The following question comes from the A sine integral post, in which user26872 proved the following: $$\int_{-\infty}^\infty \left(\frac{\sin x}{x}\right)^n dx=\frac{1}{(2i)^n}\sum_{k=0}^n(-1)^k \binom{n}{k}\int_{-\infty}^\infty \frac{e^{(n-2k)ix}}{x^n}dx$$$$=\frac{1}{(2i)^n}\sum_{k=0}^{\lfloor n/2 \rfloor}(-1)^k \binom{n}{k}\int_{-\infty}^\infty \frac{e^{(n-2k)ix}}{x^n}dx$$
This then leads to the use of Cauchy's differentiation formula to get: $$\int_{-\infty}^\infty \left(\frac{\sin x}{x}\right)^n dx=\frac{\pi}{(n-1)!}\sum_{k=0}^{\lfloor n/2\rfloor} (-1)^k \binom{n}{k}\left(\frac{n}{2}-k\right)^{n-1}$$
which gives the exact value of the integral for any positive integer value of n. I was able to prove this with a long and cumbersome derivation using the Laplace transform, but this user used contour integration. However, they did not specify how the contour was defined. I think it is a diameter from -R to R on the real axis then a semicircle in the lower half-plane back to -R, in the limit as $R\rightarrow\infty$, as it is easy to show that the integral over the arc tends to 0, thus making the integral over the contour equal to the integral over the real axis.
I'm fairly new to contour integration and complex analysis, which is why I wasn't able to understand why, using this technique, the upper limit of the sum changes from n to $\lfloor n/2 \rfloor$. The user specified a condition that if $n-2k\geq0$ (which means the max value of k would be $\lfloor n/2 \rfloor$), they would close the contour in the upper half-plane. But why?
Thanks!
The key observation here is as follows: if $z = a + ib$ with $a,b\in \Bbb R$, then $e^{itz} = e^{-tb+ita}$ and hence $|e^{itz}| = e^{-tb}$, where $t\in \Bbb R$.
In order for the countour integration to work, we want the integral in the circular arc to vanish as the radius goes to infinity, so that only the integral along the real line remains. This means that
$$\left|\frac{e^{iz(n-2k)}}{z^n}\right|$$
must approach $0$ as the radius goes to infinity.
If $t = n-2k\geqslant 0$, then the observation above guarantees that the semi-circular arc in the upper half-plane does the job, because in this case $|e^{iz(n-2k)}|$ remains bounded.
If $t = n-2k<0$, then the situation is reversed, and we must take the semi-circular arc in the lower half-plane to ensure boundedness.