# How to solve $\int\tan^3(x)\,dx$?

How to solve $\int\tan^3(x)\,dx$ ? Do I use substitution?

-
Wikipedia has a nice reference page for all of these: en.wikipedia.org/wiki/… – Eric Naslund Feb 2 '11 at 18:15
Thanks Eric, that is so useful! – xiamx Feb 2 '11 at 18:34

One standard approach to integral involving powers of tangent is the following: Rewrite your power as something times $\tan^2(x)$. In this case: $\tan^3(x)=\tan(x)\cdot\tan^2(x)$.

Now, use that $\tan^2(x)=\sec^2(x)-1$, so $$\int\tan^3(x)dx=\int\tan(x)\sec^2(x)dx-\int\tan(x)dx.$$ The first integral on the right hand side can be solved using the substitution $u=\tan(x)$, so $du=\sec^2(x)dx$ and $$\int\tan(x)\sec^2(x)dx=\int u du.$$ The second integral is $\ln|\sec x|$, and can be found writing $\tan(x)=\sin(x)/\cos(x)$ and using the substitution $v=\cos(x)$.

Note that the same idea allows you to solve $\displaystyle \int\tan^n(x) dx$ for any $n\ge 3$. For example: $$\int\tan^5(x)dx=\int\tan^3(x)\tan^2(x)dx=\int\tan^3(x)(\sec^2(x)-1)dx,$$ as before we split this last integral into two: $$\int\tan^3(x)\sec^2(x)dx-\int\tan^3(x)dx.$$ The first one is solved with the substitution $u=\tan(x)$. The second is the integral we solved before.

This, by the way, is an example of a reduction method that transforms an integral that depends on an integer parameter $n$ (in this case, $\displaystyle \int\tan^n(x)dx$) into a similar integral, but that now depends on some $m<n$. This gives us an algorithm to solve the integral by repeatedly applying the reduction procedure.

-
@Sivaram: It works for all $n$: For a typical example for even $n$: $\int\tan^4(x)dx=\int\tan^2(x)\sec^2(x)dx-\int \tan^2(x)dx=\int\tan^2(x)\sec^2(x)dx-\int\sec^2(x)dx+\int dx$. The last integral is just $x+C$, and for the other two, the substitution $u=\tan(x)$ works. – Andrés E. Caicedo Feb 2 '11 at 16:32
Oh sorry. Sorry for comment. I withdraw the previous comment. – user17762 Feb 2 '11 at 16:36

A simple way out is to write $\tan^3(x) = \frac{\sin^3(x)}{\cos^3(x)}$. Now let $\cos(x) = t$ and rewrite $\sin^2(x) = 1-t^2$.

The integral now becomes $\int \frac{\sin^3(x)}{\cos^3(x)} dx$.

$\cos(x) = t \Rightarrow -\sin(x)dx = dt$ and $\sin^2(x) = 1-t^2$.

Note the numerator of the integral $\sin^3(x) dx$ can be written as $\sin^2(x) \times \sin(x) dx = (1-t^2) (-dt) = (t^2-1) dt$

So the integral becomes $\int \frac{t^2-1}{t^3} dt = \int \frac{dt}{t} - \int \frac{dt}{t^3} = \log(t) + \frac{1}{2t^2} = \log(\cos(x)) + \frac{1}{2 \cos^2(x)} = \log(\cos(x)) + \frac{\sec^2(x)}{2}$

-
I like this method a lot! – frogeyedpeas Jul 17 '14 at 18:21

HINT: Rewrite your integral in this form:

\begin{align*} \int\tan^{3}{x} \ dx & = \int (\sec^{2}{x}-1) \cdot \tan{x} \ dx \\ &= \int \sec^{2}{x} \cdot \tan{x} \ dx - \int \tan{x} \ dx \\ &= \int \sec{x} \cdot (\sec{x}\tan{x}) \ dx - \int \tan{x} \ dx \end{align*}

-