# Why is spectral density only defined for stationary processes?

I read Brockwell and Davis(2016), Shumway and Stoffer(2016), and Stoica and Moses(2004). However, none of them laid out clearly the reasoning behind the presumption of stationarity when conducting spectral analysis on a time series.

I understand we typically need to detrend the time series as necessary data pre-processing for spectral analysis, because otherwise the first cosine coefficient could distort the estimates/periodogram.(frequency close to zero could have very large spectrum).

But simple detrending doesn't make the process stationary. It may well have periodicity/seasonality built in, although it may not have a unit root (unit root stationarity tests are rendered useless in this case).

Based on above, how could we carry out a spectral analysis on a periodic time series which is not stationary when spectral analysis is only defined for stationary processes?

To quote Brockwell and Davis: "[t]he summability of $$|\gamma(\cdot)|$$ implies that the series converges absolutely..."
When you look at the definition of the spectral density $$f(\lambda) = \frac{1}{2\pi} \sum_{h=-\infty}^{\infty} e^{-ih\lambda} \gamma(h), \hspace{10mm} - \infty < \lambda < \infty,$$ the sum would be undefined if $$\gamma(\cdot)$$ was the autocovariance function of a periodic process. Intuitively periodic processes' autocovariance functions don't "die out."