\documentclass{article}
\usepackage{amsmath,amsthm,amssymb,amsfonts,fancyhdr,epic,eepic,multicol,graphicx}

\renewcommand{\baselinestretch}{1.1}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\theoremstyle{definition}
\newtheorem{problem}{Problem}
\newtheorem{remark}{Remark}
\newtheorem{definition}{Definition}
\newcommand{\bp}{\begin{problem}}
\newcommand{\ep}{\end{problem}}

\newtheorem*{answer}{Answer}
\newtheorem*{lemma*}{Lemma}
\newtheorem*{theorem*}{Theorem}
\newcommand{\ba}{\begin{answer}}
\newcommand{\ea}{\end{answer}}

\newcommand{\ds}{\displaystyle}
\newcommand{\ben}{\renewcommand{\theenumi}{\alph{enumi}}\renewcommand{\labelenumi}{(\theenumi)}\begin{enumerate}}
\newcommand{\een}{\end{enumerate}}

\newcommand{\Z}{\mathbb{Z}} 
\newcommand{\N}{\mathbb{N}} 
\newcommand{\R}{\mathbb{R}} 
\newcommand{\C}{\mathbb{C}} 



\fancyhead[L]{\Large \textbf{Math 158 Spring 2014}}
\fancyhead[R]{\large \textbf{Homework 2 Answers}}


\begin{document}
\pagestyle{fancy}
\fancyfoot[R,L,C]{}

\section*{Some new problems}


\bp Read through section 4.20 in the text and do exercises 1, 8, 9 in
section 4.19 (page 191) and exercises 2, 3, 19, 21, 28 in section 4.21
(page 194-196)
\ep


\bp True or False:  Let $\ds f(x)=(x-1)^{\frac{2}{3}}$.  Since $f(0)=1$ and
  $f(2)=1$, there is some point $c\in (0,2)$ with $f'(c)=0.$
\ba False.  One might be tempted to apply 
the mean value theorem, but it doesn't apply since
$f$ is not differentiable on $(0,2)$ ($f'(1)$ does not
exist).  

Here's a plot of $y=(x-1)^{\frac{2}{3}}.$

\begin{center}
\includegraphics[scale=0.6]{hw2_pic1.pdf}
\end{center}

\ea
\ep

\bp Prove:
\ben
\item If $f$ satisfies $|f(s)-f(t)|\leq |s-t| \text{ for all }s,t,$
  then $f$ is continuous.  
\ba The statement ``$f$ is continuous at the number $t$'' means that
for all $\epsilon>0$ there exists a $\delta>0$ so that if
$|s-t|<\delta$ then $|f(s)-f(t)|<\epsilon.$  So, let $\epsilon>0$ be
given.  Choose $\delta=\epsilon.$  Then if $|s-t|<\delta$ we have
$|s-t|<\epsilon.$  Since $|f(s)-f(t)|<|s-t|$, we have
$|f(s)-f(t)|<\epsilon$ as needed.
\ea
\item If $f$ satisfies $|f(s)-f(t)|\leq |s-t|^2 \text{ for all
}s,t,$ then $f$ is constant.
\ba Since $|f(s)-f(t)|\leq |s-t|^2$, we have $|f(x+h)-f(x)|\leq |h|^2$.
Therefore, $$\left|\frac {f(x+h)-f(x)}{h}\right |\leq |h| \Rightarrow
-|h| \leq \frac{f(x+h)-f(x)}{h} \leq |h|.$$
So, by the squeeze theorem, 
$$f'(x)=\lim_{h \to 0}\frac {f(x+h)-f(x)}{h}=0.$$
Therefore, $f$ is constant.
\ea
\een
\ep

\bp It is hard, or maybe even impossible, to
determine $$\int_{-\frac{\sqrt{\pi}}{2}}^{-\frac{\sqrt{\pi}}{2}}
\cos(x^2)dx$$ exactly.  But $g(x)=\cos(x^2)$ can be approximated by a
polynomial.   Your problem: find a polynomial $p(x)=ax^4+bx^3+cx^2+dx+e$ that
satisfies $p(0)=g(0)$, $p'(0)=g'(0)$, $p''(0)=g''(0)$,
$p'''(0)=g'''(0)$, and $p''''(0)=g''''(0)$.
Use a
computer to graph $g$ and $p$ in the same picture.  Approximate $
\int_{-\frac{\sqrt{\pi}}{2}}^{-\frac{\sqrt{\pi}}{2}}\cos(x^2)dx$ by
computing $$\int_{-\frac{\sqrt{\pi}}{2}}^{-\frac{\sqrt{\pi}}{2}}
p(x)dx$$ instead.
\ba For $g(x)=\cos(x^2)$, we have 
\begin{align*}
 g(x)&=\cos \left(x^2\right) & g(0)&=1 \\
 g'(x)&=-2 x \sin \left(x^2\right) & g'(0)&=0 \\
 g''(x)&=-4 x^2\cos \left(x^2\right)-2 \sin \left(x^2\right) & g''(0)&=0 \\
 g^{(3)}(x)&=8 x^3 \sin \left(x^2\right)-12 x \cos \left(x^2\right) & g^{(3)}(0)&=0 \\
 g^{(4)}(x)&=16 x^4\cos \left(x^2\right) +48 x^2\sin \left(x^2\right) -12 \cos \left(x^2\right) & g^{(4)}(0)&=-12 \\
g^{(5)}(x)& =-32 x^5\sin \left(x^2\right) +160 x^3\cos
\left(x^2\right) +120 x \sin \left(x^2\right)  & g^{(5)}(0)&=0 
\end{align*}
If $p(x)=ax^4+bx^3+cx^2+dx+e$, then 
\begin{align*}
 p(x)&=ax^4+bx^3+cx^2+dx+e& p(0)&=e \\
 p'(x)&=4ax^3+3bx^2+2cx+d & p'(0)&=d \\
 p''(x)&=12ax^2+6bx+2c & p''(0)&=2c \\
 p^{(3)}(x)&=24ax+6b & p^{(3)}(0)&=6b \\
 p^{(4)}(x)&=24a & p^{(4)}(0)&=24a \\
p^{(5)}(x)& =0  & p^{(5)}(0)&=0 
\end{align*}
Matching coefficients, we see that 
\begin{align*}
p(0)=g(0) & \Rightarrow e=1\\
p'(0)=g'(0) & \Rightarrow d=0\\
p''(0)=g''(0) & \Rightarrow c=0 \\
p^{(3)}(0)=g^{(3)}(0) & \Rightarrow b=0\\
p^{(4)}(0)=g^{(4)}(0) & \Rightarrow a=-\frac{1}{2}
\end{align*}
So, the polynomial $$p(x)=-\frac{1}{2}x^4+1$$
has the same value and first-through-fourth derivatives as
$g(x)=\cos(x^2)$, so we reason that $p(x)$ is a good approximation for
$g(x)$ and 
$$
\int_{-\frac{\sqrt{\pi}}{2}}^{-\frac{\sqrt{\pi}}{2}}
\cos(x^2)dx\approx \int_{-\frac{\sqrt{\pi}}{2}}^{-\frac{\sqrt{\pi}}{2}}
\left(-\frac{1}{2}x^4+1 \right)dx = \sqrt{\pi }-\frac{\pi ^{5/2}}{160}.$$
Here's a nice picture:
\begin{center}
\includegraphics[scale=1]{hw2_pic2.pdf}
\end{center}

\ea
\ep

\bp Suppose that $f(4)=0$, $g(4)=0$, $f'(4)=7$, and $g'(4)=-1.$  Prove
that $\ds \lim_{x \to 4}\frac{f(x)}{g(x)}$ exists and compute it.
\ba
We begin with $\frac{f'(4)}{g'(4)}$:
\begin{align*}
-7&=\frac{7}{-1}\\
&=\frac{f'(4)}{g'(4)}\\
&=\frac{\lim_{h \to
    0}\frac{f(4+h)-f(4)}{h}}{\lim_{h \to 0}\frac{g(4+h)-g(4)}{h}}\\
&=\lim_{ h\to 0}\frac{f(4+h)-f(4)}{g(4+h)-g(4)}\\
&=\lim_{ h\to 0}\frac{f(4+h)-0}{g(4+h)-0}\\
&=\lim_{h \to
  0}\frac{f(4+h)}{g(4+h)}\\
&=\lim_{x \to 4}\frac{f(x)}{g(x)}.
\end{align*}
\ea
\ep




\section*{Some review problems}

\bp Let $f$ be a function defined on an open neighborhood of $c$.
Define the statement ``$f$ is differentiable at $c$'' and the number
$f'(c).$
\ba We say $f$ is differentiable at $c$ provided the
limit $$\lim_{h\to 0}\frac{f(c+h)-f(c)}{h}$$ exists and is finite.  If
it does, we define the number $\lim_{h\to 0}\frac{f(c+h)-f(c)}{h}$ by $f'(c)$.
\ea
\ep

\bp Prove that if $f$ is differentiable at $x=c$ then $f$ is
continuous at $x=c.$
\ba
We need to prove that $f(c)=\lim_{x\to c}f(x)$, or equivalently, that
$\lim_{h \to 0}f(c+h)-f(c)=0$.  

Since $f$ is
differentiable at $c$ we know $f'(c)=\lim_{h\to
  0}\frac{f(c+h)-f(c)}{h}$ exists and is finite.  Therefore, $$\lim_{h
  \to 0}f(c+h)-f(c)=\lim_{h\to
  0}\left( \frac{f(c+h)-f(c)}{h}\right)(h)= \lim_{h \to 0}f'(c)h =0.$$
\ea
\ep

\bp Prove that if $f:\R \to \R$ is differentiable and $f(c)\geq f(x)$ for all
  $x\in \R$, then $f'(c)=0$.
\ba
Suppose that $f(c)\geq f(x)$ for all
  $x\in \R$.  If $\lim_{h\to 0}\frac{f(c+h)-f(c)}{h}=f'(c)>0$, then,
  there exists a neighborhood of $0$ so that for all $h$ in this
  neighborhood $\frac{f(c+h)-f(c)}{h}>0$.  But this is impossible
  since for some $h$ in this neighborhood we will have $h>0$ and
  $f(c)>f(c+h).$

Similarly, if $\lim_{h\to 0}\frac{f(c+h)-f(c)}{h}=f'(c)<0$, then,
  there exists a neighborhood of $0$ so that for all $h$ in this
  neighborhood $\frac{f(c+h)-f(c)}{h}<0$.  But this is impossible
  since for some $h$ in this neighborhood we will have $h<0$ and
  $f(c)>f(c+h).$

Therefore, if $f'(c)$ exists, it must equal zero.
\ea
\ep

\bp Prove that if $f'(x)>0$ for all $x\in (0,1)$, then $f$ is
increasing on $(0,1)$.
\ba  Suppose $f'(x)>0$ for all $x\in (0,1)$.  To show that $f$ is
increasing on $(0,1)$, choose two numbers $a,b\in (0,1)$ with $a<b$.
By the mean value theorem, there exists a number $c\in (a,b)$ with
$f'(c)=\frac{f(b)-f(a)}{b-a}.$  Since $f'(c)>0$ and $b-a>0$ it follows
that $f(b)-f(a)>0\Rightarrow f(a)<f(b)$, as needed to show that $f$ is increasing.
\ea
\ep


\end{document}

