
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% 22 April 2008:

\parindent=0pt
\parskip=5pt

\raggedright
\tolerance=1600

\newfam\sffam
\newfam\bbfam
\newfam\frfam
\newfam\srfam
\newfam\curfam
\newfam\isffam


\font\sixbf=cmbx6%
\font\thirtysixbf=cmbx12 at 36pt%
\font\sevenbf=cmbx7%
\font\ninebf=cmbx9%
\font\twelvebf=cmbx12%
\font\fourteenbf=cmbx12 at 14pt%
\font\fortyeightbf=cmbx12 at 48pt%
\font\eightbf=cmbx8%
\font\eighteenbf=cmbx12 at 18pt%
\font\twentyfourbf=cmbx12 at 24pt%
\font\tenbf=cmbx10%
\font\fivebf=cmbx5%

\font\sixrm=cmr6%
\font\thirtysixrm=cmr17 at 36pt%
\font\sevenrm=cmr7%
\font\ninerm=cmr9%
\font\twelverm=cmr12%
\font\fourteenrm=cmr12 at 14pt%
\font\fortyeightrm=cmr17 at 48pt%
\font\eightrm=cmr8%
\font\eighteenrm=cmr17 at 18pt%
\font\twentyfourrm=cmr17 at 24pt%
\font\tenrm=cmr10%
\font\fiverm=cmr5%

\font\sixit=cmti6%
\font\thirtysixit=cmti10 at 36pt%
\font\sevenit=cmti7%
\font\nineit=cmti9%
\font\twelveit=cmti10 at 12pt%
\font\fourteenit=cmti10 at 14pt%
\font\fortyeightit=cmti10 at 48pt%
\font\eightit=cmti8%
\font\eighteenit=cmti10 at 18pt%
\font\twentyfourit=cmti10 at 24pt%
\font\tenit=cmti10%
\font\fiveit=cmti5%

\font\sixex=cmex6%
\font\thirtysixex=cmex12 at 36pt%
\font\sevenex=cmex7%
\font\nineex=cmex9%
\font\twelveex=cmex12%
\font\fourteenex=cmex12 at 14pt%
\font\fortyeightex=cmex12 at 48pt%
\font\eightex=cmex8%
\font\eighteenex=cmex12 at 18pt%
\font\twentyfourex=cmex12 at 24pt%
\font\tenex=cmex10%
\font\fiveex=cmex5%

\font\sixfr=eufm6%
\font\thirtysixfr=eufm10 at 36pt%
\font\sevenfr=eufm7%
\font\ninefr=eufm9%
\font\twelvefr=eufm10 at 12pt%
\font\fourteenfr=eufm10 at 14pt%
\font\fortyeightfr=eufm10 at 48pt%
\font\eightfr=eufm8%
\font\eighteenfr=eufm10 at 18pt%
\font\twentyfourfr=eufm10 at 24pt%
\font\tenfr=eufm10%
\font\fivefr=eufm5%

\font\sixsy=cmsy6%
\font\thirtysixsy=cmsy12 at 36pt%
\font\sevensy=cmsy7%
\font\ninesy=cmsy9%
\font\twelvesy=cmsy10 at 12pt%
\font\fourteensy=cmsy12 at 14pt%
\font\fortyeightsy=cmsy12 at 48pt%
\font\eightsy=cmsy8%
\font\eighteensy=cmsy12 at 18pt%
\font\twentyfoursy=cmsy12 at 24pt%
\font\tensy=cmsy10%
\font\fivesy=cmsy5%

\font\sixsf=cmss6%
\font\thirtysixsf=cmss17 at 36pt%
\font\sevensf=cmss7%
\font\ninesf=cmss9%
\font\twelvesf=cmss12%
\font\fourteensf=cmss12 at 14pt%
\font\fortyeightsf=cmss17 at 48pt%
\font\eightsf=cmss8%
\font\eighteensf=cmss17 at 18pt%
\font\twentyfoursf=cmss17 at 24pt%
\font\tensf=cmss10%
\font\fivesf=cmss5%

\font\sixbb=bbm6%
\font\thirtysixbb=bbm17 at 36pt%
\font\sevenbb=bbm7%
\font\ninebb=bbm9%
\font\twelvebb=bbm12%
\font\fourteenbb=bbm12 at 14pt%
\font\fortyeightbb=bbm17 at 48pt%
\font\eightbb=bbm8%
\font\eighteenbb=bbm17 at 18pt%
\font\twentyfourbb=bbm17 at 24pt%
\font\tenbb=bbm10%
\font\fivebb=bbm5%

\font\sixmi=cmmi6%
\font\thirtysixmi=cmmi12 at 36pt%
\font\sevenmi=cmmi7%
\font\ninemi=cmmi9%
\font\twelvemi=cmmi12%
\font\fourteenmi=cmmi12 at 14pt%
\font\fortyeightmi=cmmi12 at 48pt%
\font\eightmi=cmmi8%
\font\eighteenmi=cmmi12 at 18pt%
\font\twentyfourmi=cmmi12 at 24pt%
\font\tenmi=cmmi10%
\font\fivemi=cmmi5%

\font\sixsr=rsfs5%  %% was 6               %% 31 Dec 2008 only 5,7,10
\font\thirtysixsr=rsfs10 at 36pt%
\font\sevensr=rsfs7%
\font\ninesr=rsfs7 at 9pt%   % was 9
\font\twelvesr=rsfs10 at 12pt%
\font\fourteensr=rsfs10 at 14pt%
\font\fortyeightsr=rsfs10 at 48pt%
\font\eightsr=rsfs7%  %% was 8
\font\eighteensr=rsfs10 at 18pt%
\font\twentyfoursr=rsfs10 at 24pt%
\font\tensr=rsfs10%
\font\fivesr=rsfs5%

\font\tencur=cmfi10 at 10pt%
\font\twelvecur=cmfi10 at 12pt%
\font\fourteencur=cmfi10 at 14pt%
\font\eighteencur=cmfi10 at 18pt%
\font\twentyfourcur=cmfi10 at 24pt%
\font\tenisf=cmssi10%
\font\twelveisf=cmssi10 at 12pt%
\font\fourteenisf=cmssi10 at 14pt%
\font\eighteenisf=cmssi9 at 18pt%
\font\twentyfourisf=cmssi8 at 24pt%
\skewchar\twelvemi='177%
\skewchar\tenmi='177%
\skewchar\ninemi='177%
\skewchar\eightmi='177%
\skewchar\sevenmi='177%
\skewchar\sixmi='177%
\skewchar\fivemi='177%
\skewchar\tensy='60%
\skewchar\ninesy='60%
\skewchar\eightsy='60%
\skewchar\sevensy='60%
\skewchar\sixsy='60%
\skewchar\fivesy='60%

\def\tenpoint{%
\textfont6=\tenbf \scriptfont6=\sevenbf \scriptscriptfont6=\fivebf%
\def\bf{\fam6\tenbf}%
\textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm%
\def\rm{\fam0\tenrm}%
\textfont4=\tenit \scriptfont4=\sevenit \scriptscriptfont4=\fiveit%
\def\it{\fam4\tenit}%
\textfont3=\tenex \scriptfont3=\sevenex \scriptscriptfont3=\fiveex%
\def\ex{\fam3\tenex}%
\textfont\frfam=\tenfr \scriptfont\frfam=\sevenfr \scriptscriptfont\frfam=\fivefr%
\def\fr{\fam\frfam\tenfr}%
\textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy%
\def\sy{\fam2\tensy}%
\textfont\sffam=\tensf \scriptfont\sffam=\sevensf \scriptscriptfont\sffam=\fivesf%
\def\sf{\fam\sffam\tensf}%
\textfont\bbfam=\tenbb \scriptfont\bbfam=\sevenbb \scriptscriptfont\bbfam=\fivebb%
\def\bb{\fam\bbfam\tenbb}%
\textfont1=\tenmi \scriptfont1=\sevenmi \scriptscriptfont1=\fivemi%
\def\mi{\fam1\tenmi}%
\textfont\srfam=\tensr \scriptfont\srfam=\sevensr \scriptscriptfont\srfam=\fivesr%
\def\sr{\fam\srfam\tensr}%
\def\cur{\fam\curfam\tencur}%
\def\isf{\fam\isffam\tenisf}%
}
\def\ninepoint{%
\textfont6=\ninebf \scriptfont6=\sevenbf \scriptscriptfont6=\fivebf%
\def\bf{\fam6\ninebf}%
\textfont0=\ninerm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm%
\def\rm{\fam0\ninerm}%
\textfont4=\nineit \scriptfont4=\sevenit \scriptscriptfont4=\fiveit%
\def\it{\fam4\nineit}%
\textfont3=\nineex \scriptfont3=\sevenex \scriptscriptfont3=\fiveex%
\def\ex{\fam3\nineex}%
\textfont\frfam=\ninefr \scriptfont\frfam=\sevenfr \scriptscriptfont\frfam=\fivefr%
\def\fr{\fam\frfam\ninefr}%
\textfont2=\ninesy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy%
\def\sy{\fam2\ninesy}%
\textfont\sffam=\ninesf \scriptfont\sffam=\sevensf \scriptscriptfont\sffam=\fivesf%
\def\sf{\fam\sffam\ninesf}%
\textfont\bbfam=\ninebb \scriptfont\bbfam=\sevenbb \scriptscriptfont\bbfam=\fivebb%
\def\bb{\fam\bbfam\ninebb}%
\textfont1=\ninemi \scriptfont1=\sevenmi \scriptscriptfont1=\fivemi%
\def\mi{\fam1\ninemi}%
\textfont\srfam=\ninesr \scriptfont\srfam=\sevensr \scriptscriptfont\srfam=\fivesr%
\def\sr{\fam\srfam\ninesr}%
}
\def\twelvepoint{%
\textfont6=\twelvebf \scriptfont6=\eightbf \scriptscriptfont6=\sixbf%
\def\bf{\fam6\twelvebf}%
\textfont0=\twelverm \scriptfont0=\eightrm \scriptscriptfont0=\sixrm%
\def\rm{\fam0\twelverm}%
\textfont4=\twelveit \scriptfont4=\eightit \scriptscriptfont4=\sixit%
\def\it{\fam4\twelveit}%
\textfont3=\twelveex \scriptfont3=\eightex \scriptscriptfont3=\sixex%
\def\ex{\fam3\twelveex}%
\textfont\frfam=\twelvefr \scriptfont\frfam=\eightfr \scriptscriptfont\frfam=\sixfr%
\def\fr{\fam\frfam\twelvefr}%
\textfont2=\twelvesy \scriptfont2=\eightsy \scriptscriptfont2=\sixsy%
\def\sy{\fam2\twelvesy}%
\textfont\sffam=\twelvesf \scriptfont\sffam=\eightsf \scriptscriptfont\sffam=\sixsf%
\def\sf{\fam\sffam\twelvesf}%
\textfont\bbfam=\twelvebb \scriptfont\bbfam=\eightbb \scriptscriptfont\bbfam=\sixbb%
\def\bb{\fam\bbfam\twelvebb}%
\textfont1=\twelvemi \scriptfont1=\eightmi \scriptscriptfont1=\sixmi%
\def\mi{\fam1\twelvemi}%
\textfont\srfam=\twelvesr \scriptfont\srfam=\eightsr \scriptscriptfont\srfam=\sixsr%
\def\sr{\fam\srfam\twelvesr}%
\def\cur{\fam\curfam\twelvecur}%
\def\isf{\fam\isffam\twelveisf}%
}
\def\fourteenpoint{%
\textfont6=\fourteenbf \scriptfont6=\tenbf \scriptscriptfont6=\eightbf%
\def\bf{\fam6\fourteenbf}%
\textfont0=\fourteenrm \scriptfont0=\tenrm \scriptscriptfont0=\eightrm%
\def\rm{\fam0\fourteenrm}%
\textfont4=\fourteenit \scriptfont4=\tenit \scriptscriptfont4=\eightit%
\def\it{\fam4\fourteenit}%
\textfont3=\fourteenex \scriptfont3=\tenex \scriptscriptfont3=\eightex%
\def\ex{\fam3\fourteenex}%
\textfont\frfam=\fourteenfr \scriptfont\frfam=\tenfr \scriptscriptfont\frfam=\eightfr%
\def\fr{\fam\frfam\fourteenfr}%
\textfont2=\fourteensy \scriptfont2=\tensy \scriptscriptfont2=\eightsy%
\def\sy{\fam2\fourteensy}%
\textfont\sffam=\fourteensf \scriptfont\sffam=\tensf \scriptscriptfont\sffam=\eightsf%
\def\sf{\fam\sffam\fourteensf}%
\textfont\bbfam=\fourteenbb \scriptfont\bbfam=\tenbb \scriptscriptfont\bbfam=\eightbb%
\def\bb{\fam\bbfam\fourteenbb}%
\textfont1=\fourteenmi \scriptfont1=\tenmi \scriptscriptfont1=\eightmi%
\def\mi{\fam1\fourteenmi}%
\textfont\srfam=\fourteensr \scriptfont\srfam=\tensr \scriptscriptfont\srfam=\eightsr%
\def\sr{\fam\srfam\fourteensr}%
\def\cur{\fam\curfam\fourteencur}%
\def\isf{\fam\isffam\fourteenisf}%
}
\def\eighteenpoint{%
\textfont6=\eighteenbf \scriptfont6=\twelvebf \scriptscriptfont6=\eightbf%
\def\bf{\fam6\eighteenbf}%
\textfont0=\eighteenrm \scriptfont0=\twelverm \scriptscriptfont0=\eightrm%
\def\rm{\fam0\eighteenrm}%
\textfont4=\eighteenit \scriptfont4=\twelveit \scriptscriptfont4=\eightit%
\def\it{\fam4\eighteenit}%
\textfont3=\eighteenex \scriptfont3=\twelveex \scriptscriptfont3=\eightex%
\def\ex{\fam3\eighteenex}%
\textfont\frfam=\eighteenfr \scriptfont\frfam=\twelvefr \scriptscriptfont\frfam=\eightfr%
\def\fr{\fam\frfam\eighteenfr}%
\textfont2=\eighteensy \scriptfont2=\twelvesy \scriptscriptfont2=\eightsy%
\def\sy{\fam2\eighteensy}%
\textfont\sffam=\eighteensf \scriptfont\sffam=\twelvesf \scriptscriptfont\sffam=\eightsf%
\def\sf{\fam\sffam\eighteensf}%
\textfont\bbfam=\eighteenbb \scriptfont\bbfam=\twelvebb \scriptscriptfont\bbfam=\eightbb%
\def\bb{\fam\bbfam\eighteenbb}%
\textfont1=\eighteenmi \scriptfont1=\twelvemi \scriptscriptfont1=\eightmi%
\def\mi{\fam1\eighteenmi}%
\textfont\srfam=\eighteensr \scriptfont\srfam=\twelvesr \scriptscriptfont\srfam=\eightsr%
\def\sr{\fam\srfam\eighteensr}%
\def\cur{\fam\curfam\eighteencur}%
\def\isf{\fam\isffam\eighteenisf}%
}
\def\twentyfourpoint{%
\textfont6=\twentyfourbf \scriptfont6=\fourteenbf \scriptscriptfont6=\ninebf%
\def\bf{\fam6\twentyfourbf}%
\textfont0=\twentyfourrm \scriptfont0=\fourteenrm \scriptscriptfont0=\ninerm%
\def\rm{\fam0\twentyfourrm}%
\textfont4=\twentyfourit \scriptfont4=\fourteenit \scriptscriptfont4=\nineit%
\def\it{\fam4\twentyfourit}%
\textfont3=\twentyfourex \scriptfont3=\fourteenex \scriptscriptfont3=\nineex%
\def\ex{\fam3\twentyfourex}%
\textfont\frfam=\twentyfourfr \scriptfont\frfam=\fourteenfr \scriptscriptfont\frfam=\ninefr%
\def\fr{\fam\frfam\twentyfourfr}%
\textfont2=\twentyfoursy \scriptfont2=\fourteensy \scriptscriptfont2=\ninesy%
\def\sy{\fam2\twentyfoursy}%
\textfont\sffam=\twentyfoursf \scriptfont\sffam=\fourteensf \scriptscriptfont\sffam=\ninesf%
\def\sf{\fam\sffam\twentyfoursf}%
\textfont\bbfam=\twentyfourbb \scriptfont\bbfam=\fourteenbb \scriptscriptfont\bbfam=\ninebb%
\def\bb{\fam\bbfam\twentyfourbb}%
\textfont1=\twentyfourmi \scriptfont1=\fourteenmi \scriptscriptfont1=\ninemi%
\def\mi{\fam1\twentyfourmi}%
\textfont\srfam=\twentyfoursr \scriptfont\srfam=\fourteensr \scriptscriptfont\srfam=\ninesr%
\def\sr{\fam\srfam\twentyfoursr}%
\def\cur{\fam\curfam\twentyfourcur}%
\def\isf{\fam\isffam\twentyfourisf}%
}
\def\sevenpoint{\def\rm{\sevenrm}%
\def\sf{\sevensf}%
\def\mi{\sevenmi}%
 }
\let\elevenpoint=\twelvepoint%


\tenpoint


\newcount\sectioncounter
\sectioncounter=0

\def\section#1{\advance\sectioncounter by1
\vskip20pt
%% \vfill %% \break   %%__EDIT__???
%% \vbox{
\hrule\vskip12pt
\centerline{\eighteenpoint\sf \the\sectioncounter. \isf #1} %%__EDIT__
%% }%% end of vbox
\vskip7pt
}

\newcount\toccounter     
\toccounter=0

\newcount\exercisecounter 
\toccounter=0

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\|{|\!|} %% for double bars...

\def\to{\rightarrow}
\def\kap{\kappa}

\def\adots{\mathinner{\mkern1mu\raise1pt\vbox{\kern7pt\hbox{.}}\mkern2mu\raise4pt\hbox{.}\mkern2mu\raise7pt\hbox{.}\mkern1mu}}

%% synax: \raise7pt\hbox{...}

\def\rule{\vskip10pt\hrule\vskip12pt}

\def\om{\omega}
\def\Om{\Omega}
\def\alf{\alpha}
 
\def\vol{{\rm vol}\,}

\def\eval#1{\bigl|_{#1}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\url{{\rm http://www.math.umn.edu/$\,\tilde{\,}$garrett/}}
\def\email{{\rm garrett@math.umn.edu}}

\def\r{{\bf r}}
\def\n{{\bf n}}
\def\i{{\bf i}}
\def\j{{\bf j}}
\def\k{{\bf k}}
\def\S{{\cal S}}                      %%__note__
\def\Dx{{\partial\over\partial x}}
\def\Dy{{\partial\over\partial y}}
\def\Dz{{\partial\over\partial z}}

\def\spt{{\rm spt}}

\def\curl{{\rm curl}}
\def\div{{\rm div}}

\def\clos{{\rm clos}} %% for closure
\def\J{{\bf J}}
\def\\{\backslash}    %% this is much more sensible...

\def\tr{{\rm tr}\,}

\def\meas{{\rm meas}\,}

\def\ba{\backslash}               %% superceded by "\\"
\def\rank{{\rm rank}\hskip1pt}
\def\rk{{\rm rk}\hskip1pt}
\def\im{{\rm Im}\hskip1pt}
\def\re{{\rm Re}\hskip1pt}

\def\defn{\noindent {\bf Definition: }}

\def\today{\ifcase\month\or January\or February\or March\or April\or
May\or
June\or July\or August\or September\or October\or November\or
December\fi
\space\number\day, \number\year}

\def\name{Paul Garrett}
\def\crt{\copyright \number\year{ }}

\def\arctan{{\rm arctan}\,}
\def\arcsin{{\rm arcsin}\,}

\def\mtset{\phi}
\def\id{\hbox{\bf 1}}
\def\two#1,#2,#3,#4.{\pmatrix{#1 & #2 \cr #3 & #4}}
\def\vtwo#1,#2{\pmatrix{#1 \cr #2 }}
\def\vthree#1,#2,#3{\pmatrix{#1 \cr #2 \cr #3}}
\def\three#1,#2,#3,#4,#5,#6,#7,#8,#9.{\pmatrix{#1 & #2 &#3 \cr #4 & #5 & #6
\cr #7 & #8 & #9}}

\def\th{^{\rm th}} % only for _inside_ math mode

%__.77ex is about right? or extra parameter

\def\boxit#1{\lower.77ex\hbox{\vbox{\hrule\hbox{\vrule\kern3pt
	\vbox{\kern3pt\hbox{#1}\kern3pt}\kern3pt\vrule}\hrule}}}

\def\lowerit#1#2{\lower#1ex\hbox{#2}}

% latter can be used as \boxit{$ simple math mode...$}
% but seems to fail if used as \boxit{$$ ... $$}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The following is extensive enough to do math in titles...
%
% Fontnames are used in "Medtype" and "Headtype" stuff...
%


\font\usualrm=cmr10
\font\usualit=cmti10
\font\usualei=cmmi10
\font\usualsy=cmsy10
\font\usualbf=cmbx10

\font\disprm=cmr10 at 12pt
\font\dispit=cmti10 at 12pt
\font\dispei=cmmi10 at 12pt
\font\dispsy=cmsy10 at 12pt
\font\dispbf=cmbx10 at 12pt

\def\disptype{%
\let\rm=\disprm%
\let\bf=\dispbf%
\let\it=\dispit%
\bf%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\font\headrm=cmr10 at 14pt
\font\headit=cmti10 at 14pt
\font\headei=cmmi10 at 14pt
\font\headsy=cmsy10 at 14pt
\font\headbf=cmbx10 at 14pt

\def\headtype{%
\textfont0=\headrm%
\scriptfont0=\disprm%
\textfont1=\headei%
\scriptfont1=\dispei%
\textfont2=\headsy%
\scriptfont2=\dispsy%
\textfont\itfam=\headit%
\textfont\bffam=\headbf%
\def\it{\fam\itfam\headit}%
\def\bf{\fam\bffam\headbf}%
\def\rm{\fam0\headrm}%
\bf}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\font\medrm=cmr10 at 16pt
\font\medit=cmti10 at 16pt
\font\medei=cmmi10 at 16pt
\font\medsy=cmsy10 at 16pt
\font\medbf=cmbx10 at 16pt

\def\medtype{%
\textfont0=\medrm%
\scriptfont0=\disprm%
\textfont1=\medei%
\scriptfont1=\dispei%
\textfont2=\medsy%
\scriptfont2=\dispsy%
\textfont\itfam=\medit%
\textfont\bffam=\medbf%
\def\it{\fam\itfam\medit}%
\def\bf{\fam\bffam\medbf}%
\def\rm{\fam0\medrm}%
\bf}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\font\bigfont=cmr10 at 18pt
\font\medfont=cmr10 at 14pt
\font\smallfont=cmr10 at 7pt

\font\bigitfont=cmti10 at 18pt
\font\meditfont=cmti10 at 14pt
\font\smallitfont=cmti10 at 7pt

\def\bull{\hfil\break{$\bullet\;$}}

\def\mp{\vskip14pt}
\def\bp{\bigskip}
\def\mn{\medskip\noindent}
\def\bn{\bigskip\noindent}

\def\ph{\varphi}
\def\eps{\varepsilon}
\def\Z {{\bf Z}}
\def\Q {{\bf Q}}
\def\R {{\bf R}}
\def\C {{\bf C}}
\def\F {{\bf F}}
\def\A {{\bf A}}
\def\K {{\bf K}}
\def\H {{\cal H}}
\def\N {{\cal N}}
%% \def\S {{\cal S}} %%%%%% hard to distinguish from roman 'S', anyway
\def\o {{\bf o}}
\def\O {{\cal O}}

\def\red{\;\%\;}
\def\mod{\;{\rm mod}\;}
\def\smod{\!-\!{\rm mod}\!-\!}
\def\cong{\equiv}

%% \countdef\mysectioncounter=101     %%__for sections
%% \mysectioncounter=0
%% 
%% \countdef\mysubsectioncounter=102     %%__for subsections
%% \mysubsectioncounter=0
%% 
%% \countdef\myexercisecounter=103          %%__for exercises
%% \myexercisecounter=0
%% 
%% \countdef\mytoccounter=104              %%__for TOC
%% \mytoccounter=0
%% 
%% \countdef\myproblemcounter=105           %%__for problems...
%% \myproblemcounter=0

%%__section__

%% \def\section#1{\vfill\eject\vfill
%% \hrule\vskip7pt\vskip12pt
%% \global\advance\mysectioncounter by 1
%% \global\mysubsectioncounter=0
%% \noindent{\centerline{\bigfont \the\mysectioncounter. { }#1}}
%% \vskip12pt                         %%__EDIT__\hrule\vskip12pt
%% }

%% \def\section#1{
%% \vskip7pt\hrule\vskip12pt
%% \centerline{\medtype #1}          %%__EDIT__ not "\medtype
%% \vskip3pt                          %%__EDIT__ not \vskip12pt
%% }


%%__subsection__

\def\subsection#1#2{\vfill\vskip10pt\hrule\vskip18pt %%__EDIT__??
\vbox{
\global\advance\mysubsectioncounter by 1
%\noindent{\medtype \the\mysectioncounter.\the\mysubsectioncounter { }#1}
\noindent{\medtype \the\mysubsectioncounter { }#1}
\vskip12pt
#2
}\medskip}

\def\subsubsection#1{\vskip10pt\noindent{\bf #1}\vskip8pt}

\def\moi{{\centerline\it Paul Garrett, garrett@math.umn.edu,
http://www.math.umn.edu/\~\hskip0pt garrett/}\bigskip}

\def\ord{{\rm ord}}

%%__exercise__

\def\ex{
\global\advance\exercisecounter by 1
\vfil\noindent{\bf \#\the\sectioncounter.\the\exercisecounter } %%__EDIT__??
}

%%__problem__

%% \def\problem{
%% \global\advance\problemcounter by 1
%% \vfil\noindent{\bf\#\the\problemcounter. }
%% }

%%__contents__

\def\cont{\noindent                     %%__make TOC
\global\advance\toccounter by 1
(\the\toccounter)\hskip3pt
}

\def\arr{\rightarrow}
\def\lcm{{\rm lcm}}
\def\li{{\rm li}}
\def\gcd{{\rm gcd}}

\def\qs#1#2{\left({#1 \over #2}\right)_2}      %%__quadratic symbol

\def\pf{\smallskip\noindent{\it Proof:\ }}
\def\prop{\smallskip\noindent{\bf Proposition:\ }}
\def\thm{\smallskip\noindent{\bf Theorem:\ }}
\def\cor{\smallskip\noindent{\bf Corollary:\ }}
\def\lemma{\smallskip\noindent{\bf Lemma:\ }}
\def\remark{\smallskip\noindent{\bf Remark:\ }}
\def\example{\smallskip\noindent{\bf Example:\ }}

\def\done{\hfill\hfill$\clubsuit$}      %%__{{\it Done.}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% The End
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




{\topskip=150pt

\centerline{\bigfont Calculus Refresher, version 2008.4}
\bigskip
\centerline{\it \copyright 1997-2008, Paul Garrett, garrett@math.umn.edu}
\centerline{\it http://www.math.umn.edu/\~{}garrett/}
}
\vfill
\eject
\noindent{\medfont Contents}\medskip

\cont Introduction  

\cont Inequalities 

\cont Domain of functions 

\cont Lines (and other items in Analytic Geometry) 

\cont Elementary limits 

\cont Limits with cancellation 

\cont Limits at infinity 

\cont Limits of exponential functions at infinity 

\cont The idea of the derivative of a function 

\cont Derivatives of polynomials 

\cont More general power functions 

\cont Quotient rule 

\cont Product Rule 

\cont Chain rule 

\cont Tangent and Normal Lines 

\cont Critical points, monotone increase and decrease 

\cont Minimization and Maximization 

\cont Local minima and maxima (First Derivative Test) 

\cont An algebra trick 

\cont Linear approximations: approximation by differentials 

\cont Implicit differentiation 

\cont Related rates 

\cont Intermediate Value Theorem, location of roots 

\cont Newton's method 

\cont Derivatives of transcendental functions 

\cont L'Hospital's rule 

\cont Exponential growth and decay: a differential equation 

\cont The second and higher derivatives 

\cont Inflection points, concavity upward and downward 

\cont Another differential equation: projectile motion 

\cont Graphing rational functions, asymptotes 

\cont Basic integration formulas 

\cont The simplest substitutions 

\cont Substitutions 

\cont Area and definite integrals 

\cont Lengths of Curves 

\cont Numerical integration 

\cont Averages and Weighted Averages 

\cont Centers of Mass (Centroids)  

\cont Volumes by Cross Sections 

\cont Solids of Revolution 

\cont Surfaces of Revolution 

\cont Integration by parts 

\cont Partial Fractions 

\cont Trigonometric Integrals 

\cont Trigonometric Substitutions 

\cont Historical and theoretical comments: Mean Value Theorem 

\cont Taylor polynomials: formulas 

\cont Classic examples of Taylor polynomials 

\cont Computational tricks regarding Taylor polynomials 

\cont Prototypes: More serious questions about Taylor polynomials 

\cont Determining Tolerance/Error 

\cont How large an interval with given tolerance? 

\cont Achieving desired tolerance on desired interval 

\cont Integrating Taylor polynomials: first example 

\cont Integrating the error term: example 

\vfill\eject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction }

The usual trouble that people have with `calculus' (not counting
general math phobias) is with {\bf algebra}, not to mention {\sl
arithmetic} and other more elementary things. 

\medskip Calculus itself just involves two new processes, {\sl
differentiation} and {\sl integration}, and {\sl applications} of
these new things to solution of problems that would have been
impossible otherwise.

\medskip Some things which were very important when calculators and
computers didn't exist are not so important now. Some things are just
as important. Some things are {\sl more} important. Some things are
important but with a different emphasis.

\medskip At the same time, the essential ideas of much of calculus can
be very well illustrated without using calculators at all! (Some not,
too).

\medskip Likewise, many essential ideas of calculus can
be very well illustrated without getting embroiled in awful algebra or
arithmetic, not to mention trigonometry.

\medskip At the same time, study of calculus makes clear how important
it is to be {\sl able} to do the necessary algebra and arithmetic,
whether by calculator or by hand.




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Inequalities}




It is worth reviewing some elementary but important points:

First, a person must remember that the {\it only} way for a product of
numbers to be {\it zero} is that one or more of the individual numbers
be zero. As silly as this may seem, it is indispensable.

Next, there is the collection of slogans:
 
\bull positive times positive is positive
\bull negative times negative is positive
\bull negative times positive is negative
\bull positive times negative is negative


Or, more cutely: the product of two numbers {\it of the same sign} is
{\it positive}, while the product of two numbers {\it of opposite
signs} is {\it negative}.

Extending this just a little: for a {\it product} of real numbers
to be {\it positive}, the number of {\it negative} ones must be {\it
even}. If the number of negative ones is {\it odd} then the product is
{\it negative}. And, of course, if there are any zeros, then the
product is zero.

{\it Solving inequalities:} This can be very hard in greatest
generality, but there are some kinds of problems that are very {\it
`do-able'}. One important class contains problems like {\it Solve:}
$$5(x-1)(x+4)(x-2)(x+3)<0$$
That is, we are asking where a {\it polynomial} is negative (or we
could ask where it's positive, too). One important point is that the
polynomial is {\it already factored:} to solve this problem we need to
have the polynomial factored, and if it isn't already factored this
can be a lot of additional work. There are many ways to {\it format}
the solution to such a problem, and we just choose {\it one}, which
does have the merit of being more efficient than many. 

We put the roots of the
polynomial 
$$P(x)=5(x-1)(x+4)(x-2)(x+3)=5\,(x-1)\,(x-(-4))\,(x-2)\,(x-(-3))$$ 
in order: in this case,
the roots are $1,-4,2,-3$, which we put in order (from left to right)
$$ \ldots < -4 <  -3 <  1 <  2 < \ldots$$
The roots of the polynomial $P$ break the numberline into the intervals
$$(-\infty,-4),\; (-4,-3),\; (-3,1) ,\; (1,2) ,\;
(2,+\infty)$$

On each of these intervals the polynomial is either positive
all the time, or negative all the time, since if it were positive at one
point and negative at another then it would have to be zero at some
intermediate point!

For input $x$ to the right (larger than) all the roots, all
the factors $x+4$, $x+3$, $x-1$, $x-2$ are positive, and the number
$5$ in front also happens to be positive. Therefore, on the interval
$(2,+\infty)$ the polynomial $P(x)$ is {\it positive}.

Next, moving {\it across} the root $2$ to the interval
$(1,2)$, we see that the factor $x-2$ changes sign from positive to
negative, while all the other factors $x-1$, $x+3$, and $x+4$ do {\it
not} change sign. (After all, if they would have done so, then they
would have had to be $0$ at some intermediate point, but they {\it
weren't}, since we know where they {\it are} zero...). Of course the
$5$ in front stays the same sign. Therefore, since the function was
{\it positive} on $(2,+\infty)$ and just one factor changed sign in
crossing over the point $2$, the function is {\it negative} on
$(1,2)$.

Similarly, moving {\it across} the root $1$ to the interval
$(-3,1)$, we see that the factor $x-1$ changes sign from positive to
negative, while all the other factors $x-2$, $x+3$, and $x+4$ do {\it
not} change sign. (After all, if they would have done so, then they
would have had to be $0$ at some intermediate point). The $5$ in front
stays the same sign. Therefore, since the function was {\it negative}
on $(1,2)$ and just one factor changed sign in crossing over the point
$1$, the function is {\it positive} on $(-3,1)$.

Similarly, moving {\it across} the root $-3$ to the interval
$(-4,-3)$, we see that the factor $x+3=x-(-3)$ changes sign from positive to
negative, while all the other factors $x-2$, $x-1$, and $x+4$ do {\it
not} change sign. (If they would have done so, then they
would have had to be $0$ at some intermediate point). The
$5$ in front stays the same sign. Therefore, since the function was
{\it positive} on $(-3,1)$ and just one factor changed sign in
crossing over the point $-3$, the function is {\it negative} on
$(-4,-3)$.

Last, moving {\it across} the root $-4$ to the interval
$(-\infty,-4)$, we see that the factor $x+4=x-(-4)$ changes sign from
positive to negative, while all the other factors $x-2$, $x-1$, and
$x+3$ do {\it not} change sign. (If they would have done so, then they
would have had to be $0$ at some intermediate point). The $5$ in front
stays the same sign. Therefore, since the function was {\it negative}
on $(-4,-3)$ and just one factor changed sign in crossing over the
point $-4$, the function is {\it positive} on $(-\infty,-4)$.

In summary, we have
$$P(x)=5(x-1)(x+4)(x-2)(x+3) > 0 \hbox{ on } (2,+\infty)$$
$$P(x)=5(x-1)(x+4)(x-2)(x+3) < 0 \hbox{ on } (1,2)$$
$$P(x)=5(x-1)(x+4)(x-2)(x+3) > 0 \hbox{ on } (-3,1)$$
$$P(x)=5(x-1)(x+4)(x-2)(x+3) < 0 \hbox{ on } (-4,-3)$$
$$P(x)=5(x-1)(x+4)(x-2)(x+3) > 0 \hbox{ on } (-\infty,-4)$$
In particular, $P(x)<0$ on the {\it union}
$$ (1,2) \cup (-4,-3)$$
of the intervals $(1,2)$ and $(-4,-3)$. That's it.


As another example, let's see on which intervals
$$P(x)=-3(1+x^2)(x^2-4)(x^2-2x+1)$$ is positive and and on which it's
negative. We have to factor it a bit more: recall that we have nice
facts
$$x^2-a^2=(x-a)\;(x+a)= (x-a)\;(x-(-a))$$
$$x^2-2ax+a^2=(x-a)\;(x-a)$$
so that we get
$$P(x)=-3(1+x^2)(x-2)(x+2)(x-1)(x-1)$$
It is important to note that the equation $x^2+1=0$ has no {\it real}
roots, since the square of any real number is non-negative. Thus, we
can't factor any further than this over the real numbers.
That is, the roots of $P$, in order, are 
$$-2< < 1 \hbox{ (twice!) }\;< 2 $$
These numbers break the real line up into the intervals
$$(-\infty,-2),\;(-2,1),\;(1,2),\;(2,+\infty)$$

For $x$ larger than all the roots (meaning $x>2$) all the
factors $x+2$, $x-1$, $x-1$, $x-2$ are {\it positive}, while the
factor of $-3$ in front is {\it negative}. Thus, on the interval
$(2,+\infty)$ $P(x)$ is {\it negative}.

Next, moving {\it across} the root $2$ to the interval
$(1,2)$, we see that the factor $x-2$ changes sign from positive to
negative, while all the other factors $1+x^2$, $(x-1)^2$, and $x+2$ do
{\it not} change sign. (After all, if they would have done so, then
they would have be $0$ at some intermediate point, but they {\it
aren't}). The $-3$ in front stays the same sign. Therefore, since the
function was {\it negative} on $(2,+\infty)$ and just one factor
changed sign in crossing over the point $2$, the function is {\it
positive} on $(1,2)$.

A {\it new feature} in this example is that the root $1$ occurs {\it
twice} in the factorization, so that crossing over the root $1$ from
the interval $(1,2)$ to the interval $(-2,1)$ really
means crossing over {\it two} roots. That is, {\it two} changes of
sign means {\it no} changes of sign, in effect. And the other factors
$(1+x^2)$, $x+2$, $x-2$ do not change sign, and the $-3$ does not
change sign, so since $P(x)$ was {\it positive} on $(1,2)$ it is {\it
still} positive on $(-2,1)$. (The rest of this example is the same as
the first example).

Again, the point is that each time a root of the polynomial
is {\it crossed over}, the polynomial changes sign. So if {\it two}
are crossed at once (if there is a double root) then there is really
{\it no} change in sign. If {\it three} roots are crossed at once,
then the effect is to {\it change} sign.

Generally, if an {\it even} number of roots are crossed-over, then
there is {\it no} change in sign, while if an {\it odd} number of
roots are crossed-over then there {\it is} a change in sign.


\vfill\break






\vskip15pt\hrule\vskip12pt

\ex Find the intervals on which $f(x)=x(x-1)(x+1)$ is
positive, and the intervals on which it is negative. 

\ex Find the intervals on which $f(x)=(3x-2)(x-1)(x+1)$ is
positive, and the intervals on which it is negative. 

\ex Find the intervals on which $f(x)=(3x-2)(3-x)(x+1)$ is
positive, and the intervals on which it is negative. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Domain of functions}




A {\bf function} $f$ is a {\it procedure} or {\it process} which
converts {\it input} to {\it output} in some way. A traditional
mathematics name for the input is {\it argument}, but this certainly
is confusing when compared with ordinary English usage.

The collection of all `legal' `reasonable' or `sensible' inputs is
called the {\bf domain} of the function. The collection of all
possible outputs is the {\bf range}. (Contrary to the impression some
books might give, it can be very difficult to figure out all possible
outputs!)

The question `What's the domain of this function?' is usually not what
it appears to be. For one thing, if we are being formal, then
a function hasn't even been {\it described} if its {\it domain}
hasn't been described!

What is really meant, usually, is something far less
mysterious. The question usually {\it really} is {\bf `What numbers
can be used as inputs to this function without anything bad
happening?'}.

For our purposes, `something bad happening' just refers to one of

\bull trying to take the square root of a negative number
\bull trying to take a logarithm of a negative number
\bull trying to divide by zero
\bull trying to find {\it arc-cosine} or {\it arc-sine} of a number
bigger than $1$ or less than $-1$
 

Of course, dividing by zero is the worst of these, but as
long as we insist that everything be {\it real} numbers (rather than
{\it complex} numbers) we can't do the other things either.

For example, what is the domain of the function
$$f(x)= \sqrt{x^2-1} \hbox {?}$$
Well, what could go wrong here? No division is indicated at all, so
there is no risk of dividing by $0$. But we are taking a square root,
so we must insist that $x^2-1\ge 0$ to avoid having complex numbers
come up. That is, a preliminary description of the `domain' of this
function is that it is the set of real numbers $x$ so that $x^2-1\ge
0$. 

But we can be clearer than this: we know how to solve such
inequalities. Often it's simplest to see what to {\it exclude} rather
than {\it include}: here we want to {\it exclude} from the domain any
numbers $x$ so that $x^2-1<0$ from the domain.

We recognize that we can factor 
$$x^2-1=(x-1)(x+1)=(x-1)\;(x-(-1))$$
This is negative exactly on the interval $(-1,1)$, so this is the
interval we must prohibit in order to have just the domain of the
function. That is, the domain is the union of two intervals:
$$(-\infty,-1] \cup [1,+\infty)$$






\vskip15pt\hrule\vskip12pt

\ex Find the domain of the function
$$f(x)={ x-2 \over x^2+x-2 }$$
That is, find the largest subset of the real line on which this
formula can be evaluated meaningfully.

\ex Find the domain of the function
$$f(x)={ x-2 \over \sqrt{x^2+x-2 }}$$

\ex Find the domain of the function
$$f(x)=\sqrt{x(x-1)(x+1)}$$

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Lines (and other items in Analytic Geometry)}





Let's review some basic {\bf analytic geometry:} {\it this is description
of geometric objects by numbers and by algebra.}

The first thing is that we have to pick a {\it special point}, the
{\bf origin}, from which we'll measure everything else. Then,
implicitly, we need to choose a unit of measure for distances, but
this is indeed usually only {\it implicit}, so we don't worry about it.

The second step is that {\bf points} are described by {\it
ordered pairs} of numbers: the first of the two numbers tells how far
to the {\it right} horizontally the point is from the {\it origin}
(and {\it negative} means go left instead of right), and the second of
the two numbers tells how far {\it up} from the origin the point is
(and {\it negative} means go down instead of up). The first number is
the {\bf horizontal coordinate} and the second is the {\bf vertical
coordinate}. The old-fashioned names {\it abscissa} and {\it ordinate}
also are used sometimes.

Often the horizontal coordinate is called the {\it
x-coordinate}, and often the vertical coordinate is called the {\it
y-coordinate}, but the letters $x,y$ can be used for many other
purposes as well, so {\it don't rely on this labelling!}

The next idea is that {\it an equation can describe a
curve}. It is important to be a little careful with use of language
here: for example, a correct assertion is 

{\it The set of points $(x,y)$ so that $x^2+y^2=1$ is a
circle}.

It is {\it not strictly correct} to say that $x^2+y^2=1$ {\it
is} a circle, mostly because {\it an equation is not a circle}, even
though it may {\it describe} a circle. And conceivably the $x,y$ might
be being used for something other than horizontal and vertical
coordinates. Still, very often the language is shortened so that the
phrase {\it `The set of points $(x,y)$ so that'} is omitted. Just be
careful.

The simplest curves are {\bf lines}. The main things to remember are:
 
\bull {\bf Slope} of a line is {\it rise over run}, meaning {\it
vertical change divided by horizontal change} (moving from left to
right in the usual coordinate system).
\bull The equation of a line passing through a point $(x_o,y_o)$ and
having slope $m$ 
can be written (in so-called {\bf point-slope form})
$$y=m(x-x_o)+y_o\;\;\;\;\;\hbox{or}\;\;\;\;\;y-y_o=m(x-x_o)$$
\bull 
The equation of the line passing through two points $(x_1,y_1),
(x_2,y_2)$ can be written (in so-called {\bf two-point form}) as
$$y={y_1-y_2\over x_1-x_2}(x-x_1)+y_1$$
\bull ...unless $x_1=x_2$, in which case the two points are aligned
vertically, and the line can't be written that way. Instead, the
description {\bf of a vertical line} through a point with horizontal
coordinate $x_1$ is just
$$x=x_1$$
 

Of course, the two-point form can be derived from the
point-slope form, since the slope $m$ of a line through two points  
$(x_1,y_1), (x_2,y_2)$ is that possibly irritating expression which
occurs above:
$$m={y_1-y_2\over x_1-x_2}$$

And now is maybe a good time to point out that there is
nothing sacred about the horizontal coordinate being called `$x$' and
the vertical coordinate `$y$'. Very {\it often} these {\it do} happen
to be the names, but it can be otherwise, so just pay attention.






\vskip15pt\hrule\vskip12pt

\ex Write the equation for the line passing through the two
points $(1,2)$ and $(3,8)$.

\ex Write the equation for the line passing through the two
points $(-1,2)$ and $(3,8)$.

\ex Write the equation for the line passing through the
point $(1,2)$ with slope $3$.

\ex Write the equation for the line passing through the
point $(11,-5)$ with slope $-1$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Elementary limits}





The idea of {\bf limit} is intended to be merely a slight extension of
our {\it intuition}. The so-called $\varepsilon,\delta$-definition was
invented after people had been doing calculus for hundreds of years,
in response to certain relatively pathological technical
difficulties. For quite a while, we will be entirely concerned with
situations in which we can either `directly' see the value of a limit
{\it by plugging the limit value in}, or where we {\it transform} the
expression into one where we {\it can} just plug in.

So long as we are dealing with functions no more complicated
than polynomials, most {\it limits} are easy to understand: for
example,

$$\lim_{x\rightarrow 3} 4x^2+3x-7= 4\cdot (3)^2+3\cdot(3)-7=38$$
$$\lim_{x\rightarrow 3} {4x^2+3x-7\over 2-x^2}= 
{4\cdot (3)^2+3\cdot(3)-7\over 2-(3)^2}={38\over -7}$$

The point is that we just substituted the `$3$' in and {\it nothing
bad happened}. This is the way people evaluated easy limits for
hundreds of years, and should always be the first thing a person does,
just to see what happens. 




\vskip15pt\hrule\vskip12pt

\ex   Find $\lim _{x\rightarrow 5} 2x^2-3x+4$.

\ex   Find $\lim _{x\rightarrow 2} { x+1 \over x^2+3 }$.

\ex   Find $\lim _{x\rightarrow 1} \sqrt{x+1}$.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Limits with cancellation}



But sometimes things `blow up' when the limit number is substituted:
$$\lim_{x\rightarrow 3} {x^2-9\over x-3}={0\over 0}\;\;?????$$
Ick. This is not good. However, in this example, as in {\it many}
examples, doing a bit of simplifying algebra first gets rid of the
factors in the numerator and denominator which cause them to vanish:
$$\lim_{x\rightarrow 3} {x^2-9\over x-3}=
\lim_{x\rightarrow 3} {(x-3)(x+3)\over x-3}=
\lim_{x\rightarrow 3} {(x+3)\over 1}={(3+3)\over 1}=6$$
Here at the very end we {\it did} just plug in, after all.

The lesson here is that some of those darn algebra tricks
(`identities') are helpful, after all. If you have a `bad' limit, {\it
always} look for some {\it cancellation} of factors in the numerator
and denominator. 

In fact, for hundreds of years people {\it only} evaluated limits
in this style! After all, human beings can't really execute infinite
limiting processes, and so on.





\vskip15pt\hrule\vskip12pt

\ex   Find $\lim _{x\rightarrow 2} { x-2 \over x^2-4 }$

\ex   Find $\lim _{x\rightarrow 3} { x^2-9 \over x-3 }$

\ex   Find $\lim _{x\rightarrow 3} { x^2 \over x-3 }$


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Limits at infinity}



Next, let's consider
$$\lim_{x\rightarrow \infty} {2x+3\over 5-x}$$
The hazard here is that $\infty$ is {\it not} a number that we can do
arithmetic with in the normal way. Don't even try it. So we {\it
can't} really just `plug in' $\infty$ to the expression to see what we
get.

On the other hand, what we really mean anyway is {\it not}
that $x$ `becomes infinite' in some {\it mystical} sense, but rather
that it just `gets larger and larger'. In this context, the crucial
observation is that, as $x$ gets larger and larger, $1/x$ gets smaller
and smaller (going to $0$). Thus, just based on what we want this all
to mean,
$$\lim_{x\rightarrow \infty} {1\over x}=0$$
$$\lim_{x\rightarrow \infty} {1\over x^2}=0$$
$$\lim_{x\rightarrow \infty} {1\over x^3}=0$$
and so on.

This is the essential idea for evaluating simple kinds of
limits as $x\rightarrow\infty$: rearrange the whole thing so that
everything is expressed in terms of $1/x$ instead of $x$, and then
realize that
$$\lim_{x\rightarrow \infty}\;\;\;\;\hbox{ is the same as
}\;\;\;\;\lim_{{1\over x}\rightarrow 0}$$

So, in the example above, divide numerator and denominator
both by {\it the largest power of $x$ appearing anywhere:}
$$\lim_{x\rightarrow \infty} {2x+3\over 5-x}=
\lim_{x\rightarrow \infty} {2+{3\over x} \over {5\over x}-1}=
\lim_{y\rightarrow 0} {2+3y\over 5y-1}={2+3\cdot 0\over 5\cdot
0-1}=-2$$

The point is that we called $1/x$ by a new name, `$y$', and
rewrote the original limit as $x\rightarrow \infty$ as a limit as
$y\rightarrow 0$. Since $0$ {\it is} a genuine number that we can do
arithmetic with, this brought us back to ordinary everyday
arithmetic. Of course, it was necessary to rewrite the thing we were
taking the limit of in terms of $1/x$ (renamed `$y$').

Notice that this is an example of a situation where we used
the letter `$y$' for something other than the name or value of the
vertical coordinate.





\vskip15pt\hrule\vskip12pt

\ex   Find $\lim _{x\rightarrow\infty} { x+1 \over x^2+3 }$.

\ex   Find $\lim _{x\rightarrow\infty} { x^2+3 \over x+1 }$. 

\ex   Find $\lim _{x\rightarrow\infty} { x^2+3 \over 3x^2+x+1 }$. 

\ex   Find $\lim _{x\rightarrow\infty} { 1-x^2 \over 5x^2+x+1 }$. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Limits of exponential functions at infinity}



It is important to appreciate the behavior of exponential functions as
the input to them becomes a large positive number, or a large negative
number. This behavior is different from the behavior of polynomials or
rational functions, which behave similarly for large inputs regardless
of whether the input is large {\it positive} or large {\it
negative}. By contrast, for exponential functions, the behavior is
radically different for large {\it positive} or large {\it negative}.

As a reminder and an explanation, let's remember that
exponential notation started out simply as an {\bf abbreviation}: for
positive integer $n$,
$$2^n = 2 \times 2 \times 2\times \ldots \times 2\;\;\;\;\;\hbox{ ($n$
factors) }$$
$$10^n = 10 \times 10 \times 10\times \ldots \times 10\;\;\;\;\;\hbox{ ($n$
factors) }$$
$$\left({1\over 2}\right)^n = \left({1\over 2}\right) \times
\left({1\over 2}\right) \times \left({1\over 2}\right)\times \ldots
\times \left({1\over 2}\right) \;\;\;\;\;\hbox{ ($n$
factors) }$$

From this idea it's not hard to understand the {\bf fundamental
properties of exponents} (they're not {\it laws} at all):
$$a^{m+n} = \underbrace{a\times a\times a\times \ldots \times a}_{m+n}\;\;\;\;\;\hbox{
($m+n$ factors)}$$
$$ = \underbrace{(a\times a\times a\times \ldots \times a)}_{m} \times 
\underbrace{(a\times a\times a\times \ldots \times a)}_{n}
 = a^m \times a^n$$
and also
$$a^{mn} = \underbrace{(a\times a\times a\times \ldots \times a)}_{mn}
= $$
$$ = \underbrace{
\underbrace{(a\times a\times a\times \ldots \times a)}_{m} \times
\ldots \times
\underbrace{(a\times a\times a\times \ldots \times a)}_{m}
}_n = (a^m)^n$$
at least for positive integers $m,n$. Even though we can only easily
see that these properties are true when the exponents are positive
integers, the {\it extended} notation is guaranteed (by its {\it
meaning}, not by {\it law}) to follow the same rules.

Use of {\it other} numbers in the exponent is something that
came later, and is also just an {\it abbreviation}, which happily
was {\it arranged} to match the more intuitive simpler version. For
example,
$$a^{-1} = {1\over a}$$
and (as consequences)
$$a^{-n} = a^{n\times(-1)} = (a^n)^{-1} = {1\over a^n}$$
(whether $n$ is positive or not). Just to check one example of
consistency with the properties above, notice that
$$a = a^1 = a^{(-1)\times (-1)} = {1\over a^{-1}} = {1\over 1/a} = a$$
This is not supposed to be surprising, but rather reassuring that we
won't reach false conclusions by such manipulations.

Also, fractional exponents fit into this scheme. For example
$$a^{1/2} = \sqrt{a}\;\;\;\;\;a^{1/3} = \sqrt[3]{a}$$
$$a^{1/4} = \sqrt[4]{a}\;\;\;\;\;a^{1/5} = \sqrt[5]{a}$$
This is {\it consistent} with earlier notation: the fundamental
property of the $n^{\rm th}$ root of a number is that its $n^{\rm th}$
power is the original number. We can check:
$$a = a^1 = (a^{1/n})^n = a$$
Again, this is not supposed to be a surprise, but rather a consistency
check.

Then for arbitrary {\it rational} exponents $m/n$ we can
maintain the same properties: first, the definition is just
$$a^{m/n} = (\sqrt[n]{a})^m$$

One hazard is that, if we want to have only real numbers (as
opposed to complex numbers) come up, then we should not try to take
square roots, $4^{\rm th}$ roots, $6^{\rm th}$ roots, or any {\it
even} order root of negative numbers.

For general {\it real} exponents $x$ we likewise should {\it not} try
to understand $a^x$ except for $a>0$ or we'll have to use complex
numbers (which wouldn't be so terrible). But the value of $a^x$ can
only be defined as a {\it limit}: let $r_1,r_2,\ldots$ be a sequence
of {\it rational} numbers approaching $x$, and define
$$a^x = \lim_i \;a^{r_i}$$
We would have to check that this definition does not accidentally
depend upon the sequence approaching $x$ (it doesn't), and that the same properties
still work (they do).

The number $e$ is not something that would come up in really
elementary mathematics, because its reason for existence is not really
elementary. Anyway, it's approximately
$$e = 2.71828182845905$$
but if this ever really mattered you'd have a calculator at your side,
hopefully.

With the definitions in mind it is easier to make sense of
questions about {\bf limits} of exponential functions. The two
companion issues are to evaluate
$$\lim_{x\rightarrow +\infty}\;a^x$$
$$\lim_{x\rightarrow -\infty}\;a^x$$
Since we are allowing the exponent $x$ to be {\it real}, we'd better
demand that $a$ be a {\it positive real} number (if we want to avoid
complex numbers, anyway). Then
$$\lim_{x\rightarrow +\infty}\;a^x = 
\left\{\matrix{
+\infty& \hbox{ if } & a>1 \cr 
1& \hbox{ if } & a=1 \cr 
0& \hbox{ if } & 0<a<1
}\right.$$
$$\lim_{x\rightarrow -\infty}\;a^x = 
\left\{\matrix{
0& \hbox{ if } & a>1 \cr 
1& \hbox{ if } & a=1 \cr 
+\infty& \hbox{ if } & 0<a<1
}\right.$$

To remember which is which, it is sufficient to use $2$ for
$a>1$ and ${1\over 2}$ for $0<a<1$, and just let $x$ run 
through positive integers as it goes to $+\infty$. Likewise, it is
sufficient to use $2$ for $a>1$ and ${1\over 2}$ for $0<a<1$,
and just let $x$ run through negative integers as it goes to
$-\infty$.





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The idea of the derivative of a function}



First we can tell what the {\it idea} of a derivative is. But the
issue of {\it computing} derivatives is another thing entirely: a
person can understand the {\it idea} without being able to effectively
{\it compute}, and vice-versa.

Suppose that $f$ is a function of interest for some reason. We can
give $f$ some sort of `geometric life' by thinking about {\it the set
of points $(x,y)$ so that}
$$f(x)=y$$
We would say that this describes a {\it curve} in the $(x,y)$-plane.
(And sometimes we think of $x$ as `moving' from left to right,
imparting further intuitive or physical content to the story).

For some particular number $x_o$, let $y_o$ be the value
$f(x_o)$ obtained as output by plugging $x_o$ into $f$ as input. Then
the point $(x_o,y_o)$ is a point on our curve. The {\bf tangent line}
to the curve {\bf at} the point $(x_o,y_o)$ is a line passing through
$(x_o,y_o)$ and `flat against' the curve. (As opposed to {\it crossing
it at some definite angle}).

The {\it idea} of the derivative $f'(x_o)$ is that it is {\it
the slope of the tangent line} at $x_o$ to the curve. But this isn't
the way to {\it compute} these things...





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Derivatives of polynomials}



There are just four simple facts which suffice to take the derivative
of any polynomial, and actually of somewhat more general
things. 

First, there is the rule for taking the derivative of a {\bf
power function} which takes the $n$th power of its input. That is,
these functions are functions of the form $f(x)=x^n$. The formula is
$${d\over dx}x^n=n\,x^{n-1}$$
That is, the exponent comes down to become a coefficient in front of
the thing, and the exponent is decreased by $1$.

The second rule, which is really a special case of this power-function
rule, is that {\it  derivatives of constants are zero}:
$${d\over dx}\,c=0$$
for any constant $c$.

The third thing, which reflects the innocuous role of constants in
calculus, is that for {\it  any} functions $f$ of $x$
$$\;\;{d\over dx}\,c\cdot f=c\cdot\,{d\over dx}\,f$$
The fourth is that for {\it  any} two functions $f,g$ of $x$, {\it  the
derivative of the sum is the sum of the derivatives}:
$${d\over dx}(f+g)={d\over dx}f+{d\over dx}g$$

Putting these four things together, we can write general formulas like
$${d\over dx}(ax^m+bx^n+cx^p)=a\cdot mx^{m-1}+b\cdot nx^{n-1}+
c\cdot px^{p-1}$$
and so on, with more summands than just the three, if so desired. And
in any case here are some examples with numbers instead of letters:

$${d\over dx}5x^3=5\cdot 3x^{3-1}=15x^2$$

$${d\over dx}(3x^7+5x^3-11)=
3\cdot7x^6+5\cdot 3x^2-0=21x^6+15x^2$$

$${d\over dx}(2-3x^2-2x^3)=0-3\cdot 2x-2\cdot 3x^2=-6x-6x^2$$

$${d\over dx}(-x^4+2x^5+ 1)=-4x^3+2\cdot 5x^4+0=-4x^3+10x^4$$

Even if you do catch on to this idea right away, it is wise to
practice the {\it  technique} so that not only can you do it {\it  in
principle}, but also {\it  in practice}. 





\vskip15pt\hrule\vskip12pt

\ex   Find ${ d \over dx }(3x^7+5x^3-11)$

\ex   Find ${ d \over dx }(x^2+5x^3+2 )$

\ex   Find ${ d \over dx }(-x^4+2x^5+ 1)$

\ex   Find ${ d \over dx }(-3x^2-x^3-11)$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{More general power functions}



It's important to remember some of the other possibilities for the
exponential notation $x^n$. For example
$$x^{{1\over 2}}=\sqrt{x}$$
$$x^{-1}={1\over x}$$
$$x^{-{1\over 2}}={ 1 \over \sqrt{x }}$$
and so on. The good news is that the rule given just above for taking
the derivative of powers of $x$ still is correct here, even for
exponents which are negative or fractions or even real numbers:

$$ {d\over dx}x^r=r\,x^{r-1}$$
Thus, in particular,
$${d\over dx}\sqrt{x}=
{d\over dx}x^{{1\over 2}}={1\over 2}x^{-{1\over 2}}$$
$${d\over dx}{1\over x}={d\over dx}x^{-1}=-1\cdot
x^{-2}={-1\over x^2}$$
When combined with the sum rule and so on from above, we have the
obvious possibilities:

$${d\over dx}(3x^2-7\sqrt{x}+{5\over x^2}=
{d\over dx}(3x^2-7x^{{1\over 2}}+5x^{-2})=
6x-{7\over 2}x^{-{1\over 2}}-10x^{-3}$$

The possibility of expressing square roots, cube roots, inverses,
etc., in terms of exponents is a very important idea in algebra, and
can't be overlooked.





\vskip15pt\hrule\vskip12pt


\ex   Find ${ d \over dx }(3x^7+5\sqrt{x}-11)$

\ex   Find ${ d \over dx }( {2\over x} + 5{\root 3 \of x} + 3)$

\ex   Find ${ d \over dx }( 7 - {5\over x^3} + 5x^7)$


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Quotient rule}



The quotient rule is one of the more irritating and goofy things in
elementary calculus, but it just couldn't have been any other way. The
general principle is
$${d\over dx}\left({f\over g}\right)={f'g-g'f\over g^2}$$
The main hazard is remembering that the numerator is as it is, rather
than accidentally reversing the roles of $f$ and $g$, and then being
off by $\pm$, which could be fatal in real life.

$${d\over dx}\left({1\over x-2}\right)=
{{d\over dx}1\cdot(x-2)-1\cdot{d\over dx}(x-2) \over (x-2)^2}=
{0\cdot (x-2)-1\cdot 1\over (x-2)^2}={-1\over (x-2)^2}$$

$${d\over dx}\left({x-1\over x-2}\right)=
{(x-1)'(x-2)-(x-1)(x-2)'\over (x-2)^2}=
{1\cdot(x-2)-(x-1)\cdot 1\over (x-2)^2}$$
$$=
{(x-2)-(x-1)\over (x-2)^2}=
{-1\over (x-2)^2}$$

$${d\over dx}\left({5x^3+x\over 2-x^7}\right)=
{(5x^3+x)'\cdot(2-x^7)-(5x^3+x)\cdot(2-x^7)\over (2-x^7)^2}$$
$$=
{(15x^2+1)\cdot(2-x^7)-(5x^3+x)\cdot(-7x^6)\over (2-x^7)^2}$$
and there's hardly any point in simplifying the last expression,
unless someone gives you a good reason. In general, it's not so easy
to see how much may or may not be gained in `simplifying', and we
won't make ourselves crazy over it.





\vskip15pt\hrule\vskip12pt

\ex   Find ${ d \over dx }({ x-1 \over x-2 })$

\ex   Find ${ d \over dx }({ 1 \over x-2 })$

\ex   Find ${ d \over dx }({ \sqrt{x}-1 \over x^2-5 })$

\ex   Find ${ d \over dx }({ 1-x^3 \over 2 + \sqrt{x} })$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Product Rule}



Not only will the {\it  product rule} be of use in general and later
on, but it's already helpful in perhaps unexpected ways in dealing
with polynomials. Anyway, the general rule is
$${d\over dx}(fg)=f'g+fg'$$
While this is certainly not as awful as the quotient rule just above,
it is not as simple as the rule for sums, which was the good-sounding
slogan that {\it  the derivative of the sum is the sum of the
derivatives}. It is {\it  not} true that the derivative of the product
is the product of the derivatives. Too bad. Still, it's not as bad as
the quotient rule.

One way that the product rule can be useful is in postponing or
eliminating a lot of algebra. For example, to evaluate
$${d\over dx}\left((x^3+x^2+x+1)(x^4+x^3+2x+1)\right)$$
we {\it  could} multiply out and then take the derivative term-by-term
as we did with several polynomials above. This would be at least
mildly irritating because we'd have to do a bit of algebra. Rather,
just apply the product rule {\it  without} feeling compelled first to
do any algebra:
$${d\over dx}\left((x^3+x^2+x+1)(x^4+x^3+2x+1)\right)$$
$$=(x^3+x^2+x+1)'(x^4+x^3+2x+1)+(x^3+x^2+x+1)(x^4+x^3+2x+1)'$$
$$=(3x^2+2x+1)(x^4+x^3+2x+1)+(x^3+x^2+x+1)(4x^3+3x^2+2)$$
Now if we were somehow still obliged to multiply out, then we'd still
have to do some algebra. But {\it  we can take the derivative without
multiplying out}, if we want to, by using the product rule.

For that matter, once we see that there is a {\it  choice} about doing
algebra either {\it  before} or {\it  after} we take the derivative, it
might be possible to make a choice which minimizes our computational
labor. This could matter. 





\vskip15pt\hrule\vskip12pt

\ex   Find ${ d \over dx }(x^3-1)(x^6+x^3+1))$

\ex  Find ${ d \over dx }(x^2+x+1)(x^4-x^2+1)$.

\ex   Find ${ d \over dx }(x^3+x^2+x+1)(x^4+x^2+1))$

\ex   Find ${ d \over dx }(x^3+x^2+x+1)(2x + \sqrt{x}))$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Chain rule}



The {\it  chain rule} is subtler than the previous rules, so if it {\it 
seems} trickier to you, then you're right. OK. But it is absolutely
indispensable in general and later, and already is very helpful in
dealing with polynomials. 

The general assertion may be a little hard to fathom because it is of
a different nature than the previous ones. For one thing, now we will
be talking about a {\it  composite function} instead of just adding or
multiplying functions in a more ordinary way. So, for two functions
$f$ and $g$,
$${d\over dx}\left((f(g(x))\right)=f'(g(x))\cdot g'(x)$$
There is also the standard notation
$$(f\circ g)(x)=f(g(x))$$
for this {\it  composite function}, but using this notation doesn't accomplish so very much.

A problem in successful use of the chain rule is that often it
requires a little thought to recognize that some formula {\it  is} (or
can be {\it  looked at as}) a composite function. And the very nature
of the chain rule picks on weaknesses in our understanding of the
notation. For example, the function 

$$F(x)=(1+x^2)^{100}$$
is really obtained by {\it  first} using $x$ as input to the function
which {\it  squares and adds $1$} to its input. Then the result of that
is used as input to the function which {\it  takes the $100$th
power}. It is necessary to think about it this way or we'll make a
mistake. The derivative is evaluated as
$${d\over dx}(1+x^2)^{100}=100(1+x^2)^{99}\cdot 2x$$

To see that this is a special case of the general formula, we need to
see what corresponds to the $f$ and $g$ in the general
formula. Specifically, let
$$f(\hbox{input})=(\hbox{input})^{100}$$
$$g(\hbox{input})=1+(\hbox{input})^2$$
The reason for writing `input' and not `x' for the moment is to avoid
a certain kind of mistake. But we can compute that
$$f'(\hbox{input})=100(\hbox{input})^{99}$$
$$g'(\hbox{input})=2(\hbox{input})$$
The hazard here is that {\it  the input to $f$ is not $x$, but rather
is $g(x)$}. So the general formula gives
$${d\over dx}(1+x^2)^{100}=f'(g(x))\cdot g'(x)=100g(x)^{99}\cdot 2x=
100(1+x^2)^{99}\cdot 2x$$

More examples:
$${d\over dx}\sqrt{3x+2}={d\over dx}(3x+2)^{1/2}=
{1\over 2}(3x+2)^{-1/2}\cdot 3$$

$${d\over dx}(3x^5-x+14)^{11}=11(3x^5-x+14)^{10}\cdot(15x^4-1)$$

It is very important to recognize situations like
$${d\over dx}(ax+b)^n=n(ax+b)^{n-1}\cdot a$$
for any constants $a,b,n$. And, of course, this includes
$${d\over dx}\sqrt{ax+b}={1\over 2}(ax+b)^{-1/2}\cdot a$$
$${d\over dx}{1\over ax+b}=-(ax+b)^{-2}\cdot a={-a\over (ax+b)^2}$$

Of course, this idea can be combined with polynomials, quotients, and
products to give enormous and excruciating things where we need to use
the chain rule, the quotient rule, the product rule, etc., and
possibly several times each. But this is not {\it  hard}, merely {\it 
tedious}, since the only things we really do come in small steps. For
example:

$${d\over dx}\left({1+\sqrt{x+2} \over (1+7x)^{33}}\right)=
{(1+\sqrt{x+2})'\cdot (1+7x)^{33}
-(1+\sqrt{x+2})\cdot((1+7x)^{33})' \over ((1+7x)^{33})^2}$$
by the quotient rule, which is then

$${({1\over 2}(x+2)^{-1/2})\cdot (1+7x)^{33}
-(1+\sqrt{x+2})\cdot((1+7x)^{33})' \over ((1+7x)^{33})^2}$$
because our observations just above ({\it  chain rule!}) tell us that 
$${d\over dx}\sqrt{x+2}={1\over 2}(x+2)^{-1/2}\cdot
(x+2)' ={1\over 2}(x+2)^{-1/2}$$ 
Then we use the chain rule {\it  again} to take the derivative of that
big power of $1+7x$, so the whole thing becomes

$${({1\over 2}(x+2)^{-1/2})\cdot (1+7x)^{33}
-(1+\sqrt{x+2})\cdot(33(1+7x)^{32}\cdot 7) \over ((1+7x)^{33})^2}$$

Although we {\it  could} simplify a bit here, let's not. The point
about having to do several things in a row to take a derivative is
pretty clear without doing algebra just now.





\vskip15pt\hrule\vskip12pt


\ex Find ${ d \over dx }((1-x^2)^{100})$

\ex Find ${ d \over dx }\sqrt{x-3}$

\ex Find ${ d \over dx }(x^2-\sqrt{x^2-3})$

\ex Find ${ d \over dx }(\sqrt{x^2+x+1})$

\ex Find ${ d \over dx }({\root 3 \of {x^3+x^2+x+1}})$

\ex Find ${ d \over dx }((x^3 + \sqrt{x+1})^{10})$


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Tangent and Normal Lines}



One fundamental interpretation of the derivative of a function is that
it is the {\it  slope of the tangent line} to the graph of the
function. (Still, it is important to realize that this is {\it  not
the definition} of the thing, and that there are other possible and
important interpretations as well).

The precise statement of this fundamental idea is as follows. Let $f$
be a function. For each {\it  fixed} value $x_o$ of the input to $f$, the
value $f'(x_o)$ of the derivative $f'$ of $f$ {\it  evaluated at $x_o$} is
the slope of the tangent line to the graph of $f$ {\it  at the
particular point $(x_o,f(x_o))$ on the graph}.

Recall the {\it  point-slope form} of a line with slope $m$ through a
point $(x_o,y_o)$:
$$y-y_o=m(x-x_o)$$
In the present context, the slope is $f'(x_o)$ and the point is
$(x_o,f(x_o))$, so {\it  the equation of the tangent line to the graph
of $f$ at $(x_o,f(x_o))$ is}
$$y-f(x_o)=f'(x_o)(x-x_o)$$

The {\bf normal line} to a curve at a particular point is the line
through that point and {\it  perpendicular} to the tangent. A person
might remember from analytic geometry that the slope of any line {\it 
perpendicular to} a line with slope $m$ is the {\it  negative
reciprocal} $-1/m$. Thus, just changing this aspect of the equation
for the tangent line, we can say generally that {\it  the equation of
the normal line to the graph 
of $f$ at $(x_o,f(x_o))$ is}
$$y-f(x_o)={-1\over f'(x_o)}(x-x_o)$$

The main conceptual hazard is to mistakenly name the {\it  fixed} point
`$x$', as well as naming the {\it  variable} coordinate on the tangent
line `$x$'. This causes a person to write down some equation which,
whatever it may be, is {\it  not} the equation of a line at all.

Another popular boo-boo is to forget the subtraction $-f(x_o)$ on the
left hand side. Don't do it.

So, as the simplest example: let's write the equation for the tangent
line to the curve $y=x^2$ at the point where $x=3$. The derivative of
the function is $y'=2x$, which has value $2\cdot 3=6$ when $x=3$. And
the value of the function is $3\cdot 3=9$ when $x=3$. Thus, the
{\it  tangent line} at that point is $$y-9=6(x-3)$$ The {\it  normal
line} at the point where $x=3$ is
$$y-9={-1\over 6}(x-3)$$

So the question of finding the tangent and normal lines at various
points of the graph of a function is just a combination of the two
processes: computing the derivative at the point in question, and
invoking the point-slope form of the equation for a straight line.





\vskip15pt\hrule\vskip12pt

\ex Write the equation for both the {\it tangent line} and
{\it normal line} to the curve $y=3x^2-x+1$ at the point where $x=1$.

\ex Write the equation for both the {\it tangent line} and
{\it normal line} to the curve $y=(x-1)/(x+1)$ at the point where $x=0$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Critical points, monotone increase and decrease}



A function is called {\bf increasing} if it increases as the input $x$
moves from left to right, and is called {\bf decreasing} if it
decreases as $x$ moves from left to right. Of course, a function can
be increasing in some places and decreasing in others: that's the
complication.

We can notice that a function is increasing if the slope of its
tangent is positive, and decreasing if the slope of its tangent is
negative. Continuing with the idea that the slope of the tangent is the
derivative: {\it  a function is increasing where its derivative is
positive, and is decreasing where its derivative is negative}.

This is a great principle, because we don't have to graph the function
or otherwise list lots of values to figure out where it's increasing
and decreasing. If anything, it should be a big help in graphing to
know in advance where the graph goes up and where it goes down.

And the points where the tangent line is horizontal, that is, where
the derivative is zero, are {\bf critical points}. The points where
the graph has a {\it  peak} or a {\it  trough} will certainly lie among
the critical points, although there are other possibilities for
critical points, as well.

Further, for the kind of functions we'll deal with here, there is a
fairly systematic way to get all this information: to find the
intervals of increase and decrease of a function $f$:



\bull Compute the derivative $f'$ of $f$, and {\it  solve} the equation
$f'(x)=0$ for $x$ to find all the critical points, which we list in
order as $x_1
<x_2
<\ldots
<x_n$. 

\bull (If there are points of discontinuity
or non-differentiability, these points should be added to the list!
But points of discontinuity or non-differentiability are {\it not}
called {\it critical points}.)

\bull We need some {\it  auxiliary points}: To the left of the leftmost
critical point $x_1$ pick any convenient point $t_o$, between each pair of
consecutive critical points $x_i,x_{i+1}$ choose any convenient point
$t_i$, and to the right of the rightmost critical point $x_n$ choose a
convenient point $t_n$. 

\bull Evaluate the {\it  derivative} $f'$ at all the {\it  auxiliary}
points $t_i$. 

\bull Conclusion: if $f'(t_{i+1})>0$, then $f$ is {\it  increasing} on
$(x_i,x_{i+1})$, while if $f'(t_{i+1})
<0$, then $f$ is {\it  decreasing} on
that interval.

\bull Conclusion: on the `outside' interval $(-\infty,x_o)$, the
function $f$ is {\it  increasing} if $f'(t_o)>0$ and is {\it 
decreasing} if $f'(t_o)
<0$. Similarly, on $(x_n,\infty)$, the
function $f$ is {\it  increasing} if $f'(t_n)>0$ and is {\it 
decreasing} if $f'(t_n)
<0$.



It is certainly true that there are many possible shortcuts to this
procedure, especially for polynomials of low degree or other rather
special functions. However, if you are able to quickly compute values
of (derivatives of!) functions on your calculator, you may as well use
this procedure as any other.

Exactly which {\it  auxiliary points} we choose does not matter, as
long as they fall in the correct intervals, since we just need a
single sample on each interval to find out whether $f'$ is positive or
negative there. Usually we pick integers or some other kind of number
to make computation of the derivative there as easy as possible.

It's important to realize that even if a question does not directly
ask for {\it  critical points}, and maybe does not ask about {\it 
intervals} either, still it is {\it  implicit} that we have to find the
critical points and see whether the functions is increasing or
decreasing on the {\it  intervals between critical points}. Examples:

Find the critical points and intervals on which
$f(x)=x^2+2x+9$ is increasing and decreasing: Compute
$f'(x)=2x+2$. Solve $2x+2=0$ to find only one critical point $-1$. To
the left of $-1$ let's use the {\it  auxiliary point} $t_o=-2$ and to
the right use $t_1=0$. Then $f'(-2)=-2
<0$, so $f$ is {\it  decreasing}
on the interval $(-\infty,-1)$. And $f'(0)=2>0$, so $f$ is {\it 
increasing} on the interval $(-1,\infty)$.

Find the critical points and intervals on which
$f(x)=x^3-12x+3$ is increasing, decreasing. Compute
$f'(x)=3x^2-12$. Solve $3x^2-12=0$: this simplifies to $x^2-4=0$, so
the {\it  critical points} are $\pm 2$. To the left of $-2$ choose {\it 
auxiliary point} $t_o=-3$, between $-2$ and $=2$ choose auxiliary
point $t_1=0$, and to the right of $+2$ choose $t_2=3$. Plugging in
the auxiliary points to the derivative, we find that $f'(-3)=27-12>0$,
so $f$ is {\it  increasing} on $(-\infty,-2)$. Since $f'(0)=-12
<0$, $f$
is {\it  decreasing} on $(-2,+2)$, and since $f'(3)=27-12>0$, $f$ is
{\it  increasing} on $(2,\infty)$.

Notice too that we don't really need to know the exact value of the
derivative at the auxiliary points: all we care about is whether the
derivative is positive or negative. The point is that sometimes some
tedious computation can be avoided by stopping as soon as it becomes
clear whether the derivative is positive or negative.





\vskip15pt\hrule\vskip12pt

\ex Find the critical points and intervals on which
$f(x)=x^2+2x+9$ is increasing, decreasing. 

\ex Find the critical points and intervals on which
$f(x)=3x^2-6x+7$ is increasing, decreasing.

\ex Find the critical points and intervals on which
$f(x)=x^3-12x+3$ is increasing, decreasing.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Minimization and Maximization}




The fundamental idea which makes calculus useful in understanding
problems of maximizing and minimizing things is that at a {\it  peak}
of the graph of a function, or at the bottom of a {\it  trough}, the
tangent is {\it  horizontal}. That is, {\it  the derivative $f'(x_o)$ is
$0$ at points $x_o$ at which $f(x_o)$ is a maximum or a minimum}.

Well, a little sharpening of this is necessary: sometimes for either
natural or artificial reasons the variable $x$ is restricted to some
interval $[a,b]$. In that case, we can say that {\it  the maximum and
minimum values of $f$ on the interval $[a,b]$ occur among the list of
critical points and endpoints of the interval}.

And, if there are points where $f$ is not differentiable, or is
discontinuous, then these have to be added in, too. But let's stick
with the basic idea, and just ignore some of these complications.

Let's describe a systematic procedure to find the minimum and maximum
values of a function $f$ on an interval $[a,b]$.

\bull Solve $f'(x)=0$ to find the list of critical points of $f$.
\bull Exclude any critical points not inside the interval $[a,b]$.
\bull Add to the list the {\it endpoints} $a,b$ of the interval (and
any points of discontinuity or non-differentiability!) 
\bull At each point on the list, evaluate the function $f$: the
biggest number that occurs is the maximum, and the littlest number
that occurs is the minimum.


Find the minima and maxima of the
function $f(x)=x^4-8x^2+5$ on the interval $[-1,3]$. First, take the
derivative and set it equal to zero to solve for critical points: this
is
$$4x^3-16x=0$$
or, more simply, dividing by $4$, it is $x^3-4x=0$. Luckily, we
can see how to factor this: it is
$$x(x-2)(x+2)$$
So the critical points are $-2,0,+2$. Since the interval does not
include $-2$, we drop it from our list. And we {\it  add} to the list
the endpoints $-1,3$. So the list of numbers to consider as potential
spots for minima and maxima are $-1,0,2,3$. Plugging these numbers
into the function, we get (in that order) $-2, 5, -11, 14$. Therefore,
the maximum is $14$, which occurs at $x=3$, and the minimum is $-11$,
which occurs at $x=2$.

Notice that in the previous example the maximum did not occur
at a critical point, but by coincidence did occur at an endpoint.

You have $200$ feet of fencing with which you
wish to enclose the largest possible rectangular garden.  What is
the largest garden you can have? 

Let $x$ be the length of the garden, and $y$ the width. Then the area
is simply $xy$. Since the perimeter is $200$, we know that
$2x+2y=200$, which we can solve to express $y$ as a function of $x$:
we find that $y=100-x$. Now we can rewrite the area as a function of
$x$ alone, which sets us up to execute our procedure:
$$area = xy=x(100-x)$$
The derivative of this function with respect to $x$ is
$100-2x$. Setting this equal to $0$ gives the equation
$$100-2x=0$$
to solve for critical points: we find just {\it  one}, namely
$x=50$. 

Now what about endpoints? What is the interval? In this example we
must look at `physical' considerations to figure out what interval $x$
is restricted to. Certainly a {\it  width} must be a positive number,
so $x>0$ and $y>0$. Since $y=100-x$, the inequality on $y$ gives
another inequality on $x$, namely that $x
<100$. So $x$ is in
$[0,100]$. 

When we plug the values $0,50,100$ into the function $x(100-x)$, we
get $0,2500,0$, in that order. Thus, the corresponding value of $y$ is
$100-50=50$, and the maximal possible area is $50\cdot 50=2500$.







\vskip15pt\hrule\vskip12pt

\ex   Olivia has $200$ feet of fencing with which she
wishes to enclose the largest possible rectangular garden.  What is
the largest garden she can have? 

\ex Find the minima and maxima of the function
$f(x)=3x^4-4x^3+5$ on the interval $[-2,3]$.

\ex The cost per hour of fuel to run a locomotive is
$v^2/25$ dollars, where $v$ is speed, and other costs are \$100 per
hour regardless of speed. What is the speed that minimizes cost {\it
per mile}?

\ex The product of two numbers $x,y$ is 16. We know $x\geq
1$ and $y\geq 1$. What is the greatest
 possible sum of the two numbers?

\ex   Find both the minimum and the maximum of the
function $f(x)=x^3+3x+1$ on the interval $[-2,2]$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Local minima and maxima (First Derivative Test)}



A function $f$ has a {\bf local maximum} or {\bf relative maximum} at
a point $x_o$ if the values $f(x)$ of $f$ for $x$ `near' $x_o$ are all
less than $f(x_o)$. Thus, the graph of $f$ near $x_o$ has a {\it  peak}
at $x_o$.
A function $f$ has a {\bf local minimum} or {\bf relative minimum} at
a point $x_o$ if the values $f(x)$ of $f$ for $x$ `near' $x_o$ are all
greater than $f(x_o)$. Thus, the graph of $f$ near $x_o$ has a {\it 
trough} at $x_o$.
(To make the distinction clear, sometimes the `plain' maximum and
minimum are called {\bf absolute} maximum and minimum.)

Yes, in both these `definitions' we are tolerating ambiguity about
what `near' would mean, although the peak/trough requirement on the
graph could be translated into a less ambiguous definition. But in any
case we'll be able to execute the procedure given below to {\it  find}
local maxima and minima without worrying over a formal definition.

{\it  This procedure is just a variant of things we've already done to
analyze the intervals of increase and decrease of a function, or to
find absolute maxima and minima.} This procedure starts out the same
way as does the analysis of intervals of increase/decrease, and also
the procedure for finding (`absolute') maxima and minima of functions.

To find the local maxima and minima of a function $f$ on an interval
$[a,b]$:

\bull Solve $f'(x)=0$ to find {\it  critical points} of
$f$. 
\bull Drop from the list any critical points that aren't in the
interval $[a,b]$.
\bull Add to the list the endpoints (and any points of discontinuity
or non-differentiability): we have an {\it  ordered} list of special
points in the interval:
$$a=x_o
<x_1
<\ldots
<x_n=b$$
\bull Between each pair $x_i
<x_{i+1}$ of points in the list, choose an
auxiliary point $t_{i+1}$. Evaluate the {\it  derivative} $f'$ at all
the auxiliary points.
\bull For each critical point $x_i$, we have the auxiliary points to
each side of it: $t_i
<x_i
<t_{i+1}$. There are four cases {\it  best
remembered by drawing a picture!}:
\bull if $f'(t_i)>0$ and $f'(t_{i+1})
<0$ (so $f$ is {\it  increasing}
to the left of $x_i$ and {\it  decreasing} to the right of $x_i$, then
$f$ has a {\it  local maximum} at $x_o$.
\bull if $f'(t_i)
<0$ and $f'(t_{i+1})>0$ (so $f$ is {\it  decreasing}
to the left of $x_i$ and {\it  increasing} to the right of $x_i$, then
$f$ has a {\it  local minimum} at $x_o$.
\bull if $f'(t_i)
<0$ and $f'(t_{i+1})
<0$ (so $f$ is {\it  decreasing}
to the left of $x_i$ and {\it  also decreasing} to the right of $x_i$, then
$f$ has {\it  neither} a local maximum nor a local minimum at $x_o$.
\bull if $f'(t_i)>0$ and $f'(t_{i+1})>0$ (so $f$ is {\it  increasing}
to the left of $x_i$ and {\it  also increasing} to the right of $x_i$, then
$f$ has {\it  neither} a local maximum nor a local minimum at $x_o$.

The endpoints require separate treatment: There is the auxiliary
point $t_o$ just to the {\it  right} of the left endpoint $a$, and the
auxiliary point $t_n$ just to the {\it  left} of the right endpoint $b$:
\bull At the {\it  left} endpoint $a$, if $f'(t_o)
<0$ (so $f'$ is {\it 
decreasing} to the right of $a$) then $a$ is a {\it  local maximum}.
\bull At the {\it  left} endpoint $a$, if $f'(t_o)>$ (so $f'$ is {\it 
increasing} to the right of $a$) then $a$ is a {\it  local minimum}.
\bull At the {\it  right} endpoint $b$, if $f'(t_n)
<0$ (so $f'$ is {\it 
decreasing} as $b$ is approached from the left) then $b$ is a {\it
local minimum}.
\bull At the {\it  right} endpoint $b$, if $f'(t_n)>$ (so $f'$ is {\it 
increasing} as $b$ is approached from the left) then $b$ is a {\it
local maximum}.


The possibly bewildering list of possibilities really
shouldn't be bewildering after you get used to them. We are already
acquainted with evaluation of $f'$ at auxiliary points between
critical points in order to see whether the function is increasing or
decreasing, and now we're just applying that information to see
whether the graph {\it  peaks, troughs, or does neither} around each
critical point and endpoints. That is, {\it  the geometric meaning of the
derivative's being positive or negative is easily translated into
conclusions about local maxima or minima.}

Find all the local (=relative) minima and maxima of the
function $f(x)=2x^3-9x^2+1$ on the interval $[-2,2]$: To find critical
points, solve $f'(x)=0$: this is $6x^2-18x=0$ or $x(x-3)=0$, so there
are two critical points, $0$ and $3$. Since $3$ is not in the interval
we care about, we drop it from our list. Adding the endpoints to the
list, we have $$-2
<0<2$$ as our ordered list of special points. Let's
use auxiliary points $-1,1$. At $-1$ the derivative is $f'(-1)=24>0$,
so the function is increasing there. At $+1$ the derivative is
$f'(1)=-12
<0$, so the function is decreasing. Thus, since it is
increasing to the left and decreasing to the right of $0$, it must be
that $0$ is a {\it  local maximum}. Since $f$ is increasing to the
right of the left endpoint $-2$, that left endpoint must give a {\it 
local minimum}. Since it is decreasing to the left of the right
endpoint $+2$, the right endpoint must be a {\it  local minimum}.

Notice that although the processes of finding {\it  absolute}
maxima and minima and {\it  local} maxima and minima have a lot in
common, they have essential differences. In particular, the only
relations between them are that {\it  critical points} and {\it 
endpoints} (and points of discontinuity, etc.) play a big role in
both, and that the {\it  absolute} maximum is certainly a {\it  local}
maximum, and likewise the {\it  absolute} minimum is certainly a {\it 
local} minimum.

For example, just plugging critical points into the function does not
reliably indicate which points are {\it  local} maxima and minima. And,
on the other hand, knowing which of the critical points are {\it 
local} maxima and minima generally is only a small step toward
figuring out which are {\it  absolute}: values still have to be plugged
into the funciton! {\it  So don't confuse the two procedures!}

(By the way: while it's fairly easy to make up story-problems where the
issue is to find the maximum or minimum value of some function on some
interval, it's harder to think of a simple application of {\it  local} maxima
or minima).





\vskip15pt\hrule\vskip12pt

\ex Find all
the local (=relative) minima and maxima of the
function $f(x)=(x+1)^3-3(x+1)$ on the interval $[-2,1]$.

\ex Find the local (=relative) minima and maxima on the
interval $[-3,2]$ of the function $f(x)=(x+1)^3-3(x+1)$.

\ex Find the local (relative) minima and maxima of the function
$f(x)=1-12x+x^3$ on the interval $[-3,3]$.

\ex Find the local (relative) minima and maxima of the function
$f(x)=3x^4 - 8x^3 + 6x^2 + 17$ on the interval $[-3,3]$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{An algebra trick}




The algebra trick here goes back at least $350$ years. This is worth
looking at if only as an additional review of algebra, but is actually
of considerable value in a variety of hand computations as well.

The algebraic identity we use here starts with a product of factors
each of which may occur with a {\it  fractional or negative exponent.}
For example, with $3$ such factors:
$$f(x)=(x-a)^k\;(x-b)^\ell\;(x-c)^m$$
The derivative can be computed by using the product rule twice:
$$f'(x)=\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;$$
$$=k(x-a)^{k-1}(x-b)^\ell(x-c)^m+
(x-a)^k \ell(x-b)^{\ell-1}(x-c)^m+
(x-a)^k(x-b)^\ell m(x-c)^{m-1}$$
Now all three summands here have a common factor of
$$(x-a)^{k-1}(x-b)^{\ell-1}(x-c)^{m-1}$$
which we can take out, using the distributive law in reverse: we have
$$f'(x)=\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;$$
$$=(x-a)^{k-1}(x-b)^{\ell-1}(x-c)^{m-1}
[k(x-b)(x-c)+\ell(x-a)(x-c)+m(x-a)(x-b)]$$
The minor miracle is that the big expression inside the
square brackets is a mere quadratic polynomial in $x$.

Then to determine {\it  critical points} we have to figure out the
roots of the equation $f'(x)=0$: If $k-1>0$ then $x=a$ is a critical
point, if $k-1\le 0$ it isn't. If $\ell-1>0$ then $x=b$ is a critical
point, if $\ell-1\le 0$ it isn't. If $m-1>0$ then $x=c$ is a critical
point, if $m-1\le 0$ it isn't. And, last but not least, {\it  the two
roots of the quadratic equation}
$$k(x-b)(x-c)+\ell(x-a)(x-c)+m(x-a)(x-b)=0$$ are critical points.

{\it  There is also another issue here, about not wanting to
take square roots (and so on) of negative numbers. We would exclude
from the domain of the function any values of $x$ which would make us
try to take a square root of a negative number. But this might also
force us to give up some critical points!} Still, this is not the main
point here, so we will do examples which avoid this additional worry.

A very simple {\it  numerical} example: suppose we are to find the {\it 
critical points} of the function
$$f(x)=x^{5/2}(x-1)^{4/3}$$ Implicitly, we have to find the critical
points first. We compute the derivative by using the product rule, the
power function rule, and a tiny bit of chain rule:
$$f'(x)={5\over 2}x^{3/2}(x-1)^{4/3}+x^{5/2}{4\over 3}(x-1)^{1/3}$$
And now {\it  solve} this for $x$? It's not at all a polynomial, and it
is a little ugly.

But our algebra trick transforms this
issue into something as simple as {\it  solving a linear equation}:
first figure out the largest power of $x$ that occurs in {\it  all} the
terms: it is $x^{3/2}$, since $x^{5/2}$ occurs in the first term and
$x^{3/2}$ in the second. The largest power of $x-1$ that occurs in
{\it  all} the terms is $(x-1)^{1/3}$, since $(x-1)^{4/3}$ occurs in
the first, and $(x-1)^{1/3}$ in the second. {\it  Taking these common
factors out} (using the distributive law `backward'), we rearrange to
$$f'(x)={5\over 2}x^{3/2}(x-1)^{4/3}+x^{5/2}{4\over 3}(x-1)^{1/3}$$
$$=x^{3/2}(x-1)^{1/3}\,\left( {5\over 2}(x-1)+{4\over 3}x\right)$$
$$=x^{3/2}(x-1)^{1/3}({5\over 2}x-{5\over 2}+{4\over 3}x)$$
$$=x^{3/2}(x-1)^{1/3}({23\over 6}x-{5\over 2})$$

{\it  Now} to see when this is $0$ is not so hard: first, since the
power of $x$ appearing in front is {\it  positive}, $x=0$ make this
expression $0$. Second, since the power of $x+1$ appearing in front is
{\it  positive}, if $x-1=0$ then the whole expression is $0$. Third,
and perhaps {\it  unexpectedly}, from the simplified form of the 
complicated factor, if ${23\over 6}x-{5\over 2}=0$ then the whole
expression is $0$, as well. So, altogether, the {\it  critical points}
would appear to be 
$$x=0,{15\over 23},1$$
{\it  Many people would overlook the critical point ${15\over 23}$,
which is visible only after the algebra we did.}





\vskip15pt\hrule\vskip12pt


\ex Find the critical points and intervals of increase and decrease of 
$f(x) = x^{10}(x-1)^{12}$.

\ex Find the critical points and intervals of increase and decrease of 
$f(x) = x^{10}(x-2)^{11}(x+2)^{3}$.

\ex Find the critical points and intervals of increase and
decrease of $f(x)=x^{5/3}(x+1)^{6/5}$.

\ex Find the critical points and intervals of increase and
decrease of $f(x)=x^{1/2}(x+1)^{4/3}(x-1)^{-11/3}$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Linear approximations: approximation by differentials}




The idea here in `geometric' terms is that in some vague sense a
curved line can be approximated by a straight line tangent to it. Of
course, this approximation is only good at all `near' the point of
tangency, and so on. So the only formula here is secretly the formula
for the tangent line to the graph of a function. There is some hassle
due to the fact that there are so many different choices of symbols to
{\it  write} it.

We can write some formulas: Let $f$ be a
function, and fix a point $x_o$. The idea is that {\it  for $x$ `near'
$x_o$ we have an `approximate' equality}
$$f(x)\approx f(x_o)+f'(x_o)(x-x_o)$$
We do {\it  not} attempt to clarify what {\it  either} `near' or
`approximate' mean in this context. What is really true here is that
for a given value $x$, the quantity
$$f(x_o)+f'(x_o)(x-x_o)$$
is {\it  exactly} the $y$-coordinate of the line {\it  tangent} to the
graph at $x_o$

The aproximation statement has many paraphrases in varying
choices of symbols, and a person needs to be able to recognize all of
them. For example, one of the more traditional paraphrases, which
introduces some slightly silly but oh-so-traditional notation, is the
following one. We might also say that $y$ is a function of $x$ given
by $y=f(x)$. Let 
$$\Delta x = \hbox{ small change in $x$}$$ $$\Delta
y= \hbox{ corresponding change in $y$ }=f(x+\Delta x)-f(x)$$

Then the assertion is that 
$$\Delta y\approx f'(x)\,\Delta x$$

Sometimes some texts introduce the following questionable
(but traditionally popular!) notation:
$$dy = f'(x)\;dx = \hbox{ approximation to change in $y$}$$
$$dx = \Delta x$$
and call the $dx$ and $dy$ {\it  `differentials'}. And then this whole
procedure is {\bf `approximation by differentials'}. A not
particularly enlightening paraphrase, using the previous notation, is
$$dy\approx \Delta y$$
Even though you may see people writing this, don't do it.

More paraphrases, with varying symbols:
$$f(x+\Delta x)\approx f(x) + f'(x)\Delta x$$
$$f(x+\delta)\approx f(x) + f'(x)\delta$$
$$f(x+h)\approx f(x) + f'(x)h$$
$$f(x+\Delta x)-f(x)\approx f'(x)\Delta x$$
$$y+\Delta y\approx f(x)+f'(x)\Delta x$$
$$\Delta y\approx f'(x)\Delta x$$

{\it  A little history:} Until just $20$ or $30$ years ago,
calculators were not widely available, and especially not typically
able to evaluate trigonometric, exponential, and logarithm
functions. In that context, the kind of vague and unreliable
`approximation' furnished by `differentials' was certainly worthwhile
in many situations.

By contrast, now that pretty sophisticated calculators are widely
available, some things that once seemed sensible are no longer. For
example, a very traditional type of question is to `approximate
$\sqrt{10}$ by differentials'. A reasonable contemporary response
would be to simply punch in `$1,0,\sqrt{}$' on your calculator and get
the answer immediately to 10 decimal places. But this was possible
only relatively recently.

{\it  Example:}  For example let's approximate $\sqrt{17}$ by
differentials. For this problem to make sense at all {\it  imagine that
you have no calculator}. We take $f(x)=\sqrt{x}=x^{1/2}$. {\it  The idea
here is that we can  easily evaluate `by hand' both $f$ and $f'$
at the point $x=16$ which is `near' $17$}. (Here
$f'(x)={1\over 2}x^{-1/2}$). Thus, here
$$\Delta x=17-16=1$$
and
$$\sqrt{17}=f(17)\approx f(16)+f'(16)\Delta
x=\sqrt{16}+{1\over 2}{ 1 \over \sqrt{16 }}\cdot 1=4+{1\over 8}$$

{\it  Example:}  Similarly, if we wanted to approximate $\sqrt{18}$ `by
differentials', we'd again take $f(x)=\sqrt{x}=x^{1/2}$. Still we
imagine that we are doing this `by hand', and then of course we can
`easily evaluate' the function $f$ and its derivative $f'$ at the point $x=16$ which is `near' $18$. Thus, here
$$\Delta x=18-16=2$$
and
$$\sqrt{18}=f(18)\approx f(16)+f'(16)\Delta
x=\sqrt{16}+{1\over 2}{ 1 \over \sqrt{16 }}\cdot 2=4+{1\over 4}$$

Why not use the `good' point $25$ as the `nearby' point to
find $\sqrt{18}$? Well, in broad terms, the further away your `good'
point is, the worse the approximation will be. Yes, it is true that we
have little idea how good or bad the approximation is {\it  anyway}.

It is somewhat more sensible to {\it  not} use this idea for
numerical work, but rather to say things like $$\sqrt{x+1}\approx
\sqrt{x}+{1\over 2}{ 1 \over \sqrt{x }}$$ and $$\sqrt{x+h}\approx
\sqrt{x}+{1\over 2}{ 1 \over \sqrt{x }}\cdot h$$ This kind of assertion
is more than any particular numerical example would give, because it
gives a {\it  relationship}, telling how much the {\it  output} changes
for given change in {\it  input}, depending what {\it  regime}
(=interval) the input is generally in. In this example, we can make
the {\it  qualitative} observation that {\it  as $x$ increases the
difference $\sqrt{x+1}-\sqrt{x}$ decreases}.

{\it  Example:}  Another numerical example: Approximate $\sin\,31^o$ `by
differentials'. Again, the point is {\it  not} to hit $3,1,\sin$ on
your calculator (after switching to degrees), but rather to {\it 
imagine that you have no calculator}. And we are supposed to remember
from pre-calculator days the `special angles' and the values of trig
functions at them: $\sin \,30^o={1\over 2}$ and $\cos
\,30^o={\sqrt{3} \over 2}$. So we'd use the function $f(x)=\sin\,x$,
and we'd imagine that we can evaluate $f$ and $f'$ easily by hand at
$30^o$. Then
$$\Delta x=31^o-30^o=1^o=1^o\cdot {2\pi\hbox{ radians } \over 360^o}=
 {2\pi\over 360}\hbox{ radians }$$ 
We have to rewrite things in radians
since we really only can compute derivatives of trig functions in
radians. Yes, this is a complication in our supposed `computation by
hand'. Anyway, we have 
$$\sin\,31^o=f(31^o)=f(30^o)+f'(30^o)\Delta
x =\sin\,30^o+\cos\,30^o\cdot {2\pi\over 360}$$
$$={1\over 2}+{\sqrt{3} \over 2} {2\pi\over 360}$$ Evidently we are
to {\it  also} imagine that we {\it  know} or can easily {\it  find}
$\sqrt{3}$ (by differentials?) as well as a value of $\pi$. {\it  Yes},
this is a lot of trouble in comparison to just punching the
buttons, and from a contemporary perspective may seem senseless.

{\it  Example:}  Approximate $\ln(x+2)$  `by differentials', in terms of
$\ln x$ and $x$: This {\it  non-numerical} question is somewhat more
sensible. Take $f(x)=\ln\,x$, so that $f'(x)={1\over x}$. Then
$$\Delta x=(x+2)-x=2$$
and by the formulas above
$$\ln(x+2)=f(x+2)\approx f(x)+f'(x)\cdot 2=\ln\,x+{2\over x}$$

{\it  Example:}  Approximate $\ln\,(e+2)$ in terms of differentials: Use
$f(x)=\ln\,x$ again, so $f'(x)={1\over x}$. We probably have to
imagine that we can `easily evaluate' both $\ln\,x$ and ${1\over x}$
at $x=e$. (Do we know a numerical approximation to $e$?). Now 
$$\Delta x = (e+2)-e = 2$$
so we have
$$\ln(e+2)=f(e+2)\approx f(e)+f'(e)\cdot 2=\ln\,e+{2\over e}=1+{2\over e}$$
since $\ln\,e=1$.





\vskip15pt\hrule\vskip12pt

\ex   Approximate $\sqrt{101}$ `by differentials' in terms
of $\sqrt{100}=10$. 

\ex   Approximate $\sqrt{x+1}$ `by differentials', in terms
of $\sqrt{x}$.

\ex Granting that ${d\over dx}\ln x={1\over x}$, approximate
$\ln(x+1)$ `by differentials', in terms of $\ln x$ and $x$.

\ex Granting that ${d\over dx}e^x=e^x$, approximate
$e^{x+1}$ in terms of $e^x$.

\ex Granting that ${d\over dx}\cos x=-\sin x$, approximate
$\cos(x+1)$ in terms of $\cos\,x$ and $\sin\,x$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Implicit differentiation}




There is nothing `implicit' about the differentiation we do here, it
is quite `explicit'. The difference from earlier situations is that we
have a {\it  function defined `implicitly'}. What this means is that,
instead of a clear-cut (if complicated) formula for the value of the
function in terms of the input value, we only have a {\it  relation}
between the two. This is best illustrated by examples.

For example, suppose that $y$ is a function of $x$ and
$$y^5-xy+x^5=1$$ 
and we are to find some useful expression for $dy/dx$.
Notice that it is not likely that
we'd be able to {\it  solve} this equation for $y$ as a function of $x$
(nor vice-versa, either), so our previous methods do not obviously do
anything here! But both sides of that equality are functions of $x$,
and are {\it  equal}, so their derivatives are equal, surely. That is,
$$5y^4{dy\over dx}-1\cdot y-x{dy\over dx}+5x^4=0$$
Here the trick is that we can `take the derivative' without knowing
exactly what $y$ is as a function of $x$, but just using the rules for
differentiation. 

Specifically, to take the derivative of the term $y^5$, we
view this as a {\it  composite} function, obtained by applying the
take-the-fifth-power function after applying the (not clearly known!)
function $y$. Then use the chain rule!

Likewise, to differentiate the term $xy$, we use the product rule
$${d\over dx}(x\cdot y)={dx\over dx}\cdot y+x\cdot{dy\over dx}=
y+x\cdot{dy\over dx}$$
since, after all,
$${dx\over dx}=1$$

And the term $x^5$ is easy to differentiate, obtaining the $5x^4$. The
other side of the equation, the function `$1$', is {\it  constant}, so
its derivative is $0$. (The fact that this means that the left-hand
side is also constant should not be mis-used: we need to use the very
non-trivial looking expression we have for that constant function,
there on the left-hand side of that equation!).

Now the amazing part is that this equation can be {\it  solved for
$y'$}, if we tolerate a formula involving not only $x$, but also $y$:
first, regroup terms depending on whether they have a $y'$ or not:
$$y'(5y^4-x)+(-y+5x^4)=0$$
Then move the non-$y'$ terms to the other side
$$y'(5y^4-x)=y-5x^4$$
and divide by the `coefficient' of the $y'$:
$$y'={y-5x^4\over 5y^4-x}$$

Yes, this is {\it  not} as good as if there were a formula for
$y'$ {\it  not} needing the $y$. But, on the other hand, the initial
situation we had did not present us with a formula for $y$ in terms of
$x$, so it was necessary to lower our expectations. 

Yes, if we are given a value of $x$ and told to find the
corresponding $y'$, it would be impossible without luck or some
additional information. For example, in the case we just looked at, if
we were asked to find $y'$ when $x=1$ and $y=1$, it's easy: just plug
these values into the formula for $y'$ in terms of {\it  both} $x$ and
$y$: when $x=1$ and $y=1$, the corresponding value of $y'$ is
$$y'={1-5\cdot 1^4\over 5\cdot 1^4-1}=-4/4=-1$$

If, instead, we were asked to find $y$ and $y'$ when $x=1$,
not knowing in advance that $y=1$ fits into the equation when $x=1$,
we'd have to hope for some luck. First, we'd have to try to solve the
original equation for $y$ with $x$ replace by its value $1$: solve
$$y^5-y+1=1$$
By luck indeed, there is some cancellation, and the equation becomes
$$y^5-y=0$$
By further luck, we can factor this `by hand': it is
$$0=y(y^4-1)=y(y^2-1)(y^2+1)=y(y-1)(y+1)(y^2+1)$$
So there are actually {\it  three} real numbers which work as $y$ for
$x=1$: the values $-1,0,+1$. There is no clear way to see which is
`best'. But in any case, any one of these three values could be used
as $y$ in substituting into the formula 
$$y'={y-5x^4\over 5y^4-x}$$
we obtained above.

Yes, there are really {\it  three solutions}, three functions, etc.

Note that we {\it  could} have used the Intermediate Value
Theorem and/or Newton's Method to {\it  numerically} solve the equation,
even without too much luck. In `real life' a person should be prepared
to do such things.






\vskip15pt\hrule\vskip12pt

\ex   Suppose that $y$ is a function of $x$ and
$$y^5-xy+x^5=1$$
Find $dy/dx$ at the point $x=1,y=0$.

\ex   Suppose that $y$ is a function of $x$ and
$$y^3-xy^2+x^2y+x^5=7$$
Find $dy/dx$ at the point $x=1,y=2$. Find ${ d^2\,y \over dx\,^2 }$ at
that point.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Related rates}



In this section, most functions will be functions of a parameter $t$
which we will think of as {\it  time}. There is a convention coming
from physics to write the derivative of any function $y$
of $t$ as $\dot{y}=dy/dt$, that is, with just a {\it  dot} over the
functions, rather than a {\it  prime}.

The issues here are variants and continuations of the previous
section's idea about {\it  implicit differentiation}. Traditionally,
there are other (non-calculus!) issues introduced at this point,
involving both story-problem stuff as well as requirement to be able
to deal with {\it  similar triangles}, the {\it  Pythagorean Theorem},
and to recall formulas for {\it  volumes} of cones and such.

Continuing with the idea of describing a function by a relation, we
could have {\it  two} unknown functions $x$ and $y$ of $t$, {\it  
related} by some formula such as 
$$x^2+y^2=25$$ 
A typical question of this genre is `What is $\dot{y}$ when $x=4$ and
$\dot{x}=6$?' 

The fundamental rule of thumb in this kind of situation is {\it 
differentiate the relation with respect to $t$}: so we differentiate
the relation $x^2+y^2=25$ with respect to $t$, even though we don't
know any details about those two function $x$ and $y$ of $t$:
$$2x\dot{x}+2y\dot{y}=0$$
using the chain rule. We can solve this for $\dot{y}$:
$$\dot{y}=-{x\dot{x} \over y}$$
So {\it  at any particular moment}, if we knew the values of
$x,\dot{x},y$ then we could find $\dot{y}$ {\it  at that moment}.

Here it's easy to solve the original relation to find $y$ when $x=4$:
we get $y=\pm 3$. Substituting, we get $$\dot{y}=-{4\cdot 6\over \pm
3}=\pm 8$$ (The $\pm$ notation means that we take $+$ chosen if we
take $y=-3$ and $-$ if we take $y=+3$).





\vskip15pt\hrule\vskip12pt

\ex   Suppose that $x,y$ are both functions of $t$, and that
$x^2+y^2=25$. Express ${ dx \over dt }$ in terms of $x,y,$ and
${ dy \over dt }$. When $x=3$ and $y=4$ and ${ dy \over dt }=6$, what
is${ dx \over dt }$? 

\ex   A 2-foot tall dog is walking away from a
streetlight which is on a 10-foot pole. At a certain moment, the
tip of the dog's shadow is moving away from the streetlight at
5 feet per second. How fast is the dog walking at that moment?

\ex
  A ladder $13$ feet long leans against a house, but is
sliding down. How fast is the top of the ladder moving at a
moment when the base of the ladder is $12$ feet from the house and
moving outward at $10$ feet per second? 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Intermediate Value Theorem, location of roots}




The assertion of the Intermediate Value Theorem is something which is
probably `intuitively obvious', and is also {\it  provably true}: if a
function $f$ is {\it  continuous} on an interval $[a,b]$ and if
$f(a)
<0$ and $f(b)>0$ (or vice-versa), then there is some third point
$c$ with $a
<c<b$ so that $f(c)=0$.
This result has many relatively `theoretical' uses, but for our
purposes can be used to give a crude but simple way to locate the
roots of functions. There is a lot of guessing, or trial-and-error,
involved here, but that is fair. Again, in this situation, it is to
our advantage if we are reasonably proficient in using a calculator to
do simple tasks like evaluating polynomials!
If this approach to estimating roots is taken to its logical
conclusion, it is called the method of {\it  interval bisection}, for a
reason we'll see below. We will not pursue this method very far,
because there are {\it  better} methods to use once we have invoked
{\it  this} just to get going.

For example, we probably don't know a formula to solve the cubic
equation
$$x^3-x+1=0$$
But the function $f(x)=x^3-x+1$ is certainly continuous, so we can
invoke the Intermediate Value Theorem as much as we'd like. For
example, $f(2)=7>0$ and $f(-2)=-5
<0$, so we know that there is a root
in the interval $[-2,2]$. We'd like to cut down the size of the
interval, so we look at what happens at the {\it  midpoint}, bisecting
the interval $[-2,2]$: we have $f(0)=1>0$. Therefore, since
$f(-2)=-5
<0$, we can conclude that there is a root in
$[-2,0]$. Since both $f(0)>0$ and $f(2)>0$, we can't say anything at
this point about whether or not there are roots in $[0,2]$. Again {\it 
bisecting} the interval $[-2,0]$ where we know there is a root, we
compute $f(-1)=1>0$. Thus, since $f(-2)
<0$, we know that there is a
root in $[-2,-1]$ (and have no information about $[-1,0]$).

If we continue with this method, we can obtain as good an
approximation as we want! But there are faster ways to get a really
good approximation, as we'll see.

Unless a person has an amazing intuition for polynomials (or
whatever), there is really no way to anticipate what guess is better
than any other in getting started.

Invoke the Intermediate Value Theorem to find an
interval of length $1$ or less in which there is a root of $x^3+x+3
=0$: Let $f(x)=x^3+x+3$. Just, guessing, we compute
$f(0)=3>0$. Realizing that the $x^3$ term probably `dominates' $f$
when $x$ is large positive or large negative, and since we want to
find a point where $f$ is negative, our next guess will be a `large'
negative number: how about $-1$? Well, $f(-1)=1>0$, so evidently $-1$
is not negative enough. How about $-2$? Well, $f(-2)=-7
<0$, so we have
succeeded. Further, the failed guess $-1$ actually was worthwhile,
since now we know that $f(-2)
<0$ and $f(-1)>0$. Then, invoking the
Intermediate Value Theorem, there is a root in the interval $[-2,-1]$.

Of course, typically polynomials have several roots, but {\it 
the number of roots of a polynomial is never more than its degree}. We
can use the Intermediate Value Theorem to get an idea where {\it  all}
of them are.

Invoke the Intermediate Value Theorem to find {\it  three
different intervals} of length $1$ or less in each of which there is a
root of $x^3-4x+1=0$: first, just starting anywhere, $f(0)=1>0$. Next,
$f(1)=-2
<0$. So, since $f(0)>0$ and $f(1)
<0$, there is at least one
root in $[0,1]$, by the Intermediate Value Theorem. Next,
$f(2)=1>0$. So, with some luck here, since $f(1)
<0$ and $f(2)>0$, by
the Intermediate Value Theorem there is a root in $[1,2]$. Now if we
somehow imagine that there is a {\it  negative root} as well, then we
try $-1$: $f(-1)=4>0$. So we know {\it  nothing} about roots in
$[-1,0]$. But continue: $f(-2)=1>0$, and still no new
conclusion. Continue: $f(-3)=-14
<0$. Aha! So since $f(-3)
<0$ and
$f(2)>0$, by the Intermediate Value Theorem there is a {\it  third}
root in the interval $[-3,-2]$.

Notice how even the `bad' guesses were not entirely wasted.






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Newton's method}



This is a method which, once you get started, quickly gives a very
good approximation to a root of polynomial (and other) equations.  The
idea is that, if $x_o$ is {\it not} a root of a polynomial equation,
but is pretty close to a root, then {\it sliding down the tangent line
at $x_o$ to the graph of $f$ gives a good approximation to the actual
root}. The point is that this process can be repeated as much as
necessary to give as good an approximation as you want.

Let's derive the relevant formula: if our blind guess for a root of
$f$ is $x_o$, then the tangent line is
$$y-f(x_o)=f'(x_o)(x-x_o)$$
`Sliding down' the tangent line to hit the $x$-axis means to find the
intersection of this line with the $x$-axis: this is where
$y=0$. Thus, we solve for $x$ in
$$0-f(x_o)=f'(x_o)(x-x_o)$$
to find
$$x=x_o-{f(x_o)\over f'(x_o)}$$

Well, let's call this {\it  first serious guess} $x_1$. Then, repeating this
process, the {\it  second serious guess} would be
$$x_2=x_1-{f(x_1)\over f'(x_1)}$$
and generally, if we have the $n$th guess $x_n$ then the $n+1$th guess
$x_{n+1}$ is
$$x_{n+1}=x_n-{f(x_n)\over f'(x_n)}$$

OK, that's the formula for {\it  improving our guesses}. How do we
decide when to quit? Well, it depends upon to how many decimal places we
want our approximation to be good. Basically, if we want, for example,
$3$ decimal places accuracy, then as soon as $x_n$ and $x_{n+1}$ {\it 
agree} to three decimal places, we can presume that those are the {\it 
true} decimals of the true root of the equation. This will be
illustrated in the examples below.

It is important to realize that there is some uncertainty in Newton's
method, both because it alone cannot assure that we have a root, and
also because the idea just described for approximating roots to a
given accuracy is not foolproof. But to worry about what could go
wrong here is counter-productive.

Approximate a root of $x^3-x+1=0$ using the
intermediate value theorem to get started, and then Newton's method:

First let's see what happens if we are a little foolish here,
in terms of the `blind' guess we start with. If we ignore the advice
about using the intermediate value theorem to {\it  guarantee} a root
in some known interval, we'll waste time. Let's see: The
general formula $$x_{n+1}=x_n-{f(x_n)\over f'(x_n)}$$ becomes
$$x_{n+1}=x_n-{x^3-x+1\over 3x^2-1}$$ If we take $x_1=1$ as our
`blind' guess, then plugging into the formula gives 
$$x_2=0.5$$
$$x_3=3$$ 
$$x_4=2.0384615384615383249$$ 
This is discouraging,
since the numbers are jumping around somewhat. But if we are stubborn
and can compute
quickly with a calculator (not by hand!), we'd see what happens:
$$\matrix{
x_5&=&1.3902821472167361527 \cr 
x_6&=&0.9116118977179270555\cr 
x_7&=&0.34502849674816926662 \cr 
x_8&=&1.4277507040272707783\cr 
x_9&=&0.94241791250948314662 \cr 
x_{10}&=&0.40494935719938018881\cr 
x_{11}&=&1.7069046451828553401 \cr 
x_{12}&=&1.1557563610748160521\cr 
x_{13}&=&0.69419181332954971175 \cr 
x_{14}&=&-0.74249429872066285974\cr 
x_{15}&=&-2.7812959406781381233 \cr 
x_{16}&=&-1.9827252470441485421\cr 
x_{17}&=&-1.5369273797584126484 \cr 
x_{18}&=&-1.3572624831877750928\cr 
x_{19}&=&-1.3256630944288703144 \cr 
x_{20}&=&-1.324718788615257159\cr 
x_{21}&=&-1.3247179572453899876
}$$

Well, after quite a few iterations of `sliding down the tangent', the
last two numbers we got, $x_{20}$ and $x_{21}$, agree to $5$ decimal
places. This would make us think that the {\it  true} root is {\it 
approximated to five decimal places} by $-1.32471$.

The stupid aspect of this little scenario was that our initial `blind'
guess was {\it  too far from an actual root}, so that there was some
wacky jumping around of the numbers before things settled down. If we
had been computing by hand this would have been hopeless.

Let's try this example again using the Intermediate Value Theorem to
pin down a root with some degree of accuracy: First, $f(1)=1>0$. Then
$f(0)=+1>0$ also, so we might {\it  doubt} that there is a root in
$[0,1]$.  Continue: $f(-1)=1>0$ again, so we might {\it  doubt} that
there is a root in $[-1,0]$, either. Continue: at last $f(-2)=-5
<0$,
so since $f(-1)>0$ by the Intermediate Value Theorem we do indeed know
that there is a root between $-2$ and $-1$. Now to start using {\it 
Newton's Method}, we would reasonably guess
$$x_o=-1.5$$
since this is the midpoint of the interval on which we know there is a
root. Then computing by Newton's method gives:
$$
\matrix{
x_{1}&=&-1.3478260869565217295\cr 
x_{2}&=&-1.3252003989509069104\cr 
x_{3}&=&-1.324718173999053672\cr 
x_{4}&=&-1.3247179572447898011
}$$
so right away we have what appears to be $5$ decimal places accuracy,
in $4$ steps rather than $21$. Getting off to a good start is important.

Approximate {\it  all three} roots of $x^3-3x+1=0$ using the
intermediate value theorem to get started, and then Newton's
method. Here you have to take a little care in choice of beginning
`guess' for Newton's method:

In this case, since we are {\it  told} that there are three
roots, then we should certainly be wary about where we start:
presumably we have to start in different places in order to
successfully use Newton's method to find the different roots. So,
starting thinking in terms of the intermediate value theorem: letting
$f(x)=x^3-3x+1$, we have $f(2)=3>0$. Next, $f(1)=-1
<0$, so we by the
Intermediate Value Theorem we know there is a root in $[1,2]$. Let's
try to approximate it pretty well before looking for the other roots:
The general formula for Newton's method becomes
$$x_{n+1}=x_n-{x^3-3x+1\over 3x^2-3}$$
Our initial `blind' guess might reasonably be the midpoint of the
interval in which we know there is a root: take 
$$x_o=1.5$$
Then we can compute
$$\matrix{
x_{1}&=&1.533333333333333437\cr 
x_{2}&=&1.5320906432748537807\cr 
x_{3}&=&1.5320888862414665521\cr 
x_{4}&=&1.5320888862379560269\cr 
x_{5}&=&1.5320888862379560269\cr 
x_{6}&=&1.5320888862379560269
}$$
So it appears that we have quickly approximated a root in that
interval! To what looks like $19$ decimal places!

Continuing with this example: $f(0)=1>0$, so since $f(1)
<0$
we know by the intermediate value theorem that there is a root in
$[0,1]$, since $f(1)=-1
<0$. So as our blind gues let's use the
midpoint of this interval to start Newton's Method: that is, now take
$x_o=0.5$:
$$\matrix{
x_{1}&=&0.33333333333333337034\cr 
x_{2}&=&0.3472222222222222654\cr 
x_{3}&=&0.34729635316386797683\cr 
x_{4}&=&0.34729635533386071788\cr 
x_{5}&=&0.34729635533386060686\cr 
x_{6}&=&0.34729635533386071788\cr 
x_{7}&=&0.34729635533386060686\cr 
x_{8}&=&0.34729635533386071788
}$$
so we have a root evidently approximated to $3$ decimal places after
just $2$ applications of Newton's method. After $8$ applications, we
have apparently $15$ correct decimal places.





\vskip15pt\hrule\vskip12pt

\ex Approximate a root of $x^3-x+1=0$ using the
intermediate value theorem to get started, and then Newton's method.

\ex Approximate a root of $3x^4-16x^3+18x^2+1=0$ using the
intermediate value theorem to get started, and then Newton's
method. You might have to be sure to
get sufficiently close to a root to start so that things don't `blow up'.

\ex Approximate {\it all three} roots of $x^3-3x+1=0$ using the
intermediate value theorem to get started, and then Newton's
method. Here you have to take a little care in choice of beginning
`guess' for Newton's method.

\ex Approximate the unique positive root of $\cos\,x=x$.

\ex Approximate a root of $e^x=2x$.

\ex Approximate a root of $\sin x=\ln x$. Watch out.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Derivatives of transcendental functions}




The new material here is just a list of formulas for taking
derivatives of exponential, logarithm, trigonometric, and inverse
trigonometric functions. Then any function made by composing these
with polynomials or with each other can be differentiated by using the
chain rule, product rule, etc. (These new formulas are not easy to
derive, but we don't have to worry about that).

The first two are the essentials for exponential and logarithms:
$$\matrix{
{d\over dx}\;e^x&=&e^x\cr 
{d\over dx}\;\ln\,x&=&{1\over x}
}$$

The next three are essential for trig functions:
$$\matrix{
{d\over dx}\;\sin\,x&=&\cos\,x\cr 
{d\over dx}\;\cos\,x&=&-\sin\,x\cr 
{d\over dx}\;\tan\,x&=&\sec^2\,x
}$$

The next three are essential for inverse trig functions
$$\matrix{
{d\over dx}\;\arcsin\,x&=&{ 1 \over \sqrt{1-x^2 }}\cr 
{d\over dx}\;\arctan\,x&=&{1\over 1+x^2}\cr 
{d\over dx}\;\hbox{arcsec}\,x&=&{ 1 \over x\,\sqrt{x^2-1 }}
}$$

The previous formulas are the indispensable ones in practice, and are
the only ones that I personally remember (if I'm lucky). Other
formulas one {\it  might} like to have seen are (with $a>0$ in the
first two):

$$\matrix{
{d\over dx}\;a^x&=&\ln\,a\cdot a^x\cr 
{d\over dx}\;\log_a\,x&=&{1\over \ln\,a\cdot x}\cr 
{d\over dx}\;\sec\,x&=&\tan\,x\,\sec\,x\cr 
{d\over dx}\;\csc\,x&=&-\cot\,x\,\csc\,x\cr 
{d\over dx}\;\cot\,x&=&-\csc^2\,x\cr 
{d\over dx}\;\arccos\,x&=&{ -1 \over \sqrt{1-x^2 }}\cr 
{d\over dx}\;\hbox{arccot}\,x&=&{-1\over 1+x^2} \cr 
{d\over dx}\;\hbox{arccsc}\,x&=&{ -1 \over x\,\sqrt{x^2-1 }}
}$$

{\it  (There are always some difficulties in figuring out which of the
infinitely-many possibilities to take for the values of the inverse
trig functions, and this is especially bad with {\rm arccsc}, for
example. But we won't have time to worry about such things).}

To be able to use the
above formulas it is {\it  not} necessary to know very many {\it  other}
properties of these functions. For example, {\it  it is not necessary
to be able to graph these functions to take their derivatives!}





\vskip15pt\hrule\vskip12pt

\ex   Find ${ d \over dx }(e^{\cos x})$

\ex   Find ${ d \over dx }(\arctan (2-e^x))$

\ex   Find ${ d \over dx }(\sqrt{\ln\;(x-1)})$

\ex   Find ${ d \over dx }(e^{2\cos x+5})$

\ex   Find ${ d \over dx }(\arctan (1+\sin 2x))$

\ex  Find ${d\over dx}\cos(e^x-x^2)$

\ex  Find ${d\over dx}\sqrt[3]{1-\ln\,2x}$

\ex  Find ${d\over dx}{e^x-1 \over e^x + 1}$

\ex  Find ${ d \over dx }(\sqrt{\ln \;({ 1 \over x })})$

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{L'Hospital's rule}




L'Hospital's rule is the definitive way to simplify evaluation of
limits. It does not directly evaluate limits, but only {\it  simplifies
evaluation if used appropriately}. 

In effect, this rule is the ultimate version of `cancellation tricks',
applicable in situations where a more down-to-earth genuine algebraic
cancellation may be hidden or invisible. 

Suppose we want to evaluate
$$\lim_{x\rightarrow a}{f(x)\over g(x)}$$
where the limit $a$ could also be $+\infty$ or $-\infty$ in addition
to `ordinary' numbers. Suppose that {\it  either}
$$\lim_{x\rightarrow a}f(x)=0 \hbox{ and } \lim_{x\rightarrow a}
g(x)=0$$
{\it  or}
$$\lim_{x\rightarrow a}f(x)=\pm\infty \hbox{ and } \lim_{x\rightarrow a}
g(x)=\pm\infty$$
(The $\pm$'s don't have to be the same sign). Then we cannot just
`plug in' to evaluate the limit, and these are traditionally called
{\bf indeterminate forms}. The unexpected trick that works often
is that (amazingly) we are entitled to {\it  take the derivative of
both numerator and denominator:}
$$\lim_{x\rightarrow a}{f(x)\over g(x)}=
\lim_{x\rightarrow a}{f'(x)\over g'(x)}$$
No, this is {\it  not the quotient rule}. No, it is not so clear why
this would help, either, but we'll see in examples.

{\it  Example:}  Find $\lim_{x\rightarrow 0}\,(\sin\,x)/x$: both numerator and
denominator have limit $0$, so we are entitled to apply L'Hospital's
rule:
$$\lim_{x\rightarrow 0}\,{\sin\,x\over x}=
\lim_{x\rightarrow 0}\,{\cos\,x\over 1}$$
In the new expression, {\it  neither} numerator nor denominator is $0$
at $x=0$, and we can just plug in to see that the limit is $1$.

{\it  Example:}  Find $\lim_{x\rightarrow 0}\,x/(e^{2x}-1)$: both numerator
and denominator go to $0$, so we are entitled to use L'Hospital's
rule:
$$\lim_{x\rightarrow 0}\,{ x \over e^{2x }-1}=
\lim_{x\rightarrow 0}\,{ 1 \over 2e^{2x }}$$
In the new expression, the numerator and denominator are both non-zero
when $x=0$, so we just plug in $0$ to get
$$\lim_{x\rightarrow 0}\,{ x \over e^{2x }-1}=
\lim_{x\rightarrow 0}\,{ 1 \over 2e^{2x }}={1\over 2e^0}={1\over 2}$$

{\it  Example:}  Find $\lim_{x\rightarrow 0^+}\,x\,\ln x$: The $0^+$ means
that we approach $0$ from the positive side, since otherwise we won't
have a real-valued logarithm. This problem
illustrates the {\it  possibility} as well as {\it  necessity} of {\it 
rearranging} a limit to make it be a {\it  ratio} of things, in order
to legitimately apply L'Hospital's rule. Here, we rearrange to
$$\lim_{x\rightarrow 0^+}\,x\,\ln x=\lim_{x\rightarrow
0}{\ln\,x\over 1/x}$$
In the new expressions the top goes to $-\infty$ and the bottom goes
to $+\infty$ as $x$ goes to $0$ (from the right). Thus, we are
entitled to apply L'Hospital's rule, obtaining

$$\lim_{x\rightarrow 0^+}\,x\,\ln x=\lim_{x\rightarrow
0}{\ln\,x\over 1/x}=\lim_{x\rightarrow
0}{1/x\over -1/x^2}$$
Now it is very necessary to rearrange the expression inside the last
limit: we have

$$\lim_{x\rightarrow 0}{1/x\over -1/x^2}=
\lim_{x\rightarrow 0}\,-x$$
The new expression is very easy to evaluate: the limit is $0$.

It is often necessary to apply L'Hospital's rule repeatedly:
Let's find $\lim_{x\rightarrow +\infty}x^2/e^x$: both numerator and
denominator go to $\infty$ as $x\rightarrow +\infty$, so we are
entitled to apply L'Hospital's rule, to turn this into
$$\lim_{x\rightarrow +\infty}{2x\over e^x}$$
But still both numerator and denominator go to $\infty$, so apply
L'Hospital's rule again: the limit is
$$\lim_{x\rightarrow +\infty}{2\over e^x}=0$$
since now the numerator is fixed while the denominator goes to $+\infty$.

{\it  Example:} Now let's illustrate more ways that things can
be rewritten as ratios, thereby possibly making L'Hospital's rule
applicable. Let's evaluate
$$\lim_{x \rightarrow 0}\,x^x$$ 
It is less obvious now, but we can't just plug in $0$ for $x$: on one
hand, we are taught to think that $x^0=1$, but also that $0^x=0$; but
then surely $0^0$ can't be both at once. And this exponential
expression is not a ratio. 

The trick here is to {\it  take the logarithm}:
$$\ln(\lim_{x \rightarrow 0^+}\,x^x)=\lim_{x \rightarrow 0^+}\,\ln(x^x)$$
The reason that we are entitled to {\it  interchange} the logarithm and
the limit is that {\it  logarithm is a continuous function} (on its
domain). Now we use the fact that $\ln(a^b)=b\ln a$, so the log of the
limit is
$$\lim_{x \rightarrow 0^+}\,x\ln x$$
Aha! The question has been turned into one we already did! But
ignoring that, and repeating ourselves, we'd first rewrite this as a
ratio
$$\lim_{x \rightarrow 0^+}\,x\ln x=\lim_{x \rightarrow 0^+}\,{\ln
x\over 1/x}$$
and then apply L'Hospital's rule to obtain
$$\lim_{x \rightarrow 0^+}\,{1/x\over -1/x^2}=\lim_{x \rightarrow
0^+}\,-x=0$$
But we have to remember that we've computed the {\it  log} of the
limit, not the limit. Therefore, the actual limit is
$$\lim_{x \rightarrow 0^+}\,x^x=e^{\hbox{ log of the limit
}}=e^0=1$$
{\it  This trick of taking a logarithm is important to remember}.

{\it  Example:}  Here is another issue of rearranging to fit into accessible
form: Find 
$$\lim_{x\rightarrow +\infty}\sqrt{x^2+x+1}-\sqrt{x^2+1}$$
This is not a ratio, but certainly is `indeterminate', since it is the
difference of two expressions both of which go to $+\infty$. To make
it into a ratio, we take out the largest reasonable power of $x$:
$$\lim_{x\rightarrow +\infty}
\sqrt{x^2+x+1}-\sqrt{x^2+1}=
\lim_{x\rightarrow +\infty} x\cdot(\sqrt{1+{1\over x}+{1\over x^2}}-
\sqrt{1+{1\over x^2}})
$$
$$=\lim_{x\rightarrow +\infty}
{\sqrt{1+{1\over x}+{1\over x^2}}-
\sqrt{1+{1\over x^2}} \over 1/x}$$
The last expression here fits the requirements of the L'Hospital rule,
since both numerator and denominator go to $0$. Thus, by invoking
L'Hospital's rule, it becomes
$$=\lim_{x\rightarrow +\infty}
\;{1\over 2}\;
{{-{1\over x^2}-{2\over x^3} \over 
\sqrt{1+{1\over x}+{1\over x^2}}}-
{ {-2\over x^3} \over \sqrt{1+{1\over x^2}}} \over -1/x^2}$$

This is a large but actually tractable expression: multiply top and
bottom by $x^2$, so that it becomes
$$=\lim_{x\rightarrow +\infty}
{{1\over 2}+{1\over x} \over
\sqrt{1+{1\over x}+{1\over x^2}}}+
{ {-1\over x} \over \sqrt{1+{1\over x^2}} }
$$

At this point, we {\it  can} replace every ${1\over x}$ by $0$,
finding that the limit is equal to
$${{1\over 2}+0 \over
\sqrt{1+0+0}}+
{ 0 \over \sqrt{1+0 }}={1\over 2}$$

It is important to recognize that in additional to the actual
application of L'Hospital's rule, it may be necessary to {\it 
experiment} a little to get things to settle out the way you
want. {\it  Trial-and-error is not only ok, it is necessary}.





\vskip15pt\hrule\vskip12pt

\ex   Find $\lim_{x\rightarrow 0}\,(\sin\,x)/x$

\ex   Find $\lim_{x\rightarrow 0}\,(\sin\,5x)/x$

\ex   Find $\lim_{x\rightarrow 0}\,(\sin\,(x^2))/x^2$

\ex   Find $\lim_{x\rightarrow 0}\,x/(e^{2x}-1)$

\ex   Find $\lim_{x\rightarrow 0}\,x\,\ln x$

\ex   Find $$\lim_{x\rightarrow 0^+}\,(e^x-1)\ln x$$

\ex   Find $$\lim_{x\rightarrow 1}\,{ \ln x \over x-1 }$$

\ex   Find $$\lim_{x\rightarrow
+\infty}\,{ \ln\,x \over x }$$

\ex  Find $$\lim_{x\rightarrow
+\infty}\,{ \ln x \over x^2 }$$

\ex   Find $\lim_{x\rightarrow 0}\,(\sin x)^x$

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Exponential growth and decay: a differential equation}




This little section is a tiny introduction to a very important subject
and bunch of ideas: {\it  solving differential equations}. We'll just
look at the simplest possible example of this.

The general idea is that, instead of solving equations to find unknown
{\it  numbers}, we might solve equations to find unknown {\it 
functions}. There are many possibilities for what this might mean, but
one is that we have an unknown function $y$ of $x$ and are given that
$y$ and its derivative $y'$ (with respect to $x$) satisfy a relation
$$y'=ky$$
where $k$ is some constant. Such a relation between an unknown
function and its derivative (or {\it  derivatives}) is what is called a
{\bf differential equation}. Many basic `physical principles' can be
written in such terms, using `time' $t$ as the independent variable.

Having been taking derivatives of exponential functions, a
person might remember that the function $f(t)=e^{kt}$ has exactly this
property:
$${d\over dt}e^{kt}=k\cdot e^{kt}$$
For that matter, any {\it  constant multiple} of this function has the
same property:
$${d\over dt}(c\cdot e^{kt})=k\cdot c\cdot e^{kt}$$
And it turns out that these really are {\it  all} the possible
solutions to this differential equation.

There is a certain buzz-phrase which is supposed to alert a
person to the occurrence of this little story: if a function $f$
has {\bf exponential growth} or {\bf exponential decay} then that is
taken to mean that $f$ can be written in the form
$$f(t)=c\cdot e^{kt}$$
If the constant $k$ is {\it  positive} it has exponential {\it  growth}
and if $k$ is {\it  negative} then it has exponential {\it  decay}.

Since we've described all the solutions to this equation,
what questions remain to ask about this kind of thing? Well, the usual
scenario is that some {\it  story problem} will give you information in
a way that requires you to take some trouble in order to {\it 
determine the constants $c,k$}. And, in case you were wondering where
you get to take a derivative here, the answer is that you don't
really: all the `calculus work' was done at the point where we granted
ourselves that all solutions to that differential equation are given
in the form $f(t)=ce^{kt}$.

First to look at some general ideas about determining the
constants before getting embroiled in story problems: One simple
observation is that
$$c=f(0)$$
that is, that the constant $c$ is the value of the function at time
$t=0$. This is true simply because
$$f(0)=ce^{k \cdot 0}=ce^{0}=c\cdot 1=c$$
from properties of the exponential function.

More generally, suppose we know the values of the function at
two different times:
$$y_1=ce^{kt_1}$$
$$y_2=ce^{kt_2}$$
Even though we certainly do have `two equations and two unknowns',
these equations involve the unknown constants in a manner we may not
be used to. But it's still not so hard to solve for $c,k$: dividing
the first equation by the second and using properties of the
exponential function, the $c$ on the right side cancels, and we get
$${y_1\over y_2}=e^{k(t_1-t_2)}$$
Taking a logarithm (base $e$, of course) we get
$$\ln y_1-\ln y_2=k(t_1-t_2)$$
Dividing by $t_1-t_2$, this is
$$k={\ln y_1-\ln y_2\over t_1-t_2}$$
Substituting back in order to find $c$, we first have
$$y_1=ce^{{\ln y_1-\ln y_2\over t_1-t_2}t_1}$$
Taking the logarithm, we have
$$\ln y_1=\ln c+{\ln y_1-\ln y_2\over t_1-t_2}t_1$$
Rearranging, this is
$$\ln c=\ln y_1-{\ln y_1-\ln y_2\over t_1-t_2}t_1=
{t_1\ln y_2-t_2\ln y_1\over t_1-t_2}$$
Therefore, in summary, the two equations
$$y_1=ce^{kt_1}$$
$$y_2=ce^{kt_2}$$
allow us to solve for $c,k$, giving
$$k={\ln y_1-\ln y_2\over t_1-t_2}$$
$$c=e^{{t_1\ln y_2-t_2\ln y_1\over t_1-t_2}}$$

A person might manage to remember such formulas, or it might
be wiser to remember the way of {\it  deriving} them.

{\it  Example:} A herd of llamas has $1000$ llamas in it, and
the population is growing exponentially. At time $t=4$ it has $2000$
llamas. Write a formula for the number of llamas at {\it  arbitrary}
time $t$.

Here there is no direct mention of differential equations, but use of
the buzz-phrase {\it  `growing exponentially'} must be taken as
indicator that we are talking about the situation $$f(t)=ce^{kt}$$
where here $f(t)$ is the number of llamas at time $t$ and $c,k$ are
constants to be determined from the information given in the
problem. And the use of language should probably be taken to mean that
at time $t=0$ there are $1000$ llamas, and at time $t=4$ there are
$2000$. Then, either repeating the method above or plugging into the
formula derived by the method, we find 
$$c=\hbox{ value of $f$ at $t=0$ } = 1000$$ 
$$k={\ln f(t_1)-\ln f(t_2)\over t_1-t_2}={\ln 1000-\ln
2000\over 0-4}$$
$$={ \ln {1000\over 2000}}{-4}={\ln {1\over 2} \over -4 } = (\ln 2)/4$$
Therefore,
$$f(t)=1000\;e^{{\ln 2\over 4}t}=1000\cdot 2^{t/4}$$
This is the desired formula for the number of llamas at arbitrary time $t$.

{\it  Example:} A colony of bacteria is growing
exponentially. At time $t=0$ it has $10$ bacteria in it, and at time
$t=4$ it has $2000$.  At what time will it have $100,000$ bacteria?

Even though it is not explicitly demanded, we need to find the general
formula for the number $f(t)$ of bacteria at time $t$, set this
expression equal to $100,000$, and solve for $t$. Again, we can take a
{\it  little} shortcut here since we know that $c=f(0)$ and we are
given that $f(0)=10$. (This is easier than using the bulkier more
general formula for finding $c$). And use the formula for $k$:
$$k={\ln f(t_1)-\ln f(t_2)\over t_1-t_2}=
{\ln 10 -\ln 2,000\over 0-4}={ \ln {10\over 2,000} \over -4 }=
{\ln 200\over 4} $$
Therefore, we have
$$f(t)=10\cdot e^{{\ln 200\over 4}\;t}=10\cdot 200^{t/4}$$
as the general formula. Now we try to solve
$$100,000=10\cdot e^{{\ln 200\over 4}\;t}$$
for $t$: divide both sides by the $10$ and take logarithms, to get
$$\ln 10,000={\ln 200\over 4}\;t$$
Thus,
$$t=4\,{\ln 10,000\over \ln 200}\approx 6.953407835$$





\vskip15pt\hrule\vskip12pt

\ex A herd of llamas is growing exponentially. At time $t=0$
it has $1000$ llamas in it, and at time $t=4$ it has $2000$
llamas. Write a formula for the number of llamas at {\it arbitrary}
time $t$.

\ex A herd of elephants is growing exponentially. At time $t=2$
it has $1000$ elephants in it, and at time $t=4$ it has $2000$
elephants. Write a formula for the number of elephants at {\it arbitrary}
time $t$.

\ex A colony of bacteria is growing exponentially. At time $t=0$
it has $10$ bacteria in it, and at time $t=4$ it has $2000$. 
At what time will it have $100,000$ bacteria?

\ex A colony of bacteria is growing exponentially. At time $t=2$
it has $10$ bacteria in it, and at time $t=4$ it has $2000$. 
At what time will it have $100,000$ bacteria?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The second and higher derivatives}




The {\bf second derivative} of a function is simply {\it  the
derivative of the derivative}. The {\bf third derivative} of a
function is the derivative of the second derivative. And so on.

The second derivative of a function $y=f(x)$ is written as
$$y''=f''(x)={d^2\over dx\,^2}f={d^2\,f\over dx\,^2}={d^2\,y\over dx\,^2}$$
The third derivative is
$$y'''
=f'''(x)={d^3\over dx\,^3}f={d^3\,f\over dx\,^3}={d^3\,y\over dx\,^3}$$
And, generally, we can put on a `prime' for each derivative taken. Or
write
$${d^n\over dx\,^n}f={d^n\,f\over dx\,^n}={d^n\,y\over dx\,^n}$$
for the $n$th derivative. There is yet another notation for high order
derivatives where the number of `primes' would become unwieldy:
$${d^n\,f\over dx\,^n}=f^{(n)}(x)$$
as well.

The geometric interpretation of the higher derivatives is subtler than
that of the first derivative, and we won't do much in this direction,
except for the next little section.






\vskip15pt\hrule\vskip12pt


\ex Find $f"(x)$ for $f(x)=x^3-5x+1$.

\ex Find $f"(x)$ for $f(x)=x^5-5x^2+x-1$.

\ex Find $f"(x)$ for $f(x)=\sqrt{x^2-x+1}$.

\ex Find $f"(x)$ for $f(x)=\sqrt{x}$.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Inflection points, concavity upward and downward}



A {\bf point of inflection} of the graph of a function $f$ is a point
where the {\it  second} derivative $f''$ is $0$. We have to wait a
minute to clarify the geometric meaning of this.

A piece of the graph of $f$ is {\bf concave upward} if the curve
`bends' upward. For example, the popular parabola $y=x^2$ is concave
upward in its entirety.

A piece of the graph of $f$ is {\bf concave downward} if the curve
`bends' downward. For example, a `flipped' version $y=-x^2$ of the
popular parabola is concave downward in its entirety.

The relation of {\it  points of inflection} to {\it  intervals where the
curve is concave up or down} is exactly the same as the relation of
{\it  critical points} to {\it  intervals where the function is
increasing or decreasing}. That is, the points of inflection mark the
boundaries of the two different sort of behavior Further, only one
sample value of $f''$ need be taken between each pair of consecutive
inflection points in order to see whether the curve bends up or down
along that interval.

Expressing this as a systematic procedure: {\it  to find the intervals
along which $f$ is concave upward and concave downward:}



\bull Compute the {\it  second} derivative $f''$ of $f$, and {\it 
solve} the equation $f''(x)=0$ for $x$ to find all the inflection
points, which we list in order as $x_1
<x_2
<\ldots
<x_n$. (Any points of
discontinuity, etc., should be added to the list!)

\bull We need some {\it  auxiliary points}: To the left of the leftmost
inflection point $x_1$ pick any convenient point $t_o$, between each pair of
consecutive inflection points $x_i,x_{i+1}$ choose any convenient point
$t_i$, and to the right of the rightmost inflection point $x_n$ choose a
convenient point $t_n$. 

\bull Evaluate the {\it  second derivative} $f''$ at all the {\it  auxiliary}
points $t_i$. 

\bull Conclusion: if $f''(t_{i+1})>0$, then $f$ is {\it  concave
upward} on $(x_i,x_{i+1})$, while if $f''(t_{i+1})
<0$, then $f$ is {\it 
concave downward} on that interval.

\bull Conclusion: on the `outside' interval $(-\infty,x_o)$, the
function $f$ is {\it  concave upward} if $f''(t_o)>0$ and is {\it 
concave downward} if $f''(t_o)
<0$. Similarly, on $(x_n,\infty)$, the
function $f$ is {\it  concave upward} if $f''(t_n)>0$ and is {\it 
concave downward} if $f''(t_n)
<0$.



Find the inflection points and intervals of concavity up
and down of 
$$f(x)=3x^2-9x+6$$ First, the second derivative is just
$f''(x)=6$. Since this is never zero, there are {\it  not} points of
inflection. And the value of $f''$ is always $6$, so is always $>0$,
so the curve is entirely {\it  concave upward}.

Find the inflection points and intervals of concavity up
and down of 
$$f(x)=2x^3-12x^2+4x-27$$ 
First, the second derivative is
$f''(x)=12x-24$. Thus, solving $12x-24=0$, there is just the one
inflection point, $2$. Choose auxiliary points $t_o=0$ to the left
of the inflection point and $t_1=3$ to the right of the inflection
point. Then $f''(0)=-24<0$, so on $(-\infty,2)$ the curve is concave
{\it  downward}. And $f''(2)=12>0$, so on $(2,\infty)$ the curve is concave
{\it  upward}.

Find the inflection points and intervals of concavity up
and down of 
$$f(x)=x^4-24x^2+11$$ 
the second derivative is 
$f''(x)=12x^2-48$. Solving the equation $12x^2-48=0$, we find
inflection points $\pm 2$. Choosing auxiliary points $-3,0,3$ placed
between and to the left and right of the inflection points, we
evaluate the second derivative: First, $f''(-3)=12\cdot 9-48>0$, so the curve
is concave {\it  upward} on $(-\infty,-2)$. Second, $f''(0)=-48
<0$, so
the curve is concave {\it  downward} on $(-2,2)$. Third, 
$f''(3)=12\cdot 9-48>0$, so the curve
is concave {\it  upward} on $(2,\infty)$.





\vskip15pt\hrule\vskip12pt

\ex Find the inflection points and intervals of concavity up
and down of $f(x)=3x^2-9x+6$.

\ex Find the inflection points and intervals of concavity up
and down of $f(x)=2x^3-12x^2+4x-27$.

\ex Find the inflection points and intervals of concavity up
and down of $f(x)=x^4-2x^2+11$.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Another differential equation: projectile motion}




Here we encounter the fundamental idea that {\it if $s=s(t)$ is
position, then $\dot{s}$ is velocity, and $\dot{s}\dot{}$ is
acceleration.} This idea occurs in all basic physical science and
engineering.

In particular, for a projectile near the earth's surface
travelling straight up and down, ignoring air resistance, acted upon
by no other forces but {\it gravity}, we have 
$$\hbox{ acceleration due to gravity }= -32 \hbox{ feet/sec }^2$$ 
Thus, letting $s(t)$ be position at time $t$, we have
$$\ddot{s}(t)=-32$$ We take this (approximate) {\it physical fact} as
our starting point. 

From $\ddot{s}=-32$ we {\it integrate} (or {\it
anti-differentiate}) once to undo one of the 
derivatives, getting back to {\it velocity}:
$$v(t)=\dot{s}=\dot{s}(t)=-32t+v_o$$
where we are calling the {\it constant of integration}
`$v_o$'. (No matter which constant $v_o$ we might take, the derivative
of $-32t+v_o$ with respect to $t$ is $-32$.)

Specifically, when $t=0$, we have
$$v(o)=v_o$$
Thus, the constant of integration $v_o$ is {\bf initial velocity}. And
we have this formula for the velocity at {\it any} time in terms of
{\it initial} velocity.

We integrate once more to undo the last derivative, getting
back to the {\it position} function itself:
$$s=s(t)=-16t^2+v_ot+s_o$$
where we are calling the constant of integration
`$s_o$'. Specifically, when $t=0$, we have
$$s(0)=s_o$$
so $s_o$ is {\bf initial position}. Thus, we have a formula for
position at {\it any} time in terms of {\it initial position} and {\it 
initial velocity}.

Of course, in many problems the data we are given is {\it 
not} just the initial position and initial velocity, but something
else, so we have to determine these constants indirectly.






\vskip15pt\hrule\vskip12pt

 

\ex   You drop a rock down a deep
well, and it takes $10$ seconds to hit the bottom. How deep is it?

\ex You drop a rock down a
well, and the rock is going $32$ feet per second when it hits bottom.
How deep is the well?

\ex If I throw a ball straight up and it takes $12$ seconds
for it to go up and come down, how high did it go? 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Graphing rational functions, asymptotes}




This section shows another kind of function whose graphs we can
understand effectively by our methods. There is one new item here, the
idea of {\it asymptote} of the graph of a function.

A {\bf vertical asymptote} of the graph of a function $f$ most
commonly occurs when $f$ is defined as a {\it  ratio} $f(x)=g(x)/h(x)$
of functions $g,h$ continuous at a point $x_o$, but with the
denominator going to zero at that point while the numerator
doesn't. That is, $h(x_o)=0$ but $g(x_o)\not=0$. Then we say that $f$
{\it  blows up} at $x_o$, and that the line $x=x_o$ is a {\bf vertical
asymptote} of the graph of $f$.

And as we take $x$ closer and closer to $x_o$, the graph of $f$ zooms
off (either up or down or both) {\it  closely to the line} $x=x_o$.

A very simple example of this is $f(x)=1/(x-1)$, whose denominator is
$0$ at $x=1$, so causing a {\it  blow-up} at that point, so that $x=1$
is a {\it  vertical asymptote}. And as $x$ approaches $1$ from the
right, the values of the function zoom {\it  up} to $+\infty$. When $x$
approaches $1$ from the {\it  left}, the values zoom {\it  down} to
$-\infty$.

A {\bf horizontal asymptote} of the graph of a function $f$
occurs if either limit
$$\lim_{x\rightarrow +\infty}f(x)$$
or
$$\lim_{x\rightarrow -\infty}f(x)$$
exists. If $R=\lim_{x\rightarrow +\infty}f(x)$, then $y=R$ is a {\bf
horizontal asymptote} of the function, and if $L=\lim_{x\rightarrow
-\infty}f(x)$ exists then $y=L$ is a horizontal asymptote.

As $x$ goes off to $+\infty$ the graph of the function gets closer and
closer to the horizontal line $y=R$ if {\it  that} limit exists. As $x$
goes of to $-\infty$ the graph of the function gets closer and
closer to the horizontal line $y=L$ if {\it  that} limit exists.

So in rough terms {\it  asymptotes} of a function are {\it 
straight lines} which the graph of the function approaches {\it  at
infinity}. In the case of {\it  vertical asymptotes}, it is the
$y$-coordinate that goes off to infinity, and in the case of {\it 
horizontal asymptotes} it is the $x$-coordinate which goes off to
infinity.

Find asymptotes, critical points, intervals of increase and
decrease, inflection points, and intervals of concavity up and down of
$f(x)={x+3\over 2x-6}$: First, let's find the asymptotes. The
denominator is $0$ for $x=3$ (and this is {\it  not} cancelled by the
numerator) so the line $x=3$ is a {\it  vertical asymptote}. And as $x$
goes to $\pm\infty$, the function values go to $1/2$, so the line
$y=1/2$ is a horizontal asymptote.

The derivative is 
$$f'(x)={1\cdot(2x-6)-(x+3)\cdot
2\over (2x-6)^2}={-12\over (2x-6)^2}$$
Since a ratio of polynomials can be zero only if the numerator is
zero, this $f'(x)$ can {\it  never} be zero, so there are {\it  no
critical points}. There is, however, the discontinuity at $x=3$ which
we must take into account. Choose auxiliary points $0$ and $4$ to the
left and right of the discontinuity. Plugging in to the derivative, we
have
$f'(0)=-12/(-6)^2
<0$, so the function is {\it  decreasing} on the
interval $(-\infty,3)$. To the right, $f'(4)=-12/(8-6)^2
<0$, so the
function is also decreasing on $(3,+\infty)$.

The second derivative is $f''(x)=48/(2x-6)^3$. This is never zero, so
there are {\it  no inflection points}. There is the discontinuity at
$x=3$, however. Again choosing auxiliary points $0,4$ to the left and
right of the discontinuity, we see $f''(0)=48/(-6)^3
<0$ so the curve is {\it 
concave downward} on the interval $(-\infty,3)$. And
$f''(4)=48/(8-6)^3>0$, so the curve is concave {\it  upward} on
$(3,+\infty)$.

Plugging in just two or so values into the function then is enough to
enable a person to make a fairly good qualitative sketch of the graph
of the function.






\vskip15pt\hrule\vskip12pt

\ex Find all asymptotes of $f(x)={ x-1 \over x+2 }$.

\ex Find all asymptotes of $f(x)={ x+2 \over x-1 }$.

\ex Find all asymptotes of $f(x)={ x^2-1 \over x^2-4 }$.

\ex Find all asymptotes of $f(x)={ x^2-1 \over x^2+1 }$.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Basic integration formulas}



The fundamental {\it use} of {\it integration} is as a {\it continuous
version of summing}. But, paradoxically, often integrals are {\it 
computed} by viewing integration as essentially an {\it inverse
operation to differentiation}. (That fact is the so-called {\it 
Fundamental Theorem of Calculus}.)

The notation, which we're stuck with for historical reasons,
is as peculiar as the notation for derivatives: the {\bf integral of a
function $f(x)$ with respect to $x$} is written as

$$\int f(x)\;dx$$

The remark that integration is (almost) an inverse to the operation of
differentiation means that if
$${d\over dx}f(x)=g(x)$$
then
$$\int g(x)\;dx=f(x)+C$$
The extra $C$, called the {\bf constant of integration}, is really
necessary, since after all differentiation kills off constants, which
is why integration and differentiation are not {\it exactly} inverse
operations of each other.

Since integration is {\it almost} the inverse operation of
differentiation, recollection of formulas and processes for {\it 
differentiation} already tells the most important formulas for {\it 
integration:}

$$\matrix{
\int x^n\; dx &=& {1\over n+1}x^{n+1}+C\;\;\;\;\;
\hbox{ unless $n=-1$ }\cr 
\int e^x \;dx&=& e^x+C \cr 
\int {1\over x} \;dx&=& \ln x+C \cr 
\int \sin x\;dx&=&-\cos x+C \cr 
\int \cos x\;dx&=& \sin x + C\cr 
\int \sec^2 x\;dx&=&\tan x+C \cr 
\int {1\over 1+x^2} \; dx&=&\arctan x+C
}$$

And since the derivative of a sum is the sum of the derivatives, the
{\it integral of a sum is the sum of the integrals:}
$$ \int f(x)+g(x)\;dx=\int f(x)\;dx+\int g(x)\;dx$$
And, likewise, constants `go through' the integral sign:
$$\int c\cdot f(x)\;dx=c\cdot \int f(x)\;dx$$

For example, it is easy to integrate polynomials, even
including terms like $\sqrt{x}$ and more general power functions. The
only thing to watch out for is terms $x^{-1}={1\over x}$, since these
integrate to $\ln x$ instead of a power of $x$. So
$$\int 4x^5-3x+11-17\sqrt{x}+{3\over x}\;dx=
{4x^6\over 6}-{3x^2\over 2}+11x-{ 17x^{3/2} \over 3/2 }+3\ln x+C$$
Notice that we need to include just one `constant of integration'.

Other basic formulas obtained by reversing differentiation
formulas: 
$$\matrix{
\int a^x \;dx&=& {a^x\over \ln a}+C \cr 
\int \log_a\,x\;dx&=&{1\over \ln a}\cdot{1\over x}+C \cr 
\int { 1 \over \sqrt{1-x^2 }} \; dx&=&\arcsin x+C\cr 
\int { 1 \over x\sqrt{x^2-1 }} \; dx&=&\hbox{ arcsec}\, x+C
}$$

Sums of constant multiples of all these functions are easy to
integrate: for example,
$$\int 5\cdot 2^x-{ 23 \over x\sqrt{x^2-1 }}+5x^2\;dx=
{5\cdot 2^x\over \ln 2}-23\,\hbox{arcsec}\,x+{5x^3\over 3}+C$$





\vskip15pt\hrule\vskip12pt

\ex $\int 4x^3-3\cos x+{ 7 \over x }+2\;dx=?$

\ex   $\int 3x^2+e^{2x}-11+\cos x\,dx=?$

\ex   $\int \sec^2 x\,dx=?$

\ex $\int { 7 \over 1+x^2 }\; dx=?$

\ex $\int 16x^7-\sqrt{x}+{ 3 \over \sqrt{x }}\; dx=?$

\ex $\int 23 \sin x-{ 2 \over \sqrt{1-x^2 }}\; dx=?$


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The simplest substitutions}



The simplest kind of chain rule application
$${d\over dx}f(ax+b)=a\cdot f'(x)$$ (for constants $a,b$) can easily
be run backwards to obtain the corresponding integral formulas: some
and illustrative important examples are

$$\matrix{
\int \cos(ax+b)\;dx &=&{1\over a}\cdot \sin(ax+b)+C\cr 
\int e^{ax+b}\;dx &=& {1\over a}\cdot e^{ax+b}+C\cr 
\int \sqrt{ax+b}\;dx &=& {1\over a}\cdot { (ax+b)^{3/2} \over 3/2 }+C\cr 
\int {1\over ax+b}\;dx &=& {1\over a}\cdot \ln (ax+b)+C
}$$

Putting numbers in instead of letters, we have examples like

$$\matrix{
\int \cos(3x+2)\;dx&=&{1\over 3}\cdot \sin(3x+2)+C\cr 
\int e^{4x+3}\;dx&=&{1\over 4}\cdot e^{4x+3}+C\cr 
\int \sqrt{-5x+1}\;dx&=&{1\over -5}\cdot { (-5x+1)^{3/2} \over 3/2 }+C\cr 
\int {1\over 7x-2}\;dx&=&{1\over 7}\cdot \ln (7x-2)+C
}$$

Since this kind of substitution is pretty undramatic, and a
person should be able to do such things {\it by reflex} rather than
having to think about it very much.





\vskip15pt\hrule\vskip12pt

\ex $\int e^{3x+2}\; dx=?$

\ex $\int \cos(2-5x)\; dx=?$

\ex $\int \sqrt{3x-7}\; dx=?$

\ex $\int \sec^2({2x+1})\; dx=?$

\ex   $\int (5x^7+e^{6-2x}+23+{ 2 \over x })\,dx=?$

\ex   $\int \cos(7-11x)\,dx=?$


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Substitutions}



The {\it chain rule} can also be `run backward', and is called {\bf
change of variables} or {\bf substitution} or sometimes {\bf
u-substitution}. Some examples of what happens are straightforward,
but others are less obvious. It is at this point that the capacity to
{\it recognize derivatives} from past experience becomes very
helpful. 

{\it Example} Since (by the chain rule)
$${d\over dx} e^{\sin x}=\cos x\;e^{\sin x}$$
then we can anticipate that
$$\int \cos x\;e^{\sin x}\; dx= e^{\sin x}+C$$

{\it Example} Since (by the chain rule)
$${d\over dx} \sqrt{x^5+3x}={1\over 2}(x^5+3x)^{-1/2}\cdot(5x^4+3)$$
then we can anticipate that
$$\int {1\over 2}(5x^4+3)(x^5+3x)^{-1/2}\;dx=\sqrt{x^5+3x}+C$$

Very often it happens that things are {\it off by a
constant}. This should not deter a person from recognizing the
possibilities. For example: since, by the chain rule,
$${d\over dx}\sqrt{5+e^x}={1\over 2}(5+e^x)^{-1/2}\cdot e^x$$
then
$$\int e^x\,(5+e^x)^{-1/2}\;dx=2\int {1\over 2}e^x(5+e^x)^{-1/2}\;dx=
2\,\sqrt{5+e^x}+C$$
Notice how for `bookkeeping purposes' we put the ${1\over 2}$ into
the integral (to make the constants right there) and put a
compensating $2$ outside. 

{\it Example}: Since (by the chain rule)
$${d\over dx}\sin^7(3x+1)=7\cdot \sin^6(3x+1)\cdot \cos (3x+1)\cdot
3$$
then we have
$$\int \cos(3x+1)\,\sin^6(3x+1)\;dx$$
$$={1\over 21}\int 7\cdot 3\cdot \cos(3x+1) \sin^6(3x+1)\; dx=
{1\over 21} \sin^7(3x+1)+C$$






\vskip15pt\hrule\vskip12pt

\ex   $\int \cos x\,\sin x\,dx=?$

\ex $\int 2x \;e^{x^2}\;dx=?$

\ex $\int 6x^5\;e^{x^6}\; dx=?$

\ex $\int { \cos x \over \sin x }\; dx=?$

\ex $\int \cos x e^{\sin x}\; dx=?$

\ex $\int { 1 \over 2\sqrt{x }}e^{\sqrt{x}}\; dx=?$

\ex $\int \cos x \sin^5 x\; dx=?$

\ex $\int \sec^2 x \tan^7 x\; dx=?$

\ex  $\int (3\cos x+ x)\,e^{6\sin  x+x^2}\,dx=?$

\ex  $\int e^x\sqrt{e^x+1}\,dx=?$

\vfill\break
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Area and definite integrals}




The actual {\it definition} of `integral' is as a limit of sums, which
might easily be viewed as having to do with {\it area}. One of the
original issues integrals were intended to address was computation of
area.

First we need more notation. Suppose that we have a function
$f$ whose integral is another function $F$:
$$\int f(x)\;dx=F(x)+C$$
Let $a,b$ be two numbers. Then the {\bf definite integral} of $f$ {\bf
with limits} $a,b$ is
$$\int_a^b f(x)\;dx=F(b)-F(a)$$
The left-hand side of this equality is just {\it notation} for the
definite integral. The use of the word `limit' here has little to do
with our earlier use of the word, and means something more like
`boundary', just like it does in more ordinary English. 

A similar notation is to write
$$[g(x)]_a^b=g(b)-g(a)$$
for any function $g$. So we could also write
$$\int_a^b f(x)\;dx=[F(x)]_a^b$$

For example,
$$\int_0^5
x^2\;dx=[{x^3\over 3}]_0^5={5^3-0^3\over 3}={125\over 3}$$
As another example,
$$\int_2^3 3x+1 \;dx=[{3x^2\over 2}+x]_2^3
=({3\cdot 3^2\over 2}+3)-({3\cdot 2^2\over 2}+2)={21\over 2}$$

All the other integrals we had done previously would be
called {\bf indefinite integrals} since they didn't have `limits'
$a,b$. So a {\it definite} integral is just the difference of two
values of the function given by an {\it indefinite} integral. That is,
there is almost nothing new here except the idea of evaluating the
function that we get by integrating.

But now we {\it can} do something new: compute {\it areas}:

For example, if a function $f$ is {\it positive} on an
interval $[a,b]$, then
$$\int_a^b f(x)\;dx = \hbox{ area between graph and $x$-axis, between
$x=a$ and $x=b$}$$
It is important that the function be {\it positive}, or the result is
false.

For example, since $y=x^2$ is certainly always positive (or
at least non-negative, which is really enough), the area `under the
curve' (and, implicitly, above the $x$-axis) between $x=0$ and $x=1$
is just
$$\int_0^1 x^2\;dx=[{x^3\over 3}]_0^1={1^3-0^3\over 3}={1\over 3}$$

More generally, {\it the area below $y=f(x)$, above $y=g(x)$,
and between $x=a$ and $x=b$ is}
$$\hbox{ area... }=\int_a^b f(x)-g(x) \;dx$$
$$=\int_{\hbox{\it left limit}}^{\hbox{\it right limit}} 
(\hbox{\it upper curve - lower curve}) \;dx$$
It is important that $f(x)\ge g(x)$ throughout the interval $[a,b]$.

For example, the area below $y=e^x$ and above $y=x$, and
between $x=0$ and $x=2$ is
$$\int_0^2 e^x-x\;dx=[e^x-{x^2\over 2}]_0^2=(e^2-2)-(e^0-0)=e^2+1$$
since it really is true that $e^x\ge x$ on the interval $[0,2]$.

As a person might be wondering, in general it may be not so
easy to tell whether the graph of one curve is above or below
another. The procedure to examine the situation is as follows: given
two functions $f,g$, to find the intervals where $f(x)\le g(x)$ and
vice-versa: 

\bull Find where the graphs cross by solving $f(x)=g(x)$ for $x$ to
find the $x$-coordinates of the points of intersection.
\bull Between any two solutions $x_1,x_2$ of $f(x)=g(x)$ (and also to the
left and right of the left-most and right-most solutions!), plug in
{\it one} auxiliary point of your choosing to see which function is larger.

Of course, this procedure works for a similar reason that the {\it 
first derivative test} for local minima and maxima worked: we
implicitly assume that the $f$ and $g$ are {\it continuous}, so if the
graph of one is above the graph of the other, then the situation can't
{\it reverse} itself without the graphs actually {\it crossing}.

As an example, and as an example of a certain delicacy of
wording, consider the problem to {\it find the area between $y=x$ and
$y=x^2$ with $0\le x\le 2$}. To find where $y=x$ and $y=x^2$ {\it 
cross}, solve $x=x^2$: we find solutions $x=0,1$. In the present
problem we don't care what is happening to the left of $0$. Plugging
in the value $1/2$ as auxiliary point between $0$ and $1$, we get
${1\over 2}\ge ({1\over 2})^2$, so we see that in $[0,1]$ the curve
$y=x$ is the higher. To the right of $1$ we plug in the auxiliary
point $2$, obtaining $2^2\ge 2$, so the curve $y=x^2$ is higher
there.

Therefore, the area between the two curves has to be broken into two
parts:
$$\hbox{ area }=\int_0^1 (x-x^2)\; dx+\int_1^2 (x^2-x)\; dx$$
since we must always be integrating in the form
$$\int_{\hbox{\it left}}^{\hbox{\it right}} \hbox{higher - lower}\;dx$$

In some cases the `side' boundaries are redundant or only
{\it implied}. For example, the question might be to {\it find the
area between the curves $y=2-x$ and $y=x^2$}. What is implied here is
that these two curves themselves enclose one or more {\it finite}
pieces of area, without the need of any `side' boundaries of the form
$x=a$. First, we need to see where the two curves intersect, by
solving $2-x=x^2$: the solutions are $x=-2,1$. So we {\it infer} that
we are supposed to find the area from $x=-2$ to $x=1$, and that the
two curves {\it close up} around this chunk of area without any need
of assistance from vertical lines $x=a$. We need to find which curve
is higher: plugging in the point $0$ between $-2$ and $1$, we see that
$y=2-x$ is higher. Thus, the desired integral is 
$$\hbox{ area... }=\int_{-2}^1 (2-x)-x^2 \; dx$$






\vskip15pt\hrule\vskip12pt

\ex Find the area between the curves $y=x^2$ and
$y=2x+3$.

\ex Find the area of the region bounded vertically by
$y=x^2$ and $y=x+2$ and bounded horizontally by $x=-1$ and $x=3$.

\ex Find the area between the curves $y=x^2$ and
$y=8+6x-x^2$.

\ex   Find the area between the curves $y=x^2+5$ and
$y=x+7$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Lengths of Curves}




The basic point here is {\it a formula obtained by using the ideas of
calculus}: the length of the graph of $y=f(x)$ from $x=a$ to $x=b$ is
$$\hbox{ arc length
}=\int_a^b\;\sqrt{1+\left({dy\over dx}\right)^2}\;dx$$ Or, if the
curve is {\it parametrized} in the form $$x=f(t)\;\;\;\;\;y=g(t)$$
with the parameter $t$ going from $a$ to $b$, then $$\hbox{ arc length
}=\int_a^b\;
\sqrt{\left({dx\over dt}\right)^2+\left({dy\over dt}\right)^2}\;dt$$

This formula comes from approximating the curve by straight
lines connecting successive points on the curve, using the Pythagorean
Theorem to compute the lengths of these segments in terms of the
change in $x$ and the change in $y$. In one way of writing, which also
provides a good {\it heuristic} for remembering the formula, if a small
change in $x$ is $dx$ and a small change in $y$ is $dy$, then the
length of the hypotenuse of the right triangle with base $dx$ and
altitude $dy$ is (by the Pythagorean theorem)
$$\hbox{ hypotenuse }=\sqrt{dx^2+dy^2}=
\sqrt{1+\left({dy\over dx}\right)^2}\;dx$$

Unfortunately, by the nature of this formula, most of the
integrals which come up are {\it difficult} or {\it impossible} to
`do'. But if one of these really mattered, we could still estimate it
by {\it numerical integration}.






\vskip15pt\hrule\vskip12pt


\ex Find the length of the curve $y=\sqrt{1-x^2}$ from $x=0$ to $x=1$.

\ex Find the length of the curve
$y={ 1 \over 4 }(e^{2x}+e^{-2x})$ from $x=0$ to $x=1$.

\ex Set up (but do not evaluate) the integral to find the length of
the piece of the parabola $y=x^2$ from $x=3$ to $x=4$.

\vfill\break
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Numerical integration}




As we start to see that integration `by formulas' is a much more
difficult thing than differentiation, and sometimes is impossible to
do in elementary terms, it becomes reasonable to ask for {\it 
numerical approximations to definite integrals}. Since a {\it 
definite} integral is just a {\it number}, this is possible. By
constrast, {\it indefinite} integrals, being {\it functions} rather
than just numbers, are not easily described by `numerical
approximations'.

There are several related approaches, all of which use the idea that
a definite integral is related to {\it area}. Thus, each of these
approaches is really essentially a way of approximating area under a
curve. Of course, this isn't exactly right, because integrals are not
exactly areas, but thinking of area is a reasonable heuristic.

Of course, an approximation is not very valuable unless there is an
{\it estimate for the error}, in other words, an idea of the {\it 
tolerance}. 

Each of the approaches starts the same way: To approximate
$\int_a^bf(x)\;dx$, break the interval $[a,b]$ into smaller subintervals
$$[x_0,x_1],\;\;[x_1,x_2],\;\;\ldots,[x_{n-2},x_{n-1}],\;\;[x_{n-1},x_n]$$
each of the same length
$$ \Delta x={b-a\over n}$$ 
and where $x_0=a$ and $x_n=b$. 

{\bf Trapezoidal rule}: This rule says that
$$\int_a^bf(x)\;dx \approx {\Delta x\over 2}
[f(x_0)+2f(x_1)+2f(x_2)+\ldots+2f(x_{n-2})+2f(x_{n-1})+f(x_n)]$$ Yes,
all the values have a factor of `2' except the first and the
last. (This method approximates the area under the curve by {\it 
trapezoids} inscribed under the curve in each subinterval).

{\bf Midpoint rule}: Let
$\overline{x}_i={1\over 2}(x_i-x_{i-1})$ be the midpoint of the
subinterval $[x_{i-1},x_i]$. Then the {\bf midpoint rule} says that
$$\int_a^b f(x)\;dx \approx \Delta
x[f(\overline{x}_1)+\ldots+f(\overline{x}_n)]$$
(This method approximates the area under the curve by rectangles whose
height is the midpoint of each subinterval).

{\bf Simpson's rule}: This rule says that
$$\int_a^bf(x)\;dx \approx $$
$$\approx {\Delta x\over 3}
[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+\ldots+2f(x_{n-2})+4f(x_{n-1})+f(x_n)]$$
Yes, the first and last coefficients are `1', while the `inner'
coefficients alternate `4' and `2'. And $n$ has to be an {\it even}
integer for this to make sense. (This method approximates the curve by
pieces of parabolas). 

In general, the smaller the $\Delta x$ is, the better these
approximations are. We can be more precise: the error estimates for
the trapezoidal and midpoint rules depend upon the {\it second
derivative}: suppose that $|f''(x)|\le
M$ for some constant $M$, for all $a\le x\le b$. Then
$$\hbox{ error in trapezoidal rule }\le {M(b-a)^3\over 12n^2}$$
$$\hbox{ error in midpoint rule }\le {M(b-a)^3\over 24n^2}$$
 The error estimate for Simpson's rule depends on the {\it fourth}
derivative: suppose that $|f^{(4)}(x)|\le
N$ for some constant $N$, for all $a\le x\le b$. Then
$$\hbox{ error in Simpson's rule }\le {N(b-a)^5\over 180n^4}$$

From these formulas estimating the error, it looks like the
midpoint rule is always better than the trapezoidal rule. And for high
accuracy, using a large number $n$ of subintervals, it looks like
Simpson's rule is the best.






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Averages and Weighted Averages}




The usual notion of {\it average} of a list of $n$ numbers
$x_1,\ldots,x_n$ is
$$\hbox{ average of }
x_1,x_2,\ldots,x_n={x_1+x_2+\ldots+x_n\over n}$$

A {\it continuous} analogue of this can be obtained as an integral,
using a notation which matches better: let $f$ be a function on an
interval $[a,b]$. Then
$$\hbox{ average value of $f$ on the interval }[a,b]=
{\int_a^b f(x)\;dx\over b-a}$$

For example the {\it average} value of the function $y=x^2$
over the interval $[2,3]$ is
$$\hbox{ average value of $f$ on the interval }[a,b]=
{\int_2^3 x^2\;dx\over 3-2}={[x^3/3]_2^3 \over 3-2}= {3^3-2^3 \over
3\cdot (3-2)} = 19/3$$

A {\bf weighted average} is an average in which some of the
items to be averaged are {\it `more important'} or {\it `less
important'} than some of the others. The {\it weights} are
(non-negative) numbers which measure the relative importance.

For example, the {\it weighted average} of a list of numbers
$x_1,\ldots,x_n$ with corresponding weights $w_1,\ldots,w_n$ is
$${w_1\cdot x_1+w_2\cdot x_2+\ldots+w_n\cdot
x_n\over w_1+w_2+\ldots+w_n}$$
Note that if the weights are all just $1$, then the weighted average
is just a plain average.

The {\it continuous analogue} of a weighted average
can be obtained as an integral,
using a notation which matches better: let $f$ be a function on an
interval $[a,b]$, with {\it weight} $w(x)$, a non-negative function on
$[a,b]$. Then
$$\hbox{ weighted average value of $f$ on the interval }[a,b] \hbox{
with weight } w =
{\int_a^b w(x)\cdot f(x)\;dx\over \int_a^b w(x) \;dx}$$
Notice that in the special case that the weight is just $1$ all the
time, then the weighted average is just a plain average.

For example the {\it average} value of the function $y=x^2$
over the interval $[2,3]$ with weight $w(x)=x$ is
$$\hbox{ average value of $f$ on the interval }[a,b] \hbox{
with weight } x $$
$$={\int_2^3 x\cdot x^2\;dx\over \int_2^3 x\;dx}
={[x^4/4]_2^3 \over [x^2/2]_2^3}= {{1\over 4}(3^4-2^4) \over
{1\over 2}(3^2-2^2)}$$






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Centers of Mass (Centroids) }




For many (but certainly not all!) purposes in physics and mechanics,
it is necessary or useful to be able to consider a physical object as
being a mass concentrated at a single point, its {\it geometric
center}, also called its {\bf centroid}. {\it The centroid is essentially
the `average' of all the points in the object.} For simplicity, we will
just consider the two-dimensional version of this, looking only at
regions in the plane.

The simplest case is that of a rectangle: it is pretty clear
that the centroid is the `center' of the rectangle. That is, if the
corners are $(0,0), (u,0), (0,v)$ and $(u,v)$, then the centroid is
$$({u\over 2},{v\over 2})$$
The formulas below are obtained by `integrating up' this simple idea:

For the center of mass (centroid) of the plane region
described by $f(x)\le y\le g(x)$ and $a\le x\le b$, we have

$$\hbox{ $x$-coordinate of the centroid }= \hbox{ average $x$-coordinate}$$
$$={\int_a^b x[g(x)-f(x)]\;dx\over \int_a^b [g(x)-f(x)]\;dx}$$
$$
={ \int_{\hbox{\it left}}^{\hbox{\it right}} x[\hbox{\it upper}-\hbox{\it lower}]\;dx \over \int_{\hbox{\it left }}^{\hbox{\it right }} [\hbox{\it upper}-\hbox{\it lower}]\;dx } 
={ \int_{\hbox{\it left }}^{\hbox{\it right }} x[\hbox{\it upper}-\hbox{\it lower}]\;dx \over \hbox{ area of the region } }$$
And also
$$\hbox{ $y$-coordinate of the centroid }= \hbox{ average
$y$-coordinate}$$ $$={\int_a^b {1\over 2}[g(x)^2-f(x)^2]\;dx \over 
\int_a^b [g(x)-f(x)]\;dx}$$ $$
={\int_{\hbox{\it left }}^{\hbox{\it right }} {1\over 2}[\hbox{\it upper}^2-\hbox{\it
lower}^2]\;dx 
\over
\int_{\hbox{\it left }}^{\hbox{\it right }} [\hbox{\it upper}-\hbox{\it lower}]\;dx}
={\int_{\hbox{\it left }}^{\hbox{\it right }} {1\over 2}[\hbox{\it upper}^2-\hbox{\it
lower}^2]\;dx
\over 
\hbox{ area of the region }}$$

{\it Heuristic:} For the $x$-coordinate: 
there is an amount
$(g(x)-f(x))dx$ of the region at distance $x$ from the $y$-axis. This is
integrated, and then {\it 
averaged} dividing by the {\it total}, that is, dividing by
the {\it area} of the entire region.

For the $y$-coordinate: in each vertical band of width $dx$ there is
amount $dx\;dy$ of the region at distance $y$ from the $x$-axis. This
is integrated up and then averaged by dividing by the total area.

For example, let's find the centroid of the region bounded by
$x=0$, $x=1$, $y=x^2$, and $y=0$.
$$\hbox{ $x$-coordinate of the centroid }=
{\int_0^1 x[x^2-0]\;dx\over \int_0^1 [x^2-0]\;dx}$$
$$={[x^4/4]_0^1 \over [x^3/3]_0^1} = {1/4-0 \over 1/3-0}={3 \over 4}$$
And

$$\hbox{ $y$-coordinate of the centroid }= 
{\int_0^1 {1\over 2}[(x^2)^2-0]\;dx \over \int_0^1 [x^2-0]\;dx}$$
$$={{1\over 2}[x^5/5]_0^1 \over [x^3/3]_0^1}={{1\over 2}(1/5-0) \over
1/3-0}={3 \over 10}$$






\vskip15pt\hrule\vskip12pt

\ex Find the center of mass (centroid) of the region $0\leq x\leq 1$
and $0\leq y\leq x^2$.

\ex Find the center of mass (centroid) of the region defined by
$0\leq x\leq 1, 0\leq y\leq 1$ and $x+y\leq 1$.

\ex Find the center of mass (centroid) of a homogeneous plate in the
shape of an equilateral triangle.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Volumes by Cross Sections}




Next to computing areas of regions in the plane, the easiest {\it 
concept} of application of the ideas of calculus is to computing
volumes of solids where somehow we know a formula for the {\it areas
of slices}, that is, {\it areas of cross sections}. Of course, in any
particular example, the actual issue of getting the formula for the
cross section, and figuring out the appropriate limits of integration,
can be difficult.

The idea is to
just `add them up':
$$\hbox{ volume }=\int_{\hbox{left limit}}^{\hbox{right limit}} 
\hbox{ (area of cross section at $x$) }\;dx$$
where in whatever manner we describe the solid it extends from
$x=${\it left limit} to $x=${\it right limit}. We must suppose
that we have some reasonable {\it formula} for the area of the cross
section.

For example, let's find the volume of a solid ball of radius $1$. (In
effect, we'll be deriving the formula for this). We can
suppose that the ball is centered at the origin. Since the radius is
$1$, the range of $x$ coordinates is from $-1$ to $+1$, so $x$ will be
integrated from $-1$ to $+1$. At a particular value of $x$, what does
the cross section look like? A disk, whose radius we'll have to
determine. To determine this radius, look at how the solid ball
intersects the $x,y$-plane: it intesects in the disk $x^2+y^2\le
1$. For a particular value of $x$, the values of $y$ are between
$\pm\sqrt{1-x^2}$. This line segment, having $x$ fixed and $y$ in this
range, is the intersection of the cross section disk with the
$x,y$-plane, and in fact is a {\it diameter} of that cross section
disk. Therefore, the radius of the cross section disk at $x$ is
$\sqrt{1-x^2}$. Use the formula that the area of a disk of radius $r$
is $\pi r^2$: the area of the cross section is
$$\hbox{ cross section at $x$ } = \pi(\sqrt{1-x^2})^2 = \pi(1-x^2) $$
Then integrate this from $-1$ to $+1$ to get the volume:
$$\hbox{ volume } = \int_{\rm left}^{\rm right}\,\hbox{area of
cross-section}\,dx $$ 
$$
= \int_{-1}^{+1}\, \pi(1-x^2)\,dx = \pi[x-{x^3\over 3}]_{-1}^{+1}
= \pi[(1-{1\over 3}) - (-1-{(-1)^3 \over 3})] = {2\over 3} + {2\over
3} 
= {4\over 3} $$






\vskip15pt\hrule\vskip12pt

\ex   Find the volume of a circular cone of radius $10$
and height $12$ (not by a formula, but by cross sections).

\ex Find the volume of a cone whose base is a {\it square}
of side $5$ and whose height is $6$, by cross-sections.

\ex A hole $3$ units in radius is drilled out along a diameter
of a solid sphere of radius $5$ units. What is the volume of the
remaining solid?

\ex A solid whose base is a disc of radius $3$ has
vertical cross sections which are {\it squares}. What is the volume?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Solids of Revolution}




Another way of computing volumes of some special types of solid
figures applies to solids obtained by {\it rotating plane regions}
about some axis.

If we rotate the plane region described by $f(x)\le y\le g(x)$
and $a\le x\le b$ {\bf around the $x$-axis}, the volume of the resulting
solid is
$$\hbox{ volume }=\int_a^b \pi (g(x)^2-f(x)^2)\;dx$$
$$=\int_{\hbox{left limit}}^{\hbox{right limit}}
 \pi (\hbox{upper curve}^2-\hbox{lower curve}^2)\;dx$$
It is necessary to suppose that $f(x)\ge 0$ for this to be right.

This formula comes from viewing the whole thing as sliced up
into slices of thickness $dx$, so that each slice is a {\it disk} of
radius $g(x)$ with a smaller disk of radius $f(x)$ removed from
it. Then we use the formula $$\hbox{ area of disk }= \pi \hbox{
radius}^2$$ and `add them all up'. The hypothesis that $f(x)\ge 0$ is
necessary to avoid different pieces of the solid `overlap' each other
by accident, thus counting the same chunk of volume {\it twice}.

If we rotate the plane region described by $f(x)\le y\le g(x)$
and $a\le x\le b$ {\bf around the $y$-axis} (instead of the $x$-axis), the
volume of the resulting solid is $$\hbox{ volume }=\int_a^b 2\pi
x(g(x)-f(x))\;dx$$
$$=\int_{\hbox{left}}^{\hbox{ right}} 
2\pi x(\hbox{ upper - lower})\;dx$$

This second formula comes from viewing the whole thing as
sliced up into thin cylindrical shells of thickness $dx$ encircling
the $y$-axis, of radius $x$ and of height $g(x)-f(x)$. The volume of each
one is 
$$\hbox{ (area of cylinder of height $g(x)-f(x)$ and radius $x$) }\cdot dx=
2\pi x(g(x)-f(x))\;dx$$ 
and `add them all up' in the integral.

As an example, let's consider the region $0\le x \le 1$ and
$x^2\le y \le x$. Note that for $0\le x \le 1$ it really is the
case that $x^2\le y \le x$, so $y=x$ is the {\it upper} curve of the
two, and $y=x^2$ is the {\it lower} curve of the two. Invoking the
formula above, the volume of the solid obtained by rotating this
plane region around the {\it x-axis} is
$$\hbox{ volume }=\int_{\hbox{left}}^{\hbox{ right}}
\pi (\hbox{upper}^2-\hbox{lower}^2)\;dx$$
$$=\int_0^1 \pi ((x)^2-(x^2)^2)\; dx = \pi [ x^3/3 - x^5/5]_0^1 =
\pi(1/3 - 1/5)$$ 

On the other hand, if we rotate this {\bf around the {\it y-}axis}
instead, then
$$\hbox{ volume }=\int_{\hbox{left}}^{\hbox{ right}}
2\pi x (\hbox{upper}-\hbox{lower})\;dx$$
$$ = \int_0^1 \, 2\pi x (x-x^2)\, dx 
= \pi\int_0^1 \, {2x^3 \over 3} - {2x^4 \over 4} \, dx 
= [{2x^3 \over 3} - {2x^4 \over 4}]_0^1 = {2\over 3} - {1\over 2} =
{1\over 6} $$






\vskip15pt\hrule\vskip12pt

\ex Find the volume of the solid obtained by rotating the
region $0\leq x\leq 1, 0\leq y\leq x$ around the $y$-axis.

\ex Find the volume of the solid obtained by rotating the
region $0\leq x\leq 1, 0\leq y\leq x$ around the $x$-axis.

\ex Set up the integral which expresses the volume of the
doughnut obtained by rotating the region $(x-2)^2+y^2\leq 1$ around
the $y$-axis.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Surfaces of Revolution}




Here is another {\it formula obtained by using the ideas of
calculus}: the area of the surface obtained by rotating the curve
$y=f(x)$ with $a\le x\le b$ around the $x$-axis is
$$\hbox{area }=\int_a^b 2\pi
f(x)\sqrt{1+\left({dy\over dx}\right)^2}\;dx$$

This formula comes from extending the ideas of the previous
section the length of a little piece of the curve is 
$$\sqrt{dx^2+dy^2}$$
This gets rotated around the perimeter of a circle of radius $y=f(x)$,
so approximately give a band of width $\sqrt{dx^2+dy^2}$ and length
$2\pi f(x)$, which has area
$$2\pi f(x)\sqrt{dx^2+dy^2}=2\pi
f(x)\sqrt{1+\left({dy\over dx}\right)^2}\;dx$$
Integrating this (as if it were a sum!) gives the formula.

As with the formula for arc length, it is very easy to obtain
integrals which are difficult or impossible to evaluate except
numerically.

Similarly, we might rotate the curve $y=f(x)$ around the
$y$-axis instead. The same general ideas apply to compute the area of
the resulting surface. The width of each little band is still
$\sqrt{dx^2+dy^2}$, but now the length is $2\pi x$ instead. So the
band has area
$$\hbox{width } \times \hbox{ length } = 2\pi x \sqrt{dx^2+dy^2}$$
Therefore, in this case the surface area is obtained by integrating
this, yielding the formula
$$\hbox{ area } = \int_a^b 2\pi
x\sqrt{1+\left({dy\over dx}\right)^2}\;dx$$






\vskip15pt\hrule\vskip12pt

\ex Find the area of the surface obtained by rotating the
curve $y={ 1 \over 4 }(e^{2x}+e^{-2x})$ with $0\leq x\leq 1$ around the
$x$-axis.

\ex Just set up the integral for the surface obtained by
rotating the curve $y={ 1 \over 4 }(e^{2x}+e^{-2x})$ with $0\leq x\leq
1$ around the $y$-axis.

\ex Set up the integral for the area of the surface obtained
by rotating the curve $y=x^2$ with $0\leq x\leq 1$ around the
$x$-axis.

\ex Set up the integral for the area of the surface obtained
by rotating the curve $y=x^2$ with $0\leq x\leq 1$ around the $y$-axis.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Integration by parts}




Strangely, the subtlest standard method is just the {\it product rule}
run backwards. This is called {\bf integration by parts}. (This might
seem strange because often people find the chain rule for
differentiation harder to get a grip on than the product rule). One
way of writing the integration by parts rule is $$\int f(x)\cdot
g'(x)\;dx=f(x)g(x)-\int f'(x)\cdot g(x)\;dx$$ Sometimes this is
written another way: if we use the notation that for a function $u$ of
$x$,

$$du={du\over dx}\;dx$$
then for two functions $u,v$ of $x$ the rule is
$$\int u\;dv=uv-\int v\;du$$

Yes, it is hard to see how this might be helpful, but it
is. The first theme we'll see in examples is where we could do the
integral except that there is a power of $x$ `in the way':

The simplest example is
$$\int x\;e^x\;dx=\int x\;d(e^x)=x\,e^x-\int e^x\;dx=x\,e^x-e^x+C$$
Here we have taken $u=x$ and $v=e^x$. It is important to be able to
see the $e^x$ as being the derivative of itself.

A similar example is
$$\int x\;\cos x\;dx=\int x\;d(\sin x)=
x\,\sin x-\int \sin x\;dx=x\,\sin x+\cos x +C$$
Here we have taken $u=x$ and $v=\sin x$. It is important to be able to
see the $\cos x$ as being the derivative of $\sin x$.

Yet another example, illustrating also the idea of {\it repeating}
the integration by parts:
$$\int x^2\;e^x\;dx=\int x^2\;d(e^x)=x^2\,e^x-\int e^x\;d(x^2)$$
$$=x^2\,e^x-2 \int x\,e^x\;dx=x^2\,e^x-2x\,e^x+2\int e^x\;dx$$
$$=x^2\,e^x-2x\,e^x+2e^x+C$$
Here we integrate by parts twice. After the first integration by
parts, the integral we come up with is $\int xe^x\,dx$, which we had
dealt with in the first example.

Or sometimes the theme is that it is easier to integrate the
{\it derivative} of something than to integrate the thing:
$$\int \ln x\;dx=\int \ln x\;d(x)=x\ln x-\int x\; d(\ln x)$$
$$=x\ln x-\int x\;{1\over x}\; dx=x\ln x-\int 1\; dx=x\ln x-x+C$$
We took $u=\ln x$ and $v=x$.

Again in this example it is easier to integrate the
derivative than the thing itself:
$$\int \arctan x\;dx=\int \arctan x\;d(x)=x\arctan x-\int x\;
d(\arctan x)$$
$$=x\arctan x-\int {x\over 1+x^2}\;dx
=x\arctan x-{1\over 2}\int {2x\over 1+x^2}\;dx$$
$$=x\arctan x-{1\over 2}\ln(1+x^2)+C$$
since we should recognize the
$${2x\over 1+x^2}$$
as being the derivative (via the chain rule) of $\ln(1+x^2)$.






\vskip15pt\hrule\vskip12pt

\ex   $\int \ln\,x\,dx=?$

\ex   $\int xe^x\,dx=?$

\ex   $\int (\ln\,x)^2\,dx=?$

\ex  $\int xe^{2x}\,dx=?$ 

\ex   $\int \arctan\,3x\,dx=?$ 

\ex   $\int x^3\ln x\,dx=?$

\ex  $\int \ln\,3x\,dx=?$

\ex  $\int x\ln x\,dx=?$

\vfill\break
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Partial Fractions}



Now we return to a more special but still important technique of doing
indefinite integrals. This depends on a good trick from algebra to
transform complicated {\it rational functions} into simpler
ones. Rather than try to formally describe the general fact, we'll do
the two simplest families of examples.

Consider the integral
$$\int {1\over x(x-1)}\; dx$$
As it stands, we do not recognize this as the derivative of
anything. However, we have
$${1\over x-1}-{1\over x}={x-(x-1)\over x(x-1)}={1\over x(x-1)}$$
Therefore,
$$\int {1\over x(x-1)}\; dx=\int
{1\over x-1}-{1\over x}\;dx=\ln(x-1)-\ln x + C$$
That is, by separating the fraction $1/x(x-1)$ into the `partial'
fractions $1/x$ and $1/(x-1)$ we were able to do the integrals
immediately by using the logarithm. How to see such identities?

Well, let's look at a situation
$${cx+d\over (x-a)(x-b)}={A\over x-a}+{B\over x-b}$$
where $a,b$ are given numbers (not equal) and we are to {\it find}
$A,B$ which make this true. If we can find the $A,B$ then we can
integrate $(cx+d)/(x-a)(x-b)$ simply by using logarithms:
$$\int {cx+d\over (x-a)(x-b)}\;dx=\int{A\over x-a}+{B\over x-b}\;dx=
A\ln(x-a)+B\ln(x-b)+C$$
To find the $A,B$, multiply through by $(x-a)(x-b)$ to get
$$cx+d=A(x-b)+B(x-a)$$
When $x=a$ the $x-a$ factor is $0$, so this equation becomes
$$c\cdot a+d=A(a-b)$$
Likewise, when $x=b$ the $x-b$ factor is $0$, so we also have
$$c\cdot b+d=B(b-a)$$
That is,
$$A={c\cdot a+d\over a-b}\;\;\;\;\;B={c\cdot b+d\over b-a}$$
So, yes, we can find the constants to break the fraction
$(cx+d)/(x-a)(x-b)$ down into simpler `partial' fractions.

{\it Further}, if the numerator is of {\it bigger degree}
than $1$, then before executing the previous algebra trick we must
first{\it divide the numerator by the denominator to get a remainder
of smaller degree}. A simple example is
$${x^3+4x^2-x+1\over x(x-1)}=?$$ {\it We must recall how to divide
polynomials by polynomials and get a remainder of lower degree than
the divisor}. Here we would divide the $x^3+4x^2-x+1$ by
$x(x-1)=x^2-x$ to get a remainder of degree less than $2$ (the degree
of $x^2-x$). We would obtain
$${x^3+4x^2-x+1\over x(x-1)}=x+5+{4x+1\over x(x-1)}$$ since the
quotient is $x+5$ and the remainder is $4x+1$. Thus, in this situation
$$\int {x^3+4x^2-x+1\over x(x-1)}\;dx=\int
x+5+{4x+1\over x(x-1)}\;dx$$
Now we are ready to continue with the {\it first} algebra trick.

In this case, the first trick is applied to
$${4x+1\over x(x-1)}$$
We want constants $A,B$ so that
$${4x+1\over x(x-1)}={A\over x}+{B\over x-1}$$
As above, multiply through by $x(x-1)$ to get
$$4x+1=A(x-1)+Bx$$
and plug in the two values $0,1$ to get
$$4\cdot 0+1=-A\;\;\;\;\;4\cdot 1+1=B$$
That is, $A=-1$ and $B=5$.

Putting this together, we have
$${x^3+4x^2-x+1\over x(x-1)}=x+5+{-1\over x}+{5\over x-1}$$
Thus,
$$\int {x^3+4x^2-x+1\over x(x-1)}\;dx=\int
x+5+{-1\over x}+{5\over x-1}\;dx$$
$$={x^2\over 2}+5x-\ln x+5\ln(x-1)+C$$

In a slightly different direction: we can do any
integral of the form
$$\int {ax+b\over 1+x^2}\;dx$$
because we know two different sorts of integrals with that same
denominator:
$$\int{1\over 1+x^2}\;dx=\arctan x+C\;\;\;\;\;
\int {2x\over 1+x^2}\;dx=\ln(1+x^2)+C$$
where in the second one we use a substitution. Thus, we have to break
the given integral into two parts to do it:
$$\int {ax+b\over 1+x^2}\;dx={a\over 2}\int {2x\over 1+x^2}\;dx
+b\int{1\over 1+x^2}\;dx$$
$$={a\over 2}\ln(1+x^2)+b\arctan x+C$$

And, as in the first example, if we are given a numerator of
degree $2$ or larger, then we {\it divide} first, to get a remainder
of lower degree. For example, in the case of
$$\int {x^4+2x^3+x^2+3x+1\over 1+x^2}\;dx$$
we divide the numerator by the denominator, to allow us to write
$${x^4+2x^3+x^2+3x+1\over 1+x^2}=x^2+2x+{x+1\over 1+x^2}$$
since the quotient is $x^2+2x$ and the remainder is $x+1$. Then
$$\int {x^4+2x^3+x^2+3x+1\over 1+x^2}\;dx=
\int x^2+2x+{x+1\over 1+x^2}$$
$$={x^3\over 3}+x^2+{1\over 2}\ln(1+x^2)+\arctan x+C$$

These two examples are just the simplest, but illustrate the
idea of using algebra to simplify rational functions.






\vskip15pt\hrule\vskip12pt

\ex   $\int { 1 \over x(x-1) }\,dx=?$ 

\ex   $\int { 1+x \over 1+x^2 }\,dx=?$

\ex   $\int { 2x^3+4 \over x(x+1) }\,dx=?$ 

\ex   $\int { 2+2x+x^2 \over 1+x^2 }\,dx=?$

\ex   $\int { 2x^3+4 \over x^2-1 }\,dx=?$ 

\ex   $\int { 2+3x \over 1+x^2 }\,dx=?$

\ex   $\int { x^3+1 \over (x-1)(x-2) }\,dx=?$

\ex   $\int { x^3+1 \over x^2+1 }\,dx=?$

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Trigonometric Integrals}




Here we'll just have a {\it sample} of how to use trig identities to
do some more complicated integrals involving trigonometric
functions. This is `just the tip of the iceberg'. We don't do more for
at least two reasons: first, hardly anyone remembers all these tricks
anyway, and, second, in real life you can look these things up in
tables of integrals. Perhaps even more important, in `real life' there
are more sophisticated viewpoints which even make the whole issue a
little silly, somewhat like evaluating $\sqrt{26}$ `by differentials'
without your calculator seems silly.

The only identities we'll need in our examples are
$$\cos^2x+\sin^2x=1\;\;\;\;\;\hbox{ Pythagorean identity}$$
$$\sin\,x=\sqrt{{1-\cos\,2x\over 2}}\;\;\;\;\;\hbox{ half-angle formula}$$
$$\cos\,x=\sqrt{{1+\cos\,2x\over 2}}\;\;\;\;\;\hbox{ half-angle formula}$$

The first example is
$$\int \sin^3 x\;dx$$
If we ignore all trig identities, there is no easy way to do this
integral. But if we use the Pythagorean identity to rewrite it, then
things improve:
$$\int \sin^3 x\;dx=\int (1-\cos^2x)\sin x\;dx=-\int (1-\cos^2x)(-\sin x)\;dx$$
In the latter expression, we can view the $-\sin x$ as the derivative
of $\cos x$, so with the substitution $u=\cos x$ this integral is
$$-\int (1-u^2)\;du=-u+{u^3\over 3}+C=-\cos x+{\cos^3x\over 3}+C$$

This idea can be applied, more generally, to integrals
$$\int \sin^m x\;\cos^n x\; dx$$
where {\it at least one of $m,n$ is odd}. For example, if $n$ is odd,
then use
$$\cos ^nx=\cos^{n-1}x\;\cos x=(1-\sin^2x)^{{n-1\over 2}}\;\cos x$$
to write the whole thing as
$$\int \sin^m x\;\cos^n x\; dx=
\int \sin^m x\;(1-\sin^2x)^{{n-1\over 2}}\;\cos x\;dx$$
The point is that we have obtained something of the form
$$\int\hbox{ (polynomial in $\sin x$) }\cos x\;dx$$
Letting $u=\sin x$, we have $\cos x\;dx=du$, and the integral becomes 
$$\hbox{ (polynomial in $u$) } du$$
which we can do.

But this Pythagorean identity trick does not help us on the
relatively simple-looking integral 
$$\int \sin^2 x\; dx$$ 
since there is no odd exponent anywhere. In effect, we `divide the
exponent by two', thereby getting an odd exponent, by using the {\it 
half-angle formula}:
$$\int \sin^2 x\; dx= \int
{1-\cos\,2x\over 2}\;dx={x\over 2}-{\sin 2x\over 2\cdot 2}+C$$

A bigger version of this application of the half-angle
formula is
$$\int \sin^6 x \; dx=\int ({1-\cos\,2x\over 2})^3\;dx=
\int {1\over 8}-{3\over 8}\cos 2x + {3\over 8}\cos^2 2x -
{1\over 8}\cos^3 2x\;dx$$
Of the four terms in the integrand in the last expression, we can do
the first two directly:
$$\int {1\over 8}\;dx={x\over 8}+C\;\;\;\;\;
\int -{3\over 8}\cos 2x\;dx= {-3\over 16}\sin 2x+C$$
But the last two terms require further work: using a half-angle
formula {\it again}, we have
$$\int {3\over 8}\cos^2 2x\;dx=\int {3\over 16}(1+\cos 4x)\;dx=
{3x\over 16}+{3\over 64}\sin 4x+C$$
And the $\cos^3 2x$ needs the Pythagorean identity trick:
$$\int {1\over 8}\cos^3 2x\;dx={1\over 8}\int (1-\sin^22x)\cos
2x\;dx
={1\over 8}[\sin 2x-{\sin^3 2x\over 3}]+C$$
Putting it all together, we have
$$\int \sin^6 x \; dx={x\over 8}+{-3\over 16}\sin 2x+
{3x\over 16}+{3\over 64}\sin 4x+{1\over 8}[\sin 2x-{\sin^3
2x\over 3}]+C$$
This last example is typical of the kind of repeated application of
all the tricks necessary in order to treat all the possibilities.

In a slightly different vein, there is the horrible
$$\int \sec x\;dx$$
There is no decent way to do this at all from a first-year calculus
viewpoint. A sort of rationalized-in-hindsight way of explaining the
answer is:
$$\int \sec x\;dx=\int {\sec x(\sec x+\tan x)\over \sec x+\tan
x}\;dx$$
All we did was multiply and divide by $\sec x+\tan x$. Of course, we
don't pretend to answer the question of how a person would get the
idea to do this. But then (another miracle?) we `notice' that the
numerator is the derivative of the denominator, so
$$\int \sec x\;dx=\ln(\sec x+\tan x)+C$$
There is something distasteful about this rationalization, but at this
level of technique we're stuck with it.

Maybe this is enough of a sample. There are several other
tricks that one would have to know in order to claim to be an `expert'
at this, but it's not really sensible to {\it want} to be `expert' at
these games, {\it because there are smarter alternatives.}






\vskip15pt\hrule\vskip12pt


\ex   $\int \cos ^2 x\,dx=?$

\ex   $\int \cos x \sin ^2 x\,dx=?$

\ex   $\int \cos^3 x \,dx=?$

\ex   $\int \sin ^2 5x\,dx=?$

\ex   $\int \sec (3x+7)\,dx$

\ex   $\int \sin ^2\,(2x+1)\,dx=?$

\ex $\int \sin^3\,(1-x)\;dx=?$

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Trigonometric Substitutions}




This section continues development of relatively special tricks to do
special kinds of integrals. Even though the application of such things
is limited, it's nice to be {\it aware} of the possibilities, at least
a little bit.

The key idea here is to use trig functions to be able to
`take the square root' in certain integrals. There are just three
prototypes for the kind of thing we can deal with:
$$\sqrt{1-x^2}\;\;\;\;\;\sqrt{1+x^2}\;\;\;\;\;\sqrt{x^2-1}$$
Examples will illustrate the point.

In rough terms, the idea is that in an integral where the
`worst' part is $\sqrt{1-x^2}$, replacing $x$ by $\sin u$ (and,
correspondingly, $dx$ by $\cos u\;du$), {\it we will be able to take
the square root}, and then obtain an integral in
the variable $u$ which is one of the {\it trigonometric integrals}
which in principle we now know how to do. The point is that then
$$\sqrt{1-x^2}=\sqrt{1-\sin^2x}=\sqrt{\cos^2x}=\cos x$$
We have `taken the square root'.

For example, in
$$\int \sqrt{1-x^2}\;dx$$
we replace $x$ by $\sin u$ and $dx$ by $\cos u\,du$ to obtain
$$\int \sqrt{1-x^2}\;dx=\int \sqrt{1-\sin^2u}\;\cos u\;du=
\int \sqrt{\cos^2u}\;\cos u\;du=$$
$$=\int\cos u \;\cos u\;du=\int\cos^2u\;du$$
Now we have an integral we know how to integrate: using the half-angle
formula, this is
$$\int\cos^2u\;du=\int{1+\cos 2u\over 2}\;du={u\over 2}+{\sin
2u\over 4}+C$$
And there still remains the issue of {\it substituting back} to obtain
an expression in terms of $x$ rather than $u$. Since $x=\sin u$, it's
just the definition of {\it inverse function} that
$$u=\arcsin x$$
To express $\sin 2u$ in terms of $x$ is more aggravating. We use another
{\it half-angle formula} 
$$\sin 2u=2\sin u\cos u$$
Then
$${1\over 4}\sin 2u={1\over 4}\cdot 2\sin u\cos
u={1\over 4}x\cdot\sqrt{1-x^2}$$
where `of course' we used the Pythagorean identity to give us
$$\cos u=\sqrt{1-\sin^2u}=\sqrt{1-x^2}$$
Whew.

The next type of integral we can `improve' is one containing
an expression 
$$\sqrt{1+x^2}$$
In this case, we use another Pythagorean identity
$$1+\tan^2u=\sec^2u$$
(which we can get from the usual one $\cos^2u+\sin^2u=1$ by dividing
by $\cos^2u$). So we'd let
$$x=\tan u\;\;\;\;\;dx=\sec^2u\;du$$
(mustn't forget the $dx$ and $du$ business!).

For example, in
$$\int { \sqrt{1+x^2} \over x }\;dx$$
we use
$$x=\tan u\;\;\;\;\;dx=\sec^2u\;du$$
and turn the integral into
$$\int { \sqrt{1+x^2} \over x }\;dx=\int
{ \sqrt{1+\tan^2 u} \over \tan u }\sec^2u\;du=$$
$$=\int { \sqrt{\sec^2u} \over \tan u }\sec^2u\;du=
\int {\sec u\over \tan u}\sec^2u\;du=\int {1\over \sin u\cos^2u}\;du$$
by rewriting everything in terms of $\cos u$ and $\sin u$.

For integrals containing $\sqrt{x^2-1}$, use $x=\sec u$ in
order to invoke the Pythagorean identity
$$\sec^2u-1=\tan^2u$$
so as to be able to `take the square root'. Let's not execute any
examples of this, since nothing new really happens.

{\it Rather,}, let's examine some {\it purely
algebraic variants} of these trigonometric substitutions, where we can
get some mileage out of {\it completing the square}. For example,
consider 
$$\int\sqrt{-2x-x^2}\;dx$$
The quadratic polynomial inside the square-root is {\it not} one of
the three simple types we've looked at. But, by completing the square,
we'll be able to rewrite it in essentially such forms:
$$-2x-x^2=-(2x+x^2)=-(-1+1+2x+x^2)=-(-1+(1+x)^2)=1-(1+x)^2$$
Note that always when completing the square we `take out' the
coefficient in front of $x^2$ in order to see what's going on, and
then put it back at the end.

So, in this case, we'd let
$$\sin u=1+x\;\;\;\;\;\cos u\;du=dx$$

In another example, we might have
$$\int\sqrt{8x-4x^2}\;dx$$
Completing the square again, we have
$$8x-4x^2=-4(-2+x^2)=-4(-1+1-2x+x^2)=-4(-1+(x-1)^2)$$
Rather than put the whole `$-4$' back, we only keep track of the
$\pm$, and take a `$+4$' outside the square root entirely:
$$\int\sqrt{8x-4x^2}\;dx=\int\sqrt{-4(-1+(x-1)^2)}\;dx$$
$$=2\int\sqrt{-(-1+(x-1)^2)}\;dx=2\int\sqrt{1-(x-1)^2)}\;dx$$
Then we're back to a familiar situation.






\vskip15pt\hrule\vskip12pt

\ex   Tell what trig
substitution to use for $\int x^8\sqrt{x^2-1}\,dx$

\ex   Tell what trig
substitution to use for $\int \sqrt{25+16x^2}\,dx$

\ex   Tell what trig
substitution to use for $\int \sqrt{1-x^2}\,dx$

\ex   Tell what trig
substitution to use for $\int \sqrt{9+4x^2}\,dx$

\ex  Tell what trig
substitution to use for $\int x^9\sqrt{x^2+1}\,dx$

\ex   Tell what trig
substitution to use for $\int x^8\sqrt{x^2-1}\,dx$

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Historical and theoretical comments: Mean Value Theorem}



For several reasons, the traditional way that {\it Taylor
polynomials} are taught gives the impression that the ideas are
inextricably linked with issues about {\it infinite series}. This is
not so, but every calculus book I know takes that approach.
The reasons for this systematic mistake are complicated. Anyway, we
will {\it not} make that mistake here, although we may
talk about infinite series later. 

Instead of following the tradition, we will immediately talk about
Taylor polynomials, {\it without} first tiring ourselves over infinite
series, and {\it without} fooling anyone into thinking that Taylor
polynomials have the infinite series stuff as prerequisite!

The theoretical underpinning for these facts about Taylor
polynomials is {\it The Mean Value Theorem}, which itself depends upon
some fairly subtle properties of the real numbers. It asserts that,
{\it for a function $f$ differentiable on an interval $[a,b]$, there is a
point $c$ in the interior $(a,b)$ of this interval so that}
$$f'(c)={f(b)-f(a)\over b-a}$$

Note that the latter expression is the formula for the slope
of the `chord' or `secant' line connecting the two points $(a,f(a))$
and $(b,f(b))$ on the graph of $f$. And the $f'(c)$ can be interpreted
as the slope of the {\it tangent} line to the curve at the point
$(c,f(c))$.

In many traditional scenarios a person is expected to commit
the statement of the Mean Value Theorem to memory. And be able to
respond to issues like `Find a point $c$ in the interval $[0,1]$
satisfying the conclusion of the Mean Value Theorem for the function
$f(x)=x^2$.' This is pointless and we won't do it.






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Taylor polynomials: formulas}



Before attempting to illustrate what these funny formulas can be used
for, we just write them out. First, some reminders:

The notation $f^{(k)}$ means the $k$th derivative of
$f$. The notation $k!$ means $k$-{\it factorial}, which by definition is
$$k!=1\cdot 2\cdot 3\cdot 4\cdot \ldots\cdot (k-1)\cdot k$$ 

{\bf Taylor's Formula with Remainder Term} {\it
first somewhat verbal version}: Let
$f$ be a reasonable function, and fix a
positive integer $n$. Then we have
$$f(\hbox{\it input})=f(\hbox{\it basepoint})+
{f'(\hbox{basepoint}) \over 1!}(\hbox{\it input}-\hbox{ basepoint})$$
$$+
{ f''(\hbox{\it basepoint})\over 2!}(\hbox{\it input}-\hbox{\it
basepoint})^2
+{f'''(\hbox{\it basepoint}) \over 3!}(\hbox{\it input}-\hbox{\it basepoint })^3$$
$$\ldots+
{ f^{(n)}(\hbox{\it basepoint})}{n!}(\hbox{\it input}-\hbox{\it
basepoint})^n
+{f^{(n+1)}(c) \over (n+1)!}(\hbox{\it input}-\hbox{\it basepoint})^{n+1 }$$
for some $c$ between {\it \hbox{\it basepoint}} and {\it \hbox{\it
input}}. 

That is, the value of the function $f$ for some {\it input}
presumably `near' the {\it basepoint} is expressible in terms of the
values of $f$ and its derivatives {\it evaluated at the basepoint},
with the only mystery being the precise nature of that $c$ between
{\it input} and {\it basepoint}.

{\bf Taylor's Formula with
Remainder Term} {\it second somewhat verbal version}: Let
$f$ be a reasonable function, and fix a
positive integer $n$.
$$f(\hbox{\it basepoint + increment})=f(\hbox{\it
basepoint})+{ f'(\hbox{\it basepoint}) \over 1! }(\hbox{\it
increment})$$
$$+
{ f''(\hbox{\it basepoint})\over 2!}(\hbox{\it increment})^2
+{f'''(\hbox{\it basepoint}) \over 3!}(\hbox{\it increment })^3$$
$$\ldots+
{ f^{(n)}(\hbox{\it basepoint})}{n!}(\hbox{\it increment})^n
+{f^{(n+1)}(c) \over (n+1)!}(\hbox{\it increment})^{n+1 }$$
for some $c$ between $\hbox{\it basepoint}$ and $\hbox{\it basepoint +
increment}$.

This version is really the same as the previous, but with a
different emphasis: here we still have a {\it basepoint}, but are thinking
in terms of moving a little bit away from it, by the amount {\it
increment}.

And to get a more compact formula, we can be more symbolic:
let's repeat these two versions:

{\bf Taylor's Formula with Remainder Term:} Let
$f$ be a reasonable function, fix an input value $x_o$, and fix a
positive integer $n$. Then for input $x$ we
have 
$$f(x)=f(x_o)+{f'(x_o)\over 1!}(x-x_o)+
{f''(x_o)\over 2!}(x-x_o)^2+{f'''(x_o)\over 3!}(x-x_o)^3+\ldots$$
$$\ldots+
{ f^{(n)}(x_o)}{n!}(x-x_o)^n+{f^{(n+1)}(c) \over (n+1)!}(x-x_o)^{n+1 }$$
for some $c$ between $x_o$ and $x$.

Note that in every version, in the very last term where all
the indices are $n+1$, the input into $f^{(n+1)}$ is {\it not} the
basepoint $x_o$ but is, instead, that mysterious $c$ about which we
truly know nothing but that it lies between $x_o$ and $x$. The part of
this formula {\it without} the error term is the {\bf degree-n Taylor
polynomial} for $f$ {\bf at $x_o$}, and that last term is the {\bf
error term} or {\bf remainder term}. The Taylor series is said to be
{\bf expanded at} or {\bf expanded about} or {\bf centered at} or
simply {\bf at} the basepoint $x_o$.

There are many other possible forms for the error/remainder
term. The one here was chosen partly because it resembles the other
terms in the main part of the expansion.

{\bf {\it Linear} Taylor's Polynomial with Remainder Term:}
Let $f$ be a reasonable function, fix an input value $x_o$. For any
(reasonable) input value $x$ we have
$$f(x)=f(x_o)+{f'(x_o)\over 1!}(x-x_o)+{f''(c)\over 2!}(x-x_o)^2$$
for some $c$ between $x_o$ and $x$.

The previous formula is of course a very special case of the
first, more general, formula. The reason to include the `linear' case
is that {\it without} the error term it is the old {\it approximation
by differentials} formula, which had the fundamental flaw of having no
way to estimate the error. Now we {\it have } the error estimate.

The general idea here is to approximate `fancy' functions by
polynomials, especially if we restrict ourselves to a fairly small
interval around some given point. (That `approximation by
differentials' circus was a very crude version of this idea).

It is at this point that it becomes relatively easy to `beat' a
calculator, in the sense that the methods here can be used to give
whatever precision is desired. So at the very least this methodology
is not as silly and obsolete as some earlier traditional examples.

But even so, there is more to this than getting numbers out: it ought
to be of some intrinsic interest that pretty arbitrary functions can
be approximated as well as desired by polynomials, which are so
readily computable (by hand {\it or} by machine)!

One element under our control is choice of {\it how high degree
polynomial to use}. Typically, the higher the degree (meaning more
terms), the better the approximation will be. (There is nothing
comparable to this in the `approximation by differentials').

Of course, for all this to really be worth anything either in
theory or in practice, we do need a tangible {\it error estimate}, so
that we can be sure that we are within whatever tolerance/error is
required. (There is nothing comparable to this in the `approximation
by differentials', either).

And at this point it is not at all clear what exactly can be
done with such formulas. For one thing, there are choices.






\vskip15pt\hrule\vskip12pt

\ex Write the first three
terms of the Taylor series {\it at 0} of $f(x)=1/(1+x)$.

\ex Write the first three
terms of the Taylor series {\it at 2} of $f(x)=1/(1-x)$.

\ex Write the first three
terms of the Taylor series {\it at 0} of $f(x)=e^{\cos x}$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Classic examples of Taylor polynomials}




Some of the most famous (and
important) examples are the expansions of ${1\over 1-x}$, $e^x$,
$\cos x$, $\sin x$, and $\log(1+x)$ at $0$: right from the formula,
although simplifying a little, we get
$${1\over 1-x}=1+x+x^2+x^3+x^4+x^5+x^6+\ldots$$
$$e^x=1+{x\over 1!}+{x^2\over 2!}+{x^3\over 3!}+{x^4\over 4!}+\ldots$$
$$\cos x=1-{x^2\over 2!}+{x^4\over 4!}-{x^6\over 6!}+{x^8\over 8!}\ldots$$
$$\sin
x={x\over 1!}-{x^3\over 3!}+{x^5\over 5!}-{x^7\over 7!}+\ldots$$
$$\log(1+x)=x-{x^2\over 2}+{x^3\over 3}-{x^4\over 4}+{x^5\over 5}-
{x^6\over 6}+\ldots$$ 
where here the {\it dots} mean to {\it continue to whatever term you want,
then stop, and stick on the appropriate remainder term.}

It is entirely reasonable if you can't really see that these
are what you'd get, but in any case you should do the computations to
verify that these are right. It's not so hard.

Note that the expansion for cosine has no {\it odd} powers of
$x$ (meaning that the coefficients are {\it zero}), while the
expansion for sine has no {\it even} powers of $x$ (meaning that the
coefficients are {\it zero}). 

At this point it is worth repeating that we are {\it not}
talking about {\it infinite} sums (series) at all here, although we do
allow arbitrarily large {\it finite} sums. Rather than worry over an
infinite sum that we can never truly evaluate, we use the {\it error}
or {\it remainder} term instead. Thus, while in other contexts the
dots {\it would} mean `infinite sum', that's not our concern here.

The first of these formulas you might recognize as being a
{\it geometric series}, or at least a part of one. The other three
patterns might be new to you. A person would want to be learn to
recognize these on sight, as if by reflex!






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Computational tricks regarding Taylor polynomials}




The obvious question to ask about Taylor polynomials is `What are the
first so-many terms in the Taylor polynomial of some function expanded
at some point?'.

The most straightforward way to deal with this is just to do
what is indicated by the formula: take however high order derivatives
you need and plug in. However, very often this is not at all the most
efficient.

Especially in a situation where we are interested in a composite
function of the form $f(x^n)$ or \hfil\break $f(\hbox{polynomial in }x)$ with a
`familiar' function $f$, there are alternatives.

For example, looking at $f(x)=e^{x^3}$, if we start taking
derivatives to expand this at $0$, there will be a big mess pretty
fast. On the other hand, we might start with the `familiar' expansion
for $e^x$ 
$$e^x=1+x+{x^2\over 2!}+{x^3\over 3!}+{e^c\over 4!}x^4$$
with some $c$ between $0$ and $x$, where our choice to cut it off
after that many terms was simply a whim. But then
replacing $x$ by $x^3$ gives
$$e^{x^3}=1+x^3+{x^6\over 2!}+{x^9\over 3!}+{e^c\over 4!}x^{12}$$
with some $c$ between $0$ and $x^3$. Yes, we need to keep track of $c$
in relation to the {\it new} $x$.

So we get a polynomial plus that funny term with the `c' in
it, for the remainder. Yes, this gives us a different-looking error
term, but that's fine.

So we obtain, with relative ease, the expansion of degree
{\it eleven} of this function, which would have been horrible to
obtain by repeated differentiation and direct application of the
general formula. Why `eleven'?: well, the error term has the $x^{12}$
in it, which means that the polynomial itself stopped with a $x^{11}$
term. Why didn't we see that term? Well, evidently the coefficients of
$x^{11}$, and of $x^{10}$ (not to mention $x,x^2,x^4,x^5,x^7,x^8$!)
are {\it zero}.

As another example, let's get the degree-eight expansion of
$\cos x^2$ at $0$. Of course, it makes sense to use
$$\cos x=1-{x^2\over 2!}+{x^4\over 4!}+{-\sin c\over 5!}x^5$$
with $c$ between $0$ and $x$, where we note that $-\sin x$ is the
fifth derivative of $\cos x$. Replacing $x$ by $x^2$, this becomes
$$\cos x^2=1-{x^4\over 2!}+{x^8\over 4!}+{-\sin c\over 5!}x^{10}$$
where now we say that $c$ is between $0$ and $x^2$.






\vskip15pt\hrule\vskip12pt

\ex Use a shortcut to compute the Taylor expansion at $0$
of $\cos (x^5)$.

\ex Use a shortcut to compute the Taylor expansion at $0$ of
$e^{(x^2+x)}$. 

\ex Use a shortcut to compute the Taylor expansion at $0$ of
$\log({ 1 \over 1-x })$. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Prototypes: More serious questions about Taylor polynomials}




Beyond just writing out Taylor expansions, we could actually use them
to approximate things in a more serious way. There are roughly three
different sorts of {\it serious} questions that one can ask in this
context. They all use similar words, so a careful reading of such
questions is necessary to be sure of answering the question asked.

(The word `tolerance' is a synonym for `error
estimate', meaning that we know that the error is {\it no worse} than
such-and-such)

 

\bull Given a Taylor polynomial
approximation to a function, expanded at some given point, and given a
required tolerance, {\it on how large an interval} around the given point
does the Taylor polynomial achieve that tolerance?

\bull Given a Taylor polynomial approximation to a function,
expanded at some given point, and given an interval around that
given point, {\it within what tolerance} does the Taylor polynomial
approximate the function on that interval?

\bull Given a function, given a fixed point, given an interval
around that fixed point, and given a required tolerance, find {\it how many
terms} must be used in the Taylor expansion to approximate the function
to within the required tolerance on the given interval.



As a special case of the last question, we can consider the
question of {\it approximating $f(x)$ to within a given
tolerance/error in terms of $f(x_o), f'(x_o), f''(x_o)$ and higher
derivatives of $f$ evaluated at a given point $x_o$.} 

In `real life' this last question is not really so important
as the third of the questions listed above, since evaluation at just
one point can often be achieved more simply by some other
means. Having a polynomial approximation that works {\it all along an
interval} is a much more substantive thing than evaluation at a single
point. 

It must be noted that there are also {\it other} ways to
approach the issue of {\it best approximation by a polynomial on an
interval}. And beyond worry over approximating the {\it values} of the
function, we might also want the values of one or more of the {\it 
derivatives} to be close, as well. The theory of {\bf splines} is one
approach to approximation which is very important in practical applications.






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Determining Tolerance/Error}




This section treats a simple example of the second kind of question
mentioned above:
`Given a Taylor polynomial approximation to a function,
expanded at some given point, and given an interval around that
given point, {\it within what tolerance} does the Taylor polynomial
approximate the function on that interval?'

Let's look at the approximation
$1-{x^2\over 2}+{x^4\over 4!}$ to $f(x)=\cos^x$ on the interval
$[-{1\over 2}, {1\over 2}]$. We might ask {\it `Within what
tolerance does this polynomial approximate $\cos x$ on that
interval?'}

To answer this, we first recall that the error term we have after
those first (oh-so-familiar) terms of the expansion of cosine is
$${-\sin c\over 5!}x^5$$
For $x$ in the indicated interval, we want to know the {\it worst-case
scenario} for the size of this thing. A sloppy but good and simple
{\it estimate} on $\sin c$ is that $|\sin c|\le 1$, regardless of
what $c$ is. This is a very happy kind of estimate because it's not so
bad and because it doesn't depend at all upon $x$. And the biggest
that $x^5$ can be is $({1\over 2})^5\approx 0.03$. Then the {\it error
is estimated as}
$$|{-\sin c\over 5!}x^5|\le {1\over 2^5\cdot 5!}\le 0.0003$$
This is not so bad at all!

We could have been a little clever here, taking advantage of
the fact that a lot of the terms in the Taylor expansion of cosine at
$0$ are already zero. In particular, we could {\it choose} to view the
original polynomial $1-{x^2\over 2}+{x^4\over 4!}$ as {\it 
including} the {\it fifth-degree} term of the Taylor expansion as
well, which simply happens to be zero, so is invisible. Thus, instead
of using the remainder term with the `5' in it, we are actually
entitled to use the remainder term with a `6'. This typically will
give a better outcome.

That is, instead of the remainder we had must above, we would have an
error term
$${-\cos c\over 6!}x^6$$
Again, in the {\it worst-case scenario} $|-\cos c|\le 1$. And still
$|x|\le {1\over 2}$, so we have the {\it error estimate}
$$|{-\cos c\over 6!}x^6|\le {1\over 2^6\cdot 6!}\le 0.000022$$
This is less than a tenth as much as in the first version.

But what happened here? Are there two different answers to
the question of how well that polynomial approximates the cosine
function on that interval? Of course not. Rather, there were two {\it 
approaches} taken by us to {\it estimate} how well it approximates
cosine. In fact, we still do not know the {\it exact} error!

The point is that the second estimate (being a little wiser) is {\it closer}
to the truth than the first. The first estimate is {\it true}, but is
a {\it weaker} assertion than we are able to make if we try a little
harder.

This already illustrates the point that `in real life' there
is often no single `right' or `best' estimate of an error, in the
sense that the estimates that we can obtain by practical procedures
may not be perfect, but represent a trade-off between time, effort,
cost, and other priorities.






\vskip15pt\hrule\vskip12pt

\ex How well (meaning `within what tolerance') does
$1-x^2/2+x^4/24-x^6/720$ approximate $\cos x$ on the interval
$[-0.1,0.1]$?

\ex How well (meaning `within what tolerance') does
$1-x^2/2+x^4/24-x^6/720$ approximate $\cos x$ on the interval
$[-1,1]$?

\ex How well (meaning `within what tolerance') does
$1-x^2/2+x^4/24-x^6/720$ approximate $\cos x$ on the interval
$[{ -\pi \over 2 },{ \pi \over 2 }]$?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{How large an interval with given tolerance?}




This section treats a simple example of the first kind of question
mentioned above:
`Given a Taylor polynomial
approximation to a function, expanded at some given point, and given a
required tolerance, {\it on how large an interval} around the given point
does the Taylor polynomial achieve that tolerance?'

The specific example we'll get to here is {\it `For what range of
$x\ge 25$ does $5+{1\over 10}(x-25)$ approximate $\sqrt{x}$ to
within $.001$?'}

Again, with the degree-one Taylor polynomial and
corresponding remainder term, for reasonable functions $f$ we have
$$f(x)=f(x_o)+f'(x_o)(x-x_o)+{f''(c)\over 2!}(x-x_o)^2$$
for some $c$ between $x_o$ and $x$. The
{\bf remainder} term is
$$\hbox{remainder term }= {f''(c)\over 2!}(x-x_o)^2$$
The notation $2!$ means `$2$-factorial', which is just $2$, but which
we write to be `forward compatible' with other things later.

{\it Again: no, we do not know what $c$ is, except that it is between $x_o$
and $x$}. But this is entirely reasonable, since if we really knew it
exactly then we'd be able to evaluate $f(x)$ exactly and we are
evidently presuming that this isn't possible (or we wouldn't be doing
all this!). That is, we have {\it limited information} about what $c$
is, which we could view as the limitation on how precisely we can know
the value $f(x)$.

To give an example of how to use this limited information,
consider $f(x)=\sqrt{x}$ (yet again!). Taking $x_o=25$, we have
$$\sqrt{x}=f(x)=f(x_o)+f'(x_o)(x-x_o)+{f''(c)\over 2!}(x-x_o)^2=$$
$$=\sqrt{25}+{1\over 2} { 1 \over \sqrt{25 }}(x-25)-
{1\over 2!}{1\over 4}{ 1 \over (c)^{3/2 }}(x-25)^2=$$
$$=5+{1\over 10}(x-25)-{1\over 8}{ 1 \over c^{3/2 }}(x-25)^2$$
where all we know about $c$ is that it is between $25$ and $x$. What
can we expect to get from this?

Well, we have to make a choice or two to get started: let's suppose
that $x\ge 25$ (rather than smaller). Then we can write
$$25\le c\le x$$
From this, because the three-halves-power function is {\it 
increasing}, we have
$$25^{3/2}\le c^{3/2}\le x^{3/2}$$
Taking inverses (with positive numbers) reverses the inequalities: we
have
$$25^{-3/2}\ge c^{-3/2}\ge x^{-3/2}$$
So, {\it in the worst-case scenario}, the value of $c^{-3/2}$ is at
most $25^{-3/2}=1/125$.

And we can rearrange the equation:
$$\sqrt{x}-[5+{1\over 10}(x-25)]=-{1\over 8}{ 1 \over c^{3/2 }}(x-25)^2$$
Taking absolute values {\it in order to talk about error}, this is
$$|\sqrt{x}-[5+{1\over 10}(x-25)]|=|{1\over 8}{ 1 \over c^{3/2 }}(x-25)^2|$$
Now let's use our {\bf estimate} $|{ 1 \over c^{3/2 }}|\le 1/125$ to write
$$|\sqrt{x}-[5+{1\over 10}(x-25)]|\le|{1\over 8}{1\over 125}(x-25)^2|$$

OK, having done this simplification, {\it now} we can answer questions
like {\it For what range of $x\ge 25$ does $5+{1\over 10}(x-25)$
approximate $\sqrt{x}$ to within $.001$?} We cannot hope to tell {\it 
exactly}, but only to give a range of values of $x$ for which we {\it can}
be sure {\it based upon our estimate}. So the question becomes: solve
the inequality
$$|{1\over 8}{1\over 125}(x-25)^2|\le .001$$
(with $x\ge 25$). Multiplying out by the denominator of $8\cdot 125$
gives (by coincidence?)
$$|x-25|^2\le 1$$
so the solution is $25\le x\le 26$.

So we can conclude that $\sqrt{x}$ is approximated to within
$.001$ for all $x$ in the range $25\le x\le 26$. This is a
worthwhile kind of thing to be able to find out.






\vskip15pt\hrule\vskip12pt

\ex For what range of values of $x$ is $x-{ x^3 \over 6 }$
within $0.01$ of $\sin x$?

\ex   Only consider $-1\leq x\leq 1$. For what range of
values of $x$ {\it inside this interval} is the polynomial $1+x+x^2/2$
within $.01$ of $e^x$?

\ex On how large an interval around $0$ is $1-x$ within
$0.01$ of $1/(1+x)$? 

\ex On how large an interval around $100$ is
$10+{ x-100 \over 20 }$ within $0.01$ of $\sqrt{x}$?


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Achieving desired tolerance on desired interval}




This third question is usually the most difficult, since it requires
both {\it estimates} and adjustment of {\it number of terms} in the
Taylor expansion: {\it `Given a function, given a fixed point, given
an interval around that fixed point, and given a required tolerance,
find {\it how many terms} must be used in the Taylor expansion to
approximate the function to within the required tolerance on the given
interval.}

For example, let's get a Taylor polynomial approximation to
$e^x$ which is within $0.001$ on the interval
$[-{1\over 2},+{1\over 2}]$. We use
$$e^x=1+x+{x^2\over 2!}+{x^3\over 3!}+\ldots+{x^n\over n!}+
{e^c\over (n+1)!}x^{n+1}$$
for some $c$ between $0$ and $x$, and where we do not yet know what we
want $n$ to be. It is very convenient here that the $n$th derivative
of $e^x$ is still just $e^x$! We are wanting to {\it choose $n$ large-enough to guarantee that}
$$|{e^c\over (n+1)!}x^{n+1}|\le 0.001$$
for all $x$ in that interval (without knowing anything too detailed
about what the corresponding $c$'s are!).

The error term is estimated as follows,
by thinking 
about the {\it worst-case scenario} for the sizes of the parts of that
term: we know that the exponential function is increasing along the
whole real line, so in any event $c$ lies in
$[-{1\over 2},+{1\over 2}]$ and
$$|e^c|\le e^{1/2}\le 2$$
(where we've not been too fussy about being accurate about how big the
square root of $e$ is!). And for $x$ in that interval we know that
$$|x^{n+1}|\le ({1\over 2})^{n+1}$$
So we are wanting to {\it choose $n$ large-enough to guarantee that}
$$|{e^c\over (n+1)!} ({1\over 2})^{n+1}|\le 0.001$$
Since
$$|{e^c\over (n+1)!} ({1\over 2})^{n+1}|
\le {2\over (n+1)!}({1\over 2})^{n+1}$$
we can be confident of the desired inequality if we can be sure that
$${2\over (n+1)!}({1\over 2})^{n+1}\le 0.001$$
That is, we want to `solve' for $n$ in the inequality
$${2\over (n+1)!}({1\over 2})^{n+1}\le 0.001$$

There is no genuine formulaic way to `solve' for $n$ to accomplish
this. Rather, we just evaluate the left-hand side of the desired
inequality for larger and larger values of $n$ until (hopefully!) we
get something smaller than $0.001$. So, trying $n=3$, the expression
is
$${2\over (3+1)!}({1\over 2})^{3+1}={1\over 12\cdot 16}$$
which is more like $0.01$ than $0.001$. So just try $n=4$:
$${2\over (4+1)!}({1\over 2})^{4+1}={1\over 60\cdot 32}\le
0.00052$$
which is better than we need.

The conclusion is that we needed to take the Taylor polynomial of
degree $n=4$ to achieve the desired tolerance along the whole interval
indicated. Thus, the polynomial
$$1+x+{x^2\over 2}+{x^3\over 3}+{x^4\over 4}$$
approximates $e^x$ to within $0.00052$ for $x$ in the interval 
$[-{1\over 2},{1\over 2}]$.

Yes, such questions can easily become very difficult. And, as
a reminder, there is no real or genuine claim that this kind of
approach to polynomial approximation is `the best'.






\vskip15pt\hrule\vskip12pt

\ex  Determine how many terms are needed in order to have the
corresponding Taylor polynomial approximate $e^x$ to within $0.001$
on the interval $[-1,+1]$.

\ex Determine how many terms are needed in order to have the
corresponding Taylor polynomial approximate $\cos x$ to within $0.001$
on the interval $[-1,+1]$.

\ex Determine how many terms are needed in order to have the
corresponding Taylor polynomial approximate $\cos x$ to within $0.001$
on the interval $[{ -\pi \over 2 },{ \pi \over 2 }]$.

\ex Determine how many terms are needed in order to have the
corresponding Taylor polynomial approximate $\cos x$ to within $0.001$
on the interval $[-0.1,+0.1]$.

\ex   Approximate $e^{1/2}=\sqrt{e}$ to within $.01$ by
using a Taylor polynomial with remainder term, expanded at $0$. {\it 
(Do NOT add up the finite sum you get!)}

\ex Approximate $\sqrt{101}=(101)^{1/2}$ to within
$10^{-15}$ using a Taylor polynomial with remainder term. {\it (Do NOT
add up the finite sum you get! One point here is that most hand
calculators do not easily give 15 decimal places. Hah!)}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Integrating Taylor polynomials: first example}




Thinking simultaneously about the difficulty (or impossibility) of
`direct' symbolic integration of complicated expressions, by contrast to
the ease of integration of {\it polynomials}, we might hope to get
some mileage out of {\it integrating Taylor polynomials}.

As a promising example: on one hand, it's not too hard to
compute that
$$\int_0^{T} {dx\over 1-x}\;dx=[-\log (1-x)]_0^T=-\log(1-T)$$
On the other hand, if we write out
$${1\over 1-x}=1+x+x^2+x^3+x^4+\ldots$$
then we could obtain
$$\int_0^{T}
(1+x+x^2+x^3+x^4+\ldots)\;dx=[x+{x^2\over 2}+{x^3\over 3}+\ldots]_0^T=$$
$$ = T+{T^2\over 2}+{T^3\over 3}+{T^4\over 4}+\ldots$$
Putting these two together (and changing the variable back to `$x$') gives
$$-\log(1-x)= x+{x^2\over 2}+{x^3\over 3}+{x^4\over 4}+\ldots$$

(For the moment let's not worry about what happens to the
error term for the Taylor polynomial).

This little computation has several useful
interpretations. First, we obtained a Taylor polynomial for
$-\log(1-T)$ from that of a geometric series, without going to the
trouble of recomputing derivatives. Second, from a different
perspective, we have an expression for the integral
$$\int_0^{T} {dx\over 1-x}\;dx$$
without necessarily mentioning the logarithm: that is, with some
suitable interpretation of the trailing dots,
$$\int_0^{T} {dx\over 1-x}\;dx= 
T+{T^2\over 2}+{T^3\over 3}+{T^4\over 4}+\ldots$$






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Integrating the error term: example}




Being a little more careful, let's keep track of the error
term in the example we've been doing: we have
$${1\over 1-x}=1+x+x^2+\ldots+x^n+
{1\over (n+1)}{ 1 \over (1-c)^{n+1 }}x^{n+1}$$
for some $c$ between $0$ and $x$, and also depending upon $x$ and
$n$. One way to avoid having the ${ 1 \over (1-c)^{n+1 }}$ `blow up' on us,
is to keep $x$ itself in the range $[0,1)$ so that $c$ is in the range
$[0,x)$ which is inside $[0,1)$, keeping $c$ away from $1$. To do this
we might demand that $0\le T
<1$.

For simplicity, and to illustrate the point, let's just take $0\le
T\le {1\over 2}$. Then in the {\it worst-case scenario}
$$|{ 1 \over (1-c)^{n+1 }}|\le { 1 \over (1-{1\over 2 })^{n+1}}=
2^{n+1}$$

Thus, {\it integrating the error term,} we have
$$|\int_0^T{1\over n+1}{ 1 \over (1-c)^{n+1 }}x^{n+1}\;dx|\le 
\int {1\over n+1}2^{n+1}x^{n+1}\;dx
={ 2^{n+1} \over n+1}\int_0^Tx^{n+1 }\;dx$$
$$={ 2^{n+1}}{n+1}[{x^{n+2} \over n+2}]_0^T
={2^{n+1}T^{n+2} \over (n+1)(n+2) }$$
Since we have cleverly required $0\le T\le {1\over 2}$, we actually
have
$$
|\int_0^T{1\over n+1}{ 1 \over (1-c)^{n+1 }}x^{n+1}\;dx|\le 
{ 2^{n+1}T^{n+2} \over (n+1)(n+2) }\le$$
$$\le 
{ 2^{n+1}({1\over 2})^{n+2} \over (n+1)(n+2)}={1\over 2(n+1)(n+2) }$$

That is, we have
$$|-\log(1-T)-[T+{T^2\over 2}+\ldots+{T^n\over n}]|\le 
{1\over 2(n+1)(n+2)}$$
for all $T$ in the interval $[0,{1\over 2}]$. Actually, we had
obtained
$$|-\log(1-T)-[T+{T^2\over 2}+\ldots+{T^n\over n}]|\le 
{ 2^{n+1}T^{n+2} \over 2(n+1)(n+2) }$$
and the latter expression shrinks rapidly as $T$ approaches $0$.





\bye