I need to show that $$\int_{-\pi}^{\pi}\left|\frac{a_0}{2}+\sum_{n=1}^{\infty}\alpha_n\cos(nx-\theta_n)\right|^2dx=2\pi\left(\frac{a_0^2}{4}+\frac12\sum_{n=1}^{\infty}\alpha_n^2\right)\tag{1}$$
Just for reference the trigonometric Fourier series is $$f(x)= \frac{a_0}{2} + \sum_{n=1}^{\infty}\left(a_n\cos(nx)+b_n\sin(nx)\right)$$ and the connection between the trigonometric Fourier series and the power spectrum is given by $$a_n=\alpha_n\cos\theta_n$$ $$b_n=\alpha_n\sin\theta_n$$ $$\alpha_n^2=a_n^2+b_n^2$$ $$\tan\theta_n=\frac{b_n}{a_n}$$
So I start by expanding the LHS of $(\mathrm{1})$
$$\int_{-\pi}^{\pi}\left\{\frac{a_0^2}{4}+a_0\sum_{n=1}^{\infty}\alpha_n\cos(nx-\theta_n)+\left[\sum_{n=1}^{\infty}\alpha_n\cos(nx-\theta_n)\right]^2\right\}dx$$ $$= \int_{-\pi}^{\pi}\frac{a_0^2}{4}dx+a_0\int_{-\pi}^{\pi}\sum_{n=1}^{\infty}\alpha_n\cos(nx-\theta_n)dx+\int_{-\pi}^{\pi}\left[\sum_{n=1}^{\infty}\alpha_n\cos(nx-\theta_n)\right]^2dx$$ $$= 2\pi\frac{a_0^2}{4}+a_0\int_{-\pi}^{\pi}\sum_{n=1}^{\infty}\alpha_n\cos(nx-\theta_n)dx$$ $$+\int_{-\pi}^{\pi}\sum_{n=1}^{\infty}\alpha_n\cos(nx-\theta_n)\sum_{m=1}^{\infty}\alpha_m\cos(mx-\theta_m)dx\tag{2}$$
I don't know how to proceed any further with this but do I know that for integer $n\ne m$ $$\langle\cos(nx)|\cos(mx)\rangle=0$$ but I am struggling to apply the same logic to $(\mathrm{2})$ as the cosines have different phase offsets, I am also confused about how to deal with the 2 sums in the second integral.
The answer just states that:
Does anyone have any advice on how I can complete this proof?

$$\cos(nx-\theta_n)=\cos(nx)\cos(\theta_n)+\sin(nx)\sin(\theta_n)$$
Therefore $$\int_{-\pi}^\pi \cos(nx-\theta_n)\cos(mx-\theta_m)dx={\cos(\theta_n)\cos(\theta_m)\int_{-\pi}^\pi \left(\cos(nx)\cos(mx)\right)dx \quad\text{etc.}}$$
For $n\ne m$, $$\int_{-\pi}^\pi \cos(nx)\cos(mx)dx=0$$ and in general $$\int_{-\pi}^\pi \cos(nx)\sin(mx)dx=0$$ Meanwhile $$\int_{-\pi}^\pi \cos^2(nx)dx=\pi$$ This will allow you to complete $(2)$.