evaluation of $\int\tan^{8}{x}dx$ Compute the indefinite integral
$$\displaystyle \int\tan^{8}{x}dx$$
My Attempt:(proposed solution)
$$\displaystyle \tan{x}=z\Rightarrow dz=(1+\tan^{2}{x})dx$$
$$\displaystyle dx=\frac{dz}{1+z^{2}}$$
$$\displaystyle z^{8}=(1+z^{2})(z^{6}-z^{4}+z^{2}-1)+1$$
$$\displaystyle \int\tan^{8}{x}dx=\int((z^{6}-z^{4}+z^{2}-1))dz+\int dx$$
$$\displaystyle =\frac{\tan^{7}{x}}{7}-\frac{\tan^{5}{x}}{5}+\frac{\tan^{3}{x}}{3}-\tan{x}+x+c$$
Thank you (I learned a lot thanks to you, thank you)
 A: Notice that :
$$\int \tan^n x \mathrm{d}x + \int \tan^{n - 2} x \mathrm{d} x = \int (1 + \tan^2 x) \tan^{n - 2} x \mathrm{d} x = \int \tan' x \tan^{n - 2} x \mathrm{d} x = \dfrac{\tan^{n - 1} x}{n - 1}$$
A: Let $X = \int \tan^8 xdx $
$\to$ $\int \tan ^ 6 x (\sec ^ 2 x - 1)d$ $= \int(\tan x)^6d(\tan x)-\int \tan^4x(\sec^2x-1)dx$
$=\tan^7x/7-\int(\tan x)^4d(\tan x)+\int \tan^2x(\sec^2x-1)dx$
$=\tan^7x/7-\tan^5x/5+\int(\tan x)^2d(\tan x)-\int \tan^2xdx$
$=\tan^7x/7-\tan^5x/5+\tan^3x/3-\int(\sec^2x-1)dx$
$\therefore X=\tan^7x/7-\tan^5x/5+\tan^3x/3-\tan x+x+C$
$\because X = \int \tan^8 xdx = \tan^7x/7-\tan^5x/5+\tan^3x/3-\tan x+x+C$
That's it. Your proposed solution is accurate.
A: $$\displaystyle \int \tan^{n}{x}dx$$
$$\displaystyle z=\tan{x}\Rightarrow dz=(1+z^{2})dz$$
$$\displaystyle z^{n}=(z^{2}+1)(z^{n-2}-z^{n-4}+z^{n-6}-z^{n-8}+...+z^{2}-1)+1$$
$$\displaystyle \int \tan^{n}{x}dx=\int(z^{n-2}-z^{n-4}+z^{n-6}-z^{n-8}+...+z^{2}-1)dz+\int dx$$
$\displaystyle \int \tan^{n}{x}dx=\frac{\tan^{n-1}{x}}{n-1}-\frac{\tan^{n-3}{x}}{n-3}+\frac{\tan^{n-5}{x}}{n-5}-\frac{\tan^{n-7}{x}}{n-7}+...+\frac{\tan^{3}{x}}{3}-\tan{x}+x+c$
