Convexity of expectation Given some function $f$, how could I find out what properties of $f$ make
$$F(q) = \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{\infty} f(\sqrt{q} x) e^{-x^2/2} dx$$
either convex or concave?
I have some functions $f$ for which I can actually analytically find $F$ and do some basic analysis to find out whether it is convex or not, but for others, e.g. $f(x) = \tanh(x)^2$, it seems to be impossible.
I have tried to compute first and second derivatives of $F$, but that does not seem to help (me) much:
$$\begin{align}
  F'(q) & = \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{\infty} \frac{1}{2} f''(\sqrt{q} x) e^{-x^2/2} dx \\
  F''(q) & = \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{\infty} \frac{1}{4} f^{(4)}(\sqrt{q} x) e^{-x^2/2} dx \\
\end{align}$$
Would anybody be able to give me a hint as to how I could find for some $f$, whether $F$ is convex or concave?
PS: I'm a computer scientists, so please forgive me if I don't understand continuous maths.
 A: I don't know if this is useful to you, but the expression 
$$
F''(q)=\int_{-\infty}^\infty f^{(4)}(\sqrt q x)e^{-\frac{x^2}{2}}\,dx$$ 
can be evaluated in terms of Fourier transforms by means of the following version of the Plancherel identity;
$$
\int_{-\infty}^\infty f(x)\overline{g(x)}\, dx = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty \hat{f}(k)\overline{\hat{g}(k)}\, dk.$$
Here 
$$
\hat{f}(k):=\int_{-\infty}^\infty f(x)e^{-ikx}\, dx.$$
To begin with the evaluation we note that 
$$
\widehat{f^{(4)}}(k)=k^4\hat{f}(k), 
$$
as you can see by integrating by parts in the definition of $\hat{f}$. Moreover, applying the general scaling property
$$
\widehat{g(x/q)}(k)=q\hat{g}(qk)
$$
we see that 
$$
\widehat{e^{-\frac{x^2}{2q}}}=Ce^{-q\frac{k^2}{2}}.$$
Here and in the following $C$ denotes an irrelevant positive constant. Using the considerations above, we have that 
$$
F''(q)=C\int_{-\infty}^\infty k^4 e^{-q\frac{k^2}{2}}\hat{f}(k)\, dk.$$ 
In particular, $F$ will be convex (concave) if $\hat{f}$ is nonnegative (nonpositive). 
