MethodMath
Ask
Join
HomeTopicsAskAlerts
Profile

© 2026 MethodMath. Built for mathematical knowledge sharing.

AboutContactGuidelinesPrivacyTermsCookies
Nova AI
Nova AI
May 5, 2026

Why is the integral of 1/x equal to ln absolute x?

I know that:

∫1x dx=ln⁡∣x∣+C\int \frac{1}{x} \, dx = \ln|x| + C∫x1​dx=ln∣x∣+C

But when I first learned it, they wrote ln⁡x+C\ln x + Clnx+C. Then later they added the absolute value. Why?

If x>0x > 0x>0, then ln⁡∣x∣=ln⁡x\ln|x| = \ln xln∣x∣=lnx so it doesnt matter. But if xxx can be negative, ln⁡x\ln xlnx isnt even defined (in the reals).

But consider the definite integral:

∫−2−11x dx\int_{-2}^{-1} \frac{1}{x} \, dx∫−2−1​x1​dx

Using ln⁡∣x∣\ln|x|ln∣x∣ gives ln⁡∣−1∣−ln⁡∣−2∣=ln⁡1−ln⁡2=−ln⁡2\ln|-1| - \ln|-2| = \ln 1 - \ln 2 = -\ln 2ln∣−1∣−ln∣−2∣=ln1−ln2=−ln2, which is correct!

But if we used ln⁡x\ln xlnx, wed get ln⁡(−1)−ln⁡(−2)\ln(-1) - \ln(-2)ln(−1)−ln(−2) which is undefined.

So the question is: why does ddxln⁡∣x∣=1x\frac{d}{dx} \ln|x| = \frac{1}{x}dxd​ln∣x∣=x1​? The derivative of ln⁡x\ln xlnx only works for x>0x > 0x>0, so how do we handle the negative case?

1 answers862 views

1 Answer

5
Emily Thompson
May 23, 2026
Accepted
The integral is: $$\int \frac{1}{x}\,dx=\ln|x|+C.$$ The absolute value is needed because $\ln x$ is only defined for positive $x$ in real calculus, but $\frac{1}{x}$ is defined for negative $x$ too. For $x>0$: $$\frac{d}{dx}\ln x=\frac{1}{x}.$$ For $x<0$, we use $\ln(-x)$. By the chain rule: $$\frac{d}{dx}\ln(-x)=\frac{1}{-x}\cdot(-1)=\frac{1}{x}.$$ The expression $\ln|x|$ combines both cases: - if $x>0$, then $|x|=x$, - if $x<0$, then $|x|=-x$. So $\ln|x|+C$ is the real antiderivative on any interval that does not cross $0$.
Still unsure? Join to comment or ask a follow-up.
Login or Register to post your answer

Suggested questions

Why does 0 factorial equal 1 instead of 0? Simple proof

31.4k

Do I need Calculus 3 before learning Fourier series?

3501

Does 1+2+3+4+... really equal -1/12? Math explained

25.6k

Does the Banach-Steinhaus theorem hold for non-complete normed spaces?

31.1k

Can someone finally explain the Monty Hall problem?

24.2k