Tutorials › Calculus II › Integrating x Times The Natural Logarithm

Integration by Parts I · Tutorial 34 of 998

Integrating x Times The Natural Logarithm

Integrate x ln x by letting the logarithm be u, which converts the product into a power of x that the power rule handles.

Intermediate 10 min read

What You'll Learn

  • Explain why the logarithm is the right choice for u in ∫ x ln x dx.
  • Carry out integration by parts and simplify the leftover power of x.
  • State the domain x > 0 and use the antiderivative on it.
  • Evaluate definite integrals of x ln x and related scaled forms.
  • Check antiderivatives by differentiating and avoid the lost-integration slip.

The Product of a Power and a Logarithm

The integrand \(x\ln x\) combines a simple power with a function whose antiderivative is not obvious at first sight. No substitution rewrites it as a basic integral, so integration by parts is the tool. The key question is which factor to differentiate. The logarithm is the natural choice: its derivative \(1/x\) is algebraic, while the power \(x\) integrates easily by the power rule. Differentiating the logarithm removes it from the integrand entirely.

Throughout this tutorial \(x>0\), because \(\ln x\) is defined only for positive \(x\). All antiderivatives below are valid on the interval \((0,\infty)\).

Result: For \(x>0\), \(\displaystyle\int x\ln x\,dx=\frac{x^2}{2}\ln x-\frac{x^2}{4}+C.\)

Deriving the Antiderivative

Let \(u=\ln x\) and \(dv=x\,dx\). Then \(du=\frac{1}{x}\,dx\) and \(v=\frac{x^2}{2}\). The parts formula \(\int u\,dv=uv-\int v\,du\) gives

$$ \int x\ln x\,dx=\frac{x^2}{2}\ln x-\int \frac{x^2}{2}\cdot\frac1x\,dx. $$

The integrand in the new integral simplifies: \(\frac{x^2}{2}\cdot\frac1x=\frac{x}{2}\). This is the moment where the logarithm disappears. The remaining integral is a power: \(\int\frac{x}{2}\,dx=\frac{x^2}{4}\). Therefore

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

The second form factors out \(x^2/4\), which makes it easy to read the sign of the antiderivative and to evaluate it at endpoints. The strategy extends to \(x^n\ln x\) for \(n\ne-1\): the same choice \(u=\ln x\) leaves \(\int \frac{x^n}{n+1}\cdot\frac1x\,dx=\frac{1}{n+1}\int x^{n}\,dx\), which is again a power. The exceptional case \(n=-1\) gives \(\int\frac{\ln x}{x}\,dx\), which is better done by the substitution \(w=\ln x\).

Why the Other Choice Is Worse

Suppose we tried \(u=x\) and \(dv=\ln x\,dx\) instead. We would first need an antiderivative of \(\ln x\), namely \(v=x\ln x-x\), which itself requires integration by parts. The resulting integral \(\int (x\ln x-x)\,dx\) still contains the original problem. The calculation can be made to work, but it is longer and more error-prone. The general rule of thumb is to choose \(u\) as the function that becomes simpler (or disappears) when differentiated, and logarithms and inverse trigonometric functions typically belong in that role.

Worked Examples

Worked Example: A Definite Integral from 1 to e

Evaluate \(\int_1^e x\ln x\,dx\).

Use the antiderivative \(F(x)=\frac{x^2}{2}\ln x-\frac{x^2}{4}\). At \(x=e\), \(\ln e=1\), so \(F(e)=\frac{e^2}{2}-\frac{e^2}{4}=\frac{e^2}{4}\). At \(x=1\), \(\ln 1=0\), so \(F(1)=-\frac14\). Hence

$$ \int_1^e x\ln x\,dx=F(e)-F(1)=\frac{e^2}{4}+\frac14=\frac{e^2+1}{4}\approx2.10. $$

The integrand rises from \(0\) at \(x=1\) to \(e\) at \(x=e\), over an interval of length \(e-1\approx1.72\). An average height near \(1.2\) gives an area near \(2.1\), consistent with the computed value.

Worked Example: A Constant Multiple

Find \(\int 6x\ln x\,dx\) for \(x>0\).

Constants can be pulled out of the integral, so the problem is \(6\) times the basic result:

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

Differentiate to check: \(\frac{d}{dx}\bigl(3x^2\ln x\bigr)=6x\ln x+3x\), and \(\frac{d}{dx}\bigl(-\tfrac32x^2\bigr)=-3x\). The terms \(3x\) and \(-3x\) cancel, leaving \(6x\ln x\).

Worked Example: A Logarithm of a Power

Find \(\int x\ln(x^3)\,dx\) for \(x>0\).

For \(x>0\), the logarithm rule gives \(\ln(x^3)=3\ln x\). So the integral equals \(3\int x\ln x\,dx\):

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

Simplifying the integrand first is a good habit. Without it one would apply the chain rule to differentiate \(\ln(x^3)\) as \(\frac{3x^2}{x^3}=\frac3x\), which leads to the same result with more bookkeeping.

Common Mistake: Forgetting to Integrate the Leftover Term

After parts, the new integral is \(\int \frac{x}{2}\,dx\). A common slip is to stop at the simplification and write \(\frac{x}{2}\) as the contribution, giving the incorrect antiderivative \(\frac{x^2}{2}\ln x-\frac{x}{2}\). The factor \(\frac{x}{2}\) is the integrand of the remaining integral, not its value, so one more power-rule step is required.

The wrong answer fails the derivative check at once: \(\frac{d}{dx}\left[\frac{x^2}{2}\ln x-\frac x2\right]=x\ln x+\frac x2-\frac12\), which is not \(x\ln x\). The correct term \(-\frac{x^2}{4}\) differentiates to \(-\frac{x}{2}\), and that cancels the stray \(+\frac{x}{2}\) produced by the product rule on the first term.

Conditions and Interpretation

The antiderivative \(\frac{x^2}{2}\ln x-\frac{x^2}{4}\) is defined for \(x>0\). It also has a limit as \(x\to0^+\): since \(x^2\ln x\to0\), the antiderivative tends to \(0\), which means \(\int_0^b x\ln x\,dx\) converges as an improper integral even though \(\ln x\) is unbounded near zero. For \(x<0\) the expression \(x\ln|x|\) is a different integrand with its own antiderivative, so one should not extend the formula across \(x=0\) without care.

A Reliable Procedure

Problems that combine a logarithm with a power of \(x\) all follow the same plan. Working through the steps in order keeps the algebra short and makes the final check straightforward.

1
Check the domain.
Confirm that the argument of the logarithm is positive on the interval of interest. For \(\ln x\), that means \(x>0\).
2
Let the logarithm be \(u\).
Set \(u=\ln x\), so \(du=\frac1x\,dx\). Let \(dv\) be the power of \(x\) that remains.
3
Integrate the power.
Use the power rule for \(v\). For \(dv=x\,dx\) this gives \(v=\frac{x^2}{2}\).
4
Simplify \(v\,du\).
Multiply \(v\) by \(\frac1x\). The logarithm has disappeared and a power of \(x\) remains.
5
Integrate the leftover power.
Use the power rule again. Then combine the pieces and factor if convenient.
6
Verify.
Differentiate the answer. The product rule on the first term must reproduce \(x\ln x\) after the polynomial terms cancel.

Worked Example: Area Under the Curve

Find the area under \(y=x\ln x\) from \(x=1\) to \(x=3\), where the curve lies above the \(x\)-axis.

With \(F(x)=\frac{x^2}{2}\ln x-\frac{x^2}{4}\), we have \(F(3)=\frac92\ln3-\frac94\) and \(F(1)=-\frac14\). The area is

$$ \int_1^3x\ln x\,dx=\frac92\ln3-\frac94+\frac14=\frac92\ln3-2\approx2.94. $$

As a reasonableness check, the curve rises from height \(0\) at \(x=1\) to \(3\ln3\approx3.30\) at \(x=3\). The area under a rising curve over a base of length \(2\) is less than the rectangle of height \(3.30\), which has area \(6.6\), and more than the triangle under the chord, which has area \(3.30\), minus the bulge from concavity. A value near \(2.9\) fits the actual shape, which starts very flat and climbs late.

Generalizing to Other Powers

The same method handles \(\int x^n\ln x\,dx\) whenever \(n\ne-1\). With \(u=\ln x\) and \(dv=x^n\,dx\), we get \(v=\frac{x^{n+1}}{n+1}\), and after simplifying \(v\,du=\frac{x^n}{n+1}\,dx\), the final result is

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

Setting \(n=1\) recovers the formula in this tutorial, since \(\frac{x^2}{2}\ln x-\frac{x^2}{4}\) has denominators \(2\) and \(2^2\). The pattern is easy to remember: the power increases by one, the coefficient of the logarithm is divided by the new exponent, and the polynomial term is divided by the new exponent squared. For example, \(\int x^2\ln x\,dx=\frac{x^3}{3}\ln x-\frac{x^3}{9}+C\).

Takeaway: To integrate \(x\ln x\), differentiate the logarithm and integrate the power. The result \(\frac{x^2}{2}\ln x-\frac{x^2}{4}\) is valid for \(x>0\), and its derivative check takes one line.

Quick Reference

IntegrandAntiderivativeCondition
\(\ln x\)\(x\ln x-x\)\(x>0\)
\(x\ln x\)\(\frac{x^2}{2}\ln x-\frac{x^2}{4}\)\(x>0\)
\(x^2\ln x\)\(\frac{x^3}{3}\ln x-\frac{x^3}{9}\)\(x>0\)
\(x^n\ln x\)\(\frac{x^{n+1}}{n+1}\ln x-\frac{x^{n+1}}{(n+1)^2}\)\(x>0,\ n\ne-1\)

Where This Fits in the Course

This tutorial belongs to the module “Integration by Parts I”. The tutorial just before it is “Integrating The Natural Logarithm,” and the one that follows is “Power-Weighted Logarithm Integrals.” Both tutorials use the logarithm as the function to differentiate; here the partner is a power of \(x\).

Check Your Understanding

Use the derivation and the examples above to answer these questions.

  1. Why is \(\ln x\) chosen as \(u\) in \(\int x\ln x\,dx\)?
  2. Evaluate \(\int_1^4 x\ln x\,dx\) and verify your answer numerically.
  3. What antiderivative do you obtain for \(\int x^3\ln x\,dx\)? Check it by differentiating.
  4. Explain why \(\int \frac{\ln x}{x}\,dx\) needs a substitution rather than the power-rule version of this method.
  5. What error does the expression \(\frac{x^2}{2}\ln x-\frac{x}{2}\) contain?

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