% This is a sample file for the Undergraduate Faculty Program at
% PCMI, containing one lecture 
%
%   More Heat Equation, more Fourier Series, and some issues of convergence.
%
%  from the Park City Lectures of Jorge Aarao.
%
% The sample file illustrates the use of epsf.tex to include postscript 
% graphics, as well as various "AmS-LaTeX" constructions from the amsmath
% package (which is automatically loaded by the pcms-l document class).
% To run this file you need the files 
%
%        pcms-l.cls and pcmslmod.tex
%


\documentclass[lecture,12pt,]{pcms-l}
\input pcmslmod.tex  % v.1.2
%\input epsf.tex

%\usepackage{amssymb} % this command would have loaded all the extra symbols,



% authors should not define these, they will be defined by the volume editors
%\def\currentvolume{3}
%\def\currentyear{1993}


% EQUATION NUMBERING AND THEOREM SETUP

\numberwithin{section}{chapter}
\numberwithin{equation}{chapter}

\theoremstyle{plain}
\newtheorem{theorem}[equation]{Theorem}
\newtheorem{lemma}[equation]{Lemma}

\theoremstyle{definition}
\newtheorem{definition}[equation]{Definition}

\newtheorem{exercise}{Exercise}
\newtheorem{problem}{Problem}
\newtheorem*{remark}{Remark}

% Set enumerate to use letters, not numbers for problem parts.

\renewcommand{\theenumi}{\alph{enumi}}
\renewcommand{\labelenumi}{(\theenumi)}

% AUTHOR-DEFINED MACROS:

\newcommand{\cA}{\mathcal{A}}
\newcommand{\cB}{\mathcal{B}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\cC}{\mathcal{C}}
\newcommand{\cD}{\mathcal{D}}

\begin{document}

\mainmatter
\setcounter{page}{1}

%\LogoOn

\lectureseries[An Introduction to PDE's]{An Introduction to Partial Differential Equations in the Undergraduate Curriculum}


\auth[Jorge Aarao]{Jorge Aarao} 

%\address{Department of Mathematics, Claremont McKenna College,Claremont, CA 91711}
%\email{ajb@hmc.edu}

%The following items will become first page footnotes; they are optional.
%\date{\today}
%\setaddress


% the following hack starts the lecture numbering at 1
\setcounter{lecture}{5}
\setcounter{chapter}{5}

\lecture{The Convergence of Fourier Series}

\section{Outline of Lecture}
\begin{itemize}
\item{Back in the 19th Century\dots}
\item{Fourier Series: The Basics}
\item{Examples}
\item{Other Intervals}
\item{Coefficients and their Decay}
\item{Linear Algebra to the Rescue: $L^2$}
\item{The Many Faces of Convergence} 
\item{The Way Things Are}
\end{itemize}


\section{Back in the 19th Century\dots}

`All is number', said Pythagoras, by which he meant that
the sounds we hear are built from simpler, more basic frequencies.
At the start of the 19th century Fourier explained how actually to
decompose a function into simple sine waves, a
process that relates neatly to the old Greek assertion. Fourier's
method was very simple to apply, and very difficult to 
justify rigorously, so much so that many of his contemporaries
did not believe his results. As you have seen in the previous
lecture, he used his method to offer a solution to the
problem of heat propagation on a metal bar. Here we will be 
concerned with Fourier series themselves, their behavior,
aspects of their convergence, etc.



\vfill
\eject



\section{Fourier Series: The Basics}

To fix ideas we will work over the interval $[-\pi,\pi]$, and deal with variations later.
Fourier's setup is that given a function $f$ defined over that interval, it is
possible to write it as a (possibly infinite) linear combination of the `pure' waves
$1$, $\cos(x)$, $\cos(2x)$, \dots\ , $\sin(x)$, $\sin(2x)$, etc, so that
\begin{equation}
f(x)=\frac{A_0}{2}+\sum_{n=1}^{\infty}A_n\cos(nx)+B_n\sin(nx). \label{EXP}
\end{equation}
Soon it will become clear why we have divided the zeroth coefficient by 2.

For the moment let's believe (\ref{EXP}), and see how to compute the coefficients $A_n$, $B_n$.
The key here are the following formulas, called \emph{orthogonality relations}.
\begin{exercise}
Show that if $m$, $n$ are non-negative integers, and $m\ne n$, then
$$
\int_{-\pi}^{\pi}\cos(nx)\cos(mx)\,dx=0,
$$
$$
\int_{-\pi}^{\pi}\sin(nx)\sin(mx)\,dx=0.
$$
Also, even if we drop the restriction $m\ne n$,
$$
\int_{-\pi}^{\pi}\cos(nx)\sin(mx)\,dx=0.
$$
\end{exercise}
\begin{exercise}
Show that if $n$ is a positive integer, then
$$
\int_{-\pi}^{\pi}\cos^2(nx)\, dx=\int_{-\pi}^{\pi}\sin^2(nx)\, dx=\pi.
$$
\end{exercise}

Without worrying about rigor, let's follow Fourier and obtain formulas for the
coefficients. The coefficient $A_0$ is the simplest to find: integrate (\ref{EXP})
from $-\pi$ to $\pi$ to get
$$
\int_{-\pi}^{\pi}f(x)\, dx=\int_{-\pi}^{\pi}\frac{A_0}{2}\, dx+
\sum_{n=1}^{\infty}\left\{A_n\int_{-\pi}^{\pi}\cos(nx)\, dx+B_n\int_{-\pi}^{\pi}\sin(nx)\, dx\right\}.
$$
The series on the right vanishes, and we find that
$$
A_0=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\, dx.
$$
We do the same thing to compute, say, $B_m$, except that first we multiply (\ref{EXP})
through by $\sin(mx)$. We get
\begin{eqnarray*}
\lefteqn{\int_{-\pi}^{\pi}f(x)\sin(mx)\, dx = } \\
&&\int_{-\pi}^{\pi}\frac{A_0}{2}\sin(mx)\, dx+ \\
&& \sum_{n=1}^{\infty}A_n\int_{-\pi}^{\pi}\cos(nx)\sin(mx)\, dx+
B_n\int_{-\pi}^{\pi}\sin(nx)\sin(mx)\, dx.
\end{eqnarray*}
What is important to notice is that \emph{all} of the integrals on the right side vanish,
except for the one multiplying $B_m$. The equation for $B_m$ becomes
\begin{equation}
B_m=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\sin(mx)\, dx \qquad m=1, 2, 3, \dots. \label{Bs}
\end{equation}
Likewise the formula for $A_m$ is
\begin{equation}
A_m=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\cos(mx)\, dx \qquad m=0, 1, 2, \dots.\label{As}
\end{equation}
(Because $A_0$ appears in (\ref{EXP}) divided by 2, the above formula for $A_m$ also
works for $A_0$.)

Formulas (\ref{Bs}) and (\ref{As}) allow us to compute the
Fourier coefficients of $f$. We postpone any discussion about convergence until Section 6.6.

One last important point: Even though $f$ is defined only on $[-\pi, \pi]$, the right-hand side of 
(\ref{EXP}) is $2\pi$-periodic, so we could view $f$ as being defined over the whole line, but
$2\pi$-periodic as well.


\section{Examples}

For our first example we consider $f(x)=x$ over the interval $[-\pi, \pi]$. Clearly $A_0=0$,
and for $n\geq 1$
$$
A_n=\frac{1}{\pi}\int_{-\pi}^{\pi}x\cos(nx)\, dx=\frac{1}{\pi}\left\{ \left. 
\frac{x\sin(nx)}{n}\right|_{-\pi}^{\pi}-\int_{-\pi}^{\pi}\frac{\sin(nx)}{n}\, dx
\right\}=0.
$$
\begin{exercise}
If $f$ is an \emph{odd} function ($f(x)=-f(-x)$ for all $x$), show that $A_n=0$.
\end{exercise}

For $n\geq 1$ we obtain
\begin{eqnarray*}
B_n&=&\frac{1}{\pi}\int_{-\pi}^{\pi}x\sin(nx)\, dx=\frac{1}{n\pi}\left\{ \left. 
-x\cos(nx)\right|_{-\pi}^{\pi}+\int_{-\pi}^{\pi}\cos(nx)\, dx
\right\} \\[.03in]
&=&\frac{(-1)^{n+1}\cdot 2}{n}.
\end{eqnarray*}

So, if this Fourier series converges, we obtain, for $x\in[-\pi,\pi]$,
$$
x=\sum_{n=1}^{\infty}\frac{(-1)^{n+1}\cdot 2}{n}\, \sin(nx).
$$

For our second example let's take $f(x)=x^2$.

\begin{exercise}
Show that if $f$ is \emph{even} ($f(x)=f(-x)$ for all $x$), then $B_n=0$.
\end{exercise}

Since $x^2$ is even we only need to compute $A_n$:
$$
A_0=\frac{1}{\pi}\int_{-\pi}^{\pi}x^2\, dx=\frac{2}{3}\, \pi^2,
$$
and for $n\geq 1$
\begin{eqnarray*}
A_n&=&\frac{1}{\pi}\int_{-\pi}^{\pi}x^2\cos(nx)\, dx\\[.03in]
&=&\frac{1}{n\pi}\left\{ \left. 
x^2\sin(nx)\right|_{-\pi}^{\pi}-\int_{-\pi}^{\pi}2x\sin(nx)\, dx
\right\}\\[.03in]
&=&\frac{(-1)^n\cdot 4}{n^2}.
\end{eqnarray*}

As before, if we do have convergence, then, for $x\in[-\pi, \pi]$,
$$
x^2=\frac{\pi^2}{3}+\sum_{n=1}^{\infty}\frac{(-1)^n\cdot 4}{n^2}\, \cos(nx).
$$

\section{Other Intervals}

The first variation on the above is to consider intervals of the form $[-l, l]$.
The trick is to rescale the problem: if $f$ is defined for $x\in[-l,l]$, we define
$g$ by setting $g(x\pi/l)=f(x)$; then $g$ is defined over $[-\pi ,\pi]$, and
$$
f(x)=g\left(\frac{x\pi}{l}\right)=\frac{A_0}{2}+\sum_{n=1}^{\infty}
A_n\cos\left(\frac{n\pi x}{l}\right)+B_n\sin\left(\frac{n\pi x}{l}\right),
$$
where $A_n$ and $B_n$ are the coefficients for the function $g$.
\begin{exercise}
If $a_n$ and $b_n$ are the coefficients for the function $f$, show that
$$
a_n=A_n=\frac{1}{l}\int_{-l}^lf(x)\cos\left(\frac{n\pi x}{l}\right)\, dx,
$$
$$
b_n=B_n=\frac{1}{l}\int_{-l}^lf(x)\sin\left(\frac{n\pi x}{l}\right)\, dx.
$$
\end{exercise}

The second main variation occurs when we consider half-intervals of type $[0,l]$.
Here we can just \emph{extend} $f$ to the whole interval $[-l,l]$, and obtain the Fourier
series of the extension. If we do have convergence, then the Fourier series we obtained
will be equal to $f$ on the half-interval. Of course, we want to extend $f$ in a
sensible way. The two standard ways of doing it are by extending $f$ to be an even function,
or an odd function.

\begin{exercise}
Show that if $f$ is extended to be an odd function, then $A_n=0$, and
$$
B_n=\frac{2}{l}\int_0^lf(x)\sin\left(\frac{n\pi x}{l}\right)\, dx.
$$
\end{exercise}

\begin{exercise}
Show that if $f$ is extended to be an even function, then $B_n=0$, and
$$
A_n=\frac{2}{l}\int_0^lf(x)\cos\left(\frac{n\pi x}{l}\right)\, dx.
$$
\end{exercise}

The reason why you would want to use one type of extension over the other
depends on the type of problem at hand. For Dirichlet conditions on
the half-interval we want the odd extension; for Neumann conditions we
want the even extension.

\section{Coefficients and Their Decay}

In this section we want to view $f$ as being $2\pi$-periodic and defined over the
whole line. Going back to the two examples we saw in Section 6.4, when $f(x)=x$
we saw that $|B_n|$ decayed like $C/n$, for some constant $C$ (in fact, $C=2$ for
that example). Likewise, when $f(x)=x^2$, we had $|A_n|$ decaying like $C/n^2$.
The speed with which coefficients decay is rather important if we are interested
in the convergence of the series, and the following theorem is very useful.

\begin{theorem}
Let $f$ be a $2\pi$-periodic function with $k-1$ continuous derivatives, and whose
$k$-th derivative is piecewise continuous. Then the Fourier coefficients of $f$ decay
like $C/n^k$, where the constant $C$ depends only on $f$.
\end{theorem}

\begin{proof}
By induction on $k$. Let's compute $A_n$, $n\geq 1$.
\begin{eqnarray*}
A_n&=&\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\cos(nx)\, dx\\[.03in]
&=&\frac{1}{n\pi}\left\{\left.f(x)\sin(nx)\right|_{-\pi}^{\pi}-\int_{-\pi}^{\pi}f'(x)\sin{nx}\, dx
\right\}\\[.03in]
&=&-\frac{1}{n\pi}\int_{-\pi}^{\pi}f'(x)\sin{nx}\, dx.
\end{eqnarray*}
By induction this last integral is bounded by some constant over $n^{k-1}$, so that $|A_n|\leq C/n^k$.
Likewise for $B_n$, $n\geq 1$ we have
\begin{eqnarray*}
B_n&=&\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\sin(nx)\, dx\\[.03in]
&=&\frac{1}{n\pi}\left\{\left.-f(x)\cos(nx)\right|_{-\pi}^{\pi}+\int_{-\pi}^{\pi}f'(x)\cos{nx}\, dx
\right\}\\[.03in]
&=&\frac{1}{n\pi}\int_{-\pi}^{\pi}f'(x)\cos{nx}\, dx,
\end{eqnarray*}
where the last equality is true due to the periodicity of $f$. (Periodicity is important here. Not only
is $f(-\pi)=f(\pi)$, but that is also true for all of $f$'s derivatives.) Again, induction gives us 
$|B_n|\leq C/n^k$. We are left to do the basis of induction, $k=1$. That means that $f'$ is piecewise
continuous. The same formulas we have above for $A_n$ and $B_n$ are valid, and the easy estimate
$$
\left|\int_{-\pi}^{\pi}f'(x)\sin(nx)\, dx\right|\leq \int_{-\pi}^{\pi}\vert f'(x)\vert \, dx=C
$$
shows that $|A_n|$ decays like $C/n$. A similar estimate holds for $B_n$.
\end{proof}

This theorem says that the more derivatives you have in hand, the better the Fourier series will converge.
Also true is a converse of this theorem: The faster the coefficients decay, the more derivatives
you have for $f$. We will not prove this fact.

NB: The above theorem \emph{is not optimal}, as shown by the examples we computed. The reader is invited 
to sharpen the hypotheses of this theorem.


\section{Linear Algebra to the Rescue: $L^2$}

We now ask ourselves the important question: Why, and how, would (\ref{EXP}) be true? If we look at
our problem from the point of view of Linear Algebra, we are claiming that the function $f$ is
in the linear span of the functions $1$, $\cos(x)$, $\cos(2x)$, \dots , $\sin(x)$, $\sin(2x)$, etc.
So what we have here is a vector space problem -- but which vector space?
\begin{definition}
The space $L^2=L^2([-\pi,\pi])$ is formed by those functions $f$ for which
$$
\int_{-\pi}^{\pi}\vert f(x)\vert^2\, dx
$$
is finite.
\end{definition}
Technically the integral in the above definition should be the Lebesgue integral -- but we will
gloss over this point and work with the Riemann integral here.
\begin{definition}
The $L^2$ norm of a function $f$ is given (and denoted) by
$$
\Vert f \Vert = \sqrt{\int_{-\pi}^{\pi}\vert f(x)\vert^2\, dx}.
$$
The inner product of two functions $f$ and $g$ in $L^2$ is given by
$$
(f,g)=\int_{-\pi}^{\pi} f(x)g(x)\, dx.
$$
\end{definition}
The inner product on $L^2$ plays the role of the dot product on $\mathbb{R}^n$. In fact,
if you think of the dot product of two vectors as adding the products of the coordinates,
you will see that the inner product does the `same' for functions (where here $x$ plays
the role of vector coordinate). 

With this notion of inner product, we see that the orthogonality relations are simply
stating that the functions $1$, $\cos(x)$, $\cos(2x)$, \dots , $\sin(x)$, $\sin(2x)$, etc,
are mutually perpendicular. This is great, since orthogonality implies independence. Since
we do have independence, to prove that
the trigonometric functions for a basis for $L^2$,
all we need to check is that those functions do span $L^2$. The next
definition establishes our notion of convergence in this vector space.
\begin{definition}
Given $f\in L^2$, denote by $S(f,N)$ the $N$-th partial sum of the Fourier series of $f$, namely
$$
S(f,N)(x)=\frac{A_0}{2}+\sum_{n=1}^{N}A_n\cos(nx)+B_n\sin(nx).
$$
We say that $S(f,N)$ converges to $f$ in $L^2$ if and only if 
$$
\lim_{N\rightarrow\infty}\Vert f - S(f,N)\Vert=0.
$$
\end{definition}

Convergence in $L^2$ can be very strange.
\begin{exercise}
Find a sequence of functions $g_n\in L^2$ such that $\Vert g_n\Vert\rightarrow 0$, but $g_n(x)$ 
\emph{does not converge to zero for any value of $x$}.
\end{exercise}

Our next result shows that $S(f,N)$ is, in some sense, the best approximation for $f$. To state the result,
let 
$$
g(x)=\frac{a_0}{2}+\sum_{n=1}^Na_n\cos(nx)+b_n\sin(nx),
$$ 
where the $a_n$ and $b_n$ are any coefficients.

\begin{theorem}
With $g$ defined as above, we have
$$
\Vert f-S(f,N)\Vert \leq \Vert f-g\Vert.
$$
\end{theorem}
In other words, of all finite trigonometric sums of order at most $N$, the one with exactly
the Fourier coefficients of $f$ is the one that best approximates $f$ in $L^2$.
\begin{proof}
We will show the following equality:
\begin{equation}
\Vert f-g\Vert^2 = \Vert f-S(f,N)\Vert^2 +\Vert g-S(f,N)\Vert^2. \label{PYT}
\end{equation}
As a consequence
$$
\Vert f-g\Vert \geq  \Vert f-S(f,N)\Vert,
$$
with equality holding if and only if $g=S(f,N)$. In what follows, we will
write $S=S(f,N)$. To see that (\ref{PYT}) is true, we
start by expanding the left hand side:
$$
\Vert f-g\Vert^2=(f-g,f-g)=(f,f)-2(f,g)+(g,g)=\Vert f\Vert^2-2(f,g)+\Vert g\Vert^2.
$$
Now, add and subtract the quantities $\Vert S\Vert^2$ and $2(f,S)$:
$$
\Vert f-g\Vert^2=\Vert f\Vert^2-2(f,S)+\Vert S\Vert^2 -\Vert S\Vert^2-2(f,g)
+2(f,S)+\Vert g\Vert^2.
$$
Notice that $\Vert f\Vert^2-2(f,S)+\Vert S\Vert^2 =\Vert f-S\Vert^2$. The above expression becomes
$$
\Vert f-g\Vert^2=\Vert f-S\Vert^2 -\Vert S\Vert^2-2(f,g)
+2(f,S)+\Vert g\Vert^2.
$$
All that is left to do is see that $\Vert g-S\Vert^2=-\Vert S\Vert^2-2(f,g)
+2(f,S)+\Vert g\Vert^2$. We compute:
\begin{eqnarray*}
(f,S)&=&\frac{A_0}{2}(f,1)+\sum_{n=1}^NA_n(f,\cos(nx))+B_n(f,\sin(nx))\\[.03in]
&=&\pi\frac{A_0^2}{2}+\sum_{n=1}^N\pi(A_n^2+B_n^2)=(S,S)=\Vert S\Vert^2.
\end{eqnarray*}
Likewise we find
$$
(f,g)=\pi\frac{a_0A_0}{2}+\sum_{n=1}^N\pi(a_0A_0+b_0B_0)=(S,g).
$$
The reader is now invited to finish the proof.
\end{proof}

Now take $g=0$ in (\ref{PYT}). We get
$\Vert f\Vert^2=\Vert f-S\Vert^2+\Vert S\Vert^2$, and so $\Vert f\Vert^2\geq \Vert S\Vert^2$. Explicitly this reads
$$
\frac{A_0^2}{2}+\sum_{n=1}^N(A_n^2+B_n^2)\leq \frac{1}{\pi}\Vert f \Vert^2.
$$
Since $N$ is arbitrary, we obtain \emph{Bessel's inequality}:
\begin{equation}
\frac{A_0^2}{2}+\sum_{n=1}^{\infty}(A_n^2+B_n^2)\leq \frac{1}{\pi}\Vert f \Vert^2.\label{BES}
\end{equation}

Bessel's inequality is related to Pythagoras' Theorem in $\mathbb{R}^n$. What that theorem says
is that the square of the norm of a vector is the sum of the squares of the sizes of each of that vector's
components, when projected in orthogonal directions. The reason why we did not get equality in
Bessel's inequality is simply because we don't know yet if the orthogonal directions given by the
trigonometric functions span the whole of $L^2$. If we knew that, then Bessel's inequality would become
an equality, and vice versa: if we could prove that we have equality in (\ref{BES}), then we would know
that the trigonometric functions span $L^2$. We will assume that we have proved that
the trigonometric functions span $L^2$. Then we have:

\begin{theorem} (Parseval's identity.) If $f\in L^2$, then
$$
\frac{A_0^2}{2}+\sum_{n=1}^{\infty}(A_n^2+B_n^2)=\frac{1}{\pi}\Vert f \Vert^2.
$$
\end{theorem}

\begin{exercise} Apply Parseval's identity to the function $f(x)=x$ and conclude that
$$
\sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{\pi^2}{6}.
$$
\end{exercise}
\begin{exercise} Apply Parseval's identity to the function $f(x)=x^2$. What can you conclude?
\end{exercise}

\section{The Many Faces of Convergence}

As we pointed out before, convergence in the space $L^2$ does not imply convergence
for particular values of $x$.

\begin{definition} We say that $f_n$ converges pointwise to $f$ if and only if for 
each $x\in[-\pi,\pi]$ we have
$f_n(x)\rightarrow f(x)$, as $n$ goes to infinity.
\end{definition}

\begin{definition} We say that $f_n$ converges uniformly to $f$ if and only if for 
each $\varepsilon >0$
there is some $n_0$ depending only on $\varepsilon$ (and not on $x$) such that 
if $n\geq n_0$, then $|f_n(x)-f(x)|<\varepsilon$.
\end{definition}

Roughly speaking, uniform convergence implies not only that for each $x$ we have 
$f_n(x)\rightarrow f(x)$, but that $f_n(x)$ and $f_n(y)$ converge \emph{at the same rate} to
$f(x)$ and $f(y)$.

\begin{exercise}
Show that pointwise convergence implies neither uniform nor $L^2$ convergence.
Show that $L^2$ convergence implies neither pointwise nor uniform convergence.
Show that uniform convergence implies both pointwise and $L^2$ convergence.
\end{exercise}

A Fourier series may not converge pointwise: Take $f(x)=x$ and check that $S(f,N)(\pi)=0$
for all $N$. We can fix that problem if we redefine $f$ at $-\pi$ and $\pi$ to be equal to
zero, but it seems silly to redefine $f$ so that we can obtain pointwise convergence.

More dramatically, if $f$ is not continuous, then $S(f,N)$ can \emph{never} converge
uniformly to $f$. That is because of a theorem from Analysis that guarantees that
the uniform limit of continuous functions must be continuous. Since the $S(f,N)$ are
continuous, we can't have uniform convergence to $f$ when $f$ itself is discontinuous.

\section{The Way Things Are}

In this section we give a survey of convergence results for Fourier series. We won't prove
any of these results. We assume throughout that $f\in L^2$.

\begin{theorem}
If $f$ is piecewise differentiable, then $S(f,N)(x)$ converges to $f(x)$ for all values
of $x$ for which $f$ is continuous. If $x$ is a point of discontinuity of $f$, then
$S(f,N)(x)$ converges to the average of the lateral limits of $f$ at $x$.
\end{theorem}

\begin{theorem}
If $f$ is piecewise differentiable and continuous, then $S(f,N)$ converges uniformly
to $f$. The rate of convergence depends on the degree of differentiability of $f$.
\end{theorem}

\begin{theorem}
(Carleson) If $f\in L^2$ (without smoothness assumptions), then for almost every $x$
we have that $S(f,N)(x)$ converges to $f(x)$.
\end{theorem}
(The notion of `almost every $x$' has a precise, technical meaning in Analysis. It is 
fair to say that this theorem is one of the hardest in all of Mathematics.)

\begin{theorem}
(Gibbs' phenomenon) If $f$ has a discontinuity at $x$, then $S(f,N)$ has a little bump
near $x$. The height of that bump tends to a constant as $N$ increases, 
and the bump is always present.
\end{theorem}

Of the theorems above the most useful for us are the first two. They were both proved
by Dirichlet -- indeed, he was the first to show any type of convergence results for
Fourier series. (Cauchy tried, but failed.) Here was Dirichlet's approach: If you insert
the formula for the $A_n$ and $B_n$ into $S(f,N)$, and exchange the finite sum 
with the integral, you get
\begin{eqnarray*}
\lefteqn{S(f,N)(x)=}\\
&&\frac{1}{\pi}\int_{-\pi}^{\pi}f(y)\left(\frac{1}{2}+
\sum_{n=1}^N(\cos(ny)\cos(nx)+\sin(ny)\sin(nx))
\right)\, dy\\
&&=\frac{1}{2\pi}\int_{-\pi}^{\pi}f(y)\left(1+
\sum_{n=1}^N2\cos(n(x-y))\right)\, dy.
\end{eqnarray*}
We set
$$
D_N(z)=1+\sum_{n=1}^N2\cos(nz).
$$
This is the so-called Dirichlet kernel, and it can be shown to equal
\begin{equation}
D_N(z)=\frac{\sin(N+\frac{1}{2})z}{\sin\frac{1}{2}z}.\label{KER}
\end{equation}
The function $D_N$ has useful properties that Dirichlet explored to obtain
his convergence results. 
\begin{exercise}
Prove formula (\ref{KER}). (This could be very hard.)
\end{exercise}

\begin{exercise}
What is $\int_{-\pi}^{\pi}D_N(x)\, dx$? (This is very easy!)
\end{exercise}

\begin{exercise}
Use Maple to infer a relationship between the height of the bump in Gibbs' phenomenon,
and the size of the jump at the discontinuity.
\end{exercise}











\end{document}
