# An integral evaluation

I tried my luck with Wolfram Alpha, with $p \in \mathbb{R}$

$$\int_{-\infty}^{\infty} \frac{x^p}{1+x^2} dx = \frac{1}{2} \pi ((-1)^p+1) \sec(\frac{\pi p}{2})$$ for $-1<p<1$, and doesn't exist for other $p$.

I wonder how to integrate it myself? Especially given that $(-1)^p$ may be a non-real complex number. Thanks in advance!

PS: Does Mathematica or some other (free) CAS give the process of deriving the result?

-
Check here. –  Sangchul Lee Feb 21 '12 at 13:18
@sos440: Thanks! Why does the integral exists if and only if $-1<p<1$ ? –  steveO Feb 21 '12 at 14:21
The integrand is $\approx x^{p}$ near $x = 0$. Thus if $p \leq -1$, the integral diverges. Similarly, the integrand is $\approx x^{p-2}$ near $x = \infty$. Thus if $p \geq 1$, the integral diverges. –  Sangchul Lee Feb 21 '12 at 14:46
@sos440:Thanks! Could that be formulated formally? I don't quite get why the approximations to the integrand at $x=0$ and $x=\infty$ explain? –  steveO Feb 21 '12 at 14:58
@steveO What you should think is that $\dfrac{1}{1+x^2} \sim 1$ at $x=0$, and $\dfrac{1}{1+x^2} \sim \dfrac{1}{x^2}$ at $x=\infty$ so the results are immediate. –  Pedro Tamaroff Feb 21 '12 at 23:10

Split integration over $\mathbb{R}$ into integration over $\mathbb{R}_{\geqslant 0}$ and $\mathbb{R}_{<0}$ and perform a change of variables $x \mapsto -x$ in the latter one: $$\int_{-\infty}^\infty \frac{x^p}{1+x^2} \mathrm{d} x = \left(1 + (-1)^p \right) \int_0^\infty \frac{x^p}{1+x^2} \mathrm{d} x$$ Now the idea is to reduce the integral to the Euler's beta integral. To this end perform substitution $x^2 = \frac{t}{1-t}$ so that $t$ ranges from 0 to 1. $$x \mathrm{d} x = \frac{1}{2} \cdot \frac{\mathrm{d} t}{(1-t)^2}$$ Thus $$\begin{eqnarray} 2 \int_0^\infty \frac{x^p}{1+x^2} \mathrm{d} x &=& \int_0^1 \left( \frac{t}{1-t} \right)^{(p-1)/2} \frac{1}{1+ \frac{t}{1-t}} \frac{\mathrm{d} t}{(1-t)^2} \\ &=& \int_0^1 t^{(p+1)/2 - 1} \left( 1-t \right)^{-1-(p-1)/2} \mathrm{d} t \\ &=& \operatorname{Beta}\left( \frac{p+1}{2}, \frac{1-p}{2} \right) = \frac{ \Gamma\left( \frac{1-p}{2} \right) \Gamma\left( \frac{p+1}{2}\right)}{\Gamma\left( \frac{p+1}{2} + \frac{1-p}{2} \right)} \\ &=& \frac{\pi}{ \sin\left( \pi \frac{p+1}{2} \right)} = \pi \sec\left( \frac{\pi p}{2} \right) \end{eqnarray}$$
Thanks, Sasha! Why does the integral exists if and only if $-1 < p < 1$? –  steveO Feb 21 '12 at 14:08
Consider $\int_0^\infty x^p/(1+x^2) \mathrm{d} x$. Near the origin the integrand behaves as $x^p + \mathcal{o}(x^{p})$. This is integrable is $p > -1$. For large $x$, $x^p/(1+x^2) = \frac{1}{x^{2-p}} + \mathcal{o}\left( \frac{1}{x^{2-p}} \right)$, which is integrable if $2-p > 1$. Combining these gives $-1<p<1$. –  Sasha Feb 21 '12 at 15:26