When $x<0, \quad \int \frac{1}{x}\,dx = \ln (-x) + \text{const.}$
Mathematica calculates this
Assuming[x < 0, Integrate[1/x, x]]
as
Log[x]
(It's understood that Mathematica drops the constant, okay, but the argument for the logarithm should be positive!
Any ideas?
Log[x]is the complex logarithm (with a certain standard branch cut, namely, the negative real axis) whose derivative is1/xexcept technically along the branch cut though one can pick a different branch cut,Abs[]is the complex absolute value, andLog[Abs[x]]is not complex-differentiable (so it cannot be the antiderivative). In any case, the different branches differ by a constant; as a general antiderivative therefore, it can be adapted to particular cases. – Michael E2 Aug 12 '21 at 23:44Assuming[x < 0, Integrate[1/x, x, GeneratedParameters -> C]]– flinty Aug 13 '21 at 13:58