A useful trick for integrating #tan(x)# is to use the identity #tan^2(x) = 1 + sec^2(x)#.
This is because of a general integration result it is good to be aware of. By using the substitution #u=f(x)# we can show that
#\int "f"'(x)["f"(x)]^n "d"x = ("f"(x)^(n+1))/(n+1)+C#. *
This is useful because #"d"/("d"x) tan(x) = sec^2(x)#.
#sec^2(x) = 1 + tan^2(x)# means that #tan^2(x) = sec^2(x) - 1#. Then,
So we write,
#tan^4(x) = tan^2(x)*tan^2(x)#,
#tan^4(x) = (sec^2(x)-1)*tan^2(x)#,
#tan^4(x) = -tan^2(x) + sec^2(x)tan^2(x)#.
#tan^4(x) = 1 - sec^2(x) + sec^2(x)tan^2(x)#.
Armed with the knowledge from * and the fact that #sec^2(x)# is the derivative of #tan^2(x)#, we are ready to integrate.
#\int tan^4(x) "d"x = \int 1 - sec^2(x) + sec^2(x)tan^2(x) "d"x#
#\int tan^4(x) "d"x = x - tan(x) + (tan^3(x))/3 + C#