My calculus book says that the integral of $\frac1x$ cannot cross zero. Now it seems obvious that because of symmetry, there will always be an interval whose integrals are equal in magnitude and opposite insign, so cancel, even though they do not converge.
Now typing into wolframalpha I got "does not converge" and only at the bottom did the expected result appeared ($\ln|b|-\ln|a|$) as "Cauchy principal value" (CPV, which I looked up on wikipedia). Why that fancyness? Does this has some implications in some application area?
And also, when I ask wolframalpha about "integral of cos/sin from $0$ to $\frac\pi2$", I get infinity (intuitive, looking at the plot, although $\ln|sin(\frac\pi2)|-\ln|sin(0)|$ is admittedly wrong ) as "CPV", but when I ask for "integral of cos/sin from $0$ to $\pi$" which I expect to be zero, because the plot is symmetric/odd I get "does not converge" and there is no CPV result either. Why?
Regarding the problem $$\int_a^b{\frac{1}{x}dx}$$ the fundamental theorem of calculus requires that the function be continuous over the interval $(a, b)$, and while $f(x) = \frac{1}{x}$ is continuous over its domain (which is $(-\infty, 0)\cup (0, +\infty)$), it is not continuous over an interval that crosses 0. So the integral can be found using CPV.
As for integrating $\cot(x)$ over the interval $(0, \frac{\pi}{2})$, note that $\sin{(0)} = 0$, and the domain of logarithmic functions is strictly positive. Equivalently, $$\ln{\left|\sin{\left(\frac{\pi}{2}\right)}\right|} - \ln{|\sin(0)|} = \ln{\left|\frac{\sin{\left(\frac{\pi}{2}\right)}}{\sin{(0})}\right|}$$
which causes division by zero, so can't be used.