Concept:
- Integrate $-\tan x\,dx$ using a direct $u = \cos x$ substitution instead of recalling the standard result $\int \tan x\, dx = \ln|\sec x|$.
Step 1: Write the equation in standard linear form.
Comparing $\frac{dy}{dx} - y\tan x = e^x$ with $\frac{dy}{dx} + Py = Q$ gives $P = -\tan x$.
Step 2: Set up the integral for the Integrating Factor.
$\text{I.F.} = e^{\int P\,dx} = e^{-\int \tan x\,dx} = e^{-\int \frac{\sin x}{\cos x}\,dx}$
Step 3: Integrate by direct substitution.
Let $u = \cos x$, so $du = -\sin x\,dx$, meaning $\sin x\,dx = -du$. Then:
$\int \frac{\sin x}{\cos x}\,dx = \int \frac{-du}{u} = -\ln|u| = -\ln|\cos x|$
So $-\int \tan x\,dx = \ln|\cos x|$.
Step 4: Simplify the exponential.
$\text{I.F.} = e^{\ln|\cos x|}$. Since the exponential and natural log cancel directly:
$\text{I.F.} = \cos x$
Final Answer: $\cos x$