A Logarithm of a Quadratic
The function \(\ln(1+x^2)\) is defined and smooth for every real \(x\), because \(1+x^2\ge1\) is always positive. Unlike \(\ln x\), it needs no domain restriction and no absolute value. Its antiderivative is not a simple composition, so integration by parts is the natural method, exactly as for \(\ln x\). The new feature is that the derivative of the logarithm is a genuine rational function, and its integral brings in an inverse tangent.
Deriving the Antiderivative
Take \(u=\ln(1+x^2)\) and \(dv=dx\). By the chain rule, \(du=\frac{2x}{1+x^2}\,dx\), and \(v=x\). The parts formula gives
The leftover integrand has numerator and denominator of the same degree, so divide first. Since \(2x^2=2(1+x^2)-2\), we have
The integral of \(2\) is \(2x\), and the integral of \(\frac{2}{1+x^2}\) is \(2\arctan x\). Substituting back,
Notice how the pieces fit together. The logarithm term is the boundary term \(uv\). The linear term and the inverse tangent term both come from the single division step. If the division is skipped and the fraction is integrated directly, the problem looks like a logarithm or an arctangent integral but is neither, which is a common source of confusion.
Checking by Differentiation
Differentiate each term of the answer. The product rule on \(x\ln(1+x^2)\) gives \(\ln(1+x^2)+x\cdot\frac{2x}{1+x^2}\). The derivative of \(-2x\) is \(-2\), and the derivative of \(2\arctan x\) is \(\frac{2}{1+x^2}\). Adding them:
The three non-logarithmic terms add to \(2-2=0\), leaving the integrand. This check is quick enough to do on every problem.
Worked Examples
Worked Example: A Definite Integral from 0 to 1
Evaluate \(\int_0^1\ln(1+x^2)\,dx\).
Use \(F(x)=x\ln(1+x^2)-2x+2\arctan x\). At \(x=1\), \(F(1)=\ln2-2+2\cdot\frac\pi4=\ln2-2+\frac\pi2\). At \(x=0\), \(F(0)=0\). Therefore
The integrand rises from \(0\) to \(\ln2\approx0.693\), and behaves like \(x^2\) near zero, so the area should be smaller than the triangle value \(\frac{0.693}{2}\approx0.35\). The result \(0.264\) agrees.
Worked Example: A Scaled Argument
Find \(\int\ln(1+4x^2)\,dx\).
Substitute \(t=2x\), so \(dx=\frac{dt}{2}\) and \(1+4x^2=1+t^2\). Then the integral is \(\frac12\int\ln(1+t^2)\,dt=\frac12\bigl[t\ln(1+t^2)-2t+2\arctan t\bigr]+C\). Returning to \(x\):
Check: \(\frac{d}{dx}\bigl[x\ln(1+4x^2)\bigr]=\ln(1+4x^2)+\frac{8x^2}{1+4x^2}\), and \(\frac{d}{dx}\arctan(2x)=\frac{2}{1+4x^2}\). The sum of the last two with \(-2\) is \(\frac{8x^2+2}{1+4x^2}-2=0\).
Worked Example: Symmetric Limits
Evaluate \(\int_{-1}^{1}\ln(1+x^2)\,dx\).
The integrand \(\ln(1+x^2)\) is an even function, so the integral over \([-1,1]\) is twice the integral over \([0,1]\):
Using evenness avoids evaluating the antiderivative at \(x=-1\). If you do evaluate it directly, you will find \(F(-1)=-F(1)\), because \(F\) is an odd function, and the same result follows.
A Reliable Procedure
Let \(u=\ln(1+x^2)\), \(dv=dx\), so \(v=x\).
Compute \(du=\frac{2x}{1+x^2}\,dx\). Do not forget the inner derivative \(2x\).
Rewrite \(\frac{2x^2}{1+x^2}\) as \(2-\frac{2}{1+x^2}\).
Obtain \(2x-2\arctan x\) and subtract it from the boundary term.
Differentiate the final answer and confirm that the constants and fractions cancel.
Common Mistake: Omitting the Chain-Rule Factor
The most frequent error is to differentiate \(\ln(1+x^2)\) as \(\frac{1}{1+x^2}\). That omits the inner derivative \(2x\), and the leftover integral becomes \(\int\frac{x}{1+x^2}\,dx\), which equals \(\frac12\ln(1+x^2)\). The resulting answer \(x\ln(1+x^2)-\frac12\ln(1+x^2)\) contains no inverse tangent at all and fails the derivative check. Whenever the logarithm's argument is not a bare variable, remind yourself to apply the chain rule.
A second pitfall is to leave \(\frac{2x^2}{1+x^2}\) unreduced and guess an antiderivative such as \(2\arctan x\). The numerator has the same degree as the denominator, so division is required before integrating. The correct reduction produces two simple pieces, a constant and a multiple of \(\frac{1}{1+x^2}\).
Quick Reference
| Integrand | Antiderivative | Valid where |
|---|---|---|
| \(\ln x\) | \(x\ln x-x\) | \(x>0\) |
| \(\ln(1+x^2)\) | \(x\ln(1+x^2)-2x+2\arctan x\) | all real \(x\) |
| \(\ln(1+4x^2)\) | \(x\ln(1+4x^2)-2x+\arctan(2x)\) | all real \(x\) |
| \(\ln(a^2+x^2)\) | \(x\ln(a^2+x^2)-2x+2a\arctan(x/a)\) | all real \(x\), \(a>0\) |
Worked Example: A General Constant a
Find \(\int\ln(9+x^2)\,dx\).
Factor the argument as \(9+x^2=9\bigl(1+(x/3)^2\bigr)\), so that \(\ln(9+x^2)=\ln9+\ln\bigl(1+(x/3)^2\bigr)\). Integrate each part. The constant term gives \(x\ln9\). For the second term, substitute \(t=x/3\), so \(dx=3\,dt\):
Replace \(t\) by \(x/3\) and combine with \(x\ln9\). Because \(\ln9+\ln\bigl(1+x^2/9\bigr)=\ln(9+x^2)\), the logarithmic terms merge:
The coefficient \(6\) is \(2a\) with \(a=3\), which is the pattern in the last row of the table. Differentiating confirms the result: the product rule gives \(\ln(9+x^2)+\frac{2x^2}{9+x^2}\), the next term gives \(-2\), and \(6\cdot\frac{1/3}{1+x^2/9}=\frac{18}{9+x^2}\), so the three rational pieces add to \(\frac{2x^2+18}{9+x^2}-2=0\).
Geometry and Growth of the Antiderivative
The antiderivative \(F(x)=x\ln(1+x^2)-2x+2\arctan x\) is an odd function of \(x\), because each of its three terms is odd. This matches the fact that \(\ln(1+x^2)\) is even, and it explains why the integral over a symmetric interval can be computed from one side. For large \(x\), \(\ln(1+x^2)\approx2\ln x\), so the integral grows roughly like \(2x\ln x-2x\), while the arctangent term levels off at \(\pm\pi\). The area function is therefore dominated by the first two terms for large arguments, and the inverse tangent mainly corrects the behavior near the origin.
Why the Division Step Cannot Be Skipped
After integration by parts, students sometimes try to treat \(\int\frac{2x^2}{1+x^2}\,dx\) as an arctangent integral because the denominator is \(1+x^2\), or as a logarithmic integral because the numerator resembles a derivative. Neither shortcut is available: the numerator \(2x^2\) is not the derivative of \(1+x^2\), which is \(2x\), and an arctangent requires a constant numerator. The only safe move is to divide so that the fraction part has a numerator of lower degree than the denominator. That is the same principle used later in partial fractions, where improper rational functions are always divided before they are decomposed.
Relation to Probability and Applications
Integrals of \(\ln(1+x^2)\) turn up when working with the Cauchy distribution and with log-likelihood functions that have heavy tails. In those settings one often needs the total area of the log-density between two points, and the closed form above lets you evaluate it exactly rather than numerically. The inverse tangent term is the same one that appears in the Cauchy cumulative distribution function, which is a reminder that these integrals are not isolated exercises. Keeping the antiderivative at hand also gives an immediate sanity check for numerical integration routines.
When you apply the formula on a computer-algebra system, you may see the answer written with a complex logarithm or with different constants. Any such form differs from the one here by a constant, so differentiate it, or compare values at two points, to confirm agreement.
Where This Fits in the Course
This tutorial belongs to the module “Integration by Parts I”. The tutorial just before it is “Integrating Logarithms Of Affine Expressions,” and the one that follows is “Definite Logarithmic Integrals With Positive Endpoints.” The previous tutorial uses the same method for the logarithm of a linear expression; here the chain rule introduces a rational function.
Check Your Understanding
Use the derivation and examples above to answer these questions.
- Why does \(\ln(1+x^2)\) need no absolute value or domain restriction?
- Rewrite \(\frac{2x^2}{1+x^2}\) as a constant plus a fraction.
- Evaluate \(\int_0^{\sqrt3}\ln(1+x^2)\,dx\).
- Use symmetry to evaluate \(\int_{-2}^{2}\ln(1+x^2)\,dx\) in terms of the antiderivative at \(x=2\).
- Which term in the answer comes from the boundary term, and which come from the division step?