# Convergence of Fourier Series in Mean Square

I have a question regarding the convergence of the Fourier series of a function. I am studying Fourier analysis from M.Stein and in Chapter 3 it states the theorem that if a function $$f(x)$$ is integrable on the circle and has a Fourier expansion, the partial sums of the Fourier series converge in the Mean Square sense:

$$\frac{1}{2\pi} \int_{0}^{2\pi}\left| f(x)-S_{n}(f)(x)\right|^{2}dx\longrightarrow 0$$ as $$n\longrightarrow \infty$$.

My question is, just after this theorem the book moves on to an example of a continous function that has a divergent Fourier series at a point. If the Fourier series diverges, even at a single point, shouldn't the integral shoot off to infinity and not converge?

If you have a Riemann-integrable (or Lebesgue-integrable) function $$f$$ on $$[0, 2\pi ]$$ and a sequence of Riemann-integrable (or Lebesgue-integrable) functions $$(f_{n})_{n\in\mathbb{N}}$$ on $$[0, 2\pi ]$$, you can consider two different types of convergence. One is to require that
$$\lim_{n\to\infty} \frac{1}{2\pi} \int_{0}^{2\pi} |f_{n}(x) - f(x)|^{2} \, {\rm d}x = 0.$$
This first property says that the sequence $$(f_{n})_{n\in\mathbb{N}}$$ converges in the mean square sense to $$f$$. Another is to require that for each $$x\in [0, 2\pi ]$$, $$(f_{n}(x))_{n\in\mathbb{N}}$$ converges to $$f(x)$$. This second property says that the sequence $$(f_{n})_{n\in\mathbb{N}}$$ converges pointwise to $$f$$.