AP Calculus BC

Integral of ln x / x^2: Parts, Not Substitution

The integral of ln x over x squared is minus the quantity ln x plus one, all divided by x, plus C. Integration by parts with u equal to ln x and dv equal to x to the power minus two dx is the route. Substitution works for ln x over x but not here.

∫ln⁡xx2 dx=−ln⁡x+1x+C\int \frac{\ln x}{x^{2}}\,dx = -\frac{\ln x + 1}{x} + C

Parts, with the power as dv

The two factors point in opposite directions. Logarithms get simpler when differentiated and messier when integrated, so u=ln⁡xu = \ln x. The power x−2x^{-2} integrates without effort, so dv=x−2dxdv = x^{-2}dx, giving du=dxxdu = \frac{dx}{x} and v=−1xv = -\frac{1}{x}.

∫ln⁡xx2 dx=−ln⁡xx+∫1x2 dx\int\frac{\ln x}{x^{2}}\,dx = -\frac{\ln x}{x} + \int\frac{1}{x^{2}}\,dx
=−ln⁡xx−1x+C=−ln⁡x+1x+C= -\frac{\ln x}{x} - \frac{1}{x} + C = -\frac{\ln x + 1}{x} + C

Both terms carry a factor of −1x-\frac{1}{x}, which is why the tidy form combines them over a single denominator. Note that the leftover integral ∫x−2dx\int x^{-2}dx is −1x-\frac{1}{x}, so the second minus sign is earned, not a slip.

One power away from a different problem

Set this beside ∫ln⁡xxdx\int\frac{\ln x}{x}dx. There the leftover factor 1x dx\frac{1}{x}\,dx is exactly d(ln⁡x)d\left(\ln x\right), so u=ln⁡xu = \ln x is a substitution and the answer is (ln⁡x)22+C\frac{\left(\ln x\right)^{2}}{2} + C.

Change the denominator to x2x^{2} and that link breaks. Now 1x2dx\frac{1}{x^{2}}dx is not the differential of anything in the numerator, so substitution no longer finishes the job on its own and parts takes over. Substituting u=ln⁡xu = \ln x does turn the integral into ∫ue−u du\int ue^{-u}\,du, but that one still needs parts. The integrands look almost identical; the deciding step is what differs.

Read the denominator first

With ln x over x, the leftover factor is the derivative of ln x, so it is u substitution. With ln x over x squared, it is not, so it is parts. On the exam, choosing correctly between those two is worth more than executing either one cleanly.

The mistakes students make

The first of these is the one examiners see most, because the two integrands sit next to each other in every textbook.

  • Reusing the answer to ∫ln⁡xxdx\int\frac{\ln x}{x}dx and writing (ln⁡x)22+C\frac{\left(\ln x\right)^{2}}{2} + C. Its derivative is ln⁡xx\frac{\ln x}{x}, which is missing a power of xx.
  • Taking v=1xv = \frac{1}{x} instead of −1x-\frac{1}{x}. That returns ln⁡x+1x+C\frac{\ln x + 1}{x} + C, the exact negative of the correct antiderivative.
  • Integrating numerator and denominator separately, as though ∫ln⁡xx2dx\int\frac{\ln x}{x^{2}}dx were ∫ln⁡x dx∫x2dx\frac{\int \ln x\,dx}{\int x^{2}dx}. No such rule exists.

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

How do you integrate ln x / x^2?

It is −ln⁡x+1x+C-\frac{\ln x + 1}{x} + C, equivalently −ln⁡xx−1x+C-\frac{\ln x}{x} - \frac{1}{x} + C.

Why is ln x over x^2 integration by parts but ln x over x is substitution?

Because substitution needs the derivative of ln⁡x\ln x, which is 1x\frac{1}{x}, present as a factor. It is present in ln⁡xx\frac{\ln x}{x} and absent in ln⁡xx2\frac{\ln x}{x^{2}}.

What is the domain of this antiderivative?

Only x>0x > 0, since ln⁡x\ln x is undefined otherwise. Any definite integral has to stay on the positive side of the origin.