\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{Solutions for}}
\centerline{\textbf{Sample Midterm Questions}}
\centerline{\textbf{Math 121}, \textbf{Fall 2004}}

\bigskip\bigskip
\noindent
\textbf{1.} Answer the following questions with a brief explanation to justify
your answer.

\smallskip\noindent
(a) What is the period of the function $\sin \left(7 x\right)$?

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

\smallskip\noindent
(c) What is the value of
\[
\int_0^{700\pi} \sin \left(7x\right)\sin \left(70 x\right)\, dx?
\]

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item (a) The (smallest) period is $2\pi/7$, since
\beann
\sin \left[7 \left(x+\frac{2\pi}{7}\right)\right] &=& \sin \left(7 x+2\pi\right)\\
&=& \sin\left( 7x\right)
\eeann

\item (b) The range of integration is an integer multiple of the period, since
\[
700\pi = 7\cdot 350 \cdot \frac{2\pi}{7},
\]
and the average value of $\sin^2 x$ over a period is $1/2$, so
\beann
\int_0^{700\pi} \sin^2 \left(7x\right)\, dx &=& 700\pi \cdot\frac{1}{2}\\
&=& 350\pi.
\eeann


\item (c) Since $\sin \left(7x\right)$ and $\sin \left(70 x\right)$ are orthogonal, we have
\[
\int_0^{700\pi} \sin \left(7x\right)\sin \left(70 x\right)\, dx = 0.
\]
\end{itemize}



\newpage
\noindent
\textbf{2.} Suppose that $f(x)$ is the $2\pi$-periodic function defined by
\[
f(x) = \cases{x & for $-\pi < x \le 0$,\cr
0 & for $0 < x \le \pi$.}
\]
Compute the (real) Fourier series expansion of $f(x)$. What does the Fourier series converge to
at $x=0$, $x=\pi/2$, and $x=\pi$? Why?

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item The Fourier series expansion is
\[
f(x) = \frac{1}{2} a_0 + \sum_{n=1}^\infty
\left\{a_n \cos nx + b_n \sin nx\right\},
\]
where
\beann
a_n &=& \frac{1}{\pi} \int_{-\pi}^\pi f(x) \cos nx \, dx\qquad\mbox{n=0,1,2,\dots},\\
b_n &=& \frac{1}{\pi} \int_{-\pi}^\pi f(x) \sin nx \, dx\qquad\mbox{n=0,1,2,\dots}.
\eeann

\item Computing $a_n$, and using the equations
\[
\cos n\pi = (-1)^n,\qquad \sin n\pi = 0,
\]
we get, for $n=1,2,3,\dots$,
\beann
a_n &=& \frac{1}{\pi} \int_{-\pi}^0 x \cos nx \, dx\\
&=&\frac{1}{\pi}\left[\frac{x \sin nx}{n} + \frac{\cos nx}{n^2}\right]_{-\pi}^0\\
&=&  \frac{1}{\pi}\left[\frac{1}{n^2}-\frac{(-1)^n}{n^2}\right]\\
&=&\cases{0 & for $n$ even,\cr
{2}/(\pi{n^2}) & for $n$ odd.}
\eeann
For $n=0$, we get
\beann
a_0 &=& \frac{1}{\pi} \int_{-\pi}^0 x \, dx\\
&=&\frac{1}{\pi}\left[\frac{1}{2} x^2\right]_{-\pi}^0\\
&=& -\frac{\pi}{2}.
\eeann


\item Computing $b_n$ for $n=1,2,3,\dots,$ we get
\beann
b_n &=& \frac{1}{\pi} \int_{-\pi}^0 x \sin nx \, dx\\
&=&\frac{1}{\pi}\left[-\frac{x \cos nx}{n} + \frac{\sin nx}{n^2}\right]_{-\pi}^0\\
&=&  \frac{1}{\pi}\left[\frac{(-1)^n\pi}{n}\right]\\
&=&  \frac{(-1)^{n+1}}{n}\\
&=& \cases{{1}/{n} & for $n$ even,\cr
-{1}/{n} & for $n$ odd.}
\eeann


\item The Fourier series expansion of $f(x)$ is therefore
\beann
f(x) &=& -\frac{\pi}{4} +\frac{2}{\pi} \left( \cos x + \frac{1}{3^2}\cos 3x + \frac{1}{5^2} \cos 5x + \frac{1}{7^2} \cos 7x + \dots\right)\dots\\
&&\qquad +\sin x - \frac{1}{2}\sin 2x + \frac{1}{3}\sin 3x - \frac{1}{4}\sin 4x +\dots
\eeann

\item (c) The function is piecewise smooth. By Dirichlet's theorem, the Fourier series converges to the value
of the function where is is continuous, and to the average of the left and right limits
where it has a jump discontinity. The function $f(x)$ is continuous and equal to $0$ at $x=0$ and $x=\pi/2$,
so the Fourier series converges to $0$ at both points.
The function has a jump discontinuity at $x=\pi$, with left limit equal to $0$ and right limit
equal to $-\pi$. Therefore the Fourier series converges to $-\pi/2$ at $x=\pi$.
\end{itemize}

\newpage
\noindent
\textbf{3.} Suppose that
\[
f(x) = 1-x^2\qquad\mbox{$0<x<1$}.
\]
Let $f_p$ be the periodic extension of $f$ (with period $1$), $f_{\mathrm{e}}$ the even periodic extension of
$f$ (with period $2$), and $f_{\mathrm{o}}$ the odd periodic extension of $f$ (with period $2$).

\smallskip\noindent
(a) Sketch
the graphs of $f_p$, $f_{\mathrm{e}}$, and $f_{\mathrm{o}}$ on the interval $-3 < x < 3$.


\smallskip\noindent
(b) Write out the corresponding form of the
Fourier series for these functions, together with expressions for their Fourier coefficients. (Just
write expressions for the coefficients --- don't evaluate any integrals.)

\smallskip\noindent
(c) Which Fourier series converges faster --- the one for $f_{\mathrm{e}}$ or the one for $f_{\mathrm{o}}$? Explain you answer briefly,
but don't do any explicit computations.



\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item (a) Graphs omitted.

\item (b) The Fourier series are
\beann
f_p(x) &=& \sum_{n=-\infty}^\infty c_n e^{2\pi i n x},\qquad
c_n = \int_0^1 \left(1-x^2\right) e^{-2\pi inx}\, dx,\\
f_{\mathrm{e}}(x) &=& \frac{1}{2} a_0 + \sum_{n=1}^\infty a_n \cos{n \pi x},\qquad
a_n = 2\int_0^1 \left(1-x^2\right) \cos n\pi x\, dx,\\
f_{\mathrm{o}}(x) &=& \sum_{n=1}^\infty b_n \sin{n \pi x},\qquad
b_n = 2\int_0^1 \left(1-x^2\right) \sin n\pi x\, dx.
\eeann

\item (c) The Fourier series for $f_{\mathrm{e}}$ converges faster than the one for $f_{\mathrm{o}}$, since $f_{\mathrm{o}}$
has a jump discontinuity whereas  $f_{\mathrm{e}}$  does not.
\end{itemize}


\newpage
\noindent
\textbf{4.} The function
\[
f(x) = \cases{0 & for $-\pi < x \le 0$,\cr
\sin x & for $0 < x \le \pi$.}
\]
Has the Fourier series expansion
\[
f(x) = \frac{1}{\pi} +\frac{1}{2}\sin x - \frac{2}{\pi}\left(\frac{\cos 2x}{2^2-1}
+\frac{\cos 4x}{4^2-1}+\frac{\cos 6x}{6^2-1} + \dots +\frac{\cos 2nx}{(2n)^2-1} + \dots\right)
%\label{ffs}
\]
Apply Parseval's theorem to this function, and use the result to determine the
sum of the infinite series
\[
\sum_{n=1}^\infty \frac{1}{\left[(2n)^2 - 1\right]^2} = \frac{1}{3^2} + \frac{1}{15^2} + \frac{1}{35^2} + \dots.
\]


\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item Parseval's theorem states that if $f(x)$ is a $2\pi$-periodic function with Fourier cosine and sine coefficients
$a_n$ and $b_n$, respectively, then
\[
\frac{1}{2\pi} \int_{-\pi}^\pi f(x)^2\,dx = \frac{1}{4} a_0^2+ \frac{1}{2} \sum_{n=-\infty}^\infty \left\{a_n^2 + b_n^2\right\}. 
\]

\item For the given function $f(x)$, we have
\beann
\frac{1}{2\pi} \int_{-\pi}^\pi f(x)^2\,dx &=&  \frac{1}{2\pi} \int_{0}^\pi\sin^2x \,dx\\
&=&  \frac{1}{2\pi}\cdot\pi\cdot\frac{1}{2}\\
&=& \frac{1}{4},
\eeann
since the average value of $\sin^2 x$ is $1/2$. It follows from the Fourier series expansion of $f$ and Parseval's theorem that
\[
\frac{1}{4} = \frac{1}{4}\left(\frac{2}{\pi}\right)^2 + \frac{1}{2}\left(\frac{1}{2}\right)^2
+ \frac{1}{2}\left(\frac{2}{\pi}\right)^2\sum_{n=1}^\infty \frac{1}{\left[(2n)^2 - 1\right]^2}
\]
Rearranging and simplifying this equation, we get that
\[
\sum_{n=1}^\infty \frac{1}{\left[(2n)^2 - 1\right]^2} = \frac{\pi^2}{16} - \frac{1}{2}.
\]
\end{itemize}


\newpage
\noindent
\textbf{5.}
State the orthogonality relation for the functions $e^{inx}$, where $n$ is an integer.

\smallskip\noindent
(a) Use these relations to derive an expression for the Fourier coefficient $c_n$ in the complex
Fourier expansion of a $2\pi$-periodic function $f$,
\[
f(x) = \sum_{n=-\infty}^\infty c_n e^{inx}.
\]

\smallskip\noindent
(b) What can you say about $c_n$ if $f$ is an even function?


\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item The orthogonality relations are
\[
\frac{1}{2\pi} \int_0^{2\pi} e^{imx} e^{-inx}\, dx = \cases{0 & if $m\ne n$,\cr
1 & if $m=n$.}
\]

\item (a) We multiply the Fourier series of $f$,
\[
f(x) = \sum_{m=-\infty}^\infty c_m e^{imx},
\]
by $e^{-inx}$ and integrate over a period. (Here, $m$ is a summation variable that runs over all integers, and $n$ is an arbitrary but fixed
integer.) Exchanging the order of integration and summation, and using the orthogonality relation, we deduce that
\beann
\frac{1}{2\pi} \int_0^{2\pi} f(x) e^{-inx}\, dx &=&   \frac{1}{2\pi} \int_0^{2\pi} \left(\sum_{m=-\infty}^\infty c_m e^{imx} \right) e^{-inx}\, dx \\
&=&   \sum_{m=-\infty}^\infty c_m\left( \frac{1}{2\pi} \int_0^{2\pi} e^{imx} e^{-inx}\, dx\right) \\
&=& c_n,
\eeann
since only the $n$th term in the series is nonzero. That is,
\[
c_n = \frac{1}{2\pi} \int_0^{2\pi} f(x) e^{-inx}\, dx
\]

\item If $f$ is an even function, then $c_n$ is real.
\end{itemize}


\newpage
\noindent
\textbf{6.} Suppose that $f(x)$ has the complex Fourier series expansion
\[
f(x) = \sum_{n=-\infty}^\infty \frac{1}{1+in} \,e^{inx}.
\]
Find the real Fourier series expansion of $f(x)$ (in terms of sines and cosines).



\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item We split the series up into sums for $n<0$ and $n>0$:
\[
f(x) = \sum_{n=-1}^{-\infty} \frac{1}{1+in} \,e^{inx} + 1 + \sum_{n=1}^{\infty} \frac{1}{1+in} \,e^{inx}.
\]
The term $1$ comes from $n=0$. Changing the summation variable from $n$ to $-n$ in the first
sum, and combining the sums, we get
\beann
f(x) &=& \sum_{n=1}^{\infty} \frac{1}{1-in} \,e^{-inx} + 1 + \sum_{n=1}^{\infty} \frac{1}{1+in} \,e^{inx}\\
&=& 1 + \sum _{n=1}^{\infty} \left(\frac{1}{1+in} \,e^{inx} + \frac{1}{1-in} \,e^{-inx}\right).
\eeann
Using Euler's equation
\[
\cos nx = \frac{e^{inx}+e^{-inx}}{2},\quad
\sin nx = \frac{e^{inx}-e^{-inx}}{2i}
\]
and the equations
\beann
\frac{1}{1+in} &=&\frac{1-in}{(1+in)(1-in)}
= \frac{1-in}{1+n^2},\\
\frac{1}{1-in} &=&\frac{1+in}{(1-in)(1+in)}
= \frac{1+in}{1+n^2},
\eeann
to rewrite the terms in this series, we get
\beann
\frac{1}{1+in} \,e^{inx} + \frac{1}{1-in} \,e^{-inx} &=&
\frac{1}{1+n^2}\left(e^{inx} + e^{-inx}\right) \\
&&\qquad\qquad- \frac{in}{1+n^2} \left(e^{inx} - e^{-inx}\right)\\
&=&\frac{2}{1+n^2}\cos nx + \frac{2n}{1+n^2}\sin nx.
\eeann
Hence
\be
f(x) = 1 + 2 \sum_{n=1}^\infty \left\{\frac{1}{1+n^2}\cos nx + \frac{n}{1+n^2}\sin nx\right\}.
\label{feq}
\ee

\item Alternative method. If a $2\pi$-periodic function $f$ has complex Fourier coefficients $c_n$
and Fourier cosine and sine coefficients $a_n$ and $b_n$, respectively, then\footnote{See below
for a derivation of this result --- it's ok to state it without proof unless you're specifically asked to derive it.}
\be
c_n = \frac{1}{2}\left(a_n -ib_n\right)\qquad \mbox{for $n\ge 0$}
\label{fcf}
\ee

For the given function
\beann
c_n &=& \frac{1}{1+in} \\
&=& \frac{1-in}{1+n^2}\\
&=& \frac{1}{1+n^2}-i\frac{n}{1+n^2}
\eeann
so
\[
a_n = \frac{2}{1+n^2},\qquad b_n = \frac{2n}{1+n^2},
\]
which gives \eq{feq}.

\item For completeness, we derive \eq{fcf} from the equations for the Fourier coefficients.
We have
\beann
a_n &=& \frac{1}{\pi} \int_0^{2\pi} f(x) \cos nx\, dx,\\
b_n &=& \frac{1}{\pi} \int_0^{2\pi} f(x) \sin nx\, dx,\\
c_n &=& \frac{1}{2\pi} \int_0^{2\pi} f(x) e^{-inx}\, dx.
\eeann
Using Euler's formula in the definition of $c_n$, and rewriting the result, we get that,
for $n\ge 0$,
\beann
c_n &=& \frac{1}{2\pi} \int_0^{2\pi} f(x) \left(\cos nx - i\sin nx\right)\, dx\\
 &=& \frac{1}{2\pi} \int_0^{2\pi} f(x)\cos nx \, dx - i\frac{1}{2\pi} \int_0^{2\pi} f(x)\sin nx \, dx\\
 &=& \frac{1}{2}a_n -\frac{1}{2}ib_n,
\eeann
which proves \eq{fcf}.

\end{itemize}


\end{document}
