The correct option is C y=−cosx+2xsinx+2x2cosx+x3ln|x|−x9+cx2
The given differential equation is
y+ddx(xy)=x(sinx+ln|x|)
i.e., xdydx+2y=x(sinx+ln|x|)
⇒dydx+2xy=sinx+ln|x|⋯(i)
This is a linear differential equation
On comparing, dydx+Py=Q,
We get, P=2x & Q=sinx+ln|x|
I.F.=e∫2xdx=e2ln|x|=x2⋯(ii)
∴ Solution is given by
yx2=∫x2(sinx+ln|x|)dx+c
yx2=−x2cosx+2xsinx+2cosx+x33ln|x|−x39+c
⇒y=−cosx+2xsinx+2x2cosx+x3ln|x|−x9+cx2.