Fourier Series integral proof Consider a Fourier series representation of a function $f(x).$  Let $S_{N}(x)$ be the $N^{\text{th}}$ partial sum defined by 
$$S_{N}(x) = \frac{a_{0}}{2} + \sum_{n=1}^{N}a_{n}\cos\frac{n\pi x}{L} + b_{n}\sin\frac{n\pi x}{L}$$
where $L$ is the period of the $f(x).$  I want to show that 

$$J_{N} = \int_{-L}^{L} \left [ S_{N}(x) \right ]^2 dx = \frac{La_{0}^2}{2} + L\sum_{n=1}^{N}a_{n}^2+b_{n}^2.$$

I already know that 
$$\int_{-L}^{L}S_{N}(x)dx = La_{0}.$$ 
I proved this by writing out the sum and integrating each term, which gives 
$$\int_{-L}^{L}S_{N}(x)dx = La_{0} = \int_{-L}^{L}\frac{a_{0}}{2}dx + \int_{-L}^{L}a_{1}\cos\frac{\pi x}{L}+ b_{1}\sin\frac{\pi x}{L}dx \ +...+$$ $$\int_{-L}^{L}a_{n}\cos\frac{n\pi x}{L}+ b_{n}\sin\frac{n\pi x}{L}dx.$$
From here, the integral is easily deduced.  How can I use this to solve the problem?  I'm pretty sure this has something to do with Bessel's Inequality and Paresval's Identity, but I don't really know how to continue.  
Thanks in advance! 
 A: The statement you want to show is exactly the Parseval's Identity (up to rescaling).
A: It actually is Parseval's identity. A sketch of the argument- First, convince yourself that by switching to complex coefficients $c_n\in \mathbb C$ that satisfy certain things so that the function is real valued, its enough to consider the finite sum of complex exponentials
$$ S_N(x) = \sum_{n=-N}^N c_n e^{in\pi x/L}$$
next, show that the collection of functions $e_n(x) := e^{in\pi x/L}$ for $n=-N,\dots,N$ are orthogonal with respect to the inner product $$\langle f,g\rangle = \int_{-L}^L f(x) \overline{g(x)} dx $$ and each vector has length $\|e_n\| := \langle e_n , e_n \rangle^{1/2} = L$.
This allows you to use essentially a version of Pythagoras's theorem
$$ \|S_N\|^2 := \langle S_N , S_N\rangle  = \sum_{n=-N}^N \sum_{m=-N}^Nc_n \overline c_m \langle e_n,e_m\rangle = \sum_{n=-N}^N \sum_{m=-N}^Nc_n \overline c_m L \delta_{mn} = L\sum_{n=-N}^N c_n \overline c_n = L\sum_{n=-N}^N |c_n|^2$$
the conditions you derived that relates $c_n$ and $a_n,b_n$ will give your expression.
