Mean and variance of $Y = \cos(bX)$ when $X$ has a Gaussian distribution How can we find the mean and the variance (not using a software tool) of $Y = \cos(bX)$, when $b$ is a non-zero constant and $X$ has a Gaussian distribution?
 A: Slightly generalizing a question in math SE, we have the following equality: $$\int_{-\infty}^{\infty}e^{-x^2}\cos(bx+c) dx = \sqrt{\pi}e^{-b^2/4}\cos (c)$$
Which can be used to solve our query (for the mean): $$\begin{align}E[cos(bX)]&=\frac{1}{\sqrt{2\pi}\sigma}\int_{-\infty}^\infty {e^{-\left(\frac{x-\mu}{\sqrt{2}\sigma}\right)^2}}\cos(bx)dx\\&=\frac{1}{\sqrt{2\pi}\sigma}\int_{-\infty}^\infty {e^{-x^2}\cos(b(\sqrt{2}\sigma x+\mu))}\frac{dx}{\sqrt{2}\sigma}\end{align}$$
The variance can be found via second moment, i.e. $E[{\cos}^2(bX)]$. And, since $\cos^2(bX)=\frac{1+\cos (2bX)}{2}$, we can use the same formula to reach out the variance. 
A: Not a proof but a comment:
Knowing that the characteristic function of $X\sim N(\mu,\sigma^2)$ is of the form $E\left[e^{i bX}\right]=e^{i\mu b-\sigma^2 b^2/2}$ for any $b\in\mathbb R$ and that $E\left[e^{i bX}\right]=E\left[\cos bX\right]+iE\left[\sin bX\right]$, I think we can compare real parts of both sides to say that
$$E\left[\cos bX\right]=\mathfrak R \,E\left[e^{ib X}\right]=e^{-\sigma^2 b^2/2}\,\mathfrak R(e^{i\mu b})=e^{-\sigma^2 b^2/2}\cos \mu b$$
