Find the general solution for each of the following differential equations. \frac{\mathrm{dy}}{\mathrm{dx}}+2 \mathrm{y} \tan \mathrm{x}=\sin \mathrm{x}
Find the general solution for each of the following differential equations. \frac{\mathrm{dy}}{\mathrm{dx}}+2 \mathrm{y} \tan \mathrm{x}=\sin \mathrm{x}

Solution:

\frac{d y}{d x}+2 y \tan x=\sin x\dots(1)
To solve (1) we will use following formula \int \tan x d x=\log _{\mid} \sec x \mid
\begin{array}{l} \operatorname{alog} \mathrm{b}=\log b^{a} \\ \operatorname{a} \log _{a^{b}}=\mathrm{b} \\ \int\left(\frac{-1}{x^{2}}\right) \mathrm{d} \mathrm{x}=\frac{1}{x} \end{array}
General solution for the differential equation in the form of \frac{d y}{d x}+\mathrm{Py}=\mathrm{Q}
is given by,
\begin{array}{l} \mathrm{y} \cdot(I . F .)=\int Q \cdot(I . F \cdot) \mathrm{d} \mathrm{x}+\mathrm{c} \\ , y .(I . F .)=\int Q \cdot(I . F .) d x+c \end{array}
Where, integrating factor, I . F .=e \int^{p d x} I . F .=e \int^{p d x}
\frac{d y}{d x}+2 \mathrm{ytan} x=\sin x \ldots \ldots \ldots .(1)
Equation (1) is of the form
\frac{d y}{d x}+\mathrm{Py}=\mathrm{Q}
Where, \mathrm{P}=2 \tan x and \mathrm{Q}=\sin x
Therefore, integrating factor is
\begin{array}{l} \text { I. } \mathrm{F}=e \int^{P d x} I . F .=e \int^{p d x} \\ =e \int^{2 \tan x d x} \\ =e^{2 \log _{\mid} \sec x} \mid \ldots \ldots\left(\because \int \tan x d x=\log \mid \sec x_{\mid}\right) \\ =e^{\log |\sec x|^{2} \ldots \ldots \ldots\left(\because a \log b=\log b^{a}\right)} \\ =\sec ^{2} x \ldots \ldots \ldots\left(\because a^{\log _{a} b}=b\right) \\ =\frac{1}{\cos ^{2} x} \end{array}
General solution is
\begin{array}{l} \text { y. }(I . F .)=\int Q \cdot(I . F .) \mathrm{d} \mathrm{x}+\mathrm{c} \\ y \cdot(I . F .)=\int Q \cdot(I . F .) d x+c \\ \therefore \mathrm{y} \cdot\left(\frac{1}{\cos ^{2} x}\right)=\int(\sin x) \cdot\left(\frac{1}{\cos ^{2} x}\right) \mathrm{d} \mathrm{x}+\mathrm{c} \ldots \ldots \ldots(2) \\ \mathrm{I}=\int(\sin x) \cdot\left(\frac{1}{\cos ^{2} x}\right) \mathrm{d} \mathrm{x} \end{array}
Put, \cos x=t=>-\sin x d x=d t
\begin{array}{l} \therefore I=\int\left(\frac{-1}{t^{2}}\right) \mathrm{dt} \\ \therefore \mathrm{I}=\frac{1}{t} \cdots \cdots \cdots\left(\because \int\left(\frac{-1}{x^{2}}\right) d x=\frac{1}{x}\right) \\ \therefore \mathrm{I}=\frac{1}{\cos x} \end{array}
Substituting I in eq(2),
\therefore \mathrm{y} \cdot\left(\frac{1}{\cos ^{2} x}\right)=\frac{1}{\cos x}+\mathrm{c}
Multiplying above equation by \cos 2 \mathrm{x},
\therefore \mathrm{y}=\cos x+\mathrm{c}\left(\cos ^{2} x\right)
Therefore, general solution is
y=\cos x+c\left(\cos ^{2} x\right)