AP Calculus BC

Integral of ln x: Answer, Proof, and Mistakes

The integral of ln x is x ln x - x + C, valid for x > 0. Integration by parts produces it: take u = ln x and dv = dx, so du = (1/x) dx and v = x, leaving x ln x minus the integral of 1 dx. Differentiating x ln x - x returns ln x + 1 - 1 = ln x.

∫ln⁡x dx=xln⁡x−x+C\int \ln x\,dx = x\ln x - x + C

How to integrate ln x by parts

The integrand ln⁡x\ln x has no inside function for substitution to grab, so uu-substitution stalls immediately. Integration by parts works because differentiating ln⁡x\ln x simplifies it to 1x\frac{1}{x}, while dxdx integrates to xx at no cost.

∫ln⁡x dx\int \ln x\,dx

Choose u=ln⁡xu = \ln x and dv=dxdv = dx. Then du=1x dxdu = \frac{1}{x}\,dx and v=xv = x.

∫u dv=uv−∫v du\int u\,dv = uv - \int v\,du
∫ln⁡x dx=xln⁡x−∫x⋅1x dx\int \ln x\,dx = x\ln x - \int x \cdot \frac{1}{x}\,dx

The remaining integrand collapses to 1, and ∫1 dx=x\int 1\,dx = x.

∫ln⁡x dx=xln⁡x−x+C\int \ln x\,dx = x\ln x - x + C

Check it by differentiating

Differentiate xln⁡x−xx\ln x - x. The product rule gives 1⋅ln⁡x+x⋅1x=ln⁡x+11 \cdot \ln x + x \cdot \frac{1}{x} = \ln x + 1, and the −x-x term contributes −1-1. The two constants cancel and leave exactly ln⁡x\ln x.

Where the integral of ln x shows up on the AP exam

∫ln⁡x dx\int \ln x\,dx belongs to Unit 6 (Integration and Accumulation of Change), Topic 6.11, Integrating Using Integration by Parts. Topic 6.11 is BC only, so AB students are never asked to produce this antiderivative, though an AB student can still confirm it by differentiating. Unit 6 carries a weighting of 15 to 20 percent on both AB and BC.

On BC it rarely appears bare. It is usually one step inside a definite integral, an average value, or an accumulation function. The cleanest case runs from 1 to ee, where both endpoints make ln⁡x\ln x friendly.

∫1eln⁡x dx=[xln⁡x−x]1e=(e−e)−(0−1)=1\int_1^e \ln x\,dx = \left[x\ln x - x\right]_1^e = (e - e) - (0 - 1) = 1

The same parts choice handles any logarithm base after a change of base, since log⁡bx=ln⁡xln⁡b\log_b x = \frac{\ln x}{\ln b} and the constant 1ln⁡b\frac{1}{\ln b} pulls straight out of the integral.

Common mistakes with the integral of ln x

  • Answering 1x\frac{1}{x}. That is the derivative of ln⁡x\ln x, not an antiderivative of it, and the two get reversed constantly under time pressure.
  • Answering xln⁡xx\ln x. Differentiating it gives ln⁡x+1\ln x + 1, so it overshoots by exactly the 1 that the −x-x term exists to cancel.
  • Reaching for substitution. There is no inner function, so no choice of uu reduces ∫ln⁡x dx\int \ln x\,dx, and parts is the only elementary route.
  • Setting u=1u = 1 and dv=ln⁡x dxdv = \ln x\,dx. Finding vv then requires the answer you are trying to compute, so the choice is circular.
  • Ignoring the domain. ln⁡x\ln x needs x>0x > 0, so a definite integral reaching down to 0 is improper (Topic 6.13), not a routine FTC evaluation.
  • Dropping the +C+ C on the indefinite integral.

Worked variations on the integral of ln x

Two variations account for most of what BC actually asks. The first keeps the same parts choice, the second changes dvdv.

For ∫ln⁡(3x) dx\int \ln(3x)\,dx, take u=ln⁡(3x)u = \ln(3x) and dv=dxdv = dx, so du=1x dxdu = \frac{1}{x}\,dx (the chain rule gives 33x\frac{3}{3x}, which reduces) and v=xv = x.

∫ln⁡(3x) dx=xln⁡(3x)−∫1 dx=xln⁡(3x)−x+C\int \ln(3x)\,dx = x\ln(3x) - \int 1\,dx = x\ln(3x) - x + C

For ∫xln⁡x dx\int x\ln x\,dx, keep u=ln⁡xu = \ln x but let dv=x dxdv = x\,dx, so v=x22v = \frac{x^2}{2}.

∫xln⁡x dx=x22ln⁡x−∫x2 dx=x22ln⁡x−x24+C\int x\ln x\,dx = \frac{x^2}{2}\ln x - \int \frac{x}{2}\,dx = \frac{x^2}{2}\ln x - \frac{x^2}{4} + C

In both cases the logarithm is the factor assigned to uu, because it is the piece that gets simpler when differentiated, which is the whole reason parts helps here.

Every answer on this page is machine checked

An automated test differentiates the antiderivative above and confirms it returns the integrand. A wrong sign or a missing factor fails the build, so it cannot reach you.

Frequently asked questions

What is the integral of ln x?

∫ln⁡x dx=xln⁡x−x+C\int \ln x\,dx = x\ln x - x + C for x>0x > 0. It comes from integration by parts with u=ln⁡xu = \ln x and dv=dxdv = dx. Differentiating the answer returns ln⁡x+1−1=ln⁡x\ln x + 1 - 1 = \ln x, which is the fastest way to confirm it.

Why does integrating ln x require integration by parts?

ln⁡x\ln x is not on the basic antiderivative list, and it has no inner function for substitution to target. Parts works because u=ln⁡xu = \ln x differentiates down to 1x\frac{1}{x}, which cancels against v=xv = x and leaves the trivial ∫1 dx\int 1\,dx.

Is the integral of ln x on the AP Calculus AB exam?

No. Integration by parts is Topic 6.11, which is BC only, so AB is not asked to antidifferentiate ln⁡x\ln x. AB students do need ddx[ln⁡x]=1x\frac{d}{dx}[\ln x] = \frac{1}{x} from Topic 2.7, and they can use it to verify xln⁡x−xx\ln x - x if the answer is handed to them.

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

It equals 1. Evaluate xln⁡x−xx\ln x - x at the endpoints: at x=ex = e you get e−e=0e - e = 0, and at x=1x = 1 you get 0−1=−10 - 1 = -1, so the definite integral is 0−(−1)=10 - (-1) = 1.

What is the integral of log base b of x?

Rewrite with the change of base: log⁡bx=ln⁡xln⁡b\log_b x = \frac{\ln x}{\ln b}. The constant factors out, giving ∫log⁡bx dx=xln⁡x−xln⁡b+C\int \log_b x\,dx = \frac{x\ln x - x}{\ln b} + C. Only the natural log avoids the extra ln⁡b\ln b in the denominator.