\documentclass[12pt,answers]{exam}
\usepackage{amsmath,amsfonts, times,amsthm,graphicx,xypic}

% \setlength{\textwidth}{6.5 in}
% \setlength{\oddsidemargin}{0pt}
% \setlength{\evensidemargin}{0pt}
% \setlength{\textheight}{8.5 in}
% \setlength{\headsep}{20pt}
% \setlength{\topmargin}{20pt}

\renewcommand{\theenumi}{\alph{enumi}}
\renewcommand{\labelenumi}{(\theenumi)}

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

\newcommand{\ba}{\begin{longanswer}}
\newcommand{\ea}{\end{longanswer}}

\theoremstyle{theorem}
\newtheorem*{claim}{Claim}

\newcommand{\bp}{\addtocounter{problemnum}{1}\begin{problem}}
\newcommand{\ep}{\end{problem}}

\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\id}{\operatorname{id}} 

\newcommand{\ra}{\rightarrow} 

\title{Practice Final}
\target{Math 157}

\begin{document}


\begin{exam}{\today}


\bp Everyone ought to try to approximate $\pi$. 
\ben
\item Define the number $\pi$.
\ba $\pi$ is defined to be the area of the unit circle.
\ea
\item The picture on the left makes it easy to see that
$2<\pi<4$:
$$\includegraphics[scale=0.4]{circlepic1.pdf}\qquad \includegraphics[scale=0.4]{circlepic3.pdf}$$
It takes more work to see that $3<\pi$.  Here's one way:
Use the following points $$(0,1),\quad \left(\frac{7}{25},\frac{24}{25}\right),\quad 
\left(\frac{3}{5},\frac{4}{5}\right),\quad\left(\frac{4}{5},\frac{3}{5}\right),\quad
\left(\frac{24}{25},\frac{7}{25}\right),\quad (1,0)$$ as the vertices of a
polygon (as pictured on the right) to approximate the area of the
quarter unit circle.  Use this to (under) approximate $\pi$.
\ba
The region under the polygon from $x=0$ to $x=\frac{7}{25}$ consists
of a rectange of width $\frac{7}{25}$ and height $\frac{24}{25}$ and a
triangle of height $\frac{1}{25}$ and width $\frac{7}{25}$ giving an
area
of $$\left(\frac{7}{25}\right)\left(\frac{24}{25}\right)+\frac{1}{2}\left(
  \frac{7}{25}\right)\left(\frac{1}{25}\right)=\frac{343}{1250}.$$
Similarly, the area of the polygon between $x=\frac{7}{25}$ and
$x=\frac{3}{5}$ is given by
$$\left(\frac{7}{25}-\frac{3}{5}\right)\left(\frac{4}{5}\right)+\frac{1}{2}\left(
  \frac{7}{25}-\frac{3}{5}\right)\left(\frac{24}{25}-\frac{4}{25}\right)=\frac{176}{625}.$$
Continuing in this way we obtain the area of the polygon is
$$\frac{343}{1250}+\frac{176}{625}+\frac{7}{50}+\frac{44}{625}+\frac{7}{1250}=\frac{193}{250}.$$
So, $\pi \approx 4
\left(\frac{193}{250}\right)=\frac{386}{125}>\frac{375}{125}=3.$
\ea
\een
\ep

\addtocounter{problemnum}{-1}
\bp
\ben
\addtocounter{enumi}{2}
\item Here's another way to approximate $\pi$.  Let
  $\mathcal{P}=\{x_0,x_1,\ldots, x_n\}$ be a partition of $[0,1]$ into
  $n$ subintervals of equal length.  
  Define step a function $s:[0,1]\to \R$ by
$$s(x)=\sqrt{1-x_{k+1}^2} \text{ if }x_k\leq x < x_{k+1} $$
Note that $\ds \int_0^1 s < \frac{\pi}{4}.$ %<\int_0^1 t.$
How large must $n$ be in order for $3.14<\ds 4 \int_0^1 s $?
\ba
By defining a step function $t:[0,1]\to \R$ by
$t(x)=\sqrt{1-x_{k}^2} \text{ if }x_k\leq x < x_{k+1} $, we have 
$$\int_0^1 s\leq \int_0^1 \sqrt{1-x^2}dx \leq \int_0^1 t.$$
Since $$\int_0^1 t -\int_0^1 s= \frac{1}{n}(1-0)=\frac{1}{n}$$
we have $$\int_0^1 \sqrt{1-x^2}dx-\int_0^1 s <\frac{1}{n}\Rightarrow
\frac{\pi}{4}-\int_0^1 s <\frac{1}{n}\Rightarrow \pi -\frac{4}{n}<4
\int_0^1 s.$$
Since $3.14<\pi-\frac{1}{1000}$, if we choose $n$ large enough for
$\frac{4}{n}<\frac{1}{1000}$, we will have $3.14<\ds 4 \int_0^1 s $.
So if $n>4000$ we have $3.14<\ds 4 \int_0^1 s $.

\textit{For fun, I computed this and got $\int_0^1
  s=3.1410880051481031671\ldots$ when $n=4000$.  But note that smaller
  $n$ work--the smallest integer $n$ for which $3.14<\int_0^1
  s$ is $n=1277$}

\ea

\een
\ep

\bp Expressions like $\ds\int_0^1 \frac{1}{\sqrt{x}}dx$ and $\ds\int_1^\infty
\frac{1}{x^2}dx$ are undefined because (so far!) we have defined
$\ds\int_a^b f$ only for finite intervals
$[a,b]$ and for bounded functions $f$.  Nonetheless, by using limits we
can make sense of these ``improper integrals.''   We define
$$\ds\int_0^1 \frac{1}{\sqrt{x}}dx :=\lim_{B\to 0^+}\int_B^1 \frac{1}{\sqrt{x}}dx
\qquad \text{ and }\qquad 
\int_1^\infty\frac{1}{x^2}dx :=\lim_{B\to \infty}\int_1^B \frac{1}{x^2}dx.$$
\ben
\item Compute 
$\ds \int_0^1 \frac{1}{\sqrt{x}}dx $
\ba 
$$\ds\int_0^1 \frac{1}{\sqrt{x}}dx :=\lim_{B\to 0^+}\int_B^1
\frac{1}{\sqrt{x}}dx =\lim_{B\to 0^+}2 \sqrt{1}-2\sqrt{B}=2.$$
\ea
\item Compute
$\ds \int_1^\infty\frac{1}{x^2}dx.$
\ba
$$\int_1^\infty\frac{1}{x^2}dx :=\lim_{B\to \infty}\int_1^B
\frac{1}{x^2}dx=\lim_{B\to \infty} \left(-\frac{1}{B}\right) - \left(-\frac{1}{1}\right)=1.$$
\ea
\een
\ep

\bp Let $f:[0,\infty)\to \R$ by $f(t)=\cos(\sqrt{t})$ and define
$A:[0,\infty)\to \R$ by $$A(x)=\int_0^x f(t)dt.$$
\ben
\item Sketch the graph of $f$.
\ba $$\includegraphics[scale=0.8]{graph_off.pdf}$$
\ea
\item Approximate $A(x)$ for $x=0,\pi^2, \frac{9\pi^2}{4},$ and
  $4\pi^2$.
\ba Looking at the graph of $f$ and using $\pi^2\approx 10$,
$\frac{9}{4}\pi^2 \approx 22$ and $4\pi^2\approx 40$, I
estimate $$A(\pi^2)\approx -4, \quad A \left( \frac{9}{4} \pi^2
  \right) \approx -10, \quad A \left( 4 \pi^2 \right) \approx 0.$$
\ea 
\item On what intervals is $A$ increasing?  decreasing?
\ba $A$ is increasing when $f$ is positive.  That is $\left( 0 ,
  \frac{\pi^2}{4}\right) \cup \left (\frac{9}{4}\pi^2 , 4\pi^2
\right)$.

$A$ is decreasing when $f$ is negative.  That is
$\left(\frac{\pi^2}{4},\frac{9}{4}\pi^2\right)$.

\ea
\item On what intervals is $A$ concave up?  concave down?
\ba $A$ is concave up when $f$ is increasing.  That is
$\left(\pi^2,4\pi^2\right)$.

$A$ is concave down when $f$ is decreasing.  That is $\left(0,\pi^2\right)$.
\ea
\een
\ep

\addtocounter{problemnum}{-1}
\bp
\ben
\addtocounter{enumi}{4}
\item Sketch a good picture of the graph of $A$.
\ba
$$\includegraphics[scale=0.8]{graph_ofA.pdf}$$
\ea
\een
\ep

% \bp Let $A=\{\text{continuous functions }f:[0,1]\to \R\}$.  For any
% $f\in A$, define $$\|f\|=\sup\{f(x)\}.$$  
% \ben
% \item Prove that $\|f+g\|\leq
% \|f\|+\|g\|.$
% \item Prove that $\|f\|=0\Rightarrow f=0.$
% \een
% \ep

\bp The $k$-th Fibonacci number $F_k$ is defined inductively for all
  $k$ by $F_1=1$, $F_2=1$, and $F_k=F_{k-1}+F_{k-2}$ for all $k>2$.
  The first few Fibonacci numbers are $$1,1,2,3,5,8,13,21,34,55,89,144,
  \ldots $$
  Prove that for every $n\in \N$, $F(4n)$ is divisible by $3$.
%\een
\ba \textit{Base step}.  Note that $F_4=3$ is divisible by $3$.

\textit{Inductive step}.  Suppose that $F_{4k}$ is divisible by $3$ for some
natural number $k$.  Now look at $F_{4(k+1)}$:
\begin{align*}
F_{4(k+1)}&=F_{4k+4}\\
&=F_{4k+3}+F_{4k+2}\\
&=F_{4k+2}+F_{4k+1}+F_{4k+1}+F_{4k}\\
&=F_{4k+1}+F_{4k}+F_{4k+1}+F_{4k+1}+F_{4k}\\
&=3F_{4k+1}+F_{4k}
\end{align*}
Since $F_{4k}$ is divisible by $3$ and $3F_{4k+1}$ is divisible by
$3$, the sum is divisible by $3$.  That is, $F_{4(k+1)}$ is divisible
by $3$.

Therefore, by the principle of mathematical induction, $F_{4n}$ is
divisible by $3$ for all $n\in \N$.
\ea
\ep


\bp Let $\pi_1:\R^2 \to \R$ and $\pi_2:\R^2 \to \R$
   be the canonical projections 
$$
\xymatrix{
&\R\times \R\ar@{->}[ld] _{\pi_1} \ar@{->}[rd]^{\pi_2} & \\
\R&&\R}
$$
For each of the following sets $A\subset \R^2$ describe $\pi_1(A)$ and $\pi_2(A)$.
\ben
% \item $A=\text{ the graph of $f$}$ where $f:(0,1]\to \R$ is given by
%   $f(x)=\frac{1}{x}$. 
\item $A=\text{ the graph of $g$}$ where $g:\R \to \R$ is given by
  $g(x)=0$ if $x\in \R \setminus \Q$ and $\frac{1}{r}$ if
  $x=\frac{p}{q}\in \Q$ is in lowest terms.
\ba $\pi_1(A)=\R$ and $\pi_2(A)=\{0\}\cup \{\frac{1}{n}:n\in \N\}$.
\ea
\item $A$ is the ordinate set of $g$ where $g:\R \to \R$ is given by
  $g(x)=0$ if $x\in \R \setminus \Q$ and $\frac{1}{r}$ if
  $x=\frac{p}{q}\in \Q$ is in lowest terms.
\ba $\pi_1(A)=\R$ and $\pi_2(A)=[0,1]$
\ea
% \item $A$ is the graph of $h:\left[ -\frac{\pi}{3},\frac{\pi}{6}\right]\to \R$ where $h(x)=5\sin(3x)+2.$ 
\item $A$ is the unit circle.
\ba $\pi_1(A)=[0,1]$ and $\pi_2(A)=[0,1]$
\ea
\item $A=\{(x,y): 1<x\leq 2 \text{ and }5\leq y <7\}.$
\ba $\pi_1(A)=(1,2]$ and $\pi_2(A)=[5,7)$
\ea
\een
\ep


\bp Give an example, or prove that no such example exists.
\ben %\addtolength{\itemsep}{12pt}
\item Two functions $f,g$ satisfying $\ds\lim_{x\to 0}f(x)=0$,
  $\ds\lim_{x\to 0}g(x)=0$ and $\ds\lim_{x \to 0}\frac{f(x)}{g(x)}=3$
\ba $f(x)=3x$, $g(x)=x$.
\ea
\item A continuous bijection $f:(0,1)\to \R $
\ba Here's a sketch of the graph of one such continuous bijection
$\qquad \begin{minipage}[c][1.75in][c]{\textwidth}\includegraphics[scale=0.45]{example1.pdf}\end{minipage}$.
\ea
\item A bijection $f:[0,2\pi)\to C$ where $C\subset \R^2$ is the unit
  circle
\ba $f(t)=(\cos(t),\sin(t))$
\ea
\item A function $f:[1,3]\to \R$ satisfying $f(1)=-1$, $f(3)=1$, and $f(x)\neq 0$
  for any number $x$
\ba $f(x)=-1$ for $x=1$ and $f(x)=1$ for all $1<x\leq 3$.
\ea
\een
\ep

\addtocounter{problemnum}{-1}
\bp
\ben
\addtocounter{enumi}{4}
\item A continuous function $f$ whose domain is all real numbers
  satisfying $f(n)=n!$ for all $n\in \N$
\ba Here's a sketch of one such function
$\qquad \begin{minipage}[c][1.75in][c]{\textwidth}\includegraphics[scale=0.45]{example2.pdf}\end{minipage}$.
But there are many.  Here's another: $\qquad \begin{minipage}[c][1.75in][c]{\textwidth}\includegraphics[scale=0.45]{example3.pdf}\end{minipage}$.
\ea
%\item A continuous function $f:[0,1]\to \R$ so that $f(x)-x$ has no
%  minimum on $[-1,1]$.
\item A function with domain $[0,2]$ and range $[0,2]\cup [3,4]$
\ba Here's a sketch of the graph of one possible function:
$\qquad \begin{minipage}[c][1.75in][c]{\textwidth}\includegraphics[scale=0.45]{example4.pdf}\end{minipage}$.
\ea
\item A function with domain $[0,2]$ and range $(0,2)$
\ba Let $f(0)=1$, $f(2)=1$, and $f(x)=x$ for all $0<x<2$.
\ea
\item A continuous function with domain $[0,2]$ and range
  $[0,2)\cup(2,3]$
\ba Not possible.  By the intermediate value theorem, if $0$ and $3$
are in the range, then so must $2$ be.
\ea
%\item A continuous function with domain $[0,2]$ and range
%  $[0,2)$.
%\item A function whose domain is $[0,2]$ that has no minimum.
\een
\ep

\addtocounter{problemnum}{-1}
\bp
\ben
\addtocounter{enumi}{8}
\item A function whose domain is $\R$ and whose range is $(0,1)$
\ba
The inverse of the function from part $b$ works.  So does the function
whose graph is
pictured here: $\qquad \begin{minipage}[c][1.75in][c]{\textwidth}\includegraphics[scale=0.45]{example5.pdf}\end{minipage}$.

\ea
\een
\ep


% \bp Recall that for any two sets $X$ and $Y$, the untion $X\cup Y$
% satisfies the important property
% \begin{quote}
% \emph{For any set $Z$ and
% any functions $f:X\to Z$ and $g:Y\to Z$ such that $f(x)=g(y)$ if $x=y$ 
% there exists a unique function 
% $h:X \cup Y\to Z$ so that $hi_1=f$ and $hi_2=g.$
% }
% \end{quote}
% $$
% \xymatrix{
% &Z&\\
% &X\cup Y \ar@{-->}[u]_h& \\
% X\ar@{->}[ru] _{i_1}\ar@{->}[ruu] ^{f}&&Y\ar@{->}[lu]^{i_2}Y\ar@{->}[luu]_{g} }
% $$
% \ben
% \item If $X=(-\infty,1)$ and $Y=[1,\infty)$ then $X\cup Y=\R$.  Give
%   an example to show that if $f:X \to \R$ and $g:Y\to \R$ are
%   continuous, the function $h: X \cup Y \to \R$ need not be
%   continuous.
% \item If $X=(-\infty,2]$ and $Y=[1,\infty)$ then $X\cup Y=\R$.  Prove
%   that if $f:X \to \R$ and $g:Y\to \R$ are
%   continuous, and $f(x)=g(y)$ if $x=y$, then the function 
%   $h: X \cup Y \to \R$ is also continuous.
% \een
% \ep



\bp Compute.  
\ba I'm giving the answer so you can check your work and hint in case
you were stuck.\ea 
\ben
\addtolength{\itemsep}{0.25in}
\item $\ds \lim_{h\to 0}\left(
    \frac{1}{h}\right)\left(\frac{3}{2+h}-\frac{3}{2}\right)=-\frac{3}{4}$
  algebra, cancel the $h$.
\item $\ds \int_1^5 \left |x^2-3x+2 \right|dx=\frac{41}{3}$ factor and
  find where $x^2-3x+2=0$
\item $\ds \lim_{x \to \infty}\sqrt{x^2+x}-x=\frac{1}{2}$ multiply and
  divide by $\sqrt{x^2+x}+x$.
\item $\ds \int_0^\pi \cos \left(\frac{x}{2}\right)dx=2$ use thm 1.19
  on page 81 about expansion or contraction.
\item $\ds \int_0^ \pi |\sin(x)+\cos(x)|dx=2\sqrt{2}$ you know the
  graphs of sine and cosine.
\item $\ds \int_0^2 \frac{x+\sqrt{4-x^2}}{2}dx=1+\frac{\pi}{2}$ you
  know the area of a circle of radius $2$...
\item $\ds \int_0^1 x^{\frac{1}{5}} dx = \frac{5}{6}.$
%\item $\ds \lim_{B \to \infty}\int_1^B \frac{dx}{x^2}$
\item $\ds\lim_{h\to
    0}\frac{ \cos\left(\frac{\pi}{3}+h\right)-\frac{1}{2}}{h}=-\frac{\sqrt{3}}{2}$ use $\cos(x+y)=\cdots$
\item $\ds \lim_{ x \to 0}\frac{\sin(x)}{x}=1$ use
  the fundamental inequality and the squeezing principle
\item $\ds \lim_{x\to \infty}\frac{\sin(x)}{x}=0$ use the fact that
  $-1\leq \sin(x)\leq 1$ and squeeze
\een
\ep

\bp True or false.
\ba If true, you should have a good idea as to why.  If false, you
should be able to give a good simple example.  Here are the answers.
\ea
\ben
\addtolength{\itemsep}{.25cm}
\item If $f:X\to Y$ is injective, then for all $A\subset
  X$, $$f(X\setminus A)=Y\setminus f(A).$$
\ba False. 
\ea
 \item For any $a,b,c,d\in \R$, $(ac+bd)^2\leq (a^2+c^2)(b^2+d^2).$
\ba True.
\ea
 \item If $A$ and $B$ satisfy $$\frac{17-6n}{3}\leq A \leq B \leq
   \frac{17+6n}{3}$$ for every $n\in \N$, then $A=B$.
\ba True.
\ea
\item If $f:[a,b]\to \R$ is monotonic then $f$ is integrable.
\ba True.
\ea
\item If $f:[a,b]\to \R$ is bounded then $f$ is integrable.
\ba False.
\ea
\item If $f:[a,b]\to \R$ is bounded then $f$ is continuous.
\ba False.
\ea
\een
\ep

\addtocounter{problemnum}{-1}
\bp
\ben
\addtocounter{enumi}{6}
\item If $f:[a,b]\to \R$ is integrable then $f$ is monotonic.
\ba False.
\ea
\item If $f:[a,b]\to \R$ is integrable then $f$ is continuous.
\ba False.
\ea
\item If $f:[a,b]\to \R$ is monotonic then $f$ is invertible.
\ba False.  If $f$ is strictly monotonic, then $f$ is invertible.
\ea
\item If $f:[a,b]\to \R$ is invertible then $f$ is monotonic.
\ba False.
\ea
\item If $f:[a,b]\to \R$ is integrable then $f$ is bounded.
\ba True.
\ea
\item If $f:[a,b]\to \R$ is integrable then $f$ is invertible.
\ba False.
\ea
\item If $f:[a,b]\to \R$ is continuous then $f$ is bounded.
\ba True.
\ea
\item For every real number $x$ there exists a real number $y$ with
  $y^2=x$.
\ba False.
\ea
\een
\ep


















\end{exam}
\end{document}
















