Logarithmic integrals

Integral of 1/x: Why It Is ln|x| + C

The reciprocal has the same logarithmic antiderivative on the positive and negative half-lines. Absolute value combines those formulas without erasing the singularity.

Direct answer

∫1x dx=ln⁡∣x∣+C\int \frac{1}{x}\,\mathrm{d}x = \ln\left|x\right| + C

The integrand is defined only for x≠0, so antiderivatives live on intervals that do not cross zero.

When to use integral of 1/x

Choose the method from the top-level mathematical structure before manipulating symbols. Conditions are part of the task, not optional notes.

Ask first 1

Which structure controls the method?

What to do

Look for g′(x)/g(x), which integrates to ln|g(x)|.

Ask first 2

Which condition can change the answer?

What to do

The integrand is defined only for x≠0, so antiderivatives live on intervals that do not cross zero.

Ask first 3

How should the result be checked?

What to do

Differentiate ln|g(x)| and verify the original ratio on the stated interval.

Differentiate ln|x| on each side

For x>0, ln|x|=ln(x) and the derivative is 1/x.

For x<0, ln|x|=ln(−x), whose chain-rule derivative is again 1/x.

At zero neither expression is defined.

Constants can differ on disconnected intervals, and a definite integral crossing zero needs improper-integral analysis.

1
x>0: [ln(x)]'=1/x
2
x<0: [ln(−x)]'=1/x
3
∫1x dx=ln⁡∣x∣+C\int \frac{1}{x}\,\mathrm{d}x = \ln\left|x\right| + C

Worked examples

∫1x dx\int \frac{1}{x}\,\mathrm{d}x
ln⁡∣x∣+C\ln\left|x\right| + C

Retain the absolute value.

∫22 x+3 dx\int \frac{2}{2\,x + 3}\,\mathrm{d}x
ln⁡∣2 x+3∣+C\ln\left|2\,x + 3\right| + C

The numerator matches the inner derivative.

∫121x dx\int_{1}^{2} \frac{1}{x}\,\mathrm{d}x
ln⁡2\ln 2

The interval avoids zero.

Common mistakes

  • • Writing ln(x) for negative x.
  • • Using the power rule at exponent −1.
  • • Crossing zero directly.
  • • Dropping the inner factor.

Error clinic: locate the first invalid step

Incorrect attempt

∫1x dx=x00\int \frac{1}{x}\,\mathrm{d}x = \frac{x^{0}}{0}

Why it fails

The power formula is undefined at n=−1.

Correction

ln⁡∣x∣+C\ln\left|x\right| + C

Incorrect attempt

ln(x)+C for all x≠0

Why it fails

ln(x) is not real for negative x.

Correction

ln⁡∣x∣+C\ln\left|x\right| + C

Practice the same idea with a changed structure

Name the rule and its conditions before revealing the reference answer. Explain every sign and factor.

∫22 x+3 dx\int \frac{2}{2\,x + 3}\,\mathrm{d}x

Check before solving

The numerator matches the inner derivative.

Reveal the reference answer

Reference answer

ln⁡∣2 x+3∣+C\ln\left|2\,x + 3\right| + C
∫121x dx\int_{1}^{2} \frac{1}{x}\,\mathrm{d}x

Check before solving

The interval avoids zero.

Reveal the reference answer

Reference answer

ln⁡2\ln 2

Try the worked examples in the calculator

Each link opens the matching calculator with the expression, variable and required conditions already filled in.

Open the calculator without a preset: Integrals

Frequently asked questions

Why not use the power rule?+

The antiderivative formula would divide by n+1=0 when n=−1.

Can C differ on each side?+

Yes, because the domain has disconnected intervals.

Does ∫ from −1 to 1 exist?+

Not as an ordinary improper integral; each side diverges.

Conclusion

Use ln|x| away from zero, preserve the domain break, and never treat a singular interval as an ordinary endpoint evaluation.

Compare usage plans