\documentclass{beamer}
\usepackage{graphicx}
\definecolor{Burgandy}{RGB}{134,0,56}
\date{26 March 2018}
\setbeamertemplate{navigation symbols}{}
\mode<presentation>
{
\usetheme{Madrid}
\setbeamercolor*{palette primary}{use=structure,fg=white,bg=Burgandy}
\setbeamercolor*{palette secondary}{use=structure,fg=white,bg=Burgandy}
\setbeamercolor*{palette tertiary}{use=structure,fg=white,bg=Burgandy}
}
\begin{document}

\begin{frame}{Pointwise and uniform convergence}
\textbf{Definition} (``pointwise convergence"): Let $f_n \colon [a,b] \rightarrow \mathbb{R}$ be a sequence of functions. We say that $f_n$ converges pointwise to $f$ provided that $\forall x \in[a,b] \forall \epsilon>0 \exists N \in \mathbb{N}$ so that for all $n \geq N, |f_n(x)-f(x)|<\epsilon$. For this, we write $f_n \rightarrow f$. 

\textbf{Definition} (``uniform convergence"): Let $f_n \colon [a,b] \rightarrow \mathbb{R}$ be a sequence of functions. We say that $f_n$ converges uniformly to $f$ provided that $\forall \epsilon > 0 \exists N \in \mathbb{N}$ so that for all $n \geq N$ and $x \in [a,b]$, $|f_n(x)-f(x)| < \epsilon$. For this, we write $f_n \rightrightarrows f$.
\end{frame}

\begin{frame}{Karl Weierstrass}
\begin{minipage}{0.45\textwidth}
\includegraphics[scale=0.2]{weierstrass.jpg}
\end{minipage}
\begin{minipage}{0.45\textwidth}
Weierstrass is sometimes called the ``father of analysis". He formalized the definition of continuity, proved the intermediate value theorem, the Bolzano-Weierstrass theorem (essentially -- that closed bounded subsets of $\mathbb{R}^n$ are compact), and the Weierstrass approximation theorem.

His doctoral students included, among many others, Georg Cantor, Georg Frobenius, and Hans von Mangoldt.
\end{minipage}
\end{frame}

\begin{frame}{The space $C^0([a,b],\mathbb{R})$}
We define the notation $C^0([a,b],\mathbb{R})$ to be the set of functions $f \colon [a,b] \rightarrow \mathbb{R}$ which are continuous. \\
\vspace{0.3in}
We say that a set $X$ is dense in $C^0([a,b],\mathbb{R})$ provided that for each $f \in C^0([a,b],\mathbb{R})$ and $\epsilon > 0$, there exists $p \in X$ so that for all $x \in [a,b]$,
$$|f(x)-p(x)| < \epsilon.$$
\end{frame}

\begin{frame}{Weierstrass approximation theorem}
\textbf{Theorem}: The set of polynomials is dense in the space of continuous functions. \\
\textit{Proof}: Without loss of generality, assume $[a,b]=[0,1]$. We may also assume that $f(0)=f(1)=0$ because otherwise, the function
$$g(x)=f(x)-f(0)-x[f(1)-f(0)]$$
obeys $g(0)=g(1)=0$ and if there is a sequence $f_n^* \rightrightarrows g$, then there is a sequence $f_n \rightrightarrows f$. 
We also define $f$ to be identically zero outside of $[0,1]$. 
\onslide<2->{Define
$$Q_n(x) = c_n (1-x^2)^n,$$ 
where $c_n$ is chosen so that 
$$c_n = \displaystyle\int_{-1}^1 Q_n(x) \mathrm{d}x=1.$$}
\end{frame}

\begin{frame}{Weierstrass approximation theorem}
We have
$$c_n = \dfrac{1}{\displaystyle\int_{-1}^1 (1-x^2)^n \mathrm{d}x}.$$
\onslide<2->{Calculate
$$\begin{array}{ll}
\displaystyle\int_{-1}^1 (1-x^2)^n \mathrm{d}x &= 2 \displaystyle\int_0^1 (1-x^2)^n \mathrm{d}x \\
& \geq 2 \displaystyle\int_0^{\frac{1}{\sqrt{n}}} (1-x^2)^n \mathrm{d}x \\
\onslide<3->{&\stackrel{\text{HW}}{\geq} 2 \displaystyle\int_0^{\frac{1}{\sqrt{n}}} (1-nx^2) \mathrm{d}x \\
\onslide<4->{&= \dfrac{4}{3\sqrt{n}} > \dfrac{1}{\sqrt{n}}.
\end{array}$$
Therefore
$$c_n < \sqrt{n}.$$}}}
\end{frame}

\begin{frame}{Weierstrass approximation theorem}
For any $\delta > 0$, the fact that $c_n < \sqrt{n}$ implies for $\delta \leq |x| \leq 1$, 
$$Q_n(x) = c_n (1-x^2)^n \leq \sqrt{n} (1-\delta^2)^n\onslide<2->{,$$
from which we conclude (HW) that $Q_n(x) \rightrightarrows 0$ on $[\delta,1]$. \onslide<3->{Define for $x \in [0,1]$,
$$P_n(x) = \displaystyle\int_{-1}^1 f(x+t) Q_n(t) \mathrm{d}t.$$
Since $f$ is identically zero outside of $[0,1]$, it is identically zero whenever $x+t > 1$, i.e. when $t > 1-x$ and it is identically zero when $x+t < 0$, i.e. $t < -x$. \onslide<4->{Therefore
$$P_n(x) = \displaystyle\int_{-x}^{1-x} f(x+t)Q_n(t) \mathrm{d}t.$$}}}
\end{frame}

\begin{frame}{Weierstrass approximation theorem}
$$P_n(x) = \displaystyle\int_{-x}^{1-x} f(x+t)Q_n(t) \mathrm{d}t.$$
Letting $u=x+t$ so that $\mathrm{d}u=\mathrm{d}t$. Performing the change of variables gives us \onslide<2->{ $t=u-x$, and if $t=-x$ then $u=0$ and if $t=1-x$ then $u=x+(1-x)=1$, hence we get
$$P_n(x) = \displaystyle\int_0^1 f(t) Q_n(t-x) \mathrm{d}t.$$
Note that this final integral is a polynomial in $x$. Therefore $(P_n)$ is a sequence of polynomials.}
\end{frame}

\begin{frame}{Weierstrass approximation theorem}
Let $\epsilon > 0$ and since $f$ is continuous, we may choose $\delta > 0$ so that if $|y-x| < \delta$, then $|f(y)-f(x)| < \dfrac{\epsilon}{2}$. Let $M= \sup |f(x)|$, which exists because $f$ is continuous on a compact interval. Compute
$$\begin{array}{ll}
|P_n(x) - f(x)| &= \onslide<2->{\left| \displaystyle\int_{-1}^1 f(x+t)Q_n(t) \mathrm{d}t - f(x) \right| \\
&\stackrel{\int Q_n=1}{=} \left| \displaystyle\int_{-1}^1 [f(x+t)-f(x)]Q_n(t) \mathrm{d}t \right| \\
\onslide<3->{&\leq \displaystyle\int_{-1}^1 |f(x+t)-f(x)|Q_n(t) \mathrm{d}t}} \\
\end{array}$$
\end{frame}

\begin{frame}{Weierstrass approximation theorem}
Recall we chose $\delta$ so if $|y-x| < \delta$, then $|f(y)-f(x)| < \dfrac{\epsilon}{2}$ and we defined the quantity $M=\sup |f(x)|$. We also had $Q_n(x) \leq \sqrt{n}(1-\delta^2)^n$ for $\delta \leq |x| \leq 1$.
$$\begin{array}{ll}
|P_n(x) - f(x)| &\leq \displaystyle\int_{-1}^1 [|f(x+t)-f(x)|]Q_n(t) \mathrm{d}t \\
&\onslide<2->{= \left[ \displaystyle\int_{-1}^{-\delta} + \displaystyle\int_{-\delta}^{\delta} + \displaystyle\int_{\delta}^1 \right][|f(x+t)-f(x)|]Q_n(t) \mathrm{d}t \\
&\onslide<3->{\leq 2M \displaystyle\int_{-1}^{-\delta} Q_n(t) \mathrm{d}t + \dfrac{\epsilon}{2} \displaystyle\int_{-\delta}^{\delta} Q_n(t)\mathrm{d}t + 2M \displaystyle\int_{\delta}^1 Q_n(t) \mathrm{d}t \\
&\onslide<4->{\leq 2M \sqrt{n}(1-\delta^2)^n \left[ \displaystyle\int_{-1}^0 + \displaystyle\int_0^1 \right] 1 \mathrm{d}t + \dfrac{\epsilon}{2} \displaystyle\int_{-1}^1 Q_n(t) \mathrm{d}t \\
&= 4M \sqrt{n}(1-\delta^2)^n  + \dfrac{\epsilon}{2} \\
&\rightarrow \dfrac{\epsilon}{2} \\
&< \epsilon. \blacksquare}}}
\end{array}$$
\end{frame}

\begin{frame}{Bernstein polynomials}
If $f \colon [0,1] \rightarrow \mathbb{R}$, then the Bernstein polynomials $B_n(f;x)$ defined by
$$B_n(f;x)=\displaystyle\sum_{k=0}^n f\left( \dfrac{k}{n} \right) {n \choose k} x^k (1-x)^{n-k}$$
converge to $f$ uniformly on $[0,1]$. \\
\textbf{Quiz}: Calculate and plot the first 5 Bernstein polynomials for $f(x)=\sin(2\pi x)e^{-x^2}$. 
\end{frame}
\end{document}