Tutorials › Calculus II › Polynomial-Weighted Logarithms Of Quadratics

Integration by Parts I · Tutorial 39 of 998

Polynomial-Weighted Logarithms Of Quadratics

Use integration by parts and a substitution to evaluate \( \int x\ln(1+x^2)\,dx \), with checks that make the method and its conditions clear.

Beginner 8 min read

What You'll Learn

  • Choose the logarithm and polynomial factors for integration by parts.
  • Recognize when the remaining integral calls for substitution.
  • Simplify a polynomial divided by a quadratic before integrating.
  • State where a logarithm-of-a-quadratic antiderivative is valid.
  • Check an antiderivative by differentiating it.

Why This Integral Needs Two Steps

Consider the integral \( \int x\ln(1+x^2)\,dx \). The factor \(x\) resembles the derivative of the expression inside the logarithm, but it is multiplied by a logarithm rather than by a function that can be integrated immediately as a direct substitution. Integration by parts moves the derivative onto the logarithm; a substitution then handles the remaining rational expression.

The method is useful beyond this one integral. In a polynomial-weighted logarithm, integrating the polynomial factor can make the logarithmic factor easier to differentiate. The resulting integral may still need algebraic simplification before it is straightforward to evaluate.

Set Up Integration by Parts

For differentiable functions \(u\) and \(v\), integration by parts follows from the product rule and takes the form

$$ \int u\,dv=uv-\int v\,du. $$

For the target integral, take \(u=\ln(1+x^2)\) and \(dv=x\,dx\). This choice is useful because \(x\,dx\) has a simple antiderivative, while differentiating the logarithm introduces a denominator that can be paired with a substitution.

Conditions: The real logarithm \(\ln(1+x^2)\) is defined for every real \(x\), since \(1+x^2>0\). The functions used in integration by parts are differentiable on \(\mathbb R\), and the resulting integrands are continuous there. The calculation therefore gives an antiderivative valid on all of \(\mathbb R\). More generally, the same reasoning applies on an interval where the logarithm's argument is positive and the functions involved are differentiable.

Differentiate and integrate the chosen factors:

$$ u=\ln(1+x^2), \qquad du=\frac{2x}{1+x^2}\,dx, \qquad dv=x\,dx, \qquad v=\frac{x^2}{2}. $$

Substituting into the formula gives

$$ \int x\ln(1+x^2)\,dx = \frac{x^2}{2}\ln(1+x^2) - \int \frac{x^3}{1+x^2}\,dx. $$

At this point, substitution alone is not the most direct move: the numerator has degree three, while the denominator has degree two. First simplify the fraction by division:

$$ \frac{x^3}{1+x^2} = x-\frac{x}{1+x^2}, $$

because \(x(1+x^2)-x=x^3\). The remaining logarithmic term now has the form suited to a substitution.

Worked Example: The Target Integral

Worked Example: \( \int x\ln(1+x^2)\,dx \)

Apply integration by parts with \(u=\ln(1+x^2)\) and \(dv=x\,dx\). Then \(du=\frac{2x}{1+x^2}\,dx\), and \(v=\frac{x^2}{2}\). Thus

$$ \int x\ln(1+x^2)\,dx = \frac{x^2}{2}\ln(1+x^2) - \int\frac{x^3}{1+x^2}\,dx. $$

Rewrite the fraction and split the integral:

$$ \frac{x^3}{1+x^2}=x-\frac{x}{1+x^2}, \qquad \int\frac{x^3}{1+x^2}\,dx = \int x\,dx-\int\frac{x}{1+x^2}\,dx. $$

For the second integral, let \(t=1+x^2\). Then \(dt=2x\,dx\), so \(x\,dx=\frac12\,dt\). Therefore

$$ \int\frac{x}{1+x^2}\,dx = \frac12\int\frac{1}{t}\,dt = \frac12\ln|t| = \frac12\ln(1+x^2). $$

The absolute value can be removed because \(1+x^2>0\) for every real \(x\). Also, \(\int x\,dx=\frac{x^2}{2}\). Combining these results gives

$$ \int\frac{x^3}{1+x^2}\,dx = \frac{x^2}{2}-\frac12\ln(1+x^2). $$

Substitute this expression back into the integration-by-parts result and collect terms:

$$ \int x\ln(1+x^2)\,dx = \frac{x^2}{2}\ln(1+x^2) -\frac{x^2}{2} +\frac12\ln(1+x^2)+C = \frac12\left((1+x^2)\ln(1+x^2)-x^2\right)+C. $$

To check, differentiate the expression without \(C\):

$$ \begin{aligned} \frac{d}{dx}\left[\frac12\left((1+x^2)\ln(1+x^2)-x^2\right)\right] &=x\ln(1+x^2)+\frac12(1+x^2)\frac{2x}{1+x^2}-x\\ &=x\ln(1+x^2)+x-x\\ &=x\ln(1+x^2). \end{aligned} $$

The derivative is the original integrand, as required.

Why the Two-Step Method Works

Integration by parts is the product rule rearranged. In differential form, the product rule says \(d(uv)=u\,dv+v\,du\). Integrating both sides gives \(uv=\int u\,dv+\int v\,du\), and rearranging yields the integration-by-parts formula. In this problem, the product-rule rearrangement transfers differentiation from the polynomial antiderivative \(x^2/2\) to the logarithm. The resulting factor \(x/(1+x^2)\) is directly connected to the derivative of \(1+x^2\).

The substitution \(t=1+x^2\) works because \(dt=2x\,dx\). The numerator \(x\,dx\) supplies exactly the differential needed, up to the constant factor \(1/2\). This is why the residual integral simplifies after the fraction is divided first.

Result: For every \(x\in\mathbb R\), $$ \int x\ln(1+x^2)\,dx = \frac12\left((1+x^2)\ln(1+x^2)-x^2\right)+C, $$ where \(C\) is an arbitrary constant.

A Scaled Quadratic

A related integral shows how a constant in the quadratic changes the substitution without changing the strategy. Here the logarithm's argument remains positive for all real \(x\).

Worked Example: \( \int x\ln(1+4x^2)\,dx \)

Set \(u=\ln(1+4x^2)\), \(dv=x\,dx\). Then \(du=\frac{8x}{1+4x^2}\,dx\) and \(v=\frac{x^2}{2}\), so

$$ \int x\ln(1+4x^2)\,dx = \frac{x^2}{2}\ln(1+4x^2) - 4\int\frac{x^3}{1+4x^2}\,dx. $$

Let \(t=1+4x^2\). Then \(dt=8x\,dx\) and \(x^2=(t-1)/4\), hence \(x^3\,dx=(t-1)\,dt/32\). The remaining term becomes

$$ 4\int\frac{x^3}{1+4x^2}\,dx = \frac18\int\frac{t-1}{t}\,dt = \frac18\int\left(1-\frac1t\right)\,dt = \frac18\left(t-\ln t\right). $$

Substitute \(t=1+4x^2\) and collect the logarithmic terms:

$$ \begin{aligned} \int x\ln(1+4x^2)\,dx &=\frac{x^2}{2}\ln(1+4x^2)-\frac18\left(1+4x^2-\ln(1+4x^2)\right)+C\\ &=\frac18\left((1+4x^2)\ln(1+4x^2)-(1+4x^2)\right)+C. \end{aligned} $$

For verification, set \(q=1+4x^2\), so \(q'=8x\). Differentiating \(\frac18(q\ln q-q)\) gives \(\frac18(q'\ln q+q'-q')=x\ln(1+4x^2)\), the original integrand.

When the Polynomial Has Higher Degree

If the polynomial factor has higher degree, integration by parts still differentiates the logarithm, but the remaining rational expression may require polynomial division. The same basic choices work when an antiderivative of the polynomial factor is easy to find.

Worked Example: \( \int x^3\ln(1+x^2)\,dx \)

Choose \(u=\ln(1+x^2)\), \(dv=x^3\,dx\). Then \(du=\frac{2x}{1+x^2}\,dx\) and \(v=\frac{x^4}{4}\), giving

$$ \int x^3\ln(1+x^2)\,dx = \frac{x^4}{4}\ln(1+x^2) -\frac12\int\frac{x^5}{1+x^2}\,dx. $$

Divide to simplify the fraction. Indeed, \((1+x^2)(x^3-x)+x=x^5\), so

$$ \frac{x^5}{1+x^2}=x^3-x+\frac{x}{1+x^2}. $$

Integrate each term. The last integral uses \(t=1+x^2\), \(dt=2x\,dx\):

$$ \int\frac{x^5}{1+x^2}\,dx = \frac{x^4}{4}-\frac{x^2}{2}+\frac12\ln(1+x^2). $$

Substituting this result yields

$$ \int x^3\ln(1+x^2)\,dx = \frac{x^4}{4}\ln(1+x^2) -\frac{x^4}{8}+\frac{x^2}{4} -\frac14\ln(1+x^2)+C. $$

Differentiate to check. The derivative of the first term is \(x^3\ln(1+x^2)+\frac{x^5}{2(1+x^2)}\). The derivatives of the other terms are \(-x^3/2\), \(x/2\), and \(-x/[2(1+x^2)]\). Their nonlogarithmic contributions sum to zero, since

$$ \frac{x^5-x^3(1+x^2)+x(1+x^2)-x}{2(1+x^2)}=0. $$

Thus the derivative is \(x^3\ln(1+x^2)\), confirming the result.

Common Mistake: Losing the Factor from the Substitution

A frequent error is to use \(t=1+x^2\), notice \(dt=2x\,dx\), and then replace \(x\,dx\) by \(dt\) instead of by \(\frac12dt\). That loses a factor of two. For example, the incorrect step

$$ \int\frac{x}{1+x^2}\,dx \;\color{red}{=}\; \int\frac{1}{t}\,dt = \ln t $$

does not differentiate back to the original integrand: the derivative of \(\ln(1+x^2)\) is \(2x/(1+x^2)\). The correction is to carry the factor through the substitution:

$$ dt=2x\,dx \quad\Longrightarrow\quad x\,dx=\frac12dt, \qquad \int\frac{x}{1+x^2}\,dx = \frac12\ln(1+x^2)+C. $$

Checking by differentiation catches the error immediately. In the full target integral, another common slip is to put an extra factor of \(1/2\) in front of \(\int x^3/(1+x^2)\,dx\). The factor \(1/2\) in \(v=x^2/2\) is canceled by the \(2\) in \(du=2x/(1+x^2)\,dx\); the residual integral has coefficient \(1\), not \(1/2\).

Choosing the Method Reliably

For integrals of this form, it helps to keep the steps in order rather than trying substitutions on the original expression at random:

1
Identify the logarithm and polynomial.
Take the logarithm as \(u\), and choose \(dv\) as the polynomial factor times \(dx\), provided it has a simple antiderivative.
2
Apply integration by parts carefully.
Compute \(du\) by the chain rule and \(v\) by integration, then write the complete residual integral with its coefficient.
3
Simplify before substituting.
If the residual fraction has a numerator degree at least as large as the denominator degree, divide or decompose it first.
4
Use the quadratic's derivative.
When a factor \(x\,dx\) remains alongside \(1+x^2\), the substitution \(t=1+x^2\) reduces the integral to a logarithmic form.
5
Verify the final expression.
Differentiate the proposed antiderivative and confirm that every nonlogarithmic term cancels.

The key conditions are not tied to this exact quadratic. The real logarithm requires a positive argument throughout the interval being considered, and integration by parts requires differentiability and integrability of the chosen factors there. For \(1+x^2\), positivity holds everywhere; for a different quadratic, check its sign before using a real logarithm on an interval.

Check Your Understanding

Work through these questions by keeping the integration-by-parts and substitution steps separate.

  1. For \( \int x\ln(1+x^2)\,dx \), what choices of \(u\) and \(dv\) produce the residual integral \( \int x^3/(1+x^2)\,dx \)?
  2. Show by algebra that \(x^3/(1+x^2)=x-x/(1+x^2)\), then evaluate each term.
  3. In the substitution \(t=1+4x^2\), express \(x^3\,dx\) in terms of \(t\) and \(dt\).
  4. Why is \(\ln(1+x^2)\) defined for every real \(x\), and why may its logarithm be written without absolute-value bars?
  5. Differentiate \( \frac12((1+x^2)\ln(1+x^2)-x^2) \) and identify the cancellation that recovers the integrand.

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon