Calculate Fourier Transform of $\frac{\sin^2(x)}{x^2}$ for $k\in[0,2]$ So here we have that the Fourier Transform equals:
$$\int_{-\infty}^{\infty}\frac{\sin^2(x)}{x^2}e^{-ikx}dx=-\frac{1}{4}\int_{-\infty}^{\infty}\frac{-2e^{-ikx}+e^{i(2-k)x}+e^{-i(2+k)x}}{x^2}dx$$.
Now since $k\in[0,2]$, for contour integration, we consider the LHP for the first and third term in the integrand and then the UHP for the second term.
If we call $C_{\epsilon,U}$ the semi-circle of radius $\epsilon$ in the UHP, $C_{\epsilon,L}$ the semi-circle of radius $\epsilon$ in the LHP, $C_{R,U}$ the semi-circle of radius $R$ in the UHP, $C_{R,L}$ the semi-circle of radius $R$ in the UHP, with closed contours $\Gamma_{U}$ and $\Gamma_{L}$, we have:
$$\int_{-\infty}^{\infty}=\lim_{R\to\infty}\lim_{\epsilon\to 0}\Bigg(\int_{\Gamma_U}-\int_{C_{\epsilon,U}} -\int_{C_{R,U}}\Bigg) \text{ for the second term}$$
$$\int_{-\infty}^{\infty}=\lim_{R\to\infty}\lim_{\epsilon\to 0}\Bigg(-\int_{\Gamma_L}-\int_{C_{\epsilon,L}} -\int_{C_{R,L}}\Bigg) \text{ for the remaining terms}$$
(Note the negative sign in line 2 due to negative orientation of $\Gamma_L$)
No poles lie inside the closed $\Gamma_U$ and $\Gamma_L$ so the first integral on the RHS of each line is zero, and the last integral on the RHS each line $\to 0$ as $R\to \infty$.
So, for the top line, we're left with:
$$ -\frac{1}{4}\int_{-\infty}^{\infty}\frac{e^{i(2-k)x}}{x^2}dx=\frac{1}{4}\lim_{\epsilon\to 0}\int_{C_{\epsilon,U}}\frac{e^{i(2-k)z}}{z^2}dz=\frac{1}{4}\lim_{\epsilon\to 0}\int_{\pi}^{0}\frac{e^{i(2-k)\epsilon e^{i\theta}}}{\epsilon^2e^{2i\theta}}i\epsilon e^{i\theta}d\theta$$.
Expanding $e^{i(2-k)\epsilon e^{i\theta}}=1+i(2-k)\epsilon e^{i\theta}+...$ (can ignore higher order terms as they tend to $0$ as $\epsilon \to 0$).
So we get (for the second term in the original integrand): $$-\frac{1}{4}\lim_{\epsilon\to 0}\int_{0}^{\pi}\frac{1+i(2-k)\epsilon e^{i\theta}}{\epsilon^2e^{2i\theta}}i\epsilon e^{i\theta}d\theta=-\frac{1}{4}\lim_{\epsilon\to 0}\int_{0}^{\pi}\frac{ie^{-i\theta}}{\epsilon}d\theta+\frac{1}{4}\int_{0}^{\pi}(2-k)d\theta=-\frac{1}{4}\lim_{\epsilon\to 0}\frac{2}{\epsilon}+\frac{1}{4}(2-k)\pi$$
Now when we consider the remaining terms (the 1st and 3rd terms in the original integrand, using the LHP), using the same method I get:
$$-\frac{1}{4}\int_{-\infty}^{\infty}\frac{-2e^{-ikx}+e^{-i(2+k)x}}{x^2}dx$$
$$=\frac{1}{4}\lim_{\epsilon\to 0}\int_{-\pi}^{0}\frac{-2(1-i\epsilon e^{i\theta}k+...)+(1-i\epsilon e^{i\theta}(2+k)+...)}{\epsilon^2e^{2i\theta}}i\epsilon e^{i\theta}d\theta$$ $$=\frac{1}{4}\lim_{\epsilon\to 0}\int_{-\pi}^{0}-\frac{ie^{-i\theta}}{\epsilon}d\theta+\frac{1}{4}\int_{-\pi}^{0}(2-k)d\theta= \frac{1}{4}\lim_{\epsilon\to 0}\frac{2}{\epsilon}+\frac{1}{4}(2-k)\pi$$
So adding both integrals together, I get that the Fourier transform is $\pi(1-\frac{1}{2}k)$. Is this correct? I feel like I may have gone wrong somewhere?
 A: BRUTE FORCE METHODOLOGY:
Not quite.  There is a subtle error in the rigor applied.  The limiting operation (as $\varepsilon\to 0$) cannot be separated.
So, to proceed rigorously, we denote the integral of interest as $F(k)$ and write
$$\begin{align}
F(k)&=\int_{-\infty}^\infty \frac{\sin^2(x)}{x^2}e^{-ikx}\,dx\\\\
&=\frac14\int_{-\infty}^\infty \frac{2e^{-ikx}-e^{-i(k-2)x}-e^{-i(k+2)x}}{x^2}\,dx\\\\
&=\frac14 \lim_{\varepsilon\to 0^+}\left(\int_{|x|\ge \varepsilon} \frac{2e^{-ikx}-e^{-i(k+2)x}}{x^2}\,dx- \int_{|x|\ge \varepsilon} \frac{e^{-i(k-2)x}}{x^2}\,dx\right)\tag1
\end{align}$$
Now we analyze the following closed contour integrals, $I_1$ and $I_2$, with $0<\varepsilon<R$, as given by
$$\begin{align}
I_1&=\int_{R\ge |x|\ge \varepsilon} \frac{2e^{-ikx}-e^{-i(k+2)x}}{x^2}\,dx\\\\
&+\int_{\pi}^{2\pi}\frac{2e^{-ik\varepsilon e^{i\phi}}-e^{-i(k+2)\varepsilon e^{i\phi}}}{(\varepsilon e^{i\phi})^2}\,i\varepsilon e^{i\phi}\,d\phi\\\\
&+\int_{2\pi}^{\pi}\frac{2e^{-ikR e^{i\phi}}-e^{-i(k+2)R e^{i\phi}}}{(R e^{i\phi})^2}\,iR e^{i\phi}\,d\phi\tag2
\end{align}$$
and
$$\begin{align}
I_2&=\int_{R\ge |x|\ge \varepsilon} \frac{e^{-i(k-2)x}}{x^2}\,dx\\\\
&+\int_{\pi}^{0}\frac{e^{-i(k-2)\varepsilon e^{i\phi}}}{(\varepsilon e^{i\phi})^2}\,i\varepsilon e^{i\phi}\,d\phi\\\\
&+\int_{0}^{\pi}\frac{e^{-i(k-2)R e^{i\phi}}}{(R e^{i\phi})^2}\,iR e^{i\phi}\,d\phi\tag3
\end{align}$$
As $R\to \infty$, the third integrals on the right-hand sides of $(2)$ and $(3)$ vanish.  Application of Cauchy's Integral Theorem guarantees that
$$\begin{align}
F(k)&=\frac14 \lim_{\varepsilon \to 0^+}\left(-\int_{0}^{\pi}\frac{e^{-i(k-2)\varepsilon e^{i\phi}}}{(\varepsilon e^{i\phi})^2}\,i\varepsilon e^{i\phi}\,d\phi-\int_{\pi}^{2\pi}\frac{2e^{-ik\varepsilon e^{i\phi}}-e^{-i(k+2)\varepsilon e^{i\phi}}}{(\varepsilon e^{i\phi})^2}\,i\varepsilon e^{i\phi}\,d\phi\right)\\\\
&=\pi(1-k/2)
\end{align}$$
as expected.


ALTERNATIVE METHODOLOGY:
I thought it might be instructive to present an alternative, simpler solution.  We begin by integrating by parts the original integral with $u=2e^{-ikx}-e^{-i(k-2)x}-e^{-i(k+2)x}$ and $dv=-\frac1{4x}$.  Proceeding, we find that
$$\begin{align}
F(k)&=-\int_{-\infty}^\infty \frac{-i2k e^{-ikx}+i(k-2)e^{-i(k-2)x}+i(k+2)e^{-i(k+2)x}}{4x}\,dx\\\\
&=-\frac\pi 2 k\,\text{sgn}(k)+\frac\pi4 (k-2)\,\text{sgn}(k-2)+\frac\pi4 (k+2)\,\text{sgn}(k+2)\\\\
&=\begin{cases}
0&,|k|>2\\\\
\pi(1-|k|/2)&,0\le |k|\le 2\\\\
\end{cases}
\end{align}$$
