Hello Georg, I agree that log(|x|) is the correct way to do this, consistent with what tables of integrals have to say. (With implicit equations the situation is more complicated but the principle is the same). When 0<a<b,
Int{a,b} (1/x) dx = log(|b|) - log(|a|)
and as long as the Principal Value of the integral is used, this result holds for the other five orderings of a,b,0, including when a and b are on opposite sides of the origin. For a<0<b the PV integral is
lim eps-> 0 ( Int{a,-eps} (1/x) dx + Int{eps, b} (1/x) dx )
substituting y = -x in the first integral leads to
log(eps)-log(-a) + log(b)-log(eps) = log(|b|) - log(|a|)
(In this case the limit eps->0 is not really needed, but when integrating something like g(x)/x where g is well behaved across the origin, g can be expanded in a power series, g0 + g1*x + ... . Then eps-> 0 makes a lot of terms drop out.)
The results above are an all-real calculation. For the complex plane aspect, consider a horizontal line displaced above the x axis by a small amout i *delta. With
z = |z|e^(i*theta) log(z) = log|z| + i*theta,
then as you move along that line from positive x to negative x, you pick up a term of i*pi as you sweep past the origin. So
log(z) = log(|z|) + i*pi z<0 (1)
and there is an imaginary term hanging around. However, let b<0<a and integrate to the left from a to b. The path has to be continuous in the complex plane so the path of integration can be path 1,
Int{a,eps} (1/z) dz + Int{C} (1/z) dz + Int{-eps, b} (1/z) dz
b----<---eps/.\eps----<----a
where C is a semicircle of radius eps. But the integral of (1/z), counterclockwise around that semicircle, is i*pi (consistent with (1)). The other two terms are the PV integral. The result is
log(|b|) - log(|a|) + i*pi Int(path 1).
So what the principal value is saying is: ignore the semicircle, and obtain the all-real solution.
A convenient version for contour integration is obained by considering path 2 that, rather than going over the top with a semicircle, goes underneath with a semicircle. The result is
log(|b|) - log(|a|) - i*pi Int(path 2)
and
principal value = (1/2) (Int(path 1) + Int(path 2))