If the general solution of the differential equation $\cos ^2 x \frac{d y}{d x}+y=\tan x$ is $y=\tan x-1+C…
If the general solution of the differential equation $\cos ^2 x \frac{d y}{d x}+y=\tan x$ is $y=\tan x-1+C e^{-\tan x}$ satisfies $y\left(\frac{\pi}{4}\right)=1$, then $C=$
e
$1$
$-1$
$\frac{1}{e}$
Solution
Given,
$\cos ^2 x \frac{d y}{d x}+y=\tan x$
$\Rightarrow \frac{d y}{d x}+y \sec ^2 x=\tan x \cdot \sec ^2 x$...(i)
Here, $p=\sec ^2 x$
$\Rightarrow \quad \int p d p=\int \sec ^2 x d x=\tan x$
$I F=e^{\tan x}$
Multiplying Eq. (i) by $I F$, we get
$e^{\tan x} \frac{d y}{d x}+e^{\tan x} y \sec ^2 x=e^{\tan x} \cdot \tan x \cdot \sec ^2 x$
Integrating both sides, we get
$y e^{\tan x}=\int e^{\tan x} \tan x \cdot \sec ^2 x d x$
On putting $\tan x=t$,
$\sec ^2 x d x=d t$
$\therefore \quad y e^t=\int t e^t d t=e^t(t-1)+C$
$\therefore \quad y e^{\tan x}=\tan x-1+C e^{-\tan x}$
If $y\left(\frac{\pi}{4}\right)=1$
$\Rightarrow \quad 1=1-1+C e^{-1} \Rightarrow 1=C e^{-1}$
$\therefore \quad C=e$