Solution. We want determine the integral of \tan^3(x), i.e.,
\begin{align*} \int \tan^3(x) dx. \end{align*}
\begin{align*} \int \tan^3(x) dx = \int (\sec^2(x) - 1)\tan(x)dx = \int \sec^2(x)\tan(x)dx - \int \tan(x)dx. \end{align*}
\begin{align*} \int \sec^2(x)\tan(x)dx - \int \tan(x)dx = \int \sec^2(x)\tan(x)dx - \ln \lvert \sec(x) \rvert = \int \sec^2(x)\tan(x)dx + \ln( \lvert \cos(x) \rvert). \end{align*}
\begin{align*} \int \tan^3(x) dx &= \int \sec^2(x)\tan(x)dx - \int \tan(x)dx \\ &= \int \sec^2(x)\tan(x)dx + \ln( \lvert \cos(x) \rvert) \\ &= \int u du + \ln( \lvert \cos(x) \rvert) \\ &= \frac{1}{2} u^2 + \ln( \lvert \cos(x) \rvert) + C \\ &= \frac{1}{2} \tan^2(x) + \ln(\lvert \cos(x) \rvert) + C. \end{align*}