<s>[INST] How to solve $\int\tan^3(x)\,dx$? How to solve $\int\tan^3(x)\,dx$ ? Do I use substitution?
 [/INST] 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}$
</s>