Solution:
Key idea: Both 1−sin2x and 1+sin2x are perfect squares, because sin2x+cos2x=1 and sin2x=2sinxcosx. Once the square root is removed, y turns into a single tangent, which is easy to differentiate with the chain rule.
Step 1 — Write 1−sin2x and 1+sin2x as perfect squares.
We replace 1 by cos2x+sin2x and sin2x by 2sinxcosx, so that each expression becomes the square of a sum or a difference.
1−sin2x=cos2x+sin2x−2sinxcosx=(cosx−sinx)2
1+sin2x=cos2x+sin2x+2sinxcosx=(cosx+sinx)2
Step 2 — Remove the square root.
The square root of a square is the absolute value, so y=∣cosx+sinx∣∣cosx−sinx∣. We work on the interval −4π<x<4π, where cosx>∣sinx∣, so both cosx−sinx and cosx+sinx are positive and the bars can be dropped.
y=cosx+sinxcosx−sinx
Step 3 — Write y as one tangent.
On this interval cosx>0, so we may divide the numerator and the denominator by cosx. Then we write 1 as tan4π and use the formula tan(A−B)=1+tanAtanBtanA−tanB.
y=1+tanx1−tanx=1+tan4πtanxtan4π−tanx=tan(4π−x)
Step 4 — Differentiate by the chain rule.
The derivative of tanu is sec2u⋅dxdu. Here u=4π−x, so dxdu=−1.
dxdy=sec2(4π−x)⋅(−1)=−sec2(4π−x)
Step 5 — Form the required sum.
We move the sec2 term to the left-hand side, which gives exactly the expression in the question.
dxdy+sec2(4π−x)=0
Note: The result holds wherever cosx+sinxcosx−sinx is positive, for example on −4π<x<4π. Where that ratio is negative, y=−tan(4π−x) and the sign of dxdy changes.
Therefore, dxdy+sec2(4π−x)=0, as required.