The correct option is C y=(sinx−1)+ce−sinx.
dydx+ycosx=sinxcosx ...(1)
Here P=cosx⇒∫Pdx=∫cosxdx=sinxdx
∴I.F=esinx
Multiplying (1) by I.F, we get
esinxdydx+ycosxesinx=sinxcosxesinx
Integrating both sides w.r.t. x, we get
esinxy=∫sinxcosxesinx+c
⇒yesinx=esinx(sinx−1)+c
⇒y=(sinx−1)+ce−sinx