Why isn't an odd improper integral equal to zero 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?
 A: Regarding your original question: let $f(x)$ be an odd function on $\mathbb R$. We can think of two different ways of computing the improper integral
$$\int_{-\infty}^\infty f(x) dx=\lim_{a\to\infty}\int_{-a}^a f(x) dx,$$
or
$$\int_{-\infty}^\infty f(x) dx=\lim_{a\to -\infty, b\to\infty}\int_a^b f(x) dx.$$
Since $f$ is odd, the first way gives $0$; this is what is called Cauchy Principal Value. However, the proper way to compute the improper integral is the second way. The reason why, is because we want (in some sense) to take the supremum over all intervals $[a,b]\subset \mathbb R$. And this way of computing it is the reason why $f(x)=\dfrac{1}{x}$ (or $f(x)=x$) will give divergent integrals.
A: The Cauchy principal value and other pseudo-functions are common in distribution theory (not only...) and in physics where infinite values are removed nicely when possible (hidden under the carpet with renormalization tricks else... ;-)).
In distribution theory we may always exchange derivation and limit, all derivatives remain distributions, every distribution admits one primitive (up to a global constant) and so on... For these (generous) rules to hold we need tolerant functions so that the derivative of $\log|x|$ for example will be P.V. $\frac 1x$ and not simply $\frac 1x$ (the integral of the last one would not exist !). Curiously multiplication became more difficult when multiplying two $\delta(x)$ for example (even with Colombeau and others ideas) but we can't have everything... 
Distribution theory is much used in advanced part of physics (with great names like Sobolev, Gel'fand, Dirac and later Schwartz bringing the mathematical respectability) because it allows for example to handle discrete values as well as continuous spectra in an unified way but let's stop the propaganda and come to your second part... 
Concerning your "integral of cos/sin from 0 to pi" not evaluated by Alpha. Well it seems that the software didn't considerer compensation of singularities at two finite points (I don't know if Alpha handles compensations at $-\infty$ and $+\infty$ but it could consider them as the same 'point' $\infty=\frac 10$). For physical application you would have to specify the limits say 'from $\epsilon$ to $\pi-\epsilon$' as $\epsilon \to 0$. 
A: 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.
A: In order for the Riemann integral, or any stronger integrals, of an odd function over an interval symmetric about a root, to be $0$, it is necessary that the function be Riemann integrable over said interval. If the function is not integrable, then the integral does not exist, regardless of what your intuition may tell you about what the integral should equal. And thus, this is precisely the problem with integrating a function such as $f : \mathbb R \setminus\{0\} \rightarrow \mathbb R, f(x) \equiv \frac1x$ on $[-1,1]$: $f$ is not Riemann integrable on this interval. So any integral of $f$ on an interval containing $0$ does not exist.
