Integral of 1/(x2 + 1)

We wish to prove:

    \[  \int \frac{1}{x^2 + 1}\,dx = \arctan(x) + C \quad \text{(1)} \]

We begin by using partial fraction decomposition to re-express the integrand:

    \begin{align*}  \int \frac{1}{x^2 + 1}\,dx &= \int \frac{1}{(x-i)(x+i)}\, dx \quad \text{(2)} \\   &= \int \left[\frac{\displaystyle \frac{1}{2i}}{x-i} + \frac{\displaystyle \frac{-1}{2i}}{x+i}\right]\,dx \quad \text{(3)}  \end{align*}

(To see how we came to eq. (3), click .)

    \begin{align*}    \int \frac{1}{x^2 + 1}\,dx &= \frac{1}{2i}\int \left( \frac{1}{x-i} + \frac{1}{x+i} \right)\,dx \\ &= \frac{1}{2i}\left[\ln(x-i)-\ln(x+i)\right] + C_1\quad \text{(4)} \end{align*}

The next step is to change to polar coordinates. To see how to do this, click .

Therefore:

    \begin{align*} \int \frac{1}{x^2 + 1}\,dx &= \frac{1}{2i} [\, \ln(\sqrt{x^2 + (-1)^2}\,e^{\displaystyle i\cdot \arctan(-1/x)}) \\& - \ln(\sqrt{x^2 + (-1)^2}\,e^{\displaystyle i\cdot \arctan(1/x)})\,]+C_1 \\ \\ &= \frac{1}{2i}[\, \cancel{\ln(\sqrt{x^2 + 1})} + \ln(e^{\displaystyle i\cdot \arctan(-1/x)})\\ &- \cancel{\ln(x^2 + 1)} - \ln(e^{\displaystyle i\cdot \arctan(1/x)}) \,] + C_1 \\ &= \frac{1}{2i}\left[ -i\arctan(\frac{1}{x}) - i\arctan(\frac{1}{x}) \right] + C_1\\ &= -\arctan(\frac{1}{x}) + C_1 \quad \text{(5)}\end{align*}

At this point, we need to use the identity:

    \[ \arctan(x) + \arctan(\frac{1}{x}) = \frac{\pi}{2}\quad \text{(6)}  \]

To see where this comes from, click .

Rearranging eq. (6), we get:

    \[  -\arctan(\frac{1}{x}) = \arctan(x) -  \frac{\pi}{2} \quad \text{(7)}   \]

Now we substitute this into eq.(5):

    \begin{align*} \int \frac{1}{x^2 + 1}\,dx  &=  -\arctan(\frac{1}{x}) + C_1 \\ &= \arctan(x) - \frac{\pi}{2} + C_1  \quad \text{(8)}  \end{align*}

Let

    \[  - \frac{\pi}{2} + C_1 = C  \quad \text{(9)}  \]

Then:

    \[ \int \frac{1}{x^2 + 1}\,dx = \arctan(x) + C  \quad \text{(10)}  \]