Solution
Let u=tan(x).
Then x=atan(u) and dx=(atan(u))′du=u2+1du (steps can be seen »).
The integral can be rewritten as
∫tan7(x)dx=∫u2+1u7du
Since the degree of the numerator is not less than the degree of the denominator, perform polynomial long division (steps can be seen »):
∫u2+1u7du=∫(u5−u3+u−u2+1u)du
Integrate term by term:
∫(u5−u3+u−u2+1u)du=(∫udu−∫u3du+∫u5du−∫u2+1udu)
Apply the power rule ∫undu=n+1un+1 (n=−1) with n=1:
−∫u3du+∫u5du−∫u2+1udu+∫udu=−∫u3du+∫u5du−∫u2+1udu+1+1u1+1=−∫u3du+∫u5du−∫u2+1udu+(2u2)
Apply the power rule ∫undu=n+1un+1 (n=−1) with n=5:
2u2−∫u3du−∫u2+1udu+∫u5du=2u2−∫u3du−∫u2+1udu+1+5u1+5=2u2−∫u3du−∫u2+1udu+(6u6)
Apply the power rule ∫undu=n+1un+1 (n=−1) with n=3:
6u6+2u2−∫u2+1udu−∫u3du=6u6+2u2−∫u2+1udu−1+3u1+3=6u6+2u2−∫u2+1udu−(4u4)
Let v=u2+1.
Then dv=(u2+1)′du=2udu (steps can be seen »), and we have that udu=2dv.
Therefore,
6u6−4u4+2u2−∫u2+1udu=6u6−4u4+2u2−∫2v1dv
Apply the constant multiple rule ∫cf(v)dv=c∫f(v)dv with c=21 and f(v)=v1:
6u6−4u4+2u2−∫2v1dv=6u6−4u4+2u2−(2∫v1dv)
The integral of v1 is ∫v1dv=ln(∣v∣):
6u6−4u4+2u2−2∫v1dv=6u6−4u4+2u2−2ln(∣v∣)
Recall that v=u2+1:
6u6−4u4+2u2−2ln(∣v∣)=6u6−4u4+2u2−2ln(∣∣(u2+1)∣∣)
Recall that u=tan(x):
−2ln(1+u2)+2u2−4u4+6u6=−2ln(1+tan(x)2)+2tan(x)2−4tan(x)4+6tan(x)6
Therefore,
∫tan7(x)dx=−2ln(tan2(x)+1)+6tan6(x)−4tan4(x)+2tan2(x)
Add the constant of integration:
∫tan7(x)dx=−2ln(tan2(x)+1)+6tan6(x)−4tan4(x)+2tan2(x)+C