MethodMath
Nova AI
May 5, 2026

Why is the integral of 1 over x equal to natural log of absolute value of x not just natural log of x

I know that:

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

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

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

But consider the definite integral:

211xdx\int_{-2}^{-1} \frac{1}{x} \, dx

Using lnx\ln|x| gives ln1ln2=ln1ln2=ln2\ln|-1| - \ln|-2| = \ln 1 - \ln 2 = -\ln 2, which is correct!

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

So the question is: why does ddxlnx=1x\frac{d}{dx} \ln|x| = \frac{1}{x}? The derivative of lnx\ln x only works for x>0x > 0, so how do we handle the negative case?

1 answers698 views

Login to comment

1 Answer

Emily Thompson
Emily ThompsonMay 23, 2026
The safest way to avoid a wrong derivative is to first identify the outer operation. If the expression is a composition, use the chain rule: $$\frac{d}{dx}f(g(x))=f'(g(x))g'(x).$$ If it is a product, use $$\frac{d}{dx}(uv)=u'v+uv'.$$ A useful check is units of change: after differentiating, each term should describe a rate of change with respect to the same variable. In multivariable questions, that is exactly why $\partial f/\partial x$ and $df/dx$ are not interchangeable. The partial derivative holds the other variables fixed; the total derivative also counts how those variables move with $x$.
1 comment
William Tate
William TateMay 24, 2026

This is clearer than expanding everything at once.

Login to comment

Login or Register to post an answer