Integral of ln x: Formula, Steps and Examples
The integral of ln x is x ln x − x + C. See the integration by parts steps, a check by differentiating, a graph and examples like ln(2x) and (ln x)².
Exponential and log integrals Updated 3 min read
At a glance
- Antiderivative
- x\ln x - x + C
- Method
- Integration by parts with u = \ln x, dv = dx
- From 1 to e
- 1
- From 0 to 1
- -1 (improper, converges)
- Base-b log
- \int \log_b x\,dx = \frac{x\ln x - x}{\ln b} + C
On this page
The integral of \ln x is x\ln x - x + C. There is no reverse rule that undoes the log directly, so the standard method is integration by parts with a hidden factor of 1.
Graph of ln x and its antiderivative
How to integrate ln x step by step
Use integration by parts, \int u\,dv = uv - \int v\,du.
- Write \ln x as a product. \int\ln x\,dx = \int \ln x\cdot 1\,dx.
- Choose the parts. u = \ln x and dv = dx. Then du = \frac{1}{x}\,dx and v = x.
- Apply the formula. \int \ln x\,dx = x\ln x - \int x\cdot\frac{1}{x}\,dx = x\ln x - \int 1\,dx
- Finish. \int 1\,dx = x, so the answer is x\ln x - x + C.
Why does this work? Differentiating \ln x turns it into \frac{1}{x}, which cancels the x from v. In the LIATE order, logs come first, so they almost always play the role of u. The integration by parts guide has more on choosing u.
Check by differentiating
By the product rule and the derivative of ln x:
Definite integrals
From 1 to e:
From 1 to 2: (2\ln 2 - 2) - (0 - 1) = 2\ln 2 - 1 \approx 0.386.
From 0 to 1: this is an improper integral since \ln x \to -\infty near 0. Using the limit x\ln x \to 0 as x \to 0^+:
The answer is negative because \ln x < 0 on (0, 1), so the area lies below the axis.
Worked examples
Example 1: a constant inside. \int\ln(2x)\,dx. Let u = 2x, dx = \frac{du}{2}:
Example 2: a shifted log. \int\ln(x+1)\,dx. Let u = x + 1, du = dx:
The -1 can be absorbed into C, so (x+1)\ln(x+1) - x + C is also correct.
Example 3: a squared log. \int(\ln x)^2\,dx. Take u = (\ln x)^2, dv = dx, so du = \frac{2\ln x}{x}\,dx and v = x:
Example 4: a power of x inside. \int\ln(x^3)\,dx = 3\int\ln x\,dx = 3x\ln x - 3x + C, after the log rule \ln(x^3) = 3\ln x.
Example 5: base 10. Since \log_{10}x = \frac{\ln x}{\ln 10}, \int\log_{10}x\,dx = \frac{x\ln x - x}{\ln 10} + C.
Common mistakes
- Answering \frac{1}{x}. That is the derivative of \ln x. The integral of \frac{1}{x} is \ln\lvert x\rvert; see the integral of 1/x.
- Choosing u = 1, dv = \ln x\,dx. Then you need \int\ln x\,dx to find v, the very thing you are trying to compute.
- Losing the -x. x\ln x alone has derivative \ln x + 1, one too many.
- Confusing \ln x with \frac{\ln x}{x}. \int\frac{\ln x}{x}\,dx = \frac{(\ln x)^2}{2} + C is a u-substitution, not a parts problem.
For a log times a power of x, see the integral of x ln x. For logs in the denominator, see the integral of 1/(x ln x).
Practice it now
Integration by parts
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