\documentclass[12pt]{article}
\usepackage{amsfonts}


%new commands

% reference for equation labels
\newcommand{\eq}[1]{(\ref{#1})}

% abbreviations for equation environments
\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}
\newcommand{\bea}{\begin{eqnarray}}
\newcommand{\eea}{\end{eqnarray}}
\newcommand{\beann}{\begin{eqnarray*}}
\newcommand{\eeann}{\end{eqnarray*}}


% abbreviation for reals

\def\Cx{\mathbb{C}}
\def\Nl{\mathbb{N}}
\def\Ra{\mathbb{Q}}
\def\Rl{\mathbb{R}}
\def\Ts{\mathbb{T}}
\def\Ir{\mathbb{Z}}
\def\DD{\mathcal{D}}

% abbreviations for \varepsilon and \varphi
\newcommand{\eps}{\varepsilon}
\newcommand{\vphi}{\varphi}


\pagestyle{empty}

\begin{document}

\centerline{\textbf{Sample Midterm Solutions}}
\centerline{\textbf{Math 127B}. \textbf{Winter, 2005}}

\bigskip\bigskip
\noindent
\textbf{1.} Consider the sequence $(f_n)$ of functions $f_n : \Rl\to \Rl$
defined by
\[
f_n(x) = \frac{nx}{\sqrt{1 + n^2 x^2}}.
\]
Find the pointwise limit of this sequence as $n\to \infty$. Does the sequence
converge uniformly on $\Rl$? Justify your answer.


\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item For $x>0$, 
\[
f_n(x) =  \frac{1}{\sqrt{1/(n^2x^2) + 1}} \to 1\quad\mbox{as $n\to\infty$}.
\]
For $x<0$, 
\[
f_n(x) =  \frac{-1}{\sqrt{1/(n^2x^2) + 1}} \to -1\quad\mbox{as $n\to\infty$}.
\]
For $x=0$, 
\[
f_n(0) =  0 \to 0\quad\mbox{as $n\to\infty$}.
\]
Hence $f_n \to f$ pointwise as $n\to \infty$, where
\[
f(x) = \cases{1 & for $x>0$,\cr
0 & for $x=0$,\cr
-1 & for $x<0$.}
\]
\item The sequence cannot converge uniformly because the $f_n$ are continuous, $f$
is discontinuous, and the uniform limit of continuous functions is continuous.
\end{itemize}



\newpage
\noindent
\textbf{2.}  Let
\[
f_n(x) = \frac{nx + \sin(nx^2)}{n}.
\]
Prove that the following limit exists, and compute its value:
\[
\lim_{n\to\infty} \int_0^1 f_n(x) \, dx.
\]

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item The sequence $(f_n)$ of continuous functions
converges uniformly to the the function $x$
on $[0,1]$. To prove this, suppose $\epsilon > 0$, and
choose $N = 1/\epsilon$. Then if $n>N$, we have that
\[
\left|f_n(x) - x\right| = \left|\frac{\sin(nx^2)}{n}\right|
\le \frac{1}{n} < \epsilon
\quad\mbox{for all $x\in [0,1]$}.
\]
If $(f_n)$ is a sequence of continuous functions and $f_n\to f$ uniformly
on $[a,b]$, then
\[
\int_a^b f_n(x)\,dx \to \int_a^b f(x)\, dx.
\]
Therefore for the sequence given in the problem
\[
\int_0^1 f_n(x)\,dx \to \int_0^1 x\, dx = \frac{1}{2}.
\]
\end{itemize}



\newpage
\noindent
\textbf{3.} Prove that the following series
\[
f(x) = \sum_{n=1}^\infty \frac{n^2 + x^4}{n^4 + x^2}
\]
converges to a continuous function $f: \Rl\to \Rl$.  

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item Suppose $R >0$. Then for all $x\in [-R,R]$ we have
\beann
\left|\frac{n^2 + x^4}{n^4 + x^2}\right| &\le&  \frac{n^2 + x^4}{n^4 }\\
&\le& \frac{1}{n^2} + \frac{R^4}{n^4 }.
\eeann
The series
\[
\sum_{n=1}^\infty \left\{\frac{1}{n^2} + \frac{R^4}{n^4 }\right\}
=\sum_{n=1}^\infty \frac{1}{n^2} + R^4\sum_{n=1}^\infty \frac{1}{n^4 }
\]
converges, so the Weierstrass M-test implies that the series for $f$ converges
uniformly on the bounded interval $[-R,R]$. The terms in the
series are continuous and the uniform limit of continuous functions is
continuous, so $f$ is continuous on $[-R,R]$ for every $R >0$.
Since every $x\in\Rl$ lies in such an interval for sufficiently large $R$,
it follows that $f$ is continuous on $\Rl$.

\item Note that the series does not
converge uniformly on $\Rl$, so we can't use the argument that the sum
is continuous on $\Rl$ because the series converges uniformly on $\Rl$.
\end{itemize}



\newpage
\noindent

\noindent
\textbf{4.} Determine the radius of convergence $R$ of the power series
\beann
f(x) &=& \sum_{n=0}^\infty \frac{(-1)^n}{2n+1} x^{2n+1}\\
&=& x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \dots.
\eeann
Where does the series converge? Prove that
\[
f^\prime(x) = \frac{1}{1+x^2}\qquad\mbox{in $|x| < R$}.
\] 

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item By the root test, and the standard limit
$n^{1/n} \to 1$ as $n\to\infty$, the radius of convergence is
\[
R = \limsup_{n\to\infty} \left(\frac{1}{2n+1}\right)^{1/(2n+1)} = 1.
\]
(Alternatively, the ratio test gives the same result.)
Hence the series converges in $|x| < 1$ and diverges in $|x| > 1$. At $x=1$,
the series is
\[
1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \dots,
\]
which converges by the alternating series test.
If $x=-1$, the series is 
\[
-\left(1 + \frac{1}{3} + \frac{1}{5} + \frac{1}{7} + \dots\right),
\]
which diverges by comparison with the divergent harmonic series, since
\beann
1 + \frac{1}{3} + \frac{1}{5} + \frac{1}{7} + \dots &>&
\frac{1}{2} + \frac{1}{4} + \frac{1}{6} + \frac{1}{8} +\dots\\
&>& \frac{1}{2}\left(1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} +\dots\right)
\eeann
Thus, the series converges for $-1 < x \le 1$.

\item A power series is differentiable inside its interval of convergence and
can be differentiated term-by-term. Hence, in $|x|<1$ we have
\beann
f^\prime(x) &=& \sum_{n=0}^\infty {(-1)^n} x^{2n}\\
&=& \sum_{n=0}^\infty (-x^2)^{n}\\
&=& \frac{1}{1+x^2},
\eeann
where we have used the standard sum of a geometric series,
\[
\sum_{n=0}^\infty a^{n} = \frac{1}{1-a}\qquad|a|<1,
\]
with $a = -x^2$.
\end{itemize}



\newpage
\noindent
\textbf{5.} Suppose that $(f_n)$ is a sequence of functions $f_n : [-1,1] \to \Rl$
that converges uniformly on $[-1,1]$ to a function $f: \Rl \to \Rl$. If the limit
\[
\lim_{x\to 0} f_n(x) = a_n
\]
exists for each $n\in \Nl$, and the limit
\[
\lim_{n\to\infty} a_n = a
\]
exists, prove that $\lim_{x\to 0} f(x)$ exists, and
\[
\lim_{x\to 0} f(x) = a
\]
Give a counter-example to show that this result need not be true if $(f_n)$
converges to $f$ pointwise, but not uniformly.

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item Let $\epsilon > 0$ be given. From the uniform convergence, we can
choose $N_1$ such that $n > N_1$ implies that
\[
\left|f_n(x) - f(x)\right| < \frac{\epsilon}{3}\quad\mbox{for all $x\in
[-1,1]$}.
\]
From the existence of the limit of $(a_n)$, we can choose $N_2$ such that
$n > N_2$ implies that
\[
\left|a_n-a\right| < \frac{\epsilon}{3}.
\]
Choose some $N > \max\{N_1,N_2\}$. The existence of the limit of $f_N(x)$ as
$x\to0$ implies that there exists $\delta > 0$ such that
\[
\left|f_N(x) - a_N\right| < \frac{\epsilon}{3}\quad\mbox{when $0<|x| < \delta$}.
\]
It follows that if $0<|x|<\delta$, then
\beann
\left|f(x) - a\right| &\le& \left|f(x) - f_N(x)\right|
+ \left|f_N(x) - a_N\right| + \left|a_N-a\right| \\
&<&\frac{\epsilon}{3}+\frac{\epsilon}{3}+\frac{\epsilon}{3}\\
&<& \epsilon,
\eeann
which proves that $f(x) \to a$ as $x\to 0$.

\item Consider the sequence of functions on $[-1,1]$ defined by
\[
f_n(x) = (1-x^2)^n.
\]
Then $f_n \to f$ pointwise as $n\to\infty$, where
\[
f(x) = \cases{0 & for $x\ne0$,\cr
1 & for $x=0$.}
\]
By the continuity of $f_n$, we have
\[
a_n = \lim_{x\to 0} f_n(x) = 1
\]
for every $n$, and $a_n \to 1$ as $n\to \infty$. On the other hand,
\[
\lim_{x\to 0} f(x) = 0 \ne 1.
\]

\item This result says that \emph{uniform} convergence allows us to exchange the order
of the limits:
\[
\lim_{x\to 0} \lim_{n\to \infty} f_n(x)
=
\lim_{n\to \infty} \lim_{x\to 0} f_n(x)
\] 
\end{itemize}
\end{document}
