\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{\textsc{Advanced Analysis}}
\centerline{\textbf{Math 121, Fall 2004}}
\centerline{\textbf{Solutions, Midterm 1}}

\bigskip\noindent
\textbf{1.} Answer the following questions. Give a brief justification of
your answer.

\smallskip\noindent
(a) What is the (smallest) period of the function $\cos \left(5 \pi x\right)$?

\smallskip
\noindent
(b) What is the value of
\[
\int_0^{10} \cos^2 \left(5 \pi x\right)\, dx?
\]

\smallskip\noindent
(c) What is the value of
\[
\int_0^{10} \cos \left(5\pi x\right)\cos \left(30 \pi x\right)\, dx?
\]

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item (a) The function $\cos(kx)$ has period $2\pi/k$, so $\cos \left(5 \pi x\right)$
has period $2/5$.

\item (b) The integration interval is an integer multiple of the period, since
$10 = 25 \cdot (2/5)$. Therefore, since the average value of $\cos^2 x$ over a period is $1/2$,
we have
\[
\int_0^{10} \cos^2 \left(5 \pi x\right)\, dx = 10\cdot \frac{1}{2} = 5.
\]

\item (c) The functions $\cos \left(5\pi x\right)$ and $\cos \left(30 \pi x\right)$ are orthogonal on
any period, so
\[
\int_0^{10} \cos \left(5\pi x\right)\cos \left(30 \pi x\right)\, dx = 0.
\]
\end{itemize}

\newpage
\noindent
\textbf{2.} Suppose that $f(x)$ is defined by
\[
f(x) = x^2 \qquad\mbox{for $0 < x < \pi$}.
\]
Sketch graphs of the following extensions of $f(x)$ for $-3\pi < x < 3\pi$:

\smallskip\noindent
(a) the periodic extension $f_\mathrm{p}(x)$ with period $\pi$;



\smallskip\noindent
(b) the even periodic extension $f_\mathrm{e}(x)$ with period $2\pi$;


\smallskip\noindent
(c) the odd periodic extension $f_\mathrm{o}(x)$ with period $2\pi$.

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item Graphs omitted.
\end{itemize}



\newpage
\noindent
\textbf{3.} Suppose that $f(x)$ is the $2\pi$-periodic function defined by
\[
f(x) = x \qquad\mbox{for $-\pi < x < \pi$}.
\]

\smallskip\noindent
(a) What are the Fourier cosine coefficients $a_n$ of $f(x)$? Explain how you know
the answer without evaluating any integrals.

\smallskip\noindent
(b) What does the Fourier series of $f(x)$ converge to
at $x=\pi/2$, and $x=\pi$? Why?

\smallskip\noindent
(c) Compute the Fourier sine coefficients $b_n$ of $f(x)$, and
write out the Fourier series expansion of $f(x)$.



\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item (a) Since $f$ is odd, the Fourier cosine coefficients are zero, so $a_n=0$ for all
$n \ge 0$.

\item (b) The function $f$ is piecewise smooth. According to Dirichlet's theorem, its Fourier series converges
to $f(x)$ at points $x$ where $f$ is continuous, and to the average of the left and right hand limits of $f$
at points where $f$ has a jump discontinuity. Since $f(x)$ is continuous at $x=\pi/2$ and $f(\pi/2) = \pi/2$, the
Fourier series converges to $\pi/2$ at $x=\pi/2$. At $x=\pi$, the function $f$ has a jump discontinuity
with left-hand limit equal to $\pi$ and right-hand limit equal to $-\pi$. Hence the Fourier series converges to
$0$.

\item (c) The Fourier sine coefficients of $f$ are given by
\beann
b_n &=& \frac{1}{\pi} \int_{-\pi}^\pi x \sin nx\, dx\\
&=& \frac{2}{\pi} \int_{0}^\pi x \sin nx\, dx\\
&=& \frac{2}{\pi} \left[-\frac{x\cos nx}{n} + \frac{\sin nx}{n^2}\right]_{0}^\pi\\
&=& \frac{2}{\pi} \left[-\frac{\pi\cos n\pi}{n}\right]\\
&=& \frac{2}{n}(-1)^{n+1}
\eeann
Thus,
\[
f(x) = 2\left(\sin x - \frac{1}{2}\sin 2x + \frac{1}{3} \sin 3x - \frac{1}{4} \sin 4x + \dots \right)
\]
\end{itemize}

\newpage
\noindent
\textbf{4.}
(a) State the orthogonality relations for the functions $\sin (n\pi x)$ on the interval
$0 < x <1$, where $n=1,2,3,\dots$.

\smallskip\noindent
(b) Use these orthogonality relations to \emph{derive} an expression for the coefficients
$b_n$ in the Fourier sine expansion
\[
f(x) = \sum_{n=1}^\infty b_n \sin n\pi x
\]
of a function defined in $0 < x < 1$.

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item (a) Since $\sin m\pi x$ and $\sin n\pi x$ are orthogonal for $n\ne m$,
and the average value of $\sin^2 x$ over a period is $1/2$, the orthogonality relations are
\[
\int_0^1 \sin m\pi x\sin n\pi x\, dx = \cases{0 & for $m\ne n$,\cr
1/2 & for $m=n$.}
\]

\item (b) Replacing the summation variable $n$ by $m$, we have
\[
f(x) = \sum_{m=1}^\infty b_m \sin m\pi x.
\]
Multiplying this equation by $\sin n\pi x$, where $n$ is a fixed but arbitrary positive
integer, integrating the result over $0 < x < 1$, and using the orthogonality relations,
we get
\beann
\int_0^1 f(x)\sin n\pi x\, dx &=& \int_0^1 \left(\sum_{m=1}^\infty b_m \sin m\pi x\right)\sin n\pi x\, dx\\
&=& \sum_{m=1}^\infty b_m \left(\int_0^1\sin m\pi x \sin n\pi x\, dx\right)\\
&=& \frac{1}{2}b_n.
\eeann
Hence,
\[
b_n = 2\int_0^1 f(x)\sin n\pi x\, dx.
\]
\end{itemize}

\newpage
\noindent
\textbf{5.} The $2\pi$-periodic function defined by
\[
f(x) = |x|\qquad\mbox{$-\pi < x < \pi$}
\]
has the Fourier series expansion
\[
f(x) = \frac{\pi}{2} - \frac{4}{\pi} \left(\cos x + \frac{1}{3^2} \cos 3x + \frac{1}{5^2}\cos 5x + \frac{1}{7^2} \cos 7x + \dots\right).
\]
Apply Parseval's theorem to this function, and use the result to deduce the
sum of the infinite series
\[
\sum_{\mbox{\tiny{$n$ odd}}} \frac{1}{n^4} = 1 + \frac{1}{3^4} + \frac{1}{5^4} + \frac{1}{7^4} + \dots.
\]


\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item According to Parseval's theorem, if
\[
f(x) = \frac{1}{2} a_0 + \sum_{n=1}^\infty a_n \cos nx,
\]
then
\[
\frac{1}{2\pi} \int_{-\pi}^{\pi} f(x)^2\, dx = \frac{1}{4} a_0^2 + \frac{1}{2} \sum_{n=1}^\infty a_n^2.
\]
We have
\beann
\frac{1}{2\pi} \int_{-\pi}^{\pi} f(x)^2\, dx &=& \frac{1}{2\pi} \int_{-\pi}^{\pi} |x|^2\, dx\\
&=& \frac{1}{\pi} \int_{0}^{\pi} x^2\, dx\\
&=& \frac{1}{\pi} \left[\frac{1}{3}x^3\right]_{0}^{\pi}\\
&=& \frac{\pi^2}{3}.
\eeann
From the Fourier series expansion of $f$, we have
\[
a_0 =\pi,\quad a_n = \cases{-{4}/{(\pi n^2)} & for $n\ge 1$ odd,\cr
0 & for $n \ge 2$ even.}
\]
It follows that
\[
\frac{\pi^2}{3} = \frac{\pi^2}{4} + \frac{8}{\pi^2} \sum_{\mbox{\tiny{$n$ odd}}} \frac{1}{n^4}.
\]
Hence,
\[
\sum_{\mbox{\tiny{$n$ odd}}} \frac{1}{n^4} = \frac{\pi^4}{96}.
\]
\end{itemize}

\newpage
\noindent
\textbf{6.} Suppose that a function $f(x)$ has the real Fourier series expansion
\[
f(x) = \frac{1}{2} + \sum_{n=1}^\infty e^{-n^2}\left\{\cos nx + n \sin nx\right\}.
\]

\smallskip\noindent
(a) Find the complex Fourier series expansion of $f$, of the form
\[
f(x) = \sum_{n=-\infty}^\infty c_n e^{inx}.
\]

\smallskip\noindent
(b) Does this Fourier series converge slowly or rapidly? How smooth do you think $f(x)$
is? That is, how many orders of derivatives of $f(x)$ do you expect to be continuous?
Explain your answer briefly. (No proofs required.)


\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item Using Euler's equation, we get
\beann
f(x) &=&\frac{1}{2} + \sum_{n=1}^\infty e^{-n^2}\left\{\cos nx + n \sin nx\right\}\\
&=&\frac{1}{2} + \sum_{n=1}^\infty e^{-n^2}\left\{\left(\frac{e^{inx} + e^{-inx}}{2}\right)
+ n \left(\frac{e^{inx} - e^{-inx}}{2i}\right)\right\}\\
&=&\frac{1}{2} + \frac{1}{2} \sum_{n=1}^\infty e^{-n^2}\left\{\left(1 - in\right) e^{inx}
+ \left(1 + in\right)e^{-inx}\right\}\\
&=&\frac{1}{2}\sum_{n=-\infty}^\infty \left(1 - in\right)e^{-n^2} e^{inx}.
\eeann
Hence, the complex Fourier coefficients of $f$ are given by
\be
c_n = \frac{1}{2}\left(1 - in\right)e^{-n^2}.
\label{fsans}
\ee

\item Alternative proof. We have
\[
c_n = \frac{1}{2}\left(a_n -i b_n\right)\qquad\mbox{for $n\ge 0$},
\]
where $a_n$ and $b_n$ are the Fourier cosine and sine coefficients of $f$, respectively.

From the Fourier series, we have
\[
a_n = e^{-n^2},\qquad b_n = n e^{-n^2}.
\]
Note that $a_0 = 1$, so the expression for $a_n$ also holds when $n=0$.
Thus,
\[
c_n = \frac{1}{2}\left(1 -i n\right)e^{-n^2}\qquad\mbox{for $n\ge 0$}.
\]
Also,
\beann
c_{-n} &=& \overline{c_n}\\
&=& \frac{1}{2}\left(1 +i n\right)e^{-n^2},
\eeann
so the same formula holds for $n< 0$, and we get \eq{fsans}.


\item The Fourier coefficients of $f$ tend to zero exponentially quickly as $n\to \infty$, so the
the Fourier series converges very rapidly. Since $n^p e^{-n^2}$ converges to zero rapidly as
$n\to \infty$ for every $p=1,2,3\dots$, the series obtained from the one for $f$ by
term-by-term differentiation converges uniformly, and we expect that $f$ has continuous derivatives of all
orders (as, in fact, it does).
\end{itemize}

\end{document}
