Tutorials › Calculus II › Worked Problems With Shifted Logarithmic Arguments

Integration by Parts I · Tutorial 49 of 998

Worked Problems With Shifted Logarithmic Arguments

Work through ∫ ln(1+x) dx and ∫ x ln(1+x) dx, using polynomial division to finish the rational integrals and derivatives to check.

Intermediate 10 min read

What You'll Learn

  • Integrate ln(1+x) by parts with a convenient choice of v.
  • Integrate x ln(1+x) and simplify x²/(1+x) by division.
  • Combine logarithm terms into a compact antiderivative.
  • Evaluate definite integrals on intervals with x > −1.
  • Verify results by differentiation.

Logarithms with a Shifted Argument

The logarithm \(\ln(1+x)\) is defined for \(x>-1\). Its derivative is the simple rational function \(\frac{1}{1+x}\), which makes it an ideal candidate for the role of \(u\) in integration by parts. This tutorial works through two problems in detail: \(\int\ln(1+x)\,dx\) and \(\int x\ln(1+x)\,dx\). Both end with a rational function that must be simplified before integration, and both are checked by differentiation.

Results: For \(x>-1\): \(\displaystyle\int\ln(1+x)\,dx=(1+x)\ln(1+x)-x+C,\) and \(\displaystyle\int x\ln(1+x)\,dx=\frac{x^2-1}{2}\ln(1+x)-\frac{x^2}{4}+\frac x2+C.\)

Deriving ∫ ln(1+x) dx

Let \(u=\ln(1+x)\) and \(dv=dx\). A convenient choice is \(v=1+x\), which differs from \(x\) by a constant. Then \(du=\frac{dx}{1+x}\) and

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

With \(v=1+x\) the fraction cancels completely, so no division step is needed. Choosing \(v=x\) instead gives \(x\ln(1+x)-\int\frac{x}{1+x}\,dx\), and then \(\frac{x}{1+x}=1-\frac{1}{1+x}\) leads to the same result \(x\ln(1+x)-x+\ln(1+x)\), because \((1+x)\ln(1+x)=x\ln(1+x)+\ln(1+x)\).

Deriving ∫ x ln(1+x) dx

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

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

The fraction \(\frac{x^2}{1+x}\) is improper. Polynomial division gives \(x^2=(x-1)(x+1)+1\), so \(\frac{x^2}{1+x}=x-1+\frac{1}{1+x}\). Integrating:

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

Therefore \(\int x\ln(1+x)\,dx=\frac{x^2}{2}\ln(1+x)-\frac{x^2}{4}+\frac x2-\frac12\ln(1+x)+C\). Collecting the logarithm terms gives the compact form \(\frac{x^2-1}{2}\ln(1+x)-\frac{x^2}{4}+\frac x2+C\).

Checking by Differentiation

For the first result: \(\frac{d}{dx}\bigl[(1+x)\ln(1+x)-x\bigr]=\ln(1+x)+1-1=\ln(1+x)\). For the second: the product rule on \(\frac{x^2-1}{2}\ln(1+x)\) gives \(x\ln(1+x)+\frac{x^2-1}{2(1+x)}=x\ln(1+x)+\frac{x-1}{2}\), because \(x^2-1=(x-1)(x+1)\). The derivative of \(-\frac{x^2}{4}+\frac x2\) is \(-\frac x2+\frac12\). The algebraic terms \(\frac{x-1}{2}-\frac{x}{2}+\frac12\) sum to zero, so only \(x\ln(1+x)\) remains.

Worked Examples

Worked Example: ln(1+x) from 0 to 1

Evaluate \(\int_0^1\ln(1+x)\,dx\).

At \(x=1\): \(2\ln2-1\). At \(x=0\): \(1\cdot0-0=0\). Hence

$$ \int_0^1\ln(1+x)\,dx=2\ln2-1\approx0.386. $$

The integrand rises from \(0\) to \(\ln2\approx0.693\); the average height is about \(0.39\), consistent with a concave curve.

Worked Example: A Clean Upper Limit e − 1

Evaluate \(\int_0^{e-1}\ln(1+x)\,dx\).

At \(x=e-1\), \(1+x=e\) and \(\ln e=1\), so \(F(e-1)=e\cdot1-(e-1)=1\). Also \(F(0)=0\), so

$$ \int_0^{e-1}\ln(1+x)\,dx=1. $$

Choosing the upper limit so that \(1+x\) is a power of \(e\) makes the logarithm disappear. This kind of choice appears frequently in textbook problems.

Worked Example: x ln(1+x) from 0 to 1

Evaluate \(\int_0^1x\ln(1+x)\,dx\).

At \(x=1\) the coefficient \(\frac{x^2-1}{2}\) is zero, so the logarithm term vanishes and \(F(1)=-\frac14+\frac12=\frac14\). Also \(F(0)=0\). Hence

$$ \int_0^1x\ln(1+x)\,dx=\frac14. $$

The elegant result \(\frac14\) arises because the factor \(x^2-1\) vanishes at the upper limit.

Worked Example: x ln(1+x) from 0 to e − 1

Evaluate \(\int_0^{e-1}x\ln(1+x)\,dx\).

At \(x=e-1\), \(x^2-1=e^2-2e\) and \(\ln(1+x)=1\), so the first term is \(\frac{e^2-2e}{2}\). The remaining terms are \(-\frac{(e-1)^2}{4}+\frac{e-1}{2}\). Adding gives

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

The simplification uses \(\frac{2e^2-4e-(e^2-2e+1)+2e-2}{4}=\frac{e^2-3}{4}\); combining over a common denominator avoids errors.

A Reliable Procedure

1
Choose the parts.
Put \(\ln(1+x)\) in \(u\), and take \(dv\) to be the polynomial factor.
2
Choose a helpful antiderivative.
Add a constant to \(v\) if it cancels the denominator \(1+x\).
3
Divide.
If the leftover fraction is improper, divide the numerator by \(1+x\).
4
Integrate and combine.
Merge the logarithm terms with the same argument.
5
Check.
Differentiate and make sure the algebraic terms cancel.

Common Mistakes

Students often write \(\int\frac{x^2}{1+x}\,dx\) as \(\ln(1+x)\) times something, skipping the division. The numerator has a higher degree than the denominator, so division is required. Another common error is to forget the \(\frac12\) in front of the leftover integral, which comes from \(v=\frac{x^2}{2}\). Finally, remember that \(\ln(1+x)\) requires \(x>-1\); for \(x<-1\) the correct logarithm has argument \(|1+x|\), but definite integrals in this tutorial stay on \(x>-1\). A last slip is to merge \(\ln(1+x)\) with \(\ln x\) as if they were the same function; the shift by one unit changes every value, so never combine logarithms whose arguments differ.

Quick Reference

IntegrandAntiderivative on x > −1
\(\ln(1+x)\)\((1+x)\ln(1+x)-x\)
\(x\ln(1+x)\)\(\frac{x^2-1}{2}\ln(1+x)-\frac{x^2}{4}+\frac x2\)
\(x^2\ln(1+x)\)\(\frac{x^3+1}{3}\ln(1+x)-\frac{x^3}{9}+\frac{x^2}{6}-\frac x3\)
\(\frac{x^2}{1+x}\)\(\frac{x^2}{2}-x+\ln(1+x)\)

Practice Problems with Answers

Try each problem before reading the answer. Every answer below was checked by differentiation or by numerical integration.

  1. Evaluate \(\int_0^1\ln(1+x)\,dx\). Hint: use \(F(x)=(1+x)\ln(1+x)-x\). Answer: \(2\ln2-1\)
  2. Evaluate \(\int_0^1x\ln(1+x)\,dx\). Hint: the logarithm coefficient vanishes at \(x=1\). Answer: \(\frac14\)
  3. Find an antiderivative of \(x^2\ln(1+x)\). Hint: choose \(v=\frac{x^3+1}{3}\) so that \(\frac{x^3+1}{x+1}=x^2-x+1\) is a polynomial. Answer: \(\frac{x^3+1}{3}\ln(1+x)-\frac{x^3}{9}+\frac{x^2}{6}-\frac x3\)
  4. Evaluate \(\int_0^{e-1}x\ln(1+x)\,dx\). Hint: note that \(\ln e=1\). Answer: \(\frac{e^2-3}{4}\)
Takeaway: For \(\ln(1+x)\) and its products with polynomials, put the logarithm in \(u\), pick \(v\) so that \(1+x\) cancels where possible, and use polynomial division for what remains.

Extending to x² ln(1+x)

The same method handles higher powers. For \(\int x^2\ln(1+x)\,dx\), take \(u=\ln(1+x)\) and \(dv=x^2\,dx\), and choose \(v=\frac{x^3+1}{3}\). This is a legitimate antiderivative of \(x^2\), and it contains the factor \(x+1\) because \(x^3+1=(x+1)(x^2-x+1)\). Then \(v\,du=\frac{x^3+1}{3(x+1)}\,dx=\frac{x^2-x+1}{3}\,dx\), a polynomial, so

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

Distributing the factor \(\frac13\) gives \(\frac{x^3+1}{3}\ln(1+x)-\frac{x^3}{9}+\frac{x^2}{6}-\frac x3+C\), the entry in the reference table. Evaluating from \(0\) to \(1\), the logarithm coefficient is \(\frac23\) and the polynomial part is \(-\frac19+\frac16-\frac13=-\frac{5}{18}\), so \(\int_0^1x^2\ln(1+x)\,dx=\frac{2\ln2}{3}-\frac{5}{18}\approx0.184\). Notice that choosing \(v\) to contain the factor \(x+1\) removes the need for a separate division step.

Interpreting the Results

All three antiderivatives have the form (polynomial) \(\times\ln(1+x)\) minus a lower-degree polynomial. The logarithm grows more slowly than any power, so for large \(x\) the polynomial factor dominates the size of the antiderivative. Near \(x=0\), \(\ln(1+x)\approx x-\frac{x^2}{2}\), and the integrals behave like the integrals of the leading terms: \(\int_0^t x\ln(1+x)\,dx\approx\frac{t^3}{3}\) for small \(t\). This is a useful estimate to compare against your exact answer.

A Numerical Spot Check

Test \(\int_0^1\ln(1+x)\,dx=2\ln2-1\approx0.386\) with the trapezoid rule on two intervals. The heights at \(0\), \(\frac12\) and \(1\) are \(0\), \(\ln1.5\approx0.405\) and \(\ln2\approx0.693\). The estimate is \(\frac12\cdot\bigl(\frac{0+0.405}{2}+\frac{0.405+0.693}{2}\bigr)=0.376\), slightly below the exact value because the logarithm is concave and the trapezoids lie under the curve. The agreement to within three percent confirms the formula.

Connecting to the Plain Logarithm

The substitution \(w=1+x\), \(dw=dx\), converts the first integral into \(\int\ln w\,dw=w\ln w-w+C\). Replacing \(w\) by \(1+x\) gives \((1+x)\ln(1+x)-(1+x)+C\), which equals \((1+x)\ln(1+x)-x+C'\) with \(C'=C-1\). The two forms differ only by a constant, so they are both correct antiderivatives. This shows that \(\ln(1+x)\) is the standard logarithm shifted one unit to the left, and the result is the standard \(x\ln x-x\) shifted in the same way.

The same substitution turns \(\int x\ln(1+x)\,dx\) into \(\int(w-1)\ln w\,dw\), which splits into \(\int w\ln w\,dw-\int\ln w\,dw\). Each piece is a standard logarithm integral, so this is a second way to confirm the answer: \(\frac{w^2}{2}\ln w-\frac{w^2}{4}-(w\ln w-w)\) becomes, after substituting \(w=1+x\) and collecting constants, the same antiderivative found by direct parts.

When x Is Less Than −1

For \(x<-1\), the argument \(1+x\) is negative and \(\ln(1+x)\) is undefined as a real function. The integrand \(\frac{1}{1+x}\) of the derivative step is still defined there, and antiderivatives involve \(\ln|1+x|\). The problems in this tutorial stay on \(x>-1\), where no absolute value signs are needed, and the definite integrals never cross the singularity at \(x=-1\).

Where This Fits in the Course

This tutorial belongs to the module “Integration by Parts I”. The tutorial just before it is “Domain And Endpoint Checks For Inverse-Trigonometric Parts,” and the one that follows is “Mixed One-Step Integration By Parts Problems.” It consolidates the logarithm techniques before the module closes with mixed one-step practice and the course moves on to repeated and tabular parts. The habits practiced here, choosing a helpful constant in v, dividing improper fractions, and checking by differentiation, carry over directly to the harder repeated-parts problems that follow, where a single slip early on propagates through several later steps.

Check Your Understanding

Use the derivations and examples above to answer these questions.

  1. Why is \(v=1+x\) a better choice than \(v=x\) for \(\int\ln(1+x)\,dx\)?
  2. Divide \(x^2\) by \(x+1\) and write the quotient and remainder.
  3. Evaluate \(\int_0^1\ln(1+x)\,dx\).
  4. What restriction on \(x\) is needed for these formulas?
  5. Differentiate \(\frac{x^2-1}{2}\ln(1+x)-\frac{x^2}{4}+\frac x2\) and confirm the result.

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