By writing tan^n x as tan^(n-2).(sec^2 x - 1) obtain a reduction formula for Integral tan^n x dx.
$\displaystyle I_n = \int \tan^n x \, dx = \int \tan^{n-2} x \cdot (\sec^2 x - 1) \, dx$
$\displaystyle = \int \tan^{n-2} x \cdot \sec^2 x \, dx - \int \tan^{n-2} x \, dx$
therefore
$\displaystyle I_n = \int \tan^{n-2} x \sec^2 x \, dx - I_{n - 2}$
and you're expected to be able to solve the integral.