We are given the differential equation
cosxdxdy+2ysinx=sin2x,0<x<2π.
First we rewrite it in the standard linear form dxdy+P(x)y=Q(x). To do so, we divide every term by cosx (which is positive in the given interval):
dxdy+2ycosxsinx=cosxsin2x.
Recalling tanx=cosxsinx and sin2x=2sinxcosx, we obtain
dxdy+2ytanx=cosx2sinxcosx=2sinx.
So the linear equation is
dxdy+2tanxy=2sinx,
with P(x)=2tanx and Q(x)=2sinx.
For a linear first-order ODE, the integrating factor is given by the formula
I.F.=e∫P(x)dx.
We compute it step by step:
∫P(x)dx=∫2tanxdx=2∫tanxdx=2(−ln∣cosx∣)=−2ln(cosx).
Hence
I.F.=e−2ln(cosx)=(cosx)−2=sec2x.
Multiplying the whole differential equation by this integrating factor, we have
sec2xdxdy+2tanxsec2xy=2sinxsec2x.
By construction of the integrating factor, the left side is the derivative of the product ysec2x. Indeed,
dxd(ysec2x)=sec2xdxdy+ydxd(sec2x),
and since dxd(sec2x)=2tanxsec2x, the two expressions match. Therefore
dxd(ysec2x)=2sinxsec2x.
We now integrate both sides with respect to x:
ysec2x=∫2sinxsec2xdx+C,
where C is the constant of integration. To evaluate the integral, we write it out explicitly:
∫2sinxsec2xdx=∫2cos2xsinxdx.
Let us set u=cosx so that du=−sinxdx, or equivalently −du=sinxdx. Substituting, we get
∫2cos2xsinxdx=2∫u2−du=−2∫u−2du.
Because ∫u−2du=−u−1, the integral becomes
−2(−u−1)=2u−1=u2=cosx2=2secx.
Thus we have obtained
ysec2x=2secx+C.
To isolate y we multiply both sides by cos2x (which equals 1/sec2x):
y=2secxcos2x+Ccos2x.
Because secxcos2x=cosx1⋅cos2x=cosx, this simplifies neatly:
y=2cosx+Ccos2x.
Now we apply the initial condition y(3π)=0. We know cos(3π)=21, so
0=2cos(3π)+Ccos2(3π)=2(21)+C(21)2=1+4C.
Solving for C, we get
1+4C=0⟹4C=−1⟹C=−4.
Substituting this value back, the explicit solution becomes
y=2cosx−4cos2x.
Finally we calculate y(4π). We recall cos(4π)=22=21 and hence cos2(4π)=21. Therefore
y(4π)=2cos(4π)−4cos2(4π)=2(21)−4(21)=22−2=2−2.
Hence, the correct answer is Option C.