I am trying to compute the integral $$\int_{-\infty}^\infty \frac{x^{2n}}{(x^2 + 1)^{n + 1}}\ dx.$$ From computational evidence, it's very obvious that $$\int_{-\infty}^\infty \frac{x^{2n}}{(x^2 + 1)^{n + 1}}\ dx = \frac{\pi}{4^n} {2n \choose n}.$$ Indeed, I can prove this via the generating function for the central binomial coefficients.
However, I want to prove this via contour integration. With $f(z) = z^{2n} / (z^2 + 1)^{n + 1}$, we can integrate over the semicircle of radius $R$ in the upper half-plane. Call this contour $\gamma_R$. The integral over the arc of $\gamma_R$ goes to zero as $R \to \infty$, which leaves $$\int_{-\infty}^\infty \frac{x^{2n}}{(x^2 + 1)^{n + 1}}\ dx = 2\pi i \operatorname{res}_i f.$$ The residue of $f$ at $i$ is $g^{(n)}(i) / n!$, where $$g(z) = \frac{z^{2n}}{(z + i)^{n + 1}}.$$ Thus, we should have $$g^{(n)}(i) = \frac{-i n! {2n \choose n}}{2^{2n + 1}}.$$
How can I show that this equality holds? Or, more generally, How can I compute the residue of $f$ at $i$?
I tried using the series $$\frac{1}{(1 - z)^{n + 1}} = \sum_{k \geq 0} {k + n \choose k} z^k,$$ but couldn't really make it work.
Edit: I was asked to explain why my evaluation is "obvious." This is from using a computer algebra system to directly evaluate $g^{(n)}(i)$ for a few dozen $n$. This gives some rational expressions which, when looked up in the OEIS, suggest the closed form I have given here. Then it is a trivial matter to estimate the integral numerically and compare it for hundreds of terms.