from __future__ import division
%matplotlib inline
import pylab as pl
import numpy as np
Let $\theta \sim N(0, \sigma^2)$. Then (thanks to this), we consider $e^{i \theta} = \cos \theta + i \sin \theta$. But $\E[e^{i \theta}] = e^{0 + (i \sigma)^2 / 2} = e^{- \sigma^2 / 2}$, since that's just the mgf of a normal.
Thus, considering the real and imaginary parts, $\E\left[ \cos \theta \right] = e^{-\sigma^2 / 2}$, $\E\left[ \sin \theta \right] = 0$.
xs = np.random.normal(size=1000000)
sigmas = np.linspace(.01, 10)
xs_sigs = xs * sigmas[:, np.newaxis]
pl.figure(figsize=(8, 3))
pl.subplot(121)
pl.plot(sigmas, np.cos(xs_sigs).mean(axis=1))
pl.plot(sigmas, np.exp(- sigmas**2 / 2), color='red', linestyle='--')
pl.subplot(122)
pl.plot(sigmas, np.sin(xs_sigs).mean(axis=1))
pl.tight_layout()
Now: $$\Var[ \cos \theta] = \E[ \cos^2 \theta ] - \E[\cos \theta]^2 = \frac{1}{2} \left[ 1 + \E \cos 2\theta \right] - \left( e^{- \sigma^2 / 2} \right)^2 = \frac{1}{2} \left[ 1 + e^{- (2 \sigma)^2 / 2} \right] - e^{- \sigma^2 } = \frac{1}{2} + \frac{1}{2} e^{- 2 \sigma^2} - e^{- \sigma^2 } = \frac{1}{2} \left[ 1 - e^{- \sigma^2} \right]^2 . $$
pl.figure(figsize=(6, 2))
pl.subplot(121)
pl.plot(sigmas, np.cos(xs_sigs).std(axis=1))
pl.plot(sigmas, (1 - np.exp(- sigmas**2)) / np.sqrt(2), color='red', linestyle='--')
pl.subplot(122)
pl.plot(sigmas, np.sin(xs_sigs).std(axis=1))
pl.plot(sigmas, np.sqrt((1 - np.exp(-2 * sigmas**2)) / 2), color='red', linestyle='--')
pl.tight_layout()
So, if $z \sim N(\mu, \sigma^2)$, $\theta = z - \mu$:
xs = np.random.normal(size=1000000)
mus = np.linspace(-5, 5)
sigmas = 1
xs_mus = xs + mus[:, np.newaxis]
pl.figure(figsize=(8, 3))
pl.subplot(121)
pl.plot(mus, np.cos(xs_mus).mean(axis=1))
pl.plot(mus, np.exp(- sigmas**2 / 2) * np.cos(mus), color='red', linestyle='--')
pl.subplot(122)
pl.plot(mus, np.sin(xs_mus).mean(axis=1))
pl.plot(mus, np.exp(- sigmas**2 / 2) * np.sin(mus), color='red', linestyle='--')
pl.tight_layout()
pl.figure(figsize=(8, 3))
pl.subplot(121)
pl.plot(mus, np.cos(xs_mus).std(axis=1))
pl.plot(mus, np.sqrt(.5 + np.exp(-2*sigmas**2) / 2 * np.cos(2 * mus) - np.exp(-sigmas**2) * np.cos(mus)**2),
color='red', linestyle='--')
pl.subplot(122)
pl.plot(mus, np.sin(xs_mus).std(axis=1))
pl.plot(mus, np.sqrt(.5 - np.exp(-2*sigmas**2) / 2 * np.cos(2 * mus) - np.exp(-sigmas**2) * np.sin(mus)**2),
color='red', linestyle='--')
pl.tight_layout()