Answer
$$\int \tan ^{k} x d x =\frac{\tan^{k-1}}{k-1}- \int \tan ^{k-2} x d x $$
Work Step by Step
\begin{aligned}
\int \tan ^{k} x d x &=\int \tan ^{k-2} x \tan ^{2} x d x \\ &=\int \tan ^{k-2} x\left(\sec ^{2} x-1\right) d x \\
&=\int \tan ^{k-2} x \sec ^{2} x d x-\int \tan ^{k-2} x d x \\
&=\frac{\tan^{k-1}}{k-1}- \int \tan ^{k-2} x d x
\end{aligned}