We have the differential equation
(2+sinx)dxdy+(y+1)cosx=0.
First we isolate dxdy. Dividing both sides by (2+sinx) gives
dxdy=−2+sinx(y+1)cosx.
Now we separate the variables. Bringing all terms that involve y to the left and all terms that involve x to the right, we get
y+1dy=−2+sinxcosxdx.
The equation is now in completely separable form, so we integrate both sides:
∫y+1dy=∫−2+sinxcosxdx.
On the left we use the standard result ∫udu=ln∣u∣+C with u=y+1. Thus
∫y+1dy=ln∣y+1∣+C1.
On the right we make the substitution u=2+sinx, so du=cosxdx. Then
∫−2+sinxcosxdx=−∫udu=−ln∣u∣+C2=−ln∣2+sinx∣+C2.
Grouping the arbitrary constants into a single constant C, we can write
ln∣y+1∣=−ln∣2+sinx∣+C.
Adding ln∣2+sinx∣ to both sides gives
ln∣y+1∣+ln∣2+sinx∣=C.
Using the property lna+lnb=ln(ab), this becomes
ln(y+1)(2+sinx)=C.
Exponentiating both sides removes the logarithm:
(y+1)(2+sinx)=K,
where K=eC is a non-zero constant.
We now apply the initial condition y(0)=1. At x=0 we have sin0=0, so
(1+1)(2+0)=K⟹2×2=K⟹K=4.
Thus the relation between y and x is
(y+1)(2+sinx)=4.
Solving for y gives
y+1=2+sinx4,soy=2+sinx4−1.
We are asked to find y(2π). Substituting x=2π, we note that sin(2π)=1. Hence
y(2π)=2+14−1=34−1=31.
Hence, the correct answer is Option A.