TITLE: Showing a function is differentiable on $\mathbb{R}^+$
QUESTION [5 upvotes]: Question: Let $f \ge 0$ be an integrable function on $\mathbb{R}$. Define $g(t) := \displaystyle \int_\mathbb{R} \cos(tx)\ f(x) \; dx$ for $t \ge 0$. Show $g$ is twice-differentiable $\iff \displaystyle \int_\mathbb{R} x^2 f(x) \; dx <\infty$.
Solution: $(\Rightarrow)$ Suppose $g$ is twice-differentiable so that $| g''(0)|<\infty$. Then,
\begin{align*}
|g''(0)| &= \left\vert \lim \limits_{h \to 0} \dfrac{g(h) -2g(0) +g(-h)}{h^2} \right\vert \\
&= \lim \limits_{h \to 0}\left\vert \dfrac{g(h) -2g(0) +g(-h)}{h^2} \right\vert \\
&= \lim \limits_{h \to 0} \int_\mathbb{R} \left\vert \dfrac{ \cos(hx) -2 + \cos(-hx)}{h^2} f(x) \right\vert \; dx  \quad (^* \text{Wrong, see edit}^*)\\
&=  \lim \limits_{h \to 0} \int_\mathbb{R} \left\vert \dfrac{2( \cos(hx) -1) }{h^2}  \right\vert f(x) \; dx \\
&\ge   \int_\mathbb{R} \liminf \limits_{h \to 0} \left\vert \dfrac{2( \cos(hx) -1) }{h^2} \right\vert  f(x) \; dx \quad \text{(Fatou)} 
\\ &= \int_\mathbb{R} x^2f(x) \; dx.
\end{align*}
$(\Leftarrow) $ This is where I am sort of stuck. I am doing a standard technique of showing a partial derivative is bounded so I can push the derivative inside the integral using LDCT (Will moving differentiation from inside, to outside an integral, change the result?)
First, note that $g(t)$ is integrable since 
$$
\left\vert \int_\mathbb{R} \cos(tx) f(x) \; dx \right\vert \le \|f\|_{L^1(\mathbb{R})}<\infty
$$
Also, $\left\vert \frac{\partial^2 }{\partial t^2} \cos(tx) f(x) \right\vert = |x^2 \cos(tx) f(x)| \le |x^2 f(x)|,$ which is integrable by assumption. So $g''$ exists, assuming $g'$ does.
But I can't show $g'$ exists because $\left\vert \frac{\partial }{\partial t} \cos(tx) f(x) \right\vert = |x\sin(tx) f(x)| $, which is $\le$ both  $|xf(x)|$ and $|x^2 t f(x)|$, neither of which seem to help . . . 
If I attack with $g'(t) = \lim \limits_{h \to 0} \dfrac{g(t+h)-g(t)}{h}
 =  \lim \limits_{h \to 0} \displaystyle \int_\mathbb{R} \dfrac{\cos(x(t+h)) - \cos(xt)}{h}f(x) \; dx$, I can't make progress either.
Thanks for the help.
EDIT: Let me fix the $\Rightarrow$ direction. Basically all I need to do is note that $2 - 2 \cos(hx) \ge 0$, so I can still apply Fatou.
\begin{align*}
-g''(0) &=  \lim \limits_{h \to 0} -\dfrac{g(h) -2g(0) +g(-h)}{h^2}  \\
&= \lim \limits_{h \to 0} \int_\mathbb{R}  \dfrac{ -\cos(hx) +2 - \cos(-hx)}{h^2} f(x)  \; dx  \\
&=  \lim \limits_{h \to 0} \int_\mathbb{R}  \dfrac{2( 1-\cos(hx)) }{h^2}  f(x) \; dx \\
&\ge   \int_\mathbb{R} \liminf \limits_{h \to 0}  \dfrac{2(1-\cos(hx)) }{h^2}  f(x) \; dx \quad \text{(Fatou)} 
\\ &= \int_\mathbb{R} x^2f(x) \; dx.
\end{align*}

REPLY [3 votes]: In your proof of $\implies,$ you have a mistake in going from line 2 to line 3: You've moved the absolute values inside the integral, so $=$ should be $\le 0.$
In the other direction, we can use the mean value theorem:
$$\tag 1 |\cos ((t+h)x) - \cos (tx)| = |(-\sin c)\cdot (hx)| \le |hx|$$
Now
$$ \frac{g(t+h)-g(t)}{h} = \int \frac{\cos ((t+h)x) - \cos (tx)}{h} f(x)\, dx.$$
In absolute value, the integrand on the right is $\le |xf(x)|$ by $(1).$ Because $x^2f(x) \in L^1,$ $xf(x) \in L^1.$ So the dominated convergence theorem gives
$$\tag 2 g'(t) = \int (- \sin (tx))x f(x)\,dx.$$
This argument can be repeated in differentiating $(2),$ this time using $x^2f(x)\in L^1$ directly. We get $g''(t) =  \int (- \cos (tx))x^2 f(x)\,dx.$