The Antiderivative of ln x

Brain Teaser · Easy · Free problem

Find the indefinite integral $$\int \ln x \, dx, \qquad x > 0,$$ and verify your result by differentiation.

Hints

  1. There is no obvious substitution, and $\ln x$ is not the derivative of anything elementary you recognize. Think of $\ln x$ as the product $1 \cdot \ln x$.
  2. Use integration by parts, $\int u\,dv = uv - \int v\,du$, choosing $u = \ln x$ (which simplifies when differentiated) and $dv = dx$.
  3. With $u = \ln x$, $du = dx/x$, $v = x$, the leftover integral is $\int x \cdot \frac{1}{x}\,dx = \int 1\,dx$.

Worked Solution

How to Think About It: $\ln x$ has an ugly integral but a very simple derivative, $1/x$. Integration by parts lets you differentiate $\ln x$ and integrate the trivial factor $1$ instead.

Quick Estimate: $\int_{1}^{e} \ln x\,dx$ is the area under a curve that rises from $0$ to $1$ over an interval of length $e - 1 \approx 1.72$, concave, so somewhere between $0.86$ (triangle) and $1.72$ (rectangle). The formula below gives exactly $1$, which is plausible.

Formal Solution:

*Step 1 -- Set up integration by parts.* Take $$u = \ln x, \quad dv = dx \qquad \Longrightarrow \qquad du = \frac{dx}{x}, \quad v = x.$$

*Step 2 -- Apply $\int u\,dv = uv - \int v\,du$.* $$\int \ln x\,dx = x \ln x - \int x \cdot \frac{1}{x}\,dx = x \ln x - \int 1\,dx = x \ln x - x + C.$$

*Step 3 -- Verify by differentiating.* $$\frac{d}{dx}\left(x \ln x - x\right) = \ln x + x \cdot \frac{1}{x} - 1 = \ln x. \checkmark$$

*Step 4 -- A useful definite version.* $\int_{1}^{e} \ln x\,dx = [x\ln x - x]_{1}^{e} = (e - e) - (0 - 1) = 1$, and $\int_{0}^{1} \ln x\,dx = -1$ (improper, but convergent since $x \ln x \to 0$).

Answer: $\displaystyle \int \ln x\,dx = x \ln x - x + C$.

Intuition

Integration by parts trades a hard integrand for an easier one by moving the derivative onto the factor that simplifies; $\ln x$ becomes $1/x$, which cancels the $x$ from the other side. This exact integral appears when computing $E[\ln X]$ for uniform variables, the entropy $-\int p \ln p$ of densities, and the Black-Scholes integrals where $\ln S$ shows up under the lognormal measure.

Open the full interactive solver →