Find the general solution for each of the following differential equations. \sec x \frac{d y}{d x}-y=\sin x
Find the general solution for each of the following differential equations. \sec x \frac{d y}{d x}-y=\sin x

Solution:

\sec x \frac{d y}{d x}-y=\sin x-\ldots(1)
General solution for the differential equation in the form of \frac{d y}{d x}+P y=Q \quad is given by,
y \cdot(I . F .)=\int Q \cdot(I . F .) d x+c
Where, integrating factor,
\text { I. } F .=e \int^{p d x}
Also,
\sec x \frac{d y}{d x}-\mathrm{y}=\sin x
Dividing above equation by sec x,
\therefore \frac{d y}{d x}-\cos x \cdot y=\sin x \cdot \cos x \ldots \ldots \ldots(2)
Equation (2) is of the form
\frac{d y}{d x}+\mathrm{Py}=\mathrm{Q}
Where, P=-\operatorname{Cos} x and Q=\operatorname{Sin} x \operatorname{Cos} x
Therefore, integrating factor is
I . F .=e \int^{p d x}=e^{-\sin x}
General solution is
\begin{array}{c} y \cdot(I . F .)=\int Q \cdot(I . F .) d x+c \\ \therefore \mathrm{y} \cdot\left(e^{-\sin x}\right)=\int(\sin x \cdot \cos x) \cdot\left(e^{\sin x}\right) \mathrm{d} \mathrm{x}+\mathrm{c} \ldots \ldots \ldots \end{array}
Let,
\mathrm{I}=\int(\sin x \cdot \cos x) \cdot\left(e^{-\sin x}\right) \mathrm{d} \mathrm{x}
Put \sin x=t=>\cos x \cdot d x=d t
\begin{array}{l} \therefore \mathrm{I}=\int e^{-t} \cdot \mathrm{t} \mathrm{dt} \\ \therefore \mathrm{I}=\mathrm{t} . \int e^{-t} \mathrm{dt}-\int\left(\frac{d}{d t}(t) \cdot \int e^{-t} \mathrm{dt}\right) \mathrm{dt} \\ \therefore \mathrm{I}=-\mathrm{t} . e^{-t}-\int\left((1) \cdot\left(-e^{-t}\right)\right) \mathrm{dt} \\ \therefore \mathrm{I}=-\mathrm{t} \cdot e^{-t}+\left(-e^{-t}\right) \end{array}
\therefore I=-\sin x \cdot e^{-\sin x}-e^{-\sin x}
Substituting I in (3),
\begin{array}{l} \therefore \mathrm{y} \cdot\left(e^{-\sin x}\right)=-\sin x \cdot e^{-\sin x}-e^{-\sin x}+\mathrm{c} \\ \therefore \mathrm{y} \cdot\left(e^{-\sin x}\right)=-e^{-\sin x}(\sin x+1)+\mathrm{c} \\ \therefore \mathrm{y} \cdot\left(e^{-\sin x}\right)=\mathrm{c}-e^{-\sin x}(\sin x+1) \end{array}
Dividing above equation by \mathrm{e}^{-\sin x}
\therefore \mathrm{y}=\frac{c}{e^{-\sin x}}-(\sin x+1)