Question Error Report

Thank you for reporting, we will resolve it shortly

Back to Question

Q. The general solution of the differential equation $\frac{d y}{d x}-y=\cos x$ is

Differential Equations

Solution:

Given differential equation is of the form
$\frac{d y}{d x}+P y=Q \text { where } P=-1 \text { and } Q=\cos x$
Therefore, $ I F=e^{\int-1 d x}=e^{-x}$
On multiplying both sides of equation by IF, we get $e^{-x} \frac{d y}{d x}-e^{-x} y=e^{-x} \cos x$
or $\frac{d y}{d x}\left(y e^{-x}\right)=e^{-x} \cos x$
On integrating both sides w.r.t. $x$, we get
$y e^{-x}=\int e^{-x} \cos x d x+C .....$(i)
Let $ I =\int e^{-x} \cos x d x $
$ =\cos x\left(\frac{e^{-x}}{-1}\right)-\int(-\sin x)\left(-e^{-x}\right) d x$
$ =-\cos x e^{-x}-\int \sin x e^{-x} d x $
$ =-\cos x e^{-x}-\left[\sin x\left(-e^{-x}\right)-\int \cos x\left(-e^{-x}\right) d x\right]$
$=- \cos x e^{-x}+\sin x \cdot e^{-x}-\int \cos x \cdot e^{-x} d x$
$\Rightarrow I =-e^{-x} \cos x+\sin x e^{-x}-I$
$\Rightarrow 2 I =(\sin x-\cos x) e^{-x} $
$\Rightarrow I =\frac{(\sin x-\cos x) e^{-x}}{2}$
Substituting the value of $I$ in Eq. (i), we get
$y e^{-x} =\left(\frac{\sin x-\cos x}{2}\right) e^{-x}+C $
$\Rightarrow y =\left(\frac{\sin x-\cos x}{2}\right)+C e^x$
which is the general solution of the given differential equation.