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!.
 A: 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| ) \,.$$
A: Without residues
You can compute the antiderivative first.
Using integration by parts
$$I_1=\int \frac{e^{i t x}}{x^2}\,dx=i t \text{Ei}(i t x)-\frac{e^{i t x}}{x}$$ where appears the exponential integral function.
$$I_2=\int \frac{e^{i t x}e^{ix}} {x^2}\,dx=\int\frac{e^{i (t+1) x}}{x^2}dx=\frac{i \left((t+1) x \text{Ei}(i (t+1) x)+i e^{i (t+1) x}\right)}{x}$$
$$I_3=\int \frac{e^{i t x}e^{-ix}} {x^2}\,dx=\int \frac{e^{i (t-1) x}}{x^2}dx=\frac{i (t-1) x \text{Ei}(i (t-1) x)-e^{i (t-1) x}}{x}$$ At this point, yo have all required elements. Use the bounds.
