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
Now at x=π2, y=0
Hence
0=π24+C
Or
C=−π24.
Hence
y=x2−π24cosecx