principal value of $\int_{-\infty}^{\infty}\frac{\sin^2(x)}{x^2}\mathrm{d}x$ I know the answer is $\pi$ there is a proof
here.
Now looking to my textbook (textbook image) the result should be $0$.
Using the last equation on the right hand page we have:
$$ i\pi(\sin^2(x))'|_{x=0} = 0 $$
and there are no other poles except $0$ so the result should be $0$. 
What is the problem? Is the definition for principal value different in the two cases?
 A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\iff}{\Leftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\, #2 \,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
\begin{align}
\color{#f00}{\int_{-\infty}^{\infty}{\sin^{2}\pars{x} \over x^{2}}\,\dd x} & =
\int_{-\infty}^{\infty}\
\overbrace{\bracks{\half\int_{-1}^{1}\expo{\ic kx}\,\dd k}}
^{\ds{{\sin\pars{x} \over x}}}\
\overbrace{\bracks{\half\int_{-1}^{1}\expo{-\ic qx}\,\dd q}\,\dd x}
^{\ds{{\sin\pars{x} \over x}}}
\\[3mm] & =
{\pi \over 2}\int_{-1}^{1}\int_{-1}^{1}\ \overbrace{%
\int_{-\infty}^{\infty}\expo{\ic\pars{k - q}x}\,{\dd x \over 2\pi}}
^{\ds{\delta\pars{k - q}}}\ \,\dd k\,\dd q =
{\pi \over 2}\int_{-1}^{1}\
\overbrace{\int_{-1}^{1}\delta\pars{k - q}\,\dd k}^{\ds{=\ 1}}\
\,\dd q
\\[3mm] & =
{\pi \over 2}\int_{-1}^{1}\dd q = \color{#f00}{\pi}
\end{align}
A: That kind of integrals are best managed through integration by parts. We have:
$$ \int_{-\infty}^{+\infty}\left(\frac{\sin x}{x}\right)^2\,dx = \int_{-\infty}^{+\infty}\frac{\frac{d}{dx}\sin^2 x}{x}\,dx = \int_{-\infty}^{+\infty}\frac{\sin(2x)}{x}\,dx = \int_{-\infty}^{+\infty}\frac{\sin z}{z}\,dz=\color{red}{\pi}.$$
A: One may observe that, by the Taylor series expansion, as $x \to 0$, 
$$
\sin x=x+O(x^3)
$$ giving
$$
\frac{\sin^2 x}{x^2}=1+O(x^2),
$$ on the other hand, as $x \to \infty$,
$$
\left|\frac{\sin^2 x}{x^2}\right|\leq \frac1{x^2}
$$ consequently the given integral is convergent:
$$
0<\int_{-\infty}^{+\infty}\frac{\sin^2 x}{x^2}\:dx<\infty.
$$
No need to consider a principal value: there is no singularity of $\dfrac{\sin^2 x}{x^2}$ over $\mathbb{R}$.
We have

$$
\int_{-\infty}^{+\infty}\frac{\sin^2 x}{x^2}\:dx=2\int_0^{+\infty}\frac{\sin^2 x}{x^2}\:dx=2\cdot \frac{\pi}2=\pi,
$$

a proof of the latter integral evaluation may be found here.
