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=$
  1. e
  2. $1$
  3. $-1$
  4. $\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$

Asked in: AP EAMCET 2022 (05 Jul Shift 1)

Practice more Differential Equations questions on Aicharya