Solving trig antiderivatives usually involves breaking the integral down to apply Pythagorean Identities, and them using a u-substitution. That's exactly what we'll do here.
Begin by rewriting ∫tan4xdx as ∫tan2xtan2xdx. Now we can apply the Pythagorean Identity tan2x+1=sec2x, or tan2x=sec2x−1:
∫tan2xtan2xdx=∫(sec2x−1)tan2xdx
Distributing the tan2x:
XX=∫sec2xtan2x−tan2xdx
Applying the sum rule:
XX=∫sec2xtan2xdx−∫tan2xdx
We'll evaluate these integrals one by one.
First Integral
This one is solved using a u-substitution:
Let u=tanx
dudx=sec2x
du=sec2xdx
Applying the substitution,
XX∫sec2xtan2xdx=∫u2du
XX=u33+C
Because u=tanx,
∫sec2xtan2xdx=tan3x3+C
Second Integral
Since we don't really know what ∫tan2xdx is by just looking at it, try applying the tan2=sec2x−1 identity again:
∫tan2xdx=∫(sec2x−1)dx
Using the sum rule, the integral boils down to:
∫sec2xdx−∫1dx
The first of these, ∫sec2xdx, is just tanx+C. The second one, the so-called "perfect integral", is simply x+C. Putting it all together, we can say:
∫tan2xdx=tanx+C−x+C
And because C+C is just another arbitrary constant, we can combine it into a general constant C:
∫tan2xdx=tanx−x+C
Combining the two results, we have:
∫tan4xdx=∫sec2xtan2xdx−∫tan2xdx=(tan3x3+C)−(tanx−x+C)=tan3x3−tanx+x+C
Again, because C+C is a constant, we can join them into one C.