We have,
dydx+2y=sinx ……. (1)
Since, P=2,Q=sinx
Integrating factor,
I.F=e∫Pdx
I.F=e∫2dx
I.F=e2x
Therefore, the general solution
y×I.F=∫Q×I.Fdx
y×e2x=∫sinx×e2xdx
We know that
∫eaxsinbxdx=eaxa2+b2(asinbx−bcosbx)+C
Thus,
y×e2x=e2x22+12(2sinx−cosx)+C
y×e2x=e2x5(2sinx−cosx)+C
Hence, this is the answer.