Solve ydx−xdy=x2ydx.
Given that, ydx−xdy=x2ydx
⇒1x2−1xy.dydx=1 [dividing throught by x2ydx]
⇒−1xy.dydx+1x2−1=0⇒dydx−xyx2+xy=0⇒dydx−yx+xy=0⇒dydx+(x−1x)y=0
which is a linear differential equation.
On comparing it with dydx+Py=Q, we get
P=(x−1x), Q=0IF=e∫Pdx =e∫(x−1x)dx =ex22−logx =ex2x, e−logx =1xex22
The general solution is
y.1xex2/2=∫0.1xex2/2dx+C⇒y.1xex2/2=C⇒y=Cxe−x2/2