# How to integrate $\int \frac{dx}{(1+x^2)^2}$?

I need to integrate this to finish an old STEP problem I'm doing, but I'm stuck here, at the very end:

$$\int_0^\infty \frac{dx}{(1+x^2)^2}$$

The result should be $\pi\over 4$ . I don't know how to approach this. *Somehow, this question doesn't seem to've been posted here ever (at least I couldn't find it).

Also, Wolfram tells me:

$$\int \frac{dx}{(1+x^2)^2} = \frac{1}{2}\left(\frac{x}{x^2+1}+\tan^{-1}x\right)+c$$

but I don't see how one can derive this without knowing the result beforehand.

Somehow, this question doesn't seem to've been posted here ever (at least I couldn't find it).

EDIT: If you're interested, the problem in question is: STEP II - problem 4 (year 2014).

• use $\frac 1{(1+x^2)^2 }=\frac 1{1+x^2} - \frac{x^2}{(1+x^2)^2}$ and do an integration by parts $\int \frac{x^2}{(1+x^2)^2} \, dx$ – abel Jun 2 '16 at 18:04
• I tried $x = \sinh(z)$ since $1+x^2 = \cosh^2(x)$ but I got stuck at $$\int \frac{1}{\cosh^3(z)} \, {\rm d}z$$ – ja72 Jun 2 '16 at 18:12

Use $x = \tan t$. Then $(1 + x^2)^2 = \sec^4 t$, and $\dfrac{dx}{dt} = \sec^2 t$, so the integral becomes \begin{align*} \int_0^{\pi/2} \cos^2 t \,\mathrm dt = \dfrac 1 2 \times \dfrac {\pi} 2 = \dfrac{\pi}{4}. \end{align*}

• Nice. Thanks. It's been a while and I forgot about trig substitions :( – I want to make games Jun 2 '16 at 18:08

For any $\alpha>0$, let: $$I(\alpha)= \int_{0}^{+\infty}\frac{dx}{\alpha^2+x^2} = \frac{\pi}{2\alpha}.$$ By differentiating both sides with respect to $\alpha$ we get: $$\int_{0}^{+\infty}\frac{2\alpha}{(\alpha^2+x^2)^2}\,dx = \frac{\pi}{2\alpha^2}$$ and by evaluating at $\alpha=1$: $$\int_{0}^{+\infty}\frac{dx}{(x^2+1)^2} = \color{red}{\frac{\pi}{4}}.$$

• How do you get these expressions? – ja72 Jun 2 '16 at 18:07
• @ja72: What's obscure? I think my answer is pretty straightforward to follow. The technique is known as differentiation under the integral sign, or "Feynman's trick". – Jack D'Aurizio Jun 2 '16 at 18:08
• I'm sure that's common knowledge, but how (a very general idea would do) do you prove that differentiating an integral is the same as differentiating the thing that's integrated? – I want to make games Jun 2 '16 at 18:09
• @M.Vinay: thanks, I was just writing the same thing :) – Jack D'Aurizio Jun 2 '16 at 18:12
• @ja72: I assure you that my memorization skills are close to being awful (that is the main reason beyond my appraise for modern technology, that allow us to store tons of useful data in portable devices), but when it comes to mathematical practice, many things become natural. Practice makes perfect. – Jack D'Aurizio Jun 2 '16 at 18:20

Use $u=tan x$ $$(1+x^2)^2=(1+tan^2u)^2=(sec^2u)^2=sec^4u$$ $$dx=sec^2u du$$ The integral becomes $$\int{\frac{1}{sec^2u}du=\int{cos^2udu}}$$

• functions need to be upright characters. Use \sin instead of sin. Also the differential needs to be upright. Use {\rm d} instead of d. – ja72 Jun 2 '16 at 18:14

Add and subtract $x^2$ from the numerator, you get $\arctan$ on one hand and an $\int \frac{x^2}{(1 + x^2)^2}dx$, which you can do by parts ($u = x$ and $dv = \frac{x}{(1+x^2)^2}dx$)

$$\int_0^\infty\frac{1}{\left(1+x^2\right)^2}\space\text{d}x=\lim_{n\to\infty}\int_0^n\frac{1}{\left(1+x^2\right)^2}\space\text{d}x=$$

Substitute $x=\tan(u)$ and $\text{d}x=\sec^2(u)\space\text{d}u$.

So $\left(1+x^2\right)^2=\left(1+\tan^2(u)\right)^2=\sec^4(u)$ and $u=\arctan(x)$.

This gives a new lower bound $u=\arctan(0)=0$ and upper bound $u=\arctan(n)$:

$$\lim_{n\to\infty}\int_0^{\arctan(n)}\cos^2(u)\space\text{d}u=$$

Use:

$$\cos^2(x)=\frac{1+\cos(2u)}{2}$$

$$\frac{1}{2}\lim_{n\to\infty}\left[\int_0^{\arctan(n)}1\space\text{d}u+\int_0^{\arctan(n)}\cos(2u)\space\text{d}u\right]=$$

Substitute $s=2u$ and $\text{d}s=2\space\text{d}u$.

This gives a new lower bound $s=2\cdot0=0$ and upper bound $s=2\arctan(n)$:

$$\frac{1}{2}\lim_{n\to\infty}\left[\left[u\right]_0^{\arctan(n)}+\frac{1}{2}\int_0^{2\arctan(n)}\cos(s)\space\text{d}s\right]=$$ $$\frac{1}{2}\lim_{n\to\infty}\left[\left[u\right]_0^{\arctan(n)}+\frac{1}{2}\left[\sin(s)\right]_0^{2\arctan(n)}\right]=$$ $$\frac{1}{2}\lim_{n\to\infty}\left[\left(\arctan(n)-0\right)+\frac{\sin(2\arctan(n))-\sin(0)}{2}\right]=$$ $$\frac{1}{2}\lim_{n\to\infty}\left[\arctan(n)+\frac{\sin(2\arctan(n))}{2}\right]=\frac{1}{2}\cdot\frac{\pi}{2}=\frac{\pi}{4}$$

let $I_n=\int_{0}^{\infty}\frac{1}{(1+x^2)^n}dx$ then $$I_{n+1}=\frac{2n-1}{2n}I_n$$ we know $I_1=\int_{0}^{\infty}\frac{1}{1+x^2}dx=\frac{\pi}{2}$, so $$I_2=\frac{2(1)-1}{2(1)}I_1=\frac{\pi}{4}$$

• (+1) I see in you a future star of MSE. – Jack D'Aurizio Jun 2 '16 at 20:54

Here's a pretty solution. Notice that $$I=\int_{0}^{\infty}\frac{1}{(1+x^2)^2}dx=\frac{1}{2}\int_{-\infty}^{\infty}\frac{1}{(1+x^2)^2}dx=\frac{1}{2}\int_{\partial\Omega}\frac{1}{(1-iz)^2(1+iz)^2}dz$$ where $\Omega$ is the top part of the complex plane. Since $f(z)$ decays faster than $\frac{1}{z^2}$, $$I=\pi i \lim_{z \to i}\frac{d}{dz}\frac{(z-i)^2}{(1-iz)^2(1+iz)^2}=\frac{\pi}{4}$$.