© All Rights reserved @ LearnWithDash
Step-by-Step Solution
Step 1: Rewrite the given differential equation
From the question, the differential equation is:
$$
\frac{dy}{dx} = (\tan x - y)\,\sec^2 x.
$$
Rearrange it into the standard linear form:
$$
\frac{dy}{dx} + y\,\sec^2 x = \tan x\,\sec^2 x.
$$
Step 2: Identify the integrating factor (IF)
The standard form of a linear differential equation is
$$
\frac{dy}{dx} + P(x)\,y = Q(x).
$$
Here, $P(x) = \sec^2 x$ and $Q(x) = \tan x\,\sec^2 x$.
The integrating factor is given by:
$$
\text{IF} = e^{\int P(x)\,dx} = e^{\int \sec^2 x\,dx} = e^{\tan x}.
$$
Step 3: Multiply the entire differential equation by the integrating factor
Multiply both sides of
$$
\frac{dy}{dx} + y\,\sec^2 x = \tan x\,\sec^2 x
$$
by $e^{\tan x}$:
$$
e^{\tan x}\,\frac{dy}{dx} + y\,e^{\tan x}\,\sec^2 x = \tan x\,\sec^2 x\,e^{\tan x}.
$$
Notice that the left side is the derivative of $y\,e^{\tan x}$ with respect to $x$. Thus, we have:
$$
\frac{d}{dx}\Bigl(y\,e^{\tan x}\Bigr) = \tan x\,\sec^2 x\,e^{\tan x}.
$$
Step 4: Integrate both sides
Integrate with respect to $x$:
$$
y\,e^{\tan x} = \int \tan x\,\sec^2 x\,e^{\tan x}\,dx + C.
$$
Substitute $t = \tan x$, so $dt = \sec^2 x\,dx$. The integral becomes:
$$
\int \tan x\,\sec^2 x\,e^{\tan x}\,dx = \int t\,e^t\,dt.
$$
Step 5: Evaluate the integral $\int t\,e^t\,dt$
Use Integration by Parts or recall a standard result:
$$
\int t\,e^t\,dt = t\,e^t - e^t + \text{constant} = e^t\,(t - 1) + \text{constant}.
$$
Therefore,
$$
\int \tan x\,\sec^2 x\,e^{\tan x}\,dx = e^{\tan x}\,(\tan x - 1).
$$
Step 6: Write the general solution
Substituting back into our expression for $y\,e^{\tan x}$, we get:
$$
y\,e^{\tan x} = e^{\tan x}(\tan x - 1) + C.
$$
Hence,
$$
y = (\tan x - 1) + C\,e^{-\tan x}.
$$
Step 7: Apply the initial condition
The problem gives $y(0) = 0$. Since $\tan(0) = 0$, substitute $x=0$ into the general solution:
$$
0 = (0 - 1) + C\,e^{-\tan(0)} = -1 + C \times e^0 = -1 + C.
$$
Thus, $C = 1$.
Step 8: Write the particular solution
Substituting $C=1$ back into the general solution:
$$
y = (\tan x - 1) + e^{-\tan x}.
$$
Step 9: Find $y\left(-\frac{\pi}{4}\right)$
Finally, evaluate $y$ at $x = -\frac{\pi}{4}$. Recall that $\tan\left(-\frac{\pi}{4}\right) = -1$, so
$$
y\left(-\frac{\pi}{4}\right) = \bigl(\,(-1) - 1\bigr) + e^{-\tan\bigl(-\frac{\pi}{4}\bigr)}
= -2 + e^{1}
= e - 2.
$$
Answer: $e - 2$