For the given differential equation find the general solution.
xdydx+y−x+xy cotx=0(x≠0)
Given, xdydx+y−x+xy cotx=0
⇒xdydx+y(1+xcotx)=x
On dividing by x both sides, we get dydx+y(1+xcotx)x=1
On comparing with the form dydx+Py=Q, we get
∴P=1+xcotxx and Q=1
∴IF=e∫Pdx=e∫(1x+cotx)dx=elogx+log|sinx|=elog(xsinx)⇒IF=xsinx (∴elogax=ax) ...(i)
The general solution of the differential equation is given by
Y.IF=∫Q×IFdx+C⇒y(xsinx)=∫xsinxdx+C⇒y(xsinx)=−xcosx+∫cosxdx+C⇒y(xsinx)=−xcosx+sinx+C⇒y=−xcosxxsinx+sinxxsinx+Cxsinx⇒y=1x−cotx+Cxsinx