Given:
(y+1)tan2xdx+tanxdy+ydx=0
⇒[(y+1)tan2x+y]dx+tanxdy=0
⇒tanx(dxdy)+(y+1)tan2x+y=0
⇒dxdy+(1+y)tanx=−ycotx
⇒dxdy+y(tanx+cotx)=−tanx
This is a linear differential equation of the form dxdy+P(x)y=Q(x).
I.F =e∫(tanx+cotx)dx
=e∫(tanxtan2x+1)dx
=e∫(tanxsec2x)dx
=eloge∣tanx∣
=tanx(∵x∈(0,2π))
Solution is
ytanx=∫−tan2xdx+c
⇒ytanx=∫(1−sec2x)dx+c
⇒ytanx=x−tanx+c
Now,
x→0+limxy=1
⇒x→0+lim(tanxx)(x−tanx+c)=1
⇒1(0−0+c)=1⇒c=1
Then the function is
ytanx=x−tanx+1
Put x=4π,
y(4π)tan(4π)=(4π)−tan(4π)+1
⇒y(4π)=4π