Calculate $\int \tan(x)dx$, $\int \tan^2(x)dx$. Give a formula to $\int \tan^n(x)dx$ in terms of $\int \tan^{n-2}(x)dx$. Use this to calculate $\int \tan^4(x)dx$, $\int \tan^5(x)dx$
I have calculated the first two integrals:
$$\int \tan(x)dx = \log(|\cos(x)|) + C$$ $$\int \tan^2(x)dx = \tan(x) -x + C$$ where $C\in \Bbb R$. But I can't see the relationship between them to obtain the formula. Could you give any hint?
Thanks in advance.
Use
$$\tan^n x = \tan^{n-2} x(\sec^2x-1) = \tan^{n-2} x(\tan x)’-\tan^{n-2}x$$
to express
$$\int \tan^{n}x dx = \int \tan^{n-2}x \>d(\tan x) -\int \tan^{n-2}xdx = \frac {\tan^{n-1} x}{n-1} - \int \tan^{n-2}xdx$$