AP Calculus AB and BC

Integral of 1/x: Answer, Proof, and Mistakes

The integral of 1/x is ln|x| + C. The absolute value is not optional: 1/x is defined for every x except 0, and ln|x| is an antiderivative on both sides of 0, while ln x only works for x > 0. Differentiating ln|x| gives 1/x on the negative branch too, since the chain rule contributes a -1 that cancels.

1xdx=lnx+C\int \frac{1}{x}\,dx = \ln|x| + C

Why the answer carries an absolute value

The power rule for antiderivatives handles every exponent except n=1n = -1, because that is the one case where the denominator n+1n+1 collapses to 0. So 1x=x1\frac{1}{x} = x^{-1} needs its own rule, and that rule comes from running the derivative of the natural log backwards.

xndx=xn+1n+1+C,n1\int x^n\,dx = \frac{x^{n+1}}{n+1} + C, \quad n \neq -1

Since ddx[lnx]=1x\frac{d}{dx}[\ln x] = \frac{1}{x}, the function lnx\ln x is an antiderivative of 1x\frac{1}{x}. But lnx\ln x exists only for x>0x > 0, while 1x\frac{1}{x} is defined for every x0x \neq 0. An antiderivative has to live on the same domain as the function it undoes, so lnx\ln x by itself is too small an answer.

1xdx=lnx+C\int \frac{1}{x}\,dx = \ln|x| + C

The bars are the fix, not decoration

lnx\ln|x| is defined for every x0x \neq 0, which is exactly where 1x\frac{1}{x} lives. Writing lnx+C\ln x + C silently discards the entire negative half of the domain.

Checking both branches

For x>0x > 0 the absolute value does nothing, since x=x|x| = x, and the derivative is the familiar one.

x>0:ddx[lnx]=1xx > 0: \quad \frac{d}{dx}\left[\ln x\right] = \frac{1}{x}

For x<0x < 0 we have x=x|x| = -x, so lnx=ln(x)\ln|x| = \ln(-x). The chain rule produces 1x\frac{1}{-x} times the inside derivative 1-1, and the two negatives cancel.

x<0:ddx[ln(x)]=1x(1)=1xx < 0: \quad \frac{d}{dx}\left[\ln(-x)\right] = \frac{1}{-x} \cdot (-1) = \frac{1}{x}

Both branches return 1x\frac{1}{x}, and that is what lets one expression, lnx\ln|x|, cover the whole domain.

A subtlety AP does not test

The domain x0x \neq 0 comes in two disconnected pieces, so strictly the general antiderivative allows a different constant on each: lnx+C1\ln|x| + C_1 for x>0x > 0 and lnx+C2\ln|x| + C_2 for x<0x < 0. AP work expects the single +C+C form, so write lnx+C\ln|x| + C.

The chain rule form you will actually use

Most AP appearances of this integral are a uu-substitution in disguise (Unit 6, Topic 6.9). Whenever the numerator is the derivative of the denominator, the integral is a log.

uudx=lnu+C\int \frac{u'}{u}\,dx = \ln|u| + C

When the inside is linear, substituting u=ax+bu = ax + b gives du=adxdu = a\,dx, so a factor of 1a\frac{1}{a} comes out front. Forgetting that factor is the most common error on these.

1ax+bdx=1alnax+b+C\int \frac{1}{ax+b}\,dx = \frac{1}{a}\ln|ax+b| + C

For example, 32x+5dx\int \frac{3}{2x+5}\,dx has a=2a = 2, so the answer is 32ln2x+5+C\frac{3}{2}\ln|2x+5| + C. Differentiating it gives 3222x+5=32x+5\frac{3}{2} \cdot \frac{2}{2x+5} = \frac{3}{2x+5}, which confirms the constant is right.

When the inside is always positive you may drop the bars, because u=u|u| = u there. That is why 2xx2+1dx=ln(x2+1)+C\int \frac{2x}{x^2+1}\,dx = \ln(x^2+1) + C is written without absolute value.

Where this shows up on the AP exam

The rule belongs to Unit 6, Topic 6.8 (Finding Antiderivatives and Indefinite Integrals: Basic Rules and Notation), and it returns in Topic 6.9 (Integrating Using Substitution). Unit 6 carries a weighting of 15 to 20 percent on both AB and BC, the largest integration block on either exam.

It also drives separable differential equations in Unit 7. Separating the variables in dydx=ky\frac{dy}{dx} = ky leaves 1ydy\int \frac{1}{y}\,dy on the left, so lny\ln|y| is the step that eventually exponentiates into y=Aekxy = Ae^{kx}.

A definite integral that stays on one side of the asymptote behaves normally.

1e1xdx=lneln1=1\int_1^e \frac{1}{x}\,dx = \ln e - \ln 1 = 1

One that crosses x=0x = 0 does not. On BC this is an improper integral (Topic 6.13), and it diverges.

111xdxdiverges\int_{-1}^{1} \frac{1}{x}\,dx \quad \text{diverges}

Mistakes that cost points

  • Writing lnx+C\ln x + C when the domain includes negative xx. The answer is lnx+C\ln|x| + C.
  • Applying the power rule to x1x^{-1} and producing x00\frac{x^0}{0}, which is undefined.
  • Losing the 1a\frac{1}{a} when the inside is ax+bax + b.
  • Calling 111xdx\int_{-1}^{1} \frac{1}{x}\,dx zero by odd symmetry. The integrand is odd, but a symmetry argument needs the integral to converge first, and this one does not.
  • Dropping the constant of integration on an indefinite integral.

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

Why is the integral of 1/x ln|x| and not ln x?

Because 1x\frac{1}{x} is defined for every x0x \neq 0, while lnx\ln x exists only for x>0x > 0. The absolute value extends the antiderivative onto the negative branch, where ddx[ln(x)]=1x(1)=1x\frac{d}{dx}[\ln(-x)] = \frac{1}{-x} \cdot (-1) = \frac{1}{x}.

Is the absolute value always required?

Only when the inside can be negative. If it is guaranteed positive, as in ln(x2+1)\ln(x^2+1), the bars are unnecessary. Keeping them is never wrong, since u=u|u| = u wherever u>0u > 0.

What is the integral of 1/(ax+b)?

1ax+bdx=1alnax+b+C\int \frac{1}{ax+b}\,dx = \frac{1}{a}\ln|ax+b| + C. The substitution u=ax+bu = ax+b gives du=adxdu = a\,dx, which is where the 1a\frac{1}{a} comes from. For instance, 32x+5dx=32ln2x+5+C\int \frac{3}{2x+5}\,dx = \frac{3}{2}\ln|2x+5| + C.

Can you integrate 1/x across x = 0?

No. 1x\frac{1}{x} has a vertical asymptote at x=0x = 0, so an integral such as 111xdx\int_{-1}^{1} \frac{1}{x}\,dx is improper. Split it at 0 and each piece diverges, so the whole integral diverges. Integrals that stay entirely on one side, like 1e1xdx=1\int_1^e \frac{1}{x}\,dx = 1, are ordinary definite integrals.

What is the derivative of ln|x|?

ddx[lnx]=1x\frac{d}{dx}[\ln|x|] = \frac{1}{x} for every x0x \neq 0. That two-sided validity is exactly why lnx\ln|x|, and not lnx\ln x, is the antiderivative of 1x\frac{1}{x}.