- $D_N(u) = \frac{1}{2\pi} + \frac{1}{\pi}\sum_{n=1}^N \cos(nu)$.
- $D_N(u)$ is even and $2\pi$ periodic.
- $\int_{-\pi}^\pi D_N(u)du = 1$ and $\int_0^\pi D_N(u)du = \frac12$.
- $D_N(u) = \frac{\sin((N+\frac12)u)}{2\pi \sin(\frac{u}{2})}$.

The properties given for D_{N} help put each partial sum
S_{N} in a form that will make it easier to work with. First
of all, in the form of S_{N} above, we change variables to u
=
t-x and use the fact that D_{N} is even to get $S_N(x) =
\int_{-\pi-x}^{\pi-x} f(u+x)D_N(u)du$. We will need the lemma below to
go any further.

**Lemma.** Let $g$ be a $2\pi$ periodic function (a.e.) that
is integrable on each bounded interval in $\mathbb R$. Then,
$\int_{-\pi+c}^{\pi+c} g(u)du$ is independent of $c$. In particular,
$\int_{-\pi+c}^{\pi+c} g(u)du=\int_{-\pi}^\pi g(u)du$.

** Proof:** Exercise.

Fix $x$. Both $D_N(u)$ and $f(x+u)$ are $2\pi$-periodic in $u$,
and so by the Lemma with $c=-x$,
\[
S_N(x) =
\int_{-\pi-x}^{\pi-x}f(u+x)D_N(u)du=
\int_{-\pi}^{\pi}f(u+x)D_N(u)du.
\]
We can change variables in the integral going from $u$ to $-u$. The
result is that
\[
S_N(x) = -\int_{\pi}^{-\pi} f(x-u)D_N(-u)du =
\int_{-\pi}^\pi f(x-u)D_N(u)du.
\]
(Recall that $D_N$ is even.) Add
these two expressions together and divide by 2. The integrand in
the
result, $(f(x+u)+f(x-u))D_N(u)/2$, is even. Using the fact that an
integral of an even function over a symmetric interval is twice the
integral of the function over half the interval, we get, after
canceling factors of 2, that
\[
(\dagger) \quad S_N(x) = \int_0^\pi (f(x+u)+f(x-u))D_N(u)du.
\]
The next ingredient in our proof is the *Riemann-Lebesgue Lemma*, which
we now state:

**Riemann-Lebesgue Lemma.** If $f$ is in $L^1[a,b]$, then
$ \lim_{\lambda\to \pm\infty} \int_a^bf(x)\cos(\lambda x)dx =
\lim_{\lambda\to \pm\infty} \int_a^bf(x)\sin(\lambda x)dx =
\lim_{\lambda\to \pm \infty} \int_a^bf(x)e^{i\lambda x}dx= 0$.

**Proof:** We will prove the cosine version. Let $f$ be a
continuous, piecewise smooth function on $[a,b]$. Then, after
integrating by parts, we have
\[
\int_a^b f(x)\cos(\lambda x)dx = \frac{1}{\lambda}(f(b)\sin(\lambda
b) -f(a)\sin(\lambda a)) - \frac{1}{\lambda}\int_a^b f'(x)\sin(\lambda
x)dx.
\]
From this, it easily follows that
\[
(\ddagger)\quad \bigg|\int_a^b f(x)\cos(\lambda x)dx\bigg| \le
\frac{1}{|\lambda|}\bigg(|f(b)|+|f(a)|+\int_a^b |f'(x)|dx\bigg).
\]
Letting $\lambda\to \pm\infty$ above then yields $\lim_{\lambda \to
\infty}\int_a^b f(x)\cos(\lambda x)dx=0$. Since linear splines are
continuous piecewise smooth functions, the result holds for them. Now,
let $f$ be in $L^1[a,b]$. We are given that $C[a,b]$ is dense in
$L^1[a,b]$. Thus, given $\epsilon>0$, we can find $g\in C[a,b]$ such
that $\|f-g\|_{L^1[a,b]} < \epsilon/3$. In addition, if $s$ is the
linear spline interpolant to $g$, with knots equally spaced a distance
$\delta_n=\frac{b-a}{n}$ apart, then $\|g-s\|_{C[a,b]}\le
\omega(g;\delta_n)$ and, consequently, $\|g-s\|_{L^1[a,b]} \le
(b-a)\omega(g;\delta_n)$. We may then choose $n$ so large that
$\|g-s\|_{L^1[a,b]}<\epsilon/3$. By our estimate $(\ddagger)$ to $s$,
we also have $\big|\int_a^b s(x)\cos(\lambda x)dx\big| \le
\frac{C_s}{|\lambda|}$. If we choose $|\lambda| > 3C_s/\epsilon$, then
$\big|\int_a^b s(x)\cos(\lambda x)dx\big| < \epsilon/3$. Finally, we
can write $f=(f-g)+(g-s) +s$, from which it follows that
\[
\bigg|\int_a^b f(x)\cos(\lambda x)dx\bigg| < \|f-g\|_{L^1[a,b]}+
\|g-s\|_{L^1[a,b]}+\bigg|\int_a^b s(x)\cos(\lambda x)dx\bigg| <
\epsilon/3+ \epsilon/3+\epsilon/3 = \epsilon,
\]
which proves the lemma. $\square$

**Pointwise Convergence Theorem.** If f is a 2π-periodic
piecewise continuous function that has a right-hand derivative
$f'(x+)$ and a left hand derivative $f'(x-)$ at $x$, then
\[
\lim_{N\to \infty}S_N(x) =
\left\{
\begin{array}{cl}
f(x) & \text{if }f \ \text{is continuous at }x.\\
\tfrac12 (f(x+)+f(x-)) & \text{if }f\ \text{has a jump discontinuity at } x.
\end{array}
\right.
\]
**Proof:** The trick here is to put the the error S_{N}(x)
- f(x) or S_{N}(x) - (f(x+)+f(x-))/2 in the right form. Since
in
the continuous case one just has f(x+)=f(x-)=f(x), we can do both
cases using $E_N(x) = S_N(x) - \frac12 (f(x+)+f(x-))$. From the third
property of D_{N} listed above and the final form of $S_N$
given in $(\dagger$), we obtain $E_N(x) = \int_0^\pi (f(x+u) +
f(x-u) - f(x+) - f(x-))D_N(u)du$. Use property 4 of $D_N(u)$ to put
the error in the form
\[
\begin{aligned}
E_N(x) =& \int_0^\pi \bigg(\frac{f(x+u) + f(x-u) - f(x+) - f(x-)}{2\pi
\sin(u/2)}\bigg) \sin((N+\tfrac12)u)du \\
=& \int_0^\pi F(u)
\sin((N+\tfrac12)u)du,
\end{aligned}
\]
where $F(u) := (f(x+u) + f(x-u) - f(x+) - f(x-))/(2\pi
\sin(u/2))$. Since x is fixed, we can ignore the dependence of the
expression above on $x$. L'Hospital's rule and the fact that $f$ has
right and left derivatives at x imply that $
\lim_{u \downarrow 0}
F(u) = (f'(x+) - f'(x-))/\pi$, so $F$ has a right hand limit at u =
0. This and the piecewise continuity of $f$ and $1/\sin(u/2)$ on the half-open
interval $(0,\pi]$ mean that $F(u)$ is piecewise continuous on
$[0,\pi]$. From the Riemann Lebesgue Lemma we have that $\lim_{N\to
\infty}E_N(x) = 0.$ $\ \square$

** An example.** In class we showed that if $f(x) = \left\{
\begin{array}{cl} 1 & 0 \le x \le \pi, \\ -1 & -\pi <\le x< 0
\end{array} \right.$, then, in the Fourier series for $f$, all of the
$a_n$'s are $0$ and also, when $n$ is even, the $b_n$'s are $0$. For odd
$n$, $b_n=\frac{4}{n \pi}$. Thus the Fourier series for $f$ satisfies
\[ \sum_{n\ \text{odd}} \frac{4}{n \pi}\sin(nx) =
\sum_{k=1}^\infty \frac{4}{(2k-1) \pi}\sin\big((2k-1)x\big)
=
\left\{
\begin{array}{cl}
f(x) = 1, & \text{for } \ 0< x < \pi \\
\frac12 \big(f(0+)+ f(0-)\big) = 0,& \text{for } x=0 \\
f(x) = -1, & \text{for } -\pi < x< 0.
\end{array}
\right.
\]
As an illustration of what this means, let's set $x = \pi/2 $. For
this value of $ x $, we have $1 = \sum_{k=1}^\infty \frac{4}{(2k-1)
\pi}\sin\big((2k-1)\pi/2\big)$. Since
$\sin\big(\frac{(2k-1)\pi}{2}\big)= (-1)^{k+1}$, we have, after
multiplying both sides by $\pi/4$,
\[
\frac{\pi}{4} =
\sum_{k=1}^\infty \frac{4(-1)^{k+1}}{2k-1} = 1 - \frac13 + \frac17 -
\frac19 + \cdots,
\]
which is a famous series that was used to compute $\pi$. Since the
series has terms that alternate and decrease in absolute value, the
error made truncating the series after $K$ terms is
$\frac{1}{2K+1}$. Thus to compute $\pi/4$ to within $0.01$, we would
need to take $K\ge 50$.

Previous: approximation of continuous functions