Solution:
Key idea: We divide the numerator and the denominator by cos4x so that everything is in tanx and sec2x. The substitution tanx=t, and then t2=u, gives the standard form ∫1+u2du=tan−1u+C. The answer holds on any interval where cosx=0.
Step 1 — Write sin2x as a product.
We use the double-angle formula so that the numerator has the factors sinx and cosx.
sin2x=2sinxcosx
Step 2 — Divide by cos4x.
In the numerator, cos4x2sinxcosx=2tanxsec2x. In the denominator, cos4xsin4x+cos4x=tan4x+1.
sin4x+cos4xsin2x=tan4x+12tanxsec2x
Step 3 — Substitute tanx=t.
We put tanx=t, so sec2xdx=dt.
I=∫t4+12tdt
Step 4 — Substitute t2=u.
The numerator 2tdt is exactly du when u=t2, and t4=u2.
I=∫1+u2du
I=tan−1u+C
Step 5 — Return to x.
We put back u=t2 and t=tanx.
I=tan−1(t2)+C
I=tan−1(tan2x)+C
Step 6 — Check by differentiating.
By the chain rule, dxdtan−1(tan2x)=1+tan4x2tanxsec2x. Multiplying the top and the bottom by cos4x gives back sin4x+cos4xsin2x.
Therefore, ∫sin4x+cos4xsin2xdx=tan−1(tan2x)+C.