-Log[-x]
is not a correct result, but Log[-x]
is.
In fact the expressions Log[-x]
and Log[x]
differ only in a constant I Pi
, so both are correct antiderivatives for all $x \in \mathbb{C}$.
While the result given by Mathematica is correct, it is complex valued for x < 0
. I think you are looking for a real valued result. I do not think it is possible to ask Integrate
to automatically provide one.
For definite integrals this won't be a problem though as that complex constant is cancelled:
Integrate[1/x, {x, a, -1}, Assumptions -> a < -1]
(* ==> -Log[-a] *)
Log[-x]
, not-Log[-x]
. $\endgroup$