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.

lnxdx=xlnxx+C\int \ln x\,dx = x\ln x - x + C

How to integrate ln x by parts

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

lnxdx\int \ln x\,dx

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

udv=uvvdu\int u\,dv = uv - \int v\,du
lnxdx=xlnxx1xdx\int \ln x\,dx = x\ln x - \int x \cdot \frac{1}{x}\,dx

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

lnxdx=xlnxx+C\int \ln x\,dx = x\ln x - x + C

Check it by differentiating

Differentiate xlnxxx\ln x - x. The product rule gives 1lnx+x1x=lnx+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 lnx\ln x.

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

lnxdx\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 lnx\ln x friendly.

1elnxdx=[xlnxx]1e=(ee)(01)=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 logbx=lnxlnb\log_b x = \frac{\ln x}{\ln b} and the constant 1lnb\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 lnx\ln x, not an antiderivative of it, and the two get reversed constantly under time pressure.
  • Answering xlnxx\ln x. Differentiating it gives lnx+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 lnxdx\int \ln x\,dx, and parts is the only elementary route.
  • Setting u=1u = 1 and dv=lnxdxdv = \ln x\,dx. Finding vv then requires the answer you are trying to compute, so the choice is circular.
  • Ignoring the domain. lnx\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=1xdxdu = \frac{1}{x}\,dx (the chain rule gives 33x\frac{3}{3x}, which reduces) and v=xv = x.

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

For xlnxdx\int x\ln x\,dx, keep u=lnxu = \ln x but let dv=xdxdv = x\,dx, so v=x22v = \frac{x^2}{2}.

xlnxdx=x22lnxx2dx=x22lnxx24+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?

lnxdx=xlnxx+C\int \ln x\,dx = x\ln x - x + C for x>0x > 0. It comes from integration by parts with u=lnxu = \ln x and dv=dxdv = dx. Differentiating the answer returns lnx+11=lnx\ln x + 1 - 1 = \ln x, which is the fastest way to confirm it.

Why does integrating ln x require integration by parts?

lnx\ln x is not on the basic antiderivative list, and it has no inner function for substitution to target. Parts works because u=lnxu = \ln x differentiates down to 1x\frac{1}{x}, which cancels against v=xv = x and leaves the trivial 1dx\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 lnx\ln x. AB students do need ddx[lnx]=1x\frac{d}{dx}[\ln x] = \frac{1}{x} from Topic 2.7, and they can use it to verify xlnxxx\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 xlnxxx\ln x - x at the endpoints: at x=ex = e you get ee=0e - e = 0, and at x=1x = 1 you get 01=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: logbx=lnxlnb\log_b x = \frac{\ln x}{\ln b}. The constant factors out, giving logbxdx=xlnxxlnb+C\int \log_b x\,dx = \frac{x\ln x - x}{\ln b} + C. Only the natural log avoids the extra lnb\ln b in the denominator.