Help with obtaining the power spectral density of a simple continuous cosine (using both forms of the definition for PSD) I am trying to go through a simple example to teach myself about Parseval's theorem and calculating power spectral density (PSD) in practice and would be very grateful if someone could check my reasoning and help my understanding.

Specifically, I want to calculate the average power of a signal in the time domain and show that it is equal to the average power obtained in the frequency domain using the PSD (according to Parseval).

As an example, I am considering a simple cosine (non-causal) signal $x(t) = A\cos(2\pi f_0t)$, which should have infinite energy but finite average power (known as a "power signal", as opposed to "energy signal") given by:
$$P_{\textrm{av}} = \lim_{T\to\infty}\frac{1}{T} \int^{+T/2}_{-T/2} |x(t)|^2\mathrm dt$$

Since this signal is periodic, I should be able to calculate the average power by considering a single period only, where $T= 1/f_0$,
$$P_{\textrm{av}} = \frac{1}{T} \int^{+T/2}_{-T/2} |A\cos(2\pi f_0t)|^2\mathrm dt = f_0 A^2 \int^{+T/2}_{-T/2} \frac{1}{2}\Big[1+\cos(4\pi f_0 t) \Big]\mathrm dt = \frac{A^2}{2}$$

I would now like to arrive at this result by integrating the power spectral density over all frequencies (as should work by Parseval), to convince myself of what I'm doing. So first, I need to obtain the power spectral density. I have seen one definition of the PSD given as the Fourier transform of the autocorrelation function, $R(\tau)$, so I first calculate this:

\begin{align}
  R(\tau) &amp;= \int^{+\infty}_{-\infty} x(t+\tau)\;x^*(t)\;\mathrm dt  \\
          &amp;= A^2 \int_{-\infty}^{+\infty} \cos(2\pi f_0(t+\tau))\cdot \cos(2\pi f_0)\; \mathrm dt\\
          &amp;= \frac{A^2}{2} \cos(2\pi f_0\tau)
\end{align}

where I have used trigonometric identity to evaluate the integrals. Now, calculating the Fourier transform of this to get the PSD:

\begin{align}
  \textrm{PSD}(f) &amp;= \mathcal{F}\{R(\tau)\}   \\
                  &amp;= \int_{-\infty}^{+\infty} R(\tau) e^{-2\pi i f \tau}\; \mathrm d\tau\\
                  &amp;= \int_{-\infty}^{+\infty} \frac{A^2}{2} \cos(2\pi f_0\tau)  e^{-2\pi i f \tau}\; \mathrm d\tau\\
                  &amp;= \frac{A^2}{4}\Big[ \delta(f-f_0) + \delta(f+f_0) \Big]
\end{align}

Is this correct for the power spectral density of a cosine wave, i.e. in units of [signal$^2$ per Hz]? It does indeed look like if I were to integrate this PSD over frequency I would get the correct average power $P_\textrm{av} = A^2/2$.

I have seen an alternative (or just different form?) of the definition of PSD in this question:

$$S_{xx}(\omega)=\lim\limits_{T\to \infty}\mathbf{E} \left[ | \hat{x}_T(\omega) |^2 \right]$$

How would I apply this definition to my cosine signal to arrive at the same PSD above, and show that the average power is recovered? Which method is the approach I should take? Is it true that the autocorrelation method is used more for stochastic signals when the FT does not exist, and for deterministic signals (such as in my case) we can directly use the FT?
There are several misconceptions in the question that have not been addressed in the existing answers. First of all, the signal $x(t)=A\cos(2\pi f_0t)$ is a deterministic power signal (unless $A$ or $f_0$ are modeled as random variables). For this reason several definitions in the question are inappropriate. First, the auto-correlation of a power signal is given by

$$R_x(\tau)=\lim_{T\to\infty}\frac{1}{2T}\int_{-T}^Tx^*(t)x(t+\tau)dt\tag{1}$$

The integral given in the question (with infinite limits and without division by $T$) does not exist for the given $x(t)$. With definition $(1)$, the auto-correlation of $x(t)$ is indeed obtained as

$$R_x(\tau)=\frac{A^2}{2}\cos(2\pi f_0\tau)\tag{2}$$

The Fourier transform of $(2)$ results in the power spectrum of $x(t)$.

The power spectrum can also be computed directly from $x(t)$, but the formula given in the question only applies to random signals, but not to deterministic signals. For deterministic signals, the appropriate definition is

$$S_x(f)=\lim_{T\to\infty}\frac{1}{2T}\left|\int_{-T}^{T}x(t)e^{-j2\pi ft}dt\right|^2\tag{3}$$

The computation of $(3)$ for the given signal is discussed in this question.