In [1, p. 62 exercise 3.18] we are asked to find the temporal autocorrelation function for the real sinusoidal random process of Problem [1, p. 62 exercise 3.16]:

as M\rightarrow \infty. As a second step we are asked to determine if the random process autocorrelation ergodic.
Solution: The sinusoidal process of Problem [1, p. 62 exercise 3.16] is given by x[n]=A \cos(2\pi f_{0}n+\phi), and the autocorrelation function was found to be equal to (see solution of exercise 3.16 [2]) r_{xx}[k]=\frac{A^{2}}{2} \cos(2\pi f_{0}k). The temporal autocorrelation is equal to :
\hat{r}_{xx}[k]=\frac{1}{2M+1}\sum\limits_{n=-M}^{M}A^{2}\cos(2\pi f_{0}n+\phi)\cos(2\pi f_{0}(n+k)+\phi)

The previous relation can be furthermore simplified by the property of trigonometric functions [3, p. 810] :
2\cos\frak{A}\cos\frak{B}=\cos(\frak{A-B})+\cos(\frak{A+B}) (1)

and thus the autocorrelation can be written as:
\hat{r}_{xx}[k]=\frac{A^{2}}{2(2M+1)}\sum\limits_{n=-M}^{M}\left(\cos(2\pi f_{0}k)+\cos(2\pi f_{0}(2n+k)+2\phi)\right)
=\frac{A^{2}}{2(2M+1)} (2M+1) \cos(2\pi f_{0}k)
 + \frac{A^{2}}{2(2M+1)}\sum\limits_{n=-M}^{M}\cos(2\pi f_{0}(2n+k)+2\phi)
=\frac{A^{2}}{2} \cos(2\pi f_{0}k)
 + \frac{A^{2}}{2(2M+1)}\sum\limits_{n=-M}^{M}\cos(4\pi f_{0}n+2\pi f_{0}k+2\phi)

Again it is possible to further simplify the previous relation, this time by using the following trigonometric formula [3, p. 810]:
\cos(\frak{A+B})=\cos\frak{A}\cos\frak{B}-\sin\frak{A}\sin\frak{B} (2)

\hat{r}_{xx}[k]=\frac{A^{2}}{2} \cos(2\pi f_{0}k)
 + \frac{A^{2}}{2(2M+1)}\cos(2\pi f_{0}k+2\phi)\sum\limits_{n=-M}^{M}\cos(4\pi f_{0}n)
 - \frac{A^{2}}{2(2M+1)}\sin(2\pi f_{0}k+2\phi)\sum\limits_{n=-M}^{M}\sin(4\pi f_{0}n)

Because the sinus function is odd \sin(-x)=-\sin(x) the symmetric sum \sum_{n=-M}^{M}\sin(4\pi f_{0}n) equals zero. Generally the same is not true for the cosine sum. For f_{0}=1 for example the sum \sum_{n=-M}^{M}\cos(4\pi f_{0}n) equals 2M+1 and thus even for M\rightarrow \infty the temporal autocorrelation function will be in error to the true autocorrelation function. In general it is true that - \frac{A^{2}}{2}\leq \frac{A^{2}}{2(2M+1)} \sum_{n=-M}^{M}\cos(4\pi f_{0}n)\leq \frac{A^{2}}{2}. The error to the true autocorrelation function is equal to \epsilon=\frac{A^{2}}{2(2M+1)}\cos(2\pi f_{0}k+2\phi)\sum_{n=-M}^{M}\cos(4\pi f_{0}n), and thus the process is in general not autocorrelation ergodic, because as we have shown for e.g. f_{0}=1 the temporal autocorrelation doesn’t even converge for large M. That is:
\hat{r}_{xx}[k]=\frac{A^{2}}{2} \cos(2\pi f_{0}k)
 + \frac{A^{2}}{2(2M+1)}\cos(2\pi f_{0}k+2\phi)\sum\limits_{n=-M}^{M}\cos(4\pi f_{0}n)

While it is true that there are frequencies f_{0} for which the temporal autocorrelation doesn’t converge, there are also cases when the process is autocorrelation ergodic. To see this we have to further simplify the relation for the temporal autocorrelation. The sum \sum_{n=-M}^{M}\cos(4\pi f_{0}n) can be further simplified, by using \cos(4\pi f_{0}n) =\Re\{e^{(j4\pi f_{0}n)}\} , and observing that the resulting sum is a geometric progression ([3, p. 7] \sum\limits_{j=0}^{n}a_{0}r^{j}=a_{0}\frac{1-r^{n+1}}{1-r}, \; r < 1 ) with a_{0}=1, r_{0}=e^{j4\pi f_{0}} :
\sum\limits_{n=-M}^{M}\cos(4\pi f_{0}n)=\Re\{\sum\limits_{n=-M}^{M}e^{j4\pi f_{0}n}\}
=\Re\{e^{-j4\pi f_{0}M}\sum\limits_{n=0}^{2M}e^{j4\pi f_{0}n}\}
=\Re\{e^{-j4\pi f_{0}M}\frac{1-e^{j4\pi f_{0}(2M+1)}}{1-e^{j4\pi f_{0}}}\}
=\Re\{\underbrace{e^{-j4\pi f_{0}M}\frac{e^{j2\pi f_{0}(2M+1)}}{e^{j2\pi f_{0}}}}_{=1}\cdot
 \frac{e^{-j2\pi f_{0}(2M+1)}-e^{j2\pi f_{0}(2M+1)}}{e^{-j2\pi f_{0}}-e^{j2\pi f_{0}}}\}
=\Re\{\frac{\sin(2 \pi f_{0}(2M+1))}{\sin(2\pi f_{0})}\}
=\frac{\sin(2 \pi f_{0}(2M+1))}{\sin(2\pi f_{0})}

Using this identity the error to the true autocorrelation function can be rewritten as:
\epsilon=\frac{A^{2}}{2(2M+1)}\cos(2\pi f_{0}k+2\phi)\frac{\sin(2 \pi f_{0}(2M+1))}{\sin(2\pi f_{0})} \Rightarrow
|\epsilon|\leq|\frac{A^{2}}{2(2M+1)}| \Rightarrow
\lim_{M\rightarrow \infty} |\epsilon|=0,

Thus by only imposing that e^{j4\pi f_{0}}\neq 1 the process is autocorrelation ergodic.

[1] Steven M. Kay: “Modern Spectral Estimation – Theory and Applications”, Prentice Hall, ISBN: 0-13-598582-X.
[2] Chatzichrisafis: “Solution of exercise 3.16 from Kay’s Modern Spectral Estimation - Theory and Applications.”.
[3] Granino A. Korn and Theresa M. Korn: “Mathematical Handbook for Scientists and Engineers”, Dover, ISBN: 978-0-486-41147-7.