# How to Integrate Ln(x^2 + 1)

The natural logarithm of x^2 + 1 is a function whose graph looks like that of the simpler function y = Ln(x^2) = 2*Ln(x). For large values of x, the functions are practically indistinguishable, however, their behavior near x = 0 and negative numbers is quite divergent. The function y = 2*Ln(x) has a vertical asymptote at x = 0, and is undefined for x = 0 and negative values of x. However, the function y = Ln(x^2 + 1) has no asymptotes and is defined for all values of x. You can compare their graphs in the image below.

The functions y = Ln(x^2 + 1) and y = 2*Ln(x) are also dissimilar in their antiderivatives. The integral of 2*Ln(x) is simply

**∫ 2*Ln(x) dx** = 2x*Ln(x) - 2x + c

while that of Ln(x^2 + 1) is more complicated to extract. (See linked article for explanation of how to integrate the natural logarithm.) The integral of Ln(x^2 + 1) is also dissimilar to that of another closely related function, y = Ln(x^2 - 1). The integral of Ln(x^2 - 1) is fairly easy to find once you make the transformation Ln(x^2 - 1) = Ln(x-1) + Ln(x+1). This gives you

∫ Ln(x^2 - 1) dx

= ∫ Ln(x-1) dx + ∫ Ln(x+1) dx

= (x-1)*Ln(x-1) - (x-1) + (x+1)*Ln(x+1) - (x+1) + c

= (x-1)*Ln(x-1) + (x+1)*Ln(x+1) - 2x + c

Fortunately, the antiderivative of Ln(x^2 + 1) can be found using the technique of integration by parts, and a little algebraic to convert the resulting integral expression into a familiar integral.

## Graphs of 2*Ln(x), Ln(x^2 + 1) and Ln(x^2 - 1)

## Integrating Ln(x^2 + 1)

Recall the integration by parts formula,

∫ u * dv = uv - ∫ v * du

To find the antiderivative of Ln(x^2 + 1), we set u = Ln(x^2 + 1) and dv = dx. This produces the related equations

du = 2x/(x^2 + 1) dx

v = x

Now we can transform our original logarithmic function integral into a simpler rational function integral:

∫ Ln(x^2 + 1) dx

= x*Ln(x^2 + 1) - ∫ (2x^2)/(x^2 + 1) dx

To make this integral even simpler, we use a little algebra to come up with an equivalent expression for (2x^2)/(x^2 + 1):

(2x^2)/(x^2 + 1)

= (2x^2 + 2)/(x^2 + 1) - 2/(x^2 + 1)

= 2 - 2/(x^2 + 1)

Plugging this back into the integral equation gives us

∫ Ln(x^2 + 1) dx

= x*Ln(x^2 + 1) - ∫ 2 dx + 2*∫ 1/(x^2 + 1) dx

Since the antiderivative of 1/(x^2 + 1) is the arctangent function, we get

∫ Ln(x^2 + 1) dx

= **x*Ln(x^2 + 1) - 2x + 2*arctan(x) + c**

As you can see, this antiderivative formula is much more complicated than that of 2*Ln(x) or Ln(x^2 - 1) as it involves not only a natural log function, but also an inverse trig function.

## Summary of Integral Formulas

## Example Calculation

Find the area under the curve y = Ln(x^2 + 1) from x = 0 to x = 4.

Since we know the antiderivative of Ln(x^2 + 1), we simply need to plug the limits of integration into the integral formula and subtract. This gives us

[4*Ln(16+1) - 2*4 + 2*arctan(4)] - [0*Ln(1) - 2*0 + 2*arctan(0)]

= 5.984489

## Example 2

Solve the **separable differential equation** y' = Ln(x^2 + 1)/e^y with the initial condition y(0) = 0

First we rewrite the differential equation as

dy/dx = Ln(x^2 + 1)/e^y

Now we use the separation of variables technique to transform it into an equivalent differential expression:

e^y dy = Ln(x^2 + 1) dx

Next, we integrate both sides:

∫ e^y dy = ∫ Ln(x^2 + 1)

e^y = x*Ln(x^2+1) - 2x + 2*arctan(x) + c

Then we solve for y:

y = Ln[ x*Ln(x^2+1) - 2x + 2*arctan(x) + c ]

And finally, we plug in the initial conditions to solve for c:

0 = Ln[ 0 + c ]

1 = c

Therefore, the complete solution to the differential equation is

**y = Ln[ x*Ln(x^2+1) - 2x + 2*arctan(x) + 1 ]**