TITLE: Fourier series simplification
QUESTION [6 upvotes]: I want to show that $$\frac{1}{\pi} \int_{-\pi}^{\pi} f(x)g(x)dx = \frac{a_0\alpha_0}{2} + \sum_{n=1}^{\infty} (a_n\alpha_n + b_n\beta_n)$$
where $f,g: [-\pi,\pi] \to \mathbb{R}$ are integral functions and that the Fourier series of $f$ and $g$ are uniformly convergent to $f,g$ respectively. 
$a_0,a_n,b_n,\alpha_0,\alpha_n,\beta_n$ are the fourier coefficients of $f,g$ respectively.
I thought we could simply expand the LHS, simplify, and then show equality. I start by multiplying $f(x)g(x)$ via their respective Fourier series.
$$a_0\alpha_0 + a_0(\sum_{n=1}^{\infty} \alpha_n\cos(nx) + \beta_n\sin(nx))+\alpha_0(\sum_{n=1}^{\infty} a_n\cos(nx) + b_n\sin(nx)) + (\sum_{n=1}^{\infty} \alpha_n\cos(nx) + \beta_n\sin(nx))(\sum_{n=1}^{\infty} a_n\cos(nx) + b_n\sin(nx))$$
How do I simplify this? Because we have uniform convergence, we can switch the places of the Sigma and Integral symbols yeah? Even then though..

REPLY [3 votes]: I am surprised nobody mentioned the brute force method. Assume that $a_0=\alpha_0$, only to ease typing. Then just expand $f$ and $g$ in the integral: 
\begin{equation}
\begin{split}
\frac{1}{\pi}\int_{-\pi}^\pi f(x)g(x)\, dx &=  \sum_{n, n'=1}^\infty \frac{a_n\alpha_{n'}}{\pi}\int_{-\pi}^\pi\cos(nx)\cos(n'x)\, dx + \sum_{n, n'=1}^\infty \frac{b_n\beta_{n'}}{\pi}\int_{-\pi}^\pi \sin(nx)\sin(n'x)\,dx \\ 
&+ \sum_{n,n'=1}^\infty \frac{a_n\beta_{n'}}{\pi}\int_{-\pi}^\pi \cos(nx)\sin(n'x)\, dx + \sum_{n, n'=1}^\infty \frac{b_n\beta_{n'}}{\pi}\int_{-\pi}^\pi\sin(nx)\cos(n'x)\, dx.
\end{split}
\end{equation}
Now use the addition formulas for sine and cosine:
\begin{align}
\cos(nx)\cos(n'x)&= \frac{1}{2}\left[ \cos((n+n')x) + \cos((n-n')x)\right] \\ 
\sin(nx)\sin(n'x)&=\frac{1}{2}\left[ \cos((n-n')x)-\cos((n+n')x)\right] \\
\cos(nx)\sin(n'x)&=\frac{1}{2}\left[\sin((n+n')x)+\sin((n-n')x)\right].
\end{align}
to evaluate 
\begin{align}
\frac{1}{\pi}\int_{-\pi}^\pi\cos(nx)\cos(n'x)\, dx&=\delta_{n n'}\\ 
\frac{1}{\pi}\int_{-\pi}^\pi\sin(nx)\sin(n'x)\, dx&=\delta_{n n'}\\
\frac{1}{\pi}\int_{-\pi}^\pi\cos(nx)\sin(n'x)\,dx&=0.
\end{align}
(Deltas are the Kronecker symbol: $\delta_{nn'}=1$ if $n=n'$ and $0$ otherwise). Substituting it into the big formula above gives the result. 
Sure, this method is not elegant. But sometimes it might be the only thing one can do. For example, this method allows us to compute
\begin{equation}
\int_{-\pi}^\pi f(x)g(x)\cos(x)\, dx.
\end{equation}