Skip to content

The antiderivative of 1/x is ln(x), not ln |x|

The antiderivative of 1x is commonly shown to be ln|x|, since the graph of lnx doesn't show anything where x<0. However, looking more closely, ln|x| can be rewritten as follows:

ln|x|={ln(x)if x<0lnxif x>0

Additionally, since an antiderivative can be offset by an arbitrary constant, ln|x|+3 is also a valid antiderivative. But going back to the piecewise function — since 1x is undefined at x=0, each piece can be offset by a different constant, like this:

1xdx={ln(x)+5if x<0lnx+3if x>0

Using this fact, I could choose the constants in a specific way:

1xdx={ln(x)+iπif x<0lnxif x>0

This is just as valid as an antiderivative, and is equivalent to taking the principal branch of lnx for negative values of x.

In fact, if the domain is extended to complex numbers, ln|x| is not differentiable at all in complex analysis, leaving only lnx as the antiderivative.