# How do you integrate Ln(1+x^2)?

Jul 17, 2016

$\int \ln \left(1 + {x}^{2}\right) \mathrm{dx} = x \ln \left(1 + {x}^{2}\right) - 2 x + \arctan \left(x\right) + C$

#### Explanation:

First, applying integration by parts, we let

$u = \ln \left(1 + {x}^{2}\right)$ and $\mathrm{dv} = \mathrm{dx}$
$\implies \mathrm{du} = \frac{2 x}{1 + {x}^{2}}$ and $v = x$

Applying the formula $\int u \mathrm{dv} = u v - \int v \mathrm{du}$, we have

$\int \ln \left(1 + {x}^{2}\right) \mathrm{dx} = x \ln \left(1 + {x}^{2}\right) - 2 \int {x}^{2} / \left(1 + {x}^{2}\right) \mathrm{dx}$

To solve the remaining integral, we will use trig substitution.

Let $x = \tan \left(\theta\right)$
$\implies \mathrm{dx} = {\sec}^{2} \left(\theta\right) d \theta$ and $\theta = \arctan \left(x\right)$

Substituting, we have

$\int {x}^{2} / \left(1 + {x}^{2}\right) \mathrm{dx} = \int {\tan}^{2} \frac{\theta}{1 + {\tan}^{2} \left(\theta\right)} {\sec}^{2} \left(\theta\right) d \theta$

$= \int {\tan}^{2} \frac{\theta}{\sec} ^ 2 \left(\theta\right) {\sec}^{2} \left(\theta\right) d \theta$

$= \int {\tan}^{2} \left(\theta\right) d \theta$

$= \int \left({\sec}^{2} \left(\theta\right) - 1\right) d \theta$

$= \int {\sec}^{2} \left(\theta\right) d \theta - \int d \theta$

$= \tan \left(\theta\right) - \theta + C$

$= x - \arctan \left(x\right) + C$

Going back to our original problem, we have

$\int \ln \left(1 + {x}^{2}\right) \mathrm{dx} = x \ln \left(1 + {x}^{2}\right) - 2 \int {x}^{2} / \left(1 + {x}^{2}\right) \mathrm{dx}$

$= x \ln \left(1 + {x}^{2}\right) - 2 \left(x - \arctan \left(x\right)\right) + C$

$= x \ln \left(1 + {x}^{2}\right) - 2 x + \arctan \left(x\right) + C$