# Principal value of integral

What is the principal value of the integral $$\int \limits _0^\infty \left( \frac {1}{x^2}-\frac{\cot(x)}{x} \right) dx ?$$ Maple finds $PV \int_0^\infty \tan(x)/x dx = \pi/2.$ Such integrals arise in physics. I unsuccessfully asked it in SE.

-
@Mark: Could you link the corresponding math.stackexchange post? Thanks. –  user11000 May 14 '13 at 7:44
@user11000: math.stackexchange.com/questions/384291/… –  Mark May 14 '13 at 7:52
Since there are multiple poles, I do not know what "principal value" means. Perhaps you can provide a definition? –  Gerald Edgar May 14 '13 at 12:18
I would presume each pole at $x_n=n\pi$ is excluded in an interval $(x_n-\epsilon,x_n+\epsilon)$, and then the limit $\epsilon\rightarrow 0$ is taken. –  Carlo Beenakker May 14 '13 at 13:12
@Gerald: it is equivalent to the textbook definition ${\cal P}\int_a^b dx f(x)=\frac{1}{2} \lim_{\epsilon\rightarrow 0}\left(\int_{a-i\epsilon}^{b-i\epsilon} dx f(x)+ \int_{a+i\epsilon}^{b+i\epsilon} dx f(x)\right)$ –  Carlo Beenakker May 14 '13 at 14:28

formula 3.749.2 from Gradshteyn & Ryzhik gives:

$$\int_0^{\infty}\frac{1-x\;{\rm cotan}x}{x^2+\epsilon^2}dx=\frac{\pi}{2\epsilon}-\frac{\pi}{e^{2\epsilon}-1}\quad{\rm for}\quad \epsilon>0.$$

taking the limit $\epsilon\downarrow 0$ gives your $\pi/2$; G&R do not explicitly say that their formula is a principal value integral, but it's the only sensible way to avoid the poles of the cotangent at $\pi,2\pi,...$; note that there is no singularity at $x=0$, so the limit $\epsilon\downarrow 0$ gives no ambiguity.

Here's the derivation by contour integration, as promised. The integral over $1/(x^2+\epsilon^2)$ is elementary, so I only do the one involving the cotangent:

$${\cal P}\int_{0}^{\infty}dx\frac{x\;{\rm cotan}x}{x^2+\epsilon^2}= \frac{1}{4}\lim_{\delta\rightarrow 0}\left(\int_{-\infty+i\delta}^{\infty+i\delta}dx\frac{x\;{\rm cotan}x}{x^2+\epsilon^2}+ \int_{-\infty-i\delta}^{\infty-i\delta}dx\frac{x\;{\rm cotan}x}{x^2+\epsilon^2}\right)$$

$$=\frac{1}{4}\lim_{\delta\rightarrow 0}\left(\int_{-\infty+i\delta}^{\infty+i\delta}\frac{dx}{\sin x}\frac{x\;e^{ix}}{x^2+\epsilon^2}+ \int_{-\infty-i\delta}^{\infty-i\delta}\frac{dx}{\sin x}\frac{x\;e^{-ix}}{x^2+\epsilon^2}\right)$$

$$=\frac{1}{4}\lim_{\delta\rightarrow 0}\left(\int_{-\infty+i\delta}^{\infty+i\delta}\frac{dx}{\sin x}\frac{x\;e^{ix}}{x^2+\epsilon^2}+ \int_{-\infty-i\delta}^{\infty-i\delta}\frac{dx}{\sin x}\frac{x\;e^{-ix}}{x^2+\epsilon^2}\right)$$

$$=\frac{1}{4}\left(\int_{C_+}\frac{dz}{z-i\epsilon}\frac{z\;e^{iz}}{(z+i\epsilon)\sin z}+ \int_{C_-}\frac{dz}{z+i\epsilon}\frac{z\;e^{-iz}}{(z-i\epsilon)\sin z}\right)$$

$$=\frac{1}{4}\times 2\pi i\times\left(\lim_{z\rightarrow i\epsilon}\frac{z\;e^{iz}}{(z+i\epsilon)\sin z}- \lim_{z\rightarrow -i\epsilon}\frac{z\;e^{-iz}}{(z-i\epsilon)\sin z}\right)$$

$$=\frac{1}{4}\times 2\pi i\times 2\times \frac{1}{\sin i\epsilon}\frac{i\epsilon\;e^{-\epsilon}}{2i\epsilon}$$

$$=\frac{\pi}{e^{2\epsilon}-1}$$

In the first equality I inserted the definition of principal value; in the second equality I used that $xe^{\pm ix}/\sin x = x\;{\rm cotan}x\pm ix$ and the second term vanishes upon integration because it is an odd function of $x$; in the third and following equalities I have closed the contour in the upper half of the complex plane for the first integral (contour $C_+$, picking up the pole at $z=i\epsilon$), and in the lower half of the complex plane for the second integral (contour $C_-$, pole at $z=-i\epsilon$). And so I arrive at the answer from Gradshteyn & Ryzhik, confirming that theirs was indeed a principal value result.

-
@Carlo Beenakker: I am grateful to you for your interest to the question and your answer. I vote it up. However, this formula gives the answer, but not the method. Also the passage to the limit as $\epsilon \downarrow 0$ should be more sound because we deal with the principal value of the specific improper integral with $\cot (x)$. As far as I understand it, that notion uses two limits by itself. –  Mark May 14 '13 at 15:09
the integral can be done as a contour integral in the complex plane, using the definition of principal value which I gave in a comment to your question above (so as the average of a contour closed in the upper and lower half of the complex plane, once picking up the pole at $x=i\epsilon$ and once at $x=-i\epsilon$; I will try to add this calculation to my answer later today. –  Carlo Beenakker May 14 '13 at 16:06
Could you explain the last equality in detail? –  Mark May 14 '13 at 17:36
I added several more intermediate steps; is it clear now? –  Carlo Beenakker May 14 '13 at 18:15

Yes the value $\pi/2$ can be obtained like this.

Let $$f(x):=\frac {1}{x^2}-\frac{\cot(x)}{x}$$

We may compute $$\int_0^{\pi/2} f(x)\;dx + \sum_{k=1}^\infty \int_0^{\pi/2}\big(f(k\pi+x)+f(k\pi-x)\big)\;dx=\frac{\pi}{2} \tag{1}$$ and this converges.

We can think of (1) as a "rearrangement" of the required integral. But the integrands in (1) are positive: Use $\cot x > 0$ for $0 < x < \pi/2$ and $\cot(k\pi+x) = \cot x$ and $\cot(k\pi-x) = -\cot x$. Also $(1/x) - \cot x$ increases from $0$ on $(0,\pi/2)$, so $f(x) >0$ on $(0,\pi/2)$. Next $$f(k\pi+x)+f(k\pi-x) = \left(\frac{1}{(k\pi+x)^2}+\frac{1}{(k\pi-x)^2}\right) + \left(\frac{-1}{k\pi+x}+\frac{1}{k\pi-x}\right)\cot x$$ and each of the two halves is positive on $(0,\pi/2)$. Recall $$\sum_{k=1}^\infty \left(\frac{1}{(k\pi+x)^2}+\frac{1}{(k\pi-x)^2}\right) = \csc^2 x - \frac{1}{x^2}$$

$$\sum_{k=1}^\infty\left(\frac{-1}{k\pi+x}+\frac{1}{k\pi-x}\right)=\frac{1}{x}-\cot x$$

$$\sum_{k=1}^\infty\left(\frac{-1}{k\pi+x}+\frac{1}{k\pi-x}\right)\cot x=\frac{\cot x}{x}-\cot^2 x$$

Our answer is the sum of three integrals:

$$\int_0^{\pi/2} \left[\left(\frac{1}{x^2}-\frac{\cot x}{x}\right)+\left(\csc^2 x-\frac{1}{x^2}\right)+\left(\frac{\cot x}{x}-\cot^2 x\right)\right]dx = \int_0^{\pi/2} 1\;dx = \frac{\pi}{2}$$

-
Could you state this in detail? –  Mark May 14 '13 at 17:21
In my opinion, your excellent proof is somewhat tricky, since nontrivial identities are used. However, I vote it up. –  Mark May 15 '13 at 11:00

There exists still another way to calculate this integral. Namely, let (the principal values are assumed) $I_1=\int\limits_0^\infty \left (\frac{1}{x^2}-\frac{\cot{x}}{x}\right )dx$ and $I_2=\int\limits_0^\infty \frac{\tan{x}}{x}dx$. Then $$I_1+I_2=\int\limits_0^\infty \left (\frac{1}{x^2}-2\frac{\cot{(2x)}}{x} \right )dx=2I_1.$$ This shows that $I_1=I_2$, so let's concentrate on $I_2$. That follows is (somewhat elaborated) calculations of Daryl McCullough from http://mathforum.org/kb/message.jspa?messageID=5667982 We have ($\epsilon\to 0$ limit is assumed) $$I_2=\sum\limits_{n=0}^\infty\left [ \int\limits_{n\pi}^{n\pi+\pi/2-\epsilon}\frac{\tan{x}}{x}dx+\int\limits_{n\pi+\pi/2+\epsilon}^{(n+1)\pi}\frac{\tan{x}}{x}dx \right ]=\sum\limits_{n=0}^\infty\left [ \int\limits_0^{\pi/2-\epsilon}\frac{\tan{(x+n\pi)}}{x+n\pi}dx+\int\limits_{\pi/2+\epsilon}^{\pi}\frac{\tan{(x+n\pi)}}{x+n\pi}dx \right ].$$ But for integer $n$, $\tan{(x+n\pi)}=\tan{x}$, and after the substitution $y=\pi-x$ in the second integral, we get $$I_2=\sum\limits_{n=0}^\infty\int\limits_0^{\pi/2-\epsilon}\tan{x}\left[\frac{1}{x+n\pi}+\frac{1}{x-(n+1)\pi}\right ] dx=\int\limits_0^{\pi/2-\epsilon}\frac{\tan{x}}{x}+$$ $$\sum\limits_{n=1}^\infty\int\limits_0^{\pi/2-\epsilon}\tan{x}\left[\frac{1}{x+n\pi}+\frac{1}{x-n\pi}\right ] dx.$$ But $\frac{1}{x+n\pi}+\frac{1}{x-n\pi}=\frac{2x}{x^2-n^2\pi^2}$ are all negative for $n=1,2,\ldots$ and $x\in(0,\pi/2)$. Therefore we can use Tonelli's theorem to justify changing the order of the summation and integration in the second term. Hence $$I_2=\int\limits_0^{\pi/2-\epsilon}\tan{x}\left [\frac{1}{x}+\sum\limits_{n=1}^\infty\left (\frac{1}{x+n\pi}+\frac{1}{x-n\pi}\right)\right ]dx.$$ It remains to recall the Euler's formula for $\cot{x}$: $$\cot(x)=\frac{1}{x}+\sum\limits_{n=1}^\infty\left (\frac{1}{x+n\pi}+\frac{1}{x-n\pi}\right),$$ and the result $I_2=\frac{\pi}{2}$ follows immediately (because $\tan{x}\cot{x}=1$).

-