practicecalculus
Products and integration by parts

Integral of x ln x: Formula, Steps and Examples

The integral of x ln x is (x²/2) ln x − x²/4 + C. See the integration by parts steps with u = ln x, a check, a graph and the xⁿ ln x formula.

Products and integration by parts Updated 3 min read

At a glance

\int x\ln x\,dx = \frac{x^2}{2}\ln x - \frac{x^2}{4} + C
Antiderivative
\frac{x^2}{2}\ln x - \frac{x^2}{4} + C
Method
Integration by parts with u = \ln x, dv = x\,dx
From 1 to e
\frac{e^2 + 1}{4} \approx 2.097
From 0 to 1
-\frac{1}{4}
General power
\int x^n\ln x\,dx = \frac{x^{n+1}}{n+1}\ln x - \frac{x^{n+1}}{(n+1)^2} + C, n \ne -1
On this page
  1. Graph of x ln x with the area from 1 to e
  2. How to integrate x ln x step by step
  3. Check by differentiating
  4. Definite integrals
  5. The general power xⁿ ln x
  6. Worked examples
  7. Common mistakes

The integral of x\ln x is \dfrac{x^2}{2}\ln x - \dfrac{x^2}{4} + C. It is a product of a power and a log, so integration by parts is the tool, with the log as u.

\int x\ln x\,dx = \frac{x^2}{2}\ln x - \frac{x^2}{4} + C

Graph of x ln x with the area from 1 to e

y = x ln x with the area from 1 to e shaded
The shaded area is \frac{e^2 + 1}{4} \approx 2.097. Between 0 and 1 the curve dips below the axis, and that small region has signed area -\frac{1}{4}.

How to integrate x ln x step by step

Use integration by parts: \int u\,dv = uv - \int v\,du.

  1. Choose the parts. u = \ln x and dv = x\,dx. Logs come first in LIATE.
  2. Find du and v. du = \frac{1}{x}\,dx and v = \frac{x^2}{2}.
  3. Apply the formula. \int x\ln x\,dx = \frac{x^2}{2}\ln x - \int\frac{x^2}{2}\cdot\frac{1}{x}\,dx = \frac{x^2}{2}\ln x - \frac{1}{2}\int x\,dx
  4. Finish. \frac{1}{2}\int x\,dx = \frac{x^2}{4}, so \int x\ln x\,dx = \frac{x^2}{2}\ln x - \frac{x^2}{4} + C

The key moment is step 3: the \frac{1}{x} from du cancels one power of x from v, leaving a plain power. That always happens with a log as u.

Check by differentiating

\frac{d}{dx}\left(\frac{x^2}{2}\ln x - \frac{x^2}{4}\right) = x\ln x + \frac{x^2}{2}\cdot\frac{1}{x} - \frac{x}{2} = x\ln x + \frac{x}{2} - \frac{x}{2} = x\ln x

The derivative of x ln x page has the forward calculation.

Definite integrals

From 1 to e:

\left[\frac{x^2}{2}\ln x - \frac{x^2}{4}\right]_1^e = \left(\frac{e^2}{2} - \frac{e^2}{4}\right) - \left(0 - \frac{1}{4}\right) = \frac{e^2}{4} + \frac{1}{4} = \frac{e^2+1}{4}

That is about 2.097.

From 0 to 1: this is improper at 0 because \ln x is undefined there, but x^2\ln x \to 0 as x \to 0^+:

\int_0^1 x\ln x\,dx = \left(0 - \frac{1}{4}\right) - 0 = -\frac{1}{4}

The general power xⁿ ln x

The same steps with dv = x^n\,dx and v = \frac{x^{n+1}}{n+1} give

\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
Integral Answer
\int\ln x\,dx (n = 0) x\ln x - x + C
\int x^2\ln x\,dx \frac{x^3}{3}\ln x - \frac{x^3}{9} + C
\int\sqrt{x}\ln x\,dx \frac{2}{3}x^{3/2}\ln x - \frac{4}{9}x^{3/2} + C
\int\frac{\ln x}{x^2}\,dx (n = -2) -\frac{\ln x}{x} - \frac{1}{x} + C

Worked examples

Example 1: a cube. \int x^3\ln x\,dx = \frac{x^4}{4}\ln x - \frac{x^4}{16} + C, from the general formula with n = 3.

Example 2: a log of a power. \int x\ln(x^2)\,dx. Use \ln(x^2) = 2\ln x for x > 0:

2\int x\ln x\,dx = x^2\ln x - \frac{x^2}{2} + C

Example 3: the n = −1 case. \int\frac{\ln x}{x}\,dx breaks the formula (it would divide by zero). Use u = \ln x, du = \frac{dx}{x} instead: \int u\,du = \frac{(\ln x)^2}{2} + C.

Example 4: a squared log. \int x(\ln x)^2\,dx. Parts with u = (\ln x)^2, dv = x\,dx gives \frac{x^2}{2}(\ln x)^2 - \int x\ln x\,dx, which you now know:

\frac{x^2}{2}(\ln x)^2 - \frac{x^2}{2}\ln x + \frac{x^2}{4} + C

Common mistakes

  1. Choosing u = x. Then v needs \int\ln x\,dx, and the leftover integral is harder than the original.
  2. Forgetting to simplify \frac{x^2}{2}\cdot\frac{1}{x}. It is \frac{x}{2}, and that integrates to \frac{x^2}{4}, not \frac{x^2}{2}.
  3. Integrating the factors separately. \frac{x^2}{2}(x\ln x - x) is not the answer.
  4. Using the general formula with n = -1. See Example 3.

Related pages: the integral of ln x, the integral of x eˣ and the integration by parts guide.

Practice it now

Repeated parts and LIATE

Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.

Practice this lesson

Frequently asked questions

What is the integral of x ln x?

It is \frac{x^2}{2}\ln x - \frac{x^2}{4} + C, which can also be written \frac{x^2}{4}(2\ln x - 1) + C.

What is the integral of x² ln x?

It is \frac{x^3}{3}\ln x - \frac{x^3}{9} + C. Use parts with u = \ln x and dv = x^2\,dx.

What is the integral of x ln x from 0 to 1?

It is -\frac{1}{4}. At the lower limit, \frac{x^2}{2}\ln x \to 0 as x \to 0^+, so only -\frac{1}{4} from the upper limit remains.

Why choose u = ln x and not u = x?

With u = x you would need v = \int\ln x\,dx = x\ln x - x, and the leftover integral gets messier. With u = \ln x, du = \frac{1}{x}dx cancels a power of x and leaves a plain power to integrate.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.