I was playing around with integrals of $\tan x$, because I knew that both $\int\tan x\,dx$ and $\int\tan^2x\,dx$ were solvable. I then came across the fact that
$$\begin{align} \int \tan^n x\,dx &= \int \tan^{n-2}x\,(\sec^2 x - 1)\,dx \\ &= \int \tan^{n-2}x\,\sec^2 x\,dx - \int \tan^{n-2}x\,dx \\ &= \int u^{n-2}\,\,du - \int \tan^{n-2}x\,dx \\ &= \frac{1}{n-1}u^{n-1} - \int \tan^{n-2}x\,dx \\ &= \frac{1}{n-1}\tan^{n-1} x - \int \tan^{n-2}x\,dx \end{align}$$
which by a simple subtraction also meant that
$$\int \tan^n x\,dx = \frac{1}{n-1}\tan^{n-1} x - \int \tan^{n+2}x\,dx$$
so any integer power of $\tan$ could be easily integrated, including the negatives: just decompose down (or up, if $n<0$ ) until $n$ is either 0 or 1, which gave final integrals of $x + C$ and $-\ln |\cos x| + C$.
I also noted that this looked like an interesting idea for an induction problem that could be posed, the kind with a summation notation that would have to be broken up. The simplest way that I see would be the use of two sums, depending on whether $n$ was odd or even. I started with
$$\int \tan^{2k} x\,dx = (-1)^n x + \sum_{i=2}^k {\dfrac{(-1)^?}{2i-1} \tan^{2i-1}x} + C$$
but I couldn't figure out what to put for the $?$ part, and I didn't even bother tackling the $2k+1$ version.
Is there a way to salvage this? Could there be a way to express both cases with only one sum?