devarshi-dt-logo

Question:

Solve the following differential equation: (1+x²)dy+2xy dx=cot x dx; x≠0

Solution:

(1+x²)dy+2xydx=cot xdx
This can be written as
dy/dx+P(x)y=Q(x)
and here, P(x)=2x/(1+x²), Q(x)=cot x/(1+x²)
The integrating factor(I.F)=e∫Pdx=e∫(2xdx/(1+x²))
Let x²=t, 2xdx=dt
∴I.F.=e∫dt/(1+t)=eln(1+t)=1+t=1+x²
Now, I.F. × y=∫(I.F)Q(x)dx
⇒y(1+x²)=∫(1+x²) × cot x/(1+x²)dx
⇒y(1+x²)=∫cot xdx
⇒y(1+x²)=ln|sin x|+c