Characteristic function of $\frac{1-\cos(x)}{x^2}$. I am trying to compute the characteristic function of the density $f(x)=\frac{1-\cos(x)}{x^2}$. But I do not know how to do it, I was trying to use the residue theorem  to compute
$$\phi(t)=\int_{-\infty}^\infty e^{itx}\frac{1-\cos(x)}{x^2}dx$$ but in this case it is not possible because there is no singularities, or I don't know how to use it in this case. Any help is welcome; Thank you!.

Let us write
$$
\phi(t) =\int e^{it x} \frac{2- e^{i x} - e^{-ix} }{2x^2} \,dx = 
\lim_{\eta\to0^+}\int e^{it x} \frac{2- e^{i x} - e^{-ix} }{2 (x-i\eta)(x+i\eta)} \,dx 
 \,.
$$
The second step is important, as we will separate the integral into  parts  and we do want that they converge individually.
Then we need the integrals  ($\eta>0$)
$$ \int e^{i t x} \frac{1}{(x+i \eta) (x-i\eta)} \,dx= \frac{\pi}{\eta}e^{-\eta |t|},$$
$$ \int e^{i t x} \frac{e^{ix}}{(x+i \eta) (x-i\eta)}\,dx = \frac{\pi}{\eta}e^{-\eta |t+1|},$$
$$ \int e^{i t x} \frac{e^{-ix}}{(x+i \eta) (x-i\eta)}\,dx = \frac{\pi}{\eta}e^{-\eta |t-1|},$$
which can be obtained via residue theorem (please indicate, if you need help with that).
Combining these results, we obtain
$$ \phi(t) = \lim_{\eta\to0^+}\frac{\pi}{\eta} \left(e^{-\eta |t|} - \frac12 e^{-\eta |t+1|}-\frac12 e^{-\eta |t-1|}\right) = \frac{\pi}{2} ( |t+1| +|t-1|-2|t| ) \,.$$
