Find the principal value of $\int_{-\infty}^{\infty}\frac{1-\cos x}{x^2}\,\mathrm dx$ How to find the Cauchy principal value of the following integral

$$\int_{-\infty}^{\infty}\frac{1-\cos x}{x^2}\,\mathrm dx$$

How to start this problem?
 A: Consider following parametric integral for $\alpha \ge0$ $$I(\alpha )=\int_{-\infty}^{\infty}\frac{1-\cos \alpha x}{x^2}\,\mathrm dx$$ We have $I(0)=0$ $$I'(\alpha )=\int_{-\infty}^{\infty}\frac{\sin \alpha x}{x}\,\mathrm dx=\pi$$ $$I(\alpha )=\pi \alpha +c$$ Then $I(0)=\pi \cdot0+c=0 \implies I(a)=\pi a$ $$I(\alpha )=\int_{-\infty}^{\infty}\frac{1-\cos \alpha x}{x^2}\,\mathrm dx=\pi \alpha $$ $$I(1)=\pi$$ 

$$\large\int_{-\infty}^{\infty}\frac{1-\cos x}{x^2}\,\mathrm dx=\pi $$

A: \begin{align}
\int_{-\infty}^{\infty}\frac{1-\cos x}{x^2}\,\mathrm dx&=\int_{-\infty}^{\infty}\frac{2\sin^2 \left(\frac x2\right)}{x^2}\,\mathrm dx\tag1\\
&=\int_{-\infty}^{\infty}\frac{\sin^2 y}{y^2}\,\mathrm dy\tag2\\
&=-\left.\frac{\sin^2 y}{y}\;\right|_{-\infty}^{\infty}+\int_{-\infty}^{\infty}\frac{2\sin y\cos y}{y}\,\mathrm dy\tag3\\
&=0+\int_{-\infty}^{\infty}\frac{\sin 2y}{y}\,\mathrm dy\tag4\\
&=\int_{-\infty}^{\infty}\frac{\sin z}{z}\,\mathrm dz\tag5\\
&=\pi\tag6
\end{align}

Explanation :
$(1)\;$ Use identity $\;\displaystyle2\sin^2 \left(\frac x2\right)=1-\cos x$
$(2)\;$ Use substitution $\;\displaystyle y=\frac{x}{2}$
$(3)\;$ Apply integration by parts by taking $\;\displaystyle u=\sin^2y$ and use the fact that $\;\displaystyle 0\le\sin^2 y\le1$
$(4)\;$ Use identity $\;\displaystyle \sin 2 y=2\sin y\cos y$
$(5)\;$ Use substitution $\;\displaystyle z=2y$
$(6)\;$ $\displaystyle \int_{-\infty}^{\infty}\frac{\sin z}{z}\,\mathrm dz=2\int_{0}^{\infty}\frac{\sin z}{z}\,\mathrm dz$
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{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\norm}[1]{\left\vert\left\vert\, #1\,\right\vert\right\vert}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
\begin{align}&\color{#66f}{\large%
\int_{-\infty}^{\infty}{1 - \cos\pars{x} \over x^{2}}\,\dd x}
=\int_{-\infty}^{\infty}{2\sin^{2}\pars{x/2} \over x^{2}}\,\dd x
=\int_{-\infty}^{\infty}{\sin^{2}\pars{x} \over x^{2}}\,\dd x
\\[5mm]&=\int_{-\infty}^{\infty}\ \overbrace{%
\half\int_{\pars{-1}^{-}}^{1^{+}}\expo{\ic kx}\,\dd k}^{\dsc{\sin\pars{x} \over x}}\ \overbrace{\half\int_{\pars{-1}^{-}}^{1^{+}}\expo{-\ic qx}\,\dd q}
^{\dsc{\sin\pars{x} \over x}}\,\dd x
\\[5mm]&={\pi \over 2}\int_{\pars{-1}^{-}}^{1^{+}}\int_{\pars{-1}^{-}}^{1^{+}}\ \overbrace{%
\int_{-\infty}^{\infty}\expo{\ic\pars{k - q}x}\,{\dd x \over 2\pi}}
^{\dsc{\delta\pars{k - q}}}\ \,\dd k\,\dd q
\\[5mm]&={\pi \over 2}\int_{\pars{-1}^{-}}^{1^{+}}
\int_{\pars{-1}^{-}}^{1^{+}}\delta\pars{k - q}\,\dd k\,\dd q
={\pi \over 2}\int_{\pars{-1}^{-}}^{1^{+}}\Theta\pars{1 - \verts{q}}\,\dd q
={\pi \over 2}\int_{\pars{-1}^{-}}^{1^{+}}\,\dd q
=\color{#66f}{\Huge\pi}
\end{align}
