\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 Questions: Solutions}}
\centerline{\textbf{Midterm II}}
\centerline{\textbf{Math 127B}. \textbf{Winter, 2005}}


\bigskip\bigskip
\noindent
\textbf{1.} For each of the following statements, say if it is true or false. (No explanation is required.)

\smallskip\noindent
(a) If $f$ is differentiable and $f^\prime > 0$, then $f$ is strictly increasing.

\smallskip\noindent
(b) If $f$ is strictly increasing and differentiable, then $f^\prime > 0$.


\smallskip\noindent
(c) If $f$ is the sum of a convergent Taylor series
in an open interval containing the origin, then $f$ is infinitely differentiable.


\smallskip\noindent
(d) If $f$ is infinitely differentiable in an open interval containing the origin, then the Taylor
series of $f$ converges.

\smallskip\noindent
(e) There exists $0<x<1$ such that
$e^x \sin 1 = \cos x\left(e-1\right)$.


\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item (a) True. (Follows from the mean value theorem.)

\item  (b) False. (For example, $f(x) = x^3$.)
\item  (c) True. (Power series can be differentiated term-by-term inside their interval of convergence.)
\item  (d) False. (For example, we saw in class that
\[
f(x) = \sum_{n=1}^\infty e^{-n} \cos(n^2 x)
\]
is infinitely differentiable on $\Rl$, but its Taylor series (at $0$) diverges.)
\item (e) True. (Apply the generalized mean value theorem to $e^x$ and $\sin x$ on $[0,1]$.)
\end{itemize}


\newpage
\noindent
\textbf{2.} Define the derivative. Consider
\[
f(x) = \cases{|x|^a& for $x$ irrational,\cr
0 & for $x$ rational.}
\]
For what values of $a > 0$ is $f$ differentiable at $0$? Is $f$ differentiable at $x\ne 0$?

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item A function $f:(a,b)\to \Rl$ is differentiable at $x_0\in (a,b)$ with
derivative $f^\prime(x_0)$ if the following limit
exists
\[
f^\prime(x_0) = \lim_{x\to x_0} \frac{f(x) - f(x_0)}{x-x_0}.
\]

\item This function is differentiable at $0$ if and only if $a > 1$. This follows because
\beann
&&\frac{f(x) - f(0)}{x-0} = 0 \qquad\mbox{if $x$ is rational and nonzero},\\
&&\frac{f(x) - f(0)}{x-0} = \frac{|x|^a}{x} \qquad\mbox{if $x$ is irrational},
\eeann
and
\[
\lim_{x\to 0}\frac{|x|^a}{x} = 0
\]
if and only if $a > 1$.

\item The function $f$ is discontinuous at every $x\ne 0$, therefore it is not differentiable at
any $x\ne 0$.
\end{itemize}

\newpage
\noindent
\textbf{3.} 
State Taylor's theorem. Prove that
\[
\log(1+x) < x
\]
for all $x > 0$.


\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item If $f : (a,b) \to \Rl$ is an $n$-times differentiable function on an open interval
$(a,b)$ containing the origin, then for any $x\in (a,b)$ there exists a $y$ between $0$ and $x$
such that
\[
f(x) - \sum_{k=0}^{n-1} \frac{f^{(k)}(0)}{k!} x^k  = \frac{f^{(n)}(y)}{n!} x^n.
\]

\item First proof. The function $f(x) = \log(1+x)$ is infinitely differentiable in
$(-1,\infty)$, and
\[
f^\prime(x) = \frac{1}{1+x},\quad f^{\prime\prime}(x) = -\frac{1}{(1+x)^2}.
\]
Since $f(0) = 0$ and $f^\prime(0) = 1$, the Taylor polynomial of $f$ of degree $1$ is $x$. 
If $x > 0$, then using Taylor's theorem with $n=2$ we find that there exists $0 < y < x$
such that
\[
f(x) - x = -\frac{1}{2!(1+y)^2}x^2 < 0, 
\]
so
\[
\log(1+x) < x.
\]

\item Second proof. For any $x > 0$, the function $g(x) = x -\log(1+x)$ is continuous
on the closed interval $[0,x]$ and differentiable in the open interval $(0,x)$.
By the mean value theorem, there exists $0 < y < x$ such that
\[
g(x) - g(0) = g^\prime(y) (x-0).
\]
Since $g(0) = 0$ and
\[
g^\prime(y) = 1 - \frac{1}{1+y} > 0\qquad \mbox{for $y > 0$}, 
\]
we conclude that
\[
g(x) > 0 \qquad\mbox{for $x > 0$}
\]
which proves the result.
\end{itemize}



\newpage
\noindent
\textbf{4.} Carefully state a version of L'Hospital's rule that applies
to the following limit. Use it to prove that the limit exists, and find its value:
\[
\lim_{x\to 0} \frac{1-\cos x}{x^2}.
\]


\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item Suppose that $f$, $g$ are functions that are differentiable in an open interval containing $x_0$,
with $g^\prime(x)$ nonzero in the interval, and
\[
\lim_{x\to x_0} f(x) = 0,\qquad \lim_{x\to x_0} g(x) = 0.
\]
If the limit
\[
\lim_{x\to x_0} \frac{f^\prime(x)}{g^\prime(x)} = L
\]
exists, then so does the limit
\[
\lim_{x\to x_0} \frac{f(x)}{g(x)} = L.
\]

\item The functions $f(x) = \sin x$ and $g(x) = 2x$ satisfy the hypotheses of L'Hospital's theorem on any
interval containing the origin, and
\[
\lim_{x\to 0} \frac{f^\prime(x)}{g^\prime(x)} = \lim_{x\to 0} \frac{\cos x}{2} =\frac{1}{2}
\]
since $\cos x$ is continuous at $x=0$. Hence
\[
\lim_{x\to 0} \frac{\sin x}{2x} =\frac{1}{2}
\]
Applying L'Hospital's theorem again to the functions
$F(x) = 1-\cos x$ and $G(x) = x^2$, which also satisfy its hypotheses,
with
\[
\lim_{x\to 0} \frac{F^\prime(x)}{G^\prime(x)} =\frac{1}{2}
\]
we conclude that
\[
\lim_{x\to 0} \frac{F(x)}{G(x)} = \frac{1}{2},
\]
which proves the result.
\end{itemize}



\newpage
\noindent
\textbf{5.} Define the hyperbolic sine
\[
\sinh x = \frac{e^x - e^{-x}}{2}.
\]
Prove that $\sinh x$ is strictly increasing on $\Rl$ and hence has an inverse.
Prove that the inverse is differentiable and compute its derivative.

\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item The functions
\[
\cosh x = \frac{e^x + e^{-x}}{2},\qquad
\sinh x = \frac{e^x - e^{-x}}{2},
\]
satisfy the following easily verified identities:
\beann
&&(\cosh x)^\prime = \sinh x,\quad (\sinh x)^\prime = \cosh x,\\
&&\cosh^2 x - \sinh^2 x = 1.
\eeann

\item Since $(\sinh x)^\prime = \cosh x > 0$ on $\Rl$, the function $\sinh x$ is strictly increasing,
and therefore invertible on its range.
Moreover, since $e^x \to \infty$ and $e^{-x} \to 0$ as  $x\to \infty$, we have $\sinh x \to \infty$
as $x\to \infty$; similarly $\sinh x \to -\infty$
as $x\to -\infty$. Thus, the range of $\sinh : \Rl \to \Rl$ is all of $\Rl$, and $\sinh^{-1} : \Rl \to \Rl$

\item Since $\sinh x$ is differentiable on $\Rl$ and $(\sinh x)^\prime \ne 0$, the inverse function is
differentiable on $\Rl$, and
\[
(\sinh^{-1})^\prime(\sinh x ) = \frac{1}{(\sinh x)^\prime} = \frac{1}{\cosh x}.
\]
Setting $y=\sinh x$, and writing
\[
\cosh x = \sqrt{1 + \sinh^2 x} = \sqrt{1 + y^2},
\]
we conclude that
\[
(\sinh^{-1})^\prime(y) = \frac{1}{\sqrt{1 + y^2}}.
\]

\end{itemize}


\newpage
\noindent
\textbf{6.} A function $f$ has a jump discontinuity at $x_0$ if
both the left and right limits
\[
\lim_{x\to x_0^+} f(x), \qquad \lim_{x\to x_0^-} f(x)
\]
exist but have different values. Suppose that $f : (a,b) \to \Rl$ is differentiable in
$(a,b)$. Prove that $f^\prime$ does not have a jump discontinuity in $(a,b)$.


\bigskip\noindent
\textbf{Solution.}
\begin{itemize}
\item Suppose, for contradiction, that the limits
\[
L_\pm = \lim_{x\to x_0^\pm} f^\prime(x)
\]
exist and are distinct. Let
\[
\epsilon = \frac{L_+ - L_-}{3}.
\]
Then there exists $\delta > 0$ such that
\[
|f^\prime(x) - L_+| < \epsilon\quad\mbox{for  $x_0 < x < x_0+\delta$}
\]
and
\[
|f^\prime(x) - L_-| < \epsilon\quad\mbox{ for $x_0-\delta < x < x_0$.}
\]
For definiteness, suppose that $L_+ > L_-$
(otherwise, we can consider $-f$ instead of $f$).
It follows that $f^\prime(x)$ cannot take values in the
interval $[L_- + \epsilon, L_+ - \epsilon]$ of width $\epsilon > 0$
when $0 < |x-x_0| < \delta$. Since $f^\prime(x) > L_+ - \epsilon$ for
$x > x_0$ and $f^\prime(x) < L_- + \epsilon$ for $x < x_0$,
this contradicts the intermediate value property of the derivative,
whatever the value of $f^\prime(x_0)$.
\end{itemize}

\end{document}
