How to integrate $f(x)$? I've been asked to integrate $\int{f(x)}^2 dx$ between the ranges of $L$ and $-L$.
I'm stuck! I understand how to integrate a constant or a function as in $x^2$ or something, but the $f(x)$ format is not something I'm familiar with. Please could someone explain this to me and perhaps guide me?
This is not the actual question I'm trying to solve. I think it might help if I put the above in context, so here's the question I'm trying to solve (I'm not asking anyone to do my homework, this isn't homework...):

Show that for a periodic function, defined over the integral $x=-L$ to $x=L$:
$$\frac1{L} \int_{-L}^L{f(x)}^2 dx = \frac{a_0^2}{2} + \sum_{n=1}^{\infty}(a_n^2 + b_n^2)$$
where $a_0$, $a_n$ and $b_n$ are Fourier coefficients of $f(x)$.

 A: First, you don't know anything about $f$ other than that it's periodic and has Fourier coefficients $a_n,b_n$. This means the exercise is not about integrating a particular function, like $x^2$ or $\cos(x)$, it's about integrating a general Fourier series.
So, second, what can we do? All we know is that $f(x)$ is periodic of period $2L$ and has Fourier coefficients. So really the only thing you can do is write down a Fourier expansion of $f$ and integrate its square:
$$f(x) = \sum_{n=0}^\infty a_n\cos(2\pi nx/L) + b_n\sin(2\pi nx/L),$$
so 
\begin{align*}f(x)^2 &= \sum_{n=0}^\infty\sum_{m=0}^\infty\bigg(a_n\cos(2\pi nx/L) + b_n\sin(2\pi nx/L)\bigg)\bigg(a_m\cos(2\pi nx/L) + b_m\sin(2\pi nx/L)\bigg)\\
&=\sum_{n,m}\bigg(\mbox{product of the two factors}\bigg)\\
&= \mbox{etc ...}
\end{align*}
I'll leave the details for you to work out. Don't forget the most important theorem of Calculus II: $$\int_{-1}^1 \cos(2n\pi x)\sin(2m\pi x)\ dx = \delta_{nm} = \begin{cases}0, & n\neq m\\ 1, & n=m.\end{cases}$$
Third, for a general perspective, note that we can regard $f$ as an element of $L^2[-L,L]$, which has an orthonormal basis of integral-frequency cosines and sines. The Fourier coefficients of $f$ are the coordinates of $f$ with respect to this basis. Since the inner product is integration, your integral is just the square of the norm of $f$:
$$\int_{-L}^L f^2\ dx = \|f\|^2_{L^2}.$$
This suggests that, indeed, your integral will evaluate to the sum of the squares of the Fourier coefficients of $f$.
