# The general solution of $\frac{dy}{dx}-y=\sin x$ is

$\begin{array}{1 1} y=2[\sin x+cos x]+ce^{-x} \\ y= \frac{1}{2} [\sin x +\cos x ]+ce^{-x} \\ y=\frac{-1}{2} [\sin x+\cos x]+ce^{-x} \\ y=\frac{1}{2} [\sin x+\cos x]+ce^{-x} \end{array}$

Toolbox:
• A linear differential equation of the form $\large\frac{dy}{dx}$$+Py=Q has general solution as ye^{\int pdx}=\int Q.e^{\int pdx}dx+c • Where e^{\int pdx} is the integral factor (I.F) • \int e^{ax}\sin bx dx=\large\frac{e^{\large ax}}{a^2+b^2}$$[a \sin bx- b \cos bx]$
Step 1:
$\large\frac{dy}{dx}$$-y=\sin x Clearly this is a linear differential equation of the form \large\frac{dy}{dx}$$+Py=Q$
Where $P=-1$ and $Q=\sin x$
$\int pdx=\int -1 dx$
$=-x$
Hence the integrating factor $(I.F)=e^{\int pdx}=e^{-x}$
Now the required solution is
$ye^{\int pdx}=\int Q.e^{\int pdx}.dx+c$
$(ie) ye^{-x}=\int \sin x (e^{-x})dx+c$
Consider $\int e^{-x} \sin x dx$
Step 2:
We know $\int e^{ax}\sin bx dx=\large\frac{e^{ax}}{a^2+b^2}$$[a \sin bx-b \cos bx] Here a=-1 and b=1 Hence \int e^{-x} \sin xdx=\large\frac{e^{-x}}{1+1}$$[(-1) \sin x-(1) \cos x]$
$=\large\frac{-e^{-x}}{2} $$[\sin x+\cos x]+c Therefore the required solution is ye^{-x}=\large\frac{-e^{-x}}{2}$$[\sin x+\cos x]+c$
Dividing throughout by $e^{-x}$
$y=\large\frac{-1}{2} $$[\sin x+\cos x]+ce^{-x} Hence the general solution of \large\frac{dy}{dx}$$-y=\sin x$ is