The antiderivative of \(\ln x\) is \(x\ln x – x + C\). You find it with integration by parts, using \(u = \ln x\) and \(dv = dx\). Check: \(\frac{d}{dx}(x\ln x – x) = \ln x + 1 – 1 = \ln x\).
\(\ln x\) looks simple, but none of the basic rules work on it. There is no power to use the power rule on, and it is not a trig or exponential function. The trick that cracks it is worth learning well, because the same idea also solves \(\int \tan^{-1}x\,dx\), \(\int \sin^{-1}x\,dx\) and \(\int \log_2 x\,dx\).
The Trick: Multiply by an Invisible 1
Integration by parts needs two pieces, \(u\) and \(dv\). With only \(\ln x\) in the integral, it seems like there is just one. But every function can be written as itself times 1:
\[\int \ln x\,dx = \int \underbrace{\ln x}_{u}\cdot\underbrace{1\,dx}_{dv}.\]
Now differentiate the hard part and integrate the easy part. Differentiating \(\ln x\) makes it much simpler, which is the whole point.
Step-by-Step Derivation
- Set up. \(u = \ln x\) and \(dv = dx\).
- Find du and v. \(du = \frac{1}{x}\,dx\) and \(v = x\).
- Use the formula \(\int u\,dv = uv – \int v\,du\). \(\int \ln x\,dx = x\ln x – \int x\cdot\frac1x\,dx\).
- Simplify. \(x\cdot\frac1x = 1\), so the last integral is just \(\int 1\,dx = x\).
- Write the answer. \(\int \ln x\,dx = x\ln x – x + C\).
You can also factor it as \(x(\ln x – 1) + C\). Both forms are correct.
Check It by Differentiating
Use the product rule on \(x\ln x\):
\[\frac{d}{dx}\left(x\ln x – x\right) = \left(1\cdot\ln x + x\cdot\frac1x\right) – 1 = \ln x + 1 – 1 = \ln x. \;✓\]
This check takes ten seconds and catches almost every mistake. See more ways to check an antiderivative.
Related Logarithm Integrals
| Integral | Answer | How |
|---|---|---|
| \(\int \ln(ax)\,dx\) | \(x\ln(ax) – x + C\) | Parts, same as \(\ln x\) |
| \(\int \ln(x+1)\,dx\) | \((x+1)\ln(x+1) – x + C\) | \(u\)-sub, then the \(\ln\) rule |
| \(\int \ln(x^2)\,dx\) | \(x\ln(x^2) – 2x + C\) | Parts |
| \(\int (\ln x)^2\,dx\) | \(x(\ln x)^2 – 2x\ln x + 2x + C\) | Parts twice |
| \(\int \frac{\ln x}{x}\,dx\) | \(\frac{(\ln x)^2}{2} + C\) | \(u = \ln x\) |
| \(\int x\ln x\,dx\) | \(\frac{x^2}{2}\ln x – \frac{x^2}{4} + C\) | Parts, \(u = \ln x\) |
| \(\int \log_b x\,dx\) | \(\frac{x\ln x – x}{\ln b} + C\) | Change of base |
Worked example: \(\int (\ln x)^2\,dx\)
Round 1: \(u = (\ln x)^2\), \(dv = dx\), so \(du = \frac{2\ln x}{x}\,dx\) and \(v = x\):
\[\int (\ln x)^2\,dx = x(\ln x)^2 – \int 2\ln x\,dx.\]
Round 2 is the basic result times 2: \(\int 2\ln x\,dx = 2x\ln x – 2x\). So
\[\int (\ln x)^2\,dx = x(\ln x)^2 – 2x\ln x + 2x + C.\]
Worked example: \(\int \frac{\ln x}{x}\,dx\)
Here parts is the wrong tool. \(\frac{1}{x}\) is the derivative of \(\ln x\), so u-substitution with \(u = \ln x\) gives \(\int u\,du = \frac{(\ln x)^2}{2} + C\) in one step.
Worked example: \(\int \log_{10} x\,dx\)
Change the base first: \(\log_{10} x = \frac{\ln x}{\ln 10}\). Then
\[\int \log_{10}x\,dx = \frac{1}{\ln 10}\left(x\ln x – x\right) + C.\]
Definite Integrals of ln x
- \(\int_1^e \ln x\,dx = \big[x\ln x – x\big]_1^e = (e – e) – (0 – 1) = 1.\)
- \(\int_1^2 \ln x\,dx = 2\ln 2 – 1 \approx 0.386.\)
- \(\int_0^1 \ln x\,dx = -1.\) This one is improper because \(\ln x \to -\infty\) as \(x \to 0\), but the area is still finite. Try it in the improper integral calculator.
The Bigger Lesson: When to Use the Hidden 1
Use \(dv = dx\) whenever the integrand is a single function that is hard to integrate but easy to differentiate. That covers the logarithms and the inverse trig functions:
- \(\int \tan^{-1}x\,dx = x\tan^{-1}x – \frac12\ln(1+x^2) + C\)
- \(\int \sin^{-1}x\,dx = x\sin^{-1}x + \sqrt{1-x^2} + C\)
These are exactly the functions at the front of the LIATE rule, which is no coincidence.
Common Mistakes
- Writing \(\frac{1}{x}\) as the answer. That is the derivative of \(\ln x\), not its antiderivative.
- Dropping the \(-x\). \(x\ln x\) alone differentiates to \(\ln x + 1\), which is wrong.
- Using parts on \(\frac{\ln x}{x}\). It works, but substitution is much faster.
Calculators for This Topic
Practice what you just read. Each tool shows full steps and checks its own answer.
- ∂Integration by Parts Calculator – LIATE choice, u, dv, v and du shown clearly.
- ∫Antiderivative Calculator – Find any antiderivative with full steps and a check.
- d/dxDerivative Calculator – Product, quotient and chain rule steps for any function.
Frequently Asked Questions
What is the antiderivative of ln x?
It is \(x\ln x – x + C\), which can also be written \(x(\ln x – 1) + C\).
What is the antiderivative of ln(2x)?
It is \(x\ln(2x) – x + C\). Because \(\ln(2x) = \ln 2 + \ln x\), this matches \(x\ln x – x\) plus a term that the constant absorbs.
Why do we use integration by parts for ln x?
No basic rule applies to \(\ln x\). Parts with \(u = \ln x\) and \(dv = dx\) replaces it with its derivative \(\frac1x\), which cancels with \(v = x\) and leaves an easy integral.
What is the integral of ln x from 1 to e?
It is exactly 1, because \(\big[x\ln x – x\big]_1^e = 0 – (-1) = 1\).
Is the antiderivative of ln x the same as 1/x?
No. \(\frac1x\) is the derivative of \(\ln x\). Going the other way, from \(\frac1x\) back, gives \(\ln|x| + C\). See the antiderivative of 1/x.


