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
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.
Worked examples
Retain the absolute value.
The numerator matches the inner derivative.
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
Why it fails
The power formula is undefined at n=−1.
Correction
Incorrect attempt
Why it fails
ln(x) is not real for negative x.
Correction
Practice the same idea with a changed structure
Name the rule and its conditions before revealing the reference answer. Explain every sign and factor.
Check before solving
The numerator matches the inner derivative.
Reveal the reference answer
Reference answer
Check before solving
The interval avoids zero.
Reveal the reference answer
Reference answer
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: IntegralsFrequently 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