%%%%		-*- Mode: LaTeX -*-
%%%% Author:    J. Robert Buchanan
%%%% Address:   Department of Mathematics
%%%%		Millersville University
%%%%            P.O. Box 1002
%%%%            Millersville, PA 17551-0302
%%%% Phone:     717-871-7305
%%%% FAX:	717-871-7948
%%%% Email:     Robert.Buchanan@millersville.edu
%%%%
%%%% Date:      06/30/2022
%%%%
%%%% Purpose:   Differentiation and Integration of Fourier Series
%%%%

\documentclass[10pt]{beamer}

\mode<presentation>
{
  %\usetheme{Warsaw}
  \usetheme{default}
  %\usetheme{CambridgeUS}
  % or ...

  %\setbeamercovered{transparent}
  % or whatever (possibly just delete it)
}


\usepackage[english]{babel}
% or whatever

\usepackage[latin1]{inputenc}
% or whatever

\usepackage{times}
\usepackage[T1]{fontenc}
% Or whatever. Note that the encoding and the font should match. If T1
% does not look nice, try deleting the line with the fontenc.


\title{Differentiation and Integration of Fourier Series}
\subtitle{MATH 467 \textit{Partial Differential Equations}} % (optional)


\author % (optional, use only with lots of authors)
{J~Robert~Buchanan}
% - Use the \inst{?} command only if the authors have different
%   affiliation.

\institute[Millersville University of Pennsylvania]
% (optional, but mostly needed)
{
  Department of Mathematics
}
% - Use the \inst command only if there are several affiliations.
% - Keep it simple, no one is interested in your street address.

\date{ % (optional)
Fall
%Spring
%Summer
\the\year}

\subject{Talks}
% This is only inserted into the PDF information catalog. Can be left
% out. 



% If you have a file called "university-logo-filename.xxx", where xxx
% is a graphic format that can be processed by latex or pdflatex,
% resp., then you can add a logo as follows:

% \pgfdeclareimage[height=0.5cm]{university-logo}{university-logo-filename}
% \logo{\pgfuseimage{university-logo}}



% Delete this, if you do not want the table of contents to pop up at
% the beginning of each subsection:
\AtBeginSubsection[]
{
  \begin{frame}<beamer>
    \frametitle{Outline}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}


% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command: 

%\beamerdefaultoverlayspecification{<+->}


\begin{document}

\begin{frame}
  \titlepage
\end{frame}

%\begin{frame}
%  \frametitle{Outline}
%  \tableofcontents
  % You might wish to add the option [pausesections]
%\end{frame}


% Since this a solution template for a generic talk, very little can
% be said about how it should be structured. However, the talk length
% of between 15min and 45min and the theme suggest that you stick to
% the following rules:  

% - Exactly two or three sections (other than the summary).
% - At *most* three subsections per section.
% - Talk about 30s to 2min per frame. So there should be between about
%   15 and 30 frames, all told.

%\section{Introduction}

\begin{frame}\frametitle{Objectives}

In this lesson we will learn about
\begin{itemize}
\item the properties of the derivatives of Fourier series,
\item the properties of the integrals of Fourier series, and
\item Parseval's Identity and Bessel's Inequality.
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Cautionary Example}

\begin{enumerate}
\item Find the Fourier (sine) series for the $2 \pi$-periodic
  extension of $f(x) = x$.
\uncover<2->{%
\begin{align*}
b_{n} &= \frac{1}{\pi} \int_{-\pi}^{\pi} x \sin (n x) \, dx
	= \frac{2}{\pi} \int_{0}^{\pi} x \sin (n x) \, dx
	= \frac{2 (-1)^{n+1}}{n}	\\
f(x) &= 2 \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} \sin (n x)
\end{align*}
}
\item<3-> Differentiate the series term by term.
\uncover<4->{%
\[
2 \sum_{n=1}^{\infty} (-1)^{n+1} \cos (n x)
\]
}
\item<5-> Does the result converge to $f'(x) = 1$?
\uncover<6->{%
No, in fact the result diverges for all $x \in (-\pi,\pi)$.
}
\end{enumerate}

\end{frame}
%%

\begin{frame}\frametitle{Differentiation of Fourier Series}

\begin{theorem}
Assume that $f(x)$ is continuous on $(-L,L)$
with $f(-L+) = f(L-)$, and $f'(x)$ is piecewise continuous on
$(-L,L)$.
Then the Fourier series of $f(x)$ can be differentiated term-by-term.
\end{theorem}

\end{frame}
%%

\begin{frame}\frametitle{Example}

\begin{itemize}
\item The Fourier (cosine) series for the $2 \pi$-periodic extension
  of $F(x) = x^{2}$ is
\[
F(x) = \frac{\pi^{2}}{3} + 4 \sum_{n=1}^{\infty}
\frac{(-1)^{n}}{n^{2}} \cos (n x)	.
\]
\item The Fourier (sine) series for the $2 \pi$-periodic extension of
  $f(x) = 2 x$ is
\[
f(x) = 4 \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} \sin (n x)	.
\]
\item \textbf{Note}: the term-by-term derivative of the Fourier series
  for $F(x)$ results in the Fourier series for $f(x) = F'(x)$.
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Proof (1 of 2)}

\begin{itemize}
\item Suppose $f(x)$ is continuous on $(-L,L)$ and $f(-L+) = f(L-)$.
\item Define $f(L) = f(L-) = f(-L+)$ which will make the $2L$-periodic
  extension of $f(x)$ continuous on $(-\infty,\infty)$.
\item The Fourier series for $f(x)$ is
\[
f(x) = \frac{a_{0}}{2} + \sum_{n=1}^{\infty} \left( a_{n} \cos \frac{n
  \pi x}{L} + b_{n} \sin \frac{n \pi x}{L} \right)	.
\]
\item If $f'(x)$ is piecewise continuous then $f'(x)$ has a Fourier
  series representation and
\[
f'(x) = \frac{\alpha_{0}}{2} + \sum_{n=1}^{\infty} \left( \alpha_{n} \cos \frac{n
  \pi x}{L} + \beta_{n} \sin \frac{n \pi x}{L} \right)	.
\]
except at the removable or jump discontinuities of $f'(x)$.
\item<2-> We need to show $\alpha_{0} = 0$ and
\[
\alpha_{n} = \frac{n \pi}{L} b_{n}
\quad\mbox{and}\quad
\beta_{n} = -\frac{n \pi}{L} a_{n}	.
\]
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Proof (2 of 2)}

\begin{align*}
\alpha_{0} &=
\frac{1}{L} \int_{-L}^{L} f'(x) \, dx = \frac{1}{L} \left[ f(x)
                 \right]_{-L}^{L} = 0	\\
\alpha_{n} &=
\frac{1}{L} \int_{-L}^{L} f'(x) \cos \frac{n \pi x}{L} \, dx	\\
	&=
\frac{1}{L} \left[ f(x) \cos \frac{n \pi x}{L} \right]_{-L}^{L} +
\frac{n \pi}{L} \, \frac{1}{L} \int_{-L}^{L} f(x) \sin \frac{n \pi
              x}{L} \, dx	\\
	&=
\frac{n \pi}{L} b_{n}
\end{align*}
Using integration by parts.
Similarly it is shown that $\displaystyle \beta_{n} = -\frac{n \pi}{L} a_{n}$.

\end{frame}
%%

\begin{frame}\frametitle{Consequence of Differentiation Theorem}

The assumptions of the theorem include the continuity of the
$2L$-periodic extension of $f(x)$ and
the piecewise continuity of the $2L$-periodic extension of $f'(x)$.
Thus the Dirichlet Convergence Theorem states
\[
f(x) = \frac{a_{0}}{2} +
\sum_{n=1}^{\infty} \left(
a_{n} \cos \frac{n \pi x}{L} + b_{n} \sin \frac{n \pi x}{L}
\right)
\]
for all $x \in (-\infty,\infty)$.
The Fourier series for $f'(x)$ is
\[
f'(x)
	\sim
\frac{\pi}{L} \sum_{n=1}^{\infty} \left(
n \, b_{n} \cos \frac{n \pi x}{L} - n \, a_{n} \sin \frac{n \pi x}{L}
\right)	,
\]
and for any $(-\infty,\infty)$
\[
\frac{f'(x+) + f'(x-)}{2}
	=
\frac{\pi}{L} \sum_{n=1}^{\infty} \left(
n \, b_{n} \cos \frac{n \pi x}{L} - n \, a_{n} \sin \frac{n \pi x}{L}
\right)
\]

\end{frame}
%%

\begin{frame}\frametitle{Integration of Fourier Series}

\begin{theorem}
Let $f(x)$ be piecewise
continuous on $[-L,L]$.
The Fourier series of $f(x)$ can be integrated term by term
and the resulting series always
converges to the integral of $f(x)$ on $[-L,L]$.
That is, if
\[
f(x)
	\sim
\frac{a_{0}}{2} +
\sum_{n=1}^{\infty} \left(
a_{n} \cos \frac{n \pi x}{L} + b_{n} \sin \frac{n \pi x}{L}
\right)
\]
then
\[
\int_{0}^{x} f(s) \, ds
	=
\frac{a_{0}}{2} x +
\frac{L}{\pi} \sum_{n=1}^{\infty} \left[
\frac{a_{n}}{n} \sin \frac{n \pi x}{L} +
\frac{b_{n}}{n} \left( 1 - \cos \frac{n \pi x}{L} \right)
\right]	.
\]
\end{theorem}

\end{frame}
%%

\begin{frame}\frametitle{Proof (1 of 4)}

\begin{itemize}
\item Define $F(x) = \int_{0}^{x} f(s) \, ds$ and define $G(x) = F(x)
  - a_{0} x/2$.
\item Since $f'(x)$ is piecewise continuous on $[-L,L]$ then $F(x)$
  and $G(x)$ are continuous on $(-L,L)$.
\item By definition
\begin{align*}
a_{0} &= \frac{1}{L} \int_{-L}^{L} f(s) \, ds	\\
\frac{a_{0} L}{2} + \frac{a_{0} L}{2}
	&=
-\int_{0}^{-L} f(s) \, ds + \int_{0}^{L} f(s) \, ds	\\
\int_{0}^{-L} f(s) \, ds + \frac{a_{0} L}{2} = G(-L)
	&=
G(L) = \int_{0}^{L} f(s) \, ds - \frac{a_{0} L}{2}	.
\end{align*}
\item Therefore $G(x)$ has a Fourier series
\[
G(x)
	=
\frac{A_{0}}{2} +
\sum_{n=1}^{\infty} \left(
A_{n} \cos \frac{n \pi x}{L} + B_{n} \sin \frac{n \pi x}{L}
\right)	.
\]
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Proof (2 of 4)}

The Fourier coefficients for $G(x)$ are by definition,
\begin{align*}
A_{n}
	&=
\frac{1}{L} \int_{-L}^{L} G(x) \cos \frac{n \pi x}{L} \, dx	\\
	&=
\frac{1}{n \pi} \left( \left[ \left( G(x)
\sin \frac{n \pi x}{L} \right) \right]_{-L}^{L} -
\int_{-L}^{L} (f(x) - \frac{a_{0}}{2} ) \sin \frac{n \pi x}{L} \, dx \right)	\\
	&=
-\frac{1}{n \pi} \int_{-L}^{L} f(x) \sin \frac{n \pi x}{L} \, dx +
\frac{a_{0}}{2n \pi}  \int_{-L}^{L} \sin \frac{n \pi x}{L} \, dx	\\
	&= -\frac{L}{n \pi} b_{n}
\end{align*}
using integration by parts.
Similarly it can be shown that $\displaystyle B_{n} = \frac{L}{n \pi} a_{n}$.

\end{frame}
%%

\begin{frame}\frametitle{Proof (3 of 4)}

Thus far we have shown
\begin{align*}
G(x) &= \frac{A_{0}}{2} +
\sum_{n=1}^{\infty} \left(
-\frac{L}{n \pi} b_{n} \cos \frac{n \pi x}{L} +
\frac{L}{n \pi} a_{n} \sin \frac{n \pi x}{L}
\right)	\\
\uncover<2->{%
G(0) &= \frac{A_{0}}{2} +
\sum_{n=1}^{\infty} \left(
-\frac{L}{n \pi} b_{n} \cos \frac{n \pi (0)}{L} +
\frac{L}{n \pi} a_{n} \sin \frac{n \pi (0)}{L}
\right)	\\
0	&= \frac{A_{0}}{2} - \sum_{n=1}^{\infty} \frac{L}{n \pi} b_{n}	\\
\frac{A_{0}}{2} &= \sum_{n=1}^{\infty} \frac{L}{n \pi} b_{n}	.
}
\end{align*}

\end{frame}
%%

\begin{frame}\frametitle{Proof (4 of 4)}

Consequently
\begin{align*}
G(x)
	&=
\sum_{n=1}^{\infty} \frac{L}{n \pi} b_{n} +
\sum_{n=1}^{\infty} \left(
-\frac{L}{n \pi} b_{n} \cos \frac{n \pi x}{L} +
\frac{L}{n \pi} a_{n} \sin \frac{n \pi x}{L}
\right)	\\
	&=
\sum_{n=1}^{\infty} \frac{L}{n \pi} \left(
b_{n} \left( 1 - \cos \frac{n \pi x}{L} \right) +
\frac{L}{n \pi} a_{n} \sin \frac{n \pi x}{L}
\right)	\\
F(x)
	&=
\frac{a_{0}}{2} x +
\frac{L}{\pi} \sum_{n=1}^{\infty} \left(
\frac{b_{n}}{n} \left( 1 - \cos \frac{n \pi x}{L} \right) +
\frac{a_{n}}{n} \sin \frac{n \pi x}{L}
\right)	.
\end{align*}

\end{frame}
%%

\begin{frame}\frametitle{Partial Sum of Fourier Series}

Let the $N$th partial sum of the Fourier series for $f(x)$ be
\[
S_{N}(x) =
\frac{a_{0}}{2} +
\sum_{n=1}^{N} \left( a_{n} \cos \frac{n \pi x}{L} +
b_{n} \sin \frac{n \pi x}{L} \right)
\]
\begin{itemize}
\item We wish to describe the error present in this approximation.
\item Multiply $S_{N}$ by $f(x)$ and integrate over $[-L,L]$.
\item Multiply $S_{N}$ by $S_{N}(x)$ and integrate over $[-L,L]$.
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Multiplication by $f(x)$}

\begin{align*}
\lefteqn{\int_{-L}^{L} f(x) S_{N}(x) \, dx}	\\
	= {} & \frac{1}{2} a_{0} \int_{-L}^{L} f(x) \, dx	\\
	& + \sum_{n=1}^{N} \left(
  a_{n} \int_{-L}^{L} f(x) \cos \frac{n \pi x}{L} \, dx +
b_{n} \int_{-L}^{L} f(x) \sin \frac{n \pi x}{L} \, dx \right)
	\\
	= {} & \frac{L}{2} a_{0}^{2} +
L \sum_{n=1}^{N} \left( a_{n}^{2} + b_{n}^{2} \right)	.
\end{align*}

\end{frame}
%%

\begin{frame}\frametitle{Multiplication by $S_{N}(x)$}
\fontsize{9pt}{10.8}\selectfont

\begin{align*}
\int_{-L}^{L} S_{N}(x) S_{N}(x) \, dx
	= {} & \frac{1}{2} a_{0} \int_{-L}^{L} S_{N}(x) \, dx	\\
	& + \sum_{n=1}^{N} \left(
  a_{n} \int_{-L}^{L} S_{N}(x) \cos \frac{n \pi x}{L} \, dx +
b_{n} \int_{-L}^{L} S_{N}(x) \sin \frac{n \pi x}{L} \, dx \right)
	\\
	= {} & \frac{L}{2} a_{0}^{2} +
L \sum_{n=1}^{N} \left( a_{n}^{2} + b_{n}^{2} \right)	.
\end{align*}
This is the same result as before.

\end{frame}
%%

\begin{frame}\frametitle{Squared Error}

One measure of the error in approximating $f(x)$ by $S_{N}(x)$ is
\begin{align*}
0 \le {} & \int_{-L}^{L} \left( f(x) - S_{N}(x) \right)^{2} \, dx	\\
\uncover<2->{%
	= {} & \int_{-L}^{L} \left( f(x) \right)^{2} \, dx -
2 \int_{-L}^{L} f(x) S_{N}(x) \, dx	\\
	& + \int_{-L}^{L} \left( S_{N}(x) \right)^{2} \, dx	\\
	= {} & \int_{-L}^{L} \left( f(x) \right)^{2} \, dx -
\left( \frac{L}{2}a_{0}^{2} + L \sum_{n=1}^{N} \left(
    a_{n}^{2}+b_{n}^{2} \right) \right)	\\
\uncover<3->{%
\frac{1}{2} a_{0}^{2} +
\sum_{n=1}^{N} \left( a_{n}^{2}+b_{n}^{2} \right)
	\le {} & \frac{1}{L} \int_{-L}^{L} \left( f(x) \right)^{2} \, dx	.
}
}
\end{align*}
\uncover<3->{%
This is known as \textbf{Bessel's inequality}.
}

\end{frame}
%%

\begin{frame}\frametitle{Remarks}
\fontsize{10pt}{12}\selectfont

\begin{align*}
\sum_{n=1}^{N} \left( a_{n}^{2}+b_{n}^{2} \right)
	&\le \frac{1}{L} \int_{-L}^{L} \left( f(x) \right)^{2} \, dx	\\
\lim_{N \to \infty} \sum_{n=1}^{N} \left( a_{n}^{2}+b_{n}^{2} \right)
	&\le \frac{1}{L} \int_{-L}^{L} \left( f(x) \right)^{2} \, dx	\\
\sum_{n=1}^{\infty} \left( a_{n}^{2}+b_{n}^{2} \right)
	&\le \frac{1}{L} \int_{-L}^{L} \left( f(x) \right)^{2} \, dx
\end{align*}
\begin{itemize}
\item A function for which $\displaystyle \int_{-L}^{L} (f(x))^{2} \,
  dx$ is finite is said to be \textbf{square integrable on $[-L,L]$}.
\item<2-> If $f(x)$ is square integrable on $[-L,L]$ then the infinite
  series $\displaystyle \sum_{n=1}^{\infty} \left( a_{n}^{2}+b_{n}^{2}
  \right)$ converges.
\item<3-> The convergence of the infinite series implies
  $\displaystyle \lim_{n \to \infty} a_{n} = 0 = \lim_{n \to \infty} b_{n}$.
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Mean Square Error}

For $N \in \mathbb{N}$ define the \textbf{mean square error} of the
partial sum $S_{N}(x)$ relative to $f(x)$ to be
\[
E_{N}
	=
\frac{1}{2L} \int_{-L}^{L} \left( f(x) - S_{N}(x) \right)^{2} \, dx	.
\]

\vspace*{0.10in}

\begin{theorem}
Assume that $f(x)$ is a square integrable function on $[-L,L]$, then
\[
\lim_{N \to \infty} E_{N} = 0	.
\]
\end{theorem}

\end{frame}
%%

\begin{frame}\frametitle{Corollary}

\begin{corollary}
If $f(x)$ is a square integrable function on $[-L,L]$, then
\[
\frac{1}{2L} \int_{-L}^{L} \left( f(x) \right)^{2} \, dx
	=
\frac{1}{4} a_{0}^{2} +
\frac{1}{2} \sum_{n=1}^{\infty} \left( a_{n}^{2}+b_{n}^{2} \right)
\]
where $a_{n}$ and $b_{n}$ are the Fourier coefficients of $f(x)$.
\end{corollary}

\vspace*{0.10in}

\textbf{Remark}:
this equation is known as \textbf{Parseval's identity} and functions
like the Pythagorean theorem for Fourier series.

\end{frame}
%%

\begin{frame}\frametitle{Application of Parseval's Identity}

Find the $\displaystyle \sum_{n=1}^{\infty} \frac{1}{n^{6}}$ using
\begin{itemize}
\item the Fourier (sine) coefficients for $f(x) = x^{3}$ on $(-\pi,\pi)$,
\item Parseval's identity,
\item and the facts that $\displaystyle \sum_{n=1}^{\infty}
  \frac{1}{n^{2}} = \frac{\pi^{2}}{6}$ and
$\displaystyle \sum_{n=1}^{\infty}
  \frac{1}{n^{4}} = \frac{\pi^{4}}{90}$	.
\end{itemize}

\end{frame}
%%

\begin{frame}<handout:0>\frametitle{Solution}

Fourier coefficients:
\[
b_{n} =
\frac{1}{\pi} \int_{-\pi}^{\pi} x^{3} \sin (n x) \, dx =
\frac{2}{\pi} \int_{0}^{\pi} x^{3} \sin (n x) \, dx =
\frac{2(-1)^{n} (6 - n^{2} \pi^{2})}{n^{3}}
\]
Parseval's identity:
\begin{align*}
\frac{1}{2 \pi} \int_{-\pi}^{\pi} (x^{3})^{2} \, dx
	&=
\frac{1}{2} \sum_{n=1}^{\infty} \left[ \frac{2(-1)^{n} (6 - n^{2}
              \pi^{2})}{n^{3}} \right]^{2}	\\
\frac{\pi^{6}}{7}
	&=
\sum_{n=1}^{\infty} \frac{72}{n^{6}} - \sum_{n=1}^{\infty} \frac{24
              \pi^{2}}{n^{4}} + \sum_{n=1}^{\infty} \frac{2
              \pi^{4}}{n^{2}}	\\
\frac{\pi^{6}}{7} + \frac{4 \pi^{6}}{15} - \frac{\pi^{6}}{3}
	&=
72 \sum_{n=1}^{\infty} \frac{1}{n^{6}}	\\
\frac{\pi^{6}}{945} &= \sum_{n=1}^{\infty} \frac{1}{n^{6}}
\end{align*}

\end{frame}
%%

\begin{frame}\frametitle{Proof of Parseval's Identity}
\fontsize{9pt}{10.8}\selectfont

By definition
\begin{align*}
E_{N} &= \frac{1}{2L} \int_{-L}^{L} (f(x) - S_{N}(x))^{2} \, dx
  \\
	&= \frac{1}{2L} \int_{-L}^{L} \left( f(x) \right)^{2} \, dx -
\frac{1}{L} \int_{-L}^{L} f(x) S_{N}(x) \, dx +
\frac{1}{2L} \int_{-L}^{L} \left( S_{N}(x) \right)^{2} \, dx	\\
	&= \frac{1}{2L} \int_{-L}^{L} \left( f(x) \right)^{2} \, dx
              -
\left[ \frac{1}{2} a_{0}^{2} + \sum_{n=1}^N(a_{n}^{2} +b_{n}^{2}) \right] +
\left[ \frac{1}{4} a_{0}^{2} +\frac{1}{2} \sum_{n=1}^N  (a_{n}^{2}  +
              b_{n}^{2}) \right]	\\
	&=
\frac{1}{2L} \int_{-L}^{L} \left( f(x) \right)^{2} \, dx -
\frac{1}{4} a_{0}^{2} -
\frac{1}{2} \sum_{n=1}^{N}( a_{n}^{2} + b_{n}^{2})	.
\end{align*}
Since $\displaystyle \lim_{N \to \infty} E_{N} = 0$ then
\[
\frac{1}{2L} \int_{-L}^{L} \left( f(x) \right)^{2} \, dx =
\frac{1}{4} a_{0}^{2} +
\frac{1}{2} \sum_{n=1}^{N}( a_{n}^{2} + b_{n}^{2})	.
\]

\end{frame}
%%

\begin{frame}\frametitle{Homework}

\begin{itemize}
\item Read Sections $3.8$ and $3.9$
\item Exercises: 20--25
\end{itemize}

\end{frame}
%%

%%%
\end{document}

%%%%
%%%% EOF
%%%%
