# Linear Differential Equation (Part-1) | S N De

Solve:

$~1.~~\frac{dy}{dx}-\frac{2}{x+1}y=(x+1)^3$

Sol. $~~~\frac{dy}{dx}-\frac{2}{x+1}y=(x+1)^3\rightarrow(1)$ and it is of the form of $~\frac{dy}{dx}+Py=Q,~$ where $~P=-\frac{2}{x+1},~Q=(x+1)^3.$

Now, $~\displaystyle\int{P~dx}\\=-2\displaystyle\int{\frac{dx}{x+1}}\\=-2\log(x+1)\\=\log(x+1)^{-2}$

$~\therefore~\text{I.F.}=e^{\displaystyle\int{P~dx}}\\~~~~~~~~~~~~~=e^{\log(x+1)^{-2}}\\~~~~~~~~~~~~~=(x+1)^{-2}\\~~~~~~~~~~~~~=\frac{1}{(x+1)^2}$

Now, multiplying both sides of $\,(1)\,$ by $~\frac{1}{(x+1)^2}~$ we get,

$~~~\frac{1}{(x+1)^2}~\frac{dy}{dx}-\frac{2}{(x+1)^3}y=x+1\\ \text{or,}~~ \frac{d}{dx}\left(\frac{1}{(x+1)^2}y\right)=x+1 \\ \therefore \frac{y}{(x+1)^2}=\displaystyle\int{(x+1)~dx}\\ \text{or,}~~\frac{y}{(x+1)^2}=\frac{(x+1)^2}{2}+c_1\\~~~[~c_1\rightarrow \text{constant of integration.}]\\ \text{or,}~~2y=(x+1)^4+2c_1(x+1)^2 \\ \text{or,}~~2y=(x+1)^4+c(x+1)^2~~\text{(ans.)}\\~~~~[\text{where}~~~c=2c_1]$

$~2.~~\frac{dy}{dx}-y\tan x=-2\sin x$

Sol. $~~\frac{dy}{dx}-y\tan x=-2\sin x \rightarrow(1)~$ and it is of the form of $~\frac{dy}{dx}+Py=Q,~$ where $~P=-\tan x,~Q=-2\sin x.$

Now, $~\displaystyle\int{P~dx}\\=-\displaystyle\int{\tan x~dx}\\=-\log(\sec x)\\=\log(\sec x)^{-1}$

$~\therefore~\text{I.F.}=e^{\displaystyle\int{P~dx}}\\~~~~~~~~~~~~~=e^{\log(\sec x)^{-1}}\\~~~~~~~~~~~~~=(\sec x)^{-1}\\~~~~~~~~~~~~~=\cos x$

Now, multiplying both sides of $\,(1)\,$ by $~\cos x~$ we get,

$~~\cos x~\frac{dy}{dx}-y\tan x \cdot \cos x=-2\sin x\cos x \\ \therefore \cos x\frac{dy}{dx}-y\sin x=-\sin 2x \\ \text{or,}~~ \frac{d}{dx}(y\cos x)=-\sin2x \\ \therefore y\cos x=-\displaystyle\int{\sin2x~dx} \\ \text{or,}~~ y\cos x=\frac 12\cos 2x+c~~\text{(ans.)}$

$~3.~~\frac{dy}{dx}+y\cot x=2\cos x$

Sol. $~~~\frac{dy}{dx}+y\cot x=2\cos x \rightarrow(1)~$  and it is of the form of $~\frac{dy}{dx}+Py=Q,~$ where $~P=\cot x,~Q=2\cos x.$

Now, $~\displaystyle\int{P~dx}\\=\int{\cot x~dx}\\=\log(\sin x)$

$~\therefore~\text{I.F.}=e^{\int{P~dx}}\\~~~~~~~~~~~~~=e^{\log(\sin x)}\\~~~~~~~~~~~~~=\sin x$

Now, multiplying both sides of $\,(1)\,$ by $~\sin x~$ we get,

$~~\sin x~\frac{dy}{dx}+y\cos x=2\cos x\sin x \\ \text{or,}~~\frac{d}{dx}(y\sin x)=\sin2x \\ \therefore y\sin x=\displaystyle\int{\sin2x~dx} \\ \text{or,}~~y\sin x=-\frac 12\cos 2x+c~~\text{(ans.)}$

$~4.~~(x-x^3)~\frac{dy}{dx}+(2x^2-1)y=ax^3$

Sol. $~~(x-x^3)~\frac{dy}{dx}+(2x^2-1)y=ax^3 \\ \text{or,}~~\frac{dy}{dx}+\frac{2x^2-1}{x-x^3}~y=a \cdot \frac{x^3}{x-x^3} \rightarrow(1)~$ and it is of the form of $~\frac{dy}{dx}+Py=Q,~$ where $~P=-\frac{2}{x+1},~Q=(x+1)^3.$

At first, we calculate the following:

$~~~~~~~\frac{2x^2-1}{x-x^3}\\=-\frac{1-2x^2}{x(1-x^2)}\\=-\frac{(1-x^2)-x^2}{x(1-x^2)}\\=-\left[\frac{1}{x}-\frac 12 \cdot \frac{2x}{1-x^2}\right]\\=-\left[\frac 1x-\frac 12\cdot \frac{(1+x)-(1-x)}{(1+x)(1-x)}\right]\\=-\frac 1x+\frac 12\left(\frac{1}{1-x}-\frac{1}{1+x}\right)\rightarrow(2)$

Now, $~\displaystyle\int{P~dx}\\=\displaystyle\int{\frac{2x^2-1}{x-x^3}~dx}~~\\=-\displaystyle\int{\frac{dx}{x}}+\frac 12 \int{\frac{dx}{1-x}}-\frac 12 \int{\frac{dx}{1+x}}\\~~~~~~~~[\text{By (2)}]\\=-\log x-\frac 12\log(1-x)-\frac 12\log(1+x)\\=-\frac 12[2\log x+\log(1-x)+\log(1+x)]\\=-\frac 12[\log x^2+\log\{(1-x)(1+x)\}]\\=-\frac 12[\log x^2+\log(1-x^2)]\\=-\frac 12[\log\{x^2(1-x^2)\}]\\=\log [x^2(1-x^2)]^{-1/2}$

$~\therefore~\text{I.F.}=e^{\int{P~dx}}\\~~~~~~~~~~~~~=e^{\log [x^2(1-x^2)]^{-1/2}}\\~~~~~~~~~~~~~=\frac{1}{x\sqrt{1-x^2}}$

Now, multiplying both sides of $\,(1)\,$ by $~\frac{1}{x\sqrt{1-x^2}}~$ we get,

$~\frac{1}{x\sqrt{1-x^2}} \cdot \frac{dy}{dx}+\frac{2x^2-1}{x-x^3}\cdot \frac{1}{x\sqrt{1-x^2}}y\\~~~~~~=a \frac{x^3}{x-x^3}\cdot \frac{1}{x\sqrt{1-x^2}} \\ \Rightarrow \frac{1}{x\sqrt{1-x^2}} \cdot\frac{dy}{dx}+\frac{2x^2-1}{x^2(1-x^2)^{3/2}}y=\frac{ax}{(1-x^2)^{3/2}} \\ \Rightarrow \frac{d}{dx}\left(y \cdot \frac{1}{x\sqrt{1-x^2}}\right)=\frac{ax}{(1-x^2)^{3/2}} \\ \therefore y \cdot \frac{1}{x\sqrt{1-x^2}}=a \displaystyle \int{\frac{1}{(1-x^2)^{3/2}}~dx} \rightarrow(3)$

Now, let $~I=\displaystyle \int{\frac{1}{(1-x^2)^{3/2}}~dx} \\~~~~=\int{\frac{-p~dp}{p^3}}\\~~[~~\text{Suppose}~~~1-x^2=p^2 \\ ~~~~~~~~~~\Rightarrow -2x~dx=2p~dp\\ ~~~~~~~~~~\therefore x~dx=-p~dp] \\~~~~=-\int{\frac{dp}{p^2}} \\~~~~= -\int{p^{-2}~dp}\\~~~~= -\left(\frac{p^{-2+1}}{(-2+1)}\right)\\~~~~= p^{-1}\\~~~~=\frac 1p\\~~~~=\frac{1}{\sqrt{1-x^2}} \rightarrow(4)$

So, from $\,(3)\,$ and $\,(4)\,$ we get,

$~~y \cdot \frac{1}{x\sqrt{1-x^2}} =\frac{a}{\sqrt{1-x^2}}+c \\ \Rightarrow y=ax+cx\sqrt{1-x^2}~~\text{(ans.)}$

$~5.~~\frac{dy}{dx}-y\tan x=e^x$

Sol. $~~~\frac{dy}{dx}-y\tan x=e^x \rightarrow(1)$

The integrating factor(I.F.) of $\,(1)$

$=e^{\int{(-\tan x)~dx}}\\=e^{-\log \sec x}\\=e^{\log (\sec x)^{-1}}\\=e^{\log \cos x}\\=\cos x$

Now, multiplying both sides of $\,(1)\,$ by $~\cos x~$ we get,

$~~~~\cos x\frac{dy}{dx}-y\sin x=e^x\cos x \\ \text{or,}~~ \frac{d}{dx}(y\cos x)=e^x \cos x \\ \text{or,}~~ y\cos x=\displaystyle\int{e^x \cos x~dx} \\ \text{or,}~~ y\cos x=\frac{e^x}{2}(\cos x+\sin x)+c~~\text{(ans)}~~[*]$

Note[*] : $~~I=\displaystyle\int{e^x \cos x~dx} \\~~~~=\cos x\displaystyle\int{e^x~dx}\\-\displaystyle\int{\left[\left\{\frac{d}{dx}(\cos x)\right\}\int{e^x~dx}\right]~dx}\\~~~~=\cos x (e^x)-\displaystyle\int{(-\sin x)e^x~dx}\\~~~~=e^x\cos x+\int{e^x\sin x~dx}\\~~~~=e^x \cos x+\sin x\int{e^x~dx}\\-\displaystyle\int{\left[\left\{\frac{d}{dx}(\sin x)\right\}\displaystyle\int{e^x~dx}\right]~dx}\\~~~~=e^x\cos x+e^x \sin x\\-\displaystyle\int{e^x\cos x~dx}\\~~~~=e^x(\cos x+\sin x)-I \\ \Rightarrow 2I=e^x(\sin x+\cos x) \\ \Rightarrow I=\frac{e^x}{2}(\sin x+\cos x)$

$~6.~~(x^2+1)~\frac{dy}{dx}+2xy=4x^2$

Sol. $~~~(x^2+1)~\frac{dy}{dx}+2xy=4x^2 \\ \text{or,}~~ \frac{dy}{dx}+\left(\frac{2xy}{x^2+1}\right)~y=\frac{4x^2}{x^2+1} \rightarrow(1)$

Integrating factor (I.F.) of $\,(1)$

$=e^{\displaystyle\int{\frac{2x}{1+x^2}}~dx}\\=e^{\log(x^2+1)}\\=x^2+1$

Now, multiplying both sides of $\,(1)\,$ by $~(x^2+1)~$ we get,

$~~~(x^2+1)~\frac{dy}{dx}+2xy=4x^2 \\ \text{or,}~~ \frac{d}{dx}\left[y(x^2+1)\right]=4x^2 \\ \therefore y(x^2+1)=\displaystyle\int{4x^2~dx} \\ \text{or,}~~y(x^2+1)=\frac 43 x^4+c \\ \text{or,}~~ 3(x^2+1)y=4x^3+k\\~~[\text{where}~~k=3c,~~c \rightarrow \text{constant of integration.}]$

$~7.~~x~\frac{dy}{dx}+2y=\log x$

Sol. $~~~x~\frac{dy}{dx}+2y=\log x \\ \text{or,}~~ \frac{dy}{dx}+\frac 2x~y=\frac 1x\log x\rightarrow(1)$

I.F. of $\,(1)$

$=e^{\displaystyle\int{\frac 2x}~dx}\\=e^{2\log x}\\=e^{\log x^2}\\=x^2$

Now, multiplying both sides of $\,(1)\,$ by $~x^2~$ we get,

$~x^2~\frac{dy}{dx}+2xy=x\log x \\ \text{or,}~~ \frac{d}{dx}(yx^2)=x\log x \\ \therefore ~yx^2=\displaystyle\int{x\log x~dx}+c \\ \text{or,}~~yx^2=\log x \cdot \frac{x^2}{2}-\displaystyle\int{\frac{1}{x} \cdot \frac{x^2}{2}~dx }+c \\ \text{or,}~~yx^2=\frac{x^2}{2} \cdot \log x-\frac 12\displaystyle \int{x~dx}+c \\ \text{or,}~~ yx^2=\frac{x^2}{2}~\cdot \log x-\frac 12 \cdot \frac{x^2}{2}+c \\ \text{or,}~~ yx^2=\frac{x^2}{2}\log x-\frac{x^2}{4}+c~~\text{(ans.)}\\~~[~c \rightarrow \text{constant of integration.}$