I am trying to determine a closed form expression of the integral $I_n := \int_0^\infty \frac{1}{(x^2+1)^n}dx$, where $n \in \mathbb{N}$. I'd like to use residue calculus to solve this problem. I have come up with the following:
Let $f_n(x) := \frac{1}{(x^2+1)^n}$. Since $f_n$ is an even function, we have $$ 2I_n = \int_\mathbb{R}\frac{1}{(x^2+1)^n}dx. $$ Next, consider the function $f_n$ with a complex argument $z \in \mathbb{C}$. This gives us $$ f_n(z) = \frac{1}{(z^2+1)^n} = \frac{1}{(z+i)^n(z-i)^n}. $$ Let $r>0$, $t \in [0,\pi]$ and define the contour $\Gamma := [-r,r] \cup \gamma_r$, i.e. $\Gamma$ consists of the straight line from $-r$ to $r$ along the real axis, and then the half circle $\gamma_r$ (counterclockwise, with radius $r$) from $r$ to $-r$, i.e. $\gamma_r(t) := re^{it}$. Then, by the residue theorem: $$ \oint_\Gamma f_n(z)\,dz = \int_{-r}^rf_n(z)\,dz + \int_{\gamma_r}f_n(z)\,dz = 2\pi i \text{Res}(f_n,i), $$ since $i$ lies within the contour $\Gamma$. We see that $\lim_{r\to\infty}\int_{\gamma_r}f_n(z)\,dz = 0$, since \begin{align} \left|\int_{\gamma_r}f_n(z)\,dz\right| &= \left| \int_0^\pi f_n(\gamma_r(t))\gamma_r'(t)\,dt \right|\\ &= \left| \int_0^\pi \frac{rie^{it}}{(r^2e^{2it}+1)^n}dt \right|\\ &\leq r \int_0^\pi \frac{1}{|r^2e^{2it}+1|^n}dt\\ &\leq r \int_0^\pi \frac{1}{|r^2-1|^n}dt = \frac{\pi r}{|r^2-1|^n} \xrightarrow{\;r \to \infty\;} 0. \end{align} Hence, we get that $$ 2I_n = \lim_{r\to\infty}\oint_\Gamma f_n(z)\,dz = 2\pi i \text{Res}(f_n,i) \implies I_n = \pi i \text{Res}(f_n,i). $$ Now, we calculate $\text{Res}(f_n,i)$. Since $i$ is a pole of order $n$ of $f_n$, we can write $$ \text{Res}(f_n,i) = \frac{1}{(n-1)!}\lim_{z\to i} \frac{\partial^{n-1}}{\partial z^{n-1}}[(z-i)^nf_n(z)] = \frac{1}{(n-1)!}\lim_{z\to i} \frac{\partial^{n-1}}{\partial z^{n-1}} \left[ \frac{1}{(z+i)^n} \right]. $$ Then, we see that \begin{align} \frac{\partial^{n-1}}{\partial z^{n-1}} \left[ \frac{1}{(z+i)^n} \right] &= n(n+1)(n+2)\cdots(2n-3)(2n-2)\frac{p(n-1)}{(z+i)^{2n-1}} \qquad\qquad (*) \end{align} where $p$ denotes the "parity-function" defined by $$ p : \mathbb{N} \to \{-1,1\}, \qquad n \mapsto \begin{cases} 1 & n \text{ even}\\ -1 & n \text{ odd} \end{cases}. $$ Then, we get \begin{align} \frac{1}{(n-1)!}n(n+1)(n+2)\cdots(2n-3)(2n-2)\frac{p(n-1)}{(z+i)^{2n-1}} =\frac{(2n-2)!}{((n-1)!)^2}\frac{z+i}{(z+i)^{2n}}p(n-1), \end{align} and finally, by letting $z \to i$, we obtain $$ \text{Res}(f_n,i) = \frac{(2n-2)!}{((n-1)!)^2}\frac{2i}{(2i)^{2n}}p(n-1) = -\frac{(2n-2)!}{((n-1)!)^2}\frac{2i}{4^n}, $$ where the last equality follows from comparing the signs of $p(n-1)$ and $(2i)^{2n} = (-4)^n$ for different $n \in \mathbb{N}$. Since $I_n = \pi i \text{Res}(f_n,i)$, we get $$ I_n = \frac{(2n-2)!}{((n-1)!)^2}\frac{2\pi}{4^n}. $$ My questions are:
- Is this formula for $I_n$ correct? Are there any flaws in my proof?
- I'm not sure that equation $(*)$ is correct. I simply calculated the derivative for $n=1,2, 3$ and then loosely used an inductive argument for the general case. Is there a mistake here?