Let's derive the reduction formula. Then you can find the integral of all
tann(x)
\(\displaystyle \L\\\int{tan^{n}(x)}dx\)
Rewrite as:
\(\displaystyle \L\\\int{tan^{n-2}tan^{2}(x)}dx\)
=\(\displaystyle \L\\\int{tan^{n-2}(sec^{2}(x)-1)}dx\)
=\(\displaystyle \L\\\int{tan^{n-2}(x)sec^{2}(x)}dx-\int{tan^{n-2}(x)}dx\)
The first integral above can be evaluated using
u=tan(x) and
du=sec2(x)dx
\(\displaystyle \L\\\int{tan^{2}(x)}dx=\int{u^{n-2}}du-\int{tan^{n-2}(x)}dx\)
=\(\displaystyle \L\\\frac{u^{n-1}}{n-1}-\int{tan^{n-2}(x)}dx\)
=\(\displaystyle \L\\\frac{1}{n-1}tan^{n-1}(x)-\int{tan^{n-2}(x)}dx\)
Which is the reduction formula for
tann(x)
If n=2, then the integral part of this is
tan0(x)=1