## expected value

$x[n] = \cos (2 \pi f_1 n) + \cos (2 \pi f_2 n) + w[n]$

$w[n]$ is zero-mean WGN with variance $\sigma^2$

I have to derive the expected value of this expression

$E \{\displaystyle{\frac{4 \pi^2}{\sigma^2} \sum_{n=0}^{N-1} n^2 (x[n] \cos (2 \pi f_1 n) - \cos (4 \pi f_1 n) - \cos (2 \pi f_1 n)\cos (2 \pi f_2 n))} \}$

$= \displaystyle{\frac{4 \pi^2}{\sigma^2} \sum_{n=0}^{N-1} n^2 E \{x[n] \cos (2 \pi f_1 n) - \cos (4 \pi f_1 n) - \cos (2 \pi f_1 n)\cos (2 \pi f_2 n)} \}$

$= \displaystyle{\frac{4 \pi^2}{\sigma^2} \sum_{n=0}^{N-1} n^2 E \{ \cos^2 (2 \pi f_1 n) + \cos (2 \pi f_1 n) \cos (2 \pi f_2 n) + w[n] \cos(2 \pi f_1 n) - \cos (4 \pi f_1 n) - \cos (2 \pi f_1 n)\cos (2 \pi f_2 n)} \}$

$= \displaystyle{\frac{4 \pi^2}{\sigma^2} \sum_{n=0}^{N-1} n^2 E \{ \cos^2 (2 \pi f_1 n) + w[n] \cos(2 \pi f_1 n) - \cos (4 \pi f_1 n)} \}$

$= \displaystyle{\frac{4 \pi^2}{\sigma^2} \sum_{n=0}^{N-1} n^2 E \{ \frac{1}{2} + \frac{\cos (4 \pi f_1 n)}{2} + w[n] \cos(2 \pi f_1 n) - \cos (4 \pi f_1 n)} \}$

$= \displaystyle{\frac{4 \pi^2}{\sigma^2} \sum_{n=0}^{N-1} n^2 \frac{1}{2}} = \displaystyle{\frac{2 \pi^2}{\sigma^2} \sum_{n=0}^{N-1} n^2$

could someone please check this?
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 9, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}