The antiderivative of 1/x is ln(x), not ln |x
blog.danielh.ccSir what you wrote down is equivalent to integral 1/x = ln|x| if x > 0 else ln|x| + pi*i
1/x = ln|x| + C if x > 0
ln|x| + pi*i + C or ln|x| - pi*i + C or is x < 0 (Protip: Choose C=-+pi*i)
In reals ln|x| is fine.
In complex, it's a mess https://en.wikipedia.org/wiki/Complex_logarithm