dydx+ycotx=2x+x2cotx
Comparing with
dydx+yP(x)=Q(x)
The integrating factor for the above integral is
IF=e∫cotx.dx
=elnsinx
=sinx.
Hence the equation can be written as
sinx.dydx+ycosx=2xsinx+x2cosx
d(y.sinx)=d(x2sinx)
Integrating both sides give us
ysinx=x2sinx+C or
y=x2+Ccosecx