% % % % % % % %
% % % % % % % %
%IMPORTANT
%compiles with
%pdflatex -shell-escape
%IMPORTANT
% % % % % % % %
% % % % % % % %
\documentclass%
%[handout]%
{beamer}
%IMPORTANT: the following line selects the current lecture. Change number to select a different lecture.
\newcommand{\currentLecture}{2}


\mode<presentation>
{
\useinnertheme{rounded}
\useoutertheme{infolines}
\usecolortheme{orchid}
\usecolortheme{whale}
}
%\setbeamertemplate{footline}{%
%  \raisebox{5pt}{\makebox[\paperwidth]{\hfill\makebox[10pt]{\scriptsize\insertframenumber}}}}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../example-templates.tex
\usepackage{ifthen}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{cancel}
\usepackage{comment}
\usepackage{multirow}
\usepackage{psfrag}
\usepackage{rotating}
\usepackage{fp}
\usepackage{calc}
\usepackage{bm} 
\usepackage[all,cmtip]{xy}
\RequirePackage{xstring}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% List of commands in this document
%
%
% \logdiffbaseandexp
% \logdifftwouponedown
% \productrulefofx
% \quotientruley
% \limitradical  (broken)
% \limitsub
% \chainruley
% \chainrulefofx
% \chainruleStyleOne
% \chainruleStyleTwo
% \chainruleStyleThree
% \infinitelimit
% \limitfactor
% \newtonsmethod
% \constantmultiple
% \chainruletwice
% \youWillNotBeTested
% \optionalDisplay  %Dummy command needed for compatibility with Calculus notes.
% \Arcsin 
% \Arccos 
% \Arctan 
% \Arccot 
% \diff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\diff}{{\normalfont \text{d}}}
\newtheorem{question}{Question}
\newtheorem{observation}{Observation}
\newtheorem{proposition}{Proposition}
\newtheorem{remark}{Remark}
\newcommand{\youWillNotBeTested}{\begin{frame}You will not be tested on the material in the following slide.\end{frame}}
\DeclareMathOperator{\Vol}{Vol}

\DeclareMathOperator{\Arcsin}{\sin^{-1}}
\DeclareMathOperator{\Arccos}{\cos^{-1}}
\DeclareMathOperator{\Arctan}{\tan^{-1}}
\DeclareMathOperator{\Arccot}{{\cot^{-1}}}
\DeclareMathOperator{\Arcsec}{{\sec^{-1}}}
\DeclareMathOperator{\Arccsc}{{\csc^{-1}}}
\DeclareMathOperator{\maclaurin}{{\normalfont{Mc}}}
\newcommand{\taylor}{{\normalfont{T}}}

\newcommand{\optionalDisplay}[1]{#1}
\renewcommand{\Im}{\mathrm{Im}}
\renewcommand{\Re}{\mathrm{Re}}

%\DeclareMathOperator{\Re}{Re}
%\DeclareMathOperator{\Im}{Im}
\newcommand{\fcv}[1]{{\bf #1}} %this command stands for freecalc Vector
\DeclareMathOperator{\curl}{\fcv{curl}}
\DeclareMathOperator{\divg}{div}
\DeclareMathOperator{\proj}{\fcv{proj}}
\DeclareMathOperator{\orth}{\fcv{orth}}
\DeclareMathOperator{\grad}{\fcv{grad}}
\newcommand{\RR}{{\mathbb{R}}}
\newcommand{\cR}{{\mathcal{R}}}
\newcommand{\cD}{{\mathcal{D}}}
\newcommand{\cP}{{\mathcal{P}}}
\newcommand{\fcUncoverAlert}[2]{\uncover<#1->{\alert<#1>{#2}}}
\newcommand{\fcAnswer}[2]{ 
\FPeval{\fcResult}{clip(#1-1)} 
\uncover<handout:0|\fcResult>{\alert<\fcResult>{\textbf{?}}} \uncover<#1->{\alert<handout:0|#1>{#2}} 
}
\newcommand{\fcQuestion}[2]{% 
\FPeval{\fcResult}{clip(#1+1)}% 
\uncover<#1->{\alert<handout:0| #1,\fcResult>{#2}}%
}
\newcommand{\fcEvalToInt}[1]{\FPeval{\fcResult}{clip(#1)}\fcResult}
\newcommand{\refBad}[3]{%
\ifthenelse{\equal{#1}{??}}%
{#2}%
{#3}%
}
%
%  An example of logarithmic differentiation of a function with a 
%  variable base and exponent.
%  #1 is the base.
%  #2 is the exponent.
%  #3 is the derivative of the natural logarithm of the base.
%  #4 is the derivative of the exponent.
%  #5 is (base)(exponent)' + (exponent)(base)' after simplification.
%
\newcommand{\logdiffbaseandexp}[5]{
\begin{example}[Variable base and exponent]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Differentiate}\quad \alert<handout:0| 13>{y} %
 & \alert<handout:0| 13>{=} %
\alert<handout:0| 13>{%
#1^{#2}%
}.%
\uncover<2->{%
\intertext{
Take logarithms of both sides:%
}
}%
\uncover<2->{%
\ln y
}%
 & \uncover<2->{ = } %
\uncover<2->{%
\ln #1^{\alert<handout:0| 3>{#2}}%
}\\%
\uncover<3->{%
\alert<handout:0| 4-5>{\ln y}%
}%
 & \uncover<3->{ = } %
\uncover<3->{%
\alert<handout:0| 6-7>{%
\alert<handout:0| 3>{#2} \ln #1%
}.}%
\uncover<4->{%
\intertext{
Differentiate implicitly with respect to $x$:%
}%
}%
\uncover<5->{%
\alert<handout:0| 5>{\frac{1}{y} y'}%
}%
 & \uncover<4->{ = } %
\uncover<7->{%
\alert<handout:0| 7>{%
\left( #2 \right) \alert<handout:0| 8-9>{\frac{\diff}{\diff x} \left( \ln #1 \right)} + \left( \ln #1 \right)\alert<handout:0| 10-11>{\frac{\diff}{\diff x}\left( #2 \right)} %
}%
}\\%
\uncover<8->{%
\frac{1}{\alert<handout:0| 12>{y}} y'%
}%
 & \uncover<8->{ = } %
\uncover<8->{%
( #2 ) \alert<handout:0| 8-9>{\left( \uncover<9->{ #3 }\right)} + \left( \ln #1 \right) \alert<handout:0| 10-11>{ \left( \uncover<11->{ #4 } \right) }
}\\%
\uncover<12->{%
y'%
}%
 & \uncover<12->{ = } %
\uncover<12->{%
\alert<handout:0| 12-13>{y} \left( #5 \right)%
}\\%
 & \uncover<13->{ = } %
\uncover<13->{%
\alert<handout:0| 13>{#1^{#2}} \left( #5 \right).%
}%
\end{align*}
\end{example}
}


%
%  An example of logarithmic differentiation of a function.
%  It looks as follows:
%
%  Differentiate y = (#1 #2)/#3.
%  Take logarithms of both sides:
%  ln y = ln((#1 #2)/#3)
%  ln y = ln#1 + ln#2 - ln#3
%  ln y = #4 + #5 - #6
%  Differentiate implicitly with respect to x:
%  (1/y)y' = #7 + #8 - #9
%  y' = y(#7 + #8 - #9)
%  y' = ((#1 #2)/#3)(#7 + #8 - #9)
%
\newcommand{\logdifftwouponedown}[9]{
\begin{example}[Logarithmic Differentiation%
]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Differentiate}\quad \alert<handout:0| 18>{y} %
 & \alert<handout:0| 18>{=} %
\alert<handout:0| 18>{%
\frac{#1 #2}{#3}%
}.%
\uncover<2->{%
\intertext{
Take logarithms of both sides:%
}
}%
\uncover<2->{%
\ln y
}%
 & \uncover<2->{ = } %
\uncover<2->{%
\ln \frac{\alert<handout:0| 3-4>{#1}\alert<handout:0| 5-6>{#2}}{\alert<handout:0| 7-8>{#3}}%
}\\%
\uncover<2->{%
\ln y
}%
 & \uncover<2->{ = } %
\uncover<2->{%
\ln \alert<handout:0| 3-4>{#1} + \ln \alert<handout:0| 5-6>{#2} -  \ln \alert<handout:0| 7-8>{#3}%
}\\%
\uncover<3->{%
\alert<handout:0| 9-10>{\ln y}%
}%
 & \uncover<3->{ = } %
\uncover<3->{%
\alert<handout:0| 3-4,11-12>{%
\left( \uncover<4->{#4}\right) %
}%
\alert<handout:0| 5-6>{%
\uncover<6->{+} \alert<handout:0| 13-14>{\left( \uncover<6->{#5}\right)} %
}%
\alert<handout:0| 7-8>{%
\uncover<8->{-} \alert<handout:0| 15-16>{\left( \uncover<8->{#6}\right)} %
}%
}%
\uncover<9->{%
\intertext{
Differentiate implicitly with respect to $x$:%
}%
}%
\uncover<10->{%
\alert<handout:0| 10>{\frac{1}{\alert<handout:0| 17>{y}} y'}%
}%
 & \uncover<9->{ = } %
\uncover<9->{%
\alert<handout:0| 11-12>{\left( \uncover<12->{#7} \right)} + %
\alert<handout:0| 13-14>{\left( \uncover<14->{#8} \right)} - %
\alert<handout:0| 15-16>{\left( \uncover<16->{#9} \right)} %
}\\%
\uncover<17->{%
y'%
}%
 & \uncover<17->{ = } %
\uncover<17->{%
\alert<handout:0| 17-18>{y} \left( #7 + #8 - #9 \right)%
}\\%
 & \uncover<18->{ = } %
\uncover<18->{%
\alert<handout:0| 18>{\frac{#1 #2}{#3}} \left( #7 + #8 - #9 \right)%
}%
\end{align*}
\end{example}
}


%
%  An example of a derivative with the Product Rule, using the symbol f(x).
%  It looks as follows:
%  
%  Differentiate f(x) = #1 #2.
%  Product Rule: f'(x) = (#1)(d/dx)(#2) + (#2)(d/dx)(#1)
%   = (#1)(#4) + (#2)(#3)
%   = #5.
%
%  #6 appears in the subtitle of the example.
%
\newcommand{\productrulefofx}[6]{%
\begin{example}[Product Rule%
\ifthenelse{\equal{#6}{0}}%
{}%
{, #6}%
]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Differentiate}\quad f(x) & = #1 #2.\\%
\uncover<2->{%
\text{Product Rule:}\quad f'(x)%
}%
& \uncover<2->{%
 = \left( #1 \right) \alert<handout:0| 3-4>{\frac{\diff}{\diff x}\left( #2 \right)} + \left( #2 \right) \alert<handout:0| 5-6>{\frac{\diff}{\diff x}\left( #1 \right)}%
}\\%
& \uncover<3->{%
 = \left( #1 \right) \alert<handout:0| 3-4>{\left(\uncover<4->{ #4 }\right)} + \left( #2 \right) \alert<handout:0| 5-6>{\left( \uncover<6->{#3} \right)}%
}\\%
& \uncover<7->{%
 = #5.%
}%
\end{align*}
\end{example}
}


%
%  An example of a derivative with the Constant Multiple Rule. 
%  It looks as follows:
%  
%  Find the derivative of #1 = #2.
%   #1 = (#3)(#4).
%   d#1/dx = (d/dx)((#3)(#4))
% Constant Multiple Rule: = (#3)(d/dx)(#4)
%   = (#3)(#5)
%   = #6.
%
%  #7 appears in the subtitle of the example.
%
\newcommand{\constantmultiple}[7]{%
\begin{example}[Constant Multiple Rule%
\ifthenelse{\equal{#7}{0}}%
{}%
{, #7}%
]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Find the derivative of}\quad #1 & = #2.\\%
\uncover<2->{%
#1 %
}%
& \uncover<2->{%
 = \left( #3\right)\left( #4\right).
}\\%
\uncover<3->{%
\frac{\diff #1}{\diff x} %
}%
& \uncover<3->{%
 = \frac{\diff}{\diff x}\left[ \alert<handout:0| 4>{\left( #3\right)}\left( #4\right)\right]
}\\%
\uncover<4->{%
\text{Constant Multiple Rule:}\quad %
}%
& \uncover<4->{%
 =  \alert<handout:0| 4>{\left( #3\right)}\alert<handout:0| 5-6>{\frac{\diff}{\diff x}\left( #4\right)}
}\\%
& \uncover<5->{%
 =  \left( #3\right)\alert<handout:0| 5-6>{\left( \uncover<6->{#5}\right)}
}\\%
& \uncover<7->{%
 =  #6.
}%
\end{align*}
\end{example}
}


%
%  An example of a derivative with the Quotient Rule, using the symbol y.
%  It looks as follows:
%  
%  Differentiate y = #1 / #2.
%  Quotient Rule: dy/dx = ((#2)(d/dx)(#1)-(#1)(d/dx)(#2))/(#2)^2
%   = ((#2)(#3)-(#1)(#4))/(#2)^2
%   = #5
%   = #6.
%
%  #7 appears in the subtitle of the example.
%
\newcommand{\quotientruley}[7]{%
\begin{example}[Quotient Rule%
\ifthenelse{\equal{#7}{0}}%
{}%
{, #7}%
]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Differentiate}\quad y & = \frac{#1}{#2}.%
\uncover<2->{%
\intertext{Quotient Rule:}%
}%
%&\\%
\uncover<2->{%
\frac{\diff y}{\diff x}%
}%
& \uncover<2->{%
 = \frac%
{\left( #2 \right) \alert<handout:0| 3-4>{\frac{\diff}{\diff x}\left( #1 \right)} - \left( #1 \right) \alert<handout:0| 5-6>{\frac{\diff}{\diff x}\left( #2 \right)}}%
{\left( #2\right)^2}%
}\\%
& \uncover<3->{%
 = \frac%
{\left( #2 \right) \alert<handout:0| 3-4>{\left(\uncover<4->{ #3 }\right)} - \left( #1 \right) \alert<handout:0| 5-6>{\left( \uncover<6->{#4} \right)}}%
{\left( #2\right)^2}%
}\\%
& \uncover<7->{%
 = #5%
}\\%
& \uncover<8->{%
 = #6.%
}%
\end{align*}
\end{example}
}

%
%  An example of an indefinite integral with the Substitution Rule.
%  It looks as follows:
%  
%  Find \int (#1, with nothing substituted for UU and VV).
%  Let u = #2
%  Then du = #3.
%  Therefore #4 = #5.
%  Substitute: \int (#1, with the alert command for u and du 
%          substituted for UU and VV respectively) 
%  = \int (#6, with the alert command for u and du substituted for UU and VV)
%  = (#7, with u substituted for UU) + C
%  = (#8, with #2 substituted for UU) + C
%
%  #9 appears in the subtitle of the example.
%
\newcommand{\subrule}[9]{%
\begin{example}[Substitution Rule%
\ifthenelse{\equal{#9}{0}}%
{}%
{, #9}%
]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Find}\quad \int %
 \noexpandarg\exploregroups\StrSubstitute{\StrSubstitute{#1}{UU}{3}}{VV}{6-7}\noexploregroups\expandarg. & \\%
\uncover<2->{%
\text{Let}\quad\alert<handout:0| 2-3,8,13>{u}%
}%
& \uncover<2->{%
\alert<handout:0| 2-3,8,13>{ = \uncover<3->{#2.}}%
}\\%
\uncover<4->{%
\text{Then}\quad \alert<handout:0| 4-5>{\diff u}%
}%
& \uncover<4->{%
\alert<handout:0| 4-5>{ = \uncover<5->{#3}}%
}\\%
\uncover<6->{%
\alert<handout:0| 6-7,9>{#4}%
}%
& \uncover<6->{%
\alert<handout:0| 6-7,9>{ = \uncover<7->{#5.}}%
}\\%
\uncover<8->{%
\text{Substitute:}\quad \int%
 \noexpandarg\exploregroups\StrSubstitute{\StrSubstitute{#1}{UU}{8}}{VV}{9}\noexploregroups\expandarg}%
& \uncover<8->{= \alert<handout:0| 10-11>{\int\noexpandarg\exploregroups\StrSubstitute{\StrSubstitute{#6}{UU}{8}}{VV}{9}\noexploregroups\expandarg %
}}\\%
& \uncover<10->{\alert<handout:0| 10-11>{%
 = \uncover<11->{\noexpandarg\exploregroups \StrSubstitute{#7}{UU}{\alert<handout:0| 13>{u}}\noexploregroups\expandarg} \uncover<12->{\alert<handout:0| 12>{+C}}%
}}\\%
& \uncover<13->{%
 = \noexpandarg\exploregroups \StrSubstitute{#8}{UU}{\alert<handout:0| 13>{#2}}\noexploregroups\expandarg +C.%
}%
\end{align*}
\end{example}
}

%
%  An example of a definite integral with the Substitution Rule.
%  There are nine arguments to the function.  The ninth is a string of four 
%  groups of the form {AA}{BB}{CC}{DD} where AA is the lower limit of 
%  integration, BB is the upper limit of integration, CC is the lower limit
%  of integration with respect to u, and DD is the upper limit of integration
%  with respect to u.
%  It looks as follows:
%  
%  Find \int_{AA}^{BB} (#1, with nothing substituted for UU and VV).
%  Let u = #2
%  Then du = #3.
%  #4 = #5.
%  When x = AA, u = CC.
%  When x = BB, u = DD.
%  Substitute: \int_{AA}^{BB} (#1, with the alert command for u and du 
%          substituted for UU and VV respectively) 
%  = \int_{CC}^{DD} (#6, with the alert command for u and du substituted for UU and VV)
%  = [#7, with u substituted for UU]_{CC}^{DD}
%  = #8.
%
%
\newcommand{\subruledefbounds}[9]{%
\begin{example}[Substitution Rule, Definite Integral%
]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Find}\quad \int%
_{\StrMid{#9}{1}{1}}%
^{\StrMid{#9}{2}{2}} %
 \noexpandarg\exploregroups\StrSubstitute{\StrSubstitute{#1}{UU}{3}}{VV}{6-7}\noexploregroups\expandarg. & \\%
\uncover<2->{%
\text{Let}\quad\alert<handout:0| 2-3,8-12>{u}%
}%
& \uncover<2->{%
\alert<handout:0| 2-3,8-12>{ = \uncover<3->{#2.}}%
}\\%
\uncover<4->{%
\text{Then}\quad \alert<handout:0| 4-5>{\diff u}%
}%
& \uncover<4->{%
\alert<handout:0| 4-5>{ = \uncover<5->{#3}}%
}\\%
\uncover<6->{%
\alert<handout:0| 6-7,13>{#4}%
}%
& \uncover<6->{%
\alert<handout:0| 6-7,13>{ = \uncover<7->{#5.}}%
}\\%
\uncover<8->{%
\alert<handout:0| 8-9,14>{\text{When } x = \StrMid{#9}{1}{1}, \quad u }%
}%
& \uncover<8->{%
\alert<handout:0| 8-9,14>{ = \uncover<9->{\StrMid{#9}{3}{3}.}}%
}\\%
\uncover<10->{%
\alert<handout:0| 10-11,15>{\text{When } x = \StrMid{#9}{2}{2}, \quad u }%
}%
& \uncover<10->{%
\alert<handout:0| 10-11,15>{ = \uncover<11->{\StrMid{#9}{4}{4}.}}%
}\\%
\uncover<12->{%
\text{Substitute:}\quad \int%
_{\alert<handout:0| 14>{\StrMid{#9}{1}{1}}}%
^{\alert<handout:0| 15>{\StrMid{#9}{2}{2}}} %
 \noexpandarg\exploregroups\StrSubstitute{\StrSubstitute{#1}{UU}{12}}{VV}{13}\noexploregroups\expandarg}%
& \uncover<12->{= \alert<handout:0| 16-17>{{\int}%
_{\uncover<14->{\alert<handout:0| 14>{
\StrMid{#9}{3}{3}}}}%
^{\uncover<15->{
\alert<handout:0| 15>{
\StrMid{#9}{4}{4}}}} %
\noexpandarg\exploregroups\StrSubstitute{\StrSubstitute{#6}{UU}{12}}{VV}{13}\noexploregroups\expandarg %
}}\\%
& \uncover<16->{\alert<handout:0| 16-17>{%
 = {\left[ \uncover<17->{%
\noexpandarg\exploregroups\StrSubstitute{#7}{UU}{u}\noexploregroups\expandarg %
}\right]}_{\StrMid{#9}{3}{3}}^{\StrMid{#9}{4}{4}}%
}}\\%
& \uncover<18->{%
 = #8.
}%
\end{align*}
\end{example}
}


%
%  An example of a definite integral with the Substitution Rule.
%  There are nine arguments to the function.  The ninth is a string of two 
%  groups of the form {AA}{BB} where AA is the lower limit of 
%  integration and BB is the upper limit of integration.  
%  It looks as follows:
%  
%  Find \int_{AA}^{BB} (#1, with nothing substituted for UU and VV).
%  Let u = #2
%  Then du = #3.
%  #4 = #5.
%  Substitute: \int (#1, with the alert command for u and du 
%          substituted for UU and VV respectively) 
%  = \int (#6, with the alert command for u and du substituted for UU and VV)
%  = #7, with u substituted for UU
%  = #8.
%  Therefore int_{AA}^{BB} (#1, with nothing substituted for UU and VV)
%      = [#8]_{AA}^{BB}
%  = #9.
%
%
\newcommand{\subruledefvar}[9]{%
\begin{example}[Substitution Rule, Definite Integral%
]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Find}\quad \int%
_{\StrMid{#9}{1}{1}}%
^{\StrMid{#9}{2}{2}} %
 \noexpandarg\exploregroups\StrSubstitute{\StrSubstitute{#1}{UU}{3}}{VV}{6-7}\noexploregroups\expandarg. & \\%
\uncover<2->{%
\text{Let}\quad\alert<handout:0| 2-3,8,12>{u}%
}%
& \uncover<2->{%
\alert<handout:0| 2-3,8,12>{ = \uncover<3->{#2.}}%
}\\%
\uncover<4->{%
\text{Then}\quad \alert<handout:0| 4-5>{\diff u}%
}%
& \uncover<4->{%
\alert<handout:0| 4-5>{ = \uncover<5->{#3}}%
}\\%
\uncover<6->{%
\alert<handout:0| 6-7,9>{#4}%
}%
& \uncover<6->{%
\alert<handout:0| 6-7,9>{ = \uncover<7->{#5.}}%
}\\%
\uncover<8->{%
\text{Substitute:}\quad \int%
 \noexpandarg\exploregroups\StrSubstitute{\StrSubstitute{#1}{UU}{8}}{VV}{9}\noexploregroups\expandarg}%
& \uncover<8->{= \alert<handout:0| 10-11>{{\int}%
\noexpandarg\exploregroups\StrSubstitute{\StrSubstitute{#6}{UU}{8}}{VV}{9}\noexploregroups\expandarg %
}}\\%
& \uncover<10->{%
 \alert<handout:0| 10-11>{ = \uncover<11->{%
\noexpandarg\exploregroups{\StrSubstitute{#7}{UU}{\alert<handout:0| 12>{u}}}\noexploregroups\expandarg%
}}%
  \uncover<12->{%
 = \noexpandarg\exploregroups{\StrSubstitute{#7}{UU}{\alert<handout:0| 12>{#2}}}\noexploregroups\expandarg.%
}%
}\\%
\uncover<13->{%
\text{Therefore}\quad \int%
_{\StrMid{#9}{1}{1}}%
^{\StrMid{#9}{2}{2}} %
 \noexpandarg\exploregroups\StrSubstitute{\StrSubstitute{#1}{UU}{0}}{VV}{0}\noexploregroups\expandarg}%
& \uncover<13->{%
 = \left[%
 \noexpandarg\exploregroups{\StrSubstitute{#7}{UU}{#2}}\noexploregroups\expandarg%
\right]%
_{\StrMid{#9}{1}{1}}%
^{\StrMid{#9}{2}{2}} %
}\\%
& \uncover<14->{%
 = #8.
}%
\end{align*}
\end{example}
}

%
%  An example of a derivative with the Chain Rule, using the symbol y.
%  It looks as follows:
%
%  Differentiate y = #1.
%  Let u = #2
%  Then y = #3
%  Chain Rule: dy/dx = (dy/du)(du/dx)
%  = (#4, with u substituted for UU)(#5)
%  = #6, with #2 substituted for UU
%
%  #7 appears in the subtitle of the example.
%
\newcommand{\chainruley}[7]{%
\begin{example}[Chain Rule%
\ifthenelse{\equal{#7}{0}}%
{}%
{, #7}%
]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Differentiate}\quad y & = #1.\\%
\uncover<2->{%
\text{Let}\quad\alert<handout:0| 2-3,8-10>{u}%
}%
& \uncover<2->{%
\alert<handout:0| 2-3,8-10>{ = \uncover<3-| handout:0>{#2.}}%
}\\%
\uncover<4->{%
\text{Then}\quad \alert<handout:0| 6-7>{y}%
}%
& \uncover<4->{%
\alert<handout:0| 6-7>{ = \uncover<4-| handout:0>{#3.}}%
}\\%
\uncover<5->{%
\text{Chain Rule:}\quad%
\frac{\diff y}{\diff x}%
}%
& \uncover<5->{%
 = \alert<handout:0| 6-7>{\frac{\diff y}{\diff u}}%
\alert<handout:0| 8-9>{\frac{\diff u}{\diff x}}%
}\\%
& \uncover<6->{%
 = \alert<handout:0| 6-7>{\left( \uncover<7-| handout:0>{\noexpandarg\exploregroups\StrSubstitute{#4}{UU}{\alert<handout:0| 10>{u}}\noexploregroups\expandarg}\right)}%
\alert<handout:0| 8-9>{\left( \uncover<9-| handout:0>{#5}\right)}%
}\\%
& \uncover<10->{ = } \uncover<10-| handout:0>{%
 \noexpandarg\exploregroups \StrSubstitute{#6}{UU}{\alert<handout:0| 10>{#2}}.\noexploregroups\expandarg%
}%
\end{align*}
\end{example}
}





%
%  An example of a derivative with the Chain Rule, using the symbol f(x).
%  It looks as follows:
%  
%  Differentiate f(x) = #1.
%  Let h(x) = #2
%  Let g(x) = #3
%  Then f(x) = g(h(x))
%  f'(x) = g'(h(x))h'(x)
%  = (#4, with h(x) substituted for UU)(#5)
%  = #6, with #2 substituted for UU
%
%  #7 appears in the subtitle of the example.
%
\newcommand{\chainrulefofx}[7]{%
\begin{example}[Chain Rule%
\ifthenelse{\equal{#7}{0}}%
{}%
{, #7}%
]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Differentiate}\quad f(x) & = #1.\\%
\uncover<2->{%
\text{Let}\quad\alert<handout:0| 2-3,9-11>{h(x)}%
}%
& \uncover<2->{%
\alert<handout:0| 2-3,9-11>{ = \uncover<3-| handout:0>{#2.}}%
}\\%
\uncover<2->{%
\text{Let}\quad\alert<handout:0| 4-5,7-8>{g(x)}%
}%
& \uncover<2->{%
\alert<handout:0| 4-5,7-8>{ = \uncover<5-| handout:0>{#3.}}%
}\\%
\uncover<2-| handout:0>{%
\text{Then}\quad f(x)%
}%
& \uncover<2-| handout:0>{%
 = g(h(x)).%
}\\%
\uncover<6-| handout:0>{%
\text{Chain Rule:}\quad%
f'(x)%
}%
& \uncover<6-| handout:0>{%
 = \alert<handout:0| 7-8>{g'(h(x))}%
\alert<handout:0| 9-10>{h'(x)}%
}\\%
& \uncover<7-| handout:0>{%
=}\uncover<7-| handout:0>{\alert<handout:0| 7-8>{\left( \uncover<8-| handout:0>{\noexpandarg\exploregroups\StrSubstitute{#4}{UU}{\alert<handout:0| 11>{h(x)}}\noexploregroups\expandarg}\right)}%
\alert<handout:0| 9-10>{\left( \uncover<10-| handout:0>{#5}\right)}%
}\\%
& \uncover<11-| handout:0>{=} \uncover<11-| handout:0>{%
 \noexpandarg \exploregroups \StrSubstitute{#6}{UU}{\alert<handout:0| 11>{#2}}.\noexploregroups \expandarg%
}%
\end{align*}
\end{example}
}

%
%  Similar to chainrulefofx but in different style.
%  It looks as follows: 
%
%  Recall the chain rule (...).
%******************************
%  Differentiate f(x) = #1.
%  h(x) = #2
%  Let g(u) = #3
%  Then g'(u)=#4
%  Then f(x) = g(u)
%  f'(x) = g'(u)h'(x)
%  = (#4, with h(x) substituted for UU)(#5)
%  = #6, with #2 substituted for UU
%
%  #7 appears in the subtitle of the example.
%
\newcommand{\chainruleStyleOne}[7]{%
{\renewcommand{\arraystretch}{1.2}
$
\begin{array}{rclll}
\alert<1-| handout:0>{\left(g(h(x))\right)'}&\alert<1-| handout:0>{=}&\alert<1-| handout:0>{g'(h(x))\cdot  h'(x)}&& \text{(notation 1)} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} \\ 
(g(u))'&\alert<0>{=}&g'(u) u'&\text{where } u=h(x)& \text{(notation 2)}\\
\displaystyle\frac{\diff y}{\diff x} &\alert<0>{=}& \displaystyle\frac{\diff y}{\diff u}  \frac{\diff u}{\diff x} &\text{where } y=g(u)& \text{(notation 3)}\quad.\\
\end{array}
$
}
\begin{example}[Chain Rule, Notation 1%
\ifthenelse{\equal{#7}{0}}%
{}%
{, #7}%
]%
\[
\begin{array}{rrcl}
\text{Differentiate } & f(x) & =& #1.\\%
\uncover<2->{%
\text{Let}&\alert<handout:0| 2-3,9-11>{h(x)}%
}%
&\uncover<2-| handout:0>{\alert<handout:0| 2-3,9-11>{=}}&\displaystyle \uncover<2-| handout:0>{%
\alert<handout:0| 2-3,9-11>{ \uncover<3-| handout:0>{#2.}}%
}\\%
\uncover<2->{%
\text{Let}&\alert<handout:0| 4-5,7-8>{g(u)}%
}
&\uncover<2->{\alert<handout:0| 4-5,7-8>{=}}&\displaystyle
\uncover<2->{\alert<handout:0| 4-5,7-8>{\uncover<5-| handout:0>{#3.}}%
}\\%
\uncover<2-| handout:0>{%
\text{Then}& f(x)
}%
&\uncover<2-| handout:0>{{=}}&\uncover<2-| handout:0>{%
 g(h(x)).%
}\\%
\uncover<6->{%
\text{Chain Rule:} &
f'(x)%
}%
&\uncover<6->{=}& \uncover<6->{%
 \alert<handout:0| 7-8>{g'(h(x))}%
\alert<handout:0| 9-10>{h'(x)}%
}\\%
&&\uncover<7-| handout:0>{=}& \displaystyle
\uncover<7-| handout:0>{\alert<handout:0| 7-8>{ \left( \uncover<8-| handout:0>{\noexpandarg \exploregroups \StrSubstitute{#4}{UU}{\alert<handout:0| 11>{h(x)}} \noexploregroups\expandarg}\right)}%
\alert<handout:0| 9-10>{\left( \uncover<10-| handout:0>{#5}\right)}%
}\\%
&&\uncover<11-| handout:0>{=}&\displaystyle \uncover<11-| handout:0>{%
 \noexpandarg \exploregroups \StrSubstitute{#6}{UU}{\alert<handout:0| 11>{#2}}.\noexploregroups \expandarg%
}%
\end{array}
\]
\end{example}
}

%
%  Similar to chainrulefofx but in different style.
%  It looks as follows: 
%
%  Recall the chain rule (...).
%******************************
%  Differentiate f(x) = #1.
%  Let u= #2
%  Let g(u) = #3
%  Then g'(u)=#4
%  Then f(x) = g(u)
%  f'(x) = g'(u)h'(x)
%  = (#4, with h(x) substituted for UU)(#5)
%  = #6, with #2 substituted for UU
%
%  #7 appears in the subtitle of the example.
%
\newcommand{\chainruleStyleTwo}[7]{%
{\renewcommand{\arraystretch}{1.2}
$
\begin{array}{rclll}
\alert<0>{\left(g(h(x))\right)'}&\alert<0>{=}&g'(h(x))  \cdot  h'(x)&& \text{(notation 1)} {~~~~~~~~~~~~~~~~~~~~} \\ 
\alert<1->{(g(u))'}&\alert<1->{=}&\alert<1->{g'(u) u'}&\text{where } u=h(x)& \text{(notation 2)}\\
\displaystyle\frac{\diff y}{\diff x} &\alert<0>{=}& \displaystyle\frac{\diff y}{\diff u}  \frac{\diff u}{\diff x} &\text{where } y=g(u)& \text{(notation 3)}\quad.\\
\end{array}
$
}
\begin{example}[Chain Rule, Notation 2%
\ifthenelse{\equal{#7}{0}}%
{}%
{, #7}%
]%
\[
\begin{array}{rrcl}
\text{Differentiate } & f(x) & =& #1.\\%
\uncover<2->{%
\text{Let}&\alert<handout:0| 2-3,9-11>{u}%
}%
&\uncover<2->{\alert<handout:0| 2-3,9-11>{=}}&\displaystyle \uncover<2->{%
\alert<handout:0| 2-3,9-11>{ \uncover<3-| handout:0>{#2.}}%
}\\%
\uncover<2->{%
\text{Let}&\alert<handout:0| 4-5,7-8>{g(u)}%
}
&\uncover<2->{\alert<handout:0| 4-5,7-8>{=}}&\displaystyle
\uncover<2->{\alert<handout:0| 4-5,7-8>{\uncover<5-| handout:0>{#3.}}%
}\\%
\uncover<2->{%
\text{Then}& f(x)
}%
&\uncover<2->{{=}}&\uncover<2->{%
 g(u).%
}\\%
\uncover<6->{%
\text{Chain Rule:} &
f'(x)%
}%
&\uncover<6->{=}& \uncover<6->{%
 \alert<handout:0| 7-8>{g'(u)}%
\alert<handout:0| 9-10>{u'}%
}\\%
&& \uncover<7-|handout:0>{=}&\displaystyle \uncover<7-|handout:0>{\alert<handout:0| 7-8>{\left( \uncover<8-| handout:0>{\noexpandarg\exploregroups\StrSubstitute{#4}{UU}{\alert<handout:0| 11>{u}}\noexploregroups\expandarg}\right)}%
\alert<handout:0| 9-10>{\left( \uncover<10-| handout:0>{#5}\right)}%
}\\%
&& \uncover<11-|handout:0>{ = }&\displaystyle \uncover<11-| handout:0>{%
 \noexpandarg \exploregroups \StrSubstitute{#6}{UU}{\alert<handout:0| 11>{#2}}.\noexploregroups \expandarg%
}%
\end{array}
\]
\end{example}
}


%
%  Similar to chainrulefofx but in different style.
%  It looks as follows: 
%
%  Recall the chain rule (...).
%******************************
%  Differentiate f(x) = #1.
%  h(x) = #2
%  Let g(u) = #3
%  Then f(x) = g(u)
%  f'(x) = g'(u)h'(x)
%  = (#4, with h(x) substituted for UU)(#5)
%  = #6, with #2 substituted for UU
%
%  #7 appears in the subtitle of the example.
%
\newcommand{\chainruleStyleThree}[7]{%
{\renewcommand{\arraystretch}{1.2}
$
\begin{array}{rclll}
\alert<0>{\left(g(h(x))\right)'}&\alert<0>{=}&g'(h(x))  \cdot  h'(x)&& \text{(notation 1)} {~~~~~~~~~~~~~~~~~~~~} \\ 
(g(u))'&\alert<0>{=}&g'(u) u'&\text{where } u=h(x)& \text{(notation 2)}\\
\displaystyle\alert<1->{\frac{\diff y}{\diff x}}&\alert<1->{=}&\displaystyle\alert<1->{\frac{\diff y}{\diff u}  \frac{\diff u}{\diff x}} &\text{where } y=g(u)& \text{(notation 3)}\quad.\\
\end{array}
$
}
\begin{example}[Chain Rule, Notation 3%
\ifthenelse{\equal{#7}{0}}%
{}%
{, #7}%
]%
\[
\begin{array}{rrcl}
\text{Differentiate } & y & =& #1.\\%
\uncover<2->{%
\text{Let}&\alert<handout:0| 2-3,9-11>{u}%
}%
&\uncover<2->{\alert<handout:0| 2-3,9-11>{=}}& \displaystyle \uncover<2->{%
\alert<handout:0| 2-3,9-11>{ \uncover<3-| handout:0>{#2.}}%
}\\%
\uncover<2->{%
\text{Then}&\alert<handout:0| 4-5,7-8>{y}%
}
&\uncover<2->{\alert<handout:0| 4-5,7-8>{=}}&\displaystyle
\uncover<2->{\alert<handout:0| 4-5,7-8>{\uncover<5-| handout:0>{#3.}}%
}\\%
\uncover<6->{%
\text{Chain Rule:} &
\displaystyle \frac{\diff y}{\diff x}%
}%
&\uncover<6->{=}&\displaystyle  \uncover<6->{%
 \alert<handout:0| 7-8>{\frac{\diff y}{\diff u}}%
\alert<handout:0| 9-10>{\frac{\diff u}{\diff x}}%
}\\%
&& \uncover<handout:0|7->{ =}&\displaystyle \uncover<handout:0|7->{\alert<handout:0| 7-8>{ \left( \uncover<8-| handout:0>{\noexpandarg \exploregroups \StrSubstitute{#4}{UU}{\alert<handout:0| 11>{u}} \noexploregroups\expandarg}\right)}%
\alert<handout:0| 9-10>{\left( \uncover<10-| handout:0>{#5}\right)}%
}\\%
&&\uncover<11->{=}&\displaystyle \uncover<11-| handout:0>{%
\noexpandarg \exploregroups \StrSubstitute{#6}{UU}{\alert<handout:0| 11>{#2}}.\noexploregroups \expandarg%
}%
\end{array}
\]
\end{example}
}

%
%  An example of an infinite limit calculation. 
%  There are nine arguments to the function.  The ninth is a string of six
%  plus and minus signs.  Let AA, BB, CC, DD, EE, and FF denote these plus
%  and minus signs.  Then the output of the function looks as follows:
%  
%  Find lim_{x \to #1^AA} (#2, with x substituted for UU)/(#3, with x substituted for UU).
%  Plug in #1.
%  (#2, with (#1) substituted for UU)/(#3, with (#1) substituted for UU) = #4/0.
%  The numerator is non-zero and the denominator is zero.  
%  Therefore the answer is DNE, infty, or -infty.
%  Factor: (#3, with x substituted for UU)/(#4, with x substituted for UU) = (#5 #6)/(#7 #8)
%  \to ((BB)(CC))/((DD)(EE))
%  = (FF).
%  Therefore lim_{x \to #1^AA} (#2, with x substituted for UU)/(#3, with x substituted for UU) = FF infty.
%
\newcommand{\infinitelimit}[9]{%
\begin{example}[Infinite Limit]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Find}\quad \lim_{x\to #1^{\StrMid{#9}{1}{1}}}
\frac%
{\noexpandarg\StrSubstitute{#2}{UU}{x}\expandarg}%
{\noexpandarg\StrSubstitute{#3}{UU}{x}\expandarg}%
& \\%
\uncover<2->{%
\text{Plug in $#1$:}\quad%
\frac%
{\alert<handout:0| 2-3>{\noexpandarg\StrSubstitute{#2}{UU}{(#1)}\expandarg}}%
{\alert<handout:0| 4-5>{\noexpandarg\StrSubstitute{#3}{UU}{(#1)}\expandarg}}%
}%
& \uncover<2->{= \frac{\uncover<3->{\alert<handout:0| 3>{#4}}}{\uncover<5->{\alert<handout:0| 5>{0}}}}%
\uncover<6->{%
\intertext{The numerator is non-zero and the denominator is zero.  %}
Therefore the answer is DNE, $\infty$, or $-\infty$.}
}%
\uncover<7->{%
\text{Factor:}\quad
}%
\uncover<7->{%
\lim_{x\to #1^{\StrMid{#9}{1}{1}}}%
\frac%
{\alert<handout:0| 8-9>{\noexpandarg\StrSubstitute{#2}{UU}{x}\expandarg}}%
{\alert<handout:0| 10-11>{\noexpandarg\StrSubstitute{#3}{UU}{x}\expandarg}}%
}%
& \uncover<8->{%
 = \lim_{x\to #1^{\StrMid{#9}{1}{1}}}%
\frac%
{%
\uncover<handout:0| 9->{\alert<handout:0| 9>{%
\alert<handout:0| 12-13>{%
#5%
}%
\alert<handout:0| 14-15>{%
#6%
}%
}}%
}{%
\uncover<handout:0| 11->{\alert<handout:0| 11>{%
\alert<handout:0| 16-17>{%
#7%
}%
\alert<handout:0| 18-19>{%
#8%
}%
}}%
}%
}\\%
& \uncover<12->{%
 \to \alert<handout:0| 20-21>{\frac%
{%
\alert<handout:0| 12-13>{(\uncover<handout:0| 13->{%
\StrMid{#9}{2}{2}%
})}%
\alert<handout:0| 14-15>{(\uncover<handout:0| 15->{%
\StrMid{#9}{3}{3}%
})}%
}{%
\alert<handout:0| 16-17>{(\uncover<handout:0| 17->{%
\StrMid{#9}{4}{4}%
})}%
\alert<handout:0| 18-19>{(\uncover<handout:0| 19->{%
\StrMid{#9}{5}{5}%
})}%
}%
}%
}\\%
& \uncover<20->{\alert<handout:0| 20-21>{ = \uncover<handout:0| 21->{\alert<handout:0| 22>{(\StrMid{#9}{6}{6})}}}}\\%
\uncover<22->{%
\text{Therefore}\quad\lim_{x\to #1^{\StrMid{#9}{1}{1}}}%
\frac%
{\noexpandarg\StrSubstitute{#2}{UU}{x}\expandarg}%
{\noexpandarg\StrSubstitute{#3}{UU}{x}\expandarg}%
}%
& \uncover<22->{ = } \uncover<handout:0| 22->{ \alert<handout:0| 22>{\StrMid{#9}{6}{6}}\infty.}
\end{align*}
\end{example}
}




%
%  An example of a limit calculation with factoring. 
%  
%  It looks as follows.  
%  
%  Find lim_{x \to #1} (#2, with x substituted for UU)/(#3, with x substituted for UU).
%  Plug in #1.
%  (#2, with (#1) substituted for UU)/(#3, with (#1) substituted for UU) = 0/0.
%  Zero over zero gives no information.
%  Factor: (#2, with x substituted for UU)/(#3, with x substituted for UU) = ((#4, with x substituted for UU) #6)/((#5, with x substituted for UU) #6)
%  = (#4, with x substituted for UU)/(#5, with x substituted for UU)
%  Plug in #1: = (#4, with (#1) substituted for UU)/(#5, with (#1) substituted for UU)
%  = #7
%  = #8
%
\newcommand{\limitfactor}[8]{%
\begin{example}[Limit with Factoring]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Find}\quad \lim_{x\to #1}
\frac%
{\noexpandarg\StrSubstitute{#2}{UU}{x}\expandarg}%
{\noexpandarg\StrSubstitute{#3}{UU}{x}\expandarg}%
& \\%
\uncover<2->{%
\text{Plug in $#1$:}\quad%
\frac%
{\alert<handout:0| 2-3>{\noexpandarg\StrSubstitute{#2}{UU}{(#1)}\expandarg}}%
{\alert<handout:0| 4-5>{\noexpandarg\StrSubstitute{#3}{UU}{(#1)}\expandarg}}%
}%
& \uncover<2->{%
= \frac%
{\uncover<3->{\alert<handout:0| 3>{0}}}%
{\uncover<5->{\alert<handout:0| 5>{0}}}%
}%
\uncover<6->{%
\intertext{Zero over zero is undefined, so we can't use direct substitution.}
}%
\uncover<7->{%
\text{Factor:}\quad%
\lim_{x\to #1} \frac%
{\alert<handout:0| 8-9>{\noexpandarg\StrSubstitute{#2}{UU}{x}\expandarg}}%
{\alert<handout:0| 10-11>{\noexpandarg\StrSubstitute{#3}{UU}{x}\expandarg}}%
}%
& \uncover<8->{%
 = \lim_{x\to #1} \frac%
{%
\uncover<handout:0| 9->{\alert<handout:0| 9>{%
(\noexpandarg\StrSubstitute{#4}{UU}{x}\expandarg)%
\alert<handout:0| 12>{#6}%
}}%
}{%
\uncover<handout:0| 11->{\alert<handout:0| 11>{%
(\noexpandarg\StrSubstitute{#5}{UU}{x}\expandarg)%
\alert<handout:0| 12>{#6}%
}}%
}%
}\\%
& \uncover<12->{%
 = \lim_{x\to #1} \frac%
{\uncover<handout:0| 12->{\noexpandarg\StrSubstitute{#4}{UU}{\alert<handout:0| 13>{x}}\expandarg}}%
{\uncover<handout:0| 12->{\noexpandarg\StrSubstitute{#5}{UU}{\alert<handout:0| 13>{x}}\expandarg}}%
}\\%
\uncover<13->{%
\text{Plug in $#1$:}\quad%
\lim_{x\to #1} \frac%
{\noexpandarg\StrSubstitute{#2}{UU}{x}\expandarg}%
{\noexpandarg\StrSubstitute{#3}{UU}{x}\expandarg}%
}%
& \uncover<13->{%
 = \frac%
{\uncover<handout:0| 13->{\noexpandarg\StrSubstitute{#4}{UU}{(\alert<handout:0| 13>{#1})}\expandarg}}%
{\uncover<handout:0| 13->{\noexpandarg\StrSubstitute{#5}{UU}{(\alert<handout:0| 13>{#1})}\expandarg}}%
}\\%
& \uncover<14->{%
= \uncover<handout:0| 14->{#7}%
}\\%
& \uncover<15->{%
= \uncover<handout:0| 14->{#8.}%
}%
\end{align*}
\end{example}
}




%
%  An example of a limit calculation with a conjugate radical. 
%  
%  It looks as follows.  
%  
%  Find lim_{x \to #1} (#2, with x substituted for UU)/(#3, with x substituted for UU).
%  Plug in #1.
%  (#2, with (#1) substituted for UU)/(#3, with (#1) substituted for UU) = 0/0.
%  Zero over zero gives no information.
%  Factor: (#2, with x substituted for UU)/(#3, with x substituted for UU) = ((#4, with x substituted for UU) #6)/((#5, with x substituted for UU) #6)
%  = (#4, with x substituted for UU)/(#5, with x substituted for UU)
%  Plug in #1: = (#4, with (#1) substituted for UU)/(#5, with (#1) substituted for UU)
%  = #7
%  = #8
%
\newcommand{\limitradical}[9]{%
\begin{example}[Limit with Conjugate Radical]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
& \text{Find}\quad \lim_{x\to #1}
\frac%
{\noexpandarg\StrSubstitute{#2}{UU}{x}\expandarg}%
{\noexpandarg\StrSubstitute{#3}{UU}{x}\expandarg}%
 \\%
\uncover<2->{%
& \text{Plug in $#1$:}\quad%
\frac%
{\alert<handout:0| 2-3>{\noexpandarg\StrSubstitute{#2}{UU}{(#1)}\expandarg}}%
{\alert<handout:0| 4-5>{\noexpandarg\StrSubstitute{#3}{UU}{(#1)}\expandarg}}%
}%
 \uncover<2->{%
= \frac%
{\uncover<3->{\alert<handout:0| 3>{0}}}%
{\uncover<5->{\alert<handout:0| 5>{0}}}%
}%
\uncover<6->{%
\intertext{Zero over zero gives no information.  Use a conjugate radical.}
}%
& \uncover<7->{%
\lim_{x\to #1} \frac%
{\noexpandarg\StrSubstitute{#2}{UU}{x}\expandarg}%
{\alert<handout:0| 7-8>{\noexpandarg\StrSubstitute{#3}{UU}{x}\expandarg}}%
\cdot %
\frac%
{\uncover<8->{\alert<8>{\noexpandarg\StrSubstitute{#4}{UU}{x}\expandarg}}}%
{\uncover<8->{\alert<8>{\noexpandarg\StrSubstitute{#4}{UU}{x}\expandarg}}}%
}\\%
& \uncover<9->{%
 = \lim_{x\to #1} \frac%
{(\noexpandarg\StrSubstitute{#2}{UU}{x}\expandarg)%
\left(\noexpandarg\StrSubstitute{#4}{UU}{x}\expandarg\right)}%
{#5}%
}\\%
& \uncover<10->{%
 = \lim_{x\to #1} \frac%
{(\alert<11-12>{\noexpandarg\StrSubstitute{#2}{UU}{x}\expandarg})%
\left(\noexpandarg\StrSubstitute{#4}{UU}{x}\expandarg\right)}%
{\alert<13-14>{#6}}%
}\\%
\uncover<11->{%
\text{Factor:}\quad%
}%
& \uncover<11->{%
 = \lim_{x\to #1} \frac%
{\uncover<12->{\alert<12>{(\noexpandarg\StrSubstitute{#7}{UU}{x}\expandarg)(x-#1)}}%
\left(\noexpandarg\StrSubstitute{#4}{UU}{x}\expandarg\right)}%
{\uncover<14->{\alert<14>{(\noexpandarg\StrSubstitute{#8}{UU}{x}\expandarg)(x-#1)}}}%
}\\%
& \uncover<15->{%
 = \lim_{x\to #1} \frac%
{(\noexpandarg\StrSubstitute{#7}{UU}{x}\expandarg)%
\left(\noexpandarg\StrSubstitute{#4}{UU}{x}\expandarg\right)}%
{\noexpandarg\StrSubstitute{#8}{UU}{x}\expandarg}%
}\\%
\uncover<16->{%
\text{Plug in $#1$:}\quad%
}%
& \uncover<16->{%
 = \frac%
{(\noexpandarg\StrSubstitute{#7}{UU}{(#1)}\expandarg)%
\left(\noexpandarg\StrSubstitute{#4}{UU}{(#1)}\expandarg\right)}%
{\noexpandarg\StrSubstitute{#8}{UU}{(#1)}\expandarg}%
}\\%
& \uncover<17->{%
#9.
}%
\end{align*}
\end{example}
}


%
%  An example of a limit calculation with direct substitution.  
%  
%  It looks as follows.  
%  
%  Find lim_{x \to #1} (#2, with x substituted for UU)/(#3, with x substituted for UU).
%  Plug in #1.
%  (#2, with (#1) substituted for UU)/(#3, with (#1) substituted for UU) = 0/0.
%  Zero over zero gives no information.
%  Factor: (#2, with x substituted for UU)/(#3, with x substituted for UU) = ((#4, with x substituted for UU) #6)/((#5, with x substituted for UU) #6)
%  = (#4, with x substituted for UU)/(#5, with x substituted for UU)
%  Plug in #1: = (#4, with (#1) substituted for UU)/(#5, with (#1) substituted for UU)
%  = #7
%  = #8
%
\newcommand{\limitsub}[7]{%
\begin{example}[%
\ifthenelse{\equal{#6}{0}}%
{Limit in Which Direct Substitution Doesn't Work}%
{Limit with Direct Substitution}%
]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Find}\quad \lim_{x\to #1}
\frac%
{\noexpandarg\StrSubstitute{#2}{UU}{x}\expandarg}%
{\noexpandarg\StrSubstitute{#3}{UU}{x}\expandarg}%
& \\%
\uncover<2->{%
\text{Plug in $#1$:}\quad%
\frac%
{\alert<handout:0| 2-3>{\noexpandarg\StrSubstitute{#2}{UU}{(#1)}\expandarg}}%
{\alert<handout:0| 4-5>{\noexpandarg\StrSubstitute{#3}{UU}{(#1)}\expandarg}}%
}%
& \uncover<2->{%
= \frac%
{\uncover<3->{\alert<handout:0| 3>{#4}}}%
{\uncover<5->{\alert<handout:0| 5>{#5}}}%
}\\%
\ifthenelse{\equal{#6}{0}}%
{ }%
{&}%
\uncover<6->{%
\ifthenelse{\equal{#6}{0}}%
{\intertext{Dividing by zero is undefined, so we can't use direct substitution.}}%
{ = #7.}%
}%
\ifthenelse{\equal{#6}{0}}%
{ }%
{ \text{Therefore}= #7.}%
\end{align*}
\end{example}
}



%
%  An example Newton's Method.  
%  
%  It looks as follows.  
%  
%  Starting with x_1 = #1, find the third approximation x_3 to the root of the equation #2.  
%  
%  f(x) = (#3, with x substituted for UU).
%  f'(x) = (#4, with x substituted for UU).
%  Newton's Method: x_{n+1} = x_n - f(x_n)/f'(x_n) = x_n - (#3, with x_n substituted for UU)/(#4, with x_n substituted for UU).
%  
%  x_2 = x_1 - (#3, with x_1 substituted for UU)/(#4, with x_1 substituted for UU)     x_3 = x_2 - (#3, with x_2 substituted for UU)/(#4, with x_2 substituted for UU)     
%   = (#1) - (#3, with (#1) substituted for UU)/(#4, with (#1) substituted for UU)     = (#5) - (#3, with (#5) substituted for UU)/(#4, with (#5) substituted for UU)
%  = #5.      = #6.
%
\newcommand{\newtonsmethod}[8]{%
\begin{example}[Newton's Method%
\ifthenelse{\equal{#8}{0}}%
{}%
{, #8}%
]%
\ifthenelse{\equal{#7}{0}}%
{%
Starting with $x_1 = #1$, find the third approximation $x_3$ to the root of the equation $#2$.  
}%
{#7}%
\abovedisplayskip=0pt
\belowdisplayskip=10pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\uncover<2->{%
\alert<handout:0| 2-3,7>{f(x)}%
& \alert<handout:0| 2-3,7>{ = \uncover<3->{\noexpandarg \exploregroups \StrSubstitute{#3}{UU}{x}.\noexploregroups \expandarg}}%
}\\%
\uncover<4->{%
\alert<handout:0| 4-5,8>{f'(x)}%
& \alert<handout:0| 4-5,8>{ = \uncover<5->{\noexpandarg \exploregroups \StrSubstitute{#4}{UU}{x}.\noexploregroups \expandarg}}%
}\\%
\uncover<6->{%
\text{Newton's Method:}\quad %
x_{n+1} & = x_n - \frac{\alert<handout:0| 7>{f(x_n)}}{\alert<handout:0| 8>{f'(x_n)}}%
}
\uncover<7->{%
 = x_n - \frac%
{\alert<handout:0| 7>{\noexpandarg \exploregroups \StrSubstitute{#3}{UU}{x_n}\noexploregroups \expandarg}}%
{\alert<handout:0| 8>{\uncover<8->{\noexpandarg \exploregroups \StrSubstitute{#4}{UU}{x_n}\noexploregroups \expandarg}}}%
}
\end{align*}
\begin{align*}
\uncover<9->{%
x_2 %
}%
& \uncover<9->{%
 = \alert<handout:0| 10>{x_1} - \frac%
{\noexpandarg \exploregroups \StrSubstitute{#3}{UU}{\alert<handout:0| 10>{x_1}}\noexploregroups \expandarg}%
{\noexpandarg \exploregroups \StrSubstitute{#4}{UU}{\alert<handout:0| 10>{x_1}}\noexploregroups \expandarg}%
}%
& \uncover<12->{%
x_3 %
}%
& \uncover<12->{%
 = \alert<handout:0| 13>{x_2} - \frac%
{\noexpandarg \exploregroups \StrSubstitute{#3}{UU}{\alert<handout:0| 13>{x_2}}\noexploregroups \expandarg}%
{\noexpandarg \exploregroups \StrSubstitute{#4}{UU}{\alert<handout:0| 13>{x_2}}\noexploregroups \expandarg}%
}\\%
& \uncover<10->{%
 = \alert<handout:0| 10>{(#1)} - \frac%
{\noexpandarg \exploregroups \StrSubstitute{#3}{UU}{\alert<handout:0| 10>{(#1)}}\noexploregroups \expandarg}%
{\noexpandarg \exploregroups \StrSubstitute{#4}{UU}{\alert<handout:0| 10>{(#1)}}\noexploregroups \expandarg}%
}%
& % 
& \uncover<13->{%
 = \alert<handout:0| 13>{(#5)} - \frac%
{\noexpandarg \exploregroups \StrSubstitute{#3}{UU}{\alert<handout:0| 13>{(#5)}}\noexploregroups \expandarg}%
{\noexpandarg \exploregroups \StrSubstitute{#4}{UU}{\alert<handout:0| 13>{(#5)}}\noexploregroups \expandarg}%
}\\%
& \uncover<11->{%
 = #5.%
}%
& % 
& \uncover<14->{%
 = #6.
}%
\end{align*}
\end{example}
}


%
%  An example of a derivative using the Chain Rule twice, using dy/dx.
%  It looks as follows:
%  
%  Differentiate: y = #1.
%		  dy\dx  = d\dx(#1)
%  Chain Rule:     = (#2) (d/dx)(#3)
%  Chain Rule:     = (#2)(#4) d/dx(#5)
%  #7 [optional]    = (#2)(#3)(#6)
%                             = (#8)
%                             = (#9)    [optional]
%

\newcommand{\chainruletwice}[9]{%
\begin{example}[Using the Chain Rule twice]%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\text{Differentiate:}\quad y & = #1.\\%
\uncover<2->{\frac{\diff y}{\diff x} & = \alert<handout:0|3-5>{\frac{\diff}{\diff x}\left( #1\right)}}\\%
\uncover<4->{\text{Chain Rule:} \ \ \quad &= \alert<handout:0|4-5>{\left(\uncover<5-| handout:0>{#2} \right)\alert<handout:0|6-8>{\frac{\diff}{\diff x} \left(\uncover<4-| handout:0>{#3}\right)}}} \\%
\uncover<7->{\text{Chain Rule:} \ \ \quad &= \left(\uncover<7-| handout:0>{#2}\right) \alert<handout:0|7-8>{\left(\uncover<8-| handout:0>{#4}\right) \alert<handout:0|9-10>{\frac{\diff}{\diff x}\left( \uncover<7-| handout:0>{#5} \right)}}}\\%
\uncover<9->{\uncover<10->{\ifthenelse{\equal{#7}{}}{}{\text{#7 :} \ \ \quad}}& = \left(\uncover<9-| handout:0>{#2} \right) \left(\uncover<9-| handout:0>{#4}\right)\alert<handout:0|9-10>{\left( \uncover<10-| handout:0>{#6} \right) }} \\%
\uncover<11->{& = \uncover<11-| handout:0>{#8 \ifthenelse{\equal{#9}{}}{.}{\\}}}%
\ifthenelse{\equal{#9}{}}{}{\uncover<12->{& = \uncover<12-| handout:0>{#9.}}}
\end{align*}
\end{example}
}



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../pstricks-commands.tex
\usepackage{etex, ifthen}
\usepackage [dvips={-o -Ppdf}, pspdf={-dNOSAFER -dAutoRotatePages=/None}, pdfcrop={}]
{auto-pst-pdf}
\usepackage{pst-plot}
\usepackage{pst-math}
%WARNING THE FOLLOWING PACKAGE IS BROKEN use only with EXTREME CAUTION
%\usepackage{pst-3dplot}

\makeatletter
\begingroup
\catcode `P=12  % digits and punct. catcode
\catcode `T=12  % digits and punct. catcode
\lowercase{%
\def\x{\def\rem@pt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}}
\expandafter\endgroup\x%
\newcommand{\stripPoints}[1]{\expandafter\rem@pt\the#1}
\makeatother

\newcommand{\fcShiftX}{0}
\newcommand{\fcShiftY}{0}
\newcommand{\fcXLabel}{$x$}
\newcommand{\fcYLabel}{$y$}
\newcommand{\fcZLabel}{$z$}
\newcommand{\fcDelta}{0.5}
\newcommand{\fcZBufferNumXIntervals}{20}
\newcommand{\fcZBufferNumYIntervals}{20}
\newcommand{\fcZBufferRowColumnsUnderInvestigation}{(empty) (empty)}
\newcommand{\fcZBufferUparameterPointUnderInvestigation}{(empty) (empty)}
\newcommand{\fcZBufferVparameterPointUnderInvestigation}{(empty) (empty)}
%\newcommand{\fcContourDebugged}{-1}
\newcommand{\fcStartXIId}{0}
\newcommand{\fcStartYIId}{0}
\newcommand{\fcIterationsX}{9\space}
\newcommand{\fcIterationsY}{9\space}
\newcommand{\fcIterationsU}{9\space}
\newcommand{\fcIterationsV}{9\space}
\newcommand{\fcNumCountourSegmentsPatchU}{10\space}
\newcommand{\fcNumCountourSegmentsPatchV}{10\space}
\newcommand{\fcScreenStyle}{z}
\newcommand{\fcColorLine}{black}
\newcommand{\fcForceForeground}{false}
\newcommand{\fcLineWidth}{1}
\newcommand{\fcScale}{1\space}
\newcommand{\fcArrows}{}
\newcommand{\fcPlotPoints}{200}
\newcommand{\fcLineStyle}{0}
\newcommand{\fcDashLength}{2}
\newcommand{\fcContourOptions}{
[(\fcArrows) (->) eq (\fcArrows) (<-) eq (\fcArrows) (<->) eq or or [\fcGetColorCode{\fcColorLine}] \fcLineWidth [\fcDashes] (\fcLineStyle)]
}
\newcommand{\fcDashes}{[1 1] 0}
\newcommand{\fcColorPatchUV}{1 0.5 0.5}
\newcommand{\fcColorPatchVU}{0.7 0.2 0.2}
\newcommand{\fcFastPatchSort}{false}
\newcommand{\fcDashesCode}{%
(\fcLineStyle) (dashed) eq %
{[\fcDashLength\space \fcDashLength] 0 setdash}%
{[] 0 setdash}%
ifelse\space %
}
\newcommand{\fcScreen}{[-1 1 -0.75] -1} %default projection plane. Renew this command to change projection plane.

\newcommand{\fcSet}[1]{\setkeys{fcGraphics}{#1}}

\makeatletter %needed for define@key command.
\define@key{pstricks,pst-plot}{xLabel}[]{}
\define@key{pstricks,pst-plot}{yLabel}[]{}
\define@key{pstricks,pst-plot}{zLabel}[]{}
\define@key{fcGraphics}{Delta}[\renewcommand{\fcDelta}{1}]{\renewcommand{\fcDelta}{#1}}
\define@key{fcGraphics}{shiftX}[\renewcommand{\fcShiftX}{0}]{\renewcommand{\fcShiftX}{#1}}
\define@key{fcGraphics}{shiftY}[\renewcommand{\fcShiftY}{0}]{\renewcommand{\fcShiftY}{#1}}
\define@key{fcGraphics}{startX}[\renewcommand{\fcStartXIId}{0}]{\renewcommand{\fcStartXIId}{#1}}
\define@key{fcGraphics}{startY}[\renewcommand{\fcStartYIId}{0}]{\renewcommand{\fcStartYIId}{#1}}
\define@key{fcGraphics}{colorUV}[\renewcommand{\fcColorPatchUV}{1 0.5 0.5}]{\renewcommand{\fcColorPatchUV}{#1\space}}
\define@key{fcGraphics}{colorVU}[\renewcommand{\fcColorPatchVU}{0.7 0.2 0.2}]{\renewcommand{\fcColorPatchVU}{#1\space}}
\define@key{fcGraphics}{iterationsU}[\renewcommand{\fcIterationsU}{9\space}]{\renewcommand{\fcIterationsU}{#1\space}}
\define@key{fcGraphics}{iterationsV}[\renewcommand{\fcIterationsU}{9\space}]{\renewcommand{\fcIterationsV}{#1\space}}
\define@key{fcGraphics}{forceForeground}[\renewcommand{\fcForceForeground}{false\space}]{\renewcommand{\fcForceForeground}{#1\space}}
\define@key{fcGraphics}{iterationsX}[\renewcommand{\fcIterationsX}{9\space}]{\renewcommand{\fcIterationsX}{#1\space}}
\define@key{fcGraphics}{scale}[\renewcommand{\fcScale}{1}]{\renewcommand{\fcScale}{#1\space}}
%\define@key{fcGraphics}{debugContour}[\renewcommand{\fcContourDebugged}{-1\space}]{\renewcommand{\fcContourDebugged}{#1\space}}
\define@key{fcGraphics}{iterationsY}[\renewcommand{\fcIterationsY}{9\space}]{\renewcommand{\fcIterationsY}{#1\space}}
\define@key{fcGraphics}{screenStyle}[\renewcommand{\fcScreenStyle}{z}]{\renewcommand{\fcScreenStyle}{#1}}
\define@key{fcGraphics}{xLabel}[\renewcommand{\fcXLabel}{$x$}]{\renewcommand{\fcXLabel}{#1}}
\define@key{fcGraphics}{yLabel}[\renewcommand{\fcYLabel}{$y$}]{\renewcommand{\fcYLabel}{#1}}
\define@key{fcGraphics}{zLabel}[\renewcommand{\fcZLabel}{$z$}]{\renewcommand{\fcZLabel}{#1}}
\define@key{fcGraphics}{linecolor}[\renewcommand{\fcColorLine}{black}]{\renewcommand{\fcColorLine}{#1}}
\define@key{fcGraphics}{linewidth}[\renewcommand{\fcLineWidth}{1}]{\renewcommand{\fcLineWidth}{#1}}
\define@key{fcGraphics}{linestyle}[\renewcommand{\fcLineStyle}{0}]{\renewcommand{\fcLineStyle}{#1}}
\define@key{fcGraphics}{linestyle}[\renewcommand{\fcLineStyle}{0}]{\renewcommand{\fcLineStyle}{#1}}
\define@key{fcGraphics}{fastsort}[\renewcommand{\fcFastPatchSort}{false}]{\renewcommand{\fcFastPatchSort}{#1}}
\define@key{fcGraphics}{dashes}[\renewcommand{\fcDashes}{[1 1] 0}]{\renewcommand{\fcDashes}{#1}}
\define@key{fcGraphics}{arrows}[\renewcommand{\fcArrows}{}]{\renewcommand{\fcArrows}{#1}}
\makeatother %undoes \makeatletter.


\newcommand{\fcHollowDot}[2]{
\pscircle*[fillcolor=white, linecolor=red](#1, #2){0.07}
\pscircle*[fillcolor=white, linecolor=white](#1, #2){0.04}
}

\newcommand{\fcFullDot}[3][linecolor=red]{
\setkeys{fcGraphics}{#1}
\pscircle*[#1](! #2 #3){! 0.07 \fcScale\space mul}
}

\newcommand{\fcFullDotCode}{
gsave
\fcCoordsPStricksToPS [0.02 0] \fcCoordsPStricksToPS pop 0 360 arc 1 0 0 setrgbcolor fill stroke
grestore
}

\newcommand{\fcHollowDotCode}{
gsave
\fcCoordsPStricksToPS [0.04 0] \fcCoordsPStricksToPS pop 0 360 arc 0 1 0 setrgbcolor stroke
grestore
}

\newcommand{\fcHashString}{
2 dict begin
/theString exch def
/counter -1 def
0
theString length {
/counter counter 1 add def
theString counter get cvi counter 1 add mul add
}repeat
20 string cvs
end
}

\newcommand{\fcToString}{
1 dict begin
/ToString
{
5 dict begin
cvlit
/theData exch def
theData type (arraytype) eq{
([)
theData{ToString ( )} forall
(])
theData length 2 mul 2 add \fcConcatenateMultiple
}
{theData 20 string cvs}
ifelse
end
} def %
ToString
end\space
}

\newcommand{\fcConcatenate}{ %Code taken from stackexchange, many thanks!
exch dup length
2 index length add string
dup dup 4 2 roll copy length
4 -1 roll putinterval
}

\newcommand{\fcConcatenateMultiple}{ %Code taken from stackexchange, many thanks!
%Usage: (s1) (s2) (s3) ... (sN) n  \fcConcatenateMultiple  (s1s2s3...sN)
% s1 s2 s3 .. sN n                   % first sum the lengths
dup 1 add  % s1 s2 s3 .. sN n n+1
copy       % s1 s2 s3 .. sN n  s1 s2 s3 .. sN n
0 exch     % s1 s2 s3 .. sN n  s1 s2 s3 .. sN 0 n
{exch length add} repeat % s1 s2 s3 .. sN  n   len  % then allocate string
string exch          % s1 s2 s3 .. sN str   n
0 exch               % s1 s2 s3 .. sN str  off  n
-1 1 {               % s1 s2 s3 .. sN str  off  n  % copy each string
  2 add -1 roll       % s2 s3 .. sN str  off s1  % bottom to top
  3 copy putinterval  % s2 s3 .. sN str' off s1
  length add          % s2 s3 .. sN str' off+len(s1)
                      % s2 s3 .. sN str' off'
} for                               % str' off'
pop  % str'
}

\newcommand{\fcRectangularRiemannSumCode}{
/theRiemannSumFigure exch def
theRiemannSumFigure \fcSetupFiles
graphicsCached not{
theRiemannSumFigure \fcArrayToStack
20 dict begin
/theFunction exch def
/yIterations exch def
/xIterations exch def
/yMax exch def
/xMax exch def
/yMin exch def
/xMin exch def
/DeltaX xMax xMin sub xIterations div def
/DeltaY yMax yMin sub yIterations div def
/theSideColor exch def
/theContourColor exch def
/x xMin def
xIterations{
/y yMin def
yIterations{
/xOld x def
/yOld y def
/x x DeltaX 2 div add def
/y y DeltaY 2 div add def
/z theFunction def
[xOld yOld 0]
[xOld DeltaX add yOld 0]
[xOld yOld DeltaY add 0]
[xOld yOld z]
theContourColor
theSideColor
true
false
[\fcDashes]
\fcBoxIIIdFilledCode
/x xOld def
/y yOld DeltaY add def
}repeat
/x x DeltaX add def
}repeat
end
}if
}

\newcommand{\fcRectangularRiemannSum}[8][]{
\setkeys{fcGraphics}{#1}
\pscustom{%
\code{%
[[\fcGetColorCode{\fcColorLine}] [\fcGetColorCode{\fcColorPatchUV}]  #2\space #3\space #4\space #5 \space #6\space #7\space {#8}\space]
\fcRectangularRiemannSumCode
}%
}%
}

\newcommand{\fcTextCode}{
/Times-Roman findfont
4 scalefont
setfont
newpath
\fcCoordsPStricksToPS moveto
show
stroke
}

\newcommand{\fcHollowDotBlue}[2]{
\pscircle*[fillcolor=white, linecolor=blue](#1, #2){0.07}
\pscircle*[fillcolor=white, linecolor=white](#1, #2){0.04}
}
\newcommand{\fcFullDotBlack}[2]{
\pscircle*[fillcolor=white, linecolor=black](#1, #2){0.07}
}
\newcommand{\fcFullDotBlue}[2]{
\pscircle*[fillcolor=white, linecolor=blue](#1, #2){0.07}
}
\newcommand{\fcXTickColored}[2]{\psline[linecolor=#1](#2, -0.1)(#2,0.1)}

\newcommand{\fcXTick}[1]{\psline(! #1\space -0.1)(! #1 \space 0.1)}
\newcommand{\fcYTick}[1]{\psline(! -0.1 #1)(! 0.1 #1)}
\newcommand{\fcXYTick}[2]{\fcXTick{#1} \fcYTick{#2}}

\newcommand{\fcXTickWithLabel}[2]{\fcXTick{#1}\rput[t](! #1\space -0.2){#2}}
\newcommand{\fcYTickWithLabel}[2]{\fcYTick{#1}\rput[r](! -0.2 #1){#2}}

\newcommand{\fcLabelNumberXaxis}[1]{\fcXTickWithLabel{#1}{#1}}
\newcommand{\fcLabelNumberYaxis}[1]{\fcYTickWithLabel{#1}{#1}}

\newcommand{\fcLabelNumberXYaxes}[2]{\fcLabelNumberXaxis{#1} \fcLabelNumberYaxis{#2} }

\newcommand{\fcLabelXOne}{\fcLabelNumberXaxis{1} }
\newcommand{\fcLabelYOne}{\fcLabelNumberYaxis{1} }

\newcommand{\fcLabelOnXaxis}[2]{\fcXTick{#1}\rput[t](#1,-0.2){#2}}
\newcommand{\fcLabelOnYaxis}[2]{\fcYTick{#1}\rput[r](-0.2, #1){#2}}

\newcommand{\fcLabels}[1][$x$]{%
  \def\ArgpsXAxisLabel{{#1}}%
  \fcLabelsRelay
}
\newcommand\fcLabelsRelay[3][$y$]{\rput[t](! #2 -0.1){\ArgpsXAxisLabel}\rput[r](! -0.1 #3){#1}}

\newcommand{\fcLabelsWithOnes}[2]{\psline(1, -0.1)(1,0.1) \rput[t](1, -0.2 ) { $1$} \psline(-0.1, 1)(0.1, 1) \rput[r](-0.2, 1 ) { $1$} \fcLabels{#1}{#2}}

\newcommand{\fcDefaultXLabel}{$x$}
\newcommand{\fcDefaultYLabel}{$y$}

\newcommand{\fcBoundingBox}[4]{%
\psframe*[linecolor=white](! #1\space #2)(! #3\space #4)%
\psline[linecolor=black!1](! #1 #2 )(! #1 #2 0.01 add)%
\psline[linecolor=black!1](! #3 #4 )(! #3 #4 0.01 add)%
}
\newcommand{\fcAxesStandardNoFrame}[5][]{%
\psaxes[ticks=none, labels=none,#1]{<->}(0,0)(#2,#3)(#4,#5)% \fcLabels[\fcDefaultXLabel][\fcDefaultYLabel]{#3}{#4}%
}%

\newcommand{\fcAxesStandard}[5][]{%
\psframe*[linecolor=white](! #2\space #3)(! #4 \space 0.1 add #5 \space 0.1 add)%
\fcAxesStandardNoFrame[#1]{#2}{#3}{#4}{#5}%
}%
\newcommand{\fcColorTangent}{blue}
\newcommand{\fcColorGraph}{red}
\newcommand{\fcColorAreaUnderGraph}{cyan}
\newcommand{\fcColorNegativeAreaUnderGraph}{orange}

\newcommand{\fcMachine}[2]{
\pscustom*[linecolor=#2]{
\psline(1,1.1)(1,0.1)(1.5,0.1)(2, 0.6)(2.5, 0.6)(2.5, -0.6)(2, -0.6)(1.5,-0.1)(1,-0.1)(1,-1.1)(-1,-1.1)(-1,-0.1)(-1.5,-0.1)(-2, -0.6)(-2.5, -0.6)(-2.5, 0.6)(-2, 0.6)(-1.5,0.1)(-1,0.1)(-1,1.1)
}
\pscircle*[linecolor=white](0,0){0.3}
\rput(0,0){#1}
}

%command format
%first argument gives you formula for the direction field in
%postscript notation, for example x y add.
%second and third argument give the starting x,y coordinates
\newcommand{\fcDirectionFieldOneTangent}[6]{%
\pstVerb{%
3 dict begin%
/x #2 \space def%
/y #3 \space def%
/F #1 \space def%
}%
\psline[#6](! x F ATAN 57.295 mul cos #4 mul sub y F ATAN 57.295 mul sin #4 mul sub)(! x F ATAN 57.295 mul cos #4 mul add y F ATAN 57.295 mul sin #4 mul add)%
\pscircle*[linecolor=red!60](! x y){#5}%
\pstVerb{%
end%
}%
}

\newcommand{\fcDirectionFieldOneTangentDefault}[3]{%
\fcDirectionFieldOneTangent{#1}{#2}{#3}{0.3}{0.03}{linecolor=blue}%
}

%command format
%first argument gives you formula for the direction field in
%postscript notation, for example x y add.
%second and third argument give the starting x,y coordinates
%fourth coordinate gives the delta x=delta y
%fifth argument gives the number of iterations delta x
%sixth argument gives the number of iterations delta y
%seventh argument gives the length of the vector
%eighth  argument gives the circle radius
%ninth argument gives the arguments of the psline command
\newcommand{\fcDirectionFieldFull}[9]{%
\multido{\ra=#2+#4}{#5}{%
\multido{\rb=#3+#4}{#6}{%
\fcDirectionFieldOneTangent{#1}{\ra}{\rb}{#7}{#8}{#9}%
}%end multido
}%end multido
}%end newcommand

\newcommand{\fcDirectionFieldDefault}[5]{%
\fcDirectionFieldFull{#1}{#2}{#3}{#4}{#5}{#5}{0.2}{0.02}{linecolor=blue}%
}%
\newcommand{\fcDirectionFieldDefaultRange}[1]{%
\fcDirectionFieldFull{#1}{-4}{-4}{0.5}{21}{21}{0.2}{0.02}{linecolor=blue}%
}

\newcommand{\fcMatrixTimesMatrix}{
10 dict begin
/matrixRight exch def
/matrixLeft exch def
/rowCounter -1 def
[
matrixLeft length {
/rowCounter rowCounter 1 add def
/columnCounter -1 def
[
matrixRight 0 get length{
/columnCounter columnCounter 1 add def
/thirdCounter -1 def
/accum 0 def
matrixLeft rowCounter get length{
/thirdCounter thirdCounter 1 add def
/accum accum
matrixLeft rowCounter get thirdCounter get
matrixRight thirdCounter get columnCounter get
mul add def
}repeat
accum
}repeat
]
}repeat
]
end
}

\newcommand{\fcMatrixTimesVector}{
10 dict begin
/theVector exch def
/theMatrix exch def
/rowCounter -1 def
[
theMatrix length {
/rowCounter rowCounter 1 add def
/columnCounter -1 def
/accum 0 def
theVector length{
/columnCounter columnCounter 1 add def
/accum accum
theMatrix rowCounter get columnCounter get theVector columnCounter get mul
add def
}repeat
accum
}repeat
]
end
}

\newcommand{\fcVectorProjectOntoVector}{%
\fcVectorNormalize dup 3 1 roll \fcVectorScalarVector \fcVectorTimesScalar%
} %

%fcAngleIIId Arguments:
%first optional: pstricks options
%second: vector describing arm of first angle
%third: vector describing arm of second angle
%fourth: radius of arc representing the angle
\newcommand{\fcAngleIIId}[4][]{%
\pstVerb{%
3 dict begin%
/firstV #2 \fcVectorNormalize def%
/orthonormalV #3 dup firstV  \fcVectorProjectOntoVector \fcVectorMinusVector \fcVectorNormalize def%
/theAngle firstV #3\space \fcVectorNormalize \fcVectorScalarVector arccos def%
}%
\parametricplot[#1]{0}{theAngle}{firstV t cos #4 mul \fcVectorTimesScalar orthonormalV t sin #4 mul \fcVectorTimesScalar \fcVectorPlusVector \fcCoordsIIIdToPStricks}%
\pstVerb{end}%
}

\newcommand{\fcAngleDegrees}[5][linecolor=red]{%
\parametricplot[#1]{#2}{#3}{t cos #4\space mul t sin #4\space mul}%
\rput(! #2\space #3\space add 2 div dup cos #4\space 0.2 add mul exch sin #4\space 0.2 add mul){#5}%
}

\newcommand{\fcAngleBetweenVectors}[5][linecolor=\fcColorGraph]{%
\pstVerb{%
3 dict begin%
/firstV #2 \fcVectorNormalize def%
/orthonormalV #3 dup firstV  \fcVectorProjectOntoVector \fcVectorMinusVector \fcVectorNormalize def%
/theAngle firstV #3\space \fcVectorNormalize \fcVectorScalarVector arccos def%
}%
\parametricplot[#1]{0}{theAngle}{firstV t cos #4 mul \fcVectorTimesScalar orthonormalV t sin #4 mul \fcVectorTimesScalar \fcVectorPlusVector \fcArrayToStack}%
\pstVerb{end}%
}

\makeatletter
\newcommand{\fcAngle}[5][linecolor=\fcColorGraph]{%
\ifPst@algebraic{%
\parametricplot[#1, algebraic=true]{#2}{#3}{#4*cos(t)| #4*sin(t)}%
\rput(! #2\space #3\space add 2 div 57.29578 mul cos #4\space 0.2 add mul #2\space #3\space add 2 div 57.29578 mul sin #4\space 0.2 add mul){#5}%
}%
\else%
\parametricplot[#1, algebraic=false]{#2}{#3}{t 57.29578 mul cos #4\space mul t 57.29578 mul sin #4\space mul}%
\rput(! #2\space #3\space add 2 div 57.29578 mul cos #4\space 0.2 add mul #2\space #3\space add 2 div 57.29578 mul sin #4\space 0.2 add mul){#5}%
\fi%
}
\makeatother

\newcommand{\fcDistance}{ \fcVectorMinusVector \fcVectorNorm\space}

\newcommand{\fcLengthIndicator}[5]{
\psline[arrows=<-, linecolor=red](! #1 #2)(! #1 0.58 mul #3 0.42 mul add #2 0.58 mul #4 0.42 mul add)
\psline[arrows=->, linecolor=red]{->}(! #1 0.42 mul #3 0.58 mul add #2 0.42 mul #4 0.58 mul add)(! #3 #4)
\rput(! #1 #3 add 0.5 mul #2 #4 add 0.5 mul){ #5}
}

\makeatletter
\newcommand{\fcDrawPolar}[4][linecolor=\fcColorGraph]{%
\ifPst@algebraic{%
\parametricplot[#1]{#2}{#3}{(#4) *cos(t) | (#4) * sin(t)}%
}%
\else%
\parametricplot[#1]{#2}{#3}{#4 t 57.29578 mul cos mul #4 t 57.29578 mul sin mul}%
\fi%
}
\makeatother

\newcommand{\fcPolarWedge}[4][fillstyle=solid, linecolor=blue, fillcolor=\fcColorAreaUnderGraph]{%
\pstVerb{%
2 dict begin%
/theta {t 57.295779513 mul} def%
/r {#4} def%
}%
\pscustom[#1]{%
\psline(0,0)%
(! 1 dict begin /t #2\space def theta cos r mul theta sin r mul end)%
(! 1 dict begin /t #3\space def theta cos r mul theta sin r mul end)%
(0,0)%
} %
\pstVerb{end}%
}%

\newcommand{\fcPolarWedgeSequence}[4]{%
\multido{\ra=#1+#2}{#3}{%
\fcPolarWedge{\ra}{\ra\space #2 add}{#4}%
}%
}

\newcommand{\fcRegularNgon}[3][linecolor=\fcColorGraph]{%
\multido{\ra=0+1}{#2}{%
\psline[#1](! \ra \space #2 div 360 mul cos #3 mul \ra \space #2 div 360 mul sin #3 mul)(! \ra \space 1 add #2 div 360 mul cos #3 mul \ra \space 1 add #2 div 360 mul sin #3 mul)%
}%end multido
}

\newcommand{\fcEvaluateT}[2]{%
1 dict begin /t #1 def #2 end
}

\newcommand{\fcPolylineAlongCurve}[5][linecolor=\fcColorGraph]{%
\multido{\ra=0+1}{#2}{%
\psline[#1](! \fcEvaluateT{\ra\space #2 div #3 mul 1 \ra \space #2 div sub #4 mul add}{#5})(! \fcEvaluateT{\ra\space 1 add #2 div #3 mul 1 \ra \space 1 add #2 div sub #4 mul add}{#5})%
\rput(! \fcEvaluateT{\ra\space #2 div #3 mul 1 \ra \space #2 div sub #4 mul add}{#5}){\fcFullDot{0}{0}}%
}%
\rput(! \fcEvaluateT{#3}{#5}){\fcFullDot{0}{0}}%
}

\newcommand{\fcPolylineAlongCurveWithLabels}[6][linecolor=\fcColorGraph]{%
\fcPolylineAlongCurve[#1]{#2}{#3}{#4}{#5}%
\multido{\ia=0+1}{#2}{%
\rput[b](! \fcEvaluateT{\ia\space #2 div #3 mul 1 \ia \space #2 div sub #4 mul add}{#5} 0.1 add){${#6}_{\ia}$}%
}%
\rput[b](! \fcEvaluateT{#3}{#5}){${#6}_{#2}$}%
}

\newcommand{\fcVectorNormalize}{ %
1 dict begin %
/theV exch def % theV is our vector
theV 1 theV \fcVectorNorm div \fcVectorTimesScalar %
end %
} %pushes elements of array onto the stack

\newcommand{\fcArrayToStack}{ %
aload pop
} %pushes elements of array onto the stack

\newcommand{\fcSpliceArrayOperationArray}{ %
5 dict begin %
/theOp exch def %
/secondV exch def %
/firstV exch def %
/counter 0 def %
/dimension firstV length def %
[dimension {firstV counter get secondV counter get theOp /counter counter 1 add def } repeat] %
end %
} %splices two arrays and operation, for example [a b] [c d] {op} -> [a c op b d op]

\newcommand{\fcSpliceArrayOperation}{ %
4 dict begin %
/theOp exch def %
/firstV exch def %
/counter 0 def %
/dimension firstV length def %
[ dimension {firstV counter get theOp /counter counter 1 add def } repeat ] %
end %
} %splices array with operation. [a b] {op} -> [a op b op]

\newcommand{\fcArrayOperation}{ %
4 dict begin %
/theOp exch def %
/firstV exch def %
/counter 0 def%
/dimension firstV length def %
dimension {firstV counter get /counter counter 1 add def} repeat %
dimension 1 sub {theOp} repeat %
end %
} %applies operation n-1 times to array. Example: [a b c] {op} -> a b c op op

\newcommand{\fcVectorScalarVector}{%
{mul} \fcSpliceArrayOperationArray {add}\fcArrayOperation
} %Scalar product two vectors

\newcommand{\fcVectorPlusVector}{%
{add} \fcSpliceArrayOperationArray %
} %Adds two vectors

\newcommand{\fcVectorMinusVector}{%
{sub} \fcSpliceArrayOperationArray %
} %Adds two vectors

\newcommand{\fcVectorTimesScalar}{ %
2 dict begin %
/theScalar exch def %
/theV exch def %
theV {theScalar mul} \fcSpliceArrayOperation %
end %
} %

\newcommand{\fcVectorTripleProduct}{%
\fcVectorCrossVector \fcVectorScalarVector\space %
}

\newcommand{\fcVectorCrossVector}{ %
8 dict begin %
/vectB exch def %
/vectA exch def %
vectA \fcArrayToStack %
/a3 exch def %The three coordinates of Vector a
/a2 exch def %
/a1 exch def %
vectB \fcArrayToStack %
/b3 exch def %The three coordinates of Vector b
/b2 exch def %
/b1 exch def %
[a2 b3 mul a3 b2 mul sub a3 b1 mul a1 b3 mul sub a1 b2 mul a2 b1 mul sub] %the cross product of a and b
end %
}

\newcommand{\fcVectorNorm}{%
dup \fcVectorScalarVector sqrt %
} %

\newcommand{\fcVectorNormSquared}{%
dup \fcVectorScalarVector %
} %

\newcommand{\fcMarkClean}{
mark\space
}

\newcommand{\fcMarkCleanCheck}{
counttomark 0 ne {(ERROR: procedure did not clean up properly. Printing stack: ) print pstack == error}if pop
}

\newcommand{\fcProjectOntoScreen}{%
3 dict begin %
\fcScreen\space %
/theD exch def %
/theNormal exch def %
/theV exch def %
theV theNormal theD theV theNormal \fcVectorScalarVector sub theNormal \fcVectorNormSquared div \fcVectorTimesScalar \fcVectorPlusVector %
end %
} %Projection of point onto a plane. First argument is point, second argument is plane normal, third argument is the scalar product you need to have with the normal to be in the plane. Format: [1 2 3] [4 5 6] 7, corresponds to projecting the point (1,2,3) onto the plane 4x+5y+6z=7

\newcommand{\fcCoordsIIIdToPStricks}{%
5 dict begin %
/theV exch def %
/theVprojected theV \fcProjectOntoScreen [0 0 0] \fcProjectOntoScreen  \fcVectorMinusVector def%
/theNormalizedNormal \fcScreen\space pop \fcVectorNormalize def %
(\fcScreenStyle) (z) eq %
{ %
/theYUnitV [0 0 1] \fcProjectOntoScreen [0 0 0] \fcProjectOntoScreen \fcVectorMinusVector \fcVectorNormalize def %
/theXUnitV theNormalizedNormal theYUnitV \fcVectorCrossVector def %
} %
{ %
(\fcScreenStyle) (x) eq %
{
/theXUnitV [1 0 0] \fcProjectOntoScreen [0 0 0] \fcProjectOntoScreen \fcVectorMinusVector \fcVectorNormalize def %
/theYUnitV theXUnitV theNormalizedNormal \fcVectorCrossVector def%
}
{
/theYUnitV \fcScreenStyle \fcProjectOntoScreen [0 0 0] \fcProjectOntoScreen \fcVectorMinusVector \fcVectorNormalize def%
/theXUnitV theNormalizedNormal theYUnitV \fcVectorCrossVector def%
} ifelse%
}%
ifelse %
%(normalized normal: ) == theNormalizedNormal ==
%(y unit v) == theYUnitV ==
%(x unit v: ) == theXUnitV ==
theVprojected theXUnitV \fcVectorScalarVector theVprojected theYUnitV \fcVectorScalarVector
end %
}

\newcommand{\fcCoordsIIIdToPS}{%
[ exch \fcCoordsIIIdToPStricks ] \fcCoordsPStricksToPS
}

\newcommand{\fcBoxIIId}[5][]{%
\pstVerb{%
4 dict begin%
/visibleCorner #2 def%
/vectorOne #3 #2 \fcVectorMinusVector def%
/vectorTwo #4 #2 \fcVectorMinusVector def%
/vectorThree #5 #2 \fcVectorMinusVector def%
}%
\fcPolyLineIIId[#1]{visibleCorner dup vectorOne \fcVectorPlusVector dup vectorTwo \fcVectorPlusVector dup vectorOne \fcVectorMinusVector dup vectorTwo \fcVectorMinusVector visibleCorner}%
\fcPolyLineIIId[#1]{visibleCorner dup vectorOne \fcVectorPlusVector dup vectorThree \fcVectorPlusVector dup vectorOne \fcVectorMinusVector dup vectorThree \fcVectorMinusVector}%
\fcPolyLineIIId[#1]{visibleCorner vectorTwo \fcVectorPlusVector dup vectorThree \fcVectorPlusVector dup vectorTwo \fcVectorMinusVector}%
\fcPolyLineIIId[#1, linestyle=dashed]{visibleCorner vectorOne  vectorTwo vectorThree \fcVectorPlusVector \fcVectorPlusVector \fcVectorPlusVector dup vectorOne \fcVectorMinusVector}%
\fcPolyLineIIId[#1, linestyle=dashed]{visibleCorner vectorOne  vectorTwo vectorThree \fcVectorPlusVector \fcVectorPlusVector \fcVectorPlusVector dup vectorTwo \fcVectorMinusVector}%
\fcPolyLineIIId[#1, linestyle=dashed]{visibleCorner vectorOne  vectorTwo vectorThree \fcVectorPlusVector \fcVectorPlusVector \fcVectorPlusVector dup vectorThree \fcVectorMinusVector}%
\pstVerb{end}%
}

\newcommand{\fcParallelogramIIIdCode}{
4 dict begin
/v2 exch def
/v1 exch def
/v0 exch def
/secondRun false def
2 {
newpath
v0 \fcCoordsPStricksToPS moveto
v0 v1 \fcVectorPlusVector \fcCoordsPStricksToPS lineto
v0 v1 v2 \fcVectorPlusVector \fcVectorPlusVector \fcCoordsPStricksToPS lineto
v0 v2 \fcVectorPlusVector \fcCoordsPStricksToPS lineto
v0 \fcCoordsPStricksToPS lineto
closepath
secondRun not {fill} if
stroke
/secondRun true def
}repeat
end
}

\newcommand{\fcPatchMakeFromThreeCorners}{
5 dict begin
/options exch def
/v2 exch def
/v1 exch def
/v0 exch def
/v3 v1 v2 \fcVectorPlusVector v0 \fcVectorMinusVector def
[v0 v1 v2 v3 [v0 v1 v1 v3 v3 v2 v2 v0] options]
end
}

\newcommand{\fcZDepth}{
\fcScreen\space pop \fcVectorScalarVector
}

\newcommand{\fcBoxIIIdFilledCode}{
%input order
% corner0 corner1 corner2 corner3
15 dict begin
/currentDashes exch def
/contourIsDashedIndependentOfVisibility exch def
/sidesVisible exch def
/colorSides exch def
/colorContour exch def
/options [colorSides colorSides true true colorContour contourIsDashedIndependentOfVisibility currentDashes] def
/corner3 exch def
/corner2 exch def
/corner1 exch def
/corner0 exch def
/v1 corner1 corner0 \fcVectorMinusVector def
/v2 corner2 corner0 \fcVectorMinusVector def
/v3 corner3 corner0 \fcVectorMinusVector def
%the following code selects the corner closest to the viewing screen
v1 \fcScreen\space pop \fcVectorScalarVector 0 lt
{/corner0 corner0 v1 \fcVectorPlusVector def /v1 v1 -1 \fcVectorTimesScalar def }if
v2 \fcScreen\space pop \fcVectorScalarVector 0 lt
{/corner0 corner0 v2 \fcVectorPlusVector def /v2 v2 -1 \fcVectorTimesScalar def }if
v3 \fcScreen\space pop \fcVectorScalarVector 0 lt
{/corner0 corner0 v3 \fcVectorPlusVector def /v3 v3 -1 \fcVectorTimesScalar def }if
%the closest corner is selected, we are recomputing the box corners
/corner1 corner0 v1 \fcVectorPlusVector def
/corner2 corner0 v2 \fcVectorPlusVector def
/corner3 corner0 v3 \fcVectorPlusVector def
[
corner0 corner1 corner2 options \fcPatchMakeFromThreeCorners
corner0 corner2 corner3 options \fcPatchMakeFromThreeCorners
corner0 corner3 corner1 options \fcPatchMakeFromThreeCorners
%corner1 corner1 v2 \fcVectorPlusVector corner1 v3 \fcVectorPlusVector options \fcPatchMakeFromThreeCorners
%corner2 corner2 v3 \fcVectorPlusVector corner2 v1 \fcVectorPlusVector options \fcPatchMakeFromThreeCorners
%corner3 corner3 v1 \fcVectorPlusVector corner3 v2 \fcVectorPlusVector options \fcPatchMakeFromThreeCorners
]
/LeftGreaterThanRight {\fcPatchGetPoint \fcZDepth exch \fcPatchGetPoint \fcZDepth gt} def
\fcMergeSort
sidesVisible{dup {\fcPatchPaintFilledDirectly }forall }if
{\fcPatchPaintContourDirectly}forall
/cornerop corner0 v1 v2 v3 \fcVectorPlusVector \fcVectorPlusVector \fcVectorPlusVector def
\fcLineFormatCode
currentDashes \fcArrayToStack setdash
[v1 v2 v3]
{
newpath
cornerop \fcCoordsIIIdToPS moveto
cornerop exch \fcVectorMinusVector \fcCoordsIIIdToPS lineto
stroke
}forall
end
}

\newcommand{\fcBoxIIIdFilledNew}[5][]{%
\setkeys{fcGraphics}{#1}%
\pscustom{%
\code{%
\fcSetUpGraphicsToScreen %
#2\space #3\space #4\space #5\space[ \fcGetColorCode{\fcColorLine} ] [\fcGetColorCode{\fcColorPatchUV}] true (\fcLineStyle) (dashed) eq [\fcDashes] \fcBoxIIIdFilledCode%
}%
}%
}

\newcommand{\fcBoxIIIdHollowNew}[5][]{%
\setkeys{fcGraphics}{#1}%
\pscustom{%
\code{%
\fcSetUpGraphicsToScreen %
#2\space #3\space #4\space #5\space[ \fcGetColorCode{\fcColorLine} ] [\fcGetColorCode{\fcColorPatchUV}] false (\fcLineStyle) (dashed) eq [\fcDashes] \fcBoxIIIdFilledCode%
}%
}%
}

\newcommand{\fcBoxIIIdFilled}[5][]{%
\pscustom*[#1]{%
\fcPolyLineIIId{4 dict begin%
/visibleCorner #2 def%
/vectorOne #3 #2 \fcVectorMinusVector def%
/vectorTwo #4 #2 \fcVectorMinusVector def%
/vectorThree #5 #2 \fcVectorMinusVector def %
visibleCorner vectorOne \fcVectorPlusVector dup vectorTwo \fcVectorPlusVector dup vectorOne \fcVectorMinusVector dup vectorThree \fcVectorPlusVector dup vectorTwo \fcVectorMinusVector dup vectorOne \fcVectorPlusVector visibleCorner vectorOne \fcVectorPlusVector end %
}%
}%
}

\newcommand{\fcParallelogramIIId}[4][linecolor=cyan!30]{%
\pscustom*[#1]{%
\fcParallelogramHollowIIId{#2}{#3}{#4}%
}%
}

\newcommand{\fcParallelogramHollowIIId}[4][]{ %
\fcPolyLineIIId[#1]{3 dict begin /corner #2 def /vectorOne #3 #2 \fcVectorMinusVector def /vectorTwo #4 #2 \fcVectorMinusVector def corner dup vectorOne \fcVectorPlusVector dup vectorTwo \fcVectorPlusVector dup vectorOne \fcVectorMinusVector corner end
}%
}

\newcommand{\fcParallelogramHalfVisibleIIId}[4][]{%
\pstVerb{3 dict begin /corner #2 def /vectorOne #3 #2 \fcVectorMinusVector def /vectorTwo #4 #2 \fcVectorMinusVector def}%
\fcPolyLineIIId[#1]{corner vectorOne \fcVectorPlusVector corner dup vectorTwo \fcVectorPlusVector}%
\fcPolyLineIIId[#1,linestyle=dashed]{corner vectorOne \fcVectorPlusVector dup vectorTwo \fcVectorPlusVector dup vectorOne \fcVectorMinusVector}%
\pstVerb{end}%
}

\newcommand{\fcPolyLineIIId}[2][linecolor=black]{%
\listplot[#1]{ [#2] {\fcCoordsIIIdToPStricks} \fcSpliceArrayOperation \fcArrayToStack}%
}

%\newcommand{\fcCoordsPStricksToPS}{\fcArrayToStack \fcConvertPSYUnit exch \fcConvertPSXUnit exch\space }
\makeatletter
\newcommand{\fcCoordsPStricksToPS}{\fcArrayToStack \tx@ScreenCoor\space }
\makeatother

\newcommand{\fcLine}[3][]{%
\setkeys{fcGraphics}{#1}
\pscustom{%
\code{%
\fcLineFormatCode
newpath %
#2\space \fcCoordsPStricksToPS moveto %
#3\space \fcCoordsPStricksToPS lineto %
stroke %
}%
}%
}

\newcommand{\fcEllipsoidInScene}[2][iterationsU=22, iterationsV=22]{%
\setkeys{fcGraphics}{#1}%
\pstVerb{%
/theIIIdObjects%
[theIIIdObjects \fcArrayToStack [0 0 180 360%
{ #2\space 6 dict begin%
  /c exch def%
  /b exch def%
  /a exch def%
  /z1 exch def%
  /y1 exch def%
  /x1 exch def%
  [ u sin v cos mul a mul x1 add %
    u sin v sin mul b mul y1 add %
    u cos c mul z1 add%
  ]%
  end%
}%
{true}%
\fcIterationsU\space \fcIterationsV\space %
\fcPatchOptions %
\fcContourOptions %
(surface)%
]%
]%
def%
}%
}

\newcommand{\fcLineFormatCode}{\fcDashesCode \fcLineWidth\space setlinewidth \fcGetColorCode{\fcColorLine} setrgbcolor}

\newcommand{\fcCurveCode}{%
%(calling fcCurveCode) == %
5 dict begin %
%newpath 0 0 moveto 1000 1000 lineto stroke
/theCurve exch def %
%theCurve == %
/tMin exch def%
/tMax exch def%
/Delta tMax tMin sub \fcPlotPoints \space 1 sub div def %
/t tMin def %
\fcLineFormatCode %
newpath %
theCurve \fcCoordsPStricksToPS moveto %
\fcPlotPoints\space 1 sub {/t t Delta add def theCurve \fcCoordsPStricksToPS lineto %
} repeat %
stroke %
end\space%
}

\newcommand{\fcCurve}[4][]{%
\setkeys{fcGraphics}{#1}%
\pstVerb{#2\space #3\space {#4} \space \fcCurveCode}%
}

\newcommand{\fcLineIIId}[3][linecolor=black]{%
\psline[#1](! #2 \space \fcCoordsIIIdToPStricks)(! #3 \space \fcCoordsIIIdToPStricks)%
}

\newcommand{\fcAxesIIIdFull}[4][linecolor=black, arrows=->]{%
\fcAxesIIId[#1]{#2}{#3}{#4}%
\fcLineIIId[#1]{[0 0 0]}{[#2\space -1 mul 0 0]}%
\fcLineIIId[#1]{[0 0 0]}{[0 #3\space -1 mul 0]}%
\fcLineIIId[#1]{[0 0 0]}{[0 0 #4\space -1 mul]}%
} %

\newcommand{\fcAxesIIIdInScene}[4][linecolor=black, arrows=->]{%
\setkeys{fcGraphics}{#1}%
\fcLineIIIdInScene[#1]{[0 0 0]}{[#2 0 0]}%
\fcLineIIIdInScene[#1]{[0 0 0]}{[0 #3 0]}%
\fcLineIIIdInScene[#1]{[0 0 0]}{[0 0 #4]}%
\rput[l](! [#2 0 0] \fcCoordsIIIdToPStricks){~\fcXLabel}%
\rput[l](! [0 #3 0] \fcCoordsIIIdToPStricks){~\fcYLabel}%
\rput[r](! [0 0 #4] \fcCoordsIIIdToPStricks){\fcZLabel~}%
}%

\newcommand{\fcAxesIIIdFullInScene}[4][linecolor=black, arrows=->]{%
\setkeys{fcGraphics}{#1}%
\fcLineIIIdInScene[#1]{[0 0 0]}{[#2 0 0]}%
\fcLineIIIdInScene[#1]{[0 0 0]}{[0 #3 0]}%
\fcLineIIIdInScene[#1]{[0 0 0]}{[0 0 #4]}%
\fcLineIIIdInScene[#1]{[0 0 0]}{[#2\space-1 mul 0 0]}%
\fcLineIIIdInScene[#1]{[0 0 0]}{[0 #3\space-1 mul 0]}%
\fcLineIIIdInScene[#1]{[0 0 0]}{[0 0 #4\space-1 mul]}%
}

\newcommand{\fcAxesIIId}[4][linecolor=black, arrows=->]{%
\setkeys{fcGraphics}{#1}%
\fcLineIIId[#1]{[0 0 0]}{[#2 0 0]}%
\fcLineIIId[#1]{[0 0 0]}{[0 #3 0]}%
\fcLineIIId[#1]{[0 0 0]}{[0 0 #4]}%
\rput[l](! [#2 0 0] \fcCoordsIIIdToPStricks){~\fcXLabel}%
\rput[l](! [0 #3 0] \fcCoordsIIIdToPStricks){~\fcYLabel}%
\rput[r](! [0 0 #4] \fcCoordsIIIdToPStricks){\fcZLabel~}%
}

\newcommand{\fcDotIIId}[2][linecolor=\fcColorGraph]{%
\pscircle*[#1](! #2 \fcCoordsIIIdToPStricks){0.07} %
} %

\newcommand{\fcPutIIId}[3][]{ \rput[#1](! #2 \fcCoordsIIIdToPStricks) {#3}%
} %

\newcommand{\fcPaintCone}{ %
\fcArrayToStack %
15 dict begin %
/c exch def %
/b exch def %
/a exch def %
/z1 exch def %
/y1 exch def %
/x1 exch def %
/zmax exch def %
/zmin exch def %
}

\newcommand{\fcZBufferRowColumn}{ %
%input: vector on the top of the stack.
%output: row column of point in the z-buffer.
\fcCoordsIIIdToPStricks %
2 dict begin %
/rowIndex exch \space getZBufferYmin sub getZBufferYmax getZBufferYmin sub div zBufferNumRows mul floor cvi def %
/columnIndex exch getZBufferXmin sub getZBufferXmax getZBufferXmin sub div zBufferNumCols mul floor cvi def %
rowIndex zBufferNumRows ge {/rowIndex rowIndex 1 sub def}if %
columnIndex zBufferNumCols ge {/columnIndex columnIndex 1 sub def}if %
rowIndex zBufferNumRows ge {(ERROR: bad row index!!!) == rowIndex ==}if %
columnIndex zBufferNumCols ge {(ERROR: bad column index: ) == columnIndex == }if %
rowIndex 0 lt {/rowIndex rowIndex 1 add def}if %
columnIndex 0 lt {/columnIndex columnIndex 1 add def}if %
rowIndex 0 lt {(ERROR: bad row index!!!) == rowIndex ==}if %
columnIndex 0 lt {(ERROR: bad column index: ) == columnIndex ==  }if %
rowIndex columnIndex %
end %
}

\newcommand{\fcPointIsBehindOrInFrontOfPatch}[1]{ %
%(entering fcPointIsBehindOrInFrontOfPatch) ==
%a patch is assumed to be on the top of the stack
12 dict begin %
/thePatch exch def
/point exch def
thePatch \fcPatchGetInBounds
{
/v0 thePatch \fcPatchGetvZero def %
/v1 thePatch \fcPatchGetvOne def %
/v2 thePatch \fcPatchGetvTwo def %
/v3 thePatch \fcPatchGetvThree def %
/normalLeft v1 v0 \fcVectorMinusVector \fcScreen\space pop \fcVectorCrossVector def %
/normalRight v3 v2 \fcVectorMinusVector \fcScreen\space pop \fcVectorCrossVector def %
/normalBottom v2 v0 \fcVectorMinusVector \fcScreen\space pop \fcVectorCrossVector def %
/normalTop v3 v1 \fcVectorMinusVector \fcScreen\space pop \fcVectorCrossVector def %
/patchNormal v1 v0 \fcVectorMinusVector v2 v0 \fcVectorMinusVector \fcVectorCrossVector def %
point v0 \fcVectorMinusVector normalLeft \fcVectorScalarVector %
v2 point \fcVectorMinusVector normalRight \fcVectorScalarVector %
mul 0 ge { %
point v0 \fcVectorMinusVector normalBottom \fcVectorScalarVector %
v1 point \fcVectorMinusVector normalTop \fcVectorScalarVector %
mul 0 ge %
{ %
point v0 \fcVectorMinusVector patchNormal \fcVectorScalarVector %
\fcScreen\space pop patchNormal \fcVectorScalarVector %
mul #1{0.00001  gt}{-0.00001 lt}ifelse %
{true}{false}ifelse %
}{false}ifelse %
}{false}ifelse %
}{false}ifelse
end %
}

\newcommand{\fcIsInForeground}{ %
15 dict begin %
/theNeighborhood exch def %
/thePoint theNeighborhood 0 get def %
%(neighborhood: ) print
%theNeighborhood ==
%(thePoint:) print
%thePoint ==
thePoint \fcZBufferRowColumn %
/column exch def %
/row exch def %
/theZBuffEntry theZBuffer row get column get def %
/result true def %
/counterZBuff -1 def %
theZBuffEntry length { %
/counterZBuff counterZBuff 1 add def %
/theZbuffPatchIndex theZBuffEntry counterZBuff get def %
/theZbuffPatch thePatchCollection theZbuffPatchIndex get def %
theZbuffPatchIndex theNeighborhood \fcContains not{ %
%(patch) == theZbuffPatch == (is not contained in neighborhood ) ==
%theNeighborhood ==
thePoint theZbuffPatch \fcPointIsBehindOrInFrontOfPatch{true}
{/result false def
exit
}
{ %(point is in front of patch) ==
}
ifelse
}
{ %(patch coincides with zbuff patch) ==
}
ifelse %
}repeat %
result %
end %
}

\newcommand{\fcZBufferBoundingBoxPatch}{ %
5 dict begin %
/thePatch exch def
/v3 thePatch \fcPatchGetvThree def %
/v2 thePatch \fcPatchGetvTwo def %
/v1 thePatch \fcPatchGetvOne def %
/v0 thePatch \fcPatchGetvZero def %
v0 \fcZBufferBoundingBoxPoint %
v1 \fcZBufferBoundingBoxPoint %
v2 \fcZBufferBoundingBoxPoint %
v3 \fcZBufferBoundingBoxPoint %
v1 v2 \fcVectorPlusVector v0 \fcVectorMinusVector \fcZBufferBoundingBoxPoint %
end %
}

\newcommand{\fcZBufferBoundingBoxPoint}{ %
%Account bounding box:
\fcCoordsIIIdToPStricks %
dup dup getZBufferYmin lt {setZBufferYmin}{pop}ifelse %
dup getZBufferYmax gt {setZBufferYmax}{pop}ifelse %
dup dup getZBufferXmin lt {setZBufferXmin}{pop}ifelse %
dup getZBufferXmax gt {setZBufferXmax}{pop}ifelse \space%
}

\newcommand{\fcZBufferEllipsoid}{ %
%(calling fcZBufferEllipsoid with input: ) == dup == %
\fcArrayToStack
6 dict begin
/c exch def %
/b exch def %
/a exch def %
/z1 exch def %
/y1 exch def %
/x1 exch def %
[a -1 mul x1 add b -1 mul y1 add c -1 mul z1 add a x1 add b y1 add c z1 add] %
end
}

\newcommand{\fcSegmentBoundingBox}{ %
\fcZBufferBoundingBoxPoint %
\fcZBufferBoundingBoxPoint %
}

\newcommand{\fcZBufferPaintCellContainingPoint}{
10 dict begin
/thePoint exch def
thePoint \fcZBufferRowColumn
/column exch def
/row exch def
\fcZBufferComputeDeltaXDeltaY
/lowerLeftX getZBufferXmin DeltaX column mul add def
/lowerLeftY getZBufferYmin DeltaY row mul add def
gsave
0.6 0.6 1 setrgbcolor
newpath
[lowerLeftX lowerLeftY] \fcCoordsPStricksToPS moveto
[lowerLeftX DeltaX add lowerLeftY] \fcCoordsPStricksToPS lineto
[lowerLeftX DeltaX add lowerLeftY DeltaY add] \fcCoordsPStricksToPS lineto
[lowerLeftX lowerLeftY DeltaY add] \fcCoordsPStricksToPS lineto
[lowerLeftX lowerLeftY] \fcCoordsPStricksToPS lineto
stroke
grestore
end
}

\newcommand{\fcZBufferComputeDeltaXDeltaY}{
/DeltaX getZBufferXmax getZBufferXmin sub zBufferNumCols div def %
/DeltaY getZBufferYmax getZBufferYmin sub zBufferNumRows div def %
}

\newcommand{\fcPaintZbuffForDebug}{ %
6 dict begin %
\fcZBufferComputeDeltaXDeltaY
gsave %
0.1 setlinewidth %
/x getZBufferXmin def %
0.5 0.5 0.5 setrgbcolor %
zBufferNumRows {newpath [x getZBufferYmin] \fcCoordsPStricksToPS moveto [x getZBufferYmax] \fcCoordsPStricksToPS lineto stroke /x x DeltaX add def}repeat %
/y getZBufferYmin def %
zBufferNumCols { newpath [getZBufferXmin y] \fcCoordsPStricksToPS moveto [getZBufferXmax y] \fcCoordsPStricksToPS lineto stroke /y y DeltaY add def}repeat %
/y getZBufferYmin DeltaY 2 div add def %
/counterY 0 def %
zBufferNumRows { %
/x getZBufferXmin DeltaX 2 div add def %
/counterX 0 def %
zBufferNumCols { %
theZBuffer counterY get counterX get length 0 gt{ %
[x y] \fcFullDotCode %
} if %
/x x DeltaX add def %
/counterX counterX 1 add def %
}repeat %
/y y DeltaY add def %
/counterY counterY 1 add def %
}repeat %
grestore %
end %
}

\newcommand{\fcStartIIIdScene}{%
\pstVerb{1 dict begin /theIIIdObjects [] def}%
}%

\newcommand{\fcZBufferPrint}{ %
(printing Zbuffer...) == %
getZBufferXmin == %
getZBufferXmax == %
getZBufferYmin == %
getZBufferYmax == %
theZBuffer == %
}

\newcommand{\fcZBufferLoad}{ %
\fcZBufferInitialize %
/theZBuffer exch def %
setZBufferYmax %
setZBufferYmin %
setZBufferXmax %
setZBufferXmin %
}

\newcommand{\fcZBufferInitialize}{ %
/ZBufferRectangle [0 0 0 0] def %
/setZBufferXmin {ZBufferRectangle exch 0 exch put} def %
/setZBufferYmin {ZBufferRectangle exch 1 exch put} def %
/setZBufferXmax {ZBufferRectangle exch 2 exch put} def %
/setZBufferYmax {ZBufferRectangle exch 3 exch put} def %
/getZBufferXmin {ZBufferRectangle 0 get} def %
/getZBufferYmin {ZBufferRectangle 1 get} def %
/getZBufferXmax {ZBufferRectangle 2 get} def %
/getZBufferYmax {ZBufferRectangle 3 get} def %
/zBufferNumCols \fcZBufferNumXIntervals\space def
/zBufferNumRows \fcZBufferNumYIntervals\space def
thePatchCollection length zBufferNumCols zBufferNumRows mul lt
{ /zBufferNumCols thePatchCollection length sqrt round cvi def
  zBufferNumCols 3 lt {/zBufferNumCols 3 def}if
  /zBufferNumRows zBufferNumCols def
  (There are only a few patches in the scene, I decreased z-buffer size to ) print zBufferNumCols == (rows and columns. ) print
}if
/getZBufferDeltaX {getZBufferXmax getZBufferXmin sub zBufferNumCols div} def %
/getZBufferDeltaY {getZBufferYmax getZBufferYmin sub zBufferNumRows div} def %
/theZBuffer [zBufferNumRows {[zBufferNumCols{[]} repeat]}repeat] def %
}

\newcommand{\fcPaintCachedFile}{
graphicsFile run
}

\newcommand{\fcSetUpGraphicsToScreen}{
/movetoVirtual {moveto} def
/linetoVirtual {lineto} def
/strokeVirtual {stroke} def
/closepathVirtual {closepath} def
/newpathVirtual {newpath} def
/fillVirtual {fill} def
/arrowVirtual {} def
/setrgbcolorVirtual {setrgbcolor} def
/setlinewidthVirtual {setlinewidth} def
/plotArrowHeadVirtual {\fcArrowHeadPlotCode} def
/setdashVirtual {setdash} def
}

\newcommand{\fcSetUpGraphicsToFileAndScreen}{
graphicsFile ( /plotArrowHeadVirtual {\fcArrowHeadPlotCode} def ) writestring
/storeNumberPairToGraphicsFile{
\fcMarkClean 3 1 roll
20 string cvs exch 20 string cvs graphicsFile exch writestring graphicsFile ( ) writestring graphicsFile exch writestring graphicsFile ( ) writestring
\fcMarkCleanCheck
} def
/movetoVirtual {
2 copy moveto
storeNumberPairToGraphicsFile
graphicsFile (moveto ) writestring
} def
/setlinewidthVirtual {
dup setlinewidth
20 string cvs graphicsFile exch writestring graphicsFile ( setlinewidth ) writestring
} def
/linetoVirtual {
2 copy lineto
storeNumberPairToGraphicsFile
graphicsFile (lineto ) writestring
} def
/strokeVirtual {
stroke
graphicsFile (stroke ) writestring
} def
/newpathVirtual {
newpath
graphicsFile (newpath ) writestring
} def
/closepathVirtual {
closepath
graphicsFile ( closepath ) writestring
} def
/fillVirtual {
fill
graphicsFile ( fill ) writestring
} def
/setrgbcolorVirtual {
3 copy
setrgbcolor
graphicsFile 4 -1 roll \fcToString writestring graphicsFile ( ) writestring
graphicsFile 3 -1 roll \fcToString writestring graphicsFile ( ) writestring
graphicsFile exch \fcToString writestring
graphicsFile ( setrgbcolor ) writestring
} def
/setdashVirtual {
2 copy setdash
20 string cvs exch \fcToString graphicsFile exch writestring graphicsFile ( ) writestring graphicsFile exch writestring graphicsFile ( setdash ) writestring
} def
/plotArrowHeadVirtual {
2 copy \fcArrowHeadPlotCode\space
\fcToString exch \fcToString graphicsFile exch writestring graphicsFile ( ) writestring graphicsFile exch writestring graphicsFile ( plotArrowHeadVirtual ) writestring
}def
}

\newcommand{\fcSetupFiles}{
\fcSetUpGraphicsToScreen
/graphicsCached false def
/graphicsFileAvailable true def
/graphicsFileName (graphicsCacheSafeToDelete) (\fcScreen) [[1 0] \fcCoordsPStricksToPS] \fcToString [[0 1] \fcCoordsPStricksToPS] \fcToString 6 -1 roll \fcToString \fcHashString (.txt) 6 \fcConcatenateMultiple def
/graphicsFile (file not open) def
errordict begin
/invalidfileaccess
{ userdict begin /graphicsFileAvailable false def end
(ERROR: failed to open file for caching large IIId rendering operations. ) print
(This is not fatal but will cause your graphics to compile incredibly slowly. ) print
(To fix this, compile with pdflatex --shell-escape. ) print
(Make sure the file is executed in a folder with write priviledges. \string\n) print
pop pop
} def
/undefinedfilename{
(File doesn't exist. ) print
 pop pop
} def
end
(Opening file ) print graphicsFileName print (. ) print
/graphicsFile graphicsFileName (r) file def
graphicsFile type (filetype) eq {
/graphicsCached true def
\fcPaintCachedFile
graphicsFile closefile
}
{ /graphicsFile graphicsFileName (w) file def
  graphicsFile type (filetype) ne{
  /graphicsFileAvailable false def
  }
  { \fcSetUpGraphicsToFileAndScreen
  }
  ifelse
}ifelse
}

\newcommand{\fcComputePatchesAndContours}{
/totalNumPatches 0 def
/totalNumContours 0 def
\fcMarkClean
theIIIdObjects {\fcObjectGetNumPatches /totalNumPatches exch totalNumPatches add def} forall
\fcMarkCleanCheck
\fcMarkClean
theIIIdObjects {\fcObjectGetNumContours /totalNumContours exch totalNumContours add def} forall
\fcMarkCleanCheck
/thePatchCollection [totalNumPatches {(empty)}repeat] def
/theContourCollection [totalNumContours{(empty)} repeat] def
(\string\n) print (Expected number of patches, contours: ) print
thePatchCollection length 20 string cvs print (, ) print
theContourCollection length 20 string cvs print
(. Computing patches and contours ...) print
/numPatchesComputedSoFar 0 def
/numContoursComputedSoFar 0 def
/counter -1 def
theIIIdObjects length {
/counter counter 1 add def
theIIIdObjects counter get \fcObjectComputePatchesAndContours
theIIIdObjects counter get \fcObjectGetNumPatches
/numPatchesComputedSoFar exch numPatchesComputedSoFar add def
theIIIdObjects counter get \fcObjectGetNumContours
/numContoursComputedSoFar exch numContoursComputedSoFar add def
} repeat
thePatchCollection{(empty) eq {(ERROR: declared patch not computed!)}if }forall
theContourCollection{(empty) eq {(ERROR: declared contour not computed!)}if }forall
(... computing patches and contours done!\string\n) print
}

\newcommand{\fcPaintPatches}{
thePatchIndices {\fcPaintPatchIndexFilledDirectly} forall
}

\newcommand{\fcPaintPatchLabels}{
/counter -1 def
0 0 0 setrgbcolorVirtual
thePatchCollection length
{/counter counter 1 add def
counter thePatchCollection counter get \fcPatchPaintLabel
}repeat
}

\newcommand{\fcPaintPatchSortOrder}{
/counter -1 def
0 0 0 setrgbcolorVirtual
thePatchIndices length
{/counter counter 1 add def
counter thePatchCollection thePatchIndices counter get get \fcPatchPaintLabel
}repeat
}

\newcommand{\fcPaintContours}{
theContourCollection{\fcPaintContour} forall %
}

\newcommand{\fcProcessCurrentZBuffer}{
/counterI -1 def
%(currentZBuffer is: ) ==
%currentZBuffer ==
currentZBuffer length {
/counterI counterI 1 add def
/counterJ -1 def
currentZBuffer length{
/counterJ counterJ 1 add def
counterI counterJ ne{
/leftIndex currentZBuffer counterI get def
/rightIndex currentZBuffer counterJ get def
rightIndex leftIndex \fcLeftPatchIsBehind {
rightIndex thePatchIncidenceGraph leftIndex get \fcContains not {
thePatchIncidenceGraph leftIndex
[ thePatchIncidenceGraph leftIndex get \fcArrayToStack rightIndex
]
put
}if
}if
}if
}repeat
}repeat
}

\newcommand{\fcComputePatchOrder}{
/thePatchIncidenceGraph [thePatchCollection length {[]}repeat] def
/rowCounter -1 def
(computing patch order... ) print
(processing z-buffer row, column:) print
theZBuffer length {
/rowCounter rowCounter 1 add def
/columnCounter -1 def
theZBuffer rowCounter get length {
/columnCounter columnCounter 1 add def
/currentZBuffer theZBuffer rowCounter get columnCounter get def
% % % % %
(\string\n) print rowCounter == columnCounter ==
(out of: ) print theZBuffer length == theZBuffer rowCounter get length ==
% % % % %
\fcProcessCurrentZBuffer
}repeat
}repeat
(... computing patch order done ) print
}

\newcommand{\fcSortPatchIndices}{
(sorting a total of ) print thePatchCollection length == ( patches... ) print
fastPatchSort
{ (\string\n Sorting patches by their z-depth. This may be inaccurate but is fast. ) print
  /counter -1 def
  /thePatchIndices [thePatchCollection length {/counter counter 1 add def counter} repeat] def
  20 dict begin
  /LeftGreaterThanRight
  { 4 dict begin
  	/rightPatch exch thePatchCollection exch get def
  	/leftPatch  exch thePatchCollection exch get def
    rightPatch \fcPatchGetForcedForegroundStatus leftPatch \fcPatchGetForcedForegroundStatus not and {true}{
    leftPatch \fcPatchGetForcedForegroundStatus rightPatch \fcPatchGetForcedForegroundStatus not and
    {false}{
  	leftPatch  \fcPatchGetPoint \fcScreen\space pop \fcVectorScalarVector
  	rightPatch \fcPatchGetPoint \fcScreen\space pop \fcVectorScalarVector
  	lt
  	}ifelse}ifelse
    end
  } def
  thePatchIndices \fcMergeSort
  end
  /thePatchIndices exch def
  (\string\n Sorting patches done. ) print
}
{
(\string\n Sorting patches via the partial order induced by their visibility. This is slow but somewhat accurate. ) print
%thePatchIncidenceGraph shall have one entry for each patch.
%The entry will consist of a list of all patch indices of
%patches that are behind our patch.
/thePatchIndices [thePatchCollection length {(empty)} repeat] def
20 dict begin
\fcComputePatchOrder
(patch incidence graph:) ==
thePatchIncidenceGraph ==
/accountPatch {
  /patchIndex exch def
  (accounting patch: ) print
  patchIndex ==
  /numAccountedLastCycle numAccountedLastCycle 1 add def
  accountedPatches patchIndex true put
  thePatchIndices numAccountedSoFar patchIndex put
  /numAccountedSoFar numAccountedSoFar 1 add def
} def
/accountedPatches [thePatchCollection length {false} repeat] def
/numAccountedSoFar 0 def
{
/numAccountedLastCycle 0 def
/patchIndex -1 def
thePatchIncidenceGraph length {
/patchIndex patchIndex 1 add def
accountedPatches patchIndex get not
{/patchIsNext true def
/patchBehindIndex -1 def
/patchesBehindCurrent thePatchIncidenceGraph patchIndex get def
patchesBehindCurrent length{
/patchBehindIndex patchBehindIndex 1 add def
accountedPatches patchesBehindCurrent patchBehindIndex get get not{
/patchIsNext false def exit
}if
}repeat
patchIsNext{
patchIndex accountPatch
}if
}if
}repeat
numAccountedLastCycle 0 eq{
(We have cyclically overlapping patches!) ==
/patchIndex -1 def
thePatchIncidenceGraph length {
/patchIndex patchIndex 1 add def
accountedPatches patchIndex get not
{ patchIndex accountPatch exit
}if
}repeat
}if
numAccountedSoFar thePatchIndices length eq{exit} if
}loop
(sorting patches done) print
%thePatchIndices ==
%(thePatchCollection: ) ==
%thePatchCollection ==
end
}ifelse
}

\newcommand{\fcFinishIIIdScene}[1][fastsort=false]{%
\setkeys{fcGraphics}{#1}%
\pscustom{%
\code{%
%print the objects we are about to paint:
theIIIdObjects length 0 gt { %
%(about to process IIId scene given by: ) print %
%theIIIdObjects == %
} if %
60 dict begin %
theIIIdObjects \fcSetupFiles
graphicsCached not{
/fastPatchSort \fcFastPatchSort\space def
% % % % % % % % % % % % % % % % % % %
\fcComputePatchesAndContours
% % % % % % % % % % % % % % % % % % %
\fcZBufferInitialize %
(computing bounding box IIId scene... ) print %
theContourCollection {\fcZBufferBoundingBoxPatchContour} forall
thePatchCollection {\fcZBufferBoundingBoxPatch} forall
%extend slightly the bounding box to take care of floating point errors at the
%border
getZBufferXmin 0.1 sub setZBufferXmin %
getZBufferXmax 0.1 add setZBufferXmax %
getZBufferYmin 0.1 sub setZBufferYmin %
getZBufferYmax 0.1 add setZBufferYmax %
(bounding box computed: ) == ZBufferRectangle == %
% % % % % % % % % % % % % % % % % % % % % % % % % %
(computing z-buffer IIId scene... ) print %
/counter -1 def
thePatchCollection length { /counter counter 1 add def counter \fcZBufferPatchIndex} repeat %
(z buffer computed.) print %
% % % % % % % % % % % % % % % % % % % % % % % % % %
\fcSortPatchIndices
\fcPaintPatches
\fcPaintContours
%\fcPaintPatchSortOrder
%\fcPaintPatchLabels
%[
%thePatchCollection { \fcPatchGetPoint \fcScreen \space pop \fcVectorScalarVector } forall
%] ==
% % % % % %
%(z buffer sorted) print %
% % % % % % % % % % % % % % % % % % % % % % % % % %
%\fcZBufferPrint %
%(painting patches) ==
%\fcZBufferPaintPatches
% %
%\fcPaintZbuffForDebug %
% %
end %
(done, printing stack to make sure no trash is left) == %
pstack %
} %if graphics is not cached
if
}%
}%
\pstVerb{end}%
}%

\newcommand{\fcObjectGetNumContours}{%
\fcArrayToStack %
1 dict begin %
/HandlerNotFound true def %
HandlerNotFound{dup (surface) eq {pop \fcSurfaceGetNumContours /HandlerNotFound false def} if} if %
HandlerNotFound{dup (curve) eq {pop \fcCurveInit 1 /HandlerNotFound false def} if} if %
HandlerNotFound{dup (triangle) eq {pop \fcTriangleInSceneInit 1 /HandlerNotFound false def} if} if %
HandlerNotFound{== (ERROR: OBJECT GET NUMBER OF CONTOURS HANDLER NOT FOUND)} if %
end %
}%

\newcommand{\fcObjectGetNumPatches}{%
\fcArrayToStack %
1 dict begin %
/HandlerNotFound true def %
HandlerNotFound{dup (surface) eq {pop \fcSurfaceGetNumPatches /HandlerNotFound false def} if} if %
HandlerNotFound{dup (curve) eq {pop \fcCurveInit 0 /HandlerNotFound false def} if} if %
HandlerNotFound{dup (triangle) eq {pop \fcTriangleInSceneInit 1 /HandlerNotFound false def} if} if %
HandlerNotFound{== (ERROR: OBJECT NUMBER OF PATCHES HANDLER NOT FOUND)} if %
end %
}%

\newcommand{\fcObjectComputePatchesAndContours}{%
\fcMarkClean exch
\fcArrayToStack %
1 dict begin %
/HandlerNotFound true def %
HandlerNotFound{dup (surface) eq {pop \fcSurfaceComputePatchesAndContours /HandlerNotFound false def} if} if %
HandlerNotFound{dup (curve) eq {pop \fcCurveComputeContour /HandlerNotFound false def} if} if %
HandlerNotFound{dup (triangle) eq {pop \fcTriangleComputePatchesAndContours /HandlerNotFound false def} if} if %
HandlerNotFound{== (ERROR: OBJECT PATCH-CONTOUR HANDLER NOT FOUND)} if %
end %
\fcMarkCleanCheck
}%

\newcommand{\fcZBufferBoundingBoxPatchContour}{ %
2 dict begin %
/theContour exch def %
/counter -1 def %
theContour length 1 sub { /counter counter 1 add def theContour counter get 0 get \fcZBufferBoundingBoxPoint}repeat %
end %
}

\newcommand{\fcPaintPointForegroundData}{
20 dict begin %
gsave
/theNeighborhood exch def %
/thePoint theNeighborhood 0 get def %
(theNeighborhood:)==
theNeighborhood ==
thePoint \fcZBufferRowColumn
/column exch def
/row exch def
/theZBufferCurrent theZBuffer row get column get def
/counter 0 def
/numPatchesInNeighborhood 0 def %
theNeighborhood length 1 sub {
/counter counter 1 add def
1.8 setlinewidth
0.5 1 0.5 setrgbcolor
theNeighborhood counter get theZBufferCurrent \fcContains not
{3 setlinewidth 1 0 0 setrgbcolor
}if
theNeighborhood counter get \fcPatchPaintContourDirectly
theNeighborhood counter get type (arraytype) eq
{/numPatchesInNeighborhood numPatchesInNeighborhood 1 add def}if
}repeat
/counter -1 def
theZBufferCurrent length {
/counter counter 1 add def %
1.1 setlinewidth
1 0.7 0.7 setrgbcolor
thePoint thePatchCollection theZBufferCurrent counter get get \fcPointIsBehindOrInFrontOfPatch{true}
{1 0 0 setrgbcolor
}if
thePatchCollection theZBufferCurrent counter get get \fcPatchPaintContourDirectly
}repeat
thePoint \fcZBufferPaintCellContainingPoint %
[thePoint \fcCoordsIIIdToPStricks] theNeighborhood \fcIsInForeground
{\fcFullDotCode}{\fcHollowDotCode}ifelse %
0 0 0 setrgbcolor
(nsize: ) numPatchesInNeighborhood 20 string cvs \fcConcatenate [thePoint \fcCoordsIIIdToPStricks ] \fcTextCode
(bsize: ) theZBufferCurrent length 20 string cvs \fcConcatenate [thePoint \fcCoordsIIIdToPStricks 0.2 sub ] \fcTextCode
grestore
end
}

\newcommand{\fcZBufferRowColumnIsInvestigated}{
\fcZBufferRowColumnsUnderInvestigation\space column eq exch row eq and
}

\newcommand{\fcArrowHeadAndTailPlotCode}{
2 copy 
10 dict begin
/pointRight exch def
/pointLeft exch def
newpath %
pointLeft \fcCoordsPStricksToPS moveto %
pointRight \fcCoordsPStricksToPS lineto %
stroke %
end
\fcArrowHeadPlotCode
}

\makeatletter
\newcommand{\fcArrowHeadPlotCode}{
10 dict begin
/pointRight exch [ exch \fcCoordsPStricksToPS ] def
/pointLeft  exch [ exch \fcCoordsPStricksToPS ] def
 gsave
/directionVector [pointRight pointLeft \fcVectorMinusVector \fcArrayToStack] def
directionVector \fcVectorNorm 0 ne{
/directionVector directionVector \fcVectorNormalize def
}if
/xPS directionVector 0 get def
/yPS directionVector 1 get def
[yPS  xPS -1 mul  -1 xPS mul -1 yPS mul pointRight \fcArrayToStack] concat
%[1 0 0 1  pointRight 0 get \fcCoordsIIIdToPS ] concat
 newpath
 false 0.4 1.5 0.4 0.5 \tx@Arrow
 closepath
 stroke
 grestore
end
}
\makeatother

\newcommand{\fcPointOnContourGetVisibility}{
dup length 1 sub get\space
}

\newcommand{\fcContourGetUseArrows}{dup length 1 sub get 0 get\space}
\newcommand{\fcContourGetColor}    {dup length 1 sub get 1 get\space}
\newcommand{\fcContourGetWidth}    {dup length 1 sub get 2 get\space}
\newcommand{\fcContourGetDashes}   {dup length 1 sub get 3 get\space}
\newcommand{\fcContourGetLineStyle}{dup length 1 sub get 4 get\space}

\newcommand{\fcPaintContour}{ %
20 dict begin %
/theContour exch def %
theContour \fcContourGetLineStyle (none) ne{
/numSegments theContour length 2 sub def %
/counter -1 def %
/rightIsInForeground theContour 0 get \fcIsInForeground def %
/style (none) def %
/useArrows theContour \fcContourGetUseArrows def
/currentDashes {theContour \fcContourGetDashes \fcArrayToStack} def
theContour \fcContourGetWidth setlinewidthVirtual
theContour \fcContourGetColor \fcArrayToStack setrgbcolorVirtual
numSegments{ %
  /counter counter 1 add def %
  /pointLeft theContour counter get def %
  /pointRight theContour counter 1 add get def %
  /leftIsInForeground rightIsInForeground def %
  /rightIsInForeground pointRight \fcIsInForeground def %
  /leftIsVisible pointLeft \fcPointOnContourGetVisibility def %
  /rightIsVisible pointRight \fcPointOnContourGetVisibility def %
  /oldStyle style def %
  /style leftIsInForeground rightIsInForeground or {(normal)}{(dashed)}ifelse def %
  /setStyle {style (normal) eq{[] 0 setdashVirtual}{currentDashes setdashVirtual}ifelse } def
  leftIsVisible rightIsVisible and{
	counter 0 eq{newpathVirtual}if
    style oldStyle ne{strokeVirtual setStyle %
    newpathVirtual pointLeft 0 get \fcCoordsIIIdToPS movetoVirtual %
    }if %
    pointRight 0 get \fcCoordsIIIdToPS linetoVirtual
  }if
  leftIsVisible rightIsVisible not and{
    strokeVirtual
    /style (invisible) def
  }if
  leftIsVisible not rightIsVisible and{
    setStyle
    newpathVirtual pointRight 0 get \fcCoordsIIIdToPS movetoVirtual %
  }if
}repeat %
strokeVirtual %
useArrows{[] 0 setdashVirtual [pointLeft 0 get \fcCoordsIIIdToPStricks] [pointRight 0 get \fcCoordsIIIdToPStricks] plotArrowHeadVirtual}if %
}if %
end %
}

\newcommand{\fcCurveInit}{
/contourOptions exch def
/theCurve exch def %
/tMax exch def %
/tMin exch def %
/tIterations \fcPlotPoints\space def %
}

\newcommand{\fcCurveComputeContour}{
30 dict begin %
\fcCurveInit
/DeltaT tMax tMin sub tIterations div def %
/t tMin def %
theContourCollection numContoursComputedSoFar
[
tIterations { %
[theCurve true]
/t t DeltaT add def %
}repeat %
contourOptions
]
put
end %
}

\newcommand{\fcComputeSurfacePatch}{
/oldU u def %
/oldV v def %
/inBounds true def
[ %start of patch data structure
theSurface %(x(u,v), y(u,v), z(u,v))
theRestrictions not {/inBounds false def}if
/u u DeltaU add def %
theSurface %(x(u+Delta,v), y(u+Delta,v), z(u+Delta,v))
theRestrictions not {/inBounds false def}if
/u oldU def %
/v v DeltaV add def %
theSurface %(x(u,v+Delta), y(u,v+Delta), z(u,v+Delta))
theRestrictions not {/inBounds false def}if
/u u DeltaU add def %
theSurface %(x(u+Delta,v+Delta), y(u+Delta,v+Delta), z(u+Delta,v+Delta))
theRestrictions not {/inBounds false def}if
[
/u oldU def
/v oldV def
numContourUSegmentsPerPatch {theRestrictions{theSurface}if /u u DeltaDeltaU add def} repeat
/u oldU DeltaU add def
/v oldV def
numContourVSegmentsPerPatch {theRestrictions{theSurface}if /v v DeltaDeltaV add def} repeat
/v oldV DeltaV add def
numContourVSegmentsPerPatch {theRestrictions{theSurface}if /u u DeltaDeltaU sub def} repeat
/u oldU def
numContourVSegmentsPerPatch {theRestrictions{theSurface}if /v v DeltaDeltaV sub def} repeat
]
[colorUVpatch % front color of patch
colorVUpatch % back color of patch
forceForeground %
inBounds %
colorVUpatch %patch built-in contour color, used when drawing patch contour directly
false %is contour dashed independent of visibility?
[] %dashes not used
]
(patch) %
] %patch data structure complete
/u oldU def %
/v oldV def %
}

\newcommand{\fcSurfaceGetNumContours}{
30 dict begin
\fcSurfaceInit %
uIterations 1 add vIterations 1 add add
end
}

\newcommand{\fcSurfaceGetNumPatches}{
30 dict begin
\fcSurfaceInit %
uIterations vIterations mul
end
}

\newcommand{\fcSurfaceInit}{%
/contourOptions exch def%
/patchOptions exch def%
/forceForeground patchOptions 2 get def%
/colorUVpatch patchOptions 0 get def%
/colorVUpatch patchOptions 1 get def%
/vIterations exch def %
/uIterations exch def %
/theRestrictions exch def
/theSurface exch def %
/vMax exch def %
/uMax exch def %
/vMin exch def %
/uMin exch def %
}

\newcommand{\fcSurfaceComputePatchesAndContours}{%
30 dict begin %
{ %begin loop, used to simulate a jump instruction
%exiting the loop = jumping at loop end
\fcSurfaceInit
/u uMin def
/v vMin def
mark
theSurface type (arraytype) ne {(\string\n ERROR: surface must be an array. \string\n) print cleartomark exit}if cleartomark
\fcMarkClean
/DeltaU uMax uMin sub uIterations div def %
/DeltaV vMax vMin sub vIterations div def %
/getPatchIndex {exch vIterations mul add numPatchesComputedSoFar add} def
/accountPatch {getPatchIndex dup thePatchCollection exch get (empty) eq {thePatchCollection exch 3 -1 roll put}{pop pop}ifelse
} def
/numContourVSegmentsPerPatch \fcNumCountourSegmentsPatchV \space def
/numContourUSegmentsPerPatch \fcNumCountourSegmentsPatchU \space def
/DeltaDeltaV DeltaV numContourVSegmentsPerPatch div def %
/DeltaDeltaU DeltaU numContourUSegmentsPerPatch div def %
% % % % % % % % % % % % % % % % % % % % %
%process uv-contours
/u uMin def %
/counterU -1 def %
uIterations 1 add{ %
/counterU counterU 1 add def %
/counterV -1 def %
/v vMin def %
/patchLeftIndex (empty) def %
/patchRightIndex (empty) def %
[
vIterations { %
/counterV counterV 1 add def
/patchLeftBackIndex patchLeftIndex def %
/patchRightBackIndex patchRightIndex def %
/patchLeftIndex counterU uIterations lt
{\fcComputeSurfacePatch counterU counterV accountPatch counterU counterV getPatchIndex}
{(empty)}
ifelse def %
/patchRightIndex counterU 0 ne {counterU 1 sub counterV getPatchIndex}
{(empty)} ifelse def %
/vOld v def %
[theSurface patchLeftIndex patchRightIndex patchLeftBackIndex patchRightBackIndex theRestrictions]
numContourUSegmentsPerPatch 1 sub{/v v DeltaDeltaV add def [theSurface patchLeftIndex patchRightIndex theRestrictions]} repeat
/v vOld DeltaV add def %
}repeat %
[theSurface patchLeftIndex patchRightIndex theRestrictions]
contourOptions
]
/thePatchContour exch def %
%/contourIsUnderInvestigation \fcZBufferVparameterPointUnderInvestigation\space pop counterU eq def
%/indexPointUnderInvestigation
%\fcZBufferVparameterPointUnderInvestigation\space exch pop def
theContourCollection counterU numContoursComputedSoFar add thePatchContour put
/uOld u def %
/u u DeltaU add def %
} repeat %
% % % % % % % % % % % % % % % % % % % % %
%process vu-contours
/v vMin def %
/counterV -1 def %
vIterations 1 add{ %
  /counterV counterV 1 add def %
  /counterU -1 def
  /u uMin def %
  /patchLeftIndex (empty) def %
  /patchRightIndex (empty) def %
  [
  uIterations { %
  /counterU counterU 1 add def
  /patchLeftBackIndex patchLeftIndex def %
  /patchRightBackIndex patchRightIndex def %
  /patchLeftIndex counterV vIterations lt
  {counterU counterV getPatchIndex}
  {(empty)}
  ifelse
  def %
  /patchRightIndex counterV 0 ne {counterU counterV 1 sub getPatchIndex} {(empty)} ifelse def %
  /uOld u def %
  [theSurface patchLeftIndex patchRightIndex patchLeftBackIndex patchRightBackIndex theRestrictions]
  numContourVSegmentsPerPatch 1 sub{/u u DeltaDeltaU add def [theSurface patchLeftIndex patchRightIndex theRestrictions]} repeat
  /u uOld DeltaU add def %
  }repeat %
  [theSurface patchLeftIndex patchRightIndex theRestrictions]
  contourOptions
  ]
  /thePatchContour exch def %
  %/contourIsUnderInvestigation \fcZBufferUparameterPointUnderInvestigation\space pop counterV  eq def
  %/indexPointUnderInvestigation
  %\fcZBufferUparameterPointUnderInvestigation\space exch pop def
  theContourCollection uIterations 1 add counterV add numContoursComputedSoFar add thePatchContour put
  /vOld v def %
  /v v DeltaV add def %
} repeat %
\fcMarkCleanCheck
exit
}loop %this loop is used to simulate a jump instruction
end %
}%

\newcommand{\fcGetColorCode}[1]{%
2 dict begin%
/theColor {0 0 0} def%
/colorNotFound true def%
(#1) (black) eq (#1) (black ) eq or{/theColor {0 0 0} def /colorNotFound false def}if%
(#1) (white) eq (#1) (white ) eq or{/theColor {1 1 1} def /colorNotFound false def}if%
(#1) (red) eq (#1) (red ) eq or{/theColor {1 0 0} def /colorNotFound false def}if%
(#1) (blue) eq (#1) (blue ) eq or{/theColor {0 0 1} def /colorNotFound false def}if%
(#1) (green) eq (#1) (green ) eq or{/theColor {0 1 0} def /colorNotFound false def}if%
(#1) (brown) eq (#1) (brown ) eq or{/theColor {0.6484375 0.1640625 0.1640625} def /colorNotFound false def}if%
(#1) (orange) eq (#1) (orange ) eq or{/theColor {1 0.647058824 0} def /colorNotFound false def}if%
(#1) (cyan) eq (#1) (cyan ) eq or {/theColor {0 1 1} def /colorNotFound false def}if %
(#1) (pink) eq (#1) (pink ) eq or {/theColor {1 0.75390625 0.796875} def /colorNotFound false def}if %
(#1) (gray) eq (#1) (gray ) eq or {/theColor {0.5 0.5 0.5} def /colorNotFound false def}if %
colorNotFound{/theColor {#1} def}if %
theColor %
end%
}%

\newcommand{\fcLineIIIdInScene}[3][arrows=,]{%
\fcCurveIIIdInScene[#1]{0}{1}{#3 t \fcVectorTimesScalar #2 1 t sub \fcVectorTimesScalar \fcVectorPlusVector}%
}

%Format of curve: we store the curve in the format [tmin tmax [x y z] arrows red green blue (curve)]
\newcommand{\fcCurveIIIdInScene}[4][]{%
\setkeys{fcGraphics}{#1}%
\pstVerb{%
[theIIIdObjects \fcArrayToStack [#2\space #3{#4} \fcContourOptions (curve)] ]/theIIIdObjects exch def}%
}%

\newcommand{\fcSegmentCodeNoFirstPoint}{
5 dict begin
/right exch def
/left exch def
/Delta 1 \fcNumCountourSegmentsPatchU div def
/t Delta def
\fcNumCountourSegmentsPatchU {left 1 t sub \fcVectorTimesScalar right t \fcVectorTimesScalar \fcVectorPlusVector /t t Delta add def} repeat
end
}

\newcommand{\fcTriangleComputePatchesAndContours}{
25 dict begin
\fcTriangleInSceneInit
\fcMarkClean
/currentPatch
[ vertex0 vertex1 vertex2 vertex1 vertex2 \fcVectorPlusVector 0.5
\fcVectorTimesScalar
[ vertex0 dup vertex1 \fcSegmentCodeNoFirstPoint vertex1 vertex2 \fcSegmentCodeNoFirstPoint vertex2 vertex0 \fcSegmentCodeNoFirstPoint]
patchOptions (patch)
] def
/currentContour
[
currentPatch \fcPatchGetContour {[exch true]}forall
contourOptions
]
def
thePatchCollection numPatchesComputedSoFar currentPatch put
theContourCollection numContoursComputedSoFar currentContour put
\fcMarkCleanCheck
end
}

\newcommand{\fcTriangleInSceneInit}{
/contourOptions exch def
/patchOptions exch def
/vertex2 exch def
/vertex1 exch def
/vertex0 exch def
}

\newcommand{\fcBoxIIIdInScene}[5][]{%
\fcPatchInScene[#1]{#2}{#4}{#3}%
\fcPatchInScene[#1]{#2}{#5}{#4}%
\fcPatchInScene[#1]{#2}{#3}{#5}%
\fcPatchInScene[#1]{#3}{#3 #4 #2 \fcVectorMinusVector \fcVectorPlusVector}{#3 #5 #2 \fcVectorMinusVector \fcVectorPlusVector}%
\fcPatchInScene[#1]{#4}{#4 #5 #2 \fcVectorMinusVector \fcVectorPlusVector}{#4 #3 #2 \fcVectorMinusVector \fcVectorPlusVector}%
\fcPatchInScene[#1]{#5}{#5 #3 #2 \fcVectorMinusVector \fcVectorPlusVector}{#5 #4 #2 \fcVectorMinusVector \fcVectorPlusVector}%
}

%We give the patch by its corners v0, v1, v2.
\newcommand{\fcTriangleInScene}[4][]{%
\setkeys{fcGraphics}{#1}%
\pstVerb{%
/theIIIdObjects [theIIIdObjects \fcArrayToStack [#2\space #3\space #4\space \fcPatchOptions \fcContourOptions (triangle)] ] def%
}%
}

%Format of patch: we give the patch by its corners v0, v1, v2. The patch is spanned by v1-v0 and v2-v0
\newcommand{\fcPatchInScene}[4][]{%
\fcSurfaceInScene[#1, iterationsU=1, iterationsV=1]{0}{0}{1}{1}{%
3 dict begin %
/v0 #2\space def %
/t1 #3\space v0 \fcVectorMinusVector def %
/t2 #4\space v0 \fcVectorMinusVector def %
v0 %
t1 u \fcVectorTimesScalar %
t2 v \fcVectorTimesScalar %
\fcVectorPlusVector \fcVectorPlusVector %
end %
}{}%
}

%Format of surface: we store the surface in the format
%[umin vmin umax vmax
%[x(u,v) y(u,v) z(u,v)] %coordinate functions
% restrictions %boolean function in u,v, when the function evaluates to false the surface is not drawn. A great tool for cutting surfaces.
%uIterations vIterations   %number of curvilinear u,v-segments
%[red green blue] %color of patches whose u,v-side is visible
%[red green blue] %color of patches whose v,u-side is visible
%[red green blue] %color of contours
% foregroundstatus %true or false
%(surface)].
\newcommand{\fcSurfaceInScene}[7][]{%
\setkeys{fcGraphics}{#1}%
\pstVerb{%
[theIIIdObjects \fcArrayToStack [#2\space #3\space #4\space #5\space {#6} {#7} length 0 ne {{#7}}{{true}}ifelse \fcIterationsU\space \fcIterationsV%
\fcPatchOptions%
\fcContourOptions%
(surface)] ]/theIIIdObjects exch def}%
}%

\newcommand{\fcCurveIIIdNoSceneCode}{%
15 dict begin%
/theCurve exch def%
/tMax exch def%
/tMin exch def%
/numPoints \fcPlotPoints\space def%
/Delta tMax tMin sub numPoints 1 sub div def%
/t tMin def %
\fcLineFormatCode %
newpath %
theCurve \fcCoordsIIIdToPS moveto %
numPoints 1 sub {/t t Delta add def theCurve \fcCoordsIIIdToPS lineto } repeat %
stroke %
end %
}%

\newcommand{\fcZBufferBoundingBoxPolyline}{ %
{\fcZBufferBoundingBoxPoint} forall
}

\newcommand{\fcContains}{ %
%format: theElement theArray -> true if theElement is in the array, false else.
3 dict begin %
/theArray exch def %
/theElement exch def %
false %
/counter 0 def %
theArray length { %
theElement theArray counter get \fcAreEqual {pop true exit}if %
/counter counter 1 add def %
}repeat %
end %
}

\newcommand{\fcAreEqual}{ %
1 dict begin
/areEqual
{5 dict begin
/left exch def
/right exch def
left type  right type ne{false}
{ left type (arraytype) ne{ left right eq}
{ left length right length ne{false}
{ /counter 0 def %
true %
left length { left  counter get right counter get areEqual not{pop false exit }if /counter counter 1 add def }repeat
}ifelse
}ifelse
}ifelse
end
} def %
areEqual
end
}

\newcommand{\fcZBufferAccountPatchIndexAtXY}{ %
5 dict begin %
/currentArray theZBuffer row get column get def %
/counter 0 def %
thePatchIndex currentArray \fcContains not
{theZBuffer row get column [currentArray \fcArrayToStack thePatchIndex ] put}if
end %
}

\newcommand{\fcMergeSort}{
2 dict begin
/theArray exch def
/mergeSortStartIndexLength {
10 dict begin
/theLength exch def
/startIndex exch def
{ theLength 1 eq
  { [theArray startIndex get]
  	exit
  } if
  theLength 2 eq
  { theArray startIndex get theArray startIndex 1 add get
    LeftGreaterThanRight
    { [theArray startIndex 1 add get theArray startIndex get]
    }
    { [theArray startIndex get theArray startIndex 1 add get]
    } ifelse
    exit
  } if
  /leftLength theLength 2 div cvi def
  /rightLength theLength leftLength sub def
  /leftSorted startIndex leftLength mergeSortStartIndexLength def
  /rightSorted startIndex leftLength add rightLength mergeSortStartIndexLength def
  /counterLeft 0 def
  /counterRight 0 def
  [ theLength{
      counterLeft leftLength ge{
        /leftNext false def
      }{
        counterRight rightLength ge{
          /leftNext true def
        }{
          /leftNext leftSorted counterLeft get rightSorted counterRight get  LeftGreaterThanRight not def
        } ifelse
      } ifelse
      leftNext{
        leftSorted counterLeft get /counterLeft counterLeft 1 add def
      }{
        rightSorted counterRight get /counterRight counterRight 1 add def
      }ifelse
    } repeat
  ]
  exit
}loop
end
} def
theArray length 0 gt {
  0 theArray length mergeSortStartIndexLength
}{
  theArray
} ifelse
end
}

\newcommand{\fcBubbleSort}{
5 dict begin
/a exch def
/n a length 1 sub def
n 0 gt {
% at this point only the n+1 items in the bottom of a remain to be sorted
% the largest item in that block is to be moved up into position n
n {
0 1 n 1 sub {
/i exch def
a i get a i 1 add get LeftGreaterThanRight {
% if a[i] > a[i+1] swap a[i] and a[i+1]
a i 1 add
a i get
a i a i 1 add get
% set new a[i] = old a[i+1]
put
% set new a[i+1] = old a[i]
put
} if
} for
/n n 1 sub def
} repeat
} if
end
}

\newcommand{\fcGaussianElimination}{
15 dict begin
/theMatrix exch def
/numRows theMatrix length def
/numCols theMatrix 0 get length def
/rowIndex 0 def
/columnIndex -1 def
{ /columnIndex columnIndex 1 add def
  columnIndex numCols ge {exit}if
  /candidateIndex -1 def
  /counter rowIndex 1 sub def
  numRows rowIndex sub {
    /counter counter 1 add def
    theMatrix counter get columnIndex get 0 ne {/candidateIndex counter def exit}if
  }repeat
  candidateIndex -1 ne{
    /temp theMatrix rowIndex get def
    theMatrix rowIndex theMatrix candidateIndex get put
    theMatrix candidateIndex temp put
    /pivotRow theMatrix rowIndex get def
    /theCoeff 1 pivotRow columnIndex get div def
    /pivotRow pivotRow  theCoeff \fcVectorTimesScalar def
    theMatrix rowIndex pivotRow put
    /counter -1 def
    numRows {
      /counter counter 1 add def
      counter rowIndex ne{
      theMatrix counter get dup columnIndex get pivotRow exch \fcVectorTimesScalar \fcVectorMinusVector theMatrix exch counter exch put
      }if
    }repeat
    /rowIndex rowIndex 1 add def
  }if
  rowIndex numRows ge {exit}if
}loop
theMatrix
end\space
}

\newcommand{\fcLeftSegmentIsBehindSegmentsAreSkew}{
%Let l1 l2 be the endpoints of the left segment,
%r1, re - the endpoints of the right.
%Let pl1, pl2, pr1, pr2 denote the projections onto the viewing
%screen of the corresponding endpoints.
%Let
%(a,c) be the vector pl1-pl2
%(b,d) be the vector pr2-pr1
%(e,f) be the vector pr2-pl2
%We need to solve the system
%(a b) (s)= (e)
%(c d) (t)= (f)
%The determinant of the system must be non-zero, else the segments are non-skew.
% the projections of the segments intersect if 0 <= s<=1
% and 0<=t<=1.
%In that case the point on the left segment that projects onto the point of interest is s*l1 +(1-s)l2. The point on the right segment that projects onto the point of interest is t*r1 +(1-t)*r2
%
25 dict begin
\fcArrayToStack
/r1 exch def
/r2 exch def
\fcArrayToStack
/l1 exch def
/l2 exch def
/pr1 [r1 \fcCoordsIIIdToPStricks] def
/pr2 [r2 \fcCoordsIIIdToPStricks] def
/pl1 [l1 \fcCoordsIIIdToPStricks] def
/pl2 [l2 \fcCoordsIIIdToPStricks] def
pl1 pl2 \fcVectorMinusVector \fcArrayToStack
/c exch def
/a exch def
pr2 pr1 \fcVectorMinusVector \fcArrayToStack
/d exch def
/b exch def
pr2 pl2 \fcVectorMinusVector \fcArrayToStack
/f exch def
/e exch def
/theMatrix [[a b e][c d f]] \fcGaussianElimination def
/a theMatrix 0 get 0 get def
/d theMatrix 1 get 1 get def
/e theMatrix 0 get 2 get def
/f theMatrix 1 get 2 get def
a 0 eq d 0 eq or {false}{
/s e a div def
/t f d div def
s 0 gt s 1 lt t 0 gt t 1 lt and and and
{
/leftPoint l1 s \fcVectorTimesScalar l2 1 s sub \fcVectorTimesScalar \fcVectorPlusVector def
/rightPoint r1 t \fcVectorTimesScalar r2 1 t sub \fcVectorTimesScalar \fcVectorPlusVector def
leftPoint  \fcScreen\space pop \fcVectorScalarVector
rightPoint \fcScreen\space pop \fcVectorScalarVector
ge
}
{false}
ifelse
}ifelse
end
}

\newcommand{\fcLeftPatchIsBehind}{
2 dict begin
/rightIndex exch def
/leftIndex exch def
leftIndex rightIndex \fcLeftPatchIsBehindOrPatchesIntersect
{
rightIndex leftIndex \fcLeftPatchIsBehindOrPatchesIntersect not
}
{false}ifelse
end
}

\newcommand{\fcLeftPatchIsBehindOrPatchesIntersect}{
%this function compares two patches:
40 dict begin
/rightIndex exch def
/leftIndex exch def
/rightPatch thePatchCollection rightIndex get def
/leftPatch thePatchCollection leftIndex get def
rightPatch \fcPatchGetForcedForegroundStatus leftPatch \fcPatchGetForcedForegroundStatus not and {true}{
leftPatch \fcPatchGetForcedForegroundStatus rightPatch \fcPatchGetForcedForegroundStatus not and
{false}{
/result false def
{ leftPatch \fcPatchGetContour {rightPatch \fcPointIsBehindOrInFrontOfPatch{true} {/result true def exit}if }forall
result {exit}if
rightPatch \fcPatchGetContour {leftPatch \fcPointIsBehindOrInFrontOfPatch{false} {/result true def exit}if }forall
exit
}loop
result
}ifelse
}ifelse
end
}

\newcommand{\fcLeftPatchIsBehindOrPatchesIntersectOLDAndINCORRECT}{
%this function compares two patches:
40 dict begin
/rightIndex exch def
/leftIndex exch def
/rightPatch thePatchCollection rightIndex get def
/leftPatch thePatchCollection leftIndex get def
rightPatch \fcPatchGetForcedForegroundStatus leftPatch \fcPatchGetForcedForegroundStatus not and {true}{
leftPatch \fcPatchGetForcedForegroundStatus rightPatch \fcPatchGetForcedForegroundStatus not and
{false}{
/lv0 leftPatch \fcPatchGetvZero def
/lv1 leftPatch \fcPatchGetvOne def
/lv2 leftPatch \fcPatchGetvTwo def
/lv3 leftPatch \fcPatchGetvThree def
/rv0 rightPatch \fcPatchGetvZero def
/rv1 rightPatch \fcPatchGetvOne def
/rv2 rightPatch \fcPatchGetvTwo def
/rv3 rightPatch \fcPatchGetvThree def
/ls0 [lv0 lv1] def
/ls1 [lv1 lv3] def
/ls2 [lv2 lv3] def
/ls3 [lv0 lv2] def
/rs0 [rv0 rv1] def
/rs1 [rv1 rv3] def
/rs2 [rv2 rv3] def
/rs3 [rv0 rv2] def
/result false def
4 leftIndex eq  3 rightIndex eq and {(4 behind 3?) == }if
{ lv0 rightPatch \fcPointIsBehindOrInFrontOfPatch{true} {/result true def 4 leftIndex eq  3 rightIndex eq and {(4 IS behind 3 for vertex reasons) == }if exit }if
  lv1 rightPatch \fcPointIsBehindOrInFrontOfPatch{true} {/result true def 4 leftIndex eq 3 rightIndex eq and {(4 IS behind 3 for vertex reasons) == }if exit }if
  lv2 rightPatch \fcPointIsBehindOrInFrontOfPatch{true} {/result true def 4 leftIndex eq 3 rightIndex eq and {(4 IS behind 3 for vertex reasons) == }if exit }if
  lv3 rightPatch \fcPointIsBehindOrInFrontOfPatch{true} {/result true def 4 leftIndex eq 3 rightIndex eq and {(4 IS behind 3 for vertex reasons) == }if exit }if
  [ls0 ls1 ls2 ls3]
  { [rs0 rs1 rs2 rs3]
    {
    3 leftIndex eq  4 rightIndex eq and {(3 behind 4? 2nd) == pstack (STACK) ==}if
    %3 leftIndex eq  3 rightIndex eq and {(ere be i) == pstack }if
    %(printint stack) == pstack (printing stack done ) ==
      exch dup 3 -1 roll \fcLeftSegmentIsBehindSegmentsAreSkew{/result true def exit}if
    }forall
    pop
    result {exit}if
  }forall
  exit
}loop
3 leftIndex eq 4 rightIndex eq and {(and the 34 RESULT result is...) == result ==}if
result
}ifelse
}ifelse
end
}

\newcommand{\fcZBufferPaintPatches}{
10 dict begin
gsave
/row -1 def %
theZBuffer length{ %
/row row 1 add def %
/column -1 def %
theZBuffer row get length{ %
/column column 1 add def %
/currentZBuffer theZBuffer row get column get def %
currentZBuffer {\fcPaintPatchIndexFilledDirectly} forall %
} repeat%
}repeat %
grestore
end
}

\newcommand{\fcPatchGetNormal}{
1 dict begin
/thePatch exch def
thePatch \fcPatchGetvOne thePatch \fcPatchGetvZero \fcVectorMinusVector
thePatch \fcPatchGetvTwo thePatch \fcPatchGetvZero \fcVectorMinusVector
\fcVectorCrossVector
end
}

\newcommand{\fcPatchOptions}{%
[[\fcGetColorCode{\fcColorPatchUV}] [\fcGetColorCode{\fcColorPatchVU}] \fcForceForeground \space true [\fcGetColorCode{\fcColorLine}] ]%
}%

\newcommand{\fcPatchGetvZero}{0 get\space}
\newcommand{\fcPatchGetvOne}{1 get\space}
\newcommand{\fcPatchGetvTwo}{2 get\space}
\newcommand{\fcPatchGetvThree}{3 get \space}
\newcommand{\fcPatchGetContour}{4 get\space}
\newcommand{\fcPatchGetColorUV}{5 get 0 get \fcArrayToStack \space}
\newcommand{\fcPatchGetColorVU}{5 get 1 get \fcArrayToStack \space}
\newcommand{\fcPatchGetForcedForegroundStatus}{5 get 2 get\space}
\newcommand{\fcPatchGetInBounds}{5 get 3 get\space}
\newcommand{\fcPatchGetColorContour}{5 get 4 get \fcArrayToStack \space}
\newcommand{\fcPatchGetIsDashed}{5 get 5 get \space}
\newcommand{\fcPatchGetDashes}{5 get 6 get \fcArrayToStack \space}

\newcommand{\fcPaintPatchIndexFilledDirectly}{
thePatchCollection exch get \fcPatchPaintFilledDirectly
}

\newcommand{\fcPatchGetPoint}{
1 dict begin
/thePatch exch def %
thePatch \fcPatchGetvZero
thePatch \fcPatchGetvOne
thePatch \fcPatchGetvTwo
thePatch \fcPatchGetvThree
\fcVectorPlusVector
\fcVectorPlusVector
\fcVectorPlusVector
0.25 \fcVectorTimesScalar
end
}

\newcommand{\fcPatchPaintLabel}{
3 dict begin
/thePatch exch def
20 string cvs
/Times-Roman findfont
4 scalefont
setfont
newpath
thePatch \fcPatchGetPoint \fcCoordsIIIdToPS moveto
show
stroke
end
}

\newcommand{\fcPlotArrow}{
2 copy
exch
newpath
\fcCoordsIIIdToPS moveto
\fcCoordsIIIdToPS lineto
stroke
exch [ exch \fcCoordsIIIdToPStricks ] exch [exch \fcCoordsIIIdToPStricks ] plotArrowHeadVirtual
}


\newcommand{\fcPatchPaintNormal}{
1 dict begin
/thePatch exch def
2 setlinewidth
0 0 0 setrgbcolorVirtual
thePatch \fcPatchGetPoint
thePatch \fcPatchGetPoint thePatch \fcPatchGetNormal \fcVectorPlusVector
\fcPlotArrow
1 1 0 setrgbcolorVirtual
thePatch \fcPatchGetvZero
thePatch \fcPatchGetvOne
\fcPlotArrow
0 1 1 setrgbcolorVirtual
thePatch \fcPatchGetvZero
thePatch \fcPatchGetvTwo
\fcPlotArrow
end
}

\newcommand{\fcPatchPaintFilledDirectly}{
1 dict begin
/thePatch exch def %
thePatch type (arraytype) eq{
thePatch \fcPatchGetContour length 0 gt{
thePatch \fcPatchGetNormal \fcScreen\space pop \fcVectorScalarVector 0 gt
{ thePatch \fcPatchGetColorVU setrgbcolorVirtual }
{ thePatch \fcPatchGetColorUV setrgbcolorVirtual }
ifelse
0.5 setalpha
newpathVirtual
thePatch \fcPatchGetContour 0 get \fcCoordsIIIdToPS movetoVirtual
thePatch \fcPatchGetContour{\fcCoordsIIIdToPS linetoVirtual}forall
closepathVirtual
fillVirtual
strokeVirtual
%thePatch \fcPatchPaintNormal
}if
}if
end
}

\newcommand{\fcPatchPaintContourDirectly}{
1 dict begin
/thePatch exch def %
thePatch type (arraytype) eq{
thePatch \fcPatchGetIsDashed {thePatch \fcPatchGetDashes setdashVirtual}{[] 0 setdashVirtual}ifelse
thePatch \fcPatchGetContour length 0 gt{
thePatch \fcPatchGetColorContour setrgbcolorVirtual
newpathVirtual
thePatch \fcPatchGetContour 0 get \fcCoordsIIIdToPS movetoVirtual
thePatch \fcPatchGetContour{\fcCoordsIIIdToPS linetoVirtual}forall
closepathVirtual
strokeVirtual
}if
}if
end
}

\newcommand{\fcZBufferPatchIndex}{ %
15 dict begin %
/thePatchIndex exch def %
/thePatch thePatchCollection thePatchIndex get def
%thePatch \fcPatchPaintContourDirectly
/secondPoint thePatch \fcPatchGetvTwo def %
/firstPoint  thePatch \fcPatchGetvOne def %
/basePoint   thePatch \fcPatchGetvZero def %
/firstDirection firstPoint basePoint \fcVectorMinusVector def %
/secondDirection secondPoint basePoint \fcVectorMinusVector def %
/iterationsFirst [firstDirection \fcCoordsIIIdToPStricks\space pop getZBufferDeltaX div firstDirection \fcCoordsIIIdToPStricks\space exch pop getZBufferDeltaY div] \fcVectorNorm 2 mul 2 add round cvi def %
/iterationsSecond [secondDirection \fcCoordsIIIdToPStricks pop  getZBufferDeltaX div secondDirection \fcCoordsIIIdToPStricks exch pop getZBufferDeltaY div] \fcVectorNorm 2 mul 2 add round cvi def
/s 0 def %
iterationsFirst{ %
/firstComponent firstDirection s iterationsFirst 1 sub div  \space\fcVectorTimesScalar basePoint \fcVectorPlusVector def%
/t 0 def %
iterationsSecond{ %
secondDirection t iterationsSecond 1 sub div \fcVectorTimesScalar %
firstComponent \fcVectorPlusVector \fcZBufferRowColumn %
/column exch def %
/row exch def %
\fcZBufferAccountPatchIndexAtXY %
/t t 1 add def %
}repeat
/s s 1 add def %
}repeat
end %
}

\newcommand{\fcCurveIIId}[4][linecolor=\fcColorGraph]{%
\parametricplot[#1]{#2}{#3}{#4 \fcCoordsIIIdToPStricks}%
}

\newcommand{\fcZeroVector}{[exch {0} repeat]}

\newcommand{\fcPerpendicularComputeHeel}[3]{%
\pstVerb{%
7 dict begin%
/thePoint #1 def%
/heelSize #3 def %
mark #2 %
counttomark 1 eq {%
/directionUnitVector exch \fcVectorNormalize def%
/basePoint thePoint length \fcZeroVector def%
}{%
/basePoint exch def%
/directionUnitVector exch basePoint \fcVectorMinusVector \fcVectorNormalize def%
} ifelse %
pop%
/heel directionUnitVector thePoint basePoint \fcVectorMinusVector directionUnitVector \fcVectorScalarVector \fcVectorTimesScalar basePoint \fcVectorPlusVector def%
/perpendicularUnitVector thePoint heel \fcVectorMinusVector \fcVectorNormalize def %
/polyLineInput {%
heel directionUnitVector heelSize \fcVectorTimesScalar \fcVectorMinusVector %
dup perpendicularUnitVector heelSize \fcVectorTimesScalar \fcVectorPlusVector %
heel perpendicularUnitVector heelSize \fcVectorTimesScalar \fcVectorPlusVector%
} def%
}%
}

\newcommand{\fcPerpendicular}[4][]{%
\fcPerpendicularComputeHeel{#2}{#3}{#4}%
\psline[#1](! thePoint \fcArrayToStack)(! heel \fcArrayToStack)%
\listplot[linecolor=red]{ [polyLineInput] {\fcArrayToStack} \fcSpliceArrayOperation \fcArrayToStack}%
\pstVerb{end}%
}

\newcommand{\fcPerpendicularIIId}[4][]{%
\fcPerpendicularComputeHeel{#2}{#3}{#4}%
\fcLineIIId[#1]{thePoint}{heel}%
\fcPolyLineIIId[linecolor=red]{polyLineInput}%
\pstVerb{end}%
}%

\newcommand{\fcPlotIIId}[7][]{%
\fcPlotIIIdXconst[#1]{#2}{#3}{#4}{#5}{#6}{#7}%
\fcPlotIIIdYconst[#1]{#2}{#3}{#4}{#5}{#6}{#7}%
}
\newcommand{\fcPlotIIIdXconst}[7][]{%
\setkeys{fcGraphics}{#2}%
\multido{\ra=0+1}{\fcIterationsX}{%
\pstVerb{%
3 dict begin %
/x \ra \space #3 mul \fcIterationsX \space \ra \space sub 1 sub  #5\space mul add \fcIterationsX\space 1 sub div def%
/ymin #4 def%
/ymax #6 def%
}%
\parametricplot[#1]{ymin}{ymax}{%
1 dict begin /y t def  [x y #7] \fcCoordsIIIdToPStricks end%
}%
\pstVerb{end}%
}%end multido
}

\newcommand{\fcPlotIIIdYconst}[7][]{%
\setkeys{fcGraphics}{#2}%
\multido{\ra=0+1}{\fcIterationsY}{%
\pstVerb{%
3 dict begin%
/y \ra \space #4 mul \fcIterationsY \space \ra \space sub 1 sub  #6\space mul add \fcIterationsY\space 1 sub div def%
/xmin #3 def%
/xmax #5 def%
}%
\parametricplot[#1]{xmin}{xmax}{%
1 dict begin /x t def  [x y #7] \fcCoordsIIIdToPStricks end%
}%
\pstVerb{end}%
}%end multido
}

\newcommand{\fcSurfaceIIIdUConst}[7][]{%
\setkeys{fcGraphics}{#2}%
\multido{\ra=0+1}{\fcIterationsX}{%
\pstVerb{%
3 dict begin%
/u \ra \space #3 mul \fcIterationsX \space \ra \space sub 1 sub  #5\space mul add \fcIterationsX\space 1 sub div def%
/vmin #4 def%
/vmax #6 def%
}%
\parametricplot[#1]{vmin}{vmax}{%
1 dict begin /v t def #7 \fcCoordsIIIdToPStricks end%
}%
\pstVerb{end}%
}%end multido
}

\newcommand{\fcSurfaceIIIdVConst}[7][]{%
\setkeys{fcGraphics}{#2}%
\multido{\ra=0+1}{\fcIterationsY}{%
\pstVerb{%
3 dict begin%
/v \ra \space #4 mul \fcIterationsY \space \ra \space sub 1 sub  #6\space mul add \fcIterationsY\space 1 sub div def%
/umin #3 def%
/umax #5 def%
}%
\parametricplot[#1]{umin}{umax}{%
1 dict begin /u t def #7 \fcCoordsIIIdToPStricks end%
}%
\pstVerb{end}%
}%end multido
}

\newcommand{\fcSurfaceDirectDraw}[7][]{%
\fcSurfaceIIIdUConst[#1]{#2}{#3}{#4}{#5}{#6}{#7}%
\fcSurfaceIIIdVConst[#1]{#2}{#3}{#4}{#5}{#6}{#7}%
}%

%Use: \fcVectorFieldCenteredArrow[options]{startX}{startY}{iterationsX}{iterationsY}{Delta}{y -x}
\newcommand{\fcVectorFieldCenteredArrow}[7][linecolor=blue]{%
\multido{\ra=#2+#6}{#4}{%
\multido{\rb=#3+#6}{#5}{%
\pstVerb{%
4 dict begin%
/x \ra\space def%
/y \rb\space def %
#7\space%
/vY exch def%
/vX exch def%
}%
\psline[#1](! x vX 2 div sub y vY 2 div sub)(! x vX 2 div add y vY 2 div add)%
\pscircle*[linecolor=red](! x y){0.02}%
\pstVerb{end}%
}%end multido
}%end multido
}%

%Use: \fcVectorField[options]{startX}{startY}{iterationsX}{iterationsY}{Delta}{y -x}
\newcommand{\fcVectorField}[7][linecolor=blue]{%
\setkeys{fcGraphics}{#1}%
\multido{\ra=#2+#6}{#4}{%
\multido{\rb=#3+#6}{#5}{%
\pstVerb{%
6 dict begin%
/x \ra\space def%
/y \rb\space def %
#7\space %
/vY exch def%
/vX exch def%
}%
\pscustom{%
\code{%
vX 0 ne vY 0 ne or{
\fcLineFormatCode
[x y] [x vX add y vY add] \fcArrowHeadAndTailPlotCode
}if%
}%
}%
\pscircle*[linecolor=red](! x y){0.02}%
\pstVerb{end}%
}%end multido
}%end multido
}%

\newcommand{\fcGrid}[8][]{%
\setkeys{fcGraphics}{#1}%
\pscustom{%
\code{%
20 dict begin
/startX #2\space def
/startY #3\space def
/iterationsX #4\space def
/iterationsY #5\space def
/DeltaX #6\space def
/DeltaY #7\space def
/stickyPiece (#8) () eq (#8) ( ) eq or {0}{#8}ifelse def
\fcLineFormatCode
/counterX -1 def
iterationsX 1 add{
/counterX counterX 1 add def
/currentX1 counterX DeltaX mul startX add def
/currentY1 0        stickyPiece sub DeltaY mul startY add def
/currentY2 iterationsY stickyPiece add DeltaY mul startY add def
/currentX2 currentX1 def
newpath 
[currentX1 currentY1] \fcCoordsPStricksToPS moveto
[currentX2 currentY2] \fcCoordsPStricksToPS lineto
stroke
} repeat
/counterY -1 def
iterationsY 1 add{
/counterY counterY 1 add def
/currentX1 0        stickyPiece sub DeltaX mul startX add def
/currentY1 counterY DeltaY mul startY add def
/currentY2 currentY1 def
/currentX2 iterationsX stickyPiece add DeltaX mul startX add def
newpath 
[currentX1 currentY1] \fcCoordsPStricksToPS moveto
[currentX2 currentY2] \fcCoordsPStricksToPS lineto
stroke
} repeat
end
}%
}%
}

\newcommand{\fcVectorFieldAlongSurfaceInScene}[8][ ]{%
\setkeys{fcGraphics}{#1}%
\fcSurfaceInScene[#1]{#2}{#3}{#4}{#5}{#6}{#7}%
\pstVerb{%
/theIIIdObjects [theIIIdObjects \fcArrayToStack 
30 dict begin
/theField {#8} def
/theSurfaceObject exch def
theSurfaceObject \fcArrayToStack pop \fcSurfaceInit
/DeltaU uMax uMin sub uIterations div def
/DeltaV vMax vMin sub vIterations div def
/counterU -1 def %
uIterations{
/counterU counterU 1 add def
/counterV -1 def %
vIterations{
/counterV counterV 1 add def
/u DeltaU counterU 0.5 add mul uMin add def
/v DeltaV counterV 0.5 add mul vMin add def
/lineStart theSurface def
/lineEnd theSurface theField \fcVectorPlusVector def
[0 1 [lineEnd lineStart {1 t sub \fcVectorTimesScalar exch t \fcVectorTimesScalar \fcVectorPlusVector} \fcArrayToStack] cvx \fcContourOptions (curve)]
}repeat
}repeat
end
] def
}%
}


\usepackage[T1]{fontenc}
% Or whatever. Note that the encoding and the font should match. If T1
% does not look nice, try deleting the line with the fontenc.

\graphicspath{{../../modules/}}

\newcommand{\lect}[4]{
\ifnum#3=\currentLecture
  \date{#1}
  \lecture[#1]{#2}{#3}
#4
\else
%include nothing
\fi
}

\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}
  \end{beamercolorbox}}%
  \vskip0pt%
}

\setbeamertemplate{navigation symbols}{}


\renewcommand{\Arcsin}{\arcsin}
\renewcommand{\Arccos}{\arccos}
\renewcommand{\Arctan}{\arctan}
\renewcommand{\Arccot}{\text{arccot\hspace{0.03cm}}}
\renewcommand{\Arcsec}{\text{arcsec\hspace{0.03cm}}}
\renewcommand{\Arccsc}{\text{arccsc\hspace{0.03cm}}}


% If you have a file called "university-logo-filename.xxx", where xxx
% is a graphic format that can be processed by latex or pdflatex,
% resp., then you can add a logo as follows:

%\pgfdeclareimage[height=0.8cm]{logo}{bluelogo}
%\logo{\pgfuseimage{logo}}

\begin{document}

\AtBeginLecture{%

\title[\insertlecture]{Math 141}
\subtitle{\insertlecture}
\author[Math 141]{Greg Maloney  \\~\\  Todor Milev}
\institute[UMass Boston]{University of Massachusetts Boston}
\date{\insertshortlecture}
\begin{frame}
  \titlepage
\end{frame}

\begin{frame}{Outline}
  \tableofcontents[pausesections]
\end{frame}
}%

% begin lecture
\lect{Spring 2015}{Lecture  (not covered in class)}{-1}{
\section{Exponential Functions and logarithms, Review}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/exponential-functions/exponential-function-def.tex
% begin module exponential-function-def
\begin{frame}
\frametitle{ %(1.2)
Exponential Functions}
The function $f(x) = 2^x$ is called an exponential function because the variable $x$ is the exponent.
\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=0.8cm, yunit=0.8cm}
\begin{pspicture}(-2.5,-0.5)(2.5,6.25)
\psframe*[linecolor=white](-2.5,-0.5)(2.5,6.25)
\psaxes[labels=none]{<->}(0,0)(-2.5,-0.5)(2.5,6.25)
\rput[t](1, -0.2){$1$}
\uncover<3->{
\fcFullDot{2}{4}
}
\uncover<5->{
\fcFullDot{1}{2}
}
\uncover<7->{
\fcFullDot{0}{1}
}
\uncover<9->{
\fcFullDot{-1}{0.5}
}
\uncover<11->{
\fcFullDot{-2}{0.25}
}
\uncover<12->{
\rput[r](-0.5, 1.5){$y=2^x$}
%Function formula: 2^{x}
\psplot[linecolor=red, plotpoints=1000]{-2.5}{2.5}{2 x exp }
}
\end{pspicture}
%\only<handout:0| -2>{%
%\includegraphics[height=6cm]{exponential-functions/pictures/twoxa.pdf}%
%}%
%\only<handout:0| 3-4>{%
%\includegraphics[height=6cm]{exponential-functions/pictures/twoxb.pdf}%
%}%
%\only<handout:0| 5-6>{%
%\includegraphics[height=6cm]{exponential-functions/pictures/twoxc.pdf}%
%}%
%\only<handout:0| 7-8>{%
%\includegraphics[height=6cm]{exponential-functions/pictures/twoxd.pdf}%
%}%
%\only<handout:0| 9-10>{%
%\includegraphics[height=6cm]{exponential-functions/pictures/twoxe.pdf}%
%}%
%\only<handout:0| 11>{%
%\includegraphics[height=6cm]{exponential-functions/pictures/twoxf.pdf}%
%}%
%\only<handout:1| 12->{%
%\includegraphics[height=6cm]{exponential-functions/pictures/twoxg.pdf}%
%}%


\column{.5\textwidth}
\[
\begin{array}{r|l}
x & y\\
\hline
\alert<handout:0| 2-3>{2} & \alert<handout:0| 3>{\uncover<3->{4}} \\
\alert<handout:0| 4-5>{1} & \alert<handout:0| 5>{\uncover<5->{2}} \\
\alert<handout:0| 6-7>{0} & \alert<handout:0| 7>{\uncover<7->{1}} \\
\alert<handout:0| 8-9>{-1} & \alert<handout:0| 9>{\uncover<9->{1/2}} \\
\alert<handout:0| 10-11>{-2} & \alert<handout:0| 11>{\uncover<11->{1/4}}
\end{array}
\]
\uncover<13->{
\begin{definition}[Exponential Function]
An exponential function is a function of the form $f(x) = a^x$, where $a$ is a positive constant.
\end{definition}
}
\end{columns}
\end{frame}
% end module exponential-function-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/exponential-functions/exponential-function-graphs.tex
% begin module exponential-function-graphs
\begin{frame}
\begin{center}
Graphs of various exponential functions.

\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-5, -5)(5,5) 
\psframe*[linecolor=white](-5,-5)(5,5) 
\psaxes[labels=none]{<->}(0,0)(-2.1,-0.2)(2.1,3.5)
\uncover<1->{
\rput[r](1.8, 2.3){$y=2^x$}
%Function formula: 2^{x} 
\psplot[linecolor=red, plotpoints=1000]{-2}{1.584962501}{2 x exp }
}
\uncover<2->{
\rput[l](1.2, 3.1){$y=4^x$}
%Function formula: 4^{x} 
\psplot[linecolor=black, plotpoints=1000]{-2}{0.79248125}{4 x exp }
}
\uncover<3->{
\rput[b](0.4, 3.05){$y=10^x$}
%Function formula: 4^{x} 
\psplot[linecolor=blue, plotpoints=1000]{-2}{0.477121255}{10 x exp }
}
\uncover<4->{
\rput[l](1.15, 1.5){$y=1.5^x$}
%Function formula: 4^{x} 
\psplot[linecolor=green, plotpoints=1000]{-2}{2}{1.5 x exp }
}
\uncover<5->{
\rput[l](-1.9, 2){$y=0.5^x$}
%Function formula: 4^{x} 
\psplot[linecolor=purple, plotpoints=1000]{-1.584962501}{2}{0.5 x exp }
}
\uncover<6->{
\rput[l](-1.2, 3.1){$y=0.25^x$}
%Function formula: 4^{x} 
\psplot[linecolor=brown, plotpoints=1000]{-0.79248125}{2}{0.25 x exp }
}
\end{pspicture}
\pause\pause\pause\pause\pause
%\ \only<handout:0| -1>{%
%\includegraphics[height=6cm]{exponential-functions/pictures/07-02-manyexpa.pdf}%
%}%
%\only<handout:0| 2>{%
%\includegraphics[height=6cm]{exponential-functions/pictures/07-02-manyexpb.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[height=6cm]{exponential-functions/pictures/07-02-manyexpc.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[height=6cm]{exponential-functions/pictures/07-02-manyexpd.pdf}%
%}%
%\only<handout:0| 5>{%
%\includegraphics[height=6cm]{exponential-functions/pictures/07-02-manyexpe.pdf}%
%}%
%\only<6->{%
%\includegraphics[height=6cm]{exponential-functions/pictures/07-02-manyexpf.pdf}%
%}%

\end{center}
\end{frame}
% end module exponential-function-graphs



\section{Derivatives of Exponential Functions}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/exponential-functions/exponential-function-derivative.tex
% begin module exponential-function-derivative
\begin{frame}
\frametitle{Derivatives of Exponential Functions}
Compute the derivative of $f(x) = a^x$ using the definition:
\begin{align*}
\uncover<2->{f'(x) = \lim_{h\to 0} \frac{f(x+h)-f(x)}{h}} & \uncover<3->{=}  \uncover<3->{\lim_{h\to 0} \frac{\alert<handout:0| 4>{a^{x+h}}-a^x}{h}}\\
 & \uncover<4->{=}  \uncover<4->{\lim_{h\to 0} \frac{\alert<handout:0| 5>{\alert<handout:0| 4>{a^x a^h}-a^x}}{h}}\\
 & \uncover<5->{=}  \uncover<5->{\lim_{h\to 0} \frac{\alert<handout:0| 5>{\alert<handout:0| 6>{a^x} (a^h- 1)}}{h}}\\
 & \uncover<6->{=}  \uncover<6->{\alert<handout:0| 6>{a^x} \alert<handout:0| 7>{\lim_{h\to 0} \frac{a^h- 1}{h}}}\\
 & \uncover<7->{=}  \uncover<7->{a^x \alert<handout:0| 7>{f'(0)}.}
\end{align*}
\end{frame}


\begin{frame}
We have shown that, if $f(x) = a^x$ is differentiable at 0, then it is differentiable everywhere, and
\[
f'(x) = f'(0)a^x .
\]
\uncover<2->{
We leave the following theorem without proof. 
\begin{theorem}
Let $a$ be a positive number and let $f(x)=a^x$. Then the limit \[f'(0)=\lim_{h\rightarrow 0}\frac{a^h - 1}{h}\] exists. 
\end{theorem}

In fact, it can be shown, as was/will be done in Calculus I that the limit above equals $\ln a$, i.e., $f'(0)=\ln(a)$. Here, $\ln$ is the natural logarithm function (was/will be defined in Calculus I).
}
\end{frame}
% end module exponential-function-derivative



\subsection{Natural Exponent}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/exponential-functions/natural-exponential-intro.tex
% begin module natural-exponential-intro
\begin{frame}
\frametitle{The Natural Exponential Function}
\begin{itemize}
\item  One base for an exponential function is especially useful.
\item<2->  It has a special property: its tangent line at $x = 0$ has slope $m=1$.
\item<3->  We call this number $e$, known as Euler's number or Napier's constant.
\item<4->  $e$ is a number between 2 and 3.  
\item<5-> In fact, $e = 1+1+\frac{1}{2!}+\frac{1}{3!} +\frac{1}{4!}+\dots\approx 2.71828$.  
\end{itemize}

\begin{columns}
\column{.3\textwidth}
\psset{xunit=1.3cm, yunit=1.3cm}
\begin{pspicture}(-1.4, -0.5)(1.4,2.6)
\psaxes[labels=none]{<->}(0,0)(-1.3, -0.5)(1.3,2.5)
\psplot[linecolor=red, plotpoints=1000]{-1.3}{1.3}{2 x exp}
\rput[r](-0.2, 1.1){\footnotesize $y=2^x$}
\rput[l](0.2, 0.8){\tiny $m\approx 0.693147$} 
\psline[linecolor=blue](-1.3,0.098908665)(1.3, 1.901091335)
\end{pspicture}
%\includegraphics[height=4cm]{exponential-functions/pictures/exp-tangent-two.pdf}%
\column{.3\textwidth}
\uncover<handout: 1|3->{%
\psset{xunit=1.3cm, yunit=1.3cm}
\begin{pspicture}(-1.4, -0.5)(1.4,2.6)
\psaxes[labels=none]{<->}(0,0)(-1.3, -0.5)(1.3,2.5)
\psplot[linecolor=red, plotpoints=1000]{-1.3}{0.901091335}{2.718281828 x exp}
\rput[r](-0.2, 1.1){\footnotesize $y=e^x$}
\rput[l](0.2, 0.8){\tiny $m=1$}
\psline[linecolor=blue](-1.3, -0.3)(1.3,2.3) 
\end{pspicture}
%\includegraphics[height=4cm]{exponential-functions/pictures/exp-tangent-e.pdf}%
}%
\column{.3\textwidth}
\psset{xunit=1.3cm, yunit=1.3cm}
\begin{pspicture}(-1.4, -0.5)(1.4,2.6)
\psaxes[labels=none]{<->}(0,0)(-1.3, -0.5)(1.3,2.5)
\psplot[linecolor=red, plotpoints=1000]{-1.3}{0.82020868}{3 x exp}
\rput[r](-0.2, 1.1){\footnotesize $y=3^x$}
\rput[l](0.2, 0.8){\tiny $m\approx 1.09861$} 
\psline[linecolor=blue](-1.3, -0.428195975)(1.3,2.428195975)
\end{pspicture}
%\includegraphics[height=4cm]{exponential-functions/pictures/exp-tangent-three.pdf}%
\end{columns}
\end{frame}
% end module natural-exponential-intro


%\input{../../modules/exponential-functions/e-def}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/exponential-functions/natural-exponential-def.tex
% begin module natural-exponential-def
\begin{frame}
\begin{definition}[Natural Exponential Function]
$e^x$ is called the natural exponential function.  Its derivative is
\[
\frac{\diff}{\diff x} e^x = e^x .
\]
\end{definition}
\end{frame}
% end module natural-exponential-def



\section{A More Advanced Approach to Exponents}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/exponential-functions/exponential-function-def-various-approaches.tex
% begin module exponential-def-various-approaches
\begin{frame}
\frametitle{Exponents overview}
\begin{itemize}
\item<1-> For integer $x$, we know how to compute $a^{x}$ as a function of $a$. 
\item<2-> However, how do we compute $f(x)=a^x$ when $x$ is not an integer?
\item<3-> We need to go back to the definition of $a^x$ (when $x$ is not an integer).
\item<4-> In what follows we give/recall the Calc I definition of exponent.
\item<5-> Then we give an alternative (but of course equivalent) second definition of exponent. The second definition is studied in detail by the end of Calculus II. 
\item<6-> We discuss pros and cons of the two definitions. In a nutshell: the Calc I definition is easier to motivate, the Calc II definition is easier to compute with.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Exponent definition using limits (approach I)}
\begin{itemize}
\item<1-> For integer $p$ we know to compute $a^p$.
\item<2-> Therefore for integer $q$ we know to compute $a^{\frac{1}{q}}= \sqrt[q]{a}=\max\{x|\text{~for~which~} x^q\leq a\}$.
\item<3-> Therefore we know to compute $a^{\frac{p}{q}}$ for all rational $\frac{p}{q}$.
\item<4-> We can then define
\[
a^x = \lim\limits_{\substack{y \to x \\ y\text{-rational}}} a^y 
\]
\item<5-> Not computationally effective. It is not how computers compute.
\item<6-> However is the easiest approach. $a^{x+y}=a^xa^y$ is easiest to prove (follows directly from the $\varepsilon, \delta$-definition of $\lim$).
\item<7->\alert<7->{This is the definition assumed in Calculus I.}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Exponent definition using series (approach II)}
\begin{itemize}
\item<1-> The following formula (studied at end of Calc II) can be used as alternative definition.
\[
e^{x}=\alert<4>{\sum_{n=0}^{\infty}} \frac{x^n}{\alert<2>{n!}}= 1+ x+\frac{x^2}{2!}+\frac{x^3}{3!}+\dots + \frac{x^{n}}{\alert<2>{n!}}+\dots
\]
\uncover<2->{\alert<2>{Here $n!=1\cdot 2\cdot 3\cdot\dots \cdot(n-1)\cdot n$ and is read ``$n$ factorial''. }}
\item<3-> For $|x|<1$ define 
\[
\ln (1+x)=\alert<4>{\sum_{n=1}^{\infty}} (-1)^{n+1}\frac{x^n}{n}=  x-\frac{x^2}{2}+\frac{x^3}{3}-\dots + \frac{(-1)^{n+1}x^{n}}{n}+\dots
\]
\uncover<4->{\alert<4>{Infinite sum studied in Calc II.}} 
\item<5-> For arbitrary $a>0$ define $a^x$ as $a^x=e^{x\ln a}$. 
\item<6-> Disadvantage: more difficult to prove $e^{x+y}=e^{x}e^y$ and $e^{\ln(1+x)}=1+x$, proof done in Calculus II.
\item<7-> This is how computers compute $e^x$ and $a^x$.
\end{itemize}
\end{frame}

% end module exponential-def-various-approaches



\subsection{Derivative using series definition}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/derivatives-computation-understanding/exponent-derivative-from-taylor-series.tex
% begin module power-rule-rationa-from-chain-rule
\begin{frame}

\begin{example}
Derive \alert<11>{the exponent rule $\left(e^x\right)'=e^x$} \uncover<2->{using the Calc II formula below,} \uncover<3->{ \alert<3>{the infinite} {\color{gray!50} (both sides uniformly convergent)} \alert<3>{sum rule $(f_1+f_2 +f_3 +\dots)' =f_1' +f_2'  +f_3' +\dots$}}
\uncover<4->{and \alert<4>{the power rule $(x^n)'=nx^{n-1}$}. } 
\uncover<2->{\[
\alert<2,10>{e^x}=\alert<2,10>{1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\dots},
\]
}
\uncover<2->{where $n!=1\cdot2\cdot3\cdot \dots\cdot n$.} \uncover<5->{We have that $\alert<5,9>{\frac{n}{\alert<6>{ n!}}} =\uncover<6->{ \frac{\alert<7>{n} }{ \alert<6>{ 1\cdot 2\cdot \dots\cdot (n-1) \cdot  \alert<7>{n}}}=}\uncover<7->{\frac{1}{\alert<8>{1\cdot 2\cdot \dots\cdot (n-1)}}=}\uncover<8->{\alert<9>{ \frac{1}{ \alert<8>{(n-1)!} }}} $.}
\[
\begin{array}{rcl}
\uncover<2->{\alert<11>{\left(\alert<2>{e^x}\right)'} &=&\alert<3>{\left(\alert<2>{1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\dots} \right)' }} \\
\uncover<3->{&=& \alert<3>{ \alert<4>{(1)'}+\alert<4>{(x)'}+\frac{\alert<4>{(x^2)'}}{2!} +\frac{\alert<4>{(x^3)'}}{3!}+\dots + \frac{\alert<4>{(x^n)'}}{n!}+\dots}}
\\ \uncover<4->{&=&\alert<4>{0}+ \alert<4>{1}+ \frac{\alert<4>{\alert<5-9>{2}x}}{\alert<5-9>{2!}}+ \frac{\alert<4>{\alert<5-9>{3}x^2}}{\alert<5-9>{3!}}+ \dots +\frac{\alert<4>{\alert<5-9>{n}x^{n-1}}}{\alert<5-9>{n!}}+\dots }\\
\uncover<9->{&=& \alert<10>{ \phantom{ 0~ + }  1 + \frac{\phantom{2}x}{\alert<9>{1!}}+\frac{\phantom{3}x^{2}}{\alert<9>{2!}}+\dots+\frac{\phantom{n}x^{n-1}}{\alert<9>{(n-1)!}}+\dots}=}\uncover<10->{\alert<10,11>{e^x}}\\
\end{array}
\]
\uncover<11->{\alert<11>{as desired.}}
\end{example}

\end{frame}

%end module power-rule-rationa-from-chain-rule


\section{Logarithmic Functions, Review}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/logarithm-def.tex
% begin module logarithm-def
\begin{frame}
\frametitle{Logarithmic Functions}
\begin{columns}[c]
\column{.3\textwidth}
\psset{xunit=0.7cm, yunit=0.7cm}
\begin{pspicture}(-2,-2.1)(4.2, 4.2)
\psframe*[linecolor=white](-2,-2.1)(4.2, 4.2)
\psaxes[ticks=none, labels=none]{<->}(0,0)(-2,-2.1)(4.2, 4.2)
\psline(-0.1, 1)(0.1,1)
\rput[r](-0.2, 1){\footnotesize$1$}
\rput(0.9, 3){\footnotesize$y=a^x$}
%Function formula: 2^{x} 
\psplot[linecolor=red, plotpoints=1000]{-2}{2}{2 x exp }
\uncover<8->{
\psplot[linecolor=red, plotpoints=1000]{0.25}{4}{x ln 0.693147181 div }
\psline[linestyle=dashed, linecolor=blue](-1.9, -1.9)(4,4) 
\rput[tl](2, 0.7){\footnotesize$y=\log_ax$}
}
\end{pspicture} 
%\ \only<handout:0| -7>{%
%\includegraphics[height=4cm]{logarithms/pictures/07-03-logandexpa.pdf}%
%}%
%\only<8->{%
%\includegraphics[height=4cm]{logarithms/pictures/07-03-logandexpb.pdf}%
%}%
\column{.7\textwidth}
\begin{itemize}
\item  Suppose $a > 0$, $a\neq 1$.
\item<2->  Let $f(x) = a^x$.
\item<3->  Then $f$ is either increasing or decreasing.
\item<4->  Therefore $f$ is one-to-one.
\item<5->  Therefore $f$ has an inverse function, $f^{-1}$.
\item<7->  The graph shows $y = a^x$ for $a > 1$.
\item<8->  The graph of $y = \log_a x$ is the reflection of this in the line $y = x$.
\end{itemize}
\end{columns}
\uncover<6->{%
\begin{definition}[$\log_a x$]
The inverse function of $f(x) = a^x$ is called the logarithmic function with base $a$, and is written $\log_a x$.  It is defined by the formula
\[
\log_a x = y \qquad \Leftrightarrow \qquad a^y = x .
\]
\end{definition}
}%
\end{frame}
% end module logarithm-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/logarithm-def-ex1.tex
% begin module logarithm-def-ex1
\begin{frame}
If $x > 0$, then $\log_a x$ is the exponent to which the base $a$ must be raised to give $x$.
\begin{example}%[Example 1, p. 405]
Evaluate:
\begin{enumerate}
\item<1-| alert@2-3> $\log_3 81 =$ \uncover<3->{$4$ because $3^4 = 81$.}
\item<1-| alert@4-5> $\log_{25} 5 =$ \uncover<5->{$\frac{1}{2}$ because $25^{1/2} = 5$.}
\item<1-| alert@6-7> $\log_{10} 0.001 =$ \uncover<7->{$-3$ because $10^{-3} = 0.001$.}
\end{enumerate}
\end{example}
\end{frame}
% end module logarithm-def-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/log-and-exp.tex
% begin module log-and-exp
\begin{frame}
\begin{columns}[c]
\column{.6\textwidth}
\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-2,-2.1)(4.2, 4.2)
\psaxes[ticks=none, labels=none]{<->}(0,0)(-2,-2.1)(4.2, 4.2)
\psline(-0.1, 1)(0.1,1)
\rput[r](-0.2, 1){\footnotesize$1$}
\rput(0.9, 3){\footnotesize$y=a^x$}
%Function formula: 2^{x} 
\psplot[linecolor=red, plotpoints=1000]{-2}{2}{2 x exp }
\psplot[linecolor=red, plotpoints=1000]{0.25}{4}{x ln 0.693147181 div }
\psline[linestyle=dashed, linecolor=blue](-1.9, -1.9)(4,4) 
\rput[tl](2, 0.7){\footnotesize$y=\log_ax$}
\rput[tl](-1, -1.1){\footnotesize$y=x$}
\end{pspicture} 
%\includegraphics[height=7cm]{logarithms/pictures/07-03-logandexpb.pdf}%
\column{.4\textwidth}
\begin{itemize}
\item  Suppose $a > 1$.
\item<2-| alert@3-4>  Domain of $a^x$: \uncover<4->{$\mathbb{R}$.}
\item<2-| alert@5-6>  Range of $a^x$: \uncover<6->{$(0, \infty )$.}
\item<2-| alert@7-8>  Domain of $\log_a x$: \uncover<8->{$(0, \infty )$.}
\item<2-| alert@9-10>  Range of $\log_a x$: \uncover<10->{$\mathbb{R}$.}
\item<11->  $\log_a (a^x) = x$ for $x\in \mathbb{R}$.
\item<11->  $a^{\log_a x} = x$ for $x > 0$.
%\item<12-| alert@13-14>  $\lim_{x\rightarrow \infty}\log_a x = \uncover<14->{\infty .}$
%\item<12-| alert@15-16>  $\lim_{x\rightarrow 0^+}\log_a x = \uncover<16->{-\infty .}$
\end{itemize}
\end{columns}
\end{frame}
% end module log-and-exp



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/logarithm-graphs.tex
% begin module logarithm-graphs
\begin{frame}
\begin{center}
Graphs of various logarithmic functions with $a > 1$
\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-0.5,-4.5)(7.5,3.2)
\psaxes[ticks=none, labels=none]{<->}(0,0)(-0.5,-4.5)(7.5,3.2)
\psline(1,-0.1)(1,0.1)
%Function formula: ln(x)/ln(2)
\psplot[linecolor=red, plotpoints=1000]{0.044194174}{7.5}{x ln 0.693147181 div}
\rput[r](3, 1.8){\footnotesize $y=log_2 x$}
\uncover<2->{
%Function formula: ln{x}/ln(3) 
\psplot[linecolor=black, plotpoints=1000]{0.007127781}{7.5}{x ln 1.098612289 div}
\rput[l](3.6, 1.6 ){\footnotesize $y=log_3 x$}
}
\uncover<3->{
%Function formula: ln{x}/ln(5) 
\psplot[linecolor=blue, plotpoints=1000]{0.000715542}{7.5}{x ln 1.609437912 div}
\rput[l](3.7, 1.1){\footnotesize $y=log_5 x$}
}
\uncover<4->{
%Function formula: ln{x}/ln(5) 
\psplot[linecolor=green, plotpoints=1000]{0.000031623}{7.5}{x ln 2.302585093 div}
\rput[tl](3.6, 0.6){\footnotesize $y=log_{10} x$}
}
%\rput(6, 1){\color{red!1} .}
\end{pspicture} 
%\ \only<handout:0| -1>{%
%\includegraphics[height=6cm]{logarithms/pictures/07-03-manylogsa.pdf}%
%}%
%\only<handout:0| 2>{%
%\includegraphics[height=6cm]{logarithms/pictures/07-03-manylogsb.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[height=6cm]{logarithms/pictures/07-03-manylogsc.pdf}%
%}%
%\only<4->{%
%\includegraphics[height=6cm]{logarithms/pictures/07-03-manylogsd.pdf}%
%}%
\pause\pause\pause
\end{center}
\end{frame}
% end module logarithm-graphs


\subsection{Natural Logarithms}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/natural-logarithm-def.tex
% begin module natural-logarithm-def
\begin{frame}
\frametitle{Natural Logarithms}
\begin{definition}[$\ln x$]
The logarithm with base $e$ is called the natural logarithm, and has a special notation:
\[
\log_e x = \ln x .
\]
\end{definition}
\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=0.6cm, yunit=0.6cm}
\begin{pspicture}(-4.2,-4.2)(4.2, 4.2)
\psframe*[linecolor=white](-4.2,-4.2)(4.2, 4.2)
\psaxes[ticks=none, labels=none]{<->}(0,0)(-4.2,-4.2)(4.2, 4.2)
\psline(-0.1, 1)(0.1,1)
\rput[r](-0.2, 1){\footnotesize$1$}
\psline(1, -0.1)(1,0.1)
\rput[t](1, -0.2){\footnotesize$1$}
\rput[l](1.3, 3.2){\footnotesize$y=e^x$}
%Function formula: 2^{x} 
\psplot[linecolor=red, plotpoints=1000]{-4}{1.386294361}{2.718281828 x exp }
\psplot[linecolor=red, plotpoints=1000]{0.018315639}{4}{x ln}
\psline[linestyle=dashed, linecolor=blue](-4, -4)(4,4) 
\rput[tl](2, 0.7){\footnotesize$y=\ln x$}
\rput[tl](-2, -2.3){\footnotesize$y=x$}
\end{pspicture} 
%\ \includegraphics[height=5cm]{logarithms/pictures/07-03-natlog.pdf}%
\column{.5\textwidth}
\begin{itemize}
\item<2->  $\ln x = y \qquad \Leftrightarrow \qquad e^y = x$ .
\item<3->  $\ln (e^x ) = x$ for $x\in \mathbb{R}$.
\item<4->  $e^{\ln x}  = x$ for $x > 0$.
\end{itemize}
\end{columns}
\end{frame}
% end module natural-logarithm-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/logarithm-properties.tex
% begin module logarithm-properties
\begin{frame}
\begin{theorem}[Properties of Logarithmic Functions]
If $a > 1$, the function $f(x) = \log_a x$ is a one-to-one, continuous, increasing function with domain $(0, \infty )$ and range $\mathbb{R}$.  If $x, y, a, b > 0$ and $r$ is any real number, then
\begin{enumerate}
\item  $\log_a (xy) = \log_a x + \log_a y$.
\item  $\log_a \left( \frac{x}{y}\right) = \log_a x - \log_a y$.
\item  $\log_a (x^r) = r\log_a x$.
% The next two are redundant
%\item  $\log_{\frac{1}{a}}x=-\log_a x$
%\item  $\log_{a}b=\frac{1}{\log_b a}$
\item  $\log_{a}(x)=\log_b x \log_{a} b=\frac{\log_b x}{\log_{b} a}=  \frac{\ln x}{\ln a}$
\end{enumerate}
\end{theorem}
\end{frame}
% end module logarithm-properties



%\input{../../modules/logarithms/natural-logarithm-def-ex8}
%\input{../../modules/inverse-functions/inverse-function-solve-for-ex2-freeCalc}
\section{Derivatives of Logarithms, Review}
\subsection{The Natural Logarithm}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/natural-logarithm-derivative.tex
% begin module natural-logarithm-derivative
\begin{frame}
\frametitle{The Derivative of the Natural Logarithm}
\begin{theorem}[The Derivative of $\ln x$]
\[
\frac{\diff}{\diff x} (\ln x) = \frac{1}{x} .
\]
\end{theorem}
\begin{proof}
\begin{itemize}
\item<2->  Let $\alert<handout:0| 8,10>{y = \ln x}$.
\item<3->  Then $e^y = x$.
\item<4->  Differentiate this implicitly with respect to $x$:
\item<5->  $e^y \frac{\diff y}{\diff x} = 1$.
\item<6->  Rearrange:
\item<7->  $\uncover<10->{\frac{\diff}{\diff x} (\alert<handout:0| 10>{\ln x}) = } \frac{\diff \alert<handout:0| 10>{y}}{\diff x} = \frac{1}{e^{\alert<handout:0| 8>{y}}} \uncover<8->{ = \frac{1}{e^{\alert<handout:0| 8>{\ln x}}}} \uncover<9->{ = \frac{1}{x}.}$
\end{itemize}
\end{proof}
\end{frame}
% end module natural-logarithm-derivative



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/natural-logarithm-derivative-ex1.tex
% begin module natural-logarithm-derivative-ex1
\begin{frame}
\chainruley{\ln (x^3+1)}{x^3+1}{\ln u}{\frac{1}{UU}}{3x^2}{\frac{3x^2}{UU}}{ %Example 1, p. 222
}
\end{frame}
% end module natural-logarithm-derivative-ex1



\subsection{The Number $e$ as a Limit}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/e-limit.tex
% begin module e-limit
\begin{frame}
\frametitle{The Number $e$ as a Limit}
\begin{theorem}[The Number $e$ as a Limit]
\[
e = \lim_{x\rightarrow 0} (1 + x)^{\frac{1}{x}} = \lim_{y\to \infty} \left(1+\frac{1}{y}\right)^y.
\]
\end{theorem}
\begin{proof}
\uncover<2->{Let $f(x) = \ln x$.  }%
\uncover<3->{Then $f'(x) = 1/x$, so $f'(1) = 1$.}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\uncover<4->{\alert<handout:0| 10>{1} = f'(1)} & \uncover<4->{=} %
\uncover<4->{\lim_{h\rightarrow 0}\frac{f(1+h)-f(1)}{h}}%
\uncover<5->{ = \lim_{x\rightarrow 0}\frac{f(1+x)-f(1)}{x}}\\%
& \uncover<6->{=}  %
\uncover<6->{\lim_{x\rightarrow 0}\frac{\ln (1+x)-\ln (1)}{x}}%
\uncover<7->{ = \lim_{x\rightarrow 0}\frac{1}{x}\ln (1 + x)}\\%
& \uncover<8->{\alert<handout:0| 10>{=}}  %
\uncover<8->{\alert<handout:0| 10>{\lim_{x\rightarrow 0}\ln (1+x)^{1/x}}.}
\end{align*}
\uncover<9->{Then use the fact that \alert<handout:0| 11>{the exponential function is continuous}:}
\[
\uncover<9->{e = e^{\alert<handout:0| 10>{1}} =}%
\uncover<10->{\alert<handout:0| 11>{e^{\alert<handout:0| 10>{\lim_{x\rightarrow 0}\ln (1+x)^{1/x}}} =}}%
\uncover<11->{\alert<handout:0| 11>{\lim_{x\rightarrow 0}e^{\ln (1+x)^{1/x}}} =}%
\uncover<12->{\lim_{x\rightarrow 0} (1+x)^{1/x}.}\qedhere
\]
\end{proof}
\end{frame}
% end module e-limit



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/e-limit-problems-ex1.tex
%begin module e-limit-problems-ex1
\begin{frame}
\begin{example}
Compute 
\[
\begin{array}{rcll|l}
\displaystyle\lim\limits_{x\to \infty}\left(\alert<2>{ \frac{x+3}{x}} \right)^x 
\uncover<2->{
&=&\displaystyle  \lim\limits_{x\to \infty} \left(\alert<2>{1 +\alert<3>{\frac{3}{x}} } \right)^{\alert<4>{x}} } \\
\uncover<3->{&=& \displaystyle \lim\limits_{x\to \infty}\left(1+\frac{1}{\alert<3,6>{ \frac{x}{3}} }\right)^{\alert<4>{3\alert<6>{\frac{x}{3}}} } } \uncover<5->{ && \text{Set } \alert<6>{\frac{x}{3}=y}}\\
\uncover<6->{&=&\displaystyle \lim\limits_{\substack{\alert<7>{x\to \infty} \\ \uncover<7->{\alert<7>{\frac{x}{3}=y\to \infty} } }}\left(1+\frac{1}{\alert<6>{y}}\right)^{\alert<8>{3\alert<6>{y}}} } \\
\uncover<8->{ &=&\displaystyle \alert<9,10>{ \alert<11>{\lim\limits_{y\to \infty}}\left(\alert<11>{\left(1+\frac{1}{y}\right)^{\alert<8>{y}}}\right)^{\alert<8>{3}}}} \uncover<9->{\alert<9,10>{=}}\uncover<10->{\alert<10>{\alert<11>{ e}^3} \quad .} 
\end{array}
\]

\end{example}
\end{frame}
\begin{frame}
\begin{example}
Compute 
\[
\begin{array}{rll|l}
&\displaystyle \lim_{x\to \infty} \left(\frac{\alert<2>{x}}{x-2} \right)^{2x+2}\\
\uncover<2->{ =&\displaystyle
\lim\limits_{x\to \infty}\left(\alert<3>{ \frac{\alert<2>{x-2 +2}} {x-2} } \right)^{2x+2}}
\uncover<3->{= \lim\limits_{x\to \infty}\left(\alert<3>{1+\alert<4>{\frac{2}{x-2}} } \right)^{2\alert<5>{x}+2}} \\
\uncover<4->{=&\displaystyle \lim\limits_{x\to \infty} \left( 1+ \alert<4>{\frac{1}{ \frac{x-2}{2}}} \right)^{\alert<6>{ 2( \alert<5>{ x-2+2} )+2}} }\\
\uncover<6->{ =&\displaystyle \lim\limits_{x\to \infty} \left( 1+ \frac{1}{ \alert<8>{ \frac{x-2}{2}} } \right)^{ \alert<6>{ 4\alert<8>{\frac{x-2}{2}} +6}}} \uncover<8->{= \lim \limits_{\substack{ \alert<8>{\frac{ x-2 }{2}
= y} \\ y\to\infty}} {\alert<9,10>{\left(1+\frac{1}{\alert<8>{ y} }\right)}}^{\alert<9>{4\alert<8>{y}} +\alert<10>{6}} } \uncover<7->{&& \alert<7>{\text{Set } \alert<8>{y=\frac{x-2}{2}} }}\\
\uncover<9->{=& \displaystyle \alert<12>{ \lim\limits_{y\to \infty} }  \alert<9>{ \left( \alert<12>{\left(1+\frac{1}{y} \right)^{y}}\right)^4} \alert<13>{\lim\limits_{ y\to\infty}} \alert<10>{\left(1+\alert<13>{\frac{1}{y}} \right)^6} } \\ \uncover<11->{ =&\alert<14>{ \alert<12>{e}^4\cdot (1+\alert<13>{0})^6}}\uncover<14->{
= \alert<14>{e^4} \quad . }
\end{array}
\]

\end{example}
\end{frame}
%end module e-limit-problems-ex1



\subsection{Derivatives of Exponents with Arbitrary Base}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/general-exponential-derivative.tex
% begin module general-exponential-derivative
\begin{frame}
\begin{theorem}[The Derivative of $a^x$]
\[
\frac{\diff}{\diff x} (a^x) = a^x \ln a .
\]
\end{theorem}
\begin{proof}
\uncover<2->{
Use the fact that $\alert<handout:0| 4,8>{a = e^{\ln a}}$.
}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\uncover<3->{\frac{\diff}{\diff x} (\alert<handout:0| 4>{a}^x)}%
& \uncover<3->{ = }  %
\uncover<4->{\frac{\diff}{\diff x} \left((\alert<handout:0| 4>{e^{\ln a}})^x\right) }\\%
& \uncover<5->{ = }  %
\uncover<5->{\frac{\diff}{\diff x}\left( e^{x\ln a}\right)}\\%
& \uncover<6->{ = }  %
\uncover<6->{ e^{x\ln a}\frac{\diff}{\diff x}(x\ln a) }\\%
& \uncover<7->{ = }  %
\uncover<7->{ (\alert<handout:0| 8>{e^{\ln a}})^x\ln a }\\%
& \uncover<8->{ = }  %
\uncover<8->{ \alert<handout:0| 8>{a}^x(\ln a).}%
\end{align*}
\end{proof}
\end{frame}
% end module general-exponential-derivative



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/general-exponential-derivative-ex13.tex
% begin module general-exponential-derivative-ex13
\begin{frame}
\chainruley{10^{x^2}}{x^2}{10^u}{10^{UU}(\ln 10)}{2x}{(2\ln 10)x10^{UU}}{0}
\end{frame}
% end module general-exponential-derivative-ex13



\subsection{Derivatives of Arbitrary Exponents with Arbitrary Base}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/arbitrary-base-arbitrary-exponent-derivative-ex1.tex
\begin{frame}
\begin{example}
Compute $\frac{\diff}{\diff x} \left((\tan x)^{\frac{1}{x}} \right)$,  where $x\in (0,\frac{\pi}{2})$.

\[
\begin{array}{rcl}
\uncover<2->{\displaystyle  \frac{\diff }{\diff x} \left((\alert<3>{\tan x})^{\frac{1}{x}} \right)&=&} \uncover<3->{ \displaystyle \frac{\diff }{\diff x} \left( (\alert<3>{e^{\alert<4>{\ln \tan x} }})^{ \alert<4>{\frac{1}{x}} } \right)}  \uncover<4->{=\frac{\diff }{\diff x} \left( e^{\alert<4>{\frac{1}{x}\ln \tan x}} \right)}\\
\uncover<5->{ &=&\displaystyle  \alert<6>{e^{\frac{1}{x} \ln (\tan x)}} \alert<7,8>{\frac{\diff }{\diff x}\left(\frac{1}{x} \ln( \tan x) \right)}} \\
\uncover<6->{&=&\displaystyle  \alert<6>{ (\tan x)^{\frac{1}{x}}}\alert<7,8>{ \left( \uncover<8->{ -\frac{1}{x^2} \ln (\tan x) +\frac{1}{x} \frac{(\tan x)' }{\tan x}}\right)}} \\
\uncover<9->{&=&\displaystyle (\tan x)^{\frac{1}{x}} \left( -\frac{1}{x^2} \ln (\tan x) +\frac{1}{x} \frac{\frac{1}{\cos^2(x)}}{\frac{\sin x}{\cos x}}\right)}\\
\uncover<10->{&=&\displaystyle (\tan x)^{\frac{1}{x}} \left( -\frac{1}{x^2} \ln (\tan x) +\frac{1}{x} \frac{1}{\sin x \cos x}\right)}
\end{array}
\]
\end{example}

\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/arbitrary-base-arbitrary-exponent-derivative.tex
% begin module arbitrary-base-arbitrary-exponent-derivative
\begin{frame}
\begin{example}
Suppose $g(x)$ and $f(x)$ are differentiable functions and suppose $g(x)>0$. Prove that
\[
\frac{\diff}{\diff x} \left(g(x)^{f(x)} \right)=g(x)^{f(x)} \left( f'(x) \ln (g(x)) + f(x)\frac{g'(x)}{g(x)}\right) \quad .
\]
\end{example}
\begin{proof}
\[
\begin{array}{rcl}
\displaystyle \frac{\diff }{\diff x} \left(g(x)^{f(x)} \right)&=&\displaystyle \frac{\diff }{\diff x} \left( \left(e^{\ln g(x)}\right)^{f(x)} \right)=\frac{\diff }{\diff x} \left(e^{f(x)\ln g(x)} \right)\\
&=&\displaystyle e^{f(x)\ln g(x)} \frac{\diff }{\diff x} (f(x) \ln g(x)) \\
&=&\displaystyle 
g(x)^{f(x)} \left( f'(x) \ln (g(x)) + f(x)\frac{g'(x)}{g(x)}\right)\quad ,
\end{array}
\]
as desired.
\end{proof}
\end{frame}
%end module arbitrary-base-arbitrary-exponent-derivative


} %end lecture


% begin lecture
\lect{Spring 2015}{Lecture  1}{1}{
\section{Review of trigonometry}
\subsection{The Trigonometric Functions}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trigonometry/trig-functions-unit-circle.tex
\begin{frame}
\frametitle{Geometric interpretation of all trigonometric functions}
\begin{columns}
\column{0.4\textwidth}
\psset{xunit=1.5cm,yunit=1.5cm}
\begin{pspicture}(-1.3,-2.6)(1.3,2.6)
\tiny
\rput[rb](-0.1,1){$1$}
%circle:
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-1.000000}{1.000000}{1 x 2 exp -1 mul add sqrt }
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-1.000000}{1.000000}{1 x 2 exp -1 mul add sqrt -1 mul }
\psline(1, -2.5)(1,2.5)

\uncover<2->{
\psline(0,0)(1,2)
}
\psline[linecolor=green](0,0)(0.447213595,0)

%angle:
\psaxes[ticks=none, labels=none]{<->}(0,0)(-1.2,-1.2)(1.2,1.2)

\uncover<2->{
\rput[lb](0.3, 0.2){\alert<2>{$\theta$}}
\psplot[plotpoints=1000]{0.134164079}{0.2999}{0.09 x 2 exp -1 mul add sqrt}
\rput[l](1.05,2){\alert<2>{$B$}}
\rput[bl](1.05,0.05){\alert<2>{$D$}}
}

\psline(0.95,0)(0.95, 0.05)(1,0.05)

\rput[tr](-0.1,-0.1){\alert<2>{$O$}}
\uncover<3->{
\rput[b](0.4,1){\alert<3>{$A$}}
}


\uncover<5->{
\psline[linecolor=blue](0.447213595, 0.894427191)(0.447213595,0)
\rput[tl](0.45,-0.05){$C$}
\psline(0.397213595,0)(0.397213595, 0.05)(0.447213595,0.05)
}

\uncover<6->{
\psline[linecolor=green](0,0)(0.447213595,0)
}
\uncover<7->{
\psline[linecolor=purple](1,0)(1,2)
}
\uncover<8->{
\psline[linecolor=cyan](1,0)(1,-0.5)
\rput[l](1.05,-0.5){$E$}
\psline[linecolor=black](0,0)(1,-0.5)
\psline(0.04472136,-0.02236068)(0.06708204,0.02236068) (0.02236068, 0.04472136)
}
\uncover<9->{
\psline[linecolor=magenta](0,0)(1,2)
}
\uncover<10->{
\psline[linecolor=orange](0,0)(1,-0.5)
}
\end{pspicture}
\column{0.6\textwidth}
On picture: circle of radius $1$ centered at point $O$ with coordinates $(0,0)$. \uncover<2->{Let \alert<2>{$\angle DOB=\theta$}.} \uncover<3->{\alert<3>{Let $OB$ intersect the circle at point $A$}.} \uncover<4->{Then the coordinates of $A$ are $(\color{green}\cos \theta \color{black},\color{blue}\sin\theta \color{black} )$.}

\medskip

\uncover<5->{ $\color{blue}\sin \theta \color{black} = \frac{|AC|}{|OA|} = \frac{|AC|}{1}=|AC| $.}

\uncover<6->{ $\color{green}\cos \theta \color{black} =\frac{|OC|}{|OA|}=\frac{|OC|}{1}= |OC| $.}

\uncover<7->{$\color{purple} \tan \theta\color{black} = \frac{|BD|}{|OD|}=\frac{|BD|}{1}=|BD|$.}

\uncover<8->{$\color{cyan} \cot \theta\color{black} = \frac{|DE|}{|OD|}=\frac{|DE|}{1}=|DE|$.}

\uncover<9->{$\color{magenta} \sec\theta \color{black} =\frac{|OB|}{|OD|}=\frac{|OB|}{1}=|OB|$.}

\uncover<10->{$ \color{orange}\csc\theta \color{black} =\frac{|OE|}{|DO|}=\frac{|OE|}{1}=|OE|$.}


\end{columns}
\end{frame}



\subsection{Trigonometric Identities}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trigonometry/trig-identities.tex
% begin module trig-identities
\begin{frame}
\frametitle{Trigonometric Identities}
\begin{definition}[Trigonometric Identity]
A trigonometric identity is a relationship among the trigonometric functions that is true for any value of the independent variable.
\end{definition}
\end{frame}

\newcommand{\trigIdentitiesPicture}{
\psset{xunit=1cm,yunit=1cm}
\begin{pspicture}(-4,-0.5)(1,4)
\psaxes[labels=none, ticks=none]{<->}(0,0)(-4,-0.5)(1,4)
\pscircle*(-3,2){0.07}
\psline[linecolor=blue](0,0)(-3,2)
\psline[linecolor=blue](0,0)(1,0)
\psarc[linecolor=red](0,0){0.5}{0}{146.3099}
\rput[br](-3, 2){$(x,y)$}
\rput[l](0.1, 0.7){$\theta$}
\rput[lb](-1.55, 1.1){$r$}
\psline[linestyle=dotted](-3, 2)(-3, 0)
\psline[linestyle=dotted](-3, 2)(0, 2)
\psline(-2.7, 0)(-2.7, 0.3)(-3, 0.3)
\psline(0, 1.7)(-0.3, 1.7)(-0.3, 2)
\end{pspicture}
%\includegraphics[width=5cm]{trigonometry/pictures/app-d-ratiosb.pdf}%
}

\begin{frame}
\begin{columns}[c]
\column{.45\textwidth}
\trigIdentitiesPicture
\[
\begin{array}{cc}
\sin \theta = \frac{ y}{ r} &
\csc \theta = \frac{ r}{ y} \\
\cos \theta = \frac{ x}{ r} &
\sec \theta = \frac{ r}{ x} \\
\tan \theta = \frac{ y}{ x} &
\cot \theta = \frac{ x}{ y} \\
\end{array}
\]

\vspace{3cm}
\column{.5\textwidth}
\begin{itemize}
\item $\csc \theta = \frac{1}{\sin \theta}$
\item $\sec \theta = \frac{1}{\cos \theta}$
\item $\cot \theta = \frac{1}{\tan \theta}$
\item $\tan \theta = \frac{\sin \theta}{\cos \theta}$
\item $\cot \theta = \frac{\cos \theta}{\sin \theta}$
\end{itemize}
\end{columns}
\end{frame}


\begin{frame}
\begin{columns}[c]
\column{.45\textwidth}
\trigIdentitiesPicture
\[
\begin{array}{cc}
\sin \theta = \frac{ y}{ r} &
\csc \theta = \frac{ r}{ y} \\
\cos \theta = \frac{ x}{ r} &
\sec \theta = \frac{ r}{ x} \\
\tan \theta = \frac{ y}{ x} &
\cot \theta = \frac{ x}{ y} \\
\end{array}
\]

\vspace{3cm}
\column{.5\textwidth}
\begin{eqnarray*}
& & \uncover<2->{\sin^2 \theta + \cos^2 \theta}\\
& \uncover<3->{=} & \uncover<3->{\frac{y^2}{r^2} + \frac{x^2}{r^2}}\\
& \uncover<4->{=} & \uncover<4->{\frac{y^2+x^2}{r^2}}\\
& \uncover<5->{=} & \uncover<5->{\frac{r^2}{r^2}}\\
& \uncover<6->{=} & \uncover<6->{1}
\end{eqnarray*}
\uncover<7->{%
Therefore $\sin^2 \theta + \cos^2 \theta = 1$.%
}%
\end{columns}
\end{frame}


\begin{frame}
\begin{columns}[c]
\column{.45\textwidth}
\trigIdentitiesPicture
\[
\begin{array}{cc}
\sin \theta = \frac{ y}{ r} &
\csc \theta = \frac{ r}{ y} \\
\cos \theta = \frac{ x}{ r} &
\sec \theta = \frac{ r}{ x} \\
\tan \theta = \frac{ y}{ x} &
\cot \theta = \frac{ x}{ y} \\
\end{array}
\]

\vspace{3cm}
\column{.5\textwidth}
\begin{example}[$\tan^2 \theta + 1 = \sec^2 \theta$]
Prove the identity $\tan^2 \theta + 1 = \sec^2 \theta$.
\begin{eqnarray*}
\uncover<2->{\sin^2 \theta + \cos^2 \theta} & \uncover<2->{=} & \uncover<2->{1}\\
\uncover<3->{\frac{\sin^2 \theta}{\cos^2\theta} + \frac{\cos^2 \theta}{\cos^2\theta}} & \uncover<3->{=} & \uncover<3->{\frac{1}{\cos^2\theta}}\\
\uncover<4->{\tan^2 \theta + 1} & \uncover<4->{=} & \uncover<4->{\sec^2\theta}
\end{eqnarray*}
\end{example}
\end{columns}
\end{frame}



\begin{frame}
\begin{columns}[c]
\column{.45\textwidth}
\psset{xunit=1cm,yunit=1cm}
\begin{pspicture}(-4,-2.5)(1,4)
\psaxes[labels=none, ticks=none]{<->}(0,0)(-4.2,-2.5)(1,4)
\pscircle*(-3,2){0.07}
\psline[linecolor=blue](0,0)(-3,2)
\psline[linecolor=blue](0,0)(1,0)
\rput[br](-3, 2){$(x,y)$}
\rput[lb](-1.55, 1.1){$r$}

\uncover<1>{
\psarc[linecolor=red, linewidth=2pt]{->}(0,0){0.5}{0}{146.3099}
\rput[l](0.1, 0.7){$\theta$}
}
\uncover<2>{
\psarc[linecolor=red, linewidth=2pt]{<-}(0,0){0.5}{0}{146.3099}
\rput[l](0.1, 0.7){$-\theta$}
}
\uncover<3->{
\psarc[linecolor=red]{->}(0,0){0.5}{0}{146.3099}
\rput[l](0.1, 0.7){$\theta$}
}
\uncover<4->{
\psarc[linecolor=red]{<-}(0,0){0.5}{-146.3099}{0}
\rput[lt](0.1, -0.7){$-\theta$}
\psline[linecolor=blue](0,0)(-3,-2)
\psline[linecolor=blue](0,0)(1,0)
\rput[br](-3, -2){$(x,-y)$}
\rput[lt](-1.55, -1.1){$r$}
}
\uncover<5->{\psline(-2.7, 0)(-2.7, -0.3)(-3, -0.3)
\psline[linestyle=dotted](-3, -2)(-3, 0)
}

\psline[linestyle=dotted](-3, 2)(-3, 0)
\psline[linestyle=dotted](-3, 2)(0, 2)
\psline(-2.7, 0)(-2.7, 0.3)(-3, 0.3)
\psline(0, 1.7)(-0.3, 1.7)(-0.3, 2)
\end{pspicture}
\[
\begin{array}{cc}
\sin \theta = \frac{ y}{ r} &
\csc \theta = \frac{ r}{ y} \\
\cos \theta = \frac{ x}{ r} &
\sec \theta = \frac{ r}{ x} \\
\tan \theta = \frac{ y}{ x} &
\cot \theta = \frac{ x}{ y} \\
\end{array}
\]
\column{.5\textwidth}
\begin{itemize}
\item<1->  Positive angles are obtained by rotating counterclockwise.
\item<2->  Negative angles are obtained by rotating clockwise.
\item<3->  If $(x,y)$ is on the terminal arm of the angle $\theta$, \alert<4>{then $(x, -y)$ is on the terminal arm of $-\theta$}.
\item<5->  $\alert<7>{\sin(-\theta )} = \frac{-y}{r} = -\frac{y}{r} = \alert<7>{-\sin \theta}$.
\item<6->  $\alert<8>{\cos(-\theta )} = \frac{x}{r} =\alert<8>{\cos \theta}$.
\item<7->  $\sin$ is an \alert<7>{odd function}.
\item<8->  $\cos$ is an \alert<8>{even function}.
\end{itemize}
\end{columns}
\end{frame}



\begin{frame}
\begin{columns}[c]
\column{.45\textwidth}
\psset{xunit=1cm,yunit=1cm}
\begin{pspicture}(-4,-2.5)(1,4)
\psaxes[labels=none, ticks=none]{<->}(0,0)(-4.2,-2.5)(1,4)
\pscircle*(-3,2){0.07}
\psline[linecolor=blue](0,0)(-3,2)
\psline[linecolor=blue](0,0)(1,0)
\rput[br](-3, 2){$(x,y)$}
\rput[lb](-1.55, 1.1){$r$}

\psarc[linecolor=red]{->}(0,0){0.5}{0}{146.3099}
\rput[l](0.1, 0.7){$\theta$}

\uncover<2>{
\parametricplot[linecolor=red, plotpoints=1000, arrows=->]{0}{360}{0.25 0.000198413 t mul add t cos mul 0.25 0.000198413 t mul add t sin mul}
}

\uncover<3->{
\parametricplot[linecolor=red, plotpoints=1000, arrows=->]{0}{506.3099}{0.25 0.000198413 t mul add t cos mul 0.25 0.000198413 t mul add t sin mul}
}

\psline[linestyle=dotted](-3, 2)(-3, 0)
\psline[linestyle=dotted](-3, 2)(0, 2)
\psline(-2.7, 0)(-2.7, 0.3)(-3, 0.3)
\psline(0, 1.7)(-0.3, 1.7)(-0.3, 2)
\end{pspicture}
\[
\begin{array}{cc}
\sin \theta = \frac{ y}{ r} &
\csc \theta = \frac{ r}{ y} \\
\cos \theta = \frac{ x}{ r} &
\sec \theta = \frac{ r}{ x} \\
\tan \theta = \frac{ y}{ x} &
\cot \theta = \frac{ x}{ y} \\
\end{array}
\]
\column{.5\textwidth}
\begin{itemize}
\item<2->  $2\pi$ represents a full rotation.
\item<3->  $\theta + 2\pi$ has the same terminal arm as $\theta$.
\item<4->  $\theta + 2\pi$ uses the same point $(x,y)$ and the same length $r$.
\item<5->  $\sin (\theta + 2\pi ) = \sin \theta$.
\item<5->  $\cos (\theta + 2\pi ) = \cos \theta$.
\item<6->  We say $\sin$ and $\cos$ are $2\pi$-periodic.
\end{itemize}
\end{columns}
\end{frame}


\begin{frame}[t]
The remaining identities are consequences of the addition formulas:
\[
\begin{array}{ccccc}
\sin (x + y) & = & \sin x\cos y & + & \cos x \sin y \\
\cos (x + y) & = & \cos x\cos y & - & \sin x \sin y 
\end{array}
\]
\uncover<2->{
Substitute $-y$ for $y$, and use the fact that $\sin(-y) = -\sin y$ and $\cos (-y) = \cos y$:
\[
\begin{array}{ccccc}
\sin (x - y) & = & \sin x\cos y & - & \cos x \sin y \\
\cos (x - y) & = & \cos x\cos y & + & \sin x \sin y 
\end{array}
\]
}
\end{frame}


\begin{frame}[t]
The remaining identities are consequences of the addition formulas:
\[
\begin{array}{ccccc}
\sin (x + y) & = & \sin x\cos y & + & \cos x \sin y \\
\cos (x + y) & = & \cos x\cos y & - & \sin x \sin y 
\end{array}
\]
\uncover<2->{
To get the double angle formulas, substitute $x$ for $y$:
\[
\begin{array}{rcl}
\sin 2x  & = & 2\sin x\cos x \\
\cos 2x  & = & \cos^2 x - \sin^2 x
\end{array}
\]
}
\uncover<3->{
Rewrite the second double angle formula in two ways, using $\cos^2 x = 1 - \sin^2 x$ and $\sin^2 x = 1 - \cos^2 x$:
\[
\begin{array}{rcl}
\cos 2x  & = & 2\cos^2 x  -1\\
\cos 2x  & = & 1 - 2\sin^2 x
\end{array}
\]
}
\uncover<4->{
To get the half-angle formulas, solve these equations for $\cos^2 x$ and $\sin^2 x$ respectively.
\[
\cos^2 x = \frac{1 + \cos 2x}{2}, \qquad \sin^2 x = \frac{1 - \cos 2x}{2} 
\]
}
\end{frame}


\begin{frame}[t]
The remaining identities are consequences of the addition formulas:
\[
\begin{array}{ccccc}
\sin (x + y) & = & \sin x\cos y & + & \cos x \sin y \\
\cos (x + y) & = & \cos x\cos y & - & \sin x \sin y 
\end{array}
\]
\uncover<2->{
Divide the first equation by the second, and then cancel $\cos x \cos y$ from the top and bottom:
\[
\begin{array}{rcl}
\tan (x + y)  & = & \frac{\tan x + \tan y}{1 - \tan x \tan y}
\end{array}
\]
}
\uncover<3->{
Do the same for the subtraction formulas:
\[
\begin{array}{rcl}
\tan (x - y)  & = & \frac{\tan x - \tan y}{1 + \tan x \tan y}
\end{array}
\]
}
\end{frame}
% end module trig-identities



\subsection{Trigonometric Identities and Complex Numbers}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-definition.tex
\begin{frame}
\frametitle{Complex numbers definition}
\begin{definition}The set of complex numbers $\mathbb C$ is defined as the set
\[
\{a+  b i  | a,b-\text{real~numbers}\},
\]
where the number $i$ is a number for which 
\[
\alert<4>{i^2=-1}\quad .
\]
The number $i$ is called the imaginary unit.
\end{definition}
\begin{itemize}
\item<2-> Complex numbers are added/subtracted according to the rule
\[
(a+b i)\pm(c+d i)= (a\pm c) + (b\pm d)i\quad .
\]
\item<3-> Complex numbers are multiplied according to the rule
\[
(a+b i)(c+d i)= a c + a d i+ b ci + \alert<4>{bd i^2}= \uncover<4>{(ac \alert<4>{- bd}) + (bc+ad)i}  \quad .
\]
\end{itemize}

\end{frame}


\youWillNotBeTested
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trigonometry/trig-Euler-formula.tex

\begin{frame}
\frametitle{Euler's Formula}
\begin{theorem}[Euler's Formula]
\[
e^{i x}= \cos x + i\sin x,
\]
where $e \approx 2.71828$ is Euler's/Napier's constant .
\end{theorem}
\begin{proof} 
Recall $n!=1\cdot2\cdot 3\cdot \dots \cdot(n-1)*n$. Borrow from Calc II the f-las:
\only<1>{\\ \vspace{5cm} ~}
\only<2>{
\[
\sin x= x-\frac{x^3}{3!}+\frac{x^5}{5!}-\dots +\frac{(-1)^nx^{2n+1}}{(2n+1)!}+\dots 
\]
\[
\cos x= 1-\frac{x^2}{2!}+\frac{x^4}{4!}-\dots +\frac{(-1)^nx^{2n}}{(2n)!} +\dots
\]
\[
e^{x}=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\dots + \frac{x^n}{n!}+\dots 
\]
} 
\only<3->{
\\~\\
\begin{tabular}{rclllllll}
$\uncover<6->{\alert<6>{i}}\sin x$ & $ =$  & & $\phantom{+}\uncover<6->{\alert<6>{i}} x$ & &$-\uncover<6->{\alert<6>{i}}\frac{~~x^3~~}{3!}$ & & $+\uncover<6->{\alert<6>{i}}\frac{~~x^5~~}{5!}$ & $-\dots$ \\
\\
$\cos x$ & $ =$  & $1$ &  & $-\frac{~~~x^{2}~~~}{2!}$ & & $+\frac{~~~x^4~~~}{4!}$ &  & $+\dots$ \\\hline
$e^{\only<3>{z} \only<4->{ \alert<4>{ix}} }$& $= $ & $1$ 
& $+\only<3>{z} \only<4->{\alert<4>{ix}}  $
&$\only<-4>{+}\only<5->{\alert<5>{-}} \frac{ 
\only<3>{z^2}\only<4>{\alert<4>{(ix)^2}}\only<5->{\alert<5>{~~x^2~~}}  \vphantom{(ix)^2}
}{2!}$ 
&$\only<-4>{+}\only<5->{\alert<5>{-i}} \frac{ 
\only<3>{z^3}\only<4>{\alert<4>{(ix)^3}}\only<5->{\alert<5>{~x^3~}}  \vphantom{(ix)^3}
}{3!}$ 
& $+ \frac{ 
\only<3>{z^4}\only<4>{\alert<4>{(ix)^4}}\only<5->{\alert<5>{~~~x^4~~~}}  \vphantom{(ix)^4}
}{4!}$ 
&$+ \uncover<5->{\alert<5>{i}}\frac{ 
\only<3>{z^5}\only<4>{\alert<4>{(ix)^5}}\only<5->{\alert<5>{~~x^5~~}}  \vphantom{(ix)^4}
}{5!}$ 
& $\only<-4>{+}\only<5->{\alert<5>{-}}\dots$ 
\end{tabular}
\\~ \\~\\
\alert<3>{Rearrange.} \uncover<4->{\alert<4>{Plug-in ${z=ix}$}.} \uncover<5->{\alert<5>{Use ${i^2=-1}$.}} \uncover<6->{\alert<6>{Multiply $\sin x$ by $i$}.} \uncover<7->{\alert<7>{Add to get $e^{ix}=\cos x+i\sin x$}.}
}
\end{proof}
\end{frame}



\youWillNotBeTested
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trigonometry/trig-using-euler-formula.tex
% begin module trig-identities
\begin{frame}
\frametitle{Trigonometric Identities Revisited}
\begin{itemize}
\item<alert@5,7,15,21,23> $e^{ix}=\cos x+i\sin x$  \hfill~ (Euler's Formula).
\item<alert@6,14,22> $e^{ix} e^{iy} = e^{ix+iy}=e^{i(x+y)}$\hfill~ (exponentiation rule: valid for $\mathbb C$).
\item<alert@12> $e^0=1$ \hfill~(exponentiation rule).
\item<2->\alert<16>{$\sin (-x) =-\sin x$, $\cos (-x)=\cos x$} \hfill~ (easy to remember).
\end{itemize}
\only<2>{\alert<2>{ All trigonometric formulas can be easily derived using the above formulas.} }

\footnotesize
\only<1-2>{\vspace{10cm}}


\only<3-10>{ %Example1
\footnotesize
\begin{example}
\[
\begin{array}{rcl}
\alert<9>{\sin (x+y)}&\alert<9>{=}& \alert<9>{\sin x \cos y + \sin y \cos x}\\
\alert<10>{\cos (x+y)}&\alert<10>{=}& \alert<10>{\cos x \cos y - \sin x \sin y} \quad .
\end{array}
\]
\end{example}
\begin{proof}
\uncover<4->{ 
\[
\begin{array}{rcl}
\alert<5,6>{e^{i(x+y)}}&=&\uncover<5->{\alert<5>{\cos (x+y)+i\sin (x+y)}}\\

\uncover<6->{\alert<6,7>{e^{ix} e^{iy}}} &\uncover<6->{=} &\uncover<6->{\cos (x+y)+i\sin (x+y)}\\
 
\uncover<7->{\alert<7>{(\cos x+i\sin x)(\cos y+i\sin y)}} &\uncover<7->{=}&\uncover<7->{\cos (x+y)+i\sin (x+y)}\\

\uncover<8->{{\alert<10>{\cos x\cos y- \sin x \sin y}+i(\alert<9>{\sin x \cos y +\sin y \cos x)}}} &\uncover<8->{=}&\uncover<8->{\alert<10>{\cos (x+y)}+i\alert<9>{\sin (x+y)}}\\
\end{array}
\]
\uncover<9->{\alert<9>{
Compare coefficient in front of $i$ 
} and } 
\uncover<10->{\alert<10>{
remaining terms} to get the desired equalities.
}
}
\uncover<10->{
\end{proof}
}
} %end Example1
\only<11-18>{ %
\begin{example}
\[
\alert<18>{\sin^2 x+\cos^2x=1}
\]
\end{example}
\begin{proof}
\uncover<12->{ %Example2
\[
\begin{array}{rcl}
\alert<12,18>{1}&\alert<12>{=}&\alert<12>{e^{0}}\\
&\uncover<13->{=}&\uncover<13->{\alert<14>{ e^{ix-ix}=}}\uncover<14->{\alert<14,15>{ e^{ix} e^{-ix}}=}\uncover<15->{\alert<15>{ (\cos x+i\sin x)(\alert<16>{\cos (-x)+i\sin (-x)})}} \\
&\uncover<16->{=}&\uncover<16->{(\cos x+i\sin x)(\alert<16>{\cos x-i\sin x})=}\uncover<17->{\cos^2 x -i^2\sin^2x}\\
&\uncover<18->{\alert<18>{=}}&\uncover<18->{\alert<18>{\cos^2x+\sin^2x}}\quad.
\end{array}
\]
}
\uncover<18->{
\end{proof}
}
\vspace{3cm}
} %end Example2

\only <19->{ %Example3
\footnotesize
\begin{example}
\[
\begin{array}{rcl}
\alert<25>{\sin 2x}&\alert<25>{=}& \alert<25>{2\sin x \cos x}\\
\alert<26>{\cos 2x}&\alert<26>{=}& \alert<26>{\cos^2 x - \sin^2 x } \quad .
\end{array}
\]
\end{example}
\begin{proof}
\uncover<20->{ 
\[
\begin{array}{rcl}
\alert<21,22>{e^{i(2x)}}&=&\uncover<21->{\alert<21>{\cos 2x+i\sin 2x}}\\

\uncover<22->{\alert<22,23>{e^{ix} e^{ix}}} &\uncover<22->{=} &\uncover<22->{\cos 2x+i\sin 2x}\\
 
\uncover<24->{\alert<24>{(\cos x+i\sin x)^2=}} \uncover<23->{\alert<23>{(\cos x+i\sin x)(\cos x+i\sin x)}} &\uncover<23->{=}&\uncover<23->{\cos 2x+i\sin 2x}\\

\uncover<24->{ \alert<24>{\alert<26>{\cos^2 x- \sin^2 x  }+i(\alert<25>{2\sin x \cos x})} } &\uncover<24->{=}&\uncover<24->{\alert<26>{\cos 2x}+i\alert<25>{\sin 2x}}\\
\end{array}
\]
\uncover<25->{\alert<25>{
Compare coefficient in front of $i$ 
} and } 
\uncover<26->{\alert<26>{
remaining terms} to get the desired equalities.
}
}
\uncover<26->{
\end{proof}
}
} %end Example1


\end{frame}
% end module trig-identities



\subsection{Graphs of the Trigonometric Functions}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trigonometry/trig-functions-graphs.tex
% begin module trig-functions-graphs
\begin{frame}
\frametitle{Graphs of the Trigonometric Functions}
\begin{tabular}{cc}
\begin{tabular}{c}
\psset{xunit=0.6cm,yunit=0.6cm}
\begin{pspicture}(-5,-1.4)(10,1.4)
\tiny
\psaxes[labels=none, Dx=1.570796327, Dy=1] {<->}(0,0)(-4,-1.4)(10,1.4)
\psplot[linecolor=red, plotpoints=1000]{-4}{10}{x 57.295779513 mul sin}

\rput[t](-3.14, -0.3){$-\pi$}
\rput[t](-1.57, -0.3){$-\frac{\pi}{2}$}
\rput[t](1.57, -0.3){$\frac{\pi}{2}$}
\rput[t](3.14, -0.3){$\pi$}
\rput[t](4.71, -0.3){$\frac{3\pi}{2}$}
\rput[t](6.28, -0.3){$2\pi$}
\rput[t](7.85, -0.3){$\frac{5\pi}{2}$}
\rput[t](9.42, -0.3){$3\pi$}
\rput[bl](0.2,1){\tiny $1$}
\end{pspicture}
%\includegraphics[width=8cm]{trigonometry/pictures/app-d-sin.pdf}%

\end{tabular}
& $y = \sin x$\\
\begin{tabular}{c}
\psset{xunit=0.6cm,yunit=0.6cm}
\begin{pspicture}(-5,-1.4)(10,1.4)
\tiny
\psaxes[labels=none, Dx=1.570796327, Dy=1] {<->}(0,0)(-4,-1.4)(10,1.4)
\psplot[linecolor=red, plotpoints=1000]{-4}{10}{x 57.295779513 mul cos}

\rput[t](-3.14, -0.3){$-\pi$}
\rput[t](-1.57, -0.3){$-\frac{\pi}{2}$}
\rput[t](1.57, -0.3){$\frac{\pi}{2}$}
\rput[t](3.14, -0.3){$\pi$}
\rput[t](4.71, -0.3){$\frac{3\pi}{2}$}
\rput[t](6.28, -0.3){$2\pi$}
\rput[t](7.85, -0.3){$\frac{5\pi}{2}$}
\rput[t](9.42, -0.3){$3\pi$}
\rput[bl](0.2,1){\tiny $1$}
\end{pspicture}
%\includegraphics[width=8cm]{trigonometry/pictures/app-d-cos.pdf}%
\end{tabular}
& $y = \cos x$
\end{tabular}
\begin{itemize}
\item<2->  $\sin x$ has zeroes at $n\pi$ for all integers $n$.
\item<3->  $\cos x$ has zeroes at $\pi /2 + n\pi$ for all integers $n$.
\item<4->  $-1 \leq \sin x \leq 1$. 
\item<5->  $-1 \leq \cos x \leq 1$. 
\end{itemize}
\end{frame}


\begin{frame}
\begin{tabular}{cc}
\psset{xunit=0.35cm,yunit=0.35cm}
\begin{pspicture*}(-7,-10)(7,10)
\psaxes[labels=none, ticks=x, Dx=1.570796327] {<->}(0,0)(-5.5,-10)(5.5,10)
\tiny
\rput[lt](5.5,0){$x$}
\rput[lb](0.2,9){$y$}
%\rput[t](1,-0.1){1}
\psline[linecolor=gray](1,-0.1)(1,0.1) % x unit mark
\rput[lb](1.570796327,0.1){$\frac{\pi}2$}
\psline[linecolor=gray](1.570796327,-0.1)(1.570796327,0.1) % pi/2 unit mark
%\rput[br](0,1){1}
\psline[linecolor=gray](-0.1,1)(0.1,1) % y unit mark

\psplot[linecolor=red]{-1.57}{1.57}{ 180 x mul  3.1415 div tan} 
\psplot[linecolor=red]{-4.71}{-1.58}{ 180 x mul  3.1415 div tan} 
\psplot[linecolor=red]{1.58}{4.71}{ 180 x mul  3.1415 div tan} 

\psline[linestyle=dotted](-4.71238898,-10)(-4.71238898,10)
\psline[linestyle=dotted](-1.570796327,-10)(-1.570796327,10)
\psline[linestyle=dotted](1.570796327,-10)(1.570796327,10)
\psline[linestyle=dotted](4.71238898,-10)(4.71238898,10)
\end{pspicture*}
%\includegraphics[width=5.5cm]{trigonometry/pictures/app-d-tan.pdf}%

&%
\psset{xunit=0.35cm,yunit=0.35cm}
\begin{pspicture*}(-7,-10)(8,10)
\psaxes[labels=none, ticks=x, Dx=1.570796327] {<->}(0,0)(-7,-10)(7,10)
\tiny
\rput[lt](7,0){$x$}
\rput[lb](0.2,9){$y$}
%\rput[t](1,-0.1){1}
\psline[linecolor=gray](1,-0.1)(1,0.1) % x unit mark
\rput[rb](3.13,0.1){$\pi$}
\psline[linecolor=gray](1.570796327,-0.1)(1.570796327,0.1) % pi/2 unit mark
%\rput[br](0,1){1}
\psline[linecolor=gray](-0.1,1)(0.1,1) % y unit mark

\psplot[linecolor=red]{0.01}{3.14}{1 180 x mul  3.1415 div tan div} 
\psplot[linecolor=red]{3.15}{6.28}{1 180 x mul  3.1415 div tan div} 
\psplot[linecolor=red]{-3.14}{-0.01}{1 180 x mul  3.1415 div tan div} 
\psplot[linecolor=red]{-6.28}{-3.15}{1 180 x mul  3.1415 div tan div} 
%\psplot[linecolor=red]{-4.71}{-1.58}{ 180 x mul  3.1415 div cot} 
%\psplot[linecolor=red]{1.58}{4.71}{ 180 x mul  3.1415 div cot} 

\psline[linestyle=dotted](-6.283185307,-10)(-6.283185307,10)
\psline[linestyle=dotted](-3.141592654,-10)(-3.141592654,10)
\psline[linestyle=dotted](3.141592654,-10)(3.141592654,10)
\psline[linestyle=dotted](6.283185307,-10)(6.283185307,10)
\end{pspicture*}
%\includegraphics[width=5.5cm]{trigonometry/pictures/app-d-cot.pdf}%
\\%
$y = \tan x$ & $y = \cot x$\\
\end{tabular}
\end{frame}


\begin{frame}
\begin{tabular}{cc}
\psset{xunit=0.5cm,yunit=0.5cm}
\begin{pspicture}(-4.8,-7.1)(6.2,7.1)
\psaxes[labels=none, ticks=x, Dx=1.570796327] {<->}(0,0)(-3.2,-7)(6.2,7)
\psline(-0.15, 1)(0.15,1)
\psplot[linecolor=blue, linestyle=dashed, plotpoints=1000]{-3.2}{6}{x 57.295779513 mul sin}
\uncover<2->{
\psplot[linecolor=red, plotpoints=1000]{0.15}{2.991592654}{1 x 57.295779513 mul sin div}
\psplot[linecolor=red, plotpoints=1000]{-2.991592654}{-0.15}{1 x 57.295779513 mul sin div}
\psplot[linecolor=red, plotpoints=1000]{3.291592654}{6.133185307}{1 x 57.295779513 mul sin div}
}

\psline[linestyle=dotted](3.14159,-7)(3.14159,7)
\rput[t](-3.14, -0.3){\tiny$-\pi$}
\rput[t](-1.57, -0.3){\tiny$-\frac{\pi}{2}$}
\rput[t](1.57, -0.3){\tiny$\frac{\pi}{2}$}
\rput[t](3, -0.3){\tiny$\pi$}
\rput[t](4.71238898, -0.3){\tiny$\frac{3\pi}{2}$}

\rput[bl](0.2,1){$1$}
\end{pspicture}
%\only<handout:0| -1>{%
%\includegraphics[width=5.5cm]{trigonometry/pictures/app-d-csca.pdf}%
%}%
%\only<2->{%
%\includegraphics[width=5.5cm]{trigonometry/pictures/app-d-cscb.pdf}%
%}%

&%
\psset{xunit=0.5cm,yunit=0.5cm}
\begin{pspicture}(-4.7,-7.1)(6.1,4.8)
\psaxes[labels=none, ticks=x, Dx=1.570796327] {<->}(0,0)(-4.7,-7.1)(4.8,7.1)
\psline(-0.15, 1)(0.15,1)
\psplot[linecolor=blue, linestyle=dashed, plotpoints=1000]{-4.7}{4.7}{x 57.295779513 mul cos}
\uncover<3->{
\psplot[linecolor=red, plotpoints=1000]{-1.420796327}{1.420796327}{1 x 57.295779513 mul cos div}
\psplot[linecolor=red, plotpoints=1000]{1.720796327}{4.56238898}{1 x 57.295779513 mul cos div}
\psplot[linecolor=red, plotpoints=1000]{-4.56238898}{-1.720796327}{1 x 57.295779513 mul cos div}
}

\psline[linestyle=dotted](1.570796327,-7.1)(1.570796327,7.1)
\psline[linestyle=dotted](-1.570796327,-7.1)(-1.570796327,7.1)
\rput[t](-3.14, -0.3){\tiny$-\pi$}
\rput[t](-1.57, -0.3){\tiny$-\frac{\pi}{2}$}
\rput[t](1.57, -0.3){\tiny$\frac{\pi}{2}$}
\rput[t](3, -0.3){\tiny$\pi$}
\rput[t](4.71238898, -0.3){\tiny$\frac{3\pi}{2}$}

\rput[bl](0.2,1){$1$}
\end{pspicture}
%\only<handout:0| -2>{%
%\includegraphics[width=5.5cm]{trigonometry/pictures/app-d-seca.pdf}%
%}%
%\only<3->{%
%\includegraphics[width=5.5cm]{trigonometry/pictures/app-d-secb.pdf}%
%}%
\\%
$y = \csc x$  & $y = \sec x$\pause\pause\\
\end{tabular}
\end{frame}
% end module trig-functions-graphs



\section{Inverse Trigonometric Functions}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arcsin-def.tex
% begin module arcsin-def
\begin{frame}
\frametitle{Inverse Trigonometric Functions}
\psset{xunit=0.6cm,yunit=0.6cm}
\begin{pspicture}(-5,-1.4)(10,1.4)
\tiny
\psaxes[labels=none, Dx=1.570796327, Dy=1] {<->}(0,0)(-4,-1.8)(10,1.8)

\uncover<1-2| handout:0>{\psplot[linecolor=red, plotpoints=1000]{-4}{10}{x 57.295779513 mul sin}}
\uncover<2| handout:0>{\psline(-4,0.6)(10,0.6 )}

\uncover<3>{\psplot[linecolor=red, plotpoints=1000]{-1.570796327}{1.570796327}{x 57.295779513 mul sin}
\rput[bl](3, 1){\alert<3>{$y=\sin x, -\frac{\pi}{2}\leq x\leq \frac{\pi}{2}$} }
}
\uncover<4-| handout:0>{\psplot[linecolor=gray, plotpoints=1000]{-1.570796327}{1.570796327}{x 57.295779513 mul sin}
\rput[bl](3, 1){\color{gray}{$y=\sin x, -\frac{\pi}{2}\leq x\leq \frac{\pi}{2}$} }
}

\uncover<4-| handout:0>{\psplot[linecolor=red, plotpoints=1000]{-1}{1}{x ASIN}
\rput[r](-1.5, -1){\alert<4>{$y=\Arcsin x$} }

}

\rput[t](-3.14, -0.3){$-\pi$}
\rput[t](-1.57, -0.3){$-\frac{\pi}{2}$}
\rput[t](1.57, -0.3){$\frac{\pi}{2}$}
\rput[t](3.14, -0.3){$\pi$}
\rput[t](4.71, -0.3){$\frac{3\pi}{2}$}
\rput[t](6.28, -0.3){$2\pi$}
\rput[t](7.85, -0.3){$\frac{5\pi}{2}$}
\rput[t](9.42, -0.3){$3\pi$}
\rput[bl](0.2,1){\tiny $1$}
\end{pspicture}
\begin{columns}[c]
\column{.65\textwidth}
\begin{itemize}
\item<2->  $\sin x$ isn't one-to-one.
\item<3->  It is if we restrict the domain to $[-\pi /2, \pi /2]$.
\item<4->  Then it has an inverse function.
\item<4->  We call it $\arcsin$ or $\sin^{-1}$.
\item<6->  $\Arcsin x = y \Leftrightarrow \sin y = x$ and $-\pi /2 \leq y \leq \pi /2$.
\end{itemize}
\column{.35\textwidth}
\psset{xunit=1cm,yunit=1cm}
\uncover<5->{
\begin{pspicture}(-1.5,-2)(1.7,2)
\tiny
\psaxes[ticks=none, labels=none]{<->}(0,0)(-1.5,-2)(1.5,2)
\fcLabels{1.5}{2}
\fcLabelXOne
\psline(-1, -0.1)(-1,0.1)
\rput[t](-1,  -0.1){$-1$}

\psline(-0.1, 1.570796327)(0.1,1.570796327)
\rput[r](-0.1,  1.570796327){$\frac{\pi}{2}$}
\psline(-0.1, -1.570796327)(0.1,-1.570796327)
\rput[r](-0.1,  -1.570796327){$-\frac{\pi}{2}$}

\psplot[linecolor=red, plotpoints=1000]{-1}{1}{x ASIN}
\rput[rb](-0.05, 0.2){\alert<4>{$y=\Arcsin x$} }
\fcFullDot{1}{1.570796327}
\fcFullDot{-1}{-1.570796327}
\end{pspicture}
}
%\uncover<5->{%
%\includegraphics[height=4cm]{inverse-trig/pictures/07-06-arcsine.pdf}%
%}%

\end{columns}
\end{frame}
% end module arcsin-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arcsin-ex1.tex
% begin module arcsin-ex1
\begin{frame}
\begin{example} %[Example 1, p. 217]
\begin{columns}[t]
\column{.4\textwidth}
\[
\text{Find } \ \Arcsin \left( \frac{1}{2}\right)
\]
\begin{itemize}
\item<2->  $\sin (\uncover<2-| handout:0>{\pi / 6}) = 1/2$.
\item<3->  $-\pi /2 \leq \uncover<3-| handout:0>{\pi / 6} \leq \pi /2$.
\item<4->  Therefore $\Arcsin \left( \frac{1}{2}\right) = \uncover<3-| handout:0>{\frac{\pi}{6}}$.
\end{itemize}
\column{.6\textwidth}
\[
\text{Find } \ \tan \left( \Arcsin \left( \frac{1}{3}\right) \right)
\]
\begin{itemize}
\item<5->  Let $\theta = \Arcsin (1/3)$, so $\sin \theta = 1/3$.
\item<6->  Draw a right triangle with opposite side $1$ and hypotenuse $3$.
\item<7->  \alert<handout:0| 7-8>{Length of adjacent side $ = \uncover<8-| handout:0>{\sqrt{3^2-1^2} = \sqrt{8} = 2\sqrt{2}.}$}
\item<9->  Then \alert<handout:0| 9-10>{$\tan (\Arcsin \frac13) = \uncover<10-| handout:0>{\frac{1}{2\sqrt{2}}.}$}
\end{itemize}

\psset{xunit=1.8cm, yunit=1.8cm}
\begin{pspicture}(-0.2, -0.35)(3.2,1.05)
\psframe*[linecolor=white](-0.2, -0.35)(3.2,1.05)
\psline[linecolor=red!1](2.828427125, 1)(2.828427125, 1.01)
\psline[linecolor=red!1](0, -0.35)(0.001, -0.35)
\uncover<5->{\psline(0,0)(2.828427125, 0)(2.828427125, 1)(0,0)
\psline(2.828427125, 0.1)(2.728427125, 0.1)(2.728427125,0)
\rput[b](1.41, 0.55){$3$}
\rput[l](2.87, 0.5){$1$}
\rput(0.55, 0.1){$\theta$}
\fcAngle{0}{0.339837}{0.4}{}
}
\uncover<7>{\rput[t](1.41, -0.1){\alert<7| handout:0>{?}} }
\uncover<8-| handout:0>{\rput[t](1.41, -0.1){\alert<8>{$2\sqrt{2}$}} }

\end{pspicture}


\end{columns}
\end{example}
\end{frame}
% end module arcsin-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arcsin-sin-ex1.tex
% begin module arcsin-sin-ex1
\begin{frame}
\begin{example}
Find $\Arcsin (\sin 1.5)$.  
\begin{itemize}
\item<2->  \alert<2-3>{$\pi/2 \approx \uncover<3->{1.57.}$}
\item<4->  Therefore $-\pi/2 \leq 1.5\leq \pi/2$.  
\item<5->  Therefore $\Arcsin (\sin 1.5) = 1.5$.  
\end{itemize}
\end{example}
\end{frame}
% end module arcsin-sin-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arcsin-sin-ex2.tex
% begin module arcsin-sin-ex2
\begin{frame}
\begin{example}
Find $\Arcsin (\sin 2)$.  
\begin{itemize}
\item<2->  $2$ is not between $-\pi/2$ and $\pi/2$.  
\item<3->  \alert<5>{$\sin 2 = \sin a$} for some \alert<6>{$a$ between $-\pi/2$ and $\pi/2$.}  
\end{itemize}
\begin{align*}
\uncover<4->{\alert<7>{a - 0} & \alert<7>{= \pi - 2.}} \\
\uncover<5->{\text{Therefore }\quad \Arcsin(\alert<5>{\sin 2}) & = \alert<6>{\Arcsin(\alert<5>{\sin a})}} \\
& \uncover<6->{ \alert<6>{= \alert<7>{a}}} \uncover<7->{\alert<7>{= \pi-2.}}
\end{align*}

\end{example}

\begin{center}
\psset{xunit=1.0cm,yunit=1.0cm}
\begin{pspicture}(-2.2,-1.4)(4.2,1.4)
\tiny
\psaxes[labels=none, Dx=1.570796327, Dy=1] {<->}(0,0)(-2,-1.8)(4,1.8)
\psplot[linecolor=red, plotpoints=1000]{-1.570796327}{1.570796327}{x 57.295779513 mul sin}
\rput[bl](3, 1){$y=\sin x$ }
\psplot[linecolor=gray, plotpoints=1000]{1.570796327}{4}{x 57.295779513 mul sin}
\psplot[linecolor=gray, plotpoints=1000]{-2}{-1.570796327}{x 57.295779513 mul sin}
\rput[t](-1.57, -0.3){$-\frac{\pi}{2}$}
\rput[t](1.57, -0.3){$\frac{\pi}{2}$}
\rput[t](3.14, -0.3){$\pi$}
\rput[bl](0.2,1){\tiny $1$}

\uncover<2-| handout:0>{%
\psline[linewidth=0.4pt](2,0.2)(2,-0.2)
\rput[t](2, -0.3){$2$}
}%

\uncover<3-| handout:0>{%
\psline[linewidth=0.4pt](1.141592654,0.2)(1.141592654,-0.2)
\rput[t](1.141592654, -0.3){$a$}
\psline(1.141592654,0.909297427)(2,0.909297427)
}%

\uncover<4->{%
\psline[linecolor=red]{<->}(0,-0.2)(1.141592654,-0.2)
\psline[linecolor=red]{<->}(2,-0.2)(3.141592654,-0.2)
}%
\end{pspicture}
\end{center}

\end{frame}
% end module arcsin-sin-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arcsin-derivative.tex
% begin module arcsin-derivative
\begin{frame}
\begin{theorem}[The Derivative of $\Arcsin x$]
\[
\frac{\diff}{\diff x} \left( \Arcsin x\right) = \frac{1}{\sqrt{1-x^2}}, \qquad -1 < x < 1.
\]
\end{theorem}
\begin{proof}
\abovedisplayskip=0pt
\belowdisplayskip=-15pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\uncover<2->{%
\text{Let}\quad y %
}%
& \uncover<2->{%
 = \Arcsin x.
}\\%
\uncover<2->{%
\text{Then}\quad \alert<handout:0| 3-4,10>{\sin y} %
}%
& \uncover<2->{%
 \alert<handout:0| 10>{=}  \alert<handout:0| 5-6,10>{x}\quad \text{and} \quad \alert<handout:0| 9>{-\pi/2 \leq y \leq \pi/2}.
}\\%
\uncover<3->{%
\text{Differentiate implicitly:}\quad \alert<handout:0| 3-4>{\uncover<4->{\cos y \cdot y'}} %
}%
& \uncover<3->{%
 = \uncover<6->{\alert<handout:0| 6>{1}} 
}\\%
\uncover<7->{%
y' %
}%
& \uncover<7->{%
 = \frac{1}{\alert<handout:0| 8>{\cos y}} %
}\\%
& \uncover<8->{%
 = \frac{1}{\alert<handout:0| 8>{\alert<handout:0| 9>{\pm}\sqrt{1-\sin^2y}}} %
}\\%
\uncover<9->{%
\text{But \alert<handout:0| 9>{$\cos y > 0$}:}\quad %
}%
& \uncover<9->{%
 = \frac{1}{\sqrt{1-\alert<handout:0| 10>{\sin^2y}}} %
}%
\uncover<10->{%
 = \frac{1}{\sqrt{1-\alert<handout:0| 10>{x^2}}}. \qedhere%
}%
\end{align*}
\end{proof}
\end{frame}
% end module arcsin-derivative



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arcsin-properties.tex
% begin module arcsin-properties
\begin{frame}
Important facts about $\Arcsin$:
\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=2cm,yunit=2cm}
\begin{pspicture}(-1.5,-2)(1.6,2.1)
\tiny
\psaxes[ticks=none, labels=none]{<->}(0,0)(-1.5,-2)(1.5,2)
\fcLabels{1.5}{2}
\fcLabelXOne
\psline(-1, -0.1)(-1,0.1)
\rput[t](-1,  -0.1){$-1$}

\psline(-0.1, 1.570796327)(0.1,1.570796327)
\rput[r](-0.1,  1.570796327){$\frac{\pi}{2}$}
\psline(-0.1, -1.570796327)(0.1,-1.570796327)
\rput[r](-0.1,  -1.570796327){$-\frac{\pi}{2}$}

\psplot[linecolor=red, plotpoints=1000]{-1}{1}{x ASIN}
\rput[rb](-0.05, 0.2){$y=\Arcsin x$}
\fcFullDot{1}{1.570796327}
\fcFullDot{-1}{-1.570796327}
\uncover<3| handout:0>{\psline[linecolor=red, linewidth=2pt]{<->}(-1,0)(1,0) }
\uncover<5| handout:0>{\psline[linecolor=red, linewidth=2pt]{<->}(0,-1.570796327)(0,1.570796327) }

\end{pspicture}
\column{.5\textwidth}
\begin{enumerate}
\item  \alert<handout:0| 2-3>{Domain: \uncover<3-| handout:0>{$[-1, 1]$.}}
\item  \alert<handout:0| 4-5>{Range: \uncover<5-| handout:0>{$[-\pi /2, \pi /2]$.}}
\item  $\Arcsin x = y \Leftrightarrow \sin y = x$ and $-\pi /2 \leq y \leq \pi /2$.
\item  $\Arcsin (\sin x) = x$ for $-\pi /2 \leq x \leq \pi /2$.
\item  $\sin (\Arcsin x) = x$ for $-1 \leq x \leq 1$.
\item  $\frac{\diff}{\diff x} (\Arcsin x) = \frac{1}{\sqrt{1-x^2}}$.
\end{enumerate}
\end{columns}
\end{frame}
% end module arcsin-properties




%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arccos-def.tex
% begin module arccos-def
\begin{frame}
\psset{xunit=0.6cm,yunit=0.6cm}
\begin{pspicture}(-5,-1.4)(10,3.5)
\tiny
\psaxes[labels=none, ticks=x, Dx=1.570796327, Dy=1] {<->}(0,0)(-4.1,-1.4)(10,3.4)
\fcLabels{10}{3.4}
\uncover<1| handout:0>{\psplot[linecolor=red, plotpoints=1000]{-4}{10}{x 57.295779513 mul cos}
\rput[t](3.5, 1){$y=\cos x$}
}
\uncover<2>{\psplot[linecolor=red, plotpoints=1000]{0}{3.141592654}{x 57.295779513 mul cos}
\rput[t](3.5, 1){$y=\cos x, \quad 0\leq x\leq \pi$}
}
\uncover<3-| handout:0>{\psplot[linecolor=gray, plotpoints=1000]{0}{3.141592654}{x 57.295779513 mul cos}
\rput[t](3.5, 1){\color{gray}$y=\cos x, \quad 0\leq x\leq \pi$}

\psplot[linecolor=red, plotpoints=1000]{-1}{1}{x ACOS}
\psline(-0.1,3.141592654)(0.1,3.141592654)
\rput[l](0.15,3.141592654){$\pi$}
\psline(-1,-0.1)(-1,0.1)
\rput[t](-1,-0.1){$-1$}
\psline(1,-0.1)(1,0.1)
\rput[t](1,-0.1){$1$}
\rput[r](-0.6, 0.4){$y=\Arccos x$}
}

\rput[t](-3.14, -0.3){$-\pi$}
\rput[t](-1.57, -0.3){$-\frac{\pi}{2}$}
\rput[t](1.57, -0.3){$\frac{\pi}{2}$}
\rput[t](3.14, -0.3){$\pi$}
\rput[t](4.71, -0.3){$\frac{3\pi}{2}$}
\rput[t](6.28, -0.3){$2\pi$}
\rput[t](7.85, -0.3){$\frac{5\pi}{2}$}
\rput[t](9.42, -0.3){$3\pi$}
\rput[br](-0.2,1){\tiny $1$}

\end{pspicture}

\begin{columns}[c]
\column{.65\textwidth}
\begin{itemize}
\item<1->  Same for $\cos x$.
\item<2->  Restrict the domain to $[0, \pi ]$.
\item<3->  The inverse is called $\arccos$ or $\cos^{-1}$.
\item<5->  $\Arccos (x) = y \Leftrightarrow \cos y = x$ and $0 \leq y \leq \pi$.
\end{itemize}
\column{.35\textwidth}
\uncover<4->{%
%\uncover<4->{%
%\includegraphics[height=4cm]{inverse-trig/pictures/07-06-arccosd.pdf}%
%}%
\psset{xunit=1.2cm,yunit=1.2cm}
\begin{pspicture}(-2,-0.5)(1.7,3.8)
\tiny
\psaxes[labels=none, ticks=none] {<->}(0,0)(-2,-0.5)(1.6,3.7)
\fcLabels{1.6}{3.7}
\psplot[linecolor=red, plotpoints=1000]{-1}{1}{x ACOS}
\psline(-0.1,3.141592654)(0.1,3.141592654)
\rput[l](0.15,3.141592654){$\pi$}
\psline(-1,-0.1)(-1,0.1)
\rput[t](-1,-0.1){$-1$}
\psline(1,-0.1)(1,0.1)
\rput[t](1,-0.1){$1$}
\rput[r](-0.6, 2){$y=\Arccos x$}
\end{pspicture}
}%
\end{columns}
\end{frame}
% end module arccos-def




%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arccos-properties.tex
% begin module arccos-properties
\begin{frame}
Important facts about $\Arccos$:
\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=1.2cm,yunit=1.2cm}
\begin{pspicture}(-1.9,-0.5)(1.9,3.8)
\tiny
\psaxes[labels=none, ticks=none] {<->}(0,0)(-1.8,-0.5)(1.8,3.7)
\fcLabels{1.8}{3.7}
\psline(1,-0.1)(1,0.1)
\psplot[linecolor=red, plotpoints=1000]{-1}{1}{x ACOS}
\psline(-0.1,3.141592654)(0.1,3.141592654)
\rput[l](0.15,3.141592654){$\pi$}
\psline(-1,-0.1)(-1,0.1)
\rput[t](-1,-0.1){$-1$}
\rput[t](1,-0.1){$1$}
\rput[r](-0.6, 2){$y=\Arccos x$}
\uncover<handout:0| 3>{
\psline[arrows=<->, linecolor=red, linewidth=3pt](-1,0)(1,0)
}
\uncover<handout:0| 5>{
\psline[arrows=<->, linecolor=red, linewidth=3pt](0,0)(0,3.141592654)
}
\end{pspicture}

%\ \includegraphics[height=6cm]{inverse-trig/pictures/07-06-arccosd.pdf}%
\column{.5\textwidth}
\begin{enumerate}
\item  \alert<handout:0| 2-3>{Domain: \uncover<3-| handout:0>{$[-1, 1]$.}}
\item  \alert<handout:0| 4-5>{Range: \uncover<5-| handout:0>{$[0, \pi ]$.}}
\item  $\Arccos x = y \Leftrightarrow \cos y = x$ and $0 \leq y \leq \pi$.
\item  $\Arccos (\cos x) = x$ for $0 \leq x \leq \pi$.
\item  $\cos (\Arccos x) = x$ for $-1 \leq x \leq 1$.
\item  $\frac{\diff}{\diff x} (\Arccos x) = -\frac{1}{\sqrt{1-x^2}}$.  \uncover<6->{(The proof is similar to the proof of the formula for the derivative of $\Arcsin x$.)}
\end{enumerate}
\end{columns}
\end{frame}
% end module arccos-properties



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arctan-def.tex
% begin module arctan-def
\begin{frame}
\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=0.6cm, yunit=0.6cm}
\begin{pspicture}(-3.9, -3.8)(5.2,3.8)
\psframe*[linecolor=white](-3.9,3.8)(5.2,3.8)
\tiny
\fcAxesStandard{-3.85}{-3.7}{5.2}{3.7}
%Function formula: \frac{\sin{}x}{\cos{}x}

\uncover<1>{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-3.8}{-1.841592654}{x 57.29578 mul tan }
}
\uncover<1-2>{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-1.3}{1.3}{x 57.29578 mul tan }
}
\uncover<3->{
\psplot[linecolor=gray, plotpoints=1000]{-1.3}{1.3}{x 57.29578 mul tan }
}
\uncover<1>{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1.841592654}{4.441592654}{x 57.29578 mul tan }
}
\uncover<3->{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-3.602102448}{3.602102448}{x ATAN }
}
\uncover<1-2>{
\psline[linestyle=dashed](1.570796327, -3.7)(1.570796327, 3.7)
\psline[linestyle=dashed](-1.570796327, -3.7)(-1.570796327, 3.7)
}
\uncover<3->{
%\psline[linecolor=gray!20, linestyle=dashed](1.570796327, -3.7)(1.570796327, 3.7)
%\psline[linecolor=gray!20, linestyle=dashed](-1.570796327, -3.7)(-1.570796327, 3.7)
\psline[linestyle=dashed](-3.7, 1.570796327)(5, 1.570796327)
\psline[linestyle=dashed](-3.7, -1.570796327)(5, -1.570796327)
}
\uncover<1>{
\psline[linestyle=dashed](4.71238898, -3.7)(4.71238898, 3.7)
}
\uncover<3->{
\psline(1.570796327, -0.1)(1.570796327, 0.1)
\psline(-1.570796327, -0.1)(-1.570796327, 0.1)
}
\rput[tr](1.5,-0.1){$\frac{\pi}{2}$}
\rput[tr](-1.7,-0.1){$-\frac{\pi}{2}$}
\uncover<1>{
\fcXTickWithLabel{3.141592654}{$\pi$}
\fcXTickWithLabel{-3.141592654}{$-\pi$}
}
\uncover<1>{\rput[tr](4.65,-0.1){$\frac{3\pi}{2}$}
}
\fcYTickWithLabel{1}{$1$}
\fcYTickWithLabel{-1}{$-1$}
\rput[l](1.6, 2.1){ $\begin{array}{l} y=\tan x\uncover<2->{,}\\ \uncover<2->{-\frac{\pi}{2}\leq x\leq\frac{\pi}{2} }\end{array}$
}
\end{pspicture}

%\ \only<handout:0| -1>{%
%\includegraphics[width=5cm]{inverse-trig/pictures/07-06-arctana.pdf}%
%}%
%\only<handout:1| 2>{%
%\includegraphics[width=5cm]{inverse-trig/pictures/07-06-arctanb.pdf}%
%}%
%\only<handout:2| 3->{%
%\includegraphics[width=5cm]{inverse-trig/pictures/07-06-arctanc.pdf}%
%}%
\column{.5\textwidth}
\begin{itemize}
\item<1->  $\tan x$ isn't one-to-one.
\item<2->  Restrict the domain to $(-\frac{\pi}2, \frac{\pi}2)$.
\item<3->  The inverse is called $\tan^{-1}$ or $\arctan$.
\item<4->  $\Arctan x = y \Leftrightarrow \tan y = x$ and $-\frac{\pi}2 < y < \frac{\pi}2$.
\item<5->  \alert<handout:0| 5-6>{Domain of $\Arctan$: \uncover<6-| handout:0>{$(-\infty,\infty)$.}}
\item<5->  \alert<handout:0| 7-8>{Range of $\Arctan$: \uncover<8-| handout:0>{$(-\frac{\pi}2, \frac{\pi}2 )$.}}
\item<9->  \alert<handout:0| 9-10>{$\displaystyle \lim_{x\rightarrow \infty} \Arctan x = \uncover<10-| handout:0>{\frac{\pi}2.}$}
\item<9->  \alert<handout:0| 11-12>{$\displaystyle \lim_{x\rightarrow - \infty} \Arctan x = \uncover<12-| handout:0>{- \frac{\pi}2.}$}
\end{itemize}
\end{columns}
\end{frame}
% end module arctan-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arctan-ex3.tex
% begin module arctan-ex3
\begin{frame}
\begin{example} %[Example 3, p. 218]
Simplify the expression $\cos (\Arctan x)$.
\begin{itemize}
\item<2->  Let $y = \Arctan x$, so $\tan y = x$.
\item<3->  Draw a right triangle with opposite $x$ and adjacent $1$.
\item<4->  \alert<handout:0| 4-5>{Length of hypotenuse $ = \uncover<5->{\sqrt{1^2+x^2}.}$}
\item<6->  Then \alert<handout:0| 6-7>{$\cos (\Arctan x) = \uncover<7-| handout:0>{\frac{1}{\sqrt{1+x^2}}.}$}
\end{itemize}
\begin{pspicture}(-0.2,-0.5)(4.5,3.2)
\psframe*[linecolor=white](-0.2,-0.5)(4.5,3.2)
\psline[linecolor=red!1](4.5,-0.5)(4.5,-0.49)
\psline(0,0)(4,0)(4,3)(0,0)
\psline(3.8,0)(3.8,0.2)(4,0.2)
\fcAngle{0}{0.643501}{0.5}{$y$}
\uncover<3->{%
\rput[l](4.1, 1.5){$x$}
\rput[t](2,-0.1 ){\alert<6,7>{$1$}}
}%
\uncover<5->{%
\rput[rb](1.9,1.6){\alert<6,7>{$\sqrt{x^2+1}$}}
}%
\end{pspicture}
%\ \only<handout:0| -2>{%
%\includegraphics[width=5cm]{inverse-trig/pictures/07-06-ex3a.pdf}%
%}%
%\only<handout:0| 3-4>{%
%\includegraphics[width=5cm]{inverse-trig/pictures/07-06-ex3b.pdf}%
%}%
%\only<5->{%
%\includegraphics[width=5cm]{inverse-trig/pictures/07-06-ex3c.pdf}%
%}%
\end{example}
\end{frame}
% end module arctan-ex3



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arctan-ex4.tex
% begin module arctan-ex4
\begin{frame}
\begin{example} %[Example 4, p. 219]
Evaluate 
\[
\lim_{x\rightarrow 2^+} \arctan \left( \frac{1}{x-2}\right) .
\]
\uncover<2->{
\[
\frac{1}{x-2} \rightarrow \infty \qquad \text{ as } \qquad x\rightarrow 2^+.
\]
}
\uncover<3->{
Therefore 
\[
\alert<handout:0| 3-4>{\lim_{x\rightarrow 2^+} \arctan \left( \frac{1}{x-2}\right) = \uncover<4-| handout:0>{\frac{\pi}{2}.}}
\]
}
\end{example}
\end{frame}
% end module arctan-ex4



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arctan-derivative.tex
% begin module arctan-derivative
\begin{frame}
\begin{theorem}[The Derivative of $\Arctan x$]
\[
\frac{\diff}{\diff x} (\Arctan x) = \frac{1}{1 + x^2}.
\]
\end{theorem}
\begin{proof}
\abovedisplayskip=0pt
\belowdisplayskip=-15pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\uncover<2->{%
\text{Let}\quad y %
}%
& \uncover<2->{%
 = \Arctan x.
}\\%
\uncover<2->{%
\text{Then}\quad \alert<handout:0| 3-4,10>{\tan y} %
}%
& \uncover<2->{%
 \alert<handout:0| 10>{=}  \alert<handout:0| 5-6,10>{x.} %
}\\%
\uncover<3->{%
\text{Differentiate implicitly:}\quad \alert<handout:0| 3-4>{\uncover<4->{\sec^2 y \cdot y'}} %
}%
& \uncover<3->{%
 = \uncover<6->{\alert<handout:0| 6>{1}} 
}\\%
\uncover<7->{%
y' %
}%
& \uncover<7->{%
 = \frac{1}{\alert<handout:0| 8-9>{\sec^2 y}} %
}\\%
& \uncover<8->{%
 = \frac{1}{\alert<handout:0| 8-9>{\uncover<9->{1+\alert<handout:0| 10>{\tan^2 y}}}} %
}\\%
& \uncover<10->{%
 = \frac{1}{1+\alert<handout:0| 10>{x^2}}. \qedhere%
}%
\end{align*}
\end{proof}
\end{frame}
% end module arctan-derivative



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/inverse-trig-summary.tex
% begin module inverse-trig-summary
\begin{frame}[t]
The remaining inverse trigonometric functions aren't used as often:
\[
\begin{array}{llcrcl}
y = \Arccsc x &%
(|x| \geq 1) &%
\alert<0>{\Leftrightarrow}&%
\csc y = x &%
\text{ and } &%
y\in \left(0,\frac{\pi}{2}\right] \cup \left(\pi , \frac{3\pi}{2} \right] \\%
\alert<2>{y = \Arcsec x }&%
\alert<2>{(|x| \geq 1) }&%
\alert<2>{\Leftrightarrow}&%
\alert<2>{\sec y = x }&%
\alert<2>{\text{ and } }&%
\alert<2>{y\in  \left[0,\frac{\pi}{2}\right) \cup \left[\pi , \frac{3\pi}{2}\right) }\\%
y = \Arccot x &%
(|x| \in \mathbb{R}) &%
\alert<0>{\Leftrightarrow}&%
\cot y = x &%
\text{ and } &%
y\in (0,\pi )
\end{array}
\]
\end{frame}
\begin{frame}
We will however make use of $\Arcsec x$: we discuss in detail its domain.
\[
\begin{array}{llcrcl}
\alert<1>{y = \Arcsec x }&%
\alert<1>{(|x| \geq 1) }&%
\alert<1>{\Leftrightarrow }&%
\alert<1>{\sec y = x }&%
\alert<1>{\text{ and } }&%
\alert<1>{y\in\only<1-6>{\alert<1-6>{\textbf{?}}} \uncover<7->{\alert<7>{ \left[0,\frac{\pi}{2}\right) \cup \left[\pi , \frac{3\pi}{2}\right) }}}
\end{array}
\]

\begin{columns}
\column{0.43\textwidth}
\psset{xunit=0.5cm, yunit=0.5cm}
\begin{pspicture}(-5.2, -5.2)(5.2,5.2)
\tiny
\fcAxesStandard{-5.15}{-5.15}{5.15}{5.15}

\uncover<1-7>{
\psline[linestyle=dashed](-1.570796327,-5 )(-1.570796327,5)
\psline[linestyle=dashed](1.570796327,-5 )(1.570796327,5)
\psline[linestyle=dashed](4.71238898,-5 )(4.71238898,5)
}
\uncover<10->{
\psline[linestyle=dashed](-5,-1.570796327)(5,-1.570796327)
\psline[linestyle=dashed](-5,1.570796327)(5,1.570796327)
\psline[linestyle=dashed](-5,4.71238898)(5,4.71238898)
}

\fcXTickWithLabel{-1.570796327}{$-\frac{\pi}{2}$}
\fcXTickWithLabel{1}{$1$}
\fcXTick{1.570796327}
\rput[tl](1.6,-0.1){$\frac{\pi}{2}$}
\fcXTickWithLabel{3.141592654}{$\pi$}
\fcXTick{4.71238898}
\rput[tr](4.65,-0.1){$\frac{3\pi}{2}$}
\fcYTickWithLabel{1}{$1$}
\fcYTickWithLabel{1.570796327}{$\frac{\pi}{2}$}
\fcYTickWithLabel{3.141592654}{$\pi$}
\fcYTickWithLabel{4.71238898}{$\frac{3\pi}{2}$}

\uncover<2->{
\rput[l](1.6,4.5){$y=\sec x$}
}
\uncover<9->{
\rput[br](4.9,1.5){$y=\Arcsec x$}
}
\uncover<2-3>{%
%Function formula: 1/\cos{}x
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-4.511031}{-1.772154}{x 57.29578 mul cos -1 exp }
}%
\uncover<4->{%
%Function formula: 1/\cos{}x
\psplot[linecolor=gray!10, plotpoints=1000]{-4.511031}{-1.772154}{x 57.29578 mul cos -1 exp }
}%
\uncover<2-3>{%
%Function formula: 1/\cos{}x
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-1.369438}{0}{x 57.29578 mul cos -1 exp }
}%uncover
\uncover<4->{%
%Function formula: 1/\cos{}x
\psplot[linecolor=gray!40, plotpoints=1000]{-1.369438}{0}{x 57.29578 mul cos -1 exp }
\fcFullDot{0}{1}
}%
\uncover<2->{%
%Function formula: 1/\cos{}x
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{0}{1.369438}{x 57.29578 mul cos -1 exp }
}%
\uncover<2-4,6>{
%Function formula: 1/\cos{}x
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1.772154}{3.141592654}{x 57.29578 mul cos -1 exp }
}%
\uncover<5,7->{
%Function formula: 1/\cos{}x
\psplot[linecolor=gray!40, plotpoints=1000]{1.772154}{3.141592654}{x 57.29578 mul cos -1 exp }
\fcFullDot{3.141592654}{-1}
}%
\uncover<2-3,5,7->{
%Function formula: 1/\cos{}x
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{3.141592654}{4.511031}{x 57.29578 mul cos -1 exp }
}%uncover
\uncover<4,6>{
%Function formula: 1/\cos{}x
\psplot[linecolor=gray!40, plotpoints=1000]{3.141592654}{4.511031}{x 57.29578 mul cos -1 exp }
\fcFullDot{3.141592654}{-1}
}%uncover
\uncover<8->{%
\psline[linestyle=dashed, linecolor=\fcColorTangent](-4.9,-4.9)(4.9,4.9)
}
\uncover<9->{
%Function formula: - \arccos{}(x^{-1})+2 \pi
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-5}{-1.00001}{ 3.141592654 2 mul x -1 exp ACOS -1 mul add }
%Function formula: \arccos{}(x^{-1})
\psplot[linecolor=gray!40, plotpoints=1000]{-5}{-1.00001}{x -1 exp ACOS }
%Function formula: \arccos{}(x^{-1})
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1.00001}{5}{x -1 exp ACOS }
%Function formula: -\arccos{}(x^{-1})
\psplot[linecolor=gray!40, plotpoints=1000]{1.00001}{5}{x -1 exp ACOS -1 mul}
}
\end{pspicture}
%\ \only<handout:0| -1>{%
%\includegraphics[width=5cm]{inverse-trig/pictures/07-06-seca.pdf}%
%}%
%\only<2->{%
%\includegraphics[width=5cm]{inverse-trig/pictures/07-06-secb.pdf}%
%}%
\column{0.57\textwidth}
\begin{itemize}
\item<2-> \noindent Plot $\sec x$.
\item<3-> Restrict domain to make one-to-one: Two common choices: \alert<4>{$x\in \left[0, \frac{\pi}{2}\right)\cup\left(\frac{\pi}{2}, \pi \right] $} and \alert<5>{$x\in \left[0, \frac{\pi}{2} \right) \cup \left[\pi,\frac{3\pi}{2} \right) $}.

\item<6-> $x\in \left[0, \frac{\pi}{2}\right)\cup\left(\frac{\pi}{2}, \pi \right] $ is good because the domain is easiest to remember: an interval without a point. \textbf{NOT our choice.}

\item<7,8,9,10-> $x\in \left[0, \frac{\pi}{2} \right) \cup \left[\pi,\frac{3\pi}{2} \right) $ is  good because $\tan x$ is positive on both intervals, resulting in easier differentiation and integration formulas. \textbf{Our choice.}

\end{itemize}
\end{columns}

\end{frame}

\begin{frame}
Table of derivatives of inverse trigonometric functions:
\begin{align*}
\frac{\diff}{\diff x} (\Arcsin x) & = %
\frac{1}{\sqrt{1-x^2}} &%
\frac{\diff}{\diff x} (\Arccsc x) & = %
-\frac{1}{x\sqrt{x^2-1}} \\%
\frac{\diff}{\diff x} (\Arccos x) & = %
-\frac{1}{\sqrt{1-x^2}} &%
\frac{\diff}{\diff x} (\Arcsec x) & = %
\frac{1}{x\sqrt{x^2-1}} \\%
\frac{\diff}{\diff x} (\Arctan x) & = %
\frac{1}{1+x^2} &%
\frac{\diff}{\diff x} (\Arccot x) & = %
-\frac{1}{1+x^2} %
\end{align*}
\end{frame}
% end module inverse-trig-summary



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/arcsin-ex5.tex
% begin module arcsin-ex5
\begin{frame}
\chainruley{\frac{1}{\Arcsin x}}{\Arcsin x}{u^{-1}}{-UU^{-2}}{\frac{1}{\sqrt{1-x^2}}}{-\frac{1}{(UU)^2\sqrt{1-x^2}}}{0}
\end{frame}
% end module arcsin-ex5



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/inverse-trig/inverse-trig-reminder.tex
% begin module inverse-trig-reminder
\begin{frame}
All of the inverse trigonometric derivatives also give rise to integration formulas.  These two are the most important:
\begin{align*}
\int \frac{1}{\sqrt{1-x^2}}\diff x & = \Arcsin x + C.\\
& \\
\int \frac{1}{x^2 + 1}\diff x & = \Arctan x + C.
\end{align*}
\end{frame}
% end module inverse-trig-reminder



}% end lecture

%begin lecture
\lect{Spring 2015}{Lecture 2}{2}{
\section{Integration, Review}
\subsection{The Evaluation Theorem (FTC part 2)}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/antiderivatives/antiderivative-def.tex
% begin module antiderivative-def
\begin{frame}
\frametitle{Antiderivatives}
\begin{definition}[Antiderivative]
A function $F$ is called an antiderivative of $f$ on an interval $I$ if $F'(x) = f(x)$ for all $x$ in $I$.
\end{definition}
\end{frame}
% end module antiderivative-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/integration/FTC-part2.tex
% begin module FTC-part2
\begin{frame}
\uncover<3->{
\begin{theorem}
Let $f$ be a continuous function on $[a,b]$. Then $f$ is integrable over $[a,b]$.
\end{theorem}
}
\uncover<2->{
\uncover<3->{In other words,} \alert<2>{$\displaystyle\int_a^{b}f(x)dx $ exists for any continuous (over $[a,b]$) function $f$}.
}

\begin{theorem}[The Evaluation Theorem (FTC part 2)]
If \alert<2>{$f$ is continuous on $[a, b]$}, then
\[
\alert<2>{\int_a^b f(x) \diff x} = F(b) - F(a),
\]
where $F$ is any antiderivative of $f$.
\end{theorem}

\end{frame}
% end module FTC-part2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/integration/indefinite-integral-intro.tex
% begin module indefinite-integral-intro
\begin{frame}\frametitle{Indefinite Integrals}
\begin{itemize}
\item  The Evaluation Theorem establishes a connection between antiderivatives and definite integrals.
\item  It says that $\int_a^b f(x)\diff x$ equals $F(b) - F(a)$, where $F$ is an antiderivative of $f$.
\item  We need convenient notation for writing antiderivatives.
\item  This is what the indefinite integral is.
\end{itemize}
\begin{definition}[Indefinite Integral]
The indefinite integral of $f$ is another way of saying the antiderivative of $f$, and is written $\int f(x) \diff x$.  In other words,
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\int f(x) \diff x = F(x) \qquad \text{means}\qquad F'(x) = f(x).
\]
\end{definition}
\end{frame}

\begin{frame}
\begin{example}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\int x^4 \diff x = \uncover<2->{\frac{x^5}{5}} \uncover<3->{\alert<handout:0| 3>{+ C}}
\]
\uncover<4->{because}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<4->{\frac{\diff}{\diff x}\left( \frac{x^5}{5} + C\right) = x^4.}
\]
\end{example}
\begin{itemize}
\item<5->  The indefinite integral represents a whole family of functions.
\item<6->  Example: %1b, p. 318:  
the general antiderivative of $\frac{1}{x}$ is
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<6->{%
F(x) = \left\{ \begin{array}{ccc}
\ln |x| + C_1 & \text{ if } & x > 0\\
\ln |x| + C_2 & \text{ if } & x < 0
\end{array}\right.
}%
\]
\item<7->  We adopt the convention that the constant participating in an indefinite integral is only valid on one interval.
\item<8->  $\int \frac{1}{x} \diff x = \ln |x| + C$, and this is valid either on $(-\infty , 0)$ or $(0, \infty)$.
\end{itemize}
\end{frame}
% end module indefinite-integral-intro



\section{Integration Techniques from Calc I, Review}
\subsection{Differential Forms, Review}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/differentials/differential-def-version2.tex
% begin module differential-def
\begin{frame}
\frametitle{Differentials}
\begin{itemize}
\item<1-> Recall $\Delta y, \Delta x$ stand for change of $x,y$. Recall: \alert<12>{$\displaystyle \Delta y\approx \frac{\diff y}{\diff x} \Delta x$}
\item $\displaystyle \only<1-2>{\Delta y} 
\only<3->{\alert<3,6> {\alert<7>{\diff}y}} \only<1-3>{\approx}
\only<4->{\alert<3> =} \only<1->{\frac{\diff y}{\alert<5>{\diff x}}}
\only<1-3>{ \Delta x} 
\only<4->{\alert<4,5,8>{\alert<7>{\diff}x}}
\only<6->{=\alert<6>{\alert<7>{\diff}y} }
$
\item<2-> If we substitute \alert<3>{$\Delta y $ by the formal expression $\diff y$} and \alert<4>{$\Delta x$ by the formal expression $\diff x$}, the expression \alert<5>{$\diff x$ appears to ``cancel''} to give a \alert<6>{formal identity}.
\item<7-> Define the \alert<7,11>{\emph{differential $\diff$}} %\uncover<8->
{ and the \alert<8,10>{\emph{differential forms $\diff x$, $\diff(f(x))$}}} %\uncover<9->
{by requesting that \alert<9>{$\diff$ and $\diff x$ satisfy the transformation law} 
\[
\alert<9>{\alert<8>{\alert<7>{\diff}(f(x))}=f'(x) \alert<8>{\alert<7>{\diff}x}}
\] 
for any differentiable function $f(x)$.} In abbreviated notation:
\[ 
\alert<9>{ \alert<7>{\diff}f = f' \alert<8>{\alert<7>{\diff}x}}
\]
\uncover<10->{Expressions containing expression of the form $\alert<10>{\alert<11>{\diff}(something)}$ are called \alert<10>{differential forms}.}
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item $\alert<4,9,12>{\alert<3>{ \alert<2>{\diff} f(x)}= f'(x) \alert<3>{\alert<2>{\diff}x}}$.
\item<2-> On the previous slide we stated the \alert<2>{differential $\diff$} and the \alert<3>{differential forms} $\alert<3>{\diff x, \diff f(x)}$ are \alert<4,8>{formal expressions related by a transformation law}.
\item<5-> The precise definitions of differential forms and differentials are outside of the scope of Calculus I and II. 
\item<6-> Differential forms ``encode'' linear approximations which in turn ``encode'' ``infinitesimal'' lengths of segments.
\item<7-> Courses such as ``Integration and Manifolds'' or ``Differential geometry'' usually give precise definitions and fill in the details.
\item<8-> Nonetheless, \alert<8>{what we studied} is \alert<9>{completely sufficient} for practical purposes and \alert<9>{carrying out computations}.
\item<10-> \alert<10,11>{\textbf{Do not confuse differentials with derivatives.}} \uncover<12->{\alert<12>{The correct equality is this.}}

\[
\only<10>{\alert<10,11>{ \diff f(x) = f'(x)}} \only<11->{\alert<10,11>{ \xcancel{ \diff f(x) = f'(x)}}}
\quad \quad \quad\quad \quad \uncover<12>{\alert<12>{\diff f(x)=f'(x)\diff x}}
\]
\end{itemize}
\end{frame}



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/differentials/differentials-integration-connection-intro.tex
%begin module differentials-integration-connection-intro
\begin{frame}
\begin{itemize}
\item<1-> We defined $\displaystyle\int f(x) \diff x$ as an anti-derivative of $f(x)$ and $\displaystyle \only<2>{\color{red} } \only<3>{ \color{black} } \int\limits^{b}_{a} \uncover<2>{\color{black}}  \alert<4>{f( x) }\alert<3>{ \diff x} $ as the definite integral of $f$.
\item<2-> The $\alert<2>{\int}$ sign stands for the \alert<2>{limit of a Riemann sum} (sum of \alert<3,4>{approximating rectangles}).
\item<3-> $\alert<3>{\diff x}$ ``encodes''  \alert<3>{the length of the base} of an ``\alert<5>{infinitesimally small}'' approximating rectangle\uncover<4->{, $\alert<4>{f(x)}$ stands for the \alert<4>{height}.}
\item<5-> ``\alert<5>{Infinitesimally small}'' is an informal expression. 
\item<6-> Formally, the expression $f(x) \diff x$ is a differential form (the same differential forms discussed in the preceding slides).
\item<7-> We did not give a complete formal definition of a differential form, but we showed how to compute with those. 
\item<8-> Computing with differential forms is consistent with computing with integrals: the integrals of equal differential forms are equal.  This follows directly from the Net Change Theorem (the substitution rule for integrals), which in turn follows from the Fundamental Theorem of Calculus and the Chain Rule.
\end{itemize}
\end{frame}

%end module differentials-integratino-connection-intro


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/differentials/differentials-integration-rules.tex
%begin module differentials-rules
\begin{frame}
\begin{itemize}
\item All rules for computing with derivatives have analogues for computing with differential forms.
\item<2-> The rules for computing differential forms are a direct consequence of the corresponding derivative rules and the transformation law $\diff (f(x))=f'(x)\diff x$.
\end{itemize}
\end{frame}
\begin{frame}
\uncover<3->{Let $c$ be a constant.} Rule name: \phantom{p}
\only<1,2>{\alert<1,2>{product rule. }}
\only<3,4>{\alert<3,4>{constant derivative rule. }}
\only<7,8>{\alert<7,8>{sum rule. }}
\only<9,10>{\alert<9,10>{chain rule. }}
\only<11-12>{\alert<11-12>{power rule. }}
\only<13-14>{\alert<13-14>{exponent derivative rule. }}
%\only<5,6>{\alert<5,6>{ Constant derivative rule. }}
\only<22>{\alert<22>{Integration by parts.}}
\only<23>{\alert<23>{Integration is linear.}}
\only<24>{\alert<24>{Substitution rule.}}

\uncover<21->{Corresponding \alert<21>{integration rules.} \uncover<25->{\alert<25>{ Integration rules justified via the Fundamental Theorem of Calculus}}}

\begin{tabular}{ll}
\only<1-20>{Differential}\only<21->{\alert<21>{Integration}} rule & Derivative rule \\
\uncover<2->{\alert<22>{$\uncover<21->{\alert<21>{\int}} \diff (fg)=\uncover<21->{\alert<21>{\int}} g \diff f +\uncover<21->{\alert<21>{\int}} f \diff g$} }& 
\uncover<1->{$ (fg)'=f'g +f g'$} \\
\uncover<4->{$\uncover<21->{\alert<21>{\int}}\diff c= 0$} &
\uncover<3->{$(c)'=0$}\\
\uncover<6->{\alert<23>{$\uncover<21->{\alert<21>{\int}}\diff (cf)=c \uncover<21-> {\alert<21>{\int}}\diff f $}} & 
\uncover<5->{$(cf)'=cf'$} \\
\uncover<8->{\alert<23>{$\uncover<21->{\alert<21>{\int}}\diff (f+g) = \uncover<21->{\alert<21>{\int}}\diff f +\uncover<21->{\alert<21>{\int}}\diff g$}} & 
\uncover<7->{$(f+g)'=f'+g'$}\\
\uncover<10->{\alert<24>{$\uncover<21->{\alert<21>{\int}}\diff f(g(x))=$ $ \uncover<21->{\alert<21>{\int}}f'(g(x))\diff g(x) $} }\\
\uncover<10->{\alert<24>{$\phantom{\int \diff f(g(x))}=$ $\uncover<21->{\alert<21>{\int}}f'(g(x))g'(x)\diff x$} } & 
\uncover<9->{$(f(g(x)))'= f'(g(x))g'(x)$} \\ 
\uncover<10->{\alert<24>{$\uncover<21->{\alert<21>{\int}} \diff f(g)\phantom{(x)}= \uncover<21->{\alert<21>{\int}} f'(g) \diff g$} } \\\hline
\uncover<12->{$\diff  x^n= nx^{n-1}\diff x$} & 
\uncover<11->{$(x^n)'=nx^{n-1}$}\\
\uncover<14->{$\diff  e^x= e^x \diff x$} & 
\uncover<13->{$\left(e^x\right)'=e^x$}\\
\uncover<16->{$\diff \sin x = \cos x \diff x$} & 
\uncover<15->{$(\sin x)'= \cos x$}\\
\uncover<18->{$\diff \cos x = -\sin x \diff x$} & 
\uncover<17->{$(\cos x)'= -\sin x$}\\
\uncover<20->{$\displaystyle \diff \ln x=\frac{1}{x}\diff x$} & 
\uncover<19->{$(\ln x)'=\displaystyle \frac1x$}\\
\end{tabular}


\end{frame}
%end module differentials-rules


\section{Integration and Logarithms, Review}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/logarithms/power-rule-minus-one.tex
% begin module power-rule-minus-one
\begin{frame}
We recall from previous slides that
\[
\frac{\diff}{\diff x} (\ln |x|) = \frac{1}{x}.
\]
This formula has a special application to integration:
\begin{theorem}[The Integral of $1/x$]
\[
\int \frac{1}{x} \diff x = \ln |x| + C.
\]
\end{theorem}
\uncover<2->{
This fills in the gap in the rule for integrating power functions:
\[
\int x^n \diff x = \frac{x^{n+1}}{n+1} + C, \qquad n \neq -1.
\]
Now we know the formula for $n = -1$ too.
}
\end{frame}
% end module power-rule-minus-one



} % end lecture

% begin lecture
\lect{Spring 2015}{Lecture  3}{3}{
\section{Integration by Parts}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/integration-by-parts/integration-by-parts-intro.tex
% begin module integration-by-parts-intro
\begin{frame}
\frametitle{Integration by Parts}
\begin{itemize}
\item  Every differentiation rule has a corresponding integration rule.
\item<2->  The rule that corresponds to the Product Rule for differentiation is called the rule of Integration by Parts.
\item<3->  Product Rule: $\frac{\diff}{\diff x} [f(x)g(x)] = f(x)g'(x) + f'(x)g(x)$.
\item<4->  In the notation for indefinite integrals:
\end{itemize}
\belowdisplayskip=0pt
\abovedisplayskip=0pt
\begin{eqnarray*}
\uncover<5->{\int [f(x)g'(x) + g(x)f'(x)]\diff x} & \uncover<5->{ = } & \uncover<5->{f(x)g(x)}\\
\uncover<6->{\int f(x)g'(x)\diff x + \int g(x)f'(x)\diff x} & \uncover<6->{ = } & \uncover<6->{f(x)g(x)}\\
\uncover<7->{\int \alert<handout:0| 10>{f(x)}\alert<handout:0| 11>{g'(x)\diff x}} & \uncover<7->{ = } & \uncover<7->{\alert<handout:0| 12>{f(x)}\alert<handout:0| 13>{g(x)} - \int \alert<handout:0| 14>{g(x)}\alert<handout:0| 15>{f'(x)\diff x}}\\
\end{eqnarray*}
\uncover<8->{Let $\alert<handout:0| 10,12>{f(x) = u}$ and $\alert<handout:0| 13-14>{g(x) = v}$, so that $\alert<handout:0| 15>{\diff u = f'(x)\diff x}$ and $\alert<handout:0| 11>{\diff v = g'(x) \diff x}$. }
\uncover<9->{%
\[
\int \alert<handout:0| 10>{u}\alert<handout:0| 11>{\diff v} = \alert<handout:0| 12>{u}\alert<handout:0| 13>{v} - \int \alert<handout:0| 14>{v} \alert<handout:0| 15>{\diff u}.
\]
}%
\end{frame}
% end module integration-by-parts-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/integration-by-parts/integration-by-parts-ex1.tex
% begin module integration-by-parts-ex1
\begin{frame}
Integration by parts:
\belowdisplayskip=0pt
\abovedisplayskip=0pt
\[
\int u\diff v = uv - \int v\diff u.
\]
\begin{example} %[Example 1, p. 489]
Find $\int x\sin x \diff x$.

\uncover<2->{%
Let $u = x$ and let $\diff v = \sin x\diff x$.  Then $\alert<handout:0| 3-4>{\diff u = \uncover<4->{\diff x}}$ and $\alert<handout:0| 5-6>{v = \uncover<6->{-\cos x}}$.  
}%
\begin{eqnarray*}
\uncover<7->{\int x\sin x\diff x} & \uncover<7->{ = } & \uncover<7->{uv - \int v\diff u}\\
 & \uncover<8->{ = } & %
\uncover<8->{x(-\cos x) - \int (-\cos x)\diff x}\\
 & \uncover<9->{ = } & %
\uncover<9->{-x\cos x + \int \cos x\diff x}\\
 & \uncover<10->{ = } & %
\uncover<10->{-x\cos x + \sin x + C}\\
\end{eqnarray*}
\uncover<11->{
Note:  This choice of $u = x$ was made to obtain a simpler integral.  It worked because $\diff u = \diff x$---the $x$ ``disappeared.''
}
\end{example}
\end{frame}
% end module integration-by-parts-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/integration-by-parts/integration-by-parts-ex2.tex
% begin module integration-by-parts-ex2
\begin{frame}
\begin{example} %[Example 2, p. 490]
Find $\int \ln x \diff x$.

\uncover<2->{%
Let $u = \ln x$ and let $\diff v = \diff x$.  Then $\alert<handout:0| 3-4>{\diff u = \uncover<4->{\frac{1}{x}\diff x}}$ and $\alert<handout:0| 5-6>{v = \uncover<6->{x}}$.  
}%
\begin{eqnarray*}
\uncover<7->{\int \ln x\diff x} & \uncover<7->{ = } & \uncover<7->{uv - \int v\diff u}\\
 & \uncover<8->{ = } & %
\uncover<8->{(\ln x)x - \int x\cdot \frac{1}{x}\diff x}\\
 & \uncover<9->{ = } & %
\uncover<9->{x\ln x - \int \diff x}\\
 & \uncover<10->{ = } & %
\uncover<10->{x\ln x - x + C}\\
\end{eqnarray*}
\uncover<11->{
Note:  Integration by parts works in this example because the derivative of the function $u = \ln x$ is simpler than $\ln x$.
}
\end{example}
\end{frame}
% end module integration-by-parts-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/integration-by-parts/integration-by-parts-ex3.tex
% begin module integration-by-parts-ex3
\begin{frame}
\begin{example} %[Example 3, p. 491]
Find $\int t^2e^t \diff t$.

\uncover<2->{%
\[
\begin{array}{l@{\qquad}l}
\alert<handout:0| 3-4>{u = \uncover<4->{t^2}} & \alert<handout:0| 5-6>{\diff v = \uncover<6->{e^t\diff t}}\\
\alert<handout:0| 7-8>{\diff u = \uncover<8->{2t\diff t}} & \alert<handout:0| 9-10>{v = \uncover<10->{e^t}}
\end{array}\qquad
\alert<handout:0| 11-12,24>{%
\uncover<2->{\int t^2e^t \diff t}  \uncover<2->{ = }  \uncover<12->{t^2e^t - 2 \int te^t\diff t}
}%
\]
}%
\uncover<13->{
Do it again:
\[
\begin{array}{l@{\qquad}l}
\alert<handout:0| 14-15>{u = \uncover<15->{t}} & \alert<handout:0| 16-17>{\diff v = \uncover<17->{e^t\diff t}}\\
\alert<handout:0| 18-19>{\diff u = \uncover<19->{\diff t}} & \alert<handout:0| 20-21>{v = \uncover<21->{e^t}}
\end{array}\qquad
\alert<handout:0| 22-23,25>{%
\uncover<13->{\int te^t \diff t}  \uncover<13->{ = }  \uncover<23->{te^t - \int e^t\diff t}
}%
\]
}
\begin{eqnarray*}
\uncover<24->{%
\alert<handout:0| 24>{
\int t^2e^t\diff t
}}%
& \uncover<24->{\alert<handout:0| 24>{ = }} &%
\uncover<24->{\alert<handout:0| 24>{t^2e^t - 2\alert<handout:0| 25>{\int te^t\diff t}}}\\
& \uncover<25->{ = } &%
\uncover<25->{t^2e^t - 2\alert<handout:0| 25>{\left( te^t - \int e^t\diff t \right)}}\\
& \uncover<26->{ = } &%
\uncover<26->{%
t^2e^t - 2te^t + 2e^t + C.
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module integration-by-parts-ex3



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/integration-by-parts/integration-by-parts-ex4.tex
% begin module integration-by-parts-ex4
\begin{frame}
\begin{example} %[Example 4, p. 491]
Find $\int e^x \sin x \diff x$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\uncover<2->{%
\[
\begin{array}{l@{\ \ }l}
\alert<handout:0| 3-4>{u = \uncover<4->{e^x}} & \alert<handout:0| 5-6>{\diff v = \uncover<6->{\sin x\diff x}}\\
\alert<handout:0| 7-8>{\diff u = \uncover<8->{e^x\diff x}} & \alert<handout:0| 9-10>{v = \uncover<10->{-\cos x}}
\end{array}\ \ 
\alert<handout:0| 11-12,24>{%
\uncover<2->{\int e^x\sin x \diff x}  \uncover<2->{ = }  \uncover<12->{-e^x\cos x + \int e^x\cos x\diff x}
}%
\]
}%
\uncover<13->{
Do it again:
\[
\begin{array}{l@{\ \ }l}
\alert<handout:0| 14-15>{u = \uncover<15->{e^x}} & \alert<handout:0| 16-17>{\diff v = \uncover<17->{\cos x\diff x}}\\
\alert<handout:0| 18-19>{\diff u = \uncover<19->{e^x \diff x}} & \alert<handout:0| 20-21>{v = \uncover<21->{\sin x}}
\end{array}\ \ 
\alert<handout:0| 22-23,25>{%
\uncover<13->{\int e^x\cos x \diff x}  \uncover<13->{ = }  \uncover<23->{e^x\sin x - \int e^x\sin x\diff x}
}%
\]
}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<24->{%
\alert<handout:0| 24>{
\int e^x\sin x\diff x
}}%
& \uncover<24->{\alert<handout:0| 24>{ = }} &%
\uncover<24->{\alert<handout:0| 24>{-e^x\cos x + \alert<handout:0| 25>{\int e^x\cos x\diff x}}}\\
& \uncover<25->{ = } &%
\uncover<25->{-e^x\cos x + \alert<handout:0| 25>{e^x\sin x - \int e^x\sin x\diff x }}\\
\uncover<26->{%
2\int e^x\sin x\diff x
}%
& \uncover<26->{ = } &%
\uncover<26->{%
-e^x\cos x + e^x\sin x
}\\%
\uncover<27->{%
\int e^x\sin x\diff x
}%
& \uncover<27->{ = } &%
\uncover<27->{%
\frac{1}{2}e^x(\sin x - \cos x) + C.
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module integration-by-parts-ex4



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/integration-by-parts/integration-by-parts-ex5.tex
% begin module integration-by-parts-ex5
\begin{frame}
\begin{example}[] %[Example 5, p. 492]
Find $\int_0^1  \Arctan x \diff x$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\uncover<2->{%
\[
\begin{array}{l@{\qquad}l}
\alert<handout:0| 3-4>{u = \uncover<4->{\Arctan x}} & \alert<handout:0| 5-6>{\diff v = \uncover<6->{\diff x}}\\
\alert<handout:0| 7-8>{\diff u = \uncover<8->{\frac{\diff x}{1+x^2}}} & \alert<handout:0| 9-10>{v = \uncover<10->{x}}
\end{array}  
\alert<handout:0| 11-12,23>{%
\uncover<2->{\int_0^1 \Arctan x \diff x}  \uncover<2->{ = }  \uncover<12->{\left[x\Arctan x\right]_0^1 -  \int_0^1 \frac{x}{1+x^2} \diff x}
}%
\]
}%
\begin{itemize}
\item<13->  Substitute $\alert<handout:0| 13-14>{t = \uncover<14->{1+x^2}}$.  Then $\alert<handout:0| 15-16>{\diff t = \uncover<16->{2x\diff x}}$\uncover<16->{, so $x\diff x = \frac{1}{2}\diff t$.}
\item<17->  When $x = 0$, $\alert<handout:0| 17-18>{t = \uncover<18->{1.}}$  When $x = 1$, $\alert<handout:0| 19-20>{t = \uncover<20->{2.}}$
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\alert<handout:0| 24>{%
\uncover<13->{%
\int_0^1\frac{x}{1+x^2}\diff x = 
}%
\uncover<21->{%
\frac{1}{2}\int_1^2\frac{\diff t}{t} = 
}%
\uncover<22->{%
\frac{1}{2}\left[ \ln |t|\right]_1^2
}%
}%
\]
\[
\begin{array}{rcl}
\displaystyle \uncover<23->{%
\alert<handout:0| 23>{
\int_0^1 \Arctan x\diff x
}}%
& \uncover<23->{\alert<handout:0| 23>{ = }} &% 
\displaystyle
\uncover<23->{\alert<handout:0| 23>{\left[ x\Arctan x\right]_0^1 -  \alert<handout:0| 24>{\int_0^1 \frac{x}{1+x^2}\diff x}}}\\ ~\\
& \uncover<24->{ = } &%
\uncover<24->{\left[ x\Arctan x\right]_0^1 -  \alert<handout:0| 24>{\frac{1}{2}\left[ \ln |t|\right]_1^2}}\\~\\
& \uncover<25->{ = } &%
\uncover<25->{%
1\cdot \Arctan1 - 0\cdot \Arctan 0 - \frac{1}{2}(\ln 2 - \ln 1)
}\\
\uncover<26->{ &=& \frac{\pi}{4} - \frac{\ln 2}{2}}\\%
\end{array}
\]
\end{example}
\end{frame}
% end module integration-by-parts-ex5



}% end lecture

% begin lecture
\lect{Spring 2015}{Lecture 4}{4}{
\section{Integration of Rational Functions}
\subsection{Building block integrals}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-building-blocks-intro.tex
%begin module partial-fractions-building-blocks-intro
\begin{frame}
\frametitle{Integrating arbitrary rational functions}
Let $\frac{P(x)}{Q(x)}$ be an arbitrary rational function, i.e., a quotient of polynomials.
\begin{question}
Can we integrate $\displaystyle\int \frac{P(x)}{Q(x)}\diff x$?
\end{question}
\begin{itemize}
\item<2-> Yes. We will learn how in what follows.
\item<3-> The algorithm for integration is roughly:
\begin{itemize}
\item<4-> We use algebra to split $\frac{P(x)}{Q(x)}$ into smaller pieces (``partial fractions''). 
\item<5-> We use linear substitutions to transform each piece to one of $3$ pairs of basic building block integrals. 
\item<6-> We solve each building block integral and collect the terms.
\end{itemize}
\item<7-> We study the algorithm ``from the ground up'': we start with the building blocks.
\end{itemize}
\end{frame}

%end module partial-fractions-building-blocks-intro


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-building-blocks-the-3-types.tex
%begin module partial-fractions-building-blocks-3-and-4-intro
\begin{frame}
\frametitle{The building blocks}
Let $n$ be a positive integer.
\begin{itemize}
\item (Building block I) The first building block integral is:  

$\displaystyle \int \frac{1}{x^n }\diff x\quad .$
\item<2-> (Building block II) The second building block integral is: 

$\displaystyle \int \frac{\alert<4>{x}}{(\alert<3>{1+x^2})^n }\alert<4>{\diff x}.$ \uncover<3->{ (Note: $\alert<3>{u=1+x^2}, \alert<4>{x\diff x=\frac{1}{2}\diff u}$ transforms II to I).}
\item<5-> (Building block III) The third building block integral is: 

$\displaystyle \int \frac{1}{(1+x^2)^n }\diff x\quad .$
\item<6-> The case $n=1$ is special for each of the building blocks: 

$\displaystyle \int \frac{1}{x}\diff x$, $\displaystyle \int \frac{x}{1+x^2 }\diff x$ and $\displaystyle \int \frac{1}{1+x^2 }\diff x$.
\item<7-> The case $n=1$ we call respectively building block Ia, IIa and IIIa. 
\uncover<8-> {The case $n>1$ we call respectively building block Ib, IIb and IIIb.} \uncover<9->{ This ``building block'' terminology serves our convenience, and is not a part of standard mathematical terminology. }
\end{itemize}

\end{frame}
%end module partial-fractions-building-blocks-3-and-4-intro


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-building-block-1a.tex
%begin module partial-fractions-building-block-1a
\begin{frame}
\frametitle{Building block Ia}
Building block Ia: $\displaystyle \int \frac{1}{x }\diff x$. 
\begin{example} Integrate building block Ia
\[
\int \frac{1}{x }\diff x \uncover<2->{\alert<2,3>{ =}}\uncover<3->{\alert<3>{\ln | x | +C} }
\]
\end{example}
\end{frame}
\begin{frame}
\frametitle{Linear substitutions leading to building block Ia}
Building block Ia: $\displaystyle \int \frac{1}{x }\diff x=\ln |x|+ C$. 
\begin{example} Integrate 
\[
\begin{array}{rcll|l}
\displaystyle \alert<9>{\int \frac{1}{-4x+5 }\diff x} \uncover<2->{&=&\displaystyle \int \frac{1}{(-4x+5) }\frac{\alert<3>{ \diff (\alert<2>{-4} x)}}{ (\alert<2>{-4})}} \\
\uncover<3->{&=&\displaystyle \int \frac{1}{\alert<4>{(-4x+5)} } \frac{\alert<3>{\diff (\alert<4>{-4x+5})}}{ (-4)} \uncover<4->{&&\text{Set } \alert<4,8>{u=-4x+5}}}\\
\uncover<4->{&=&\displaystyle \int \alert<6>{\frac{1}{\alert<4>{u}}}\frac{\diff \alert<4>{u}}{(\alert<5>{-4})}}\\
\uncover<5->{&=&\displaystyle \alert<5>{-\frac{1}{4}} \alert<7>{\int \alert<6>{u^{-1}} \diff u} }\uncover<7->{=-\frac{1}{4}\alert<7>{\ln |\alert<8>{u}|}+C}\\
\uncover<8->{&=&\displaystyle \alert<9>{-\frac{1}{4}\ln |\alert<8>{-4x+5}|  +C}\quad .}
\end{array}
\]

\end{example}
\end{frame}
\begin{frame}
\frametitle{Lin. subst. leading to building block Ia: general case}
Building block Ia: $\displaystyle \int \frac{1}{x }\diff x=\ln |x|+ C$. 
\begin{example} Integrate 
\[
\begin{array}{rcll|l}
\displaystyle \alert<1>{ \int \frac{1}{ax+b }\diff x}&=&\displaystyle \int \frac{1}{(ax+b) }\frac{\diff (a x)}{a} \\
&=&\displaystyle \int \frac{1}{(ax+b) }\frac{\diff (ax+b)}{a} &&\text{Set }u=ax+b{~~~~~~~~~~~~~~~~~}\\
&=&\displaystyle \int\frac{1}{u}\frac{\diff u}{a}\\
&=&\displaystyle \frac{1}{a}\int u^{-1} \diff u =\frac{1}{a}\ln |u|+C\\
&=&\displaystyle \alert<1>{\frac{1}{a}\ln |ax+b|  +C}\quad .
\end{array}
\]

\end{example}
\end{frame}

%end module partial-fractions-building-block-1a





%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-building-block-1b.tex
%begin module partial-fractions-building-block-1b
\begin{frame}
\frametitle{Building block Ib}
Building block Ib: $\displaystyle \int \frac{1}{x^n }\diff x=\int x^{-n}\diff x$, $n\neq 1$. 
\begin{example} Integrate the building block integral Ib
\[
\int \frac{1}{x^n }\diff x\quad , n\neq 1.
\]

\[
\int \frac{1}{x^n}\diff x \uncover<2->{\alert<2,3>{= \int x^{-n}\diff x}}\uncover<3->{\alert<3>{=}} \uncover<4->{\alert<4>{\frac{x^{-n+1}}{-n+1} +C}}
\]
\end{example}
\end{frame}
\begin{frame}
\frametitle{Linear substitutions leading to building block Ib}
Building block Ib: $\displaystyle \int \frac{1}{x^n }\diff x=\int x^{-n}\diff x= \frac{x^{-n+1}}{-n+1} +C$, $n\neq 1$. 
\begin{example} Integrate 
\[
\begin{array}{rcll|l}
\alert<8>{\displaystyle \int \frac{1}{(3x+5)^3 }\diff x} \uncover<2->{&=&\displaystyle \int \frac{1}{(3x+5)^3 }\frac{\alert<3>{ \diff (\alert<2>{3} x)}}{\alert<2>{3}}} \\
\uncover<3->{&=&\displaystyle \int \frac{1}{(\alert<4>{3x+5})^3 }\frac{\alert<3>{\diff ( \alert<4>{3 x+5})}}{3}} \uncover<4->{&&\text{Set }\alert<4,7>{ u=3x+5}{~~~~~~~~~~~~~~~~~~~} } \\
\uncover<4->{&=&\displaystyle \int\alert<5>{ \frac{1}{{\alert<4>{u}}^3} } \frac{\diff \alert<4>{u}}{3}}\\
\uncover<5->{ &=&\displaystyle \frac{1}{3} \alert<6>{\int \alert<5>{ u^{-3}} \diff u}} \uncover<6->{ =\frac{1}{3} \alert<6>{ \frac{{\alert<7>{u}}^{-2}}{(-2)}}+C}\\
\uncover<7->{&=&\displaystyle \alert<8>{-\frac{1}{6(\alert<7>{3x+5})^2}+C}\quad .}
\end{array}
\]

\end{example}
\end{frame}
\begin{frame}
\frametitle{Lin. subst. leading to building block Ib: general case}
Building block Ib: $\displaystyle \int \frac{1}{x^n }\diff x=\int x^{-n}\diff x= \frac{x^{-n+1}}{-n+1} +C$, $n\neq 1$. 
\begin{example} Let $n\neq 1$. Integrate 
\[
\begin{array}{rcll|l}
\displaystyle \alert<1>{\int \frac{1}{(ax+b)^n }\diff x} &=&\displaystyle \int \frac{1}{(ax+b)^n }\frac{\diff (a x)}{a} \\
&=&\displaystyle \int \frac{1}{(ax+b)^n }\frac{\diff (a x+b)}{a} &&\text{Set }u=ax+b\\
&=&\displaystyle \int\frac{1}{u^3}\frac{\diff u}{a}\\
&=&\displaystyle \frac{1}{a}\int u^{-n} \diff u =-\frac{1}{a} \frac{u^{-n+1}}{(n-1)}+C\\
&=&\displaystyle \alert<1>{-\frac{1}{ a(n-1)(ax+b)^{n-1}}+C}\quad .
\end{array}
\]

\end{example}
\end{frame}

%end module partial-fractions-building-block-1b


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-building-blocks-2a-and-3a.tex
%begin module partial-fractions-building-blocks-2a-and-3a
%This module may be too long, perhaps a split is needed.
%\begin{comment}
\begin{frame}
\frametitle{Building blocks IIa and IIIa}
Building block IIa: $\int \frac{x}{1+x^2}\diff x.$

Building block IIIa: $\int \frac{1}{1+x^2 }\diff x.$
\begin{example}
Integrate 
\[
\begin{array}{rcl}
\displaystyle \int \frac{\alert<2>{x}}{1+x^2 }\alert<2>{ \diff x} \uncover<2->{&=&\displaystyle \int \frac{1}{(1+x^2) }\alert<2>{ \frac{\alert<3>{\diff (x^2)}}{2}}} \uncover<3->{=\alert<4>{ \int \frac{1}{1+x^2 }} \frac{\alert<3,4>{\diff (1+x^2)}}{2}} \\
\uncover<4->{&=&\displaystyle\frac12\alert<4>{ \ln (1+x^2)}+C\quad .}
\end{array}
\]
\end{example}
\uncover<5->{
\begin{example}
Integrate 
\[
\displaystyle \int \frac{1}{1+x^2 }\diff x \uncover<6->{=\Arctan x +C}
\]
\end{example}
}
\vspace{2cm} 
\end{frame}

\begin{frame}
\frametitle{Linear substitutions leading to blocks IIa and IIIa}
Building block IIa: $ \int \frac{x}{1+x^2}\diff x = \frac{1}{2}\ln(1+x^2)+C$.

\uncover<2->{ Integrals leading to block IIa can be done faster.} \uncover<3->{ We show the ``theoretical way'', then redo the ``fast way''.} \uncover<4->{ \alert<4>{\textbf{Feel free to skip the slide.}}}
\begin{example}
\[
\renewcommand{\arraystretch}{0}
\begin{array}{r{c}ll|l}
 \int \frac{ x }{2x^2+3} 
\diff x \uncover<5->{
&=& \int\frac{x}{3\left(\frac{2}{3} x^2+1\right)} \diff x = \int\frac{x}{3\left(\left(\sqrt{\frac{2}{3}} x\right)^2+1\right)} \diff x\\
&=& \frac{3}{2}\int\frac{\sqrt{\frac{2}{3}} x}{3\left(\left(\sqrt{\frac{2}{3}} x\right)^2+1\right)} \diff \left( \sqrt{\frac{2}{3}}x \right)  && \text{Set } u=\sqrt{\frac{2}{3}}x\\
&=&\frac{1}{2}\int \frac{u}{u^2+1}\diff u= \frac{1}{4} \ln (1+u^2)+C\\
&=& \frac{1}{4} \ln \left(\frac{1}{3} (2x^2+3)\right) +C\\
&=&\frac{1}{4} \ln (2x^2+3) + \frac{\ln \left(\frac{1}{3}\right)}{4}+C\\
&=&\frac{1}{4} \ln (2x^2+3)+K
}
\end{array}
\]

\end{example}



\vspace{4cm}

\end{frame}


\begin{frame}
\frametitle{Linear substitutions leading to blocks IIa and IIIa}
Building block IIa: $ \int \frac{x}{1+x^2}\diff x = \frac{1}{2}\ln(1+x^2)+C$.

In practice, integrals leading to block IIa can be done directly, without transforming to the above form. We illustrate how.
%Building block IIIa: $ \int \frac{1}{1+x^2 }\diff x=\Arctan x+C.$


\begin{example}
\[
\begin{array}{rcll|l}
\displaystyle \int \frac{\alert<2>{ x} }{2x^2+3} \alert<2>{ \diff x} \uncover<2->{&=&\displaystyle \int\frac{1}{2x^2+3} \alert<2,3>{ \diff \left( \frac{x^2}{2} \right)}} \\
\uncover<3->{&=&\displaystyle \int\frac{1}{\alert<5>{2x^2+3}} \diff \left(\frac{\alert<5>{\alert<3>{ 2x^2} \uncover<4->{\alert<4>{+3}}} }{ \alert<3>{4}}\right)} \uncover<5->{&&\text{Set } \alert<5,7>{ u=2x^2+3} } \\
\uncover<5->{&=&\displaystyle \frac{1}{4}\alert<6>{ \int \frac{1}{\alert<5>{u}}\diff \alert<5>{u}}}\\
\uncover<6->{&=&\displaystyle \frac{1}{4}\alert<6>{ \ln \alert<7>{|u|}}+C}\\
\uncover<7->{&=&\displaystyle \frac{1}{4}\ln (\alert<7>{2x^2+3})+C}
\end{array}
\]

\end{example}
\vspace{4cm}

\end{frame}
%\end{comment}

\begin{frame}
\frametitle{Linear substitutions leading to blocks IIa and IIIa}
%Building block IIa: $ \int \frac{x}{1+x^2}\diff x = \frac{1}{2}\ln(1+x^2)+C$.

Building block IIIa: $ \int \frac{1}{1+x^2 }\diff x=\Arctan x+C.$
\begin{example}
\[
\begin{array}{rcll|l}
\displaystyle \alert<8>{\int \frac{1}{\alert<2>{x^2+2}}\diff x} \uncover<2->{ &=&\displaystyle \int\frac{1}{\alert<2>{ 2} \alert<2>{\left(  \alert<3>{\frac{1}{2}x^2} +1\right)}} \alert<4>{\diff x} }\\
\uncover<3->{&=&\displaystyle \int \frac{1}{2\left( \alert<3>{\left(\alert<5>{ \frac{x}{ \sqrt{2}}} \right)^2} +1  \right)} \alert<4>{\sqrt{2}\diff\left(\alert<5>{ \frac{ x}{\sqrt{2}}}\right)}} \uncover<5->{ &&\text{ Set } \alert<5,7>{u= \frac{x}{\sqrt{2}}} }\\
\uncover<5->{&=&\displaystyle \frac{1}{\sqrt{2}}\int \frac{1}{1+{\alert<5>{u}}^2}\diff \alert<5>{u}}\\
\uncover<6->{&=& \frac{1}{\sqrt{2}}\Arctan (\alert<7>{u})+C} \\
\uncover<7->{&=&\displaystyle \alert<8>{ \frac{1}{\sqrt{2}} \Arctan\left(\alert<7>{\frac{x}{\sqrt{2}}}\right)+C}}
\end{array}
\]

\end{example}
\vspace{2cm}

\end{frame}
\begin{frame}
\frametitle{Linear substitutions leading to blocks IIa and IIIa}
%Building block IIa: $ \int \frac{x}{1+x^2}\diff x = \frac{1}{2}\ln(1+x^2)+C$.

Building block IIIa: $ \int \frac{1}{1+x^2 }\diff x=\Arctan x+C$. \alert<1>{\textbf{Let $a>0$.}}
\begin{example}
\[
\begin{array}{rcll|l}
\displaystyle \alert<1>{\int \frac{1}{x^2+a\vphantom{2}}\diff x } &=&\displaystyle \int\frac{1}{ a\left(\frac{1}{a\vphantom{2}}x^2 +1\right)} \diff x \\
\uncover<1->{&=&\displaystyle \int \frac{1}{a\left(\alert<-1>{ \left(\frac{x}{ \sqrt{a\vphantom{2}}} \right)^2} +1  \right)} \sqrt{a\vphantom{2}}\diff\left( \frac{ x}{\sqrt{a\vphantom{2}}}\right)} \uncover<1->{&& \text{ Set } u= \frac{x}{\sqrt{a}}} \\ %the uncover commands are to preserve latex spacing. This may be a LaTeX bug, but please keep the two uncover<1-> commands where they are!
&=&\displaystyle \frac{1}{\sqrt{a\vphantom{2}}} \int \frac{1}{1 +{u}^2}\diff u \\
&=& \frac{1}{\sqrt{a\vphantom{2}}}\Arctan (u)+C \\
&=&\alert<1>{ \displaystyle \frac{1}{\sqrt{a\vphantom{2}}} \Arctan\left(\frac{x}{\sqrt{a}}\right)+C}
\end{array}
\]

\end{example}
\vspace{2cm}

\end{frame}

%\begin{comment}
\begin{frame}
\frametitle{Linear substitutions leading to blocks IIa and IIIa}
Building block IIa: \alert<4>{$ \int \frac{x}{1+x^2}\diff x = \frac{1}{2}\ln(1+x^2)+C$}.

Building block IIIa: \alert<4>{$\int \frac{1}{1+x^2 }\diff x=\Arctan x+C$}.

\begin{itemize}

\item<1-> Let $ax^2+bx+c$ have no real roots.
\item<2-> We can find $p,q$ so that the linear substitution $u=px+q$ transforms the quadratic to:
\[
ax^2+bx+c= r(u^2+1)
\] 
(where $r$ is some number to be determined).
\item<3-> To find $p,q$, we \alert<3>{complete the square}. 
\item<4-> In this way, integrals of the form \alert<4>{$\displaystyle \int \frac{Ax+B}{ax^2+bx+c} \diff x$} are transformed to \alert<4>{combinations of building blocks IIa and IIIa}.

\item<5-> We show examples; the general case is analogous and we leave it to the student.
\end{itemize}
\vspace{5cm}
\end{frame}


\begin{frame}
\frametitle{Linear substitutions leading to blocks IIa and IIIa}
Building block IIa: $ \int \frac{x}{1+x^2}\diff x = \frac{1}{2}\ln(1+x^2)+C$.

Building block IIIa: $\int \frac{1}{1+x^2 }\diff x=\Arctan x+C.$


\begin{example}
\uncover<2->{\alert<2-4>{No real roots $\Rightarrow$ complete the square.}} \uncover<7->{Let \alert<7,27,30>{$u= x+ \frac{1}{2} $}}\uncover<16->{, let \alert<16,28>{$z=\frac{2u}{\sqrt{3}}$}.}  
\[
\begin{array}{rcl}
\displaystyle
%
\vphantom{\int \frac{u}{u^2+\frac{3}{4}}\diff u}
%
\int\frac{x}{\alert<2>{x^2+\alert<3>{x}+1}}\diff x 
\only<1>{{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} }
\only<1-10>{\uncover<2->{&=& \displaystyle \int \frac{x}{\alert<2>{ \alert<4>{ x^2+\alert<3>{2\frac{1}{2}x} +\frac{1}{4} } \alert<5>{-\frac{1}{4} +1}} } \alert<6>{\diff x} } {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} \\
\uncover<4->{&=&\displaystyle \int \frac{\alert<7>{x+\frac{1}{2}}-\frac{1}{2}}{ \alert<4>{\left(\alert<7>{x+\frac{1}2}\right)^2}+\alert<5>{\frac{3}{4}} }\alert<6>{\diff \left(\alert<7>{x+\frac{1}{2}}\right) }}\\
\uncover<7->{&=&\displaystyle \int \frac{\alert<7,8>{u} \alert<9>{ -\frac{1}{2}} }{{\alert<7>{u}}^2+\frac{3}{4}}\diff \alert<7>{u}} \\
\uncover<8->{&=&\alert<10>{ \displaystyle \int \frac{\alert<8>{u}}{u^2+\frac{3}{4}}\diff u\alert<9>{-\frac{1}{2}}\int \frac{1}{u^2+\frac{3}{4}}\diff u}}
}

\only<11->{
&=&\alert<11>{\displaystyle\alert<25>{ \int \frac{u}{u^2+\frac{3}{4}}\diff u} -\frac{1}{2} \alert<12,18>{\int \frac{1}{u^2+\frac{3}{4}}\diff u}} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} \\
}
\only<11-18>{
\only<12->{\displaystyle \alert<12,18>{ \int \frac{1}{\alert<13>{u^2+\frac{3}{4}} }\diff u}\uncover<13->{&=& \displaystyle \int \frac{1}{\alert<13>{\frac{3}{4}\left( \alert<14>{\frac{4}{3}u^2} +1\right)}}\alert<15>{\diff u}}}\\
\uncover<14->{&=&\displaystyle \int \frac{1}{\frac{3}{4}\left(\alert<14>{ \left(\alert<16>{ \frac{2u}{ \sqrt{3}}}\right)^2} +1\right)} \alert<15>{ \frac{\sqrt{3} }{2} \diff \left(\alert<16>{ \frac{2u}{\sqrt{3}}}\right) }}\\
\uncover<16->{&=&\displaystyle \frac{2\sqrt{3}}{3}\int \frac{1}{\alert<16>{z}^2+1}\diff \alert<16>{z}}\uncover<17->{ = \alert<18>{\frac{2\sqrt{3}}{3} \Arctan z}+C}
}
\only<19->{
&=&\displaystyle \vphantom{\int \frac{u}{u^2+\frac{3}{4}}\diff u} \only<19-24>{\alert<20>{\int \frac{u}{u^2+\frac{3}{4}}\diff u}} \only<25->{\alert<25>{ \frac{1}{2}\ln \left(\alert<27>{u}^2+\frac{3}{4}\right) } }-\frac{1}{2}\alert<19>{ \frac{2\sqrt{3}}{3} \Arctan \alert<28>{z} }+C\\
\only<26->{
\uncover<27->{&=&\displaystyle \frac{1}{2}\ln  \left( \alert<29>{ {\alert<27>{\left(x+\frac{1}{2}\right)}}^2 + \frac{3}{4}}\right) - \frac{\sqrt{3}}{3} \Arctan \left( \alert<28>{ \frac{\alert<30>{2u }}{ \sqrt{3}}} \right)+C} \\
\uncover<29->{&=&\displaystyle \frac{1}{2}\ln \left(\alert<29>{x^2+x+1}\right) - \frac{\sqrt{3}}{3} \Arctan \left(\frac{\alert<30>{2x+1}}{\sqrt{3}}\right)+C
}
}
}
\only<20-25>{
\displaystyle \alert<20,25>{\int \frac{\alert<21>{ u} }{u^2+\frac{3}{4}}\alert<21>{ \diff u} } \uncover<21->{ &=& \displaystyle\int \frac{1}{u^2+\frac{3}{4}}\diff \alert<21>{\left(\frac{u^2}{\alert<22>{2}}\right)}}\\
\uncover<22->{&=&\displaystyle \alert<22>{\frac{1}{2}}\int \frac{1}{\alert<24>{u^2+\frac{3}{4}}}\diff \left(\alert<24>{ u^2\uncover<23->{ \alert<23>{ +\frac{3}{4}} }} \right)}\uncover<24->{ =\alert<25>{ \frac{1}{2}\ln \left(\alert<24>{u^2 +\frac{3}{4}} \right)}+C}
}
\end{array}
\]
\end{example}

\vspace{8cm}

\end{frame}

%\end{comment}
%end module partial-fractions-building-blocks-2a-and-3a


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-building-block-2b.tex
%begin module Building block IIb

\begin{frame}
\frametitle{Building blocks IIa and IIb} 
We solve building block IIb. For completeness, we solve block IIa again as well. 
\begin{example}
\[
\begin{array}{rcl}
\displaystyle \int \frac{\alert<2>{ x} }{(x^2+1)^n} \alert<2>{\diff x} \uncover<2->{&=&\displaystyle  \int \frac{1}{(\alert<3>{x^2+1})^n} \alert<2>{\frac{\diff \left(\alert<3>{x^2+1} \right )}{2}}} \\
\uncover<3->{&=& \displaystyle \frac{1}{2}\int {\alert<3>{u}}^{-n}\diff \alert<3>{ u}} \\
\uncover<4->{&=&\left\{\begin{array}{ll}\displaystyle
\uncover<5->{\alert<5>{ \frac{1}{2}\ln (x^2+1) +C}} & \alert<4,5>{\text{if }n=1} \\
\uncover<7->{\alert<7>{\displaystyle \frac{1}{2} \frac{(x^2+1)^{-n+1}}{(-n+1)}+C}} &\alert<6>{ \text{if }n\neq -1}
\end{array} 
\right. ,}
\end{array}
\]
\uncover<3->{where we used the substitution $\alert<3>{u=x^2+1}$.}

\end{example}

\end{frame}

%end module Building block IIb


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-building-block-3b.tex
%begin module Building block IIIb

\begin{frame}
\frametitle{Building block IIIb: example illustrating main idea}
\begin{example}
Integrate $\int \frac{\diff x}{(x^2+1)^2}$. We start with an already known integral:
\[
\begin{array}{rcl}
\uncover<2->{\alert<12,13>{\alert<15>{\Arctan x}+C}} 
\only<1-12>{
\uncover<2->{
&=&\displaystyle \int \alert<3>{\frac{1}{x^2+1}}\diff \alert<4>{ x}}\\
\uncover<3->{&=&\displaystyle \alert<3>{\frac{1}{x^2+1}} \alert<4>{ x}-\int \alert<4>{x} \alert<5,6>{ \diff \left(\alert<3>{\frac{1}{x^2+1}}\right)} }\\
\uncover<5->{&=&\displaystyle \frac{x}{x^2+1} \alert<7>{-} \int \alert<7>{ x} \only<5>{\alert<5>{\textbf{?}}} \uncover<6->{\alert<6>{ \left( \alert<7>{-} \frac{\alert<7>{ 2x} }{ (x^2+1)^2}\right)\diff x}}}\\
\uncover<7->{&=&\displaystyle \frac{x}{x^2+1}\alert<7>{ +2} \int \frac{ \uncover<8->{\alert<8>{-\alert<10>{1}}+}\alert<9>{ \alert<7>{ x^2} \uncover<8->{\alert<8>{+1}}}}{\alert<9,10>{(x^2+1)^2}}\diff x }\\
\uncover<9->{&=&\displaystyle  \frac{x}{x^2+1}+2\alert<11>{\int \alert<9>{\frac{1}{x^2+1}} \diff x}-2\int \alert<10>{\frac{1}{(x^2+1)^2}}\diff x}\\
} %only<1-12>
\uncover<11->{ &\alert<12,13>{=}&\displaystyle \alert<12,13>{ \frac{x}{x^2+1}+ \alert<15>{2\alert<11>{\Arctan x} }\alert<14>{ -2 \int \frac{\diff x}{(x^2+1)^2}}} {~~~~~~~~~~~~~~~}} 
\end{array}
\]
\only<13->{
\uncover<14->{Rearrange terms \uncover<16->{and divide by $2$ to get the desired integral:}
\[
\alert<14>{\uncover<14,15>{2} \int \frac{\diff x}{(1+x^2)^2}}=\uncover<16->{\frac{1}{2}} \left(\frac{x}{x^2+1}+ \alert<15>{\Arctan x}  \right)+\uncover<14->{C'}\uncover<16->{'}\quad .
\]
}%uncover14
}%uncover13
\end{example}
\vspace{8cm}
\end{frame}

\begin{frame}
\frametitle{Building block IIIb}
\begin{itemize}
\item<1-> Building block IIIa: 
\[
\uncover<6->{\alert<6>{J(1)=}} \int \frac{1}{(x^2+1)}\diff x=\alert<6>{\arctan x+C}\quad .
\] 
\item<2-> Block IIIb:
\[
\uncover<4->{\alert<4>{J(n)=}} \alert<4>{\int \frac{1}{(x^2+1)^n}\diff x}
\] 
\item<3-> Unlike other cases, IIIb is much harder than IIIa.
\item<4-> Set $\alert<4>{J(n)=\int \frac{1}{(x^2+1)^n}\diff x}$. \uncover<5->{We are looking for a formula for $J(n)$.} \uncover<6->{We know $\alert<6>{J(1)=\arctan x+C}$ (this is block IIIa).}
\item<7-> We start by $J(n-1) =\int \frac{1}{(x^2+1)^{n-1}} \diff x$ and integrate by parts.
\item<8-> In this way we end up expressing $J(n)$ via $J(n-1)$.
\item<9-> We work our way from $J(n)$ to $J(n-1)$, from $J(n-1)$ to $J(n-2)$, and so on, until we get to $J(1)$.
\end{itemize} 
\end{frame}

\begin{frame}
\begin{example}
Recall that $\alert<11,12>{J(n)=\int \frac{1}{(x^2+1)^{n}}\diff x}$. %\uncover<3->{Set $\alert<3>{u=\frac{1}{(1+x^2)^{n-1}}}$.} 
\uncover<2->{We have that:}
\[
\begin{array}{rcl}
\uncover<2->{\alert<13,14,16>{J(n-1)}}
\only<1-13>{\uncover<2->{&\alert<13>{=} & 
\displaystyle \int \alert<3>{\frac{1}{(x^2+1)^{n-1 }}} \diff \alert<4>{x} } \\
\uncover<3->{&=&\displaystyle  \alert<3>{\frac{1}{(x^2+1)^{n-1}} } \alert<4>{x}-\int  \alert<4>{x} \alert<5,5>{ \diff \left(\alert<3>{ \frac{1}{ (1+x^2)^{ n-1}}}\right)}}\\
\uncover<5->{&=&\displaystyle  \frac{x}{(x^2+1)^{n-1}} \alert<7>{-} \int \alert<7>{ x}  \only<5>{\alert<5>{\textbf{?}}} \uncover<6->{\alert<6>{\frac{ \alert<7>{(-n+1) 2 x}}{ (1+x^2 )^{n}} \diff x}}} \\
\uncover<7->{ &=&\displaystyle  \frac{x}{(x^2+1)^{n-1}} \alert<7>{+ 2(n-1)} \int \frac{\uncover<8->{ \alert<8,9>{1+}} \alert<7,9>{x^2} \uncover<8->{\alert<8,10>{-1}}}{ \alert<9,10>{ (1+x^2)^n} }\diff x}\\
\uncover<9->{ &=&\displaystyle  \frac{x}{(x^2+1)^{n-1}}+ 2(n-1)\alert<11>{ \int \alert<9>{\frac{1}{(1+x^2)^{n-1}}} \diff x}} \\
\uncover<9->{&&\displaystyle \alert<10>{-} 2(n-1)\alert<12>{ \int \alert<10>{\frac{1}{(1+x^2)^n}}\diff x} }\\
} %only<1-13>
\uncover<11->{&\alert<13,14>{=}&\displaystyle \alert<13,14>{ \frac{x}{(x^2+1)^{n-1}}+\alert<16>{ 2(n-1)\alert<11>{ J(n-1)}}  \alert<15>{ -2(n-1)\alert<12>{J(n)}}}\quad .}
\end{array}
\]

\only<14->{
\uncover<15->{
Rearrange to get:
\[
\begin{array}{rcl}
\alert<15>{ \alert<17>{2(n-1)}J(n) } &=& \displaystyle \frac{x}{(x^2+1)^{n-1}}+\alert<16>{(2n-3) J(n-1)} \\
\uncover<17->{ \alert<19,20,21>{J(n)}&\alert<19,20,21>{=}&\displaystyle \alert<19,20,21>{ \frac{x}{ \alert<17>{(2n-2)} (x^2+ 1)^{ n-1}}+ \frac{2n-3}{\alert<17>{ 2n-2}}J(n-1)} \quad .}
\end{array}
\]

\uncover<18->{In this way we expressed $J(n)$ using $J(n-1)$.} \uncover<19->{We apply the above formula consecutively:

$
\alert<19>{ J(n)=  \frac{x}{ (2n-2) (x^2+ 1)^{ n-1}}+   \frac{2n-3}{ 2n-2}\only<19,20>{\alert<20>{J(n-1)}  \phantom{\left(\frac{x}{(2n-4)(x^2+1)^{n-2}}\right)} 
}} \only<21->{\alert<21>{\left(\frac{x}{(2n-4)(x^2+1)^{n-2}}+\frac{2n-5 }{2n-4} \alert<22,23>{ J(n-2)} \right)}}  \uncover<22->{\alert<22>{=\dots}}
$
}

\noindent \uncover<22->{\alert<22>{and so on.}} \uncover<23->{A formula for the final result can be written using the above (found in Calculus for beginners, Chapter ``Techniques of integration'').}

} %uncover15
} %uncover14
\end{example}


\vspace{8cm}
\end{frame}
%end module Building block IIIb


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-building-blocks-linear-substitutions-summary.tex
\begin{frame}
\frametitle{Linear substitutions leading to building blocks}
\begin{itemize}
\item In the previous slides we showed how to solve building block integrals I, II and III:
$\displaystyle \int \frac{1}{x^n }\diff x$, $\displaystyle \int \frac{x}{(1+x^2)^n }\diff x$, $\displaystyle \int \frac{1}{(1+x^2)^n }\diff x$
\item<2-> Every integral of the form
$\displaystyle \int \frac{1}{(ax+b)^n }\diff x$
can be transformed using linear substitution to building block I. We did that in full detail.
\item<3-> Every integral of the form  
$\displaystyle \int \frac{Ax+B}{(ax^2+bx+c)^{n} }\diff x$
for which $b^2-4ac<0$ can be transformed using linear substitutions to a sum of building blocks II and III. 
\begin{itemize}
\item<4-> For $n=1$ (blocks IIa and IIIa) we showed a complete example how to do that. 
\item<5-> For $n>1$ the integrals are transformed to blocks IIb and IIIb in a completely analogous fashion using the same techniques. An extended example can be found in Calculus for beginners, Chapter Techniques of Integration.
\end{itemize}
\end{itemize}

\end{frame}


}

\lect{Spring 2015}{Lecture 5}{5}{
\section{Integration of Rational Functions} 
\subsection{Partial fractions}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/from-building-blocks-to-complete-algorithm-intro.tex
% begin module from-building-blocks-to-complete-algorithm-intro
\begin{frame}
\frametitle{From building blocks to all rational functions: example}
\begin{itemize}
\item We know how to solve $\displaystyle \int \frac{2}{x-1}\diff x$ and $\displaystyle \int \frac{1}{x+2}\diff x$. 
\item Consider the difference
\[
\alert<5>{\frac{2}{x-1} - \frac{1}{x+2} } = %
\uncover<2->{%
\frac{2(x+2) - (x-1)}{(x-1)(x+2)} = %
}%
\uncover<3->{%
\alert<5>{ \frac{x + 5}{x^2+x-2} }\quad .
}%
\]
\item<4-> 

We can now solve the following integral:
\[
\int \alert<5>{ \frac{x+5}{x^2+x-2}}\diff x = %
\uncover<5->{%
\int \left(\alert<5>{\frac{2}{x-1} - \frac{1}{x+2}} \right) \diff x = %
}%
\uncover<6->{%
2\ln | x - 1| - \ln | x + 2| + C
}%
\]
\item<7-> From  (linear substitutions of) basic building blocks we constructed a larger example, which we can therefore solve. 
\item<8-> We will now learn how to do the reverse procedure: given a rational function, split it into ``partial fractions'' which are transformed by linear substitutions to basic building block integrals.
\end{itemize}
\end{frame}
% end module from-building-blocks-to-complete-algorithm-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-definition.tex
\begin{frame}
\frametitle{Partial fractions definition}
\begin{definition} 
A partial fraction is rational function of one of the 2 forms below.
\begin{itemize}
\item $\frac{A}{(ax+b)^n} $, $n\geq 1$.
\item $\frac{Ax+B}{(ax^{2}+bx+c)^n}$, where $b^2-4ac<0$ and $n\geq 1$.
\end{itemize}
\end{definition}
\uncover<2->{
\begin{theorem}
Every rational function can be written as a sum of a polynomial and partial fractions.
\end{theorem}
}
\begin{itemize}
\item<3-> We already learned know how to integrate all partial fractions (using linear substitutions and building blocks I, II and III). 
\item<4-> Thus, if we can produce the partial fractions whose existence is promised by the theorem, we can integrate all rational functions.
\end{itemize}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-long-division.tex
% begin module partial-fractions-long-division
\begin{frame}
\frametitle{Review of polynomial notation}
Consider a rational function
\[
f(x) = \frac{P(x)}{Q(x)}
\]
where $P$ and $Q$ are polynomials.  Recall that the degree of $P$ is the highest power of $x$ in $P$ that has a non-zero coefficient.  That is, if
\[
P(x) = a_nx^n + a_{n-1}x^{n-1} + \cdots + a_1x + a_0
\]
where $a_n \neq 0$, then the degree of $P$ is $n$, and we write deg$(P) = n$.

\end{frame}
\begin{frame}\frametitle{Ensure denominator degree > numerator degree}
\begin{itemize}
\item To compute a partial fraction decomposition we need that the degree of the fraction numerator be less than the degree of the denominator.
\item<2-> Therefore our first step is to transform $\frac{P(x)}{Q(x)}$ to

$\displaystyle \frac{\alert<6>{P(x)}}{\alert<7>{Q(x)} }= \alert<8>{S(x)}+\frac{\alert<9>{R(x)}}{\alert<7>{Q(x)}} $

where $S(x), R(x), Q(x)$ are polynomials and $\deg R<\deg Q$.
\item<3-> This is done using polynomial long division.
\item<4-> We recall that to divide the \alert<6>{dividend $P(x)$} by the \alert<7>{divisor $Q(x)$} to get \alert<8>{quotient $S(x)$} with \alert<9>{remainder $R(x)$} means \uncover<5->{ to find polynomials  $S(x), R(x)$ such that \alert<9>{$\deg R<\deg Q$} and
\[
\alert<6> {P(x)}=\alert<8>{S(x)}\alert<7>{Q(x)}+\alert<9>{ R(x)}
\]
}
\item<10-> We review polynomial long division on examples.
\end{itemize}



\end{frame}
% end module partial-fractions-long-division



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-long-division-ex1.tex
% begin module partial-fractions-long-division-ex1
\begin{frame}
\begin{example} %[Example 1, p. 510]
Find $\int \frac{x^3 + x}{x - 1}\diff x$.
\begin{columns}[t]
\column{.45\textwidth}
\uncover<2->{%
\[
\begin{array}{r@{}r@{}c@{}r@{}c@{}c@{}c@{}r@{}r@{}}
& & & %
\uncover<4->{\alert<handout:0| 4-6,23>{x^2}} & %
\uncover<11->{\alert<handout:0| 11-13,23>{+}} & %
\uncover<11->{\alert<handout:0| 11-13,23>{ x}} & %
\uncover<17->{\alert<handout:0| 17-19,23>{+}} & %
\uncover<17->{\alert<handout:0| 17-19,23>{ 2}} & \\%
\cline{3-8}
\alert<handout:0| 3-6,10-13,16-19>{x} & %
\alert<handout:0| 5-6,12-13,18-19>{-1} & %
\Big) & %
\alert<handout:0| 3-4,7-8>{x^3} & %
 & %
 & %
\alert<handout:0| 9>{+} & %
\alert<handout:0| 9>{ x} & \\%
& & & %
\uncover<6->{\alert<handout:0| 6-8>{x^3}} & %
\uncover<6->{\alert<handout:0| 6-8>{-}} & %
\uncover<6->{\alert<handout:0| 6-8>{ x^2}} & %
&  & \\%
\cline{4-6}%
& & & %
&  & %
\uncover<8->{\alert<handout:0| 8,10-11,14-15>{x^2}} & %
\uncover<9->{\alert<handout:0| 9,14-15>{+}} & %
\uncover<9->{\alert<handout:0| 9,14-15>{ x}} & \\%
& & & %
&  & %
\uncover<13->{\alert<handout:0| 13-15>{x^2}} & %
\uncover<13->{\alert<handout:0| 13-15>{-}} & %
\uncover<13->{\alert<handout:0| 13-15>{ x}} & \\%
\cline{6-8}
& & & %
 & %
 & %
 & %
 & %
\uncover<15->{\alert<handout:0| 15-17,20-21>{2x}} & \\%
& & & %
 & %
 & %
 & %
 & %
\uncover<19->{\alert<handout:0| 19-21>{2x}} & %
\uncover<19->{\alert<handout:0| 19-21>{- 2}} \\%
\cline{8-9}%
& & & %
 & %
 & %
 & %
 & %
 & %
\uncover<21->{\alert<handout:0| 21,24>{2}} \\%
\end{array}
\]
}%

\only<handout:0| -4,10-11,16-17>{\uncover<3->{%
Divide %
}}%
\only<handout:0| 5-6,12-13,18-19>{%
Multiply %
}%
\only<handout:0| 7-8,14-15,20-21>{%
Subtract %
}%
\only<handout:0| 3-4>{%
$x^3$ %
}%
\only<handout:0| 10-11>{%
$x^2$ %
}%
\only<handout:0| 16-17>{%
$2x$ %
}%
\only<handout:0| 5-6>{%
$x^2$ %
}%
\only<handout:0| 12-13>{%
$x$ %
}%
\only<handout:0| 18-19>{%
$2$ %
}%
\only<handout:0| 7-8>{%
$x^3-x^2$ %
}%
\only<handout:0| 14-15>{%
$x^2-x$ %
}%
\only<handout:0| 20-21>{%
$2x-2$ %
}%
\only<handout:0| -4,10-11,16-17>{\uncover<3->{%
by %
}}%
\only<handout:0| 5-6,12-13,18-19>{%
by %
}%
\only<handout:0| 7-8,14-15,20-21>{%
from %
}%
\only<handout:0| 3-4,10-11,16-17>{%
$x$ %
}%
\only<handout:0| 5-6,12-13,18-19>{%
$x-1$ %
}%
\only<handout:0| 7-8>{%
$x^3$ %
}%
\only<handout:0| 14-15>{%
$x^2+x$ %
}%
\only<handout:0| 20-21>{%
$2x$ %
}%
\only<handout:0| 9>{%
Bring down the $x$%
}%
\invisible<1->{%
y%
}%
\column{.55\textwidth}
\begin{eqnarray*}
& & %
\uncover<22->{%
\int \frac{x^3 + x}{x - 1}\diff x %
}\\%
& \uncover<22->{ = } & %
\uncover<22->{%
\int \left( \alert<handout:0| 23>{x^2 + x + 2} + \frac{\alert<handout:0| 24>{2}}{x - 1}\right) \diff x
}\\%
& \uncover<25->{ = } & %
\uncover<25->{%
\frac{x^3}{3} + \frac{x^2}{2} + 2x %
}\\%
& & \uncover<25->{%
\qquad + 2\ln | x - 1 | + C %
}%
\end{eqnarray*}
\end{columns}
\end{example}
\end{frame}
% end module partial-fractions-long-division-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/rational-functions-to-partial-fractions.tex
\begin{frame}
\begin{itemize}
\item The next step in producing a partial fraction decomposition is to factor the denominator $Q(x)$.
\item Factoring of $Q(x)$ can always be done in quadratic and linear terms: 
\begin{corollary} [Corollary to the Fundamental Theorem of Algebra]
Let $Q(x)$ be a polynomial (with real coefficients). Then $Q(x)$ can be factored as a product of terms of the form $(ax+b)^n$ (powers of linear terms) and product of terms of the form $(ax^2+bx+c)^n$ with $b^2-4ac<0$ (powers of quadratic terms).
\end{corollary}  
\item The above result is a corollary to the Fundamental Theorem of Algebra. We state the Fundamental Theorem of algebra without proving it.
\begin{theorem}[The Fundamental Theorem of Algebra]
Every polynomial has at least one complex root.
\end{theorem}
\end{itemize}
\end{frame}

\begin{frame}
Suppose we have already factored the denominator $Q(x)$ into factors of the form 
\[
(ax+b)^N\qquad \text{ and }\qquad (ax^2+bx+c)^N
\]
\uncover<2->{Then we can split the fraction $R(x)/Q(x)$ into sum of partial fractions of the form 
\[
\frac{A}{(ax+b)^i} \qquad \text{or}\qquad \frac{Ax+B}{(ax^2+bx+c)^i}\quad ,
\]
where the exponent $i$ in the partial fraction does not exceed the exponent $N$ of the corresponding term in $Q(x)$.
}

\uncover<3->{
The cases when the factorization of $Q(x)$ has terms appearing with power $N>1$ are treated differently from the the cases where all terms of the factorization of $Q(x)$ are distinct.
}
\end{frame}



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-case1.tex
% begin module partial-fractions-case1
\begin{frame}
Suppose $Q(x)$ is a product of distinct linear factors.

This means we can write
\[
Q(x) = (a_1x+b_1)(a_2x+b_2) \cdots (a_kx+b_k)
\]
where no factor is repeated (and no factor is a constant multiple of another).

Then there exist constants $A_1, A_2, \ldots , A_k$ such that
\[
\frac{R(x)}{Q(x)} = \frac{A_1}{a_1x+b_1} + \frac{A_2}{a_2x+b_2} + \cdots + \frac{A_k}{a_kx+b_k}
\]

The next example shows how to find $A_1, A_2, \cdots , A_k$.
\end{frame}
% end module partial-fractions-case1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-case1-ex2.tex
% begin module partial-fractions-case1-ex2
\begin{frame}
\begin{example} %[Example 2, p. 511]
Find $\int \frac{x^2+2x-1}{2x^3+3x^2-2x}\diff x$.
\begin{itemize}
\item<2->  deg$(x^2+2x-1) < $ deg$(2x^3+3x^2-2x)$: don't divide.
\item<3->  Factor denominator: $2x^3 + 3x^2-2x = x(2x-1)(x+2)$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<4->{%
\frac{x^2+2x-1}{x(2x-1)(x+2)}%
}%
& \uncover<4->{ = } & %
\uncover<4->{%
\frac{\alert<handout:0| 12>{A}}{x} + \frac{\alert<handout:0| 13>{B}}{2x-1} + \frac{\alert<handout:0| 14>{C}}{x+2}%
}\\%
\uncover<5->{%
x^2+2x-1%
}%
& \uncover<5->{ = } & %
\uncover<5->{%
A(2x-1)(x+2) + Bx(x+2) + Cx(2x-1)%
}\\%
\uncover<6->{%
\alert<handout:0| 7>{x^2}+\alert<handout:0| 8>{2}x\alert<handout:0| 9>{-1}%
}%
& \uncover<6->{ = } & %
\uncover<6->{%
\alert<handout:0| 7>{(2A + B + 2C)x^2} + \alert<handout:0| 8>{(3A + 2B - C)x} \alert<handout:0| 9>{- 2A}%
}%
\end{eqnarray*}
\begin{columns}[t]
\column{.4\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\begin{array}{r@{}r@{}r@{}r@{}r@{}c@{}r}
\uncover<7->{\alert<handout:0| 7>{2A}} & %
\uncover<7->{\alert<handout:0| 7>{+}} & %
\uncover<7->{\alert<handout:0| 7>{ B}} & %
\uncover<7->{\alert<handout:0| 7>{+}} & %
\uncover<7->{\alert<handout:0| 7>{2C}} & %
\uncover<7->{\alert<handout:0| 7>{=}} & %
\uncover<7->{\alert<handout:0| 7>{1}} \\ %
\uncover<8->{\alert<handout:0| 8>{3A}} & %
\uncover<8->{\alert<handout:0| 8>{+}} & %
\uncover<8->{\alert<handout:0| 8>{2B}} & %
\uncover<8->{\alert<handout:0| 8>{-}} & %
\uncover<8->{\alert<handout:0| 8>{ C}} & %
\uncover<8->{\alert<handout:0| 8>{=}} & %
\uncover<8->{\alert<handout:0| 8>{2}} \\ %
\uncover<9->{\alert<handout:0| 9>{-2A}} & %
 & %
 & %
 & %
 & %
\uncover<9->{\alert<handout:0| 9>{=}} & %
\uncover<9->{\alert<handout:0| 9>{-1}} \\ %
\end{array}
\]
\uncover<10->{Solution:\\ $\alert<handout:0| 12>{A = \frac{1}{2}}, \alert<handout:0| 13>{B = \frac{1}{5}}, \alert<handout:0| 14>{C = -\frac{1}{10}}$.}
\column{.5\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\begin{array}{c@{}l}
&  \uncover<11->{\int \frac{x^2+2x-1}{2x^3+3x^2-2x}\diff x}\\%
\uncover<11->{ = } & %
\uncover<11->{%
\int \left( \alert<handout:0| 12>{\frac{1}{2}} \ \frac{1}{x} + \alert<handout:0| 13>{\frac{1}{5}} \ \frac{1}{2x-1} \alert<handout:0| 14>{- \frac{1}{10}} \ \frac{1}{x+2}\right) \diff x%
}\\%
\uncover<15->{ = } & %
\uncover<15->{%
\frac{1}{2}\ln |x| + \frac{1}{10}\ln |2x-1|%
}\\%
 & %
\uncover<15->{%
\qquad -\frac{1}{10}\ln |x+2| + K%
}%
\end{array}
\]
\end{columns}
\end{example}
\end{frame}
% end module partial-fractions-case1-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-case1-quick-trick.tex
% begin module partial-fractions-case1-quick-trick
\begin{frame}
NOTE:  There is a quick trick to find $A, B$, and $C$.
\abovedisplayskip=2pt
\belowdisplayskip=0pt
\[
x^2 + 2x - 1 = A(\alert<handout:0| 3>{2x-1})(\alert<handout:0| 4>{x+2}) + B\alert<handout:0| 2>{x}(\alert<handout:0| 4>{x+2}) + C\alert<handout:0| 2>{x}(\alert<handout:0| 3>{2x-1})
\]
\uncover<2->{\alert<5-7>{ To find $A$, set \alert<handout:0| 2>{$x=0$};}} \uncover<3->{\alert<8-10>{to find $B$, set \alert<handout:0| 3>{$x=\frac{1}{2}$}; }} \uncover<4->{\alert<11-13>{to find $C$, set \alert<handout:0| 4>{$x=-2$}}.}

\[
\begin{array}{rcl}
\uncover<5->{%
0^2 + 2\cdot 0 - 1%
}%
& \uncover<5->{ = } & %
\uncover<5->{%
A(2\cdot 0 - 1)(0 + 2)%
}\\%
\uncover<6->{%
 - 1%
}%
& \uncover<6->{ = } & %
\uncover<6->{%
-2 A%
}\\%
\uncover<7->{%
 A%
}%
& \uncover<7->{ = } & %
\uncover<7->{%
\frac{1}{2}%
}\\ ~\\ ~\\
\uncover<8->{%
\left( \frac{1}{2}\right)^2 + 2\cdot \frac{1}{2} - 1%
}%
& \uncover<8->{ = } & %
\uncover<8->{%
B\left( \frac{1}{2}\right)\left(\frac{1}{2} + 2\right)%
}\\%
\uncover<9->{%
 \frac{1}{4}%
}%
& \uncover<9->{ = } & %
\uncover<9->{%
\frac{5}{4} B%
}\\%
\uncover<10->{%
 B%
}%
& \uncover<10->{ = } & %
\uncover<10->{%
\frac{1}{5}%
}\\ ~\\ ~\\
\uncover<11->{%
(-2)^2 + 2(-2) - 1%
}%
& \uncover<11->{ = } & %
\uncover<11->{%
C(-2)(2(-2) - 1)%
}\\%
\uncover<12->{%
 - 1%
}%
& \uncover<12->{ = } & %
\uncover<12->{%
10C%
}\\%
\uncover<13->{%
 C%
}%
& \uncover<13->{ = } & %
\uncover<13->{%
-\frac{1}{10}%
}\\%
\end{array}
\]
\end{frame}
% end module partial-fractions-case1-quick-trick



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-case2.tex
% begin module partial-fractions-case2
\begin{frame}
%\begin{enumerate}
%\setcounter{enumi}{1}
%\item  
Suppose $Q(x)$ is a product of linear factors, some of which appear with power greater than 1.
%\end{enumerate}

Suppose the first linear factor $(a_1x+b_1)$ is repeated $r$ times; that is, $(a_1x+b_1)^r$ occurs in the factorization of $Q(x)$.  Then instead of a single term $A/(a_1x+b_1)$ we would use
\[
\frac{A_1}{a_1x+b_1}%
 + \frac{A_2}{(a_1x+b_1)^2}%
 + \cdots %
 + \frac{A_r}{(a_1x+b_1)^r}%
\]
We make similar adjustments for all other repeating terms $(a_sx+b_s)$.
\end{frame}
% end module partial-fractions-case2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-case2-ex4.tex
% begin module partial-fractions-case2-ex4
\begin{frame}
\begin{example}[Example 4, p. 513]
Find $\int \frac{x^4-2x^2+4x+1}{x^3-x^2-x+1}\diff x$.
\begin{itemize}
\item<2->  Divide: $\frac{x^4-2x^2+4x+1}{x^3-x^2-x+1} = x + 1 + \frac{4x}{x^3-x^2-x+1}$.
\item<3->  Factor denominator: $x^3-x^2-x+1 = (x-1)^2(x+1)$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<4->{%
\frac{4x}{(x-1)^2(x+1)}%
}%
& \uncover<4->{ = } & %
\uncover<4->{%
\frac{A}{x-1} + \frac{B}{(x-1)^2} + \frac{C}{x+1}%
}\\%
\uncover<5->{%
4x%
}%
& \uncover<5->{ = } & %
\uncover<5->{%
A(\alert<handout:0| 8>{x-1})(\alert<handout:0| 6>{x+1}) + B(\alert<handout:0| 6>{x+1}) + C(\alert<handout:0| 8>{x-1})^2%
}\\%
\end{eqnarray*}
\vspace{-.4in}
\begin{itemize}
\item<6->  Plug in $-1$: \uncover<7->{$4(-1) = C(-1-1)^2$, therefore $C = -1$.}
\item<8->  Plug in $1$: \uncover<9->{$4(1) = B(1+1)$ therefore $B = 2$.}
\item<10->  Plug in $0$: $4(0) = A(0-1)(0+1) + 2(0+1) + (-1)(0-1)^2$.
\item<11->  Therefore $A = 1$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\begin{array}{r@{ \ }c@{ \ }l}
\uncover<12->{%
\int \frac{x^4-2x^2+4x+1}{x^3-x^2-x+1}\diff x%
}%
& \uncover<12->{ = } & %
\uncover<12->{%
\int \left( x + 1 + \frac{1}{x-1} + \frac{2}{(x-1)^2} - \frac{1}{x+1}\right) \diff x%
}\\%
& \uncover<13->{ = } & %
\uncover<13->{%
\frac{x^2}{2} + x + \ln |x-1| - \frac{2}{x-1} -\ln |x+1| + K%
}%
\end{array}
\]
\end{example}
\end{frame}
% end module partial-fractions-case2-ex4



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-case3.tex
% begin module partial-fractions-case3
\begin{frame}
%\begin{enumerate}
%\setcounter{enumi}{2}
%\item  
Suppose $Q(x)$ contains irreducible quadratic factors, none of which is repeated.
%\end{enumerate}

If $Q(x)$ has the factor $ax^2 + bx + c$, where $b^2-4ac < 0$, then, in addition to the partial fractions arising from linear factors, the expression for $R(x)/Q(x)$ will have a term of the form
\[
\frac{Ax+B}{ax^2+bx+c}
\]

This term can be integrated by completing the square and using the formula
\[
\int \frac{\diff x}{x^2+a^2} = \frac{1}{a} \Arctan \left( \frac{x}{a}\right) + C
\]
\end{frame}
% end module partial-fractions-case3



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-case3-ex5.tex
% begin module partial-fractions-case3-ex5
\begin{frame}
\begin{example} %[Example 5, p. 514]
Find $\int \frac{2x^2-x+4}{x^3+4x}\diff x$.
\begin{itemize}
\item<2->  deg$(2x^2-x+4) < $ deg$(x^3+4x)$: don't divide.
\item<3->  Factor denominator: $x^3+4x = x(x^2+4)$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<4->{%
\frac{2x^2-x+4}{x(x^2+4)}%
}%
& \uncover<4->{ = } & %
\uncover<4->{%
\frac{A}{x} + \frac{Bx+C}{(x^2+4)}%
}\\%
\uncover<5->{%
2x^2-x+4%
}%
& \uncover<5->{ = } & %
\uncover<5->{%
A(x^2+4) + (Bx+C)x%
}\\%
\uncover<6->{%
\alert<handout:0| 9>{2x^2}\alert<handout:0| 8>{-x}+\alert<handout:0| 7>{4}%
}%
& \uncover<6->{ = } & %
\uncover<6->{%
\alert<handout:0| 9>{(A+B)x^2} + \alert<handout:0| 8>{Cx} + \alert<handout:0| 7>{4A}
}\\%
\end{eqnarray*}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\vspace{-.4in}
\[
\uncover<7->{\alert<handout:0| 7>{A = 1}}\qquad%
\uncover<8->{\alert<handout:0| 8>{C = -1}}\qquad%
\uncover<9->{\alert<handout:0| 9-10>{A+B = 2}}%
\uncover<10->{\alert<handout:0| 10>{,\text{ therefore } B = 1}}%
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\vspace{-.2in}
\begin{eqnarray*}
%\[
%\begin{array}{r@{ \ }c@{ \ }l}
\uncover<11->{%
\int \frac{2x^2-x+4}{x(x^2+4)}\diff x%
}%
& \uncover<11->{ = } & %
\uncover<11->{%
\int \left( \frac{1}{x} + \frac{x-1}{x^2+4}\right) \diff x%
}\\%
& \uncover<12->{ = } & %
\uncover<12->{%
\int  \frac{1}{x}\diff x + \int \frac{x}{x^2+4}\diff x - \int \frac{1}{x^2+4}\diff x%
}\\%
& \uncover<13->{ = } & %
\uncover<13->{%
\ln |x| + \frac{1}{2}\ln (x^2 + 4) - \frac{1}{2} \Arctan \left( \frac{x}{2}\right) + K%
}\\%
%\end{array}
%\]
\end{eqnarray*}
\vspace{-.3in}
\end{example}
\end{frame}
% end module partial-fractions-case3-ex5



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-case4.tex
% begin module partial-fractions-case4
\begin{frame}
%\begin{enumerate}
%\setcounter{enumi}{3}
%\item  
Suppose $Q(x)$ contains irreducible quadratic factors, some of which are repeated.
%\end{enumerate}

If $Q(x)$ has the factor $(ax^2 + bx+c)^r$, where $b^2-4ac < 0$, then instead of the single term $(Ax+B)/(ax^2+bx+c)$ we use  
\[
\frac{A_1x+B_1}{ax^2+bx+c} + %
\frac{A_2x+B_2}{(ax^2+bx+c)^2} + %
 \cdots + %
\frac{A_rx+B_r}{(ax^2+bx+c)^r} %
\]
in the partial fraction decomposition of $R(x)/Q(x)$.

These terms can be integrated by completing the square.
\end{frame}
% end module partial-fractions-case4



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-case4-ex7.tex
% begin module partial-fractions-case4-ex7
\begin{frame}
\begin{example} %[Example 7, p. 516]
Write out the form of the partial fraction decomposition of
\[
\frac{x^3+x^2+1}{\alert<handout:0| 2-3>{x}\alert<handout:0| 4-5>{(x-1)}\alert<handout:0| 6-7>{(x^2+x+1)}\alert<handout:0| 8-9>{(x^2+1)^3}}
\]
\[
\uncover<3->{\alert<handout:0| 3>{%
 = \frac{A}{x} + %
}}%
\uncover<5->{\alert<handout:0| 5>{%
 \frac{B}{x-1} + %
}}%
\uncover<7->{\alert<handout:0| 7>{%
 \frac{Cx+D}{x^2+x+1} + %
}}%
\uncover<9->{\alert<handout:0| 9>{%
 \frac{Ex+F}{x^2+1} + %
 \frac{Gx+H}{(x^2+1)^2} + %
 \frac{Ix+J}{(x^2+1)^3} %
}}%
\]
\end{example}
\end{frame}
% end module partial-fractions-case4-ex7



}% end lecture

% begin lecture
\lect{Spring 2015}{Lecture 6}{6}{
\section{Trigonometric Integrals}
\subsection{Integrating rational trigonometric integrals}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-rationalizing-substitution.tex
%begin module trig-integrals-rationalizing-substitution
\begin{frame}
\frametitle{Integrals of the form $\int R(\cos \theta,\sin \theta) \diff \theta$, $R$}

Let $R$ be an arbitrary rational function in two variables (quotient of polynomials in two variables).
\begin{question}
Can we integrate $\int R(\cos \theta, \sin \theta)\diff \theta$?
\end{question}
\begin{itemize}
\item<2-> Yes. We will learn how in what follows.
\item<3-> The algorithm for integration is roughly:
\begin{itemize}
\item<4-> Apply the substitution $\theta=2\Arctan t$ to transform to integral of rational function.
\item<5-> Solve as previously studied.
\end{itemize}
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{The rationalizing substitution $\theta= 2\Arctan t$}
\uncover<13->{
\noindent 
Let $R$- rational function in two variables. 
$\int R(\alert<14,21>{\cos \theta,\sin \theta} ) \alert<22>{\diff \theta} $
can be integrated via the  substitution $\alert<14,15,18,23, 26>{ \theta=2\arctan t} $.
\uncover<14->{ How does this transform \alert<14,21>{$\sin \theta$, $\cos\theta$}? }\uncover<22->{How does this transform $\alert<22>{\diff \theta} $?} \uncover<26->{\alert<26>{How is $t$ expressed via $\theta$?}}
\[
\begin{array}{rcl}
\uncover<14->{ \alert<14,21>{\sin\alert<15>{\theta}}} &\uncover<14->{=} &\displaystyle \uncover<15->{ \alert<16>{\sin (\alert<15>{ 2\Arctan t} )}} \uncover<16->{ \alert<16>{= \frac{2 \alert<17>{\tan\left( \Arctan t\right)} }{1 + {\alert<17>{\tan}}^2 \alert<17>{ \left(\Arctan t \right)}} }} \uncover<17->{\alert<21>{ = \frac{2\alert<17>{ t}}{1+ {\alert<17>{t }}^2}}}\\
\uncover<14->{\alert<14,21>{\cos \alert<18>{\theta}}  } &\uncover<14->{=} &\displaystyle \alert<19>{ \uncover<18-> {\alert<19>{ \cos (\alert<18>{2\Arctan t}) }} } \uncover<19->{ \alert<19>{= \frac{1-{\alert<20>{\tan} }^2 \alert<20>{ (\Arctan t)}}{1+ {\alert<20>{\tan}}^2 \alert<20>{ (\Arctan t) }}}} \uncover<20->{  \alert<21>{= \frac{1- {\alert<20>{ t}}^2 }{1 +{\alert<20>{t} }^2}}} \\
\only<22->{
\uncover<22->{
\alert<22,23>{\diff \theta}}&\uncover<23->{\alert<23>{=}}& \displaystyle \uncover<23->{ \alert<23,24,25>{2 \diff \left(\Arctan t\right)}}\uncover<24->{ \alert<24,25>{=  \uncover<25->{ \alert<25>{\frac{2}{ 1+t^2}}} \uncover<24->{ \uncover<24>{ \textbf{?}}} \diff t}}\\
\uncover<26->{\alert<26,27>{t}&\alert<26,27>{=}&}\displaystyle \uncover<27->{\alert<27>{\tan \left(\frac{\theta}{2}\right)} }
}
\end{array}
\]
}

\only<1-20>{
Recall the expression of $\sin (2z), \cos (2z)$ via $\tan z$:
\[
\begin{array}{rcl}
\uncover<1->{\alert<1,2,16>{\sin \left(2z\right)}} &\uncover<1->{\alert<1>{=}}&\displaystyle  \uncover<2->{ \alert<2>{2\sin z\cos z}} \uncover<3->{=\frac{2 \alert<5>{\sin z\cos z} \uncover<4->{\alert<4>{ \frac{1}{\alert<5>{ \cos^2z}}}}}{\alert<3,6>{( \cos^2z +\sin^2z) }\uncover<4->{\alert<4,6>{\frac{1}{\cos^2z}}}}} \uncover<5->{\alert<16>{= \frac{2\alert<5>{\tan z} }{ \alert<6>{ 1+ \tan^2z}} } \quad .}\\
\uncover<1->{\alert<7,8,19>{\cos (2z)} }& \uncover<7->{ \alert<7,8>{= }}&\displaystyle\uncover<8->{\alert<8>{ \cos^2z-\sin^2z}} \uncover<9->{= \frac{ \alert<11>{ \left(\cos^2 z-\sin^2 z\right) \uncover<10->{\alert<10>{ \frac{1}{ \cos^2z} }}}}{\alert<12>{ \alert<9>{\left(\cos^2z +\sin^2 z\right)} \uncover<10->{\alert<10>{ \frac{1}{ \cos^2z }}} }}} \uncover<11->{\alert<19>{ =\frac{\alert<11>{ 1-\tan^2 z} }{\alert<12>{1+\tan^2z}}} ~ .}
\end{array}
\]
}



\uncover<28->{ 
\begin{theorem}
The substitution given above  transforms $ \int R(\cos \theta, \sin\theta)\diff \theta$ to an integral of a rational function of $t$.
\end{theorem}
}
\vspace{10cm}
\end{frame}
%end module trig-integrals-rationalizing-substitution


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-rationalizing-substitution-ex1.tex
%begin module trig-integrals-rationalizing-substitution-ex1
\begin{frame}
\begin{example}
\uncover<2->{Let $\alert<2,25>{\theta=2\arctan t}$, \alert<4>{$\cos \theta=\frac{1-t^2}{1+t^2}$}, \alert<3>{$\sin \theta=\frac{2t}{1+t^2}$}}\uncover<22->{, $\alert<22,24>{z= \frac{3}{\sqrt{5}} \left(t + \frac{1}{3} \right)}$.} 
\[
\begin{array}{rcl}
\displaystyle \int \frac{\alert<2>{ \diff \theta} }{ 2\alert<3>{\sin \theta} -\alert<4>{ \cos \theta} +5}
\only<1-16>{
\uncover<2->{&=& \displaystyle \int \frac{\alert<2>{ 2\diff t} }{\alert<2>{\alert<6,7,9>{(\alert<8>{1}+\alert<5>{t^2})}} \left(\alert<7>{ 2 \alert<3>{\frac{2 t}{ t^2+1}} } \alert<6,9>{-} \alert<4>{ \frac{(\alert<9>{ 1} \alert<6>{- t^2}) }{\alert<6,9>{1+t^2}}}+\alert<5,8>{5}\right)}} \\
\uncover<5->{ &=&\displaystyle \int \frac{\alert<10>{2} \diff t}{ \alert<5,6>{ \alert<10>{6}t^2} +\alert<7>{ \alert<10>{4} t} +\alert<8,9,10> {4}}}\\
\uncover<10->{&=&\displaystyle  \int \frac{\diff t}{\alert<10,11>{3}t^2+\alert<10>{2}t+\alert<10>{2}}}\\
\uncover<11->{ \uncover<12>{\alert<12>{\text{(complete square)}}} &=&\displaystyle \int \frac{\diff t}{ \alert<11>{3}\left(\alert<13>{ t^2+ 2t\frac{ 1}{\alert<11>{3}}} \uncover<12->{\alert<12>{\alert<13>{+ \frac{1}{9}} \alert<14>{-\frac{1}{9}}}} \alert<14>{+ \frac{ 2}{ \alert<11>{3}}} \right)}} \\
\uncover<13->{ &=& \displaystyle \frac{1}{3}\int\frac{\diff t}{\alert<13>{ \left(t+\frac{1}{3}\right)^2} + \alert<14,15>{ \frac{ 5}{9}}}} \\
}
\uncover<15->{&\alert<16,17>{=}&\alert<16,17>{\displaystyle \alert<18>{\frac{1}{3}} \int \frac{\diff t }{ \alert<15,18>{\frac{5}{9}} \left( \alert<15,19>{\frac{9}{5}} \left(t+ \frac{1}{3} \right)^2 +\alert<15>{1} \right)}}} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~}\\
\only<17->{
\uncover<18->{&=&\displaystyle \alert<18>{\frac{3}{5}}\int \frac{\uncover<20->{\alert<20>{ \frac{\sqrt{5}}{3}}} \diff \left( \alert<22>{ \uncover<20->{\alert<20>{\frac{3}{ \sqrt{5}}}}\left( t \uncover<21->{\alert<21>{+\frac{1}{3}}}\right)} \right) }{\left(\left(\alert<22>{ \alert<19>{ \frac{3}{ \sqrt{5}}} \left( t+\frac{1}{3}\right)}\right)^{\alert<19>{2} }+1 \right)} }\\
\uncover<22->{ &=&\displaystyle \frac{\sqrt{5}}{5} \alert<23>{\int \frac{\diff \alert<22>{ z}}{{\alert<22>{ z}}^2+1}}}\\
\uncover<23->{&=& \displaystyle  \frac{\sqrt{5}}{5} \alert<23>{\Arctan \alert<24>{z}} +C} \\
\uncover<24->{ &=&\displaystyle \frac{ \sqrt{5}}{5}\Arctan \left(\alert<24>{ \frac{3}{ \sqrt{5}} \left(\alert<25>{ t}+\frac{1}{3} \right)} \right)+C}\\
\uncover<25->{&=&\displaystyle \frac{ \sqrt{5}}{5}\Arctan \left( \frac{3}{ \sqrt{5}} \left(\alert<25>{ \tan \left(\frac{\theta}{2} \right)}+\frac{1}{3} \right) \right)+C
}
}
\end{array}
\]

\end{example}
\vspace{5cm}

\end{frame}
%end module trig-integrals-rationalizing-substitution-ex1


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-rationalizing-substitution-integral-of-sec.tex
\begin{frame}[t]
The integral $\int \sec \theta \diff \theta$ appears often in practice. A quicker solution will be shown later, but first we show the standard method.
\begin{example}
Set $\displaystyle \alert<9>{\theta=2\Arctan t}$, $\displaystyle \alert<3>{ \cos \theta =} \frac{1-\tan^2(\frac{\theta}{2}) }{1+\tan^2\left(\frac{\theta}{2}\right)}= \alert<3>{\frac{1-t^2}{1+t^2}}$, $\displaystyle  \alert<4>{\diff \theta = 2 \frac{1 }{ 1+t^2}\diff t}$.
$
\begin{array}{rclll}
\displaystyle \int \sec \theta\diff\theta &=& \displaystyle
\vphantom{ %phantom to align formulas
\ln \left|\frac{1+\tan \left(\frac{\theta}{2}\right)}{1-\tan \left(\frac{\theta}{2}\right)}\right|
} 
\displaystyle 
\only<1-10>{
\uncover<2->{ \int \frac{1}{\alert<3>{ \cos \theta}} \alert<4>{\diff \theta}}\uncover<3->{ = \int \frac{1}{ \left( \alert<3>{ \frac{1- t^2 }{ \alert<5>{1+t^2}}} \right)} \alert<4>{\frac{2}{(\alert<5>{ 1+t^2})} \diff t} } \\
\uncover<5->{ &=&\displaystyle \int \alert<6>{\frac{2}{1-t^2}}\diff t}\uncover<6->{ =\int \left(\alert<6>{ \frac{1}{1 -t}+ \frac{1}{ 1 +t}} \right)\diff t} \uncover<6->{&&\alert<6>{ \text{part. fractions}}}\\
\uncover<7->{&=&\displaystyle - \ln |1-t|+\ln |1+t| +C}\\
\uncover<8->{&=&\displaystyle \ln \left|\frac{1+\alert<9>{t}}{1-\alert<9>{t}}\right|+C}\\

\uncover<9->{&=&}
}
\only<1-21>{
\displaystyle \uncover<9->{ \alert<10,11>{\alert<21>{ \ln \left|\frac{1+\tan \left(\alert<9>{ \frac{\theta}{2}} \right)}{1-\tan \left(\alert<9>{\frac{\theta}{2}}\right)}\right|}+C} }
}
\only<22->{
\uncover<22->{\displaystyle  \alert<22>{\ln \left|\tan \theta +\sec \theta\right|} +C}
}
\end{array}
$

\only<11->{
\uncover<12->{
\noindent This is a perfectly good answer, however there's a simplification:}

$ 
\begin{array}{rcl} 
\uncover<12->{\alert<21,22>{\tan \theta+\sec \theta}&=&}\displaystyle\uncover<13->{ \frac{\alert<14>{ \sin \theta} +\alert<15>{1} }{\alert<16>{\cos \theta}}}\uncover<14->{ =\frac{\alert<17>{ \alert<14>{2\sin \frac{\theta}{2}\cos \frac{\theta}{2}} +\alert<15>{ \sin^2\frac{\theta}{2} + \cos^2\frac{\theta}{2}} }}{ \alert<16,18>{ \cos^2\frac{\theta}{2} -\sin^2\frac{\theta}{2}}} } \\
\uncover<17->{ &=&\displaystyle \frac{\alert<17>{ \left(\alert<19>{ \sin \frac{\theta}{2}+ \cos\frac{\theta}{2}} \right)^2 } }{ \alert<18>{ \left(\cos\frac{\theta}{2}-\sin \frac{\theta}{2}\right) \alert<19>{\left(\cos \frac{\theta}{2}+\sin \frac{\theta}{2}\right)} }}} \uncover<19->{ = \displaystyle \frac{\sin \frac{\theta}{2} +\cos\frac{\theta}{2}}{\cos\frac{\theta}{2} - \sin \frac{\theta}{2}}}\\
\uncover<20->{&\alert<21,22>{=}& \displaystyle\alert<21,22>{ \frac{1+\tan\frac{\theta}{2}}{1-\tan\frac{\theta}{2}}}\quad .}
\end{array}
$
}

\end{example}

\vspace{5cm}
\end{frame}


\subsection{Ad hoc methods for trigonometric integrals}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-without-rationalizing-substitution.tex
%begin module trig-integrals-without-rationalizing-substitution
\begin{frame}
\frametitle{Trigonometric Integrals - quick ad hoc techniques}
\begin{itemize}
\item As we saw, every rational trigonometric expression can be integrated with the substitution $\theta=2\Arctan t$.
\item<2-> This integration technique results in rather long computations. 
\item<3-> Particular integral types may be computable with quicker ad hoc techniques.
\item<4-> We illustrate such techniques on examples. 
\item<5-> Examples to which our ad hoc techniques apply arise from integrals needed outside of the subject of Calculus II, so these techniques are important.
\item<6-> The trigonometric integral we saw, $\int \frac{d\theta}{2\sin \theta -\cos\theta+5}$, will not work with any of following ad-hoc techniques, so the general method is important as well.
\end{itemize}
\end{frame}

%end module trig-integrals-without-rationalizing-substitution



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-ex1.tex
% begin module trig-integrals-ex1
\begin{frame}
\begin{example} %[Example 1, p. 496]
Evaluate $\int \cos^3 x \diff x$.
\begin{itemize}
\item<2->  Substituting $u =\cos x$ isn't helpful, since then $\diff u = -\sin x \diff x$.
\item<3->  Use the identity $\cos^2 x + \sin^2 x = 1$ to convert $\cos^2 x$ into an expression involving $\sin x$:
\item<4-| alert@6>  $\cos^3 x = \cos^2 x \cdot \cos x = (1 - \sin^2 x)\cos x$.
\item<5-| alert@7>  Now let $u = \sin x$, so $\diff u = \cos x \diff x$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<6->{%
\int \cos^3 x \diff x 
}%
& \uncover<6->{ = } &%
\uncover<6->{%
\int (1-\sin^2 x)\cos x\diff x
}\\%
& \uncover<7->{ = } &%
\uncover<7->{%
\int (1-u^2)\diff u
}\\%
& \uncover<8->{ = } &%
\uncover<8->{%
u - \frac{1}{3}u^3 + C
}%
\uncover<9->{%
 = \sin x - \frac{1}{3}\sin^3 x + C
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module trig-integrals-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-ex2.tex
% begin module trig-integrals-ex2
\begin{frame}
\begin{example} %[Example 2, p. 496]
Evaluate $\int \sin^5 x \cos^2 x \diff x$.
\begin{itemize}
\item<2->  We could convert $\cos^2 x$ to $1 - \sin^2 x$, but then we'd have an expression involving $\sin x$ without any $\cos x$.
\item<3->  Instead split off one $\sin x$ and express the remaining $\sin^4 x$ in terms of $\cos x$:
\item<4-| alert@10>  $\sin^5 x = (\sin^2 x)^2\sin x = (1 - \cos^2 x)^2\sin x$.
\item<5->  Now let \alert<handout:0| 6-7,11>{$u = \uncover<7->{\cos x}$}, so \alert<handout:0| 8-9,12>{$\diff u = \uncover<9->{-\sin x \diff x}$}.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<10->{%
\int \alert<handout:0| 10>{\sin^5 x}\cos^2 x \diff x 
}%
& \uncover<10->{ = } &%
\uncover<10->{%
\int \alert<handout:0| 10>{(1-\alert<handout:0| 11>{\cos^2 x})^2}\alert<handout:0| 11>{\cos^2 x}\alert<handout:0| 10,12>{\sin x}\alert<handout:0| 12>{\diff x}
}\\%
& \uncover<11->{ = } &%
\uncover<11->{%
\int (1-\alert<handout:0| 11>{u^2})^2\alert<handout:0| 11>{u^2}\alert<handout:0| 12>{(-\diff u)}
}  \uncover<13->{ = } \uncover<13->{%
-\int (u^2 - 2u^4 + u^6)\diff u
}\\%
& \uncover<14->{ = } &%
\uncover<14->{%
-\left( \frac{u^3}{3} - 2\frac{u^5}{5} +\frac{u^7}{7}\right) + C
}\\%
& \uncover<15->{ = } &%
\uncover<15->{%
-\frac{1}{3}\cos^3 x + \frac{2}{5}\cos^5 x - \frac{1}{7}\cos^7 x + C
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module trig-integrals-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-ex3.tex
% begin module trig-integrals-ex3
\begin{frame}
\begin{example} %[Example 3, p. 497]
Evaluate $\int_0^{\pi} \sin^2 x \diff x$.
\begin{itemize}
\item<2->  Writing $\sin^2 x = 1 - \cos^2 x$ doesn't make it any easier.
\item<3->  Instead use the half-angle identity $\sin^2 x = \frac{1}{2}(1-\cos 2x)$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<4->{%
\int_0^{\pi} \sin^2 x \diff x 
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\frac{1}{2}\int_0^{\pi} (1-\cos 2x)\diff x
}\\%
& \uncover<5->{ = } &%
\uncover<5->{%
\frac{1}{2}\left[ x - \frac{1}{2}\sin 2x\right]_0^{\pi}
}\\%
& \uncover<6->{ = } &%
\uncover<6->{%
\frac{1}{2}\left( \pi - \frac{1}{2}\sin 2\pi\right) %
 - \frac{1}{2}\left( 0 - \frac{1}{2}\sin 0\right)
}\\%
& \uncover<7->{ = } &%
\uncover<7->{%
\frac{\pi}{2}
}\\%
\end{eqnarray*}
\end{example}
\end{frame}
% end module trig-integrals-ex3



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-sin-cos.tex
% begin module trig-integrals-sin-cos
\begin{frame}
\frametitle{Evaluating $\int \sin^m x \cos^n x \diff x$ fast}
\only<handout:1| -1>{%
\begin{enumerate}
\item  If the power of cosine is odd ($n = 2k+1$), save one cosine factor and use $\cos^2 x = 1 - \sin^2 x$ to express the remaining factors in terms of sine:
\begin{eqnarray*}
\int \sin^m x \cos^{2k+1} x \diff x & = & \int \sin^m x (\cos^2 x)^k \cos x \diff x\\
& = & \int \sin^m x (1 - \sin^2 x)^k\cos x \diff x
\end{eqnarray*}
Then substitute $u = \sin x$.
\end{enumerate}
}%
\only<handout:2| 2>{%
\begin{enumerate}
\setcounter{enumi}{1}
\item  If the power of sine is odd ($m = 2k+1$), save one sine factor and use $\sin^2 x = 1 - \cos^2 x$ to express the remaining factors in terms of cosine:
\begin{eqnarray*}
\int \sin^{2k+1} x \cos^{n} x \diff x & = & \int (\sin^2 x)^k \cos^n x \sin x \diff x\\
& = & \int (1 - \cos^2 x)^k\cos^n x\sin x \diff x
\end{eqnarray*}
Then substitute $u = \cos x$.
\end{enumerate}
}%
\only<handout:3| 3->{%
\begin{enumerate}
\setcounter{enumi}{2}
\item  If the powers of both sine and cosine are even, use the half-angle identities
\[
\sin^2 x = \frac{1}{2}(1 - \cos 2x) \qquad \cos^2 x = \frac{1}{2}(1 + \cos 2x)
\]
\end{enumerate}
}%
\end{frame}
% end module trig-integrals-sin-cos



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-ex5.tex
% begin module trig-integrals-ex5
\begin{frame}
\begin{example} %[Example 5, p. 498]
Evaluate $\int \tan^6 x\sec^4 x \diff x$.
\begin{itemize}
\item<2->  Save one $\sec^2 x$ factor.
\item<3->  Use the identity \alert<handout:0| 6>{$\sec^2 x = 1 + \tan^2 x $} to convert the remaining $\sec^2 x$ into an expression involving $\tan x$.
\item<4->  Now let \alert<handout:0| 7,11>{$u = \tan x$}, so \alert<handout:0| 8>{$\diff u = \sec^2 x \diff x$}.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<5->{%
\int \tan^6 x\sec^4 x \diff x 
}%
& \uncover<5->{ = } &%
\uncover<5->{%
\int \tan^6 x \alert<handout:0| 6>{\sec^2 x} \sec^2 x\diff x
}\\%
& \uncover<6->{ = } &%
\uncover<6->{%
\int \alert<handout:0| 7>{\tan^6 x} \alert<handout:0| 6>{(1 + \alert<handout:0| 7>{\tan^2 x})} \alert<handout:0| 8>{\sec^2 x\diff x}
}\\%
& \uncover<7->{ = } &%
\uncover<7->{%
\int \alert<handout:0| 7>{u^6} (1 + \alert<handout:0| 7>{u^2} ) \alert<handout:0| 8>{\diff u}
}\\%
& \uncover<9->{ = } &%
\uncover<9->{%
\int (u^6 + u^8)\diff u
}\\%
& \uncover<10->{ = } &%
\uncover<10->{%
\frac{1}{7}\alert<handout:0| 11>{u^7} + \frac{1}{9}\alert<handout:0| 11>{u^9} + C
}%
\uncover<11->{%
 = \frac{\alert<handout:0| 11>{\tan^7 x}}{7} + \frac{\alert<handout:0| 11>{\tan^9 x}}{9} + C
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module trig-integrals-ex5



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-ex6.tex
% begin module trig-integrals-ex6
\begin{frame}
\begin{example} %[Example 6, p. 499]
Evaluate $\int \tan^5 x \sec^7 x \diff x$.
\begin{itemize}
\item<2->  We could separate $\sec^2 x$, but that leaves $\sec^5 x$ left over, which doesn't convert easily to $\tan x$. 
\item<3->  Instead split off $\tan x\sec x$ and express the remaining $\tan^4 x$ in terms of $\sec x$:
\item<4->  \alert<handout:0| 10>{$\tan^4 x = (\alert<handout:0| 4-5>{\tan^2 x})^2 = (\uncover<5->{\alert<handout:0| 5>{\sec^2 x - 1}})^2$}.
\item<6->  Now let \alert<handout:0| 6-7,11,15>{$u = \uncover<7->{\sec x}$}, so \alert<handout:0| 8-9,12>{$\diff u = \uncover<9->{\tan x \sec x\diff x}$}.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<10->{%
\int \alert<handout:0| 10>{\tan^5 x}\sec^7 x \diff x 
}%
& \uncover<10->{ = } &%
\uncover<10->{%
\int \alert<handout:0| 10>{(\alert<handout:0| 11>{\sec^2 x} - 1)^2}\alert<handout:0| 11>{\sec^6 x}\alert<handout:0| 12>{\sec x\alert<handout:0| 10>{\tan x}\diff x}
}\\%
& \uncover<11->{ = } &%
\uncover<11->{%
\int (\alert<handout:0| 11>{u^2} - 1)^2\alert<handout:0| 11>{u^6}\alert<handout:0| 12>{\diff u}
}  \uncover<13->{ = } \uncover<13->{%
\int (u^{10} - 2u^8 + u^6)\diff u
}\\%
& \uncover<14->{ = } &%
\uncover<14->{%
\left( \frac{\alert<handout:0| 15>{u^{11}}}{11} - 2\frac{\alert<handout:0| 15>{u^9}}{9} +\frac{\alert<handout:0| 15>{u^7}}{7}\right) + C
}\\%
& \uncover<15->{ = } &%
\uncover<15->{%
\frac{1}{11}\alert<handout:0| 15>{\sec^{11} x} - \frac{2}{9}\alert<handout:0| 15>{\sec^9 x} + \frac{1}{7}\alert<handout:0| 15>{\sec^7 x} + C
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module trig-integrals-ex6



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-tan-sec.tex
% begin module trig-integrals-tan-sec
\begin{frame}
\frametitle{Strategy for Evaluating $\int \tan^m x \sec^n x \diff x$}
\only<handout:1| -1>{%
\begin{enumerate}
\item  If the power of secant is even ($n = 2k$), save a factor of $\sec^2 x$ and use $\sec^2 x = 1 + \tan^2 x$ to express the remaining factors in terms of tangent:
\begin{eqnarray*}
\int \tan^m x \sec^{2k} x \diff x & = & \int \tan^m x (\sec^2 x)^{k-1} \sec^2 x \diff x\\
& = & \int \tan^m x (1 + \tan^2 x)^{k-1}\sec^2 x \diff x
\end{eqnarray*}
Then substitute $u = \tan x$.
\end{enumerate}
}%
\only<handout:2| 2>{%
\begin{enumerate}
\setcounter{enumi}{1}
\item  If the power of tangent is odd ($m = 2k+1$), save one factor of $\sec x \tan x$ and use $\tan^2 x =  \sec^2 x - 1$ to express the remaining factors in terms of secant:
\begin{eqnarray*}
\int \tan^{2k+1} x \sec^{n} x \diff x & = & \int (\tan^2 x)^k \sec^{n-1} x \sec x\tan x \diff x\\
& = & \int (\sec^2 x - 1)^k\sec^{n-1} x\sec x\tan x \diff x
\end{eqnarray*}
Then substitute $u = \sec x$.
\end{enumerate}
}%
\only<handout:3| 3->{%
Finally we need the indefinite integrals of tangent and secant. Those can be/were systematically computed with the rationalizing substitution $x=2\arctan t$. Alternatively, we may compute directly:

\begin{columns}[t]
\column{.5\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
& & \int \tan x \diff x\\
& \uncover<4->{ = } & %
\uncover<4->{\int \frac{\sin x}{\cos x}\diff x}\\
& & \uncover<5->{\textrm{Let $u = \cos x$, so }}\\
& & \uncover<5->{\diff u = -\sin x \diff x}\\
& \uncover<6->{ = } & %
\uncover<6->{-\int \frac{\diff u}{u}}\\
& \uncover<7->{ = } & %
\uncover<7->{-\ln |u| + C}\\
& \uncover<8->{ = } & %
\uncover<8->{-\ln |\cos x| + C}\\
& \uncover<9->{ = } & %
\uncover<9->{\ln |\sec x| + C}\\
\end{eqnarray*}
\column{.5\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
& & \int \sec x \diff x\\
& \uncover<10->{ = } & %
\uncover<10->{\int \sec x\frac{\sec x + \tan x}{\sec x + \tan x}\diff x}\\
& \uncover<11->{ = } & %
\uncover<11->{\int \frac{\sec^2 x + \sec x \tan x}{\sec x + \tan x}\diff x}\\
& & \uncover<12->{\textrm{Let $u = \sec x + \tan x$:}}\\
& \uncover<13->{ = } & %
\uncover<13->{\int \frac{\diff u}{u}}\\
& \uncover<14->{ = } & %
\uncover<14->{\ln |u| + C}\\
& \uncover<15->{ = } & %
\uncover<15->{\ln |\sec x + \tan x| + C}\\
\end{eqnarray*}
\end{columns}
}%
\end{frame}
% end module trig-integrals-tan-sec



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-ex7.tex
% begin module trig-integrals-ex7
\begin{frame}
\begin{example} %[Example 7, p. 500]
\begin{eqnarray*}
\int \tan^3 x \diff x%
 & \uncover<2->{ = } & %
\uncover<2->{\int \tan x \tan^2 x \diff x}\\%
 & \uncover<3->{ = } & %
\uncover<3->{\int \tan x (\sec^2 x - 1)\diff x}\\%
 & \uncover<4->{ = } & %
\uncover<4->{\int \tan x \sec^2 x \diff x - \int \tan x \diff x}\\%
 & \uncover<5->{ = } & %
\uncover<5->{\frac{\tan^2 x}{2}  -  \ln|\sec x|  + C}\\%
\end{eqnarray*}
\end{example}
\end{frame}
% end module trig-integrals-ex7



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-ex8.tex
% begin module trig-integrals-ex8
\begin{frame}
\begin{example} %[Example 8, p. 500]
Find $\int \sec^3 x \diff x$.

\uncover<2->{%
Integrate by parts:
\[
\begin{array}{l@{\qquad}l}
u = \sec x & \diff v = \sec^2 x \diff x\\
\alert<handout:0| 3-4>{\diff u = \uncover<4->{\sec x \tan x\diff x}} & \alert<handout:0| 5-6>{v = \uncover<6->{\tan x}}
\end{array}
\]
}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<7->{%
\alert<handout:0| 10>{\int \sec^3 x \diff x}
}%
& \uncover<7->{ = } & %
\uncover<7->{\sec x \tan x - \int \sec x \tan^2 x\diff x}\\%
& \uncover<8->{ = } & %
\uncover<8->{\sec x \tan x - \int \sec x (\sec^2 x - 1)\diff x}\\%
& \uncover<9->{ = } & %
\uncover<9->{\sec x \tan x \alert<handout:0| 10>{- \int \sec^3 x\diff x} + \int \sec x \diff x}\\%
\uncover<10->{%
\alert<handout:0| 10>{2 \int \sec^3 x \diff x}
}%
& \uncover<10->{ = } & %
\uncover<10->{\sec x \tan x + \int \sec x \diff x}\\%
\uncover<11->{%
\int \sec^3 x \diff x
}%
& \uncover<11->{ = } & %
\uncover<11->{\frac{1}{2}(\sec x \tan x +\ln| \sec x +\tan x|)+ C}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module trig-integrals-ex8



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-sinm-cosn.tex
% begin module trig-integrals-sinm-cosn
\begin{frame}
To evaluate integrals of the form
\begin{enumerate}
\item  $\int \sin mx \cos nx \diff x$
\item  $\int \sin mx \sin nx \diff x$
\item  $\int \cos mx \cos nx \diff x$
\end{enumerate}
use the corresponding identity:
\begin{enumerate}
\item  $\sin A \cos B = \frac{1}{2}[\sin (A-B) + \sin (A+B)]$
\item  $\sin A \sin B = \frac{1}{2}[\cos (A-B) - \cos (A+B)]$
\item  $\cos A \cos B = \frac{1}{2}[\cos (A-B) + \cos (A+B)]$
\end{enumerate}
\end{frame}
% end module trig-integrals-sinm-cosn



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-integrals/trig-integrals-sinm-cosn-ex9.tex
% begin module trig-integrals-sinm-cosn-ex9
\begin{frame}
\begin{example} %[Example 9, p. 501]
\begin{eqnarray*}
\int \sin 4x \cos 5x \diff x & \uncover<2->{ = } & %
\uncover<2->{\int \frac{1}{2} [ \sin (4x - 5x) + \sin (4x + 5x)]\diff x}\\%
 & \uncover<3->{ = } & %
\uncover<3->{\frac{1}{2} \int  ( \sin (-x) + \sin (9x))\diff x}\\%
 & \uncover<4->{ = } & %
\uncover<4->{\frac{1}{2} \int  (-\sin x + \sin (9x))\diff x}\\%
 & \uncover<5->{ = } & %
\uncover<5->{\frac{1}{2}   (\cos x - \frac{1}{9}\cos (9x)) + C}\\%
\end{eqnarray*}
\end{example}
\end{frame}
% end module trig-integrals-sinm-cosn-ex9



}% end lecture

\lect{Spring 2015}{Lecture 7}{7}{
\section{Integrals of form $\int R(x,\sqrt{ax^2+bx+c}) \diff x$, $R$ - rational function}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/quadratic-radicals-integrals-intro.tex
%begin module Euler-substitution-intro
\begin{frame}
\frametitle{Integrals of form $\int R(x,\sqrt{ax^2+bx+c}) \diff x$, $R$ - rational function}
Let $R(x,y)$ be an arbitrary rational expression in two variables (quotient of polynomials in two variables).
\begin{question}
Can we integrate $\alert<10>{\displaystyle\int R\left(x,\sqrt{ax^2+bx+c} \right) \diff x}$?
\end{question}
\begin{itemize}
\item<2-> Yes. We will learn how in what follows.
\item<3-> The algorithm for integration is roughly:
\begin{itemize}
\item<4-> Use linear substitution to transform to one of three integrals: 
\uncover<5->{$\int R(x, \sqrt{x^2+1})\diff x$, } \uncover<6->{$\int R(x, \sqrt{-x^2+1})\diff x$, } \uncover<7->{$\int R(x, \sqrt{x^2-1}) \diff x$.}
\item<8-> Use trigonometric substitution or Euler substitution to transform to trigonometric or rational function integral (no radicals).
\item<9-> Solve as previously studied.
\end{itemize}
\item<10-> We motivate why we need \alert<10>{such integrals } by examples such as computing the area of an ellipse.
\end{itemize}
\end{frame}
%end module Euler-substitution-intro


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitutions-intro.tex
% begin module trig-substitutions-intro
\begin{frame}
\frametitle{Trigonometric Substitution}
\begin{itemize}
\item  To find the area of a circle or ellipse, one needs to compute $\int \sqrt{a^2 - x^2} \diff x$.
\item<2->  For $\int x\sqrt{a^2 - x^2}\diff x$, the substitution $u = a^2 - x^2$ would work.
\item<3->  For $\int \sqrt{a^2 - x^2}\diff x$, we need a more elaborate substitution.
\item<4-| alert@6>  Instead, substitute $x = a\sin \theta$.
\end{itemize}
\[
\uncover<5->{%
\sqrt{a^2-\alert<handout:0| 6>{x^2}} = %
}%
\uncover<6->{%
\sqrt{a^2-\alert<handout:0| 6>{a^2\sin^2 \theta}} = %
}%
\uncover<7->{%
\sqrt{a^2(1 - \sin^2 \theta )} = %
}%
\uncover<8->{%
\sqrt{a^2\cos^2 \theta} = a|\cos \theta |.%
}%
\]
\begin{itemize}
\item<9->  With $u = a^2 - x^2$, the new variable is a function of the old one.
\item<10->  With $x = a\sin \theta$, the old variable is a function of the new one.
%Greg: the below remarks seem redundant to me. Students know how to compute \diff x, I'd think they'd be more confused than englightened by ``substitutions in reverse''.
%\item<11->  To make a substitution of the form $x = g(t)$, use the substitution rule in reverse.
%\item<12->  We call this inverse substitution.
\end{itemize}
\end{frame}
% end module trig-substitutions-intro



\subsection{Transforming to the forms $\sqrt{x^2+1}, \sqrt{-x^2+1}, \sqrt{x^2-1} $}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/quadratic-radicals-linear-substitution-preparation-ex1.tex
%begin module quadratic-radicals-linear-substitution-preparation-ex1
\begin{frame}
\frametitle{Linear substitutions to simplify radicals $\sqrt{ay^2+by+c}$}
\begin{itemize}
\item Using linear substitutions, radicals of form  $\sqrt{ay^2+by+c}$, $a\neq 0$, $b^2-4ac\neq 0$ can be transformed to (multiple of):
\begin{itemize}
\item $\sqrt{x^2+1}$ 
\item $\sqrt{-x^2+1}$
\item $\sqrt{x^2-1}$.
\end{itemize}
\item We already studied how to do that using completing the square when dealing with rational functions. 
\end{itemize}
\end{frame}
\begin{frame}
Recall: linear substitution is subst. of the form $u=px+q$.
\begin{example}
Use linear substitution to transform $\sqrt{x^2+x+1}$ to multiple of $\sqrt{u^2+1}$. 

\noindent $
\begin{array}{rcl}
\sqrt{x^2+x+1}&=&\displaystyle \uncover<2->{ \sqrt{ x^2+2\frac{1}{2}x + \uncover<3->{ \alert<3>{ \frac{1}{4} } } \uncover<2>{ \alert<2>{ \textbf{?}}} \uncover<2->{ \alert<2,3>{-} } \uncover<3->{ \alert<3>{ \frac{1}{4}}} \uncover<2>{\alert<2>{\textbf{?}}} +1}} \\
\uncover<4->{&=&\displaystyle \sqrt{ {\left(x+\uncover<5->{\alert<5>{\frac{1}{2}}} \uncover<4>{ \alert<4>{ \textbf{?}}} \right)}^2 + \uncover<4>{\alert<4>{\textbf{?} }} \uncover<5->{ \alert<5,6>{ \frac{3}{4}}} }} \\
\uncover<6->{&=&\displaystyle \sqrt{ \alert<6,7>{ \frac{3}{4}}\left( \alert<6,8>{\frac{4}{3}} \left(x+\frac{1}{2}\right)^{\alert<8>{2}} +\alert<6>{ 1} \right)}}\\
\uncover<7->{&=&\displaystyle \alert<7>{\frac{\sqrt{3}}{2}} \sqrt{\left(  \alert<9>{\alert<8>{\frac{2}{\sqrt{3}}} \left( x+ \frac{1}{2} \right)}\right)^{\alert<8>{2}}+1}}\\
\uncover<9->{ &=&\displaystyle \frac{\sqrt{3}}{2} \sqrt{ {\alert<9>{u}}^2+1},}
\end{array}
$

\noindent \uncover<9->{ where $\displaystyle \alert<9>{u= \frac{2}{\sqrt{3}}\left( x+\frac{1}{2}\right)}  =\frac{2\sqrt{3}}{3}x +\frac{\sqrt{3}}{3} $.}
\end{example}
\vspace{5cm}
\end{frame}
%end module quadratic-radicals-linear-substitution-preparation-ex1


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/quadratic-radicals-linear-substitution-preparation-ex2.tex
%begin module quadratic-radicals-linear-substitution-preparation-ex2
\begin{frame}
Recall: linear substitution is subst. of the form $u=px+q$.
\begin{example}
Use linear subst. to transform $\sqrt{-2x^2+x+1}$ to multiple of $\sqrt{-u^2+1}$. 

\noindent 
$
\begin{array}{rcl}
\sqrt{\alert<2>{ -2}x^2+x+\alert<2>{1}}&=& \uncover<2->{ \sqrt{ \alert<2>{-2} \left(x^2\alert<2>{- \alert<3>{\frac{1}{2}}} x \alert<2>{-\frac{1}{2}}\right) }} \\
\uncover<3->{ &=& \sqrt{ -2 \left( \alert<6>{ x^2- \alert<3>{2\frac{1}{4}}x  +\uncover<3,4>{ \alert<4>{\textbf{?} }} \uncover<5->{\alert<5>{ \frac{1}{16}}}} \alert<7>{-} \uncover<3,4>{\alert<4>{\textbf{?}}}\uncover<5->{\alert<5,7>{ \frac{1}{16}}} \alert<7>{-\frac{1}{2}}\right) }}\\
\uncover<6->{&=&\sqrt{\alert<8,9>{-2} \left(\alert<6>{ \left(x-\frac{1}{4}\right)^2} \alert<7,8>{-\frac{9}{16}} \right)}} \\
\uncover<8->{&=&\sqrt{ \alert<8,9,10>{ \frac{9}{8}}\left( \alert<9>{-\alert<11>{\frac{16}{9}} } \left(x- \frac{1}{4} \right)^{\alert<11>{2}}+ \alert<8>{1} \right)}}\\
\uncover<10->{&=&\alert<10>{ \frac{3}{\sqrt{8}}} \sqrt{- \left(\alert<12>{ \alert<11>{\frac{4}{3}} \left(x-\frac{1}{4}\right)}\right)^{\alert<11>{2}}+1 }}\\
\uncover<12->{&=&\frac{ 3}{\sqrt{8}} \sqrt{-{\alert<12>{ u}}^2+1},}
\end{array}
$

\noindent \uncover<12->{where $\alert<12>{u=\frac{4}{3}\left(x-\frac{1}{4}\right) } =\frac{4}{3}x-\frac{1}{3}$.}
\end{example}
\end{frame}
%end module quadratic-radicals-linear-substitution-preparation-ex2



\subsection{Table of Euler and trig substitutions}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitutions-euler-substitutions-table.tex
%begin module trig-substitutions-euler-substitutions-table

\begin{frame}
\begin{itemize}
\item Let $R$ be a rational function in two variables.
\item<2-> So far, with linear transformations we converted all integrals of the form $\displaystyle\int R(x, \sqrt{ax^2+bx+c})\diff x$ to one of the three forms:

\alert<4,9>{$\int R(x, \sqrt{x^2+1})\diff x$}, \alert<5,10>{$\int R(x, \sqrt{-x^2+1})\diff x$} , \alert<6,11>{$\int R(x, \sqrt{x^2-1}) \diff x$}.
\item<3-> Each of the above integrals can be transformed to a rational trigonometric integral using 3 pairs of substitutions:

\alert<4,9>{$x=\tan\theta $, $x=\cot \theta$;}  
\alert<5,10>{$x=\sin\theta $, $x=\cos \theta$;}
\alert<6,11>{$x=\csc\theta $, $x=\sec \theta$.}
\item<7-> We studied that trigonometric integrals are converted to rational function integrals via $\theta=2\arctan t$.
\item<8-> The resulting 3 pairs of substitutions are called Euler substitutions:
\alert<9,13>{$x=\tan (2\arctan t) $, $x=\cot (2\arctan t)$;}  
\alert<10,13>{$x=\sin(2\arctan t) $, $x=\cos (2\arctan t)$;}
\alert<11,13>{$x=\csc(2\arctan t) $, $x=\sec (2\arctan t)$.}
\item<12-> The Euler substitutions directly transform the integral to a rational function integral.
\item<13-> We will demonstrate that the Euler substitutions are \alert<13>{rational}.
\end{itemize}

\end{frame}

\begin{frame}
\frametitle{Trigonometric substitution and Euler substitution}
{\tabcolsep=0.11cm
\noindent\begin{tabular}{|l|l|l|r|}
\hline
Expression & Substitution& Variable range & Relevant identity\\\hline
\multirow{2}{*}{$\sqrt{x^2+1}$} & $x = \tan \theta$ &  $ \theta\in \left(-\frac{\pi}{2} , \frac{\pi}{2}\right)$ & $1 + \tan^2 \theta = \sec^2 \theta$\\
&$x=\cot \theta$ &$ \theta\in (0, \pi) $ & $1+\cot^2\theta =\csc^2\theta $ \\ \hline 
\multirow{2}{*}{ $\sqrt{-x^2+1 }$} & $x = \sin \theta$ &  $ \theta\in \left[ -\frac{\pi}{2} ,\frac{\pi}{2}\right]$ & $1 - \sin^2 \theta = \cos^2 \theta$\\
& $x = \cos \theta$ & $\theta\in (0,\pi)$& $1-\cos^2\theta=\cos^2\theta$ \\\hline 
\multirow{2}{*}{$\sqrt{x^2-1}$} &$x=\csc \theta$ &$\theta\in \left[0, \frac{\pi}{2} \right) \cup \left[ \pi, \frac{3\pi}{2}\right)$ &  $\csc^2\theta-1=\cot^2\theta $ \\
&$x = \sec \theta$ & 
$\theta\in \left[0, \frac{\pi}{2}\right)\cup \left[\pi, \frac{ 3 \pi}{2}\right)$
& $\sec^2\theta - 1 = \tan^2\theta$
\\
\hline
\multicolumn{4}{c}{Euler substitution by applying in addition $\theta=2\arctan t$}\\
\hline
\multirow{2}{*}{$\sqrt{x^2+1}$} & $ x =\frac{2t}{1-t^2}$ & $-1< t< 1$ & (?) \\
&$ x=\frac{1}{2} \left(\frac{1}{t}-t\right)$ & $0<t $ &  (?)\\ \hline 
\multirow{2}{*}{ $\sqrt{-x^2+1 }$} & $x=\frac{2t}{1+t^2} $ & $-1\leq t\leq 1 $ & (?)\\
& $x =\frac{1-t^2}{1+t^2} $ & $0<t$&  (?)\\\hline 
\multirow{2}{*}{ $\sqrt{x^2-1}$} & $x=\frac{1}{2}\left(\frac{ 1}{t}+t\right)$ & $t\in (-\infty, -1)\cup [0,1)$&(?)\\
& $x =\frac{1+t^2}{1-t^2} $ & $t \in (-\infty,-1)\cup [0,1)$ & (?)\\\hline
\end{tabular}
}
\end{frame}
%end module trig-substitutions-euler-substitutions-table



\subsection{The case $\sqrt{x^2+1}$}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitution-case-1-cot.tex
%begin module trig-substitution-case-1-cot
\begin{frame}
\frametitle{Trigonometric substitution $x=\cot \theta$  for $\sqrt{ x^2+1}$}
The trigonometric substitution $ \alert<2,13>{x=\cot \theta}$, $\theta\in \left(0 , \pi\right) $ for $\sqrt{x^2+1}$:
\[
\begin{array}{rclll}
\displaystyle  \alert<8,9,12>{\sqrt{\alert<2>{x}^2+1}}
\vphantom{\frac{1}{\sin \theta}}
\only<1-8>{
&=&\displaystyle \uncover<2->{ \sqrt{\alert<3>{\alert<2>{\cot}^2 \alert<2>{ \theta} } +1} }\\
\uncover<3->{&=&\displaystyle \sqrt{\alert<4>{\alert<3>{\frac{\cos^2 \theta }{ \sin^2 \theta}} + 1} }} \\
\uncover<4->{&=&\displaystyle \sqrt{ \alert<4>{\frac{\alert<5>{ \cos^2 \theta+ \sin^2\theta}}{ \sin^2 \theta}}}} \\
\uncover<5->{&=& \displaystyle  \sqrt{\frac{\alert<5>{ 1} }{ \sin^2 \theta}}=\frac{1}{\alert<6>{\sqrt{\sin^2\theta}}} } \uncover<6->{ && 
\begin{array}{|l}\displaystyle \text{when }\theta\in \left(0 , \pi\right) \text{ we have }\\ ~ \sin \theta \geq 0\text{ and so } \\ \alert<6>{ \sqrt{\sin^2 \theta}=\sin\theta}  \end{array} }
\\
} %only<1-8>
\uncover<6->{&\alert<8,9,12>{ =}& \displaystyle  \alert<8,9,12>{\frac{1}{\alert<6>{ \sin \theta} }}} \uncover<7->{\alert<8,9,12>{= \csc \theta \quad . }} && {~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~~} {~~~~~~~~~~~~~~~~~~~} %white space flushes formulas to the left
\end{array}
\]
\uncover<10->{
The differential $\diff x$ can be expressed via $\diff \theta$ from $x=\cot \theta$. \uncover<11->{
To summarize:
\begin{definition}The trigonometric substitution $\alert<13>{ x=\cot \theta }$, $\theta\in (0,\pi)$ for $\sqrt{x^2+1} $ is given by:
\[
\begin{array}{rcl}
x &=&\displaystyle \cot \theta \\
\alert<12>{\sqrt{x^2+1}}&\alert<12>{=}&\displaystyle \alert<12>{\frac{1}{\sin \theta}=\csc \theta}\\
\alert<14,15>{\diff x} &\alert<14,15>{=}&\displaystyle \uncover<15->{\alert<15>{ -\frac{\diff \theta}{\sin^2\theta} = - \csc^2 \theta} } \uncover<1-14>{\alert<14>{\textbf{?}}} \alert<14,15>{\diff \theta}\\
\alert<13>{\theta}& \alert<13>{=}& \alert<13>{\Arccot x}\quad .
\end{array}
\]
\end{definition}
}
}

\vspace{10cm}
\end{frame}
%end module trig-substitution-case-1-cot


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitutions-ex3.tex
% begin module trig-substitutions-ex3
\begin{frame}
\begin{example} %[Example 3, p. 505]
\begin{columns}[c]
\column{.4\textwidth}
Find $\int \frac{1}{x^2 \sqrt{x^2+4}}\diff x$.
\begin{itemize}
\item<2->  Let \alert<handout:0| 3-4,7,14,20>{$x = \uncover<4->{2\tan \theta}$}\uncover<4->{, where \alert<handout:0| 10>{$-\pi /2 \leq \theta \leq \pi / 2$}.}
\item<2->  Then \alert<handout:0| 5-6,13>{$\diff x = \uncover<6->{2\sec^2 \theta\diff \theta}$}\uncover<6->{.}
\end{itemize}
\column{.6\textwidth}
\begin{center}
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.15,-0.3)(2.3,1.2)
\psframe*[linecolor=white](-0.1,-0.3)(2.3,1.2)
\psline(0,0)(2, 0)(2,1)(0,0)
\psline(1.9,0)(1.9, 0.1)(2,0.1)
\fcAngle{0}{0.463648}{0.4}{$\theta$}
\uncover<handout:0|20->{
\rput[l](2.1, 0.5){$x$}
\rput[t](1, -0.1){$2$}
}
\uncover<handout:0|21->{
\rput[br](1, 0.55){$\sqrt{x^2+4}$}
}
%bounding box for pdflatex compilation:
\psline[linecolor=red!1](-0.11, -0.3 )(-0.105, -0.3)
\psline[linecolor=red!1](2.3, 1.21)(2.3, 1.205)
\end{pspicture}
%\ \only<handout:0| -19>{%
%\includegraphics[height=3cm]{trig-substitution/pictures/08-03-ex3a.pdf}%
%}%
%\only<handout:0| 20>{%
%\includegraphics[height=3cm]{trig-substitution/pictures/08-03-ex3b.pdf}%
%}%
%\only<21->{%
%\includegraphics[height=3cm]{trig-substitution/pictures/08-03-ex3c.pdf}%
%}%
\end{center}
\end{columns}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<2->{%
\alert<handout:0| 12>{%
\sqrt{\alert<handout:0| 7>{x^2} + 4} =
}%
}%
\uncover<7->{%
\sqrt{\alert<handout:0| 7>{4\tan^2 \theta} + 4} =
}%
\uncover<8->{%
\sqrt{4 \sec^2 \theta} =
}%
\uncover<9->{%
2 |\sec  \theta | =
}%
\uncover<10->{%
\alert<handout:0| 12>{%
2 \sec  \theta
}%
}%
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<11->{%
\int \frac{\alert<handout:0| 13>{\diff x}}{\alert<handout:0| 14>{x^2}\alert<handout:0| 12>{\sqrt{x^2+4}}}%
}%
& \uncover<11->{ = } & %
\uncover<11->{%
\int\frac{\alert<handout:0| 13>{2\sec^2 \theta \diff \theta}}{\alert<handout:0| 14>{4\tan^2 \theta}\cdot \alert<handout:0| 12>{2\sec \theta}}
}%
\uncover<15->{%
 = \frac{1}{4}\int \frac{\cos \theta}{\sin^2\theta} \diff \theta
}\\%
\uncover<16->{%
\textrm{Let } \alert<handout:0| 19>{u = \sin \theta} :%
}%
& \uncover<17->{ = } & %
\uncover<17->{%
\frac{1}{4} \int \frac{\diff u}{u^2}
}  \uncover<18->{ = }  \uncover<18->{%
\frac{1}{4} \left( -\alert<handout:0| 19>{\frac{1}{u}}\right)  + C
}\\%
& \uncover<19->{ = } & %
\uncover<19->{%
 -\frac{\alert<handout:0| 19,22-23>{\csc \theta}}{4} + C
}%
\uncover<23->{%
=  -\frac{\alert<handout:0| 23>{\sqrt{x^2+4}}}{4\alert<handout:0| 23>{x}} + C
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module trig-substitutions-ex3



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/Euler-substitution-case-1-cot.tex
%begin module Euler-substitution-case-1-cot
\begin{frame}
\frametitle{Euler subst. for $\sqrt{x^2+1}$ corresponding to $x=\cot \theta$ }
\begin{itemize}
\item $\alert<4>{ x =\cot \theta}$ transforms $\diff x, x,\sqrt{x^2+1}$ to trig form.
\item $\alert<5>{\theta=2\Arctan t}$, \uncover<3->{ $t>0$} transforms $\diff \theta, \cos\theta,\sin \theta$ to rational form.
\end{itemize}
\uncover<2->{\alert<2>{What if we compose the above?}} \uncover<3->{\alert<3>{We get the Euler substitution:}}
\only<1-34>{ %
\[
\begin{array}{rclll}
\uncover<3->{\alert<4,16,26,33,34>{x}} 
\vphantom{\frac{1}{2}\left(\frac{1}t - t\right)}
&\uncover<3->{\alert<4,16,26,33,34>{=}} &\displaystyle 
\vphantom{\frac{1}{2}\left(\frac{1}t -t\right)} %phantom
\only<3-13>{
\displaystyle \uncover<4->{\alert<4>{ \cot\alert<5>{\theta}}} \\
\uncover<5->{&=& \displaystyle \alert<8>{\cot \left(\alert<5>{2\arctan t}\right)}} \uncover<6->{&&| \displaystyle  \text{Recall: } \alert<8>{\cot (2z)} =\frac{ \cos (2z)}{\sin (2z)} \uncover<7->{\alert<8>{=\frac{1-\tan^2z}{2\tan z }}}} \\
\uncover<8->{ &=&\displaystyle \alert<8>{ \frac{1-{\alert<9>{\tan}}^2 \alert<9>{(\arctan t)}}{2 \alert<9>{\tan (\arctan t)}}}} \\
\uncover<9->{&=&\displaystyle \alert<16>{\frac{\alert<11>{1}-\alert<12>{{\alert<9>{t}}^2}}{\alert<10>{2} \alert<9,11,12>{t}}}}\\
\uncover<10->{&=&}
} %only <3-13>
\uncover<10->{\displaystyle \alert<13,14,16,26,33,34>{ \alert<10>{ \frac{1}{2}}\left(\alert<11>{\frac{1}t} - \alert<12>{t} \right)}\quad . &&
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} %whitespace flushes formulas left
}
\end{array}
\]
\uncover<15->{
We can furthermore compute 
\[
\begin{array}{rclll}
\displaystyle 
\alert<32,34>{\sqrt{x^2+1}}& \alert<32,34>{=}& 
\only<1-23>{
\displaystyle  \uncover<16->{ \sqrt{ \alert<16>{\alert<17>{\frac{1}{4}} \left(\frac{1}t -t \right)^2} +\alert<17>{1}}}\\
\uncover<17->{ &=&\displaystyle \alert<17>{\frac{1}{2}} \alert<22>{ \sqrt{\alert<19>{\left( \frac{1}{t} \only<1-19>{-}\only<20->{\alert<20>{+}} t \right)^2\uncover<1-19>{+\alert<17>{4}}}}}} & &
\only<18,19>{
\begin{array}{|l} 
\alert<19>{\left(\frac{1}{t}- t\right)^2+4=\left(\frac{1}{t}\alert<18>{+}t\right)^2 }
\end{array}
} 
\uncover<21->{ 
\begin{array}{|l}
\alert<22>{\sqrt{\left(\frac{1}{t}+t\right)^2} = \frac{1}{t} +t}\\ \text{ because }t>0
\end{array}
} %uncover<21->
\\
&\uncover<22->{=}&
} %only<1-23>
\uncover<22->{ \displaystyle \alert<23,24,32,34>{ \frac{1}{2}\left(\alert<22>{\frac{1}{t}+t}\right)} 
\vphantom{\sqrt{ \frac{1}{4} \left(\frac{1}t -t \right)^2 }}
\quad . &&} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} %whitespace flushes formulas left
\end{array}
\]
}
\uncover<25->{
Finally compute 
\[
\begin{array}{rcl}
\alert<34>{\diff \alert<26>{x}}&=&\displaystyle  \uncover<26->{\alert<27,28>{\diff \left( \alert<26>{\frac{1}{2} \left(\frac{1}t -t\right)} \right)}}\uncover<27->{\alert<27,28,34>{=}} \uncover<28->{\alert<28,34>{-\frac12 \left( \frac{1}{t^2} +1\right) \diff t}}\\
\displaystyle \uncover<29->{  \alert<30,34>{t}}&\uncover<29->{=} &\displaystyle  \uncover<29->{\alert<32>{ \alert<30,31>{\frac{1}{2}} \left(\alert<31>{\frac{1 }{ t}} +\alert<30>{t}\right)} \alert<30,31>{-} \alert<33>{\alert<30,31>{ \frac{1}{2}} \left(\alert<31>{ \frac{1}{t}} \alert<30>{- t}\right)}\uncover<32->{\alert<34>{ = \alert<32>{\sqrt{ x^2 +1}} -\alert<33>{x}}}\quad .} 
\end{array}
\]
}
} %only <1-34>
\uncover<35->{
\begin{definition}The Euler substitution for $\sqrt{x^2+1}$ corresponding to $x=\cot \theta$ is given by:
\[
\begin{array}{rcl}
\alert<35>{x} &\alert<35>{=}&\displaystyle \alert<35>{\frac12\left(\frac{1}{t}- t\right) }, \quad \quad t>0\\
\displaystyle \alert<35>{ \sqrt{x^2+1}} & \alert<35>{=}& \displaystyle \alert<35>{\frac12 \left(\frac1t +t\right)} \\ 
\displaystyle \alert<35>{ \diff x}& \alert<35>{=}&\displaystyle \alert<35>{-\frac12\left(\frac{1}{t^2}+1\right) \diff t}\\
\alert<35>{t} &\alert<35>{=}&\alert<35>{\sqrt{x^2+1}-x}\quad .
\end{array}
\]
\end{definition}

\vspace{5cm}
}
\end{frame}

%end module Euler-substitution-case-1-cot


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/area-under-hyperbola-ex1.tex
%begin module area-under-hyperbola-ex1

\begin{frame}
Recall Euler substitution: $x=\frac12\left(\frac{1}{t}- t \right)$, $\alert<2>{\sqrt{x^2+1}=\frac{1}2\left(\frac 1 t +t\right)}$, $\alert<12,13,14>{ t=\sqrt{x^2+1}-x} $, $\alert<3>{ \diff x=-\frac12 \left(\frac1{t^2} +1\right)\diff t}$.
\begin{example}
$
\begin{array}{rcl}
\displaystyle \int \alert<2>{ \sqrt{x^2+1}} \alert<3>{\diff x} \vphantom{ \frac{1}{8}\left(\frac{1}{ (\sqrt{ x^2 +1} -x)^2} - (\sqrt{x^2+1}- x)^2 \right) } &=&
\displaystyle
\only<1-16>{
\uncover<2->{ \alert<3>{-} \int  \alert<2>{\alert<4>{\frac12} \left(\alert<5,6>{\frac1t} +\alert<7,8>{t}\right)} \alert<3>{\alert<4>{ \frac{1}{2}} \left(\alert<5,7>{ \frac 1 {t^2}} +\alert<6,8>{1} \right)\diff t}} \\
\uncover<4->{ &=&\displaystyle -\alert<4>{ \frac 1 4} \alert<9,10,11>{ \int} \left(\alert<5>{ \alert<9>{ \frac{ 1 }{ t^3}}} + \alert<6,7,10>{2\frac{1}t} + \alert<8,11>{t} \right) \alert<9,10,11>{ \diff t} } \\
\uncover<9->{&=&\displaystyle \alert<15>{-\frac{1}4} \left( \alert<9>{ \alert<15>{ -}\frac{ \alert<12>{ t^{-2}}}{\alert<15>{2}}} +\alert<10>{ \alert<15>{2} \ln\alert<14>{ |t|} }+ \alert<11>{\frac{\alert<13>{ t^2}}{\alert<15>{2}}} \right)+C}\\
\uncover<12->{&=&}
}
\uncover<12->{\displaystyle \only<1-24>{  \alert<16,17,18,24>{ \alert<15>{\frac{1}{8}} \left(\frac{1}{\alert<12>{ (\sqrt{ x^2 +1} -x)^2}} - \alert<13>{\left(\sqrt{x^2+1}- x\right)^2} \right) } }}\only<25->{
\alert<25>{ \frac{1}{2}x\sqrt{x^2+1}}
} {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}  \\
\uncover<12->{ && \displaystyle \alert<16,17>{ \only<1-30>{\alert<15>{ -}} \only<31->{\alert<31>{+} } \alert<15>{ \frac12}  \alert<26,30>{\ln \left( \alert<14>{ \sqrt{x^2+1} \only<1-30>{-}\only<31->{\alert<31>{+} } x} \right)} +C}}
\end{array}
$

\noindent \only<17-25>{The answer is good. However, let's simplify.

\noindent
\uncover<18->{
$
\begin{array}{l}
\phantom{=}
\displaystyle \alert<18>{ \frac{1}{(\sqrt{x^2+1}-x)^2}- \left( \sqrt{ x^2+1 }-x\right)^2} \\
\uncover<19->{= \displaystyle \frac{ \alert<19>{(\sqrt{x^2+1} +x )^2} }{ ( \sqrt{x^2 +1} -x )^2  	\alert<19>{(\sqrt{x^2+1}+x)^2} } - \left(\sqrt{x^2+1}-x\right)^2} \\
\uncover<20->{ =\displaystyle \frac{(\sqrt{x^2+1}+x)^2}{ \alert<20>{ \alert<21,22>{((\sqrt{x^2 +1 } )^2 -x^2 )^2 } \uncover<21,22>{\alert<21,22>{=1}} } } - \left( \sqrt{x^2 +1 } -x \right)^2} \\
\displaystyle \uncover<22->{=\left(\sqrt{x^2+1}+x\right)^2-\left( \sqrt{ x^2 + 1 } -x\right)^2} \uncover<23->{ = \alert<24,25>{ 4x\sqrt{x^2+1}}}
\end{array}
$
} %uncover<18->
} %only<17-25>

\only<26->{
The last expression can be transformed to:
\[
\begin{array}{rcl}
\displaystyle
\alert<26>{\ln} \left(\frac{\alert<26,28>{\left(\sqrt{x^2+1}-x\right)} \uncover<27->{ \alert<27,28>{\left( \sqrt{x^2+1}+ x \right)} }}{ \uncover<27->{ \alert<27>{ \sqrt{x^2 +1} +x}}} \right)
&=& \displaystyle \uncover<28->{\alert<29>{ \ln \left( \frac{\alert<28>{ 1} }{ \sqrt{x^2+1}+x}\right)} }\\ \uncover<29->{&=&\alert<29,30,31>{ -\ln \left(\sqrt{x^2+1}+x\right)}}
\end{array}
\]
}
\end{example}

\vspace{8cm}
\end{frame}

\begin{frame}
\begin{example}
Find the area locked b-n the hyperbolas $\alert<2,3>{ y=\pm \sqrt{ x^2+1}}$ and $x=\pm 2\sqrt{ 2}$.
\begin{columns}
\column{.5\textwidth}
\psset{xunit=0.7cm, yunit=0.7cm}
\begin{pspicture}(-3.328427, -3)(3.328427,3)
\psframe*[linecolor=white](-3.328427,-3)(3.328427,3)
\tiny
\uncover<31->{
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
\psplot[linecolor=\fcColorGraph, plotpoints = 1000 ] {-2.828427} {2.828427}{1 x 2 exp add 0.5 exp }
\psline[linecolor=\fcColorGraph](2.828427,-3)(2.828427,3)
\psplot[linecolor=\fcColorGraph, plotpoints=1000] { 2.828427 } {-2.828427}{1 x 2 exp add 0.5 exp -1 mul }
\psline[linecolor=\fcColorGraph](-2.828427,-3)(-2.828427,3)
}
}
\uncover<1-26,28->{
\psaxes[arrows=<->,ticks=none, labels=none](0,0)(-3,-3)(3,3)
}
\psline[linecolor=red!1](3.301,2)(3.302,2)
\psline[linecolor=red!1](-3.301,2)(-3.302,2)

%Function formula: - (x^{2}+1)^{1/2}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.828427}{2.828427}{1 x 2 exp add 0.5 exp -1 mul }
\uncover<3-4>{\rput[tl](-2.2, -2.4){ \alert<3>{ $y= - \sqrt{ x^2 +1 }$}}}

%Function formula: (x^{2}+1)^{1/2}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.828427}{ 2.828427 }{1 x 2 exp add 0.5 exp }
\uncover<2-4>{\rput[bl](-2.1, 2.4){\alert<2>{ $y=\sqrt{ x^2 +1} $}}}

\uncover<29->{
\psline[linecolor=\fcColorGraph](-2.828427,3)(-2.828427,-3)
}
\uncover<30->{
\psline[linecolor=\fcColorGraph](2.828427,3)(2.828427,-3)
}
\uncover<25-27>{
\psline{<->}(-2.9,2.9)(2.9,-2.9)
\rput[t](-2.1, 1.7){$\begin{array}{l} \alert<25>{v=0} \\\uncover<1-26>{\alert<25>{y+x=0}} \end{array}$}
}
\uncover<15-27>{
\psline{<->}(-2.9,-2.9)(2.9,2.9)
\rput[b](-2.1, -1.9){$\begin{array}{l} \uncover<1-26>{ \alert<15>{ y-x=0 }}\\\uncover<16->{\alert<16>{u=0}} \end{array}$}
}
\uncover<17-26>{
\fcFullDot{1.4}{1.4}
\rput[l]( 1.6, 1.4){$(\frac{y+x}{2},\frac{y+x}{2})$}
}
\uncover<14-26>{
\fcFullDot{0.6}{2.2}
\rput[lb](0.65, 2.2){$(x,y)$}
}
\uncover<26>{
\psline(0.6,2.2)(-0.8,0.8)
\psline(-0.7, 0.9)(-0.6, 0.8)(-0.7, 0.7)
\rput[rb](-0.3, 1.3){\alert<26>{$v$}}
}
\uncover<18-26>{
\psline(0.6,2.2)(1.4, 1.4)
\psline(1.3, 1.5)(1.2,1.4)(1.3, 1.3)
}
\uncover<23-26>{
\rput[tr](0.95, 1.8){\alert<23>{$u$}}
}
\uncover<14-26>{
\fcFullDot{2.2}{0.6}
\rput[lt]( 2.2, 0.65){$(y,x)$}
}
\end{pspicture}

\vbox to 3.0cm {
\uncover<18->{\alert<18>{
\uncover<22->{\alert<22>{Signed}} distance b-n $(x,y)$ and line $u=0$ equals}}
\only<1-23>{
$\uncover<19->{\uncover<22->{\alert<22>{\pm}} \alert<19>{ \sqrt{ \alert<20>{ \left(x-\frac{(x+y)}{2} \right)^2+ \left( y- \frac{(x+y )}{2} \right)^2}}}}
$
$\uncover<20->{=\uncover<22->{\alert<22>{\pm}} \sqrt{ \alert<20>{ \frac{1}{2}(y-x)^2 }}} \uncover<21->{= \alert<21>{ \uncover<1-21>{\pm} \alert<23>{ \frac{\sqrt{2 }}{ 2 } ( y-x)}}} \uncover<23>{ \alert<23>{=}}$
} %only<1-23>
\uncover<23->{ \alert<23,24>{$u $}.}
\only<24->{\uncover<25->{
Similarly compute that \alert<26>{signed distance b-n $(x,y)$ and the \alert<25>{line $v=0$} equals $v$}.
\uncover<27->{$\Rightarrow$ $y^2-x^2=1$ is the \alert<27>{ hyperbola $v=\frac{1/2}{v}$} in the $(u,v)$-plane.}
}}

\vfil
} %vbox

\column {.5\textwidth}
\only<1-27>{
\uncover<4->{We studied $\alert<27>{v=\frac{1/2}{u}}$ is called a hyperbola:}\uncover<3->{ why do we call $y= \sqrt{ x^2 +1}$ hyperbola?} \uncover<5->{Compute:}
\[
\begin{array}{rcl}
\uncover<5->{\sqrt{x^2+1} &=& y}\\
\uncover<6->{ x^2+1 &=& y^2}\\
\uncover<7->{y^2-x^2&=&1}\\
\uncover<8->{\uncover<9>{\alert<9>{\frac{1}{2}}} \uncover<10->{\alert<10,11>{\frac{\sqrt{2}}{2}}} \alert<11>{(y-x)} \uncover<10->{\alert<10,12>{\frac{\sqrt{2}}{2}}} \alert<12>{(y+x)}&=&\uncover<9->{\alert<9>{\frac{1}{2}}} \uncover<8>{1}}\\
\uncover<11->{\alert<11>{u}\alert<12>{v}&=& \frac{1}{2}}\\
\uncover<13->{\alert<27>{v}&\alert<27>{=}& \alert<27>{\frac{1/2}{u}},}
\end{array}
\]
\uncover<11->{where $\begin{array}{|l}
\alert<11,16,23>{u=\frac{\sqrt{2}}{2} \left(y-x\right)}\\
\alert<12,25>{v=\frac{\sqrt{2}}{2}\left(y+x\right)}
\end{array}$. } \uncover<14->{Consider an arbitrary point $(x,y)$.}
} %only<1-27>
\only<28->{
The area in question is:
$
\begin{array}{l}
\displaystyle\phantom{=} \int \limits^{{{\uncover<28,29>{\alert<29>{ \textbf{?}}}\uncover<30->{\alert<30>{ 2\sqrt{2}}}}}}_{\uncover<28>{\alert<28>{\textbf{?}}}\uncover<29->{ -2\sqrt{2}}} 2\sqrt{x^2+1}\diff x \\
\displaystyle \uncover<32->{= \uncover<33->{\alert<33>{2}} \left[x\sqrt{x^2+1} \vphantom{\ln \left(\sqrt{x^2+1}+x\right) }\right.}\\
\displaystyle \uncover<32->{\left. \ln \left(\sqrt{x^2+1}+x\right)\right]^{2\sqrt{2}}_{\only<33->{\alert<33>{0}} \uncover<1-32>{-2\sqrt{2}}}}\\
\uncover<34->{=2\left(2\sqrt{2} \sqrt{(2\sqrt{2})^2+1}\right.} \\
\uncover<34->{\left.+ \ln \left(\sqrt{(2\sqrt{2})^2+1}+2\sqrt{2} \right) \right)}\\
\uncover<35->{=12\sqrt{2} +2\ln \left(3+2\sqrt{2}\right )}\\
\uncover<36->{\approx 20.496}
\end{array}
$
}
\end{columns}

\end{example}

\end{frame}

%end module area-under-hyperbola-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitutions-ex4.tex
% begin module trig-substitutions-ex4
\begin{frame}
\begin{example} %[Example 4, p. 506]
Find $\int \frac{x}{\sqrt{x^2+4}}\diff x$.
\begin{itemize}
\item<2->  We could use the trig substitution $x = 2\tan \theta$.
\item<3->  But there is an easier way:
\item<3-| alert@4-5,10,13>  $u = $ \uncover<5->{$x^2+4$.}
\item<3-| alert@6-7,11>  $\diff u = $ \uncover<7->{$2x\diff x$.}
\end{itemize}
\[
\uncover<8->{%
\int \frac{\alert<handout:0| 11>{x}}{\sqrt{\alert<handout:0| 10>{x^2+4}}}\alert<handout:0| 11>{\diff x} = %
}%
\uncover<9->{%
\alert<handout:0| 11>{\frac{1}{2}}\int \frac{\alert<handout:0| 11>{\diff u}}{\sqrt{\alert<handout:0| 10>{u}}} = %
}%
\uncover<12->{%
\sqrt{\alert<handout:0| 13>{u}} + C = %
}%
\uncover<13->{%
\sqrt{\alert<handout:0| 13>{x^2 + 4}} + C %
}%
\]
\end{example}
\end{frame}
% end module trig-substitutions-ex4





\subsection{The case $\sqrt{-x^2+1}$}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitution-case-2-cos.tex
\begin{frame}

\frametitle{Trigonometric substitution $x=\cos \theta$ for $\sqrt{-x^2+1}$}
The trigonometric substitution $\alert<2>{x=\cos \theta}$, $\theta\in \left[0, \pi\right] $ for $\sqrt{-x^2+1} $:
\[
\begin{array}{rclll}
\displaystyle { \sqrt{-x^2+1}}&{=}&\displaystyle \uncover<2->{ \sqrt{\alert<3>{1-{\alert<2>{\cos}}^2\alert<2>{\theta}}}}\\
\uncover<3->{&=&\displaystyle  \sqrt{\alert<3>{ \sin^2\theta} } } \uncover<4->{&&\begin{array}{|l} \text{when }\theta\in\left[-\frac{\pi}{2}, \frac{\pi}{2} \right] \text{we have}\\
\sin \theta\geq 0 \text{ and so } \sqrt{\sin^2\theta}=\sin \theta
\end{array}} \\
\uncover<3->{&=&}
\uncover<3->{\displaystyle \sin \theta\quad .}
\end{array}
\]
\uncover<4->{
To summarize:
\begin{definition}
The trigonometric substitution $ x=\cos \theta$, $\theta\in [0,\pi]$ for $\sqrt{-x^2+1} $ is given by:
\[\begin{array}{rcl}
x&=&\cos \theta\\
\sqrt{-x^2+1}&=&\sin \theta\\
\diff x&=& -\sin \theta \diff \theta\\
\theta&=&\arccos x \quad .
\end{array}
\]
\end{definition}
}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitutions-ex1.tex
% begin module trig-substitutions-ex1
\begin{frame}
\begin{example} %[Example 1, p. 504]
\begin{columns}[c]
\column{.4\textwidth}
Evaluate $\int \frac{\sqrt{9-x^2}}{x^2}\diff x$.
\begin{itemize}
\item<2->  Let \alert<handout:0| 3-4,7,14,18>{$x = \uncover<4->{3\sin \theta}$}\uncover<4->{, where \alert<handout:0| 10>{$-\pi /2 \leq \theta \leq \pi / 2$}.}
\item<2->  Then \alert<handout:0| 5-6,13>{$\diff x = \uncover<6->{3\cos \theta\diff \theta}$}\uncover<6->{.}
\end{itemize}
\column{.6\textwidth}
\begin{center}
\psset{xunit=1.5cm, yunit=1.5cm}
\begin{pspicture}(-0.15,-0.4)(3.3,1.2)
\psframe*[linecolor=white](-0.1,-0.4)(3.3,1.2)
\psline(0,0)(3, 0)(3,1)(0,0)
\psline(2.9,0)(2.9, 0.1)(3,0.1)
\fcAngle{0}{0.339837}{0.6}{$\theta$}
\uncover<handout:0|18->{
\rput[l](3.1, 0.5){$x$}
\rput[br](1.5, 0.55){$3$}
}
\uncover<handout:0|19->{
\rput[t](1.5, -0.1){$\sqrt{9-x^2} $}
}
%bounding box for pdflatex compilation:
\psline[linecolor=red!1](-0.11, -0.4 )(-0.105, -0.4)
\psline[linecolor=red!1](3.3, 1.21)(3.3, 1.205)
\end{pspicture}
%\ \only<handout:0| -17>{%
%\includegraphics[height=3cm]{trig-substitution/pictures/08-03-ex1a.pdf}%
%}%
%\only<handout:0| 18>{%
%\includegraphics[height=3cm]{trig-substitution/pictures/08-03-ex1b.pdf}%
%}%
%\only<19->{%
%\includegraphics[height=3cm]{trig-substitution/pictures/08-03-ex1c.pdf}%
%}%
\end{center}
\end{columns}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<2->{%
\alert<handout:0| 12>{%
\sqrt{9 - \alert<handout:0| 7>{x^2}} =
}%
}%
\uncover<7->{%
\sqrt{9 - \alert<handout:0| 7>{9\sin^2 \theta}} =
}%
\uncover<8->{%
\sqrt{9 \cos^2 \theta} =
}%
\uncover<9->{%
3 |\cos  \theta | =
}%
\uncover<10->{%
\alert<handout:0| 12>{%
3 \cos  \theta
}%
}%
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<11->{%
\int \frac{\alert<handout:0| 12>{\sqrt{9-x^2}}}{\alert<handout:0| 14>{x^2}}\alert<handout:0| 13>{\diff x}%
}%
& \uncover<11->{ = } & %
\uncover<11->{%
\int\frac{\alert<handout:0| 12>{3\cos \theta}}{\alert<handout:0| 14>{9\sin^2 \theta}}\alert<handout:0| 13>{3\cos \theta \diff \theta}
}%
\uncover<15->{%
 = \int \cot^2 \theta \diff \theta
}\\%
& \uncover<16->{ = } & %
\uncover<16->{%
 \int (\csc^2 \theta  - 1)\diff \theta
}  \uncover<17->{ = }  \uncover<17->{%
 -\alert<handout:0| 20-21>{\cot \theta} - \theta + C
}\\%
& \uncover<21->{ = } & %
\uncover<21->{%
 -\alert<handout:0| 21>{\frac{\sqrt{9-x^2}}{x}} - \Arcsin \left( \frac{x}{3}\right) + C
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module trig-substitutions-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitutions-ex2.tex
% begin module trig-substitutions-ex2
\begin{frame}
\begin{example} %[Example 2, p. 504]
%\begin{columns}[c]
%\column{.4\textwidth}
Find the area enclosed by the ellipse $\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$, $a,b>0$.
\begin{columns}
\column{0.37\textwidth}
\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-2.35, -1.6)(2.35,1.7)
\tiny
\psframe*[linecolor=white](-2.35, -1.6)(2.35,1.7)
\uncover<8>{ \pscustom*[linecolor=\fcColorAreaUnderGraph]{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.000000}{2.000000}{1 x 2 exp -0.25 mul add sqrt -1 mul }
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.000000}{2.000000}{1 x 2 exp -0.25 mul add sqrt }
}
}
\uncover<9-11>{ \pscustom*[linecolor=\fcColorAreaUnderGraph]{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.000000}{2.000000}{1 x 2 exp -0.25 mul add sqrt }
\psline(2,0)(-2,0)
}
}
\uncover<12->{ \pscustom*[linecolor=\fcColorAreaUnderGraph]{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{0}{2.000000}{1 x 2 exp -0.25 mul add sqrt }
\psline(2,0)(0,0)
}
}

\fcAxesStandardNoFrame{-2.2}{-1.6}{2.2}{1.6}
\rput[b](1,1){\uncover<6->{\alert<6>{$y=b\sqrt{1-\frac{x^2}{a^2}} $}}}
\rput[t](1,-1){\uncover<7->{\alert<7>{$y=-b\sqrt{1-\frac{x^2}{a^2}} $}}}

\uncover<11->{
\fcFullDot{2}{0}
\rput[rb](1.9,0.1){$(a,0)$}
\fcFullDot{-2}{0}
\rput[lb](-1.9,0.1){$(-a,0)$}
}

%Function formula: - \sqrt{-1/4 x^{2}+1}
\uncover<7->{ \psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.000000}{2.000000}{1 x 2 exp -0.25 mul add sqrt -1 mul } }
%Function formula: \sqrt{-1/4 x^{2}+1}
\uncover<6->{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.000000}{2.000000}{1 x 2 exp -0.25 mul add sqrt }
}
\end{pspicture}
\vbox to 4cm {
\uncover<8->{The area in question is }
$\begin{array}{l}
\displaystyle \uncover<9->{\phantom{=}\phantom{4} \int\limits^{ {\uncover<9,10>{\alert<10>{\textbf{?}}} \uncover<11->{\alert<11>{a}} } }_{{\uncover<9,10>{\alert<10>{\textbf{?}}} \uncover<11->{ \alert<11>{-a}}} } \alert<9>{2} b\sqrt{ 1- \frac{ x^2}{ a^2} }\diff x} \\
\displaystyle\uncover<12->{=\alert<12>{4}\int \limits_{{ \alert<12>{0}}}^{a}  b\sqrt{1-\frac{x^2}{a^2}}\diff x} \uncover<12->{.}
\end{array}
$

\vfil
} %vbox
\column{0.63\textwidth}
\uncover<2->{Express $y$ via $x$:}
$
\begin{array}{rcl}
\displaystyle \uncover<2->{\alert<3>{\frac{x^2}{a^2}} + \frac{y^2}{b^2} &=& \displaystyle 1} \\
\displaystyle \uncover<3->{\frac{y^2}{\alert<4>{ b^2} }&=&\displaystyle 1 \alert<3>{-\frac{x^2}{a^2}}}\\
\displaystyle \uncover<4->{y^2&=&\displaystyle \alert<4>{b^2}\left(1-\frac{x^2}{a^2}\right)}\\
\displaystyle \uncover<5->{y&=&\displaystyle \pm b\sqrt{1-\frac{x^2}{a^2}}}
\end{array}
$
\end{columns}
\end{example}

\vspace{10cm}
\end{frame}

\begin{frame}
\begin{example} %[Example 2, p. 504]
%\begin{columns}[c]
%\column{.4\textwidth}
Find the area enclosed by the ellipse $\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$, $a,b>0$.
\begin{columns}
\column{0.37\textwidth}
\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-2.35, -1.6)(2.35,1.7)
\tiny
\psframe*[linecolor=white](-2.35, -1.6)(2.35,1.7)
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.000000}{2.000000}{1 x 2 exp -0.25 mul add sqrt -1 mul }
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.000000}{2.000000}{1 x 2 exp -0.25 mul add sqrt }
}
\fcAxesStandardNoFrame{-2.2}{-1.6}{2.2}{1.6}
\rput[b](1,1){\uncover<1->{$y=b\sqrt{1-\frac{x^2}{a^2}}$}}
\rput[t](1,-1){$y=-b\sqrt{1-\frac{x^2}{a^2}} $}

%Function formula: - \sqrt{-1/4 x^{2}+1}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.000000}{2.000000}{1 x 2 exp -0.25 mul add sqrt -1 mul }
%Function formula: \sqrt{-1/4 x^{2}+1}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.000000}{2.000000}{1 x 2 exp -0.25 mul add sqrt }
\end{pspicture}
\vbox to 4cm {
The area in question is
$\begin{array}{l}
\displaystyle \phantom{=}\phantom{4} \int\limits_{\phantom{\textbf{?}}-a}^{\phantom{\textbf{?}}a}2b\sqrt{ 1-\frac{x^2}{ a^2} }\diff x\\
\uncover<1->{=} \displaystyle 4\alert<15>{ \int\limits_{0}^{a}}  b \alert<15>{ \sqrt{1-\frac{x^2}{a^2}}\diff x} \\
\uncover<15->{=4b\alert<15>{ \frac{a\pi}{4}}}\uncover<16->{=\pi a b\quad .}
\end{array}
$

\vfil
}
\column{0.63\textwidth}
\uncover<2->{Trig subst.: set $x= a\sin \theta $, $\alert<5>{ \theta\in \left(0,\frac{\pi}{2}\right)} $.} \uncover<3->{Compute: $\alert<6>{ \sqrt{1-\frac{ {\alert<3>{x}}^2}{a^2}}} =\sqrt{1 -\frac{\alert<4>{ {\alert<3>{a}}^2} {\alert<3>{\sin}}^2\alert<3>{ \theta} }{\alert<4>{ a^2}} } \uncover<4->{ =\sqrt{1- \sin^2\theta}} \uncover<5->{\alert<5,6>{=\cos\theta}}$.} \uncover<7->{When $x=0$, $\theta=0$ and when $x=a$, $\theta=\frac{\pi}{2}$.}

\noindent $
\begin{array}{rcl}
\displaystyle
\alert<15>{ \int_{0}^{a}\sqrt{1-\frac{x^2}{a^2}}\diff x} &\uncover<6->{\alert<6>{=}}& \displaystyle \uncover<6->{ \int_{{\uncover<7->{\alert<7>{0}}}}^{\uncover<7->{{\alert<7>{ \frac{\pi}2}}}} \alert<6>{\cos \theta} ~ \alert<9>{\diff \left(\alert<8>{a} \sin \theta\right)} }\\
&\uncover<8->{=}& \displaystyle \uncover<8->{ \alert<8>{a} \int_{0}^{\frac{\pi}2} \alert<10>{ {\alert<9>{\cos}}^2 \alert<9>{\theta}} \alert<9>{ \diff \theta} } \\
&\uncover<10->{=}&\displaystyle \uncover<10->{a\int_{0}^{\frac{\pi}2} \alert<10>{\frac{ \alert<11>{\cos(2\theta)} + \alert<12>{1}}{ \alert<11,12>{ 2} } } \diff \theta}\\
&\uncover<11->{=}& \uncover<11->{ a \left[  \alert<11>{\frac{\sin (2\theta)}{4}} +\alert<12>{ \frac{\theta}{2}} \right]_{\theta=0}^{\theta=\frac{\pi}{2}}} \\
&\uncover<13->{=}&\uncover<13->{ a\left(0+\frac{\pi}{4}-(0+0)\right)}\\
\uncover<14->{&\alert<15>{=}& \alert<15>{\frac{a\pi }{4}}}
\end{array}
$
\end{columns}
\end{example}

\vspace{10cm}
\end{frame}
% end module trig-substitutions-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitutions-ex7.tex
% begin module trig-substitution-ex7
\begin{frame}
\begin{example} %[Example 7, p. 507]
Evaluate $\int \frac{x}{\sqrt{3-2x-x^2}}\diff x$.
\begin{itemize}
\item<2->  Complete the square under the root sign:
\item<3-| alert@38>  $\uncover<3->{%
3 - 2x - x^2 = %
}% 
\uncover<4->{%
3 \uncover<5->{\alert<handout:0| 5>{ + 1 }} - (x^2 + 2x \uncover<5->{\alert<handout:0| 5>{ + 1}})  = %
}% 
\uncover<6->{%
4 - (x + 1)^2%
}$
\item<7->  Substitute \alert<handout:0| 8-9,17,39>{$u = \uncover<9->{x+1}$}.  Then \alert<handout:0| 10-11,16>{$\diff u = \uncover<11->{\diff x}$} and \alert<handout:0| 12-13,15>{$x = \uncover<13->{u - 1}$}.
\item<7-| alert@27>  $\int \frac{x}{\sqrt{3 - 2x - x^2}}\diff x = \int \frac{\alert<handout:0| 15>{x}}{\sqrt{4 - \alert<handout:0| 17>{(x+1)^2}}}\alert<handout:0| 16>{\diff x} = \uncover<14->{\int \frac{\alert<handout:0| 15>{u-1}}{\sqrt{4 - \alert<handout:0| 17>{u^2}}}\alert<handout:0| 16>{\diff u}}$
\item<18->  Let \alert<handout:0| 19-20,23,29,36>{$u = \uncover<20->{2\sin \theta}$}\uncover<20->{, where \alert<handout:0| 26>{$-\pi /2 \leq \theta \leq \pi / 2$}.}  Then \alert<handout:0| 21-22,30>{$\diff u = \uncover<22->{2\cos \theta\diff \theta}$}\uncover<22->{.}
\item<18->  $\uncover<18->{%
\alert<handout:0| 31,35>{%
\sqrt{4 - \alert<handout:0| 23>{u^2}} = 
}%
}%
\uncover<23->{%
\sqrt{4 - \alert<handout:0| 23>{4\sin^2 \theta}} = 
}%
\uncover<24->{%
\sqrt{4 \cos^2 \theta} = 
}%
\uncover<25->{%
2 |\cos  \theta | = 
}%
\uncover<26->{%
\alert<handout:0| 31,35>{%
2 \cos  \theta  
}%
}$%
\end{itemize}
%\abovedisplayskip=0pt
%\belowdisplayskip=0pt
\[
\begin{array}{l}
\uncover<27->{%
\ \ \int \frac{x}{\sqrt{3-2x-x^2}}\diff x%
}%
 \uncover<27->{ = }  %
\uncover<27->{%
\int\frac{\alert<handout:0| 29>{u} - 1}{\alert<handout:0| 31>{\sqrt{4-u^2}}}\alert<handout:0| 30>{ \diff u}%
}%
\uncover<28->{%
 = \int\frac{\alert<handout:0| 29>{2\sin \theta} - 1}{\alert<handout:0| 31>{2\cos \theta}}\alert<handout:0| 30>{ 2\cos \theta\diff \theta}%
}\\%
 \uncover<32->{ = }  %
\uncover<32->{%
 \int (2\sin \theta  - 1)\diff \theta
}  \uncover<33->{ = }  \uncover<33->{%
 -\alert<handout:0| 35>{2\cos \theta} - \alert<handout:0| 36>{\theta} + C
}\\
 \uncover<34->{ = } \uncover<34->{%
 -\alert<handout:0| 35>{\sqrt{\alert<handout:0| 38>{4-u^2}}} - \alert<handout:0| 36>{\sin^{-1}\left( \frac{\alert<handout:0| 39>{u}}{2}\right)} + C
}\\%
 \uncover<37->{%
 = } %
\uncover<37->{%
 -\sqrt{\alert<handout:0| 38>{3-2x-x^2}} - \alert<handout:0| 36>{\sin^{-1}\left( \frac{\alert<handout:0| 39>{x+1}}{2}\right)} + C
}%
\end{array}
\]
\end{example}
\end{frame}
% end module trig-substitution-ex7



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/Euler-substitution-case-2-cos.tex
\begin{frame}
\frametitle{Euler subst. for $\sqrt{-x^2+1}$ corresponding to $x=\cos \theta$ }
\begin{itemize}
\item $\alert<4>{ x =\cos \theta}$ transforms $\diff x, x,\sqrt{-x^2+1}$ to trig form.
\item $\alert<5>{\theta=2\Arctan t}$, \uncover<3->{ $t>0$} transforms $\diff \theta, \cos\theta,\sin \theta$ to rational form.
\end{itemize}
\uncover<2->{\alert<2>{What if we compose the above?}} \uncover<3->{\alert<3>{We get the Euler substitution:}}
\only<1-37>{ %
\[
\begin{array}{rclll}
\uncover<3->{\alert<4,13,22,33,37>{x}}&\uncover<3->{\alert<4,13,22,33,37>{=}}&\displaystyle \vphantom{\frac{1- t^2}{ 1+ t^2} } 
\only<1-10>{
\displaystyle \uncover<4->{\alert<4>{ \cos \alert<5>{\theta}} } \\
\uncover<5->{ &=&\displaystyle \alert<8>{ \cos (\alert<5>{2\arctan t})}} \uncover<6->{&&\begin{array}{|l}
\displaystyle \displaystyle \alert<6,7,8>{\cos (2z) =}\uncover<7->{\alert<7,8>{ \frac{ 1-\tan^2 z }{1+ \tan^2 z}}}
\end{array}}
\\
\uncover<8->{ &=&\displaystyle \alert<8>{ \frac{1- {\alert<9>{\tan}}^2 ( \alert<9>{\Arctan t})}{1+{\alert<9>{\tan}}^2(\alert<9>{\Arctan t})} } } \\
\uncover<9->{&=&}
} %only<1-10>
\uncover<9->{\displaystyle \alert<10,11,13,22,33,37>{ \frac{\alert<22>{ 1- { \alert<9>{t}}^2}}{\alert<23>{ 1+ { \alert<9>{t}}^2}} }  &&{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} %whitespace flushes formulas left
} 
\uncover<12->{ \\\hline}
\uncover<12->{\alert<37>{ \sqrt{- {\alert<13>{x}}^2+1 }}}&\uncover<12->{\alert<37>{=}} &\displaystyle 
\only<1-20>{
\uncover<13->{ \sqrt{\alert<14>{1} - \left(\alert<13>{ \frac{1-t^2}{ 1+ t^2 }} \right)^2}}\\
\uncover<14->{&=&\displaystyle \sqrt{\frac{ \alert<15>{ \alert<14,17>{ (1+ t^2)^2} -(1-t^2)^2} }{ \alert<14>{(1+t^2)^2}} }}&&
\uncover<15->{\begin{array}{|l}
\alert<15,16>{(1+t^2)^2-(1-t^2)^2=}\only<15>{\alert<15>{\textbf{?}}} \uncover<16->{\alert<16>{4t^2}}}
\end{array} 
\\
\uncover<17->{&=&\displaystyle  \sqrt{\frac{ \alert<17>{4t^2} }{ (1+t^2)^2}}} \uncover<18->{&& 
\begin{array}{|l}
\displaystyle \alert<18>{ \alert<19>{\sqrt{4t^2}=2t} \text{ because } t>0} }
\end{array}
\\
\uncover<19->{&=&}
} %only<1-20>
\uncover<19->{ \displaystyle \alert<20,21,37>{ \frac{{2t} }{1+t^2}} \vphantom{ \sqrt{1 - \left( \frac{1-t^2}{ 1+ t^2 } \right)^2}} }\uncover<22->{\\\hline }
\only<1-30>{
\uncover<22->{ \displaystyle \alert<23>{ (\alert<25>{1}+ \alert<24>{t^2})} \alert<22,24,25>{ x} &=&\displaystyle  \alert<22>{\alert<25>{1} -\alert<24>{t^2}}}\\
\uncover<24->{ \displaystyle \alert<24>{ t^2(\alert<26>{x+1})}&=&\displaystyle \alert<25>{ 1-x}}\\
\uncover<26->{ \displaystyle t^2&=&\displaystyle \frac{1-x}{\alert<26>{1+x}}}\\
}
\uncover<27->{ \displaystyle \alert<30,31,37>{t}} &\alert<30,31,37>{\uncover<27->{=}}&\displaystyle \only<27-30>{\uncover<27->{ \frac{ \alert<29>{ \sqrt{1 -x }}}{\sqrt{ 1+x}}} \uncover<28->{ \frac{ \alert<29>{  \sqrt{1+x}} }{\sqrt{1+x}} }}\only<29-30>{=} \uncover<29->{ \alert<30,31,37>{ \frac{ \alert<29>{ \sqrt{-x^2+1} }}{x+1}}} && 
\uncover<27-30>{
\begin{array}{l}\text{here we use } t>0
\end{array}
} 
\uncover<31->{ \\\hline}
\uncover<32->{\alert<37>{ \diff \alert<33>{x}}} &\uncover<33->{=} & \displaystyle \vphantom{\diff \left( \frac{ 1- t^2}{ 1+ t^2}\right)} \only<33->{\diff \left( \alert<33>{\frac{ 1- t^2}{ 1+ t^2}}\right)} 
\only<34->{=\diff\left(\frac{2-\alert<35>{ (1+t^2)} }{ \alert<35>{ 1 + t^2}} \right)}\\
&\uncover<35->{=}&\only<35->{\displaystyle \diff\left(\frac{2}{1+ t^2} \alert<35>{-1} \right)}
\only<36->{\alert<37>{=-\frac{4t}{(1+t^2)^2}\diff t}}
\end{array}
\]
} %only<1-37>
\uncover<38->{
\begin{definition}
The Euler substitution for $\sqrt{-x^2+1}$ corresponding to $x=\cos \theta$ is given by:
\[
\alert<38>{
\begin{array}{rcl}
x&=&\displaystyle \frac{1-t^2}{1+t^2}, \quad \quad t>0\\
\sqrt{-x^2+1}&=&\displaystyle \frac{2t}{1+t^2}  \\
\diff x&=&\displaystyle  -\frac{4 t}{(t^{2}+1)^{2}} \diff t\\
t&=&\displaystyle \frac{\sqrt{-x^2+1}}{x+1} \quad .
\end{array}
}
\]
\end{definition}

\vspace{7cm}
}
\end{frame}



\subsection{The case $\sqrt{x^2-1}$}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitution-case-3-sec.tex
\begin{frame}
\frametitle{Trigonometric substitution $x=\sec \theta$ for $\sqrt{ x^2-1}$ }
The trigonometric substitution $ \alert<10,12>{x=\sec \theta}$, $\theta \in \left[0, \frac{\pi}{2}\right)\cup \left[\pi, \frac{3\pi}{ 2} \right) $:
\[
\begin{array}{rclll}
\displaystyle \alert<11>{\sqrt{x^2-1}}&\alert<11>{=} & \displaystyle 
\only<1-8>
{\uncover<2->{ \sqrt{\sec^2\theta-1}}\\
\uncover<3->{&=& \displaystyle \sqrt{\frac{1}{\cos^2\theta}-1}}\\
\uncover<4->{&=&\displaystyle \sqrt{\frac{\sin^2\theta}{\cos^2\theta}}} \\ 
\uncover<5->{&=&\displaystyle \sqrt{ \tan^2 \theta}} &&\uncover<6->{ \begin{array}{|l} \text{when }\theta\in \theta \in \left[0, \frac{ \pi}{2 }\right)\cup \left[\pi, \frac{3\pi}{2}\right) \text{we have}\\
\tan \theta\geq 0 \text{ and so } \sqrt{\tan^2\theta}=\tan \theta
\end{array}} \\
\uncover<7->{&=&}
}
\uncover<7->{\displaystyle \alert<8,9,11>{\tan \theta} \vphantom{\sqrt{\sec^2\theta-1}}\quad .&&{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} }
\end{array} 
\]
\uncover<10->{
\begin{definition}The trigonometric substitution $\alert<10,12>{ x=\sec \theta }$, $\theta\in (0,\pi)$ for $\sqrt{x^2+1} $ is given by:
\begin{equation*}
\begin{array}{rcl}
\displaystyle \alert<10,13>{ x}&\alert<10,13>{=}& \displaystyle \alert<10,13>{\sec\theta= \frac{1}{\cos \theta} } \quad \quad \theta \in \left[0, \frac{\vphantom{3} \pi}{2}\right)\cup \left[\pi, \frac{ 3 \pi}{ 2} \right)\\
\displaystyle \alert<11>{ \sqrt{x^2-1}}&\alert<11>{ =}& \displaystyle \alert<11>{ \tan \theta}\\
\displaystyle \alert<13,14>{\diff x}& \alert<13,14>{=} & \displaystyle \uncover<14->{\alert<14>{ \frac{\sin\theta}{ \cos^2\theta} \diff \theta= \sec\theta\tan\theta }} \uncover<1-13>{\alert<13>{ \textbf{?}}} \alert<14>{ \diff \theta} \\
\displaystyle \alert<12>{\theta}&\alert<12>{=} &\alert<12>{ \Arcsec x} \quad .
\end{array}
\end{equation*}
\end{definition}
}

\vspace{20cm}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitutions-ex5.tex
% begin module trig-substitutions-ex5
\begin{frame}
\begin{example} %[Example 5, p. 506]
\begin{columns}[c]
\column{.4\textwidth}
Find $\int \frac{\diff x}{\sqrt{x^2-a^2}}$, \alert<handout:0| 9>{$a > 0$}.
\begin{itemize}
\item<2->  \alert<handout:0| 3-4,7,16,20>{$x = \uncover<4->{a\sec \theta}$}\uncover<4->{,  \alert<handout:0| 10>{$0 < \theta < \pi / 2$ or $\pi < \theta < 3\pi /2$}.}
\item<2->  \alert<handout:0| 5-6,13>{$\diff x = \uncover<6->{a\sec \theta\tan \theta \diff \theta}$}\uncover<6->{.}
\end{itemize}
\column{.6\textwidth}
\begin{center}
\psset{xunit=1.5cm, yunit=1.5cm}
\begin{pspicture}(-0.15,-0.4)(4.4,1.2)
\psframe*[linecolor=white](-0.1,-0.4)(4.4,1.2)
\psline(0,0)(3, 0)(3,1)(0,0)
\psline(2.9,0)(2.9, 0.1)(3,0.1)
\fcAngle{0}{0.339837}{0.6}{$\theta$}
\uncover<handout:0|16->{
\rput[br](1.5, 0.55){$x$}
\rput[t](1.5, -0.1){$a$}
}
\uncover<handout:0|17->{
\rput[l](3.1, 0.5){$\sqrt{x^2-a^2}$}
}
%bounding box for pdflatex compilation:
\psline[linecolor=red!1](-0.11, -0.4 )(-0.105, -0.4)
\psline[linecolor=red!1](4.4, 1.21)(4.4, 1.205)
\end{pspicture}
%\ \only<handout:0| -15>{%
%\includegraphics[height=2.8cm]{trig-substitution/pictures/08-03-ex5a.pdf}%
%}%
%\only<handout:0| 16>{%
%\includegraphics[height=2.8cm]{trig-substitution/pictures/08-03-ex5b.pdf}%
%}%
%\only<17->{%
%\includegraphics[height=2.8cm]{trig-substitution/pictures/08-03-ex5c.pdf}%
%}%
\end{center}
\end{columns}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<2->{%
\alert<handout:0| 12>{%
\sqrt{\alert<handout:0| 7>{x^2}-a^2} =
}%
}%
\uncover<7->{%
\sqrt{\alert<handout:0| 7>{a^2\sec^2 \theta}-a^2} =
}%
\uncover<8->{%
\sqrt{a^2 \tan^2 \theta} =
}%
\uncover<9->{%
a |\tan  \theta | =
}%
\uncover<10->{%
\alert<handout:0| 12>{%
a \tan  \theta
}%
}%
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<11->{%
\int \frac{\alert<handout:0| 13>{\diff x}}{\alert<handout:0| 12>{\sqrt{x^2-a^2}}}%
}%
& \uncover<11->{ = } & %
\uncover<11->{%
\int\frac{\alert<handout:0| 13>{a\sec \theta \tan \theta \diff \theta}}{\alert<handout:0| 12>{a\tan \theta}}%
}%
\uncover<14->{%
 = \int \sec \theta \diff \theta
}\\%
& \uncover<15->{ = } & %
\uncover<15->{%
\ln | \alert<handout:0| 20>{\sec \theta} + \alert<handout:0| 18-19>{\tan \theta} | + C%
}  \uncover<19->{ = }  \uncover<19->{%
\ln \left| \alert<handout:0| 20>{\frac{x}{\alert<handout:0| 21>{a}}} + \alert<handout:0| 19>{\frac{\sqrt{x^2-a^2}}{\alert<handout:0| 21>{a}}}\right| + C
}\\%
& \uncover<21->{ = } & %
\uncover<21->{%
\ln \left| x + \sqrt{x^2 - a^2}\right| \only<handout:0| -22>{\alert<handout:0| 21-22>{- \ln a} \alert<handout:0| 22>{+ C}}\only<23->{\alert<handout:0| 23>{ + C_1}}%
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module trig-substitutions-ex5



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/trig-substitutions-ex1-Euler-sub.tex
%begin module trig-substitution-ex1-Euler-sub.tex
%To do: compute area of ellipse usign Euler substitution.

%end module trig-substitution-ex1-Euler-sub.tex


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trig-substitution/Euler-substitution-case-3-sec.tex
\begin{frame}
\frametitle{Euler substitution $x=\sec \theta$, $\theta = 2\arctan t$}
\begin{itemize}
\item $\alert<4>{ x =\sec \theta}$ transforms $\diff x, x,\sqrt{x^2-1}$ to trig form.
\item $\alert<5>{\theta=2\Arctan t}$, \uncover<3->{ $ t\in (-\infty, -1) \cup \left[0, 1 \right) $ } rationalizes $\diff \theta, \cos\theta,\sin \theta$.
\end{itemize}
\uncover<2->{\alert<2>{What if we compose the above?}} \uncover<3->{\alert<3>{We get the Euler substitution:}}
\only<1-33>{
\[
\begin{array}{rclll}
\phantom{ ( 1- t^2 )} %phantom needed to aling table well.
\uncover<3->{\alert<4,15,22,30,33>{x}}&\uncover<3->{\alert<4,15,22,33>{=}}& \displaystyle  
\only<1-12>{
\uncover<4->{ \alert<4>{\sec \theta} =\frac{1}{\cos \alert<5>{ \theta} }} \\
\uncover<5->{&=& \displaystyle \alert<8>{ \frac{1} {\cos(\alert<5>{ 2\arctan t} )}} } &&
\uncover<6->{
\begin{array}{|l} \displaystyle \alert<8>{ \alert<6,7>{\cos (2z) =} \uncover<7->{\alert<7>{\frac{ 1- \tan^2 z}{1+ \tan^2 z }}}}
\end{array}
}
\\
\uncover<8->{&=& \displaystyle \alert<8>{  \frac{1+ {\alert<9>{\tan}}^2 (\alert<9>{\Arctan t })}{ 1- {\alert<9>{\tan}}^2 (\alert<9>{\Arctan t}) } }}
\\
\uncover<9->{&=&\displaystyle \frac{1+ {\alert<9>{t}}^2 }{1 - { \alert<9>{ t}}^2}}\uncover<10->{=\frac{2\alert<11>{- (1 - t^2 )} }{\alert<11>{1 - t^2} }}  \\
\uncover<11->{&=&} 
} %only<1-12>
\uncover<11->{\displaystyle \alert<12,13,15,22,30,33>{ \alert<11>{-1}+\frac{2}{1-t^2}} }
&&{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}  %whitespace flushes formulas left

\uncover<13->{\\\hline }
\uncover<14->{\alert<20,33>{ \sqrt{{\alert<15>{x}}^2-1 } }} &\uncover<14->{\alert<20,33>{ =} } &\displaystyle 
\only<1-20>{
\uncover<15->{\sqrt{ \left(\alert<15>{ \frac{1 +t^2 }{\alert<16>{ 1- t^2 }}} \right)^2 -\alert<16>{1}} }\\
\uncover<16->{&=& \displaystyle \sqrt{\frac{ \alert<19>{(1+t^2)^2 - \alert<16>{ (1-t^2)^2}}}{ \alert<16>{(1-t^2)^2} } }} &&
\uncover<17->{
\begin{array}{|l}
\alert<17,18,19>{(1+t^2)^2-(1-t^2)^2= } \only<17>{ \alert<17>{ \textbf{?}}} \uncover<18->{\alert<18,19>{4t^2}}
\end{array}
}
\\
\uncover<19->{ &=& \displaystyle \alert<20>{\sqrt{\frac{ \alert<19>{ 4t^2} } { (1-t^2)^2}}} }&& 
\uncover<20->{ \alert<20>{
\begin{array}{|l} \displaystyle t , 1-t^2\text{ have same sign}\\ \text{when } t\in (-\infty, -1) \cup \left[0, 1 \right)
\end{array}
}
}
\\
\uncover<20>{&=&}
} %only<1-20>
\uncover<20->{ \displaystyle \alert<20,21,33>{ \frac{2t}{1- t^2}} \vphantom{\sqrt{ \left( \frac{1 +t^2 }{ 1- t^2 } \right)^2 -1} }  &&
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}  %whitespace flushes formulas left
}
\uncover<21->{\\\hline}
\only<1-27>{
\uncover<22->{\displaystyle \alert<22>{x} &\alert<22>{=} &\displaystyle  \alert<22>{\frac{1+t^2}{ \alert<23>{1- t^2}}}} \\
\uncover<23->{\displaystyle (\alert<23>{ \alert<25>{1} \alert<24>{- t^2}} )\alert<24,25>{x}&=&\displaystyle \alert<25>{ 1}+\alert<24>{ t^2}} \\
\uncover<24->{\displaystyle \alert<24>{\alert<26>{ (1+ x)} t^2} &=&\displaystyle \alert<25>{ x-1} \\
\uncover<26->{ \displaystyle t^2&=&\displaystyle  \frac{x-1 }{\alert<26>{ x+1} }} } \\
}
\uncover<27->{
\displaystyle  
\alert<27,28,33>{t} &\alert<27,28,33>{ =} & \displaystyle \alert<27,28,33>{ \pm \sqrt{\frac{x-1}{x+1}}}
}
\uncover<28->{\\\hline}
\uncover<29->{
\alert<33>{ \diff x} &=& \displaystyle \uncover<30->{ \alert<31,32>{ \diff \left(\alert<30>{ -1+\frac{2}{1-t^2}} \right)}}\\
\uncover<31->{&\alert<31,32,33>{=}& \displaystyle \alert<33>{ \alert<32>{\uncover<32->{ \frac{4 t}{(1- t^{2})^{2}}}} \uncover<31>{\alert<31>{\textbf{?}}} \diff t}
}
}
\end{array}
\]
} %only<1-33>
\uncover<34->{
\begin{definition}
The Euler substitution for $\sqrt{x^2-1}$ corresponding to $x=\sec \theta$ is given by:
\[
\begin{array}{rcl}
\alert<34>{
x} &\alert<34>{=}&\displaystyle \alert<34>{ \frac{1+t^2}{1-t^2}, \quad \quad \quad t\in (-\infty, -1) \cup \left[0, 1 \right)} \\
\alert<34>{\sqrt{x^2-1}}&\alert<34>{=}&\displaystyle \alert<34>{\frac{2t}{1-t^2}}  \\
\alert<34>{\diff x}&\alert<34>{=}&\displaystyle  \alert<34>{\frac{4 t}{(1- t^{2})^{2}} \diff t}\\
\alert<34>{t}&\alert<34>{=}&\displaystyle \alert<34>{\pm \frac{ \sqrt{x^2-1}}{x+1} }\quad .
\end{array}
\]
\end{definition}
}

\vspace{8cm}
\end{frame}



\section{Rationalizing Substitutions}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-rationalize-intro.tex
% begin module partial-fractions-rationalize-intro
\begin{frame}
\frametitle{Rationalizing Substitutions}
Some nonrational fractions can be changed into rational fractions by means of appropriate substitutions.  In particular, when an integrand contains an expression of the form $\sqrt[n]{g(x)}$, the substitution $u = \sqrt[n]{g(x)}$ may be effective.
\end{frame}
% end module partial-fractions-rationalize-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/partial-fractions/partial-fractions-rationalize-ex9.tex
% begin module partial-fractions-rationalize-ex9
\begin{frame}
\begin{example}[Example 9, p. 517]
Find $\int \frac{\sqrt{x+4}}{x}\diff x$.

\uncover<2->{%
Let $\alert<handout:0| 3,13>{u = \sqrt{x+4}}$.  Then $u^2 = x + 4$, so \alert<handout:0| 4-5>{$x = \uncover<5->{u^2-4}$} and \alert<handout:0| 6-7>{$\diff x = \uncover<7->{2u\diff u}$}.
}%
\begin{eqnarray*}
\uncover<2->{%
\int \frac{\alert<handout:0| 3>{\sqrt{x+4}}}{\alert<handout:0| 4-5>{x}}\alert<handout:0| 6-7>{\diff x} %
}%
 & \uncover<2->{ = } & %
\uncover<2->{%
\int \frac{\uncover<3->{\alert<handout:0| 3>{u}}}{\uncover<5->{\alert<handout:0| 5>{u^2-4}}}\uncover<7->{\alert<handout:0| 7>{2u\diff u}} %
}%
\uncover<8->{%
\ = \ 2 \int \frac{u^2}{u^2-4}\diff u %
}\\%
 & \uncover<9->{ = } & %
\uncover<9->{%
 2 \int \left( 1 + \frac{4}{u^2-4}\right) \diff u %
} \ \uncover<10->{ = } \ \uncover<10->{%
 2 \int \diff u + 8 \int \frac{\diff u}{u^2-4} %
}\\%
& & \uncover<9->{%
\textrm{(long division)}%
}\\%
 & \uncover<11->{ = } & %
\uncover<11->{%
 2 \int \diff u + 8 \int \left( \frac{1}{4}\cdot \frac{1}{u-2} - \frac{1}{4}\cdot \frac{1}{u+2}\right) \diff u %
}\\%
& & \uncover<11->{%
\textrm{(partial fractions)}%
}\\%
 & \uncover<12->{ = } & %
\uncover<12->{%
 2u + 2(\ln |u - 2| - \ln |u+2|) + C %
}\\%
 & \uncover<13->{ = } & %
\uncover<13->{%
 2\sqrt{x+4} + 2\ln \left|\frac{\sqrt{x+4} - 2}{\sqrt{x+4}+2}\right| + C %
}\\%
\end{eqnarray*}
\end{example}
\end{frame}
% end module partial-fractions-rationalize-ex9



} %end lecture


% begin lecture
\lect{Spring 2015}{Lecture  8}{8}{
\section{Indeterminate Forms and L'Hospital's Rule}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/lhospital/lhospital-intro.tex
% begin module lhospital-intro
\begin{frame}
\begin{example}
Find $\lim_{x\rightarrow 1}\frac{\ln x}{x - 1}$.
\begin{itemize}
\item<2-| alert@3-4>  $\lim_{x\rightarrow 1} \ln x = $ \uncover<4->{$0$.}
\item<2-| alert@5-6>  $\lim_{x\rightarrow 1} (x - 1) = $ \uncover<6->{$0$.}
\item<7->  We don't get any cancellation between top and bottom.
\item<8->  We need new techniques.
\end{itemize}
\end{example}
\end{frame}
% end module lhospital-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/lhospital/lhospital-statement.tex
% begin module lhospital-statement
\begin{frame}
\begin{theorem}[L'Hospital's Rule]
Suppose that $f$ and $g$ are differentiable and $g'(x) \neq 0$ on an open interval that contains $a$ (except possibly at $a$).  Suppose that
\[
\begin{array}{l@{\qquad}l@{\qquad}c@{\qquad}l}
& \lim_{x\rightarrow a} f(x) = 0 &
 \textrm{and} & \lim_{x\rightarrow a} g(x) = 0 \\
& & & \\
\textrm{or that} & \lim_{x\rightarrow a} f(x) = \pm\infty &
 \textrm{and} & \lim_{x\rightarrow a} g(x) = \pm\infty \\
\end{array}
\]
(In other words, we have an indeterminate form of type $0/0$ or $\infty / \infty$.)  Then
\[
\lim_{x\rightarrow a} \frac{f(x)}{g(x)} = \lim_{x\rightarrow a} \frac{f'(x)}{g'(x)}.
\]
\end{theorem}
\end{frame}
% end module lhospital-statement



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/lhospital/lhospital-ex1.tex
% begin module lhospital-ex1
\begin{frame}
\begin{example}
Find $\lim_{x\rightarrow 1}\frac{\ln x}{x - 1}$.
\begin{itemize}
\item  $\lim_{x\rightarrow 1} \ln x = $ \uncover<1->{$0$.}
\item  $\lim_{x\rightarrow 1} (x - 1) = $ \uncover<1->{$0$.}
\item<2->  This is an indeterminate form of type $0/0$.
\item<3->  Apply L'Hospital's rule:
\end{itemize}
\[
\uncover<4->{%
\lim_{x\rightarrow 1} \frac{\ln x}{x - 1} = %
}%
\uncover<5->{%
\lim_{x\rightarrow 1} \frac{\alert<handout:0| 7-8>{\frac{\diff}{\diff x} (\ln x)}}{\alert<handout:0| 9-10>{\frac{\diff}{\diff x} (x - 1)}} = %
}%
\uncover<6->{%
\lim_{x\rightarrow 1} \frac{\uncover<8->{\alert<handout:0| 8>{1/x}}}{\uncover<10->{\alert<handout:0| 10>{1}}} = %
}%
\uncover<11->{%
\lim_{x\rightarrow 1} \frac{1}{x} = %
}%
\uncover<12->{%
1.
}%
\]
\end{example}
\end{frame}
% end module lhospital-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/lhospital/lhospital-ex2.tex
% begin module lhospital-ex2
\begin{frame}
\begin{example}
Find $\lim_{x\rightarrow \infty}\frac{\alert<handout:0| 3-4>{e^x}}{\alert<handout:0| 5-6>{x^2}}$.
\begin{itemize}
\item<2-| alert@3-4,18>  $\lim_{x\rightarrow \infty} e^x = $ \uncover<4->{$\infty$.}
\item<2-| alert@5-6>  $\lim_{x\rightarrow \infty} x^2 = $ \uncover<6->{$\infty$.}
\item<7->  This is an indeterminate form of type $\infty /\infty$.
\item<8->  Apply L'Hospital's rule:
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<9->{%
\lim_{x\rightarrow \infty} \frac{e^x}{x^2} = %
}%
\uncover<10->{%
\lim_{x\rightarrow \infty} \frac{\alert<handout:0| 12-13>{\frac{\diff}{\diff x} (e^x)}}{\alert<handout:0| 14-15>{\frac{\diff}{\diff x} (x^2)}} = %
}%
\uncover<11->{%
\lim_{x\rightarrow \infty} \frac{\uncover<13->{\alert<handout:0| 13,18>{e^x}}}{\uncover<15->{\alert<handout:0| 15-17>{2x}}} %
}%
\]
\begin{itemize}
\item<16-| alert@16-17>  $\lim_{x\rightarrow \infty} 2x = $ \uncover<17->{$\infty$.}
\item<19->  This is an inderminate form of type $\infty /\infty$.
\item<20->  Apply L'Hospital's rule again:
\end{itemize}
\[
\uncover<21->{%
\lim_{x\rightarrow \infty} \frac{e^x}{x^2} = %
}%
\uncover<21->{%
\lim_{x\rightarrow \infty} \frac{e^x}{2x} = %
}%
\uncover<22->{%
\lim_{x\rightarrow \infty} \frac{e^x}{2} = %
}%
\uncover<23->{%
\infty .%
}%
\]
\end{example}
\end{frame}
% end module lhospital-ex2



\subsection{Indeterminate Products}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/lhospital/indeterminate-products-def.tex
% begin module indeterminate-products-def
\begin{frame}
\frametitle{Indeterminate Products}
If $\lim_{x\rightarrow a} f(x) = 0$ and $\lim_{x\rightarrow a} g(x) = \pm \infty$, then it isn't clear what $\lim_{x\rightarrow a}(fg)(x)$ will be.

\uncover<2->{
In such a case, write the product $fg$ as a quotient:
\[
fg = \frac{f}{1/g} \qquad \textrm{ or} \qquad fg = \frac{g}{1/f}.
\]
}

\uncover<3->{
This converts the given limit into an indeterminate form of type $0 / 0$ or $\infty / \infty$.
}
\end{frame}
% end module indeterminate-products-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/lhospital/indeterminate-products-ex6.tex
% begin module indeterminate-products-ex6
\begin{frame}
\begin{example}
Evaluate $\lim_{x\rightarrow 0^+} \alert<handout:0| 5-6>{x}\alert<handout:0| 3-4>{\ln x}$.
\begin{itemize}
\item<2-| alert@3-4>  $\lim_{x\rightarrow 0^+} \ln x = $ \uncover<4->{$-\infty$.}
\item<2-| alert@5-6>  $\lim_{x\rightarrow 0^+} x = $ \uncover<6->{$0$.}
\item<7->  This is an indeterminate form of type $0(-\infty )$ (or $-\infty / (1/0)$).
\item<8->  Apply L'Hospital's rule:
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<9->{%
\lim_{x\rightarrow 0^+} x\ln x & \uncover<9->{=} & %
}%
\uncover<10->{%
\lim_{x\rightarrow 0^+} \frac{\ln x}{1/x} = %
}%
\uncover<11->{%
\lim_{x\rightarrow 0^+} \frac{\alert<handout:0| 13-14>{\frac{\diff}{\diff x} (\ln x)}}{\alert<handout:0| 15-16>{\frac{\diff}{\diff x} (1/x)}} \\
& \uncover<12->{=} & %
}%
\uncover<12->{%
\lim_{x\rightarrow 0^+} \frac{\uncover<14->{\alert<handout:0| 14>{1/x}}}{\uncover<16->{\alert<handout:0| 16>{-1/x^2}}} %
}%
\uncover<17->{%
 = \lim_{x\rightarrow 0^+}(-x)%
}%
\uncover<18->{%
  = 0.
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module indeterminate-products-ex6



\subsection{Indeterminate Differences}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/lhospital/indeterminate-differences-def.tex
% begin module indeterminate-differences-def
\begin{frame}
\frametitle{Indeterminate Differences}
If $\lim_{x\rightarrow a} f(x) = \infty$ and $\lim_{x\rightarrow a} g(x) =  \infty$, then the limit
\[
\lim_{x\rightarrow a} [f(x) - g(x)]
\]
is called an indeterminate form of type $\infty - \infty$.

\uncover<2->{
To compute such a limit, try to convert it into a quotient (by using a common denominator, or by rationalizing, or by factoring out a common factor).
}
\end{frame}
% end module indeterminate-differences-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/lhospital/indeterminate-differences-ex8.tex
% begin module indeterminate-differences-ex8
\begin{frame}
\begin{example}
Evaluate $\lim_{x\rightarrow (\pi /2)^-} (\alert<handout:0| 3-4>{\sec x} - \alert<handout:0| 5-6>{\tan x})$.
\begin{itemize}
\item<2-| alert@3-4>  $\lim_{x\rightarrow (\pi / 2)^-} \sec x = $ \uncover<4->{$\infty$.}
\item<2-| alert@5-6>  $\lim_{x\rightarrow (\pi / 2)^-} \tan x = $ \uncover<6->{$\infty$.}
\item<7->  This is an indeterminate form of type $\infty - \infty$.
\item<8->  Apply L'Hospital's rule:
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<9->{%
\lim_{x\rightarrow (\pi / 2)^-} ( \sec x - \tan x) & \uncover<9->{=} & %
}%
\uncover<9->{%
\lim_{x\rightarrow (\pi / 2)^-} \left( \frac{1}{\cos x} - \frac{\sin x}{\cos x}\right)%
}\\%
& \uncover<10->{ = } & %
\uncover<10->{%
\lim_{x\rightarrow (\pi / 2)^-} \frac{1 - \sin x}{\cos x} %
}\\%
& & \uncover<11->{\textrm{(indeterminate form of type $0/0$.)}}\\
& \uncover<12->{ = } & %
\uncover<12->{%
\lim_{x\rightarrow (\pi / 2)^-} \frac{\alert<handout:0| 14-15>{\frac{\diff}{\diff x} (1 - \sin x)}}{\alert<handout:0| 16-17>{\frac{\diff}{\diff x} \cos x}} %
}\\%
& \uncover<13->{ = } & %
\uncover<13->{%
\lim_{x\rightarrow (\pi / 2)^-} \frac{\uncover<15->{\alert<handout:0| 15>{- \cos x}}}{\uncover<17->{\alert<handout:0| 17>{ -\sin x}}} %
}  \uncover<18->{ = }  \uncover<18->{0}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module indeterminate-differences-ex8



\subsection{Indeterminate Powers}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/lhospital/indeterminate-powers-def.tex
% begin module indeterminate-powers-def
\begin{frame}
\frametitle{Indeterminate Powers}
Several indeterminate forms arise from the limit $\lim_{x\rightarrow a} f(x)^{g(x)}$.
\[
\begin{array}{l@{\ \ }c@{\ \ }l@{\qquad}l}
\lim_{x\rightarrow a} f(x) = 0 & \textrm{and} & \lim_{x\rightarrow a}g(x) = 0 & \textrm{type } 0^0 \\
& & & \\
\lim_{x\rightarrow a} f(x) = \infty & \textrm{and} & \lim_{x\rightarrow a}g(x) = 0 & \textrm{type } \infty^0 \\
& & & \\
\lim_{x\rightarrow a} f(x) = 1 & \textrm{and} & \lim_{x\rightarrow a}g(x) = \pm \infty & \textrm{type } 1^{\infty} 
\end{array}
\]
\uncover<2->{
These can all be solved either by taking the natural logarithm:
\[
\textrm{let} \ \ y = [f(x)]^{g(x)}, \ \ \textrm{then} \ \ \ln y = g(x) \ln f(x)
\]
or by writing the function as an exponential:
\[
[f(x)]^{g(x)} = e^{g(x)\ln f(x)} .
\]
}
\end{frame}
% end module indeterminate-powers-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/lhospital/indeterminate-powers-ex10.tex
% begin module indeterminate-powers-ex10
\begin{frame}
\begin{example}
Find $\lim_{x\rightarrow 0^+} x^x$.
\begin{itemize}
\item<2->  $0^x = 0$ for any $x > 0$.
\item<3->  $x^0 = 1$ for any $x \neq 0$.
\item<4->  This is an indeterminate form of type $0^0$.
\item<5->  Write as an exponential:
\item<6->  $x^x = e^{x\ln x}$.
\item<7->  Recall that $\lim_{x\rightarrow 0^+} x\ln x = 0$.
\item<8->  Therefore
\end{itemize}
\[
\uncover<8->{ \lim_{x\rightarrow 0^+} x^x = }%
\uncover<9->{ \lim_{x\rightarrow 0^+} e^{x\ln x} = }%
\uncover<10->{  e^{0} = 1}%
\]
\end{example}
\end{frame}
% end module indeterminate-powers-ex10



}% end lecture

% begin lecture
\lect{Spring 2015}{Lecture 9}{9}{
\section{Improper Integrals}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-def.tex
% begin module improper-integral-def
\begin{frame}
\frametitle{Improper Integrals}
\begin{itemize}
\item  The definition of $\int_a^b f(x) \diff x$, where $f$ is defined on $[a,b]$,  has two requirements:
\begin{enumerate}
\item  $[a,b]$ is a finite interval.
%\item  $f$ is defined on $[a,b]$.
\item  $f$ has no infinite discontinuities in $[a,b]$.
\end{enumerate}
\item<2->  We are now going to relax these requirements.
\begin{enumerate}
\item<2->  We allow infinite intervals, such as $(a,\infty), (-\infty , b)$, and $(-\infty , \infty )$.
\item<2->  $f$ might have infinite discontinuities in $[a,b]$.
\end{enumerate}
\item<3->  Such integrals are called improper integrals.
\end{itemize}
\uncover<4->{%
\begin{definition}[Improper Integral]
The integral
\[
\int_a^b f(x)\diff x
\]
is called improper if one or more of the endpoints $a$ and $b$ is infinite, or if $f$ has an infinite discontinuity on $[a,b]$.
\end{definition}
}%
\end{frame}
% end module improper-integral-def



\subsection{Type I: Infinite Intervals}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-geometry.tex
% begin module improper-integral-geometry

\begin{frame}
\frametitle{Type I: Infinite Intervals}
\begin{itemize}
\item  Consider the region $A$ that lies under $y = 1/x^2$, above the $x$-axis, and to the right of $x = 1$.
\item<2->  To find its area, approximate with $A(t)$, the area of the region under $1/x^2$, above the $x$-axis, right of $x = 1$, and left of $x = t$.
\end{itemize}
\begin{columns}[c]
\column{.5\textwidth}
\[
\uncover<2->{%
A(t) = \int_1^t \frac{\diff x}{x^2} = %
}%
\uncover<3->{%
\left[ -\frac{1}{x}\right]_1^t = %
}%
\uncover<4->{%
1 - \frac{1}{t}
}%
\]
\column{.5\textwidth}

\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-0.5, -0.5)(5.6,2.1)
\psframe*[linecolor=white](-0.5,-0.5)(5.6,2.1)
\tiny
\uncover<1,14->{
\psline[linewidth=0.5pt](1,0)(1,1)
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1}{5.5}{1 x 2 exp div }
\psline(5.5,0.033057851)(5.5, 0)(1,0)
}
}

\uncover<2-9>{
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1}{3}{1 x 2 exp div }
\psline(3,  0.111111)(3, 0)(1,0)
}
\psline[linewidth=0.5pt](3,  0.111111)(3, 0)
\fcXTickWithLabel{3}{$t$}
}

\uncover<10>{
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1}{2}{1 x 2 exp div }
\psline(2,  0.25)(2, 0)(1,0)
}
\psline(2,0)(2, 0.25)
\fcXTickWithLabel{2}{$2$}
}

\uncover<11>{
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1}{3}{1 x 2 exp div }
\psline(3,  0)(1,0)
}
\psline(3,0)(3, 0.111111)
\fcXTickWithLabel{3}{$3$}
}
\uncover<12>{
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1}{4}{1 x 2 exp div }
\psline(4,  0)(1,0)
}
\psline(4,0)(4, 0.0625)
\fcXTickWithLabel{4}{$4$}
}
\uncover<13>{
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1}{5}{1 x 2 exp div }
\psline(5,  0)(1,0)
}
\psline(5,0)(5, 0.04)
\fcXTickWithLabel{5}{$5$}
}


\psaxes[ticks=none, labels=none]{<->}(0,0)(-0.5,-0.5)(5.5,2)
\fcLabels{5.5}{2}
%Function formula: (1)/((x)^{2})
\rput[b](5,0.3){$y=\frac{1}{x^2}$}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{0.75}{5.5}{1 x 2 exp div }

\uncover<1,14->{\rput(1.7, 1.2){$A$}}

\rput(1.7, 1.2){$\displaystyle\uncover<2-9>{ A(t)} \uncover<4-9>{=1-\frac{1}t}$}
\uncover<10>{\rput(1.7, 1.2){$\displaystyle A(2)=\frac{1}2$}}
\uncover<11>{\rput(1.7, 1.2){$\displaystyle A(3)=\frac{2}3$}}
\uncover<12>{\rput(1.7, 1.2){$\displaystyle A(4)=\frac{3}4$}}
\uncover<13>{\rput(1.7, 1.2){$\displaystyle A(5)=\frac{4}5$}}

%\uncover<2-9>
{\psline[linewidth=2pt]{->}(1.6, 0.9 )(1.2, 0.3)}
\fcXTickWithLabel{1}{$1$}
\psline[linewidth=0.5pt](1,  0)(1, 1)

\end{pspicture}
%\ \only<-1>{%
%\includegraphics[height=3cm]{improper-integrals/pictures/08-08-xsquaredy.pdf}%
%}%
%\only<handout:0| 2-3>{%
%\includegraphics[height=3cm]{improper-integrals/pictures/08-08-xsquaredz.pdf}%
%}%
%\only<handout:0| 4-8>{%
%\includegraphics[height=3cm]{improper-integrals/pictures/08-08-xsquareda.pdf}%
%}%
%\only<handout:0| 9>{%
%\includegraphics[height=3cm]{improper-integrals/pictures/08-08-xsquaredb.pdf}%
%}%
%\only<handout:0| 10>{%
%\includegraphics[height=3cm]{improper-integrals/pictures/08-08-xsquaredc.pdf}%
%}%
%\only<handout:0| 11>{%
%\includegraphics[height=3cm]{improper-integrals/pictures/08-08-xsquaredd.pdf}%
%}%
%\only<handout:0| 12>{%
%\includegraphics[height=3cm]{improper-integrals/pictures/08-08-xsquarede.pdf}%
%}%
%\only<handout:0| 13->{%
%\includegraphics[height=3cm]{improper-integrals/pictures/08-08-xsquaredf.pdf}%
%}%
\end{columns}
\begin{itemize}
\item<5->  Notice $A(t) < 1$ no matter how big $t$ is.
\item<6->  Also notice $\lim_{t\rightarrow \infty}A(t) = \alert<handout:0| 7-8>{\lim_{t\rightarrow \infty}\left( 1 - \frac{1}{t}\right) = \uncover<8->{1}}$\uncover<8->{.}
\item<14->  We say that the area $A$ is equal to $1$ and write $\int_1^\infty \frac{1}{x^2}\diff x = \lim_{t\rightarrow \infty}\int_1^t \frac{1}{x^2}\diff x = 1$.
\end{itemize}
\end{frame}
% end module improper-integral-geometry



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-type1.tex
% begin module improper-integral-type1
\begin{frame}
\begin{definition}[Improper Integral of Type I]
\begin{enumerate}
\item  If $\int_a^t f(x) \diff x$ exists for every $t \geq a$, then
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\int_a^\infty f(x) \diff x = \lim_{t\rightarrow \infty} \int_a^t f(x) \diff x
\]
if the limit exists.
\item  If $\int_t^b f(x) \diff x$ exists for every $t \leq b$, then
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\int_{-\infty}^b f(x) \diff x = \lim_{t\rightarrow -\infty} \int_t^b f(x) \diff x
\]
if the limit exists.
\end{enumerate}
$\int_a^\infty f(x) \diff x$ and $\int_{-\infty}^b f(x) \diff x$ are called convergent if the corresponding limit exists and divergent if it doesn't exist.
\begin{enumerate}
\setcounter{enumi}{2}
\item  If both $\int_a^\infty f(x) \diff x$ and $\int_{-\infty}^a f(x) \diff x$ are convergent, then we define
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\int_{-\infty}^\infty f(x) \diff x = \int_{-\infty}^a f(x) \diff x + \int_a^\infty f(x) \diff x .
\]
\end{enumerate}
\end{definition}
\end{frame}
% end module improper-integral-type1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-type1-ex1.tex
% begin module improper-integral-type1-ex1
\begin{frame}
\begin{example} %[Example 1, p. 545]
Determine whether $\int_1^\infty \frac{1}{x} \diff x$ is convergent or divergent.
\begin{columns}[c]
\column{.4\textwidth}


\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-0.4, -0.4)(3.4,2.2)
\tiny
\fcAxesStandard{-0.40}{-0.4}{3.3}{2}

\pscustom*[linecolor=cyan]{
%Function formula: x^{-1}

\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1.000000}{3.000000}{x -1.0000000 exp }\psline(3.000000, 0)(1.000000, 0)}

%Function formula: x^{-1}

\psplot[linecolor=\fcColorGraph, plotpoints=1000]{0.5}{3.000000}{x -1.0000000 exp }
\rput(1.5, 1.5){$y=\frac{1}{x}$}
\end{pspicture}
%\ \includegraphics[height=3cm]{improper-integrals/pictures/08-08-ex1b.pdf}%

%\begin{center}
\uncover<7->{Infinite area}%
%\end{center}

\ \uncover<8->{%
\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-0.4, -0.4)(3.3,2.2)
\tiny
\fcAxesStandard{-0.400000}{-0.4}{3.200000}{2}
\pscustom*[linecolor=cyan]{
%Function formula: x^{-2}

\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1.000000}{3.000000}{x -2.0000000 exp }\psline(3.000000, 0)(1.000000, 0)}

%Function formula: x^{-2}

\psplot[linecolor=\fcColorGraph, plotpoints=1000]{0.75}{3.000000}{x -2.0000000 exp }
\rput(1.5, 1.5){$y=\frac{1}{x^2}$}

\end{pspicture}

%\includegraphics[height=3cm]{improper-integrals/pictures/08-08-ex1a.pdf}%
}%

%\begin{center}
\uncover<8->{Finite area}%
%\end{center}
\column{.6\textwidth}
\begin{eqnarray*}
\uncover<2->{%
\int_1^\infty \frac{1}{x}\diff x%
}%
& \uncover<2->{ = } & %
\uncover<2->{%
\lim_{t\rightarrow \infty} \int_1^t \frac{1}{x}\diff x%
}\\%
& \uncover<3->{ = } & %
\uncover<3->{%
\lim_{t\rightarrow \infty} \left[ \ln x\right]_1^t%
}\\%
& \uncover<4->{ = } & %
\uncover<4->{%
\lim_{t\rightarrow \infty} (\ln t - \ln 1)%
}\\%
& \uncover<5->{ = } & %
\uncover<5->{%
\lim_{t\rightarrow \infty} \ln t%
}%
\uncover<6->{ = \infty }%
\end{eqnarray*}
\uncover<7->{Therefore the improper integral is divergent.}
\end{columns}
\end{example}
\end{frame}
% end module improper-integral-type1-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-type1-ex3.tex
% begin module improper-integral-type1-ex3
\begin{frame}
\begin{example} %[Example 3, p. 546]
Evaluate $\int_{-\infty}^\infty \frac{1}{1+x^2}\diff x$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\uncover<2->{%
\[
\int_{-\infty}^\infty \frac{1}{1+x^2}\diff x = \alert<handout:0| 4-8>{\int_{-\infty}^0 \frac{1}{1+x^2}\diff x} + \alert<handout:0| 9-12>{\int_0^\infty \frac{1}{1+x^2}\diff x}%
\]
}%
\uncover<3->{Evaluate the two integrals separately:}
\begin{eqnarray*}
\uncover<4->{%
\int_{-\infty}^0 \frac{1}{1+x^2}\diff x%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\lim_{t\rightarrow -\infty} \int_{t}^0 \frac{1}{1+x^2}\diff x%
}%
\uncover<5->{%
 = \lim_{t\rightarrow -\infty} \left[ \Arctan x\right]_t^0%
}\\%
& \uncover<6->{ = } &%
\uncover<6->{%
\lim_{t\rightarrow -\infty} (\Arctan 0 - \Arctan t)%
}%
\uncover<7->{%
 = \lim_{t\rightarrow -\infty}  (0 -\Arctan t) %
}\\%
& \uncover<8->{ = } &%
\uncover<8->{%
0 - \left( -\frac{\pi}{2}\right) = \frac{\pi}{2}%
}\\%
\uncover<4->{%
\int_0^{\infty} \frac{1}{1+x^2}\diff x%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\lim_{t\rightarrow \infty} \int_{0}^t \frac{1}{1+x^2}\diff x%
}%
\uncover<9->{%
 = \lim_{t\rightarrow \infty} \left[ \Arctan x\right]_0^t%
}\\%
& \uncover<10->{ = } &%
\uncover<10->{%
\lim_{t\rightarrow \infty} (\Arctan t - \Arctan 0)%
}%
\uncover<11->{%
 = \lim_{t\rightarrow \infty} \Arctan t %
}%
\uncover<12->{%
 = \frac{\pi}{2}
}%
\end{eqnarray*}
\uncover<13->{Therefore $\int_{-\infty}^\infty \frac{1}{1+x^2}\diff x = \frac{\pi}{2} + \frac{\pi}{2} = \pi$.}
\end{example}
\end{frame}
% end module improper-integral-type1-ex3



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-type1-ex4.tex
% begin module improper-integral-type1-ex4
\begin{frame}
\begin{example} %[Example 4, p. 547]
For what values of $p$ is the integral $\int_1^\infty \frac{1}{x^p}\diff x$ convergent?
\begin{itemize}
\item<2->  We know from Example 1 that if $p = 1$, the integral is divergent.
\item<3->  Assume $p\neq 1$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<4->{%
\int_1^\infty \frac{1}{x^p} \diff x%
}%
 \uncover<4->{ = }  %
\uncover<4->{%
\lim_{t\rightarrow \infty}\int_1^t \frac{1}{x^p} \diff x%
}%
 \uncover<5->{ = }  %
\uncover<5->{%
\lim_{t\rightarrow \infty}\left[ \frac{x^{-p+1}}{-p+1}\right]_1^t%
}%
 \uncover<6->{ = }  %
\uncover<6->{%
\lim_{t\rightarrow \infty}\frac{ \frac{1}{t^{p-1}} - 1}{1-p}%
}%
\]
\begin{itemize}
\item<7->  If $p > 1$, then $p - 1 > 0$, so as $t\rightarrow \infty$, $t^{p-1}\rightarrow \infty$ and $1/t^{p-1}\rightarrow 0$.
\item<8->  Therefore $\int_1^\infty \frac{1}{x^p}\diff x = \frac{1}{p-1}$ if $p > 1$, and so the integral is convergent.
\item<9->  If $p < 1$, then $p - 1 < 0$, so $\frac{1}{t^{p-1}} = t^{1-p} \rightarrow \infty$ as $t\rightarrow \infty$.
\item<10->  Therefore $\int_1^\infty \frac{1}{x^p}\diff x$ is divergent if $p < 1$.
\end{itemize}
\end{example}
\uncover<11->{%
\begin{theorem}
$\int_1^\infty \frac{1}{x^p}\diff x$ converges if $p > 1$ and diverges if $p \leq 1$.
\end{theorem}
}%
\end{frame}
% end module improper-integral-type1-ex4



\subsection{Type II: Discontinuous Integrands}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-type2.tex
% begin module improper-integral-type2
\begin{frame}
\frametitle{Type II: Discontinuous Integrands}
We can use the same approach if the function $f$ is discontinuous at one of the endpoints $a$ and $b$ in the integral $\int_a^b f(x) \diff x$.

For example, $\frac{1}{\sqrt{x - 2}}$ is discontinuous at $2$, so we might wonder if the integral
\[
\int_2^5 \frac{1}{\sqrt{x-2}}\diff x
\]
exists.

\begin{center}
\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-0.5, -0.5)(5.600000,3.3)
\psframe*[linecolor=white](-0.5,-0.5)(5.600000,3.3)
\tiny
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
%Function formula: \frac{1}{(x-2)^{1/2}}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{2.100000}{5.000000}{1.0000000 -2.0000000 x add 0.5000000 exp div }
\psline(5.000000, 0)(2.00000, 0)(2,3.16227766)
}
%Function formula: \frac{1}{(x-2)^{1/2}}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{2.100000}{5.000000}{1.0000000 -2.0000000 x add 0.5000000 exp div }

\psaxes[arrows=<->](0,0)(-0.500000,-0.5)(5.5,3.2)
\fcLabels{5.5}{3.2}
\end{pspicture}
%\ \includegraphics[height=3cm]{improper-integrals/pictures/08-08-ex5.pdf}%
\end{center}
\end{frame}

\begin{frame}
\begin{definition}[Improper Integral of Type II]
\begin{enumerate}
\item  If $f$ is continuous on $[a, b)$ and discontinuous at $b$, then
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\int_a^b f(x) \diff x = \lim_{t\rightarrow b^-} \int_a^t f(x) \diff x
\]
if the limit exists.
\item  If $f$ is continuous on $(a, b]$ and discontinuous at $a$, then
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\int_a^b f(x) \diff x = \lim_{t\rightarrow a^+} \int_t^b f(x) \diff x
\]
if the limit exists.
\end{enumerate}
$\int_a^bf(x) \diff x$ is called convergent if the corresponding limit exists and divergent if it doesn't exist.
\begin{enumerate}
\setcounter{enumi}{2}
\item  If $f$ has a discontinuity at $c$, where $a < c < b$, and both $\int_a^c f(x)\diff x$ and $\int_c^b f(x)\diff x$ are convergent, then we define
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\int_a^b f(x) \diff x = \int_a^c f(x)\diff x + \int_c^b f(x) \diff x
\]
\end{enumerate}
\end{definition}
\end{frame}
% end module improper-integral-type2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-type2-ex5.tex
% begin module improper-integral-type2-ex5
\begin{frame}
\begin{example} %[Example 5, p. 548]
Find $\int_2^5 \frac{1}{\sqrt{x-2}}\diff x$.

\uncover<2->{Observe that $x = 2$ is a vertical asymptote for the integrand.}
\begin{columns}[c]
\column{.4\textwidth}
\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-0.5, -0.5)(5.600000,3.3)
\psframe*[linecolor=white](-0.5,-0.5)(5.600000,3.3)
\tiny
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
%Function formula: \frac{1}{(x-2)^{1/2}}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{2.100000}{5.000000}{1.0000000 -2.0000000 x add 0.5000000 exp div }
\psline(5.000000, 0)(2.00000, 0)(2,3.16227766)
}
%Function formula: \frac{1}{(x-2)^{1/2}}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{2.100000}{5.000000}{1.0000000 -2.0000000 x add 0.5000000 exp div }

\psaxes[arrows=<->](0,0)(-0.500000,-0.5)(5.5,3.2)
\fcLabels{5.5}{3.2}
\end{pspicture}


%\ \includegraphics[height=4cm]{improper-integrals/pictures/08-08-ex5.pdf}%

\uncover<7->{Area = $2\sqrt{3}$}
\column{.6\textwidth}
\begin{eqnarray*}
& & %
\uncover<3->{%
\int_2^5 \frac{1}{\sqrt{x-2}}\diff x%
}\\%
& \uncover<3->{ = } &%
\uncover<3->{%
\lim_{t\rightarrow 2^+}\int_t^5 \frac{1}{\sqrt{x-2}}\diff x%
}\\%
& \uncover<4->{ = } &%
\uncover<4->{%
\lim_{t\rightarrow 2^+}\left[ 2\sqrt{x-2}\right]_t^5%
}\\%
& \uncover<5->{ = } &%
\uncover<5->{%
\lim_{t\rightarrow 2^+} 2(\sqrt{5-2} - \sqrt{t-2})%
}\\%
& \uncover<6->{ = } &%
\uncover<6->{%
2\sqrt{3}%
}\\%
\end{eqnarray*}
\end{columns}
\end{example}
\end{frame}
% end module improper-integral-type2-ex5



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-type2-ex7.tex
% begin module improper-integral-type2-ex7
\begin{frame}
\begin{example} %[Example 7, p. 549]
Evaluate $\int_0^3 \frac{1}{x-1}\diff x$.

\uncover<2->{Observe that $x = 1$ is a vertical asymptote for the integrand.}%

\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<3->{%
\int_0^3 \frac{1}{x-1}\diff x = \alert<handout:0| 4>{\int_0^1\frac{1}{x-1}\diff x} + \int_1^3 \frac{1}{x-1}\diff x
}%
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<4->{%
\int_0^1 \frac{\diff x}{x - 1}%
}%
& \uncover<4-> { = } &%
\uncover<4->{%
\lim_{t\rightarrow 1^-} \int_0^t \frac{\diff x}{x - 1}%
}  \uncover<5-> { = } \uncover<5->{%
\lim_{t\rightarrow 1^-} \left[ \ln| x - 1| \right]_0^t%
}\\%
& \uncover<6-> { = } &%
\uncover<6->{%
\lim_{t\rightarrow 1^-} \ln|t-1| - \ln 1%
} \uncover<7-> { = } \uncover<7->{%
-\infty
}%
\end{eqnarray*}
\begin{itemize}
\item<8->  Therefore the integral diverges.
\item<9->  If we had not noticed the vertical asymptote, we might have made the following \alert<1->{mistake}:
\end{itemize}
\uncover<9->{\alert<handout:0| 1->{%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\int_0^3 \frac{\diff x}{x - 1} = \left[ \ln | x - 1|\right]_0^3 = \ln 2 - \ln 1 = \ln 2.
\]}}%
\vspace{-.1in}
\end{example}
\end{frame}
% end module improper-integral-type2-ex7



\subsection{A Comparison Test for Improper Integrals}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-comparison.tex
% begin module improper-integral-comparison
\begin{frame}
\frametitle{A Comparison Test for Improper Integrals}
Sometimes it's impossible to find the exact value of an integral, but we still want to know if it's convergent or divergent.  For such cases, we can sometimes use the following theorem.
\begin{theorem}[Comparison Theorem]
Suppose $f$ and $g$ are continuous and $f(x) \geq g(x) \geq 0$ for $x \geq a$.
\begin{enumerate}
\item  \alert<2>{If $\int_a^\infty f(x) \diff x$ is convergent}, then \alert<3>{$\int_a^\infty g(x)\diff x$ is convergent}.
\item \alert<4>{If $\int_a^\infty g(x) \diff x$ is divergent}, \alert<5>{then $\int_a^\infty f(x)\diff x$ is divergent.}
\end{enumerate}
\end{theorem}
\begin{columns}[c]
\column{.4\textwidth}
%\includegraphics[height=3cm]{improper-integrals/pictures/08-08-comptest.pdf}%
\psset{xunit=0.5cm, yunit=0.5cm}
\begin{pspicture}(-0.5, -0.5)(8.6,5.4)
\psframe*[linecolor=white](-0.5,-0.5)(8.6,5.4)
\tiny

\pscustom*[linecolor=blue]{
%Function formula: \frac{4}{(x-1/2)^{1/2}}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1.100000} {8.5} {4.0000000 -0.5000000 x add 0.5000000 exp div }\psline(8.5, 0)(1.100000, 0)}


\pscustom*[linecolor=cyan]{
%Function formula: \frac{8 x-4}{x^{2}+2}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1.100000} {8.5} {-4.0000000 x 8.0000000 mul add 2.0000000 x 2.0000000 exp add div } 
\psline(8.5, 0)(1.100000, 0)
}

\uncover<3,4>{
\pscustom*[linecolor=red]{
%Function formula: \frac{8 x-4}{x^{2}+2}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1.100000} {8.5} {-4.0000000 x 8.0000000 mul add 2.0000000 x 2.0000000 exp add div } 
\psline(8.5, 0)(1.100000, 0)
}
}

\uncover<2,5>{
\pscustom*[linecolor=red]{
%Function formula: \frac{4}{(x-1/2)^{1/2}}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1.100000} {8.5} {4.0000000 -0.5000000 x add 0.5000000 exp div }\psline(8.5, 0)(1.100000, 0)}
}


%Function formula: \frac{4}{(x-1/2)^{1/2}}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1.100000} {8.500000} {4.0000000 -0.5000000 x add 0.5000000 exp div }
%Function formula: \frac{8 x-4}{x^{2}+2}
\psplot[linecolor=\fcColorGraph, plotpoints=1000] {1.100000} {8.5000000}{-4.0000000 x 8.0000000 mul add 2.0000000 x 2.0000000 exp add div }


\fcAxesStandardNoFrame{-0.500000}{-0.5}{8.6}{5.3}
\uncover<2,3>{\rput(4.2,1){Area$<\infty$}}
\uncover<4,5>{\rput(4.2,1){Area$=\infty$}}

\rput(2,4){$f$}
\rput(2,1.4){$g$}
\psline(1.1, 0)(1.1, 5.163977795)
\end{pspicture}

\column{.6\textwidth}
\uncover<7->{%
A similar theorem holds for Type II improper integrals.
}%
\end{columns}
\end{frame}
% end module improper-integral-comparison



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-comparison-ex9.tex
% begin module improper-integral-comparison-ex9
\begin{frame}
\begin{example} %[Example 9, p. 550]
Show that $\int_0^\infty e^{-x^2}\diff x$ is convergent.
\begin{itemize}
\item<2-> If integral were $\int_{0}^{\infty} e^{-x}\diff x$, we could integrate directly. 
\item<3->  However, the antiderivative of $e^{-x^2}$ isn't an elementary function.
\item<4-| alert@10> Notice that $e^{-x^2} \leq e^{-x}$ for $x\geq 1$.
\item<5-> Now split $\int_0^\infty e^{-x^2}\diff x = \alert<6>{ \int_0^1 e^{-x^2}\diff x} + \int_1^\infty e^{-x^2}\diff x$.
\item<6->  On the RHS, first integral is proper - no affect on convergence.
\end{itemize}
\begin{columns}[c]
\column{.5\textwidth}
\ \uncover<4->{%
\psset{xunit=1.5cm, yunit=1.5cm}
\begin{pspicture}(-0.5,-0.5)(3.2,1.3)
\psframe*[linecolor=white](-0.5,-0.5)(3.200000,1.3)
\tiny
\fcAxesStandard{-0.500000}{-0.5}{3.000000}{1.2}
%Function formula: e^{- x^{2}}
\psplot[linecolor=\fcColorGraph, plotpoints=1000] {0.000000} {3.000000}{2.718281828 x 2.0000000 exp -1.0000000 mul exp }
\rput[t](0.5, 0.45){$y=e^{-x}$}

%Function formula: e^{- x}
\psplot[linecolor=blue, plotpoints=1000] {0.000000}{3.000000}{2.718281828 x -1.0000000 mul exp }
\rput[lb](0.5, 0.9){$y=e^{-x^2}$}

\fcXTickWithLabel{1}{$1$}
\end{pspicture}
%\includegraphics[height=3cm]{improper-integrals/pictures/08-08-ex9.pdf}%
}%
\column{.5\textwidth}
\begin{eqnarray*}
\uncover<7->{%
\alert<handout:0| 10>{\int_1^\infty e^{-x}\diff x}%
}%
& \uncover<7->{ = } & %
\uncover<7->{%
\lim_{t\rightarrow \infty} \int_1^t e^{-x}\diff x%
}\\%
& \uncover<8->{ = } & %
\uncover<8->{%
\lim_{t\rightarrow \infty} \left[ -e^{-x}\right]_1^t
}\\%
& \uncover<9->{ = } & %
\uncover<9->{%
\lim_{t\rightarrow \infty} (e^{-1} - e^{-t})%
}\\%
& \uncover<10->{ = } & %
\uncover<10->{%
\alert<handout:0| 11>{e^{-1}}
}%
\end{eqnarray*}
\end{columns}
\uncover<11->{%
Therefore by the Comparison Theorem, $\int_0^\infty e^{-x^2}\diff x$ converges.
}%
\end{example}
\end{frame}
% end module improper-integral-comparison-ex9



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-comparison-ex10.tex
% begin module improper-integral-comparison-ex10
\begin{frame}
\begin{example} %[Example 10, p. 551]
Is $\int_1^\infty \frac{1+e^{-x}}{x}\diff x$ convergent or divergent?

\begin{itemize}
\item<2->  $\frac{1+e^{-x}}{x} > \frac{1}{x}$.
\item<3->  By a previously studied example, $\int_1^\infty \frac{\diff x}{x}$ is divergent.
\item<4->  Therefore $\int_1^\infty \frac{1+e^{-x}}{x}\diff x$ is divergent by the Comparison Theorem.
\end{itemize}
\end{example}
\end{frame}
% end module improper-integral-comparison-ex10



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/improper-integrals/improper-integral-type1-arctan-geometric-interpretation.tex
%begin module improper-integral-type1-arctan-geometric-interpretation
%\begin{comment}
\begin{frame}[t]

\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-3.1, -0.1)(3.1,1.2)
\psframe*[linecolor=white](-3.1,-0.1)(3.1,1.2)
\tiny
\psline[linecolor=red!1](0,1.2)(0.001,1.2) %bounding boxes don't always work right
\psaxes[arrows=<->, ticks=none, labels=none] (0,0) (-3.05,-0.1) (3.05,1.1)
\rput[t](3, -0.1){$x$}

%Function formula: - (- x^{2}+1)^{1/2}
%\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-1}{1}{1 x 2 exp -1 mul add 0.5 exp -1 mul }
%Function formula: (- x^{2}+1)^{1/2}
\psplot[linecolor=blue, plotpoints=1000] {-1} {1} {1 x 2 exp -1 mul add 0.5 exp }
\psline(-3,1)(3,1)

\uncover<3->{
\psline{<-}(-0.05, 0)(-0.05,0.4)
\psline{->}(-0.05, 0.6)(-0.05,1)
\rput(-0.05, 0.5){\alert<3>{$1$}}
}
\uncover<2>{
\psline[linecolor=red](0.5,1)(1,1)
\fcFullDot{1}{1}
}
\uncover<2>{
\fcFullDot{0.5}{1}
}

\rput[br](-0.05, 1.05){ $\phantom{Q_0=P_0}A$}
\uncover<2->{
\rput[lb](0.5, 1.05){$P_1\phantom{(x_1 ,1)}$}
\rput[lb](1, 1.05){$P_2(\alert<2>{x_2}, 1)$}
}
\uncover<2->{
\rput[t](0.75,0.95){\alert<2>{$\Delta$}}
}
\uncover<5->{
\rput[lt](0.520000, 0.4500000){$\alert<5>{Q_2}$}
\rput[l](0.42000, 0.8){$\alert<5>{Q_1}$}
}
\rput[tl](0.05, -0.05){$O$}
%calculator commands:
%\Delta:=0.5;
%xInv{}{{x}}:=DoubleValue{}x/(1+x^2);
%yInv{}{{x}}:=DoubleValue{} 1/(1+x^2);
%xDir{}{{x}}:=-xInv{}x;
%yDir{}{{x}}:=1-yInv{}x;
%lengthN{}{{x}}:=((xDir{}x)^2+(yDir{}x)^2)^{1/2};
%xDirN{}{{x}}:=0.05 xDir{}x /lengthN{}x ;
%yDirN{}{{x}}:=0.05 yDir{}x/lengthN{}x;
%xT{}{{x}}:=-yDirN{}x;
%yT{}{{x}}:=xDirN{}x;

%inversePoint{}{{x}}:=(xInv{}x,yInv{}x );
%f{}{{x}}:= \psline(DoubleValue{}x,1 )(0,0) \psline inversePoint{}x (0,1)  \psline inversePoint{}x inversePoint{}(x+\Delta) \psline (xInv{}x +xDirN{}x, yInv{}x+yDirN{}x ) (xInv{}x +xDirN{}x+xT{}x, yInv{}x+yDirN{}x +yT{}x)(xInv{}x +xT{}x, yInv{}x +yT{}x);
%f{}(\Delta) f{}(2\Delta)f{}(3\Delta)f{}(4\Delta)f{}(5\Delta)f{}(6\Delta)

\uncover<5->{
\psline (0.5, 1) (0, 0)
}
\uncover<5->{
\psline (0.4, 0.8) (0, 1)
}
\uncover<15->{
\psline (0.4, 0.8) (0.5, 0.5)
}
\uncover<5->{\psline (0.355279, 0.822361) (0.332918, 0.777639) (0.377639, 0.755279) }

\uncover<4->{\psline (1, 1) (0, 0) }
\uncover<5->{\psline (0.5, 0.5) (0, 1)}
%\psline (0.5, 0.5) (0.461538, 0.307692)
\uncover<5->{\psline (0.464645, 0.535355) (0.429289, 0.5) (0.464645, 0.464645) }


%\psline (1.500000, 1) (0, 0)
%\psline (0.461538, 0.307692) (0, 1)
%\psline (0.461538, 0.307692) (0.4, 0.2)
%\psline (0.433803, 0.349295) (0.392201, 0.321560) (0.419936, 0.279957)

%\psline (2, 1) (0, 0)
%\psline (0.4, 0.2) (0, 1)
%\psline (0.4, 0.2) (0.344828, 0.137931)
%\psline (0.377639, 0.244721) (0.332918, 0.222361) (0.355279, 0.177639)

%\psline (2.5, 1) (0, 0)
%\psline (0.344828, 0.137931) (0, 1)
%\psline (0.344828, 0.137931) (0.300000, 0.100000)
%\psline (0.326258, 0.184355) (0.279834, 0.165785) (0.298404, 0.119362)

%\psline (3, 1) (0, 0)
%\psline (0.300000, 0.100000) (0, 1)
%\psline (0.300000, 0.100000) (0.264151, 0.075472)
%\psline (0.284189, 0.147434) (0.236754, 0.131623) (0.252566, 0.084189)

%\psline (-0.5, 1) (0, 0)
%\psline (-0.4, 0.8) (0, 1)
%\psline (-0.4, 0.8) (-0.5, 0.5) \psline (-0.355279, 0.822361) (-0.377639, 0.867082) (-0.422361, 0.844721)

%\psline (-1, 1) (0, 0)
%\psline (-0.5, 0.5) (0, 1)
%\psline (-0.5, 0.5) (-0.461538, 0.307692)
%\psline (-0.464645, 0.535355) (-0.5, 0.570711) (-0.535355, 0.535355)

%\psline (-1.500000, 1) (0, 0)
%\psline (-0.461538, 0.307692) (0, 1)
%\psline (-0.461538, 0.307692) (-0.4, 0.2)
%\psline (-0.433803, 0.349295) (-0.475406, 0.377030) (-0.503141, 0.335427)

%\psline (-2, 1) (0, 0)
%\psline (-0.4, 0.2) (0, 1)
%\psline (-0.4, 0.2) (-0.344828, 0.137931)
%\psline (-0.377639, 0.244721) (-0.422361, 0.267082) (-0.444721, 0.222361)

%\psline (-2.5, 1) (0, 0)
%\psline (-0.344828, 0.137931) (0, 1)
%\psline (-0.344828, 0.137931) (-0.300000, 0.100000)
%\psline (-0.326258, 0.184355) (-0.372682, 0.202924) (-0.391251, 0.156501)

%\psline (-3, 1) (0, 0)
%\psline (-0.300000, 0.100000) (0, 1)
%\psline (-0.300000, 0.100000) (-0.264151, 0.075472)
%\psline (-0.284189, 0.147434) (-0.331623, 0.163246) (-0.347434, 0.115811)


%Function formula: - (- x^{2}+1/4)^{1/2}+1/2
%\psplot[linecolor=blue, plotpoints=1000]{-0.5}{0.5}{0.5 0.2500000 x 2 exp -1 mul add 0.5 exp -1 mul add }

%Function formula: (- x^{2}+1/4)^{1/2}+1/2
%\psplot[linecolor=blue, plotpoints=1000]{-0.5}{0.5}{0.5 0.2500000 x 2 exp -1 mul add 0.5 exp add }

\uncover<3,6>{
\psline[linecolor=red](1, 1) (0, 0)(0,1)(1,1)
}
\uncover<4>{
\psline[linecolor=red](0.5, 1) (0, 0)(0,1)(0.5,1)
}

\uncover<7>{
\psline[linecolor=red](0.5, 0.5) (0, 0)(0,1)(0.5,0.5)
}
\uncover<8>{
\psline[linecolor=green](0,0)(0,1)
\psline[linecolor=red](0,0)(1,1)
}
\uncover<9>{
\psline[linecolor=green](0,0)(0.5,0.5)
\psline[linecolor=red](0,0)(0,1)
}
\uncover<15>{
\psline[linecolor=red](0,0)(0.5, 0.5)(0.4,0.8)(0,0)
}
\uncover<16>{
\psline[linecolor=red](0,0)(1, 1)(0.5,1)(0,0)
}
\uncover<17,18>{
\psline[linecolor=green](0.5, 0.5)(0.4, 0.8)
\psline[linecolor=red](0.5, 1)(1, 1)
}
\uncover<18>{
\psline[linecolor=green](0.5, 0.5)(0.0, 0.0)
\psline[linecolor=red](0, 0)(0.5, 1)
}
\end{pspicture}
\only<1-26>{
Draw a unit circle as above, let $O, A$ be as indicated. \uncover<2->{Let $P_2$ be the point $(\alert<2>{x_2},1)$, $P_1$ be the point $(x_2-\alert<2>{\Delta},1)$.} \uncover<3->{By the Pythagorean theorem, $\alert<25>{|OP_2|^2= 1 + x_2^2}$} \uncover<4->{and similarly $ |OP_1 |^2=1+(x_2-\Delta )^2$.} \uncover<5->{Let \alert<5>{$Q_1$}, \alert<5>{$Q_2$} be as indicated.} \uncover<6->{Then $\alert<6>{ \triangle OP_2A} $ is similar to $\alert<7>{\triangle OAQ_2} $.} \uncover<8->{By Euclidean geometry, $\alert<8>{ \frac{ \only<1-8>{{\color{green} |OA|}} \only<9->{|OA|} }{ |OP_2| }} =\alert<9>{ \frac{\only<9>{{\color{green}|OQ_2|}} \only<8,10->{|OQ_2|} }{|OA|}}$} \uncover<10->{ and so $\alert<12,24>{|OQ_2| |OP_2| }= |OA|^2 \alert<12,24>{ =1}$ \uncover<23->{ and therefore $\alert<23>{ \frac{|OQ_2|}{|OP_2|}} = \frac{ \alert<24>{|OQ_2| \alert<23>{| OP_2 |}} }{|OP_2|^{\alert<23>{2} }} \uncover<24->{= \frac{ \alert<24>{ 1} }{ \alert<25>{|OP_2|^2}} } \uncover<25->{ = \frac{1}{\alert<25>{ 1+x_2^2}}.}$}
}
%The points $Q_2$, $P_2$ are often called ``inverse points w.r.t. the unit circle''.
\uncover<11->{Similarly conclude $\alert<13>{ |OQ_1|} \alert<14>{|OP_1|} =|OA|^2= \alert<12>{1} \uncover<12->{ \alert<12>{\alert<13,14>{=} \alert<14>{ |OQ_2|}\alert<13>{ |OP_2| }}.}$}
\uncover<13->{Therefore $\alert<13>{ \frac{|OQ_1|}{  |OP_2|} } \alert<13,14>{=} \alert<14>{\frac{|OQ_2| }{ |OP_1|}} $} \uncover<15->{and so $ \alert<15>{\triangle OQ_2Q_1} $ is similar to $\alert<16>{\triangle OP_1P_2} $.} \uncover<17->{Therefore $\frac{ \only<17>{{\color{green}|Q_1Q_2|}} \only<18->{\alert<19>{ |Q_1Q_2|}} } { \alert<17,20>{|P_1P_2|} }= \alert<20>{ \frac{ \only<18>{\color{green}|OQ_2|} \only<1-17,19->{ |OQ_2|} }{ \alert<18>{|OP_1|} }}$} \uncover<19->{and so }
}
\uncover<19->{\alert<26,27>{\noindent $\alert<19>{|Q_1Q_2|} =\alert<20>{\frac{|P_1P_2| |OQ_2|} {|OP_1|}} \uncover<21->{=\left(\frac{\alert<21>{|OP_2|} }{|OP_1|}\right) \alert<23,24,25>{\frac{|OQ_2|} {\alert<21>{ |OP_2|}}} \alert<22>{ |P_1P_2|} } \uncover<22->{= \frac{|OP_2| } {|OP_1|} \frac{\alert<22>{ \Delta} }{\alert<23,24,25>{ 1+x_2^2}}.}$}}
\end{frame}
%\end{comment}
%\begin{comment}
\begin{frame}[t]
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-3.1, -0.1)(3.1,1.2)
\psframe*[linecolor=white](-3.1,-0.1)(3.1,1.2)
\tiny
\psline[linecolor=red!1](0,1.2)(0.001,1.2) %bounding boxes don't always work right
\uncover<48->{
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
%Function formula: \frac{1}{x^{2}+1}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-3.000000}{3.000000}{1.0000000 1.0000000 x 2.0000000 exp add div }
\psline(3.000000, 0)(-3.000000, 0)
}

%Function formula: \frac{1}{x^{2}+1}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-3.000000} {3.000000} {1.0000000 1.0000000 x 2.0000000 exp add div }
}

\psaxes[arrows=<->, ticks=none, labels=none](0,0)(-3.05,-0.1)(3.05,1.1)
%Function formula: - (- x^{2}+1)^{1/2}
%\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-1}{1}{1 x 2 exp -1 mul add 0.5 exp -1 mul }
%Function formula: (- x^{2}+1)^{1/2}
\psplot[linecolor=blue, plotpoints=1000]{-1}{1}{1 x 2 exp -1 mul add 0.5 exp }
\psline(-3,1)(3,1)
%calculator commands:
%\Delta:=0.5;
%xInv{}{{x}}:=DoubleValue{}x/(1+x^2);
%yInv{}{{x}}:=DoubleValue{} 1/(1+x^2);
%xDir{}{{x}}:=-xInv{}x;
%yDir{}{{x}}:=1-yInv{}x;
%lengthN{}{{x}}:=((xDir{}x)^2+(yDir{}x)^2)^{1/2};
%xDirN{}{{x}}:=0.05 xDir{}x /lengthN{}x ;
%yDirN{}{{x}}:=0.05 yDir{}x/lengthN{}x;
%xT{}{{x}}:=-yDirN{}x;
%yT{}{{x}}:=xDirN{}x;

%inversePoint{}{{x}}:=(xInv{}x,yInv{}x );
%f{}{{x}}:= \psline(DoubleValue{}x,1 )(0,0) \psline inversePoint{}x (0,1)  \psline inversePoint{}x inversePoint{}(x+\Delta) \psline (xInv{}x +xDirN{}x, yInv{}x+yDirN{}x ) (xInv{}x +xDirN{}x+xT{}x, yInv{}x+yDirN{}x +yT{}x)(xInv{}x +xT{}x, yInv{}x +yT{}x);
%f{}(\Delta) f{}(2\Delta)f{}(3\Delta)f{}(4\Delta)f{}(5\Delta)f{}(6\Delta)

\uncover<1-33>{
\psline(0.5, 1)(0, 0)
}
\uncover<34-41>{
\psline(0.4, 0.8)(0, 0)
}
\psline(0.4, 0.8)(0, 1)
\uncover<28,34>{
\psline[linecolor=red](0.4, 0.8)(0, 1)
}
\uncover<1-41>{
\psline(0.355279, 0.822361)(0.332918, 0.777639)(0.377639, 0.755279)
}
\uncover<22>{
\psline[linecolor=red](0.4, 0.8)(0, 1)
\psline[linecolor=red](0.355279, 0.822361)(0.332918, 0.777639)(0.377639, 0.755279)
}
\uncover<7-12>{
\psline(0.600000, 1)(0, 0)
\psline(0.441176, 0.735294)(0, 1)
\psline(0.441176, 0.735294)(0.4, 0.8)
\psline(0.398302, 0.761019)(0.372577, 0.718144)(0.415452, 0.692419)
}
\rput[lt](0.46, 0.71){\uncover<7-12>{$Q_2$}}
\uncover<6>{
\psline(0.700000, 1)(0, 0)
\psline(0.469799, 0.671141)(0, 1)
\psline(0.469799, 0.671141)(0.4, 0.8)
\psline(0.428837, 0.699814)(0.400164, 0.658852)(0.441126, 0.630179)
}
\rput[lt](0.48, 0.65){\uncover<6>{$Q_2$}}
\uncover<5>{
\psline(0.8, 1)(0, 0)
\psline(0.487805, 0.609756)(0, 1)
\psline(0.487805, 0.609756)(0.4, 0.8)
\psline(0.448761, 0.640991)(0.417527, 0.601947)(0.456570, 0.570713)
}
\rput[lt](0.5, 0.58){\uncover<5>{$Q_2$}}
\uncover<4>{
\psline(0.900000, 1) (0, 0)
\psline(0.497238, 0.552486)(0, 1)
\psline(0.497238, 0.552486)(0.4, 0.8)
\psline(0.460073, 0.585934)(0.426625, 0.548770)(0.463789, 0.515321)
}
\rput[lt](0.5, 0.54){\uncover<4>{$Q_2$}}

\uncover<1-3>{ %
\psline(1, 1)(0, 0)
\psline(0.4, 0.8)(0.5, 0.5)
} %
\rput[lt](0.520000, 0.4500000){\uncover<1-3>{$Q_2$}}
\uncover<13->{ %
\psline(0.4, 0.8)(0.5, 0.5)
} %
\rput[lt](0.520000, 0.4500000){\uncover<13->{$Q_2$}}
\uncover<13-33>{ %
\psline(1, 1)(0, 0)
}
\uncover<34-41>{
\psline(0.5, 0.5)(0, 0)
}
\uncover<30,34>{
\psline[linecolor=red](0.4, 0.8)(0.5, 0.5)
}
\uncover<32->{
\psline(0.5, 0.5)(0.461538, 0.307692)
}
\uncover<32,34>{
\psline[linecolor=red](0.5, 0.5)(0.461538, 0.307692)
}
\uncover<1-3, 13-41>{
\psline(0.5, 0.5)(0, 1)
\psline(0.464645, 0.535355)(0.429289, 0.5)(0.464645, 0.464645)
}
\uncover<23>{
\psline[linecolor=red](0.5, 0.5)(0, 1)
\psline[linecolor=red](0.464645, 0.535355)(0.429289, 0.5)(0.464645, 0.464645)
}
\uncover<14>{ %
\psline[linecolor=red](0,0)(0,1)
} %
\uncover<15>{
\psline[linecolor=red](0,0)(0.5,1)
}
\uncover<16>{
\psline[linecolor=red](0,0)(1,1)
}
\uncover<17-33>{
\psline(1.5, 1)(0, 0)
}
\uncover<34-41>{
\psline(0.461538, 0.307692)(0, 0)
}
\uncover<17>{
\psline[linecolor=red](1.500000, 1)(0, 0)
}
\uncover<32->{
\psline(0.461538, 0.307692)(0.4, 0.2)
}
\uncover<32,34>{
\psline[linecolor=red](0.461538, 0.307692)(0.4, 0.2)
}
\uncover<24-41>{
\psline(0.461538, 0.307692)(0, 1)
\psline(0.433803, 0.349295)(0.392201, 0.321560)(0.419936, 0.279957)
}
\uncover<24>{
\psline[linecolor=red](0.461538, 0.307692)(0, 1)
\psline[linecolor=red](0.433803, 0.349295)(0.392201, 0.321560)(0.419936, 0.279957)
}
\uncover<18-33>{
\psline(2, 1)(0, 0)
}
\uncover<34-41>{
\psline(0.4, 0.2)(0, 0)
}
\uncover<18>{
\psline[linecolor=red](2, 1)(0, 0)
}
\uncover<32->{
\psline(0.4, 0.2)(0.344828, 0.137931)
}
\uncover<32,34>{
\psline[linecolor=red](0.4, 0.2)(0.344828, 0.137931)
}
\uncover<25-41>{
\psline(0.4, 0.2)(0, 1)
\psline(0.377639, 0.244721)(0.332918, 0.222361)(0.355279, 0.177639)
}
\uncover<25>{
\psline[linecolor=red](0.4, 0.2)(0, 1)
\psline[linecolor=red](0.377639, 0.244721)(0.332918, 0.222361)(0.355279, 0.177639)
}
\uncover<19-33>{
\psline(2.5, 1)(0, 0)
}
\uncover<34-41>{
\psline(0.344828, 0.137931)(0, 0)
}
\uncover<19>{
\psline[linecolor=red](2.5, 1)(0, 0)
}
\uncover<32->{
\psline(0.344828, 0.137931)(0.300000, 0.100000)
}
\uncover<32,33,34>{
\psline[linecolor=red](0.344828, 0.137931)(0.300000, 0.100000)
}
\uncover<26-41>{
\psline(0.344828, 0.137931)(0, 1)
\psline(0.326258, 0.184355)(0.279834, 0.165785)(0.298404, 0.119362)
}
\uncover<26>{
\psline[linecolor=red](0.344828, 0.137931)(0, 1)
\psline[linecolor=red](0.326258, 0.184355)(0.279834, 0.165785)(0.298404, 0.119362)
}
\uncover<20-33>{
\psline(3, 1)(0, 0)
}
\uncover<34-41>{
\psline(0.300000, 0.100000)(0, 0)
}
\uncover<20>{
\psline[linecolor=red](3, 1)(0, 0)
}
%\psline(0.300000, 0.100000)(0.264151, 0.075472)
\uncover<27-41>{
\psline(0.300000, 0.100000)(0, 1)
\psline(0.284189, 0.147434)(0.236754, 0.131623)(0.252566, 0.084189)
}
\uncover<27->{
\rput[lt](0.3,0.095){$Q_n$}
}
\uncover<27>{
\psline[linecolor=red](0.300000, 0.100000)(0, 1)
\psline[linecolor=red](0.284189, 0.147434)(0.236754, 0.131623)(0.252566, 0.084189)
}

\uncover<44>{
\psline(-0.5, 1)(0, 0)
\psline(-0.4, 0.8)(0, 1)
\psline(-0.355279, 0.822361)(-0.377639, 0.867082)(-0.422361, 0.844721)

\psline(-1, 1)(0, 0)
\psline(-0.5, 0.5)(0, 1)
\psline(-0.464645, 0.535355)(-0.5, 0.570711)(-0.535355, 0.535355)

\psline(-1.500000, 1) (0, 0)
\psline(-0.461538, 0.307692)(0, 1)
\psline(-0.433803, 0.349295)(-0.475406, 0.377030)(-0.503141, 0.335427)

\psline(-2, 1) (0, 0)
\psline(-0.4, 0.2)(0, 1)
\psline(-0.377639, 0.244721)(-0.422361, 0.267082)(-0.444721, 0.222361)

\psline(-2.5, 1) (0, 0)
\psline(-0.344828, 0.137931)(0, 1)
\psline(-0.326258, 0.184355)(-0.372682, 0.202924)(-0.391251, 0.156501)

\psline(-3, 1)(0, 0)
\psline(-0.300000, 0.100000)(0, 1)
%\psline (-0.300000, 0.100000) (-0.264151, 0.075472)
\psline(-0.284189, 0.147434)(-0.331623, 0.163246)(-0.347434, 0.115811)
}
\uncover<44->{
\psline(-0.4, 0.8)(-0.5, 0.5)
\psline(-0.5, 0.5)(-0.461538, 0.307692)
\psline(-0.461538, 0.307692)(-0.4, 0.2)
\psline(-0.4, 0.2)(-0.344828, 0.137931)
\psline(-0.344828, 0.137931)(-0.300000, 0.100000)
}

%Function formula: - (- x^{2}+1/4)^{1/2}+1/2
\uncover<42->{\psplot[linecolor=red, plotpoints=1000]{-0.5}{0.5}{0.5 0.2500000 x 2 exp -1 mul add 0.5 exp -1 mul add }

%Function formula: (- x^{2}+1/4)^{1/2}+1/2
\psplot[linecolor=red, plotpoints=1000]{-0.5}{0.5}{0.5 0.2500000 x 2 exp -1 mul add 0.5 exp add }
}
\uncover<8-12>{
\psline[linecolor=red](0,0)(0.6,1)
\psline[linecolor=green](0,0)(0.5,1)
}
\uncover<4>{
\rput[lb](0.9, 1.05){$P_2$}
\rput[t](0.7,0.95){$\Delta$}
}
\uncover<5>{
\rput[lb](0.8, 1.05){$P_2$}
\rput[t](0.65,0.95){$\Delta$}
}
\uncover<6>{
\rput[lb](0.7, 1.05){$P_2$}
\rput[t](0.6,0.95){$\Delta$}
}
\uncover<7-12>{
\rput[lb](0.6, 1.05){$P_2$}
\rput[t](0.55,0.95){$\Delta$}
}
\uncover<1-3,13->{
\rput[lb](1, 1.05){\uncover<1-33>{$P_2\alert<16>{(x_2, 1)}$}}
\rput[t](0.75,0.95){$\Delta$}
}
\rput[rb](3, 1.05){$\uncover<20-33>{\alert<20>{P_n}}$}
\rput[lb](2, 1.05){
$\uncover<17-33>{\alert<17>{\dots}}$
}

\rput[lb](0.5, 1.05){\uncover<1-33>{$P_1\uncover<15->{\alert<15>{(x_1 ,1)}}$}}
\rput[t](3, -0.1){$x$}
\rput[br](-0.05, 1.05){$\uncover<21->{\alert<21>{Q_0= }}\uncover<14->{ \alert<14>{ P_0=}}A$}
\rput[l](0.42000, 0.8){$Q_1$}
\rput[tl](0.05, -0.05){$O$}
\end{pspicture}
\alert<1>{ \noindent $\alert<28>{|Q_1Q_2| =} \alert<29>{\frac{|OP_2| } {|OP_1|}} \alert<28>{\frac{ \Delta} {1+x_2^2}}. \vphantom{={\frac{|P_1P_2| |OQ_2|} {|OP_1|}} {=\left(\frac{|OP_2|}{|OP_1|}\right) \frac{|OQ_2|} { |OP_2|} |P_1P_2| } }$} \uncover<13->{For any $\varepsilon >0$, can choose $\Delta$: $\alert<29>{1< \frac{|OP_2| } {|OP_1|} < 1 + \varepsilon}$.}

\only<1-12>{ \uncover<2->{If we let $P_2\to P_1$}\uncover<3->{, i.e., $\Delta \to 0$,} \uncover<8->{we get $\alert<8>{ \frac{|OP_2| }{ |OP_1|}\to 1}$.} \uncover<9->{In strict mathematical language: for every $\varepsilon>0$ there exists $\delta >0$ such that when $\Delta  < \delta$ we have that $1>\frac{ |OP_2| }{|OP_1|}>1-\varepsilon $.} \uncover<10->{Furthermore, the choice of $\delta$ can be made independent of the value of $x_2$: } \uncover<11->{to prove that one analyzes the expression $\frac{|OP_2|}{|OP_1|} = \sqrt{ \frac{ 1+x_2^2} { 1 + (x_2-\Delta )^2}}$.} \uncover<12->{We leave the tedious but otherwise easy details to the interested student. }
}

\only<13-27>{
\uncover<13->{Fix a large number $N$ and let $\Delta$ be such that $n= \frac{N}{\Delta} $ is integer.} \uncover<14->{ Let  $\alert<14>{P_0=(0,1)} $, $\alert<15>{P_1=(\Delta, 1 )}$, $\alert<16>{P_2=(2\Delta,1)}, \dots, \alert<20>{P_n= (n \Delta,1)}$}\uncover<21->{, and let $\alert<21>{Q_0}, \alert<22>{ Q_1},\alert<23>{Q_2}, \dots, \alert<27>{Q_n}$ be as indicated.}
}

\uncover<28->{
$
\begin{array}{rcrcl}
\only<1-39>{
\alert<28>{ \frac{\Delta}{1+x_1^2 } }&<\phantom{=}&\alert<28>{ |Q_0Q_1|} &< \phantom{=} & \alert<29>{ (1+ \varepsilon )} \alert<28>{\frac{ \Delta}{1+x_1^2}}  \\
\uncover<30->{\alert<30>{ \frac{\Delta}{1+x_2^2 }} &<\phantom{=} &\alert<30>{|Q_1Q_2|} &<\phantom{=} & \alert<31>{ (1 + \varepsilon)} \alert<30>{\frac{ \Delta }{1+ x_2^2}}}  \\
\uncover<32->{ &\alert<32>{\vdots}} \\
\uncover<33->{\frac{\Delta}{1+x_n^2 } &<\phantom{=} &\alert<33>{ |Q_{n-1}Q_n|} &< \phantom{=} &(1+\varepsilon) \frac{\Delta}{1+x_n^2}} \uncover<34->{\\ \hline}
\uncover<34->{ \sum_{i=1}^n\frac{\Delta}{1+x_i^2 } &< \phantom{=}&\alert<34>{ \sum_{i=1}^n |Q_{i-1} Q_i|} & <\phantom{=}& (1 +\varepsilon)\sum_{i=1}^n \frac{\Delta}{1+x_i^2} }\\
\uncover<35->{ \downarrow  &&\downarrow&&\downarrow}\\
}
\uncover<35->{ \alert<39,40>{\int_{0}^{\uncover<37->{\alert<37>{\infty}} \uncover<35,36>{N}} \frac{\diff x}{1+x^2}} & \uncover<1-38>{<} \uncover<39->{\alert<39,40>{=}}& \alert<39,40>{  \lim\limits_{\Delta\uncover<37->{, \alert<37>{N} }\uncover<39->{, \alert<39>{\varepsilon}}} \sum| Q_{i-1} Q_i|} \uncover<1-39>{ &\uncover<1-38>{<} \uncover<39->{\alert<39>{=}}& \uncover<1-38>{(1 + \varepsilon )} \int_0^{\uncover<37->{\alert<37>{\infty}} \uncover<35,36>{ N}} \frac{ \diff x}{1+x^2}}}
\end{array}
$
}

\only<1-39>{
\uncover<35->{Let $\Delta\to 0$.} \uncover<36->{Next take $\alert<36,37>{N\to \infty}$.} \uncover<38->{Finally take \alert<38,39>{$\varepsilon\to 0$}\uncover<39->{, use squeeze thm.}}
}

\uncover<41->{
The points $Q_1, Q_2, \dots$ see the segment $OA$ from an angle of $\frac{\pi}{2}$. }\uncover<42->{Therefore, by Euclidean geometry, the points $Q_1, Q_2,\dots $ lie on the circle $C$ with radius $\frac{1}{2}$ and center $(0,\frac{1}{2}) $. } \uncover<43->{Therefore $ \sum |Q_{i-1}Q_{i}| $ approximates half of the circumference of the circle $C$.}
\uncover<44->{\alert<44,45>{By symmetry,}
\uncover<46->{
\[
\alert<47>{\int_{-\infty}^{\infty} \frac{\diff x}{1+x^2} }= \text{ circumference of }C  \uncover<47->{=2\pi \left(\frac{1}{2}\right) \alert<47>{=\pi},}
\]
\uncover<47,48->{as desired.}
}
}
\end{frame}
%\end{comment}
\begin{comment}
\begin{frame}[t]
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-3.1, -0.1)(3.1,1.2)
\psframe*[linecolor=white](-3.1,-0.1)(3.1,1.2)
\tiny
%\psline[linecolor=red!1](0,1.2)(0.001,1.2) %bounding boxes don't always work right
%\pscustom*[linecolor=\fcColorAreaUnderGraph]{
%Function formula: \frac{1}{x^{2}+1}
%\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-3.000000}{3.000000}{1.0000000 1.0000000 x 2.0000000 exp add div }
%\psline(3.000000, 0)(-3.000000, 0)
%}

%Function formula: \frac{1}{x^{2}+1}
%\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-3.000000} {3.000000} {1.0000000 1.0000000 x 2.0000000 exp add div }

\psaxes[arrows=<->, ticks=none, labels=none](0,0)(-3.05,-0.1)(3.05,1.1)
%Function formula: - (- x^{2}+1)^{1/2}
%\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-1}{1}{1 x 2 exp -1 mul add 0.5 exp -1 mul }
%Function formula: (- x^{2}+1)^{1/2}
\psplot[linecolor=blue, plotpoints=1000]{-1}{1}{1 x 2 exp -1 mul add 0.5 exp}
\psline(-3,1)(3,1)

%Function formula: - (- x^{2}+1/4)^{1/2}+1/2
\psplot[linecolor=red, plotpoints=1000] {-0.5}{0.5}{0.5 0.2500000 x 2 exp -1 mul add 0.5 exp -1 mul add }
%Function formula: (- x^{2}+1/4)^{1/2}+1/2
\psplot[linecolor=red, plotpoints=1000]{-0.5}{0.5}{0.5 0.2500000 x 2 exp -1 mul add 0.5 exp add }


%calculator commands:
%\Delta:=0.5;
%xInv{}{{x}}:=DoubleValue{}x/(1+x^2);
%yInv{}{{x}}:=DoubleValue{} 1/(1+x^2);
%xDir{}{{x}}:=-xInv{}x;
%yDir{}{{x}}:=1-yInv{}x;
%lengthN{}{{x}}:=((xDir{}x)^2+(yDir{}x)^2)^{1/2};
%xDirN{}{{x}}:=0.05 xDir{}x /lengthN{}x ;
%yDirN{}{{x}}:=0.05 yDir{}x/lengthN{}x;
%xT{}{{x}}:=-yDirN{}x;
%yT{}{{x}}:=xDirN{}x;

%inversePoint{}{{x}}:=(xInv{}x,yInv{}x );
%f{}{{x}}:= \psline(DoubleValue{}x,1 )(0,0) \psline inversePoint{}x (0,1)  \psline inversePoint{}x inversePoint{}(x+\Delta) \psline (xInv{}x +xDirN{}x, yInv{}x+yDirN{}x ) (xInv{}x +xDirN{}x+xT{}x, yInv{}x+yDirN{}x +yT{}x)(xInv{}x +xT{}x, yInv{}x +yT{}x);
%f{}(\Delta) f{}(2\Delta)f{}(3\Delta)f{}(4\Delta)f{}(5\Delta)f{}(6\Delta)

\psline(0.5, 1)(0, 0)
\psline(0.4, 0.8)(0, 0)

\psline(1, 1)(0, 0)
\psline(0.4, 0.8)(0.5, 0.5)
\psline[linecolor=red](0.4, 0.8)(0.5, 0.5)
\psline(0.5, 0.5)(0, 0)

\psline(0.5,0)(0.5,0.316228)(1, 0.316228)(1,0)
\psline[linecolor=red](0.5,0 )(0.5,0.316228)


\rput[lb](1, 1.05){$P_2(x_2, 1)$}
\rput[t](0.75,0.95){$\Delta$}

\rput[lb](0.5, 1.05) {  $P_1  (x_1 ,1)$}
\rput[t](3, -0.1){$x$}
\rput[lt](0.520000, 0.4500000){$Q_2$}
\rput[l](0.42000, 0.8){$Q_1$}
\rput[tl](0.05, -0.05){$O$}
\end{pspicture}

We finish with illustration of the integral $\int_{-\infty}^{\infty} \frac{1}{1+x^2}\diff x $. Recall $|Q_1Q_2|\approx \frac{\Delta}{1+x_2^2} $.

\end{frame}
\end{comment}
%end module improper-integral-type1-arctan-geometric-interpretation



}% end lecture

% begin lecture
\lect{Spring 2015}{Lecture 10}{10}{
\section{Sequences}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/finite-sequence.tex
% begin module finite-sequence
\begin{frame}
\begin{example}[A finite sequence]
\[
1, 2, 3, 4, 5
\]
is an example of a finite sequence.  So is
\[
-1, -2, -3, \ldots , -10 000.
\]
\end{example}

\begin{definition}[Finite sequence, Infinite sequence]
A finite sequence is a sequence that ends.  
It is possible to write down all the terms in a finite sequence.  
A sequence that is not finite is called an infinite sequence.  
\end{definition}

\uncover<2->{%
\begin{example}[An infinite sequence]
\[
2, 4, 6, 8, \ldots
\]
is an example of an infinite sequence.  
\end{example}
}%

\end{frame}
% end module finite-sequence



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/notation.tex
% begin module notation
\begin{frame}
\begin{example}[Sequence notation]
Consider the sequence
\[
2, 4, 6, 8, \ldots.
\]
We can express this sequence more compactly using the notation
\[
a_n = 2n,
\]
where $a_n$ denotes the $n$th term.  
\begin{align*}
\text{So} \quad a_1 & = 2\cdot 1 = 2 \\
a_2 & = 2\cdot 2 = 4 \\
a_3 & = 2\cdot 3 = 6 \\
a_4 & = 2\cdot 4 = 8 \\
 & \vdots
\end{align*}
\end{example}

\end{frame}
% end module notation



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/notation-examples.tex
% begin module notation-examples
\begin{frame}
\begin{example}
The sequence 
\[
-1, 1, -1, 1, -1, 1, \ldots
\]
can be written $b_n = (-1)^n$.  
\end{example}

\begin{example}
The sequence 
\[
1,2,4,8,16,\ldots
\]
can be written $c_n = 2^{n-1}$.  
\end{example}

\begin{example}
The sequence 
\[
\frac{1}{2}, -\frac{1}{4},\frac{1}{8},-\frac{1}{16},\ldots
\]
can be written $d_n = -\big( -\frac{1}{2}\big)^n$.  
\end{example}

\end{frame}
% end module notation-examples



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/find-terms.tex
% begin module find-terms
\begin{frame}
\begin{example}[Given a formula, find the terms]
Find the first five terms of each of the following sequences.  
\begin{enumerate}
\item<alert@2-3| handout:alert@0>  $a_n = 3\cdot 2^{-n}$
\[
\uncover<3-| handout:0>{%
\frac{3}{2},\frac{3}{4},\frac{3}{8},\frac{3}{16},\frac{3}{32},\ldots
}%
\]
\item<alert@4-5| handout:alert@0>  $b_n = 1$
\[
\uncover<5-| handout:0>{%
1,1,1,1,1,\ldots
}%
\]
\item<alert@6-7| handout:alert@0>  $c_n = -3(n-1)+5$
\[
\uncover<7-| handout:0>{%
5,2,-1,-4,-7,\ldots
}%
\]
\item<alert@8-9| handout:alert@0>  $d_n = n^2+1$
\[
\uncover<9-| handout:0>{%
2,5,10,17,26,\ldots
}%
\]
\end{enumerate}
\end{example}

\end{frame}
% end module find-terms



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/find-formula.tex
% begin module find-formula
\begin{frame}
\begin{example}[Given the terms, find a formula]
Find a formula for the $n$th term of each of the following sequences.  
\begin{enumerate}
\item<alert@2-3>  $a_n = \uncover<3-| handout:0>{2\cdot \big(\frac{1}{4}\big)^{n-1}}$
\[
2, \frac{1}{2},\frac{1}{8},\frac{1}{32},\frac{1}{128},\ldots
\]
\item<alert@4-5>  $b_n = \uncover<5-| handout:0>{(-1)^nn^2}$
\[
-1,4,-9,16,-25,\ldots
\]
\item<alert@6-7>  $c_n = \uncover<7-| handout:0>{-1+6(n-1)}$
\[
-1,5,11,17,23,\ldots
\]
\end{enumerate}
\end{example}

\end{frame}
% end module find-formula



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/arithmetic-def.tex
% begin module arithmetic-def
\begin{frame}
\begin{definition}[Arithmetic sequence]
An arithmetic sequence is one in which successive terms differ by a constant number.  
This constant is called the difference of the arithmetic sequence.  
\end{definition}

\begin{example}[Which are arithmetic?]
\begin{tabular}{rrrrrcl}
$ 1,$ & $ 2,$ & $ 3,$ & $ 4,$ & $ 5,$ & $\ldots$ & is arithmetic with difference $1$. \\
$23,$ & $16,$ & $ 9,$ & $ 2,$ & $-5,$ & $\ldots$ & is arithmetic with difference $-7$. \\
$ 8,$ & $ 9,$ & $12,$ & $17,$ & $24,$ & $\ldots$ & is not arithmetic. \\
& & & & & & ($9-8=1$ but $12-9=3$.)
\end{tabular}
\end{example}
\end{frame}
% end module arithmetic-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/arithmetic-ex.tex
% begin module arithmetic-ex
\begin{frame}
\begin{example}[Which are arithmetic?]
{\renewcommand{\arraystretch}{1.2}
\begin{tabular}{l|c|c|c|c}
Sequence & \alert<handout:0| 2-3,8-9,16-17>{Arithmetic?} & \alert<handout:0| 10-11,18-19>{Difference} & \alert<handout:0| 4-5,12-13,20-21>{First term} & \alert<handout:0| 6-7,14-15,22-23>{$n$th term} \\
\hline
\alert<handout:0| 2-7>{$1,-1,1,-1,\ldots$} & \uncover<3-| handout:0>{\alert<handout:0| 3>{no}} & \uncover<3-| handout:0>{\alert<handout:0| 3>{---}} & \uncover<5-| handout:0>{\alert<handout:0| 5>{$1$}} & \uncover<7-| handout:0>{\alert<handout:0| 7>{$(-1)^{n+1}$}} \\
\hline
\alert<handout:0| 8-15>{$\frac{1}{6},\frac{1}{2},\frac{5}{6},\frac{7}{6},\frac{3}{2},\ldots$} & \uncover<9-| handout:0>{\alert<handout:0| 9>{yes}} & \uncover<11-| handout:0>{\alert<handout:0| 11>{$\frac{1}{3}$}} & \uncover<13-| handout:0>{\alert<handout:0| 13>{$\frac{1}{6}$}} & \uncover<15-| handout:0>{\alert<handout:0| 15>{$\frac{1}{6}+\frac{1}{3}(n-1)$}} \\
\hline
\alert<handout:0| 16-23>{$2,2,2,2,\ldots$} & \uncover<17-| handout:0>{\alert<handout:0| 17>{yes}} & \uncover<19-| handout:0>{\alert<handout:0| 19>{$0$}} & \uncover<21-| handout:0>{\alert<handout:0| 21>{$2$}} & \uncover<23-| handout:0>{\alert<handout:0| 23>{$2\uncover<24->{\alert<handout:0| 24>{+0(n-1)}}$}} 
\end{tabular}
}%
\end{example}
\uncover<24->{%
If an arithmetic sequence has difference $d$, then the $n$th term has formula 
\[
a_n = a_1 + d(n-1),
\]
where $a_1$ is the first term.  
}%
\end{frame}
% end module arithmetic-ex



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/geometric-def.tex
% begin module geometric-def
\begin{frame}
\begin{definition}[Geometric sequence]
A geometric sequence is one in which each term is obtained by multiplying the previous one by the same constant.  
This constant is called the ratio of the geometric sequence.  
\end{definition}

\begin{example}[Which are geometric?]
\begin{tabular}{rrrrrcl}
$  2,$ & $  4,$ & $  8,$ & $ 16,$ & $ 32,$ & $\ldots$ & is geometric with ratio $2$. \\
$  1,$ & $ -3,$ & $  9,$ & $-27,$ & $ 81,$ & $\ldots$ & is geometric with ratio $-3$. \\
$-42,$ & $-14,$ & $-21,$ & $ 31,$ & $-22,$ & $\ldots$ & is not geometric. \\
& & & & & & ($\frac{-14}{-42} = \frac{1}{3}$ but $\frac{-21}{-14} = \frac{3}{2}$.)
\end{tabular}
\end{example}
\end{frame}
% end module geometric-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/geometric-ex.tex
% begin module geometric-ex
\begin{frame}
\begin{example}[Arithmetic and geometric]
{\renewcommand{\arraystretch}{1.2}
\begin{tabular}{l|c|c|c|c|c}
& \alert<handout:0| 2-3,10-11,18-19,28-29,36-37>{Arithmetic/} &  &  &  & \\
Sequence & \alert<handout:0| 2-3,10-11,18-19,28-29,36-37>{geometric} & \alert<handout:0| 12-13,20-21>{Diff.} & \alert<handout:0| 4-5,22-23,30-31>{Ratio} & \alert<handout:0| 6-7,14-15,24-25,32-33,38-39>{$a_1$} & \alert<handout:0| 8-9,16-17,26-27,34-35,40-41>{$a_n$} \\
\hline
\alert<handout:0| 2-9>{$\frac{2}{3},\frac{4}{9},\frac{8}{27},\frac{16}{81},\ldots$} & \uncover<3-| handout:0>{\alert<handout:0| 3>{geometric}} & \uncover<3-| handout:0>{\alert<handout:0| 3>{---}} & \uncover<5-| handout:0>{\alert<5| handout:0>{$\frac{2}{3}$}} & \uncover<7-| handout:0>{\alert<handout:0| 7>{$\frac{2}{3}$}} & \uncover<9-| handout:0>{\alert<handout:0| 9>{$\big(\frac{2}{3}\big)^{n}\uncover<handout:0| 42->{\alert<handout:0| 42>{ = \frac{2}{3}\big(\frac{2}{3}\big)^{n-1}}}$}} \\
\hline
\alert<handout:0| 10-17>{$7,3,-1,-5,\ldots$} & \uncover<11-| handout:0>{\alert<handout:0| 11>{arithmetic}} & \uncover<13-| handout:0>{\alert<handout:0| 13>{$-4$}} & \uncover<11-| handout:0>{\alert<11| handout:0>{---}} & \uncover<15-| handout:0>{\alert<handout:0| 15>{$7$}} & \uncover<17-| handout:0>{\alert<handout:0| 17>{$7-4(n-1)$}} \\
\hline
\alert<handout:0| 18-27>{$4,4,4,4,\ldots$} & \uncover<19-| handout:0>{\alert<handout:0| 19>{both}} & \uncover<21-| handout:0>{\alert<handout:0| 21>{$0$}} & \uncover<23-| handout:0>{\alert<23| handout:0>{$1$}} & \uncover<25-| handout:0>{\alert<handout:0| 25>{$4$}} & \uncover<27-| handout:0>{\alert<handout:0| 27>{$4\uncover<handout:0| 42->{\alert<handout:0| 42>{ = 4(1)^{n-1}}}$}} \\
\hline
\alert<handout:0| 28-35>{$\pi,-\pi^2,\pi^3,-\pi^4,\ldots$} & \uncover<29-| handout:0>{\alert<handout:0| 29>{geometric}} & \uncover<29-| handout:0>{\alert<handout:0| 29>{---}} & \uncover<31-| handout:0>{\alert<31| handout:0>{$-\pi$}} & \uncover<33-| handout:0>{\alert<handout:0| 33>{$\pi$}} & \uncover<35-| handout:0>{\alert<handout:0| 35>{$\pi(-\pi)^{n-1}$}} \\
\hline
\alert<handout:0| 36-41>{$1,1,2,2,3,3,\ldots$} & \uncover<37-| handout:0>{\alert<handout:0| 37>{neither}} & \uncover<37-| handout:0>{\alert<handout:0| 37>{---}} & \uncover<37-| handout:0>{\alert<37| handout:0>{---}} & \uncover<39-| handout:0>{\alert<handout:0| 39>{$1$}} & \uncover<41-| handout:0>{\alert<handout:0| 41>{$\lceil\frac{n}{2}\rceil$}} \\
\end{tabular}
}%
\end{example}

\uncover<42->{%
If a geometric sequence has ratio $r$, then the $n$th term has formula 
\[
a_n = a_1r^{n-1}.
\]
where $a_1$ is the first term.  
}%
\end{frame}
% end module geometric-ex



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-def.tex
% begin module sequence-def
\begin{frame}
\frametitle{Sequences}
\begin{definition}[Sequence]
A sequence is a list of numbers written in a definite order:
\[
a_1, a_2, a_3, a_4, \ldots , a_n , \ldots
\]

The number $a_1$ is called the first term, $a_2$ is called the second term, and in general $a_n$ is the $n$th term.

We will always deal with infinite sequences, in which each term $a_n$ has a successor $a_{n+1}$.
\end{definition}

Notation:

The sequence $\{ a_1, a_2, a_3, \ldots \}$ can also be written
\[
\{ a_n\} \qquad \textrm{ or }\qquad \{ a_n\}_{n = 1}^\infty
\]
\end{frame}
% end module sequence-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-def-example.tex
% begin module sequence-def-example
\begin{frame}
\begin{example}[A sequence]
\[
1, 2, 3, 4, 5, \ldots
\]
is an example of a sequence.  
\end{example}

\uncover<2->{%
\begin{definition}[Sequence, Terms]
A sequence is a list of numbers written in a definite order.  
The individual numbers in the sequence are called the terms of the sequence.  
\end{definition}
}%

\uncover<3->{%
\begin{example}[More sequences]
\begin{tabular}{rrrrrrcl}
$ 1,$ & $ 2,$ & $ 4,$ & $ 8,$ & $16,$ & $32,$ & $\ldots$ & is a sequence.  \\
$-1,$ & $ 1,$ & $-1,$ & $ 1,$ & $-1,$ & $ 1,$ & $\ldots$ & is a sequence.  \\
\uncover<4->{ $ 1,$ & $-1,$ & $ 1,$ & $-1,$ & $ 1,$ & $-1,$ & $\ldots$ & is a different sequence. }
\end{tabular}
\end{example}
}%

\end{frame}
% end module sequence-def-example



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-ex1.tex
% begin module sequence-ex1
\begin{frame}
Some sequences can by defined by giving a formula for the $n$th term $a_n$.  This example expresses four different sequences in three different ways: first, by using the preceding notation; second, by giving a formula; and third, by writing out the terms of the sequence.
\begin{example}
\[
\begin{array}{lll}
\left\{ \frac{n}{n+1}\right\} &%
a_n = \frac{n}{n+1} &%
\left\{ \frac{1}{2}, \frac{2}{3}, \frac{3}{4}, \frac{4}{5}, \ldots \right\}\\%
&&\\%
\left\{ \frac{(-1)^n(n+1)}{3^n}\right\} &%
a_n = \frac{(-1)^n(n+1)}{3^n} &%
\left\{ \frac{-2}{3}, \frac{3}{9}, \frac{-4}{27}, \frac{5}{81}, \ldots \right\}\\%
&&\\%
\left\{ \sqrt{n-3}\right\}_{n=3}^\infty &%
a_n = \sqrt{n-3}, n\geq 3&%
\left\{ 0, 1, \sqrt{2}, \sqrt{3}, \ldots \right\}\\%
&&\\%
\left\{ \cos \frac{n\pi}{6}\right\}_{n=0}^\infty &%
a_n = \cos \frac{n\pi}{6}, n\geq 0&%
\left\{ 1, \frac{\sqrt{3}}{2}, \frac{1}{2}, 0, \ldots \right\}\\%
\end{array}
\]
\end{example}
\end{frame}
% end module sequence-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-find-formula-ex.tex
% begin module sequence-find-formula-ex
\begin{frame}
\begin{example}
Find a formula for the general term $a_n$ of the sequence
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
\left\{ %
0,%
 \frac{1}{4},%
-\frac{2}{8},%
 \frac{3}{16},%
-\frac{4}{32},%
 \frac{5}{64},%
\ldots
\right\}%
\]
\uncover<2->{%
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
a_{\alert<handout:0| 4,13>{1}} = \alert<handout:0| 3-4,12-13,20>{0},%
\  a_{\alert<handout:0| 5,14>{2}} =  \frac{\alert<handout:0| 3,5>{1}}{\alert<handout:0| 12,14>{4}},%
\  a_{\alert<handout:0| 6,15>{3}} = \alert<handout:0| 20>{-}\frac{\alert<handout:0| 3,6>{2}}{\alert<handout:0| 12,15>{8}},%
\  a_{\alert<handout:0| 7,16>{4}} =  \frac{\alert<handout:0| 3,7>{3}}{\alert<handout:0| 12,16>{16}},%
\  a_{\alert<handout:0| 8,17>{5}} = \alert<handout:0| 20>{-}\frac{\alert<handout:0| 3,8>{4}}{\alert<handout:0| 12,17>{32}},%
\  a_{\alert<handout:0| 9,18>{6}} =  \frac{\alert<handout:0| 3,9>{5}}{\alert<handout:0| 12,18>{64}},%
\]
}%
\begin{itemize}
\item<3->  The numerators start at $0$ and go up by one with each term.
\item<4-| alert@4-11>  The $n$th term has numerator \uncover<11->{$n-1$.}
\item<12->  The denominators start at $2$ and double with each term.
\item<13-| alert@13-19>  The $n$th term has denominator \uncover<19->{$2^n$.}
\item<20->  The signs of the terms alternate between positive and negative.
\item<21->  We take this into account by multiplying by $(-1)^n$.
\end{itemize}
\abovedisplayskip=2pt
\belowdisplayskip=0pt
\[
\uncover<22->{a_n =} %
\uncover<21->{\alert<handout:0| 21>{(-1)^n}}%
\only<handout:0| -18>{{\uncover<11->{\alert<handout:0| 11>{n-1}} \atop \invisible<1->{2^n}}}%
\only<19->{{n-1 \over \alert<handout:0| 19>{2^n}}}%
\]
\vspace{-.1in}
\end{example}
\end{frame}
% end module sequence-find-formula-ex



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-ex2.tex
% begin module sequence-ex2
\begin{frame}
Not all sequences can be represented by a simple formula.
\begin{example}[Sequences without a simple formula]
\begin{enumerate}
\item  Consider the sequence $( p_n)$, where $p_n$ is the population of the world as of January 1 of year $n$.  This has no simple formula.
\item<2->  Let $a_n$ be the $n^{th}$ digit of the number $e$.  The first few terms of $( a_n)$:
\uncover<2->{%
\begin{center}
$ 7, 1, 8, 2, 8, 1, 8, 2, 8, 4, 5, \ldots $ 
\end{center} 
}%
\item<3->  The Fibonacci sequence $( f_n)$ is defined recursively by
\[
f_1 = 1 \qquad f_2 = 1 \qquad f_n = f_{n-1} + f_{n-2}, \quad n\geq 3
\]
\uncover<4->{%
The first few terms are
\abovedisplayskip=1pt
\belowdisplayskip=1pt
\[
\alert<handout:0| 4-5>{1},%
\alert<handout:0| 4-7>{1},%
\uncover<5-| handout:0>{\alert<handout:0| 5-9>{{2},}}%
\uncover<7-| handout:0>{\alert<handout:0| 7-11>{{3},}}%
\uncover<9-| handout:0>{\alert<handout:0| 9-13>{{5},}}%
\uncover<11-| handout:0>{\alert<handout:0| 11-13>{{8},}}%
\uncover<13-| handout:0>{\alert<handout:0| 13>{{13},\ldots }}%
\]
}%
\uncover<14->{%
The Fibonacci sequence can be described by a formula, but not a simple one $\left(\displaystyle a_n=\frac{\sqrt{5}}{5}\left( \left(\frac{1+\sqrt{5 }}{2} \right)^n- \left(\frac{1-\sqrt{5}}{2}\right)^n\right) \right)$.%
}%
\end{enumerate}
\end{example}
\end{frame}
% end module sequence-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-plotting.tex
% begin module sequence-plotting
\begin{frame}
\psset{xunit=0.75cm, yunit=0.75cm}
\begin{pspicture}(-0.5, -0.5)(15, 1.4)
\tiny
\fcAxesStandard{-0.5}{-0.5}{15.2}{1.4}
\fcYTickWithLabel{1}{$1$}
\rput[tl](15.2, -0.1){$n$}
\rput[rb]( -0.1, 1.45){$a$}
\multido{\na=1+1}{9}{%
\FPeval{\naPlusOne}{clip(\na+1)}%
\FPeval{\naPlusTwo}{clip(\na+2)}%
\only<\naPlusOne->{%
\pstVerb{1 dict begin /na \na\space def}%
\fcXTickWithLabel{na}{$\na$}%
}%
\only<\naPlusOne>{%
\rput[l](! na 0.1 add na na 1 add div 2 div ){ $a_{\na}=\frac{\na}{\naPlusOne}$}%
\psline(! na 0)(! na na na 1 add div)%
\fcFullDot[linecolor=red]{na}{na na 1 add div}%
}%
\only<\naPlusTwo->{%
\fcFullDot[linecolor=black]{na}{na na 1 add div}
}%
\only<\naPlusOne->{%
\pstVerb{end}%
}%
}%
\uncover<11->{%
\multido{\na=10+1}{6}{%
\pstVerb{1 dict begin /na \na\space def}%
\fcXTickWithLabel{na}{$\na$}%
\fcFullDot[linecolor=black]{na}{na na 1 add div}%
\pstVerb{end}%
}%
\psline[linestyle=dashed, linewidth = 0.4pt, linecolor=blue](0,1)(15,1)%
}%
\end{pspicture}



\psset{xunit=6cm, yunit=6cm}
\begin{pspicture}(-0.05, -0.2)(1.05, 0.2)
\tiny
\fcBoundingBox{-0.05}{-0.2}{1.05}{0.2}
\psline(-0.05,0)(1.05,0)%
\rput[t](0,-0.03){$0$}
\psline(0,-0.02)(0, 0.02)
\rput[t](1,-0.03){$1$}
\psline(1,-0.02)(1, 0.02)
\uncover<2->{
\rput[t](! 1 2 div -0.03){$a_1$}
\psline(! 1 2 div -0.02)(! 1 2 div 0.02)
}
\uncover<3->{
\rput[t](! 2 3 div -0.03){$a_2$}
\psline(! 2 3 div -0.02)(! 2 3 div 0.02)
}
\uncover<4->{
\rput[t](! 3 4 div -0.03){$a_3$}
\psline(! 3 4 div -0.02)(! 3 4 div 0.02)
}
\multido{\na=5+1}{6}{%
\FPeval{\naMinusOne}{clip(\na-1)}%
\only<\na->{%
\psline(!\na\space 1 sub \na\space div -0.02)(!\na\space 1 sub \na\space div 0.02)%
}%
\only<\na>{%
\rput[t](!\na\space 1 sub \na\space div -0.03){$a_{\naMinusOne}$}%
}%
}%
\uncover<11->{%
\multido{\na=11+1}{25}{%
\psline(!\na\space 1 sub \na\space div -0.02)(!\na\space 1 sub \na\space div 0.02)%
}%
\psline*(! 35 36 div -0.02 )(! 1 -0.02 )(! 1 0.02 )(! 35 36 div 0.02 )(! 35 36 div -0.02 )
}
\end{pspicture}



\begin{itemize}
\item  The sequence $\left\{ \frac{n}{n+1}\right\}$ can be plotted on a number line or using Cartesian coordinates.
\item<12->  From the pictures, the terms in the sequence appear to approach $1$ as $n$ gets larger.
\item<13->  \alert<handout:0| 13-14>{$1 - \frac{n}{n+1} =$ \uncover<14->{$\frac{1}{n+1}$.}}
\item<15->  This can be made arbitrarily small by choosing $n$ large enough.
\item<16->  We express this by writing $\lim\limits_{n\to\infty}\frac{n}{n+1} = 1$.
\end{itemize}
\end{frame}
% end module sequence-plotting



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-limit-def.tex
% begin module sequence-limit-def
\begin{frame}
\begin{definition}[Limit of a Sequence]
A sequence $\{ a_n\}$ has the limit $L$, and we write
\[
\lim_{n\to\infty}a_n = L \qquad \textrm{or}\qquad a_n\to L \ \textrm{as} \ n\to \infty
\]
if we can make $a_n$ as close to $L$ as we like by taking $n$ large enough.
\end{definition}
\begin{definition}[Convergent]
A sequence that has a limit is called convergent. A sequence that has no limit is called divergent.
\end{definition}

\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=0.6cm,yunit=0.6cm}
\begin{pspicture}(-0.5, -0.5)(5, 3)
\tiny
\fcAxesStandard{-0.5}{-0.5}{7}{3}
\rput[b](0,3.1){$a$}
\rput[l](7.1,0){$n$}
\multido{\na=0+1}{36}{%
\pstVerb{2 dict begin /na \na\space def /t na 0.2 mul def}%
\fcFullDot[scale=0.5, linecolor=red]{t }{t t mul 4 mul t 6 mul add t t mul 4 mul 1 add div }
\pstVerb{end}%
}%
\psline[linewidth =0.4pt, linestyle=dashed, linecolor=blue](0, 1)(7, 1)
\rput[r](-0.1, 1){$L$}
\end{pspicture}

\column{.5\textwidth}
\psset{xunit=0.3cm,yunit=0.3cm}
\begin{pspicture}(-1, -1)(5, 3)
\tiny
\fcAxesStandard{-1}{-1}{14}{6}
\rput[b](0,6.2){$a$}
\rput[l](14.2, 0){$n$}
\multido{\na=0+1}{36}{%
\pstVerb{2 dict begin /na \na\space def /t na 0.4 mul def}%
\fcFullDot[scale=0.5, linecolor=red]{t }{t t mul 3 mul t 4 mul add t t mul 3 mul 1 add div t 90 mul sin 3 mul t 1 add div add }%
\pstVerb{end}%
}%
\psline[linewidth =0.4pt, linestyle=dashed, linecolor=blue](0, 1)(14, 1)
\rput[r](-0.1, 1){$L$}
\end{pspicture}

\end{columns}
\end{frame}
% end module sequence-limit-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-limit-function.tex
% begin module sequence-limit-function
\begin{frame}
If you compare the definition of the limit of a sequence with the definition of the infinite limit of a function, you'll see that the only difference between
\[
\lim_{n\to\infty} a_n = L \qquad \textrm{and} \qquad \lim_{x\to\infty}f(x) = L
\]
is that $n$ is required to be an integer.
\begin{center}
\ \only<handout:0| -1>{%
\includegraphics[width=6cm]{sequences/pictures/12-01-functionsequencea.pdf}%
}%
\only<2->{%
\includegraphics[width=6cm]{sequences/pictures/12-01-functionsequenceb.pdf}%
}%
\uncover<3->{%
\begin{theorem}
If $\lim_{x\to\infty}f(x) = L$ and $f(n) = a_n$ for all integers $n$, then $\lim_{n\to\infty} a_n = L$.
\end{theorem}
}%
\end{center}
\end{frame}
% end module sequence-limit-function



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-ex4.tex
% begin module sequence-ex4
\begin{frame}
\begin{example} %[Example 4, p. 715]
Find $\lim_{n\to\infty} \frac{n}{n+1}$.

\uncover<2->{%
Divide numerator and denominator by \alert<handout:0| 3>{the highest power of $n$}, and use the limit laws:
}%
\begin{eqnarray*}
\uncover<2->{%
\lim_{n\to\infty} \frac{n}{\alert<handout:0| 3>{n}+1}\uncover<3->{\cdot \alert<handout:0| 3>{\frac{\frac{1}{n}}{\frac{1}{n}}}}%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\lim_{n\to\infty} \frac{1}{1+\frac{1}{n}}%
}\\%
& \uncover<5->{ = } &%
\uncover<5->{%
\frac{\displaystyle \lim_{n\to\infty}1}{\displaystyle \lim_{n\to\infty}1+\displaystyle \lim_{n\to\infty}\frac{1}{n}}%
}\\%
& \uncover<6->{ = } &%
\uncover<6->{%
\frac{1}{1+0}%
}\\%
& \uncover<7->{ = } &%
\uncover<7->{%
1%
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module sequence-ex4



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-limit-infinite.tex
% begin module sequence-limit-infinite
\begin{frame}
Just like for functions, there is a notion of sequences tending to infinity:  If $a_n$ grows large as $n$ becomes large, we write $\lim_{n\to\infty}a_n = \infty$.

\uncover<2->{%
You can probably guess what $\lim_{n\to\infty}a_n = - \infty$ means.%
}%
\end{frame}
% end module sequence-limit-infinite



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-limit-laws.tex
% begin module sequence-limit-laws
\begin{frame}
The Limit Laws from section 2.3 also hold for sequences:

If $\{ a_n\}$ and $\{ b_n\}$ are convergent sequences and $c$ is a constant, then
\begin{enumerate}
\item  $\displaystyle \lim_{n\to\infty}(a_n+b_n) = \lim_{n\to\infty}a_n +\lim_{n\to\infty}b_n$
\item  $\displaystyle \lim_{n\to\infty}(a_n-b_n) = \lim_{n\to\infty}a_n -\lim_{n\to\infty}b_n$
\item  $\displaystyle \lim_{n\to\infty}ca_n = c\lim_{n\to\infty}a_n$
\item  $\displaystyle \lim_{n\to\infty}(a_n b_n) = \lim_{n\to\infty}a_n \cdot \lim_{n\to\infty}b_n$
\item  $\displaystyle \lim_{n\to\infty}\frac{a_n}{ b_n} = \frac{\displaystyle \lim_{n\to\infty}a_n}{\displaystyle  \lim_{n\to\infty}b_n}$ if $\lim_{n\to\infty}b_n\neq 0$
\item  $\displaystyle \lim_{n\to\infty}a_n^p = \left[ \lim_{n\to\infty}a_n\right]^p$ if $p > 0$ and $a_n > 0$.
\end{enumerate}
\end{frame}
% end module sequence-limit-laws



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-squeeze-theorem.tex
% begin module sequence-squeeze-theorem
\begin{frame}
The Squeeze Theorem also works for sequences:
\begin{theorem}[The Squeeze Theorem for Sequences]
If $a_n\leq b_n\leq c_n$ for $n \geq n_0$ and $\lim_{n\to\infty} a_n = L = \lim_{n\to\infty}c_n$, then $\lim_{n\to\infty}b_n=L$.
\end{theorem}
\begin{center}
\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-0.5,-0.5)(10, 3)
\tiny
\fcAxesStandard{-0.5}{-0.5}{7}{3}
\rput[b](0,3.1){$a$}
\rput[l](7.1,0){$n$}
\multido{\na=1+1}{35}{%
\pstVerb{2 dict begin /na \na\space def /t na 0.2 mul def}%
\fcFullDot[scale=0.6, linecolor=red]{t }{1 t 1 add div 1 add}
\fcFullDot[scale=0.6, linecolor=black]{t }{1 t 1 add div t 180 mul sin mul 1 add}
\fcFullDot[scale=0.6, linecolor=blue]{t }{-1 t 1 add div 1 add}
\pstVerb{end}%
}%
\psline[linewidth =0.4pt, linestyle=dotted, linecolor=blue](0, 1)(7, 1)
\rput[r](-0.1, 1){$L$}
\rput[b](0.2, 2){\color{red}$c_n$}
\rput[t](0.2, 1.4){\color{black}$b_n$}
\rput[b](0.2, 0.4){\color{blue}$c_n$}
\end{pspicture}
%\includegraphics[width=8cm]{sequences/pictures/12-01-squeeze.pdf}%
\end{center}
\uncover<2->{%
%Here is a corollary to the Squeeze Theorem for sequences:
\begin{corollary}
If $\lim_{n\to\infty} |a_n| = 0$, then $\lim_{n\to\infty}a_n = 0$.
\end{corollary}
}%
\end{frame}
% end module sequence-squeeze-theorem



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-ex5.tex
% begin module sequence-ex5
\begin{frame}
\begin{example} %[Example 5, p. 715]
Calculate $\lim_{n\to\infty} \frac{\ln n}{n}$.
\begin{itemize}
\item<2->  Both $\ln n$ and $n$ go to $\infty$ as $n$ gets bigger.
\item<3->  We can't use L'Hospital's Rule directly, because L'Hospital's Rule is for functions.
\item<4->  Define $f(x) = \frac{\ln x}{x}$.  Now \alert<handout:0| 5-8>{use L'Hospital's Rule}:
\end{itemize}
\[
\uncover<4->{%
\lim_{x\to\infty}\frac{\alert<handout:0| 5-6>{\ln x}}{\alert<handout:0| 7-8>{x}}%
}%
\uncover<4->{%
 = \lim_{x\to\infty}\frac{\uncover<6->{\alert<handout:0| 6>{1/x}}}{\uncover<8->{\alert<handout:0| 8>{1}}}%
}%
\uncover<9->{%
 = 0%
}%
\]
\begin{itemize}
\item<10->  Therefore
\end{itemize}
\[
\uncover<10->{%
\lim_{n\to\infty}\frac{\ln n}{n} = \lim_{x\to\infty}f(x) = 0
}%
\]
\end{example}
\end{frame}
% end module sequence-ex5



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-ex6.tex
% begin module sequence-ex6
\begin{frame}
\begin{example} %[Example 6, p. 715]
Is the sequence $a_n = (-1)^n$ convergent or divergent?
\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=0.6cm, yunit=0.6cm}
\begin{pspicture}(-0.5,-1.3)(9.5, 1.8)
\fcBoundingBox{-0.8}{-1.3}{9.5}{1.8}
\tiny
\psaxes[arrows=<->, Dx=1, Dy=1](0,0)(-0.8,-1.5)(9, 1.5)
\rput[b](0, 1.6){$a$}
\rput[l](9.1, 0){$n$}
\uncover<2->{
\fcFullDot[linecolor=red, scale=0.6]{1}{-1}
\fcFullDot[linecolor=red, scale=0.6]{2}{1}
\fcFullDot[linecolor=red, scale=0.6]{3}{-1}
\fcFullDot[linecolor=red, scale=0.6]{4}{1}
\fcFullDot[linecolor=red, scale=0.6]{5}{-1}
\fcFullDot[linecolor=red, scale=0.6]{6}{1}
\fcFullDot[linecolor=red, scale=0.6]{7}{-1}
\fcFullDot[linecolor=red, scale=0.6]{8}{1}
\fcFullDot[linecolor=red, scale=0.6]{9}{-1}
}
\end{pspicture}

\column{.5\textwidth}
\begin{itemize}
\item<2->  The terms oscillate between $-1$ and $1$ infinitely many times.
\item<3->  Therefore the sequence doesn't approach any number.
\item<4->  $\{ a_n\}$ is divergent.
\end{itemize}
\end{columns}
\end{example}
\end{frame}
% end module sequence-ex6



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-ex7.tex
% begin module sequence-ex7
\begin{frame}
\begin{example}[Example 7, p. 716]
Is $a_n = \frac{(-1)^n}{n}$ convergent or divergent?
\begin{columns}[c]
\column{.5\textwidth}
\ \only<handout:0| -4>{%
\includegraphics[height=4cm]{sequences/pictures/12-01-ex7a.pdf}%
}%
\only<5->{%
\includegraphics[height=4cm]{sequences/pictures/12-01-ex7b.pdf}%
}%
\column{.5\textwidth}
\[
\uncover<2->{%
\lim_{n\to\infty}\left| \frac{(-1)^n}{n}\right| = %
}%
\uncover<3->{%
\lim_{n\to\infty} \frac{1}{n} = %
}%
\uncover<4->{%
0%
}%
\]
\uncover<5->{%
Therefore, by the corollary to the Squeeze Theorem,
\[
\lim_{n\to\infty}\frac{(-1)^n}{n} = 0%
\]
}%
\uncover<6->{%
Therefore $\left\{ \frac{(-1)^n}{n} \right\}$ is convergent.
}%
\end{columns}
\end{example}
\end{frame}
% end module sequence-ex7



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-function-composition.tex
% begin module sequence-function-composition
\begin{frame}
\begin{theorem}
If $\lim_{n\to\infty} a_n = L$ and the function $f$ is continuous at $L$, then
\[
\lim_{n\to\infty} f(a_n) = f(L)
\]
\end{theorem}
\end{frame}
% end module sequence-function-composition



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-function-composition-ex8.tex
% begin module sequence-function-composition-ex8
\begin{frame}
\begin{example}[Example 8, p. 716]
\begin{columns}[c]
\column{.5\textwidth}
Find $\lim_{n\to\infty}\sin (\pi /n)$.

\uncover<2->{%
Sine is continuous at $0$.
}%
\begin{eqnarray*}
&&%
\uncover<1->{%
\lim_{n\to\infty}\sin (\pi /n)%
}\\%
& \uncover<2->{ = }&%
\uncover<2->{%
\sin\left( \alert<handout:0| 3-4>{\lim_{n\to\infty} (\pi /n)}\right)%
}\\%
& \uncover<3->{ = }&%
\uncover<3->{%
\sin \uncover<4->{\alert<handout:0| 4>{0}}%
}\\%
& \uncover<5->{ = }&%
\uncover<5->{%
0%
}\\%
\end{eqnarray*}

\column{.5\textwidth}
Find $\lim_{n\to\infty}\cos (\pi /n)$.

\uncover<6->{%
Cosine is continuous at $0$.
}%
\begin{eqnarray*}
&&%
\uncover<1->{%
\lim_{n\to\infty}\cos (\pi /n)%
}\\%
& \uncover<6->{ = }&%
\uncover<6->{%
\cos\left( \alert<handout:0| 7-8>{\lim_{n\to\infty} (\pi /n)}\right)%
}\\%
& \uncover<7->{ = }&%
\uncover<7->{%
\cos \uncover<8->{\alert<handout:0| 8>{0}}%
}\\%
& \uncover<9->{ = }&%
\uncover<9->{%
1%
}\\%
\end{eqnarray*}
\end{columns}
\end{example}
\end{frame}
% end module sequence-function-composition-ex8



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-ex9.tex
% begin module sequence-ex9
\begin{frame}
\begin{example}[Example 9, p. 716]
Discuss the convergence of the sequence $a_n = \frac{n!}{n^n}$, where $n! = 1\cdot 2 \cdot 3 \cdot \cdots \cdot n$.
\begin{itemize}
\item<2->  Both the top and the bottom go to infinity as $n \to\infty$.
\item<3->  We can't use L'Hospital's Rule, because we have no function corresponding to $n!$ ($x!$ isn't defined if $x$ isn't an integer).
%\item<4->  Look at the first few terms to find a pattern:
\end{itemize}
\uncover<4->{%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
a_1 = 1 \qquad a_2 = \frac{1\cdot 2}{2\cdot 2} \qquad a_3 = \frac{1\cdot 2\cdot 3}{3\cdot 3\cdot 3}%
\]
}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<5->{%
a_n%
}%
& \uncover<5->{ = }&%
\uncover<5->{%
\frac{\alert<handout:0| 6>{1}\cdot 2\cdot 3 \cdot 4 \cdot \cdots \cdot n}{\alert<handout:0| 6>{n}\cdot n\cdot n \cdot n \cdot \cdots \cdot n}%
}\\%
& \uncover<6->{ = }&%
\uncover<6->{%
\alert<handout:0| 6>{\frac{1}{n}}\left(\frac{
\alert<handout:0| 7>{2}\cdot 
\alert<handout:0| 8>{3} \cdot 
\alert<handout:0| 9>{4} \cdot \cdots \cdot 
\alert<handout:0| 10>{n}}{
\alert<handout:0| 7>{n}\cdot 
\alert<handout:0| 8>{n} \cdot 
\alert<handout:0| 9>{n} \cdot \cdots \cdot 
\alert<handout:0| 10>{n}}\right)%
}%
\end{eqnarray*}
\begin{itemize}
\item<7->  %
\uncover<7->{\alert<handout:0| 7>{$\frac{2}{n}\leq 1$},} %
\uncover<8->{\alert<handout:0| 8>{$\frac{3}{n}\leq 1$},} %
\uncover<9->{\alert<handout:0| 9>{$\frac{4}{n}\leq 1$},$\ldots$} %
\uncover<10->{\alert<handout:0| 10>{$\frac{n}{n}\leq 1$}.} \uncover<11->{Therefore $0\leq a_n \leq \frac{1}{n}$.}%
\item<12->  Since $\frac{1}{n}\to 0$ as $n\to \infty$, by the Squeeze Theorem $a_n \to 0$ as $n\to \infty$.
\end{itemize}
\end{example}
\end{frame}
% end module sequence-ex9



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-geometric-ex10.tex
% begin module sequence-geometric-ex10
\begin{frame}
\begin{example}[Example 10, p. 717]
\begin{columns}[c]
\column{.6\textwidth}
For what values of $r$ is the sequence $\{ r^n\}$ convergent?

\uncover<2->{%
Consider the exponential function $y = r^x$.}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<2->{%
\lim_{x\to\infty}r^x = \left\{ \begin{array}{lll}
\uncover<4->{\alert<handout:0| 4>{\infty}} & \alert<handout:0| 3-4>{\textrm{ if }} & \alert<handout:0| 3-4>{r > 1}\\
\uncover<6->{\alert<handout:0| 6>{0}} & \alert<handout:0| 5-6>{\textrm{ if }} & \alert<handout:0| 5-6>{0 < r < 1}\\
\end{array}\right.}%
\]
\uncover<7->{Therefore}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<7->{%
\lim_{n\to\infty}r^n = \left\{ \begin{array}{lll}
\uncover<8->{\alert<handout:0| 8>{\infty}} & \alert<handout:0| 7-8>{\textrm{ if }} & \alert<handout:0| 7-8>{r > 1}\\
\uncover<10->{\alert<handout:0| 10>{0}} & \alert<handout:0| 9-10>{\textrm{ if }} & \alert<handout:0| 9-10>{0 < r < 1}\\
\end{array}\right.}%
\]
\uncover<11->{Also, $\displaystyle \alert<handout:0| 11-12>{\lim_{n\to\infty}1^n = \uncover<12->{1}}$ and $\displaystyle \alert<handout:0| 13-14>{\lim_{n\to\infty}0^n = \uncover<14->{0}}$.}

\uncover<15->{If $-1 < r < 0$, then $0 < |r| < 1$, and
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\lim_{n\to\infty} |r^n| = \lim_{n\to\infty}|r|^n = 0 
\]
Therefore $\displaystyle \lim_{n\to\infty}r^n = 0$.}

\uncover<16->{If $r < -1$, then $r^n$ diverges, just like $(-1)^n$.}
\column{.4\textwidth}
\ \only<handout:0| -7>{%
\includegraphics[height=3.8cm]{sequences/pictures/12-01-ex10a.pdf}%
}%
\only<handout:0| 8-9>{%
\includegraphics[height=3.8cm]{sequences/pictures/12-01-ex10b.pdf}%
}%
\only<handout:0| 10-11>{%
\includegraphics[height=3.8cm]{sequences/pictures/12-01-ex10c.pdf}%
}%
\only<12->{%
\includegraphics[height=3.8cm]{sequences/pictures/12-01-ex10d.pdf}%
}%

\ \only<handout:0| -14>{%
\includegraphics[height=3.8cm]{sequences/pictures/12-01-ex10e.pdf}%
}%
\only<handout:0| 15>{%
\includegraphics[height=3.8cm]{sequences/pictures/12-01-ex10f.pdf}%
}%
\only<16->{%
\includegraphics[height=3.8cm]{sequences/pictures/12-01-ex10g.pdf}%
}%
\end{columns}
\end{example}
\end{frame}
% end module sequence-geometric-ex10



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-geometric-theorem.tex
% begin module sequence-geometric-theorem
\begin{frame}
This theorem summarizes the results of the previous example.
\begin{theorem}[Convergence of Geometric Sequences]
The sequence $\{ r^n\}$ is convergent if $-1 < r \leq 1$ and divergent otherwise.
\[
\lim_{n\to\infty}r^n = \left\{ \begin{array}{lll}
0 & \textrm{ if } & -1 < r < 1\\
1 & \textrm{ if } & r = 1\\
\end{array}\right.
\]
\end{theorem}
\end{frame}
% end module sequence-geometric-theorem



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-monotonic-def.tex
% begin module sequence-monotonic-def
\begin{frame}
\begin{definition}[Increasing and Decreasing]
A sequence $\{ a_n\}$ is called increasing if $a_n < a_{n+1}$ for all $n \geq 1$.  In other words, $\{ a_n\}$ is increasing if $a_1 < a_2 < a_3 < \cdots$.

A sequence $\{ a_n\}$ is called decreasing if $a_n > a_{n+1}$ for all $n \geq 1$.  In other words, $\{ a_n\}$ is decreasing if $a_1 > a_2 > a_3 > \cdots$.

A sequence is called monotonic if it is either increasing or decreasing.
\end{definition}
\end{frame}
% end module sequence-monotonic-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-monotonic-ex.tex
% begin module sequence-monotonic-ex
\begin{frame}
\begin{example}
The sequence $\left\{ \frac{1}{2n+1}\right\}$ is decreasing because
\[
a_n = \frac{1}{2n+1} \qquad a_{n+1} = \frac{1}{2(n+1)+1} = \frac{1}{2n+3}
\]
and 
\[
\frac{1}{2n+1} > \frac{1}{2n+3}
\]
because the denominator of the latter is bigger.
\end{example}
\end{frame}
% end module sequence-monotonic-ex



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/sequence-bounded-def.tex
% begin module sequence-bounded-def
\begin{frame}
\begin{definition}[Bounded Sequence]
A sequence $\{ a_n\}$ is called bounded above if there exists a number $M$ such that 
\[
a_n < M \qquad \textrm{for all}\qquad  n\geq 1.
\]
It is called bounded below if there exists a number $M$ such that 
\[
a_n > M \qquad \textrm{for all}\qquad  n\geq 1.
\]
A bounded sequence is a sequence that is bounded below and above.
\end{definition}
\begin{center}
\includegraphics[height=3.5cm]{sequences/pictures/12-01-bounded.pdf}%
\end{center}
\end{frame}
% end module sequence-bounded-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/sequences/monotonic-sequence-theorem.tex
% begin module monotonic-sequence-theorem
\begin{frame}
\begin{theorem}[Monotonic Sequence Theorem]
Every bounded, monotonic sequence is convergent.
\end{theorem}
\end{frame}
% end module monotonic-sequence-theorem



% WARNING: You need an example of the monotonic sequence theorem in use.
% Try using alternating convergents in the continued fraction expansion
% of some irrational number (the golden mean will work well).
}% end lecture

% begin lecture
\lect{Spring 2015}{Lecture 11}{11}{
\section{Series}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/finite-series.tex
% begin module finite-series
\begin{frame}
\begin{example}[A finite series]
\[
1 + 2 + 3 + 4 + 5
\]
is an example of a finite series.  So is
\[
-1 - 2 - 3 - \ldots - 10 000.
\]
\end{example}

\begin{definition}[Finite series, Infinite series]
A finite series is a series that ends.  
It is possible to write down all the terms in a finite series.  
A series that is not finite is called an infinite series.  

Every finite series has a sum.  
Some infinite series have a sum, and others do not.  
\end{definition}

\uncover<2->{%
\begin{example}[An infinite series]
\[
1 + 1 + 1 + 1 + \ldots
\]
is an example of an infinite series.  
It has no sum.  
\end{example}
}%

\end{frame}
% end module finite-series



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/arithmetic-sum-theorem.tex
% begin module arithmetic-sum-theorem
\begin{frame}
\begin{theorem}[Sum of an arithmetic series]
The sum of a finite arithmetic series is the average of the first and last terms, multiplied by the number of terms.  
That is,
\[
a + (a + d) + (a + 2d) + \cdots + (a + (n-1)d) = \frac{a + (a+(n-1)d)}{2}n.
\]
The only infinite arithmetic series with a sum is the series of all $0$.
\end{theorem}

\uncover<2->{%
\begin{example}[Sum of an arithmetic series]
Find the sum of the arithmetic series
\[
5 + 10 + 15 + 20 + \cdots + 100.
\]
\uncover<3->{\alert<3-4| handout:0>{%
The series contains \uncover<4-| handout:0>{20} terms.  
}}%
\uncover<5->{%
The average of the first and last terms is \uncover<5-| handout:0>{$\frac{5+100}{2}$}.  
}%

\uncover<6->{%
Therefore the sum is $\frac{\uncover<6-| handout:0>{5+100}}{2}\cdot = \uncover<6-| handout:0>{20   105\cdot 10 = 1050.}$
}%
\end{example}
}%

\end{frame}
% end module arithmetic-sum-theorem



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/arithmetic-sum.tex
% begin module arithmetic-sum
\begin{frame}
\begin{definition}[Arithmetic series]
An arithmetic series is a series whose terms are an arithmetic sequence.  
\end{definition}

\begin{example}[Sum of a small arithmetic series]
The sum of the arithmetic series %
$7 + 4 + 1 - 2 - 5$ %
is \uncover<2-| handout:0>{\alert<handout:0| 2>{5}.}
\end{example}

\uncover<3->{%
\begin{example}[Sum of a large arithmetic series]
Find the sum of the arithmetic series 
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
7 + 4 + 1 - 2 - 5 - \cdots - 53 - 56.
\]
\uncover<4->{Let $s$ denote the sum.}  
\uncover<5->{%
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
\begin{array}{rcrrrrr}
s & = & \alert<handout:0| 7-8>{7} & \alert<handout:0| 9-10>{+ 4} & \alert<handout:0| 11-12>{+ 1} & - \cdots & \alert<handout:0| 13-14>{- 56} \\
\uncover<7->{+}\uncover<6->{s} & \uncover<6->{=} & \uncover<6->{\alert<handout:0| 7-8>{-56}} & \uncover<6->{\alert<handout:0| 9-10>{-53}} & \uncover<6->{\alert<handout:0| 11-12>{-50}} & \uncover<6->{- \cdots} & \uncover<6->{\alert<handout:0| 13-14>{+ 7}} \\
\hline
\uncover<7->{2s} & \uncover<7->{=} & \uncover<8->{\alert<handout:0| 8>{-49}} &\uncover<10->{\alert<handout:0| 10>{-49}} &\uncover<12->{\alert<handout:0| 12>{-49}} & \uncover<13->{-\cdots} & \uncover<14->{\alert<handout:0| 14>{-49}} 
\end{array}
\]
}%

\vspace{-12pt}
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\begin{align*}
\uncover<15->{\text{Therefore}\quad 2s & = (-49)\alert<handout:0| 15-16>{(\uncover<16->{22})}} \\
\uncover<17->{s & = -49\cdot 22/2 = -539.}
\end{align*}
\end{example}
}%

\end{frame}
% end module arithmetic-sum



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/geometric-sum.tex
% begin module geometric-sum
\begin{frame}
\begin{definition}[Geometric series]
A geometric series is a series whose terms are a geometric sequence.  
\end{definition}
\uncover<2->{%
\begin{example}[The sum of a finite geometric series]
Find the sum of the geometric series
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
a + ar + ar^2 + ar^3 + \cdots + ar^{M-1} = \sum_{n = 1}^M ar^{n-1}.
\]
\uncover<3->{Let $s$ denote the sum.  }
\uncover<4->{%
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
\begin{array}{rcrrrrrr}
\alert<handout:0| 6-7>{s} & = & \alert<handout:0| 8>{a} & + ar & + ar^2 & + \cdots & + ar^{M-1} & \\
\alert<handout:0| 6-7>{\uncover<6->{-}\qquad \uncover<5->{rs}} & \uncover<5->{=} &  &  \uncover<5->{ar} & \uncover<5->{+ ar^2} & \uncover<5->{+ \cdots} & \uncover<5->{+ ar^{n-1}} & \uncover<5->{+ \alert<handout:0| 8>{ar^M}}\\
\hline
\uncover<7->{\alert<handout:0| 7>{s - rs}} & \uncover<6->{=} & \multicolumn{6}{l}{\uncover<8->{\alert<handout:0| 8>{a-ar^M}}}\\
\uncover<9->{s} & \uncover<9->{=} & \multicolumn{6}{l}{\uncover<9->{\frac{a(1-r^M)}{1-r}}}
\end{array}
\]
}%

\end{example}
}%
\uncover<10->{%
\begin{theorem}[The sum of a finite geometric series]
The sum of the finite geometric series $\sum_{n=1}^M ar^{n-1}$ is $a\frac{1-r^M}{1-r}$.  
\end{theorem}
}%
\end{frame}
% end module geometric-sum





%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/series-def.tex
% begin module series-def
\begin{frame}
\frametitle{(12.2)  Series}
\begin{definition}[Series]
If we add the terms in an infinite sequence, we get an infinite series:
\[
a_1 + a_2 + a_3 + a_4 + \cdots + a_n + \cdots 
\]
We denote this sum by
\[
\sum_{n = 1}^\infty a_n \qquad \textrm{ or } \qquad \sum a_n
\]
\end{definition}
\end{frame}
% end module series-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/notation.tex
% begin module notation
\begin{frame}
\begin{example}[Series notation]
The series 
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
2 + 4 + 6 + 8 + \ldots + 124
\]
can be written more concisely as
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=1}^{62} 2 + 2(n-1).
\]
$2+2(n-1)$ is the $n$th term, and the sigma sign $\sum$ tell us to add all these terms, starting from $n=1$ and going up to $n=62$.  
In this notation $n$ is called the index.  
\end{example}

\uncover<2->{%
\begin{example}[More series notation]
\[
\text{Write } \frac{2}{3} -\frac{4}{9} + \frac{8}{27} - \frac{16}{81} + \frac{32}{243} - \frac{64}{729} \text{ using series notation.}
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<3->{\sum_{n=1}^{\uncover<4-| handout:0>{\alert<4>{6}}}} \uncover<5-| handout:0>{\alert<5>{\frac{2}{3}\Big(-\frac{2}{3}\Big)^{n-1}}}
\]
\end{example}
}%
\end{frame}
% end module notation



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/series-def-example.tex
% begin module series-def-example
\begin{frame}
\begin{example}[A series]
\[
1 + 2 + 3 + 4 + 5
\]
is an example of a series.  
\end{example}

\uncover<2->{%
\begin{definition}[Series, Sum]
A series is what you get if you add together the terms of a sequence.  
The sum of a series is the number that results from adding up its terms.  
Some series do not have a sum.  
\end{definition}
}%

\uncover<3->{%
\begin{example}[A series with a sum]
The sum of the series %
$1 + 2 + 3 + 4 + 5$ %
is \uncover<4-| handout:0>{15.} 
\end{example}
}%

\uncover<5->{%
\begin{example}[A series with no sum]
The series %
$1 + 2 + 3 + 4 + 5 + \cdots $ %
has no sum.  
\end{example}
}%

\end{frame}
% end module series-def-example




%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/series-convergence.tex
% begin module series-convergence
\begin{frame}
\begin{itemize}
\item  Does it make sense to add infinitely many numbers?
\item<2->  Sometimes yes, sometimes no.
\item<3->  Consider the series $\sum_{n=1}^\infty n$.
\end{itemize}
\uncover<3->{%
\abovedisplayskip=2pt
\[
\alert<handout:0| 4-15>{ 1}%
\alert<handout:0| 6-15>{+2}%
\alert<handout:0| 8-15>{+3}%
\alert<handout:0| 10-15>{+4}%
\alert<handout:0| 12-15>{+5}%
\alert<handout:0| 14-15>{+ \cdots + n}%
+ \cdots 
\]
\belowdisplayskip=2pt
}%
\begin{itemize}
\item<4->  If we add the terms, we get the partial sums %
\uncover<5->{\alert<handout:0| 5>{$1$},}%
\uncover<7->{\alert<handout:0| 7>{$3$},}%
\uncover<9->{\alert<handout:0| 9>{$6$},}%
\uncover<11->{\alert<handout:0| 11>{$10$},}%
\uncover<13->{\alert<handout:0| 13>{$15$}.}
\item<14->  After the $n$th term, we get \uncover<15->{\alert<handout:0| 15>{$\frac{n(n+1)}{2}$}.}%
\item<16->  This goes to $\infty$ as $n$ gets bigger.
\item<17->  Now consider the series $\sum_{n=1}^\infty \frac{1}{2^n}$.
\end{itemize}
\uncover<17->{%
\abovedisplayskip=2pt
\[
\alert<handout:0| 18-29>{ \frac{1}{2}}%
\alert<handout:0| 20-29>{+\frac{1}{4}}%
\alert<handout:0| 22-29>{+\frac{1}{8}}%
\alert<handout:0| 24-29>{+\frac{1}{16}}%
\alert<handout:0| 26-29>{+\frac{1}{32}}%
\alert<handout:0| 28-29>{+ \cdots + \frac{1}{2^n}}%
+ \cdots 
\]
\belowdisplayskip=2pt
}%
\begin{itemize}
\item<18->  If we add the terms, we get the partial sums %
\uncover<19->{\alert<handout:0| 19>{$\frac{1}{2}$},}%
\uncover<21->{\alert<handout:0| 21>{$\frac{3}{4}$},}%
\uncover<23->{\alert<handout:0| 23>{$\frac{7}{8}$},}%
\uncover<25->{\alert<handout:0| 25>{$\frac{15}{16}$},}%
\uncover<27->{\alert<handout:0| 27>{$\frac{31}{32}$}.}
\item<28->  After the $n$th term, we get \uncover<29->{\alert<handout:0| 29>{$1-\frac{1}{2^n}$}.}%
\item<30->  This gets closer and closer to $1$.  We write $\sum_{n=1}^\infty \frac{1}{2^n} = 1$.
\end{itemize}
\end{frame}


\begin{frame}
\begin{definition}[Partial Sum, Convergent, Divergent, Sum]
Given a series $\sum_{i=1}^\infty a_i = a_1 + a_2 + a_3 + \cdots$, let $s_n$ denote the $n$th partial sum:
\[
s_n = \sum_{i=1}^n a_i = a_1 + a_2 + \cdots + a_n
\]

If the sequence $\{ s_n\}$ is convergent and $\lim_{n\to \infty} s_n = s$, then we say that the series $\sum_{i=1}^\infty a_i$ is convergent, and we write
\[
\sum_{i=1}^\infty a_i = s.
\]
In this case, we call $s$ the sum of the series.

If the sequence $\{ s_n\}$ is divergent, then we say that the series $\sum_{i=1}^\infty a_i$ is divergent.
\end{definition}
\end{frame}
% end module series-convergence



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/series-geometric-ex1.tex
% begin module series-geometric-ex1
\begin{frame}
\begin{example} %[Example 1, p. 724]
An important example is the geometric series
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
a + ar + ar^2 + ar^3 + \cdots + ar^{n-1} + \cdots = \sum_{n = 1}^\infty ar^{n-1}, \qquad a\neq 0
\]
\begin{itemize}
\item<2->  If $r = 1$, then $s_n = a + a + \cdots + a = na \to \pm\infty$.
\item<3->  Since $\lim_{n\to\infty} s_n$ doesn't exist, the series is divergent when $r = 1$.
\item<4->  If $r\neq 1$, then
\end{itemize}
\only<handout:0| -5>{%
\uncover<4->{%
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
\begin{array}{rcrrrrrr}
s_n & = & a & + ar & + ar^2 & + \cdots & + ar^{n-1} & \\
\invisible<1->{-}\qquad \uncover<5->{rs_n} & \uncover<5->{=} &  &  \uncover<5->{ar} & \uncover<5->{+ ar^2} & \uncover<5->{+ \cdots} & \uncover<5->{+ ar^{n-1}} & \uncover<5->{+ ar^n}\\
%\hline
\uncover<6->{s_n - rs_n} & \uncover<6->{=} & \multicolumn{6}{l}{\uncover<6->{a-ar^n}}\\
\uncover<7->{s_n} & \uncover<7->{=} & \multicolumn{6}{l}{\uncover<7->{\frac{a(1-r^n)}{1-r}}}
\end{array}
\]
}}%
\only<handout:1| 6->{%
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
\begin{array}{rcrrrrrr}
\alert<handout:0| 8>{s_n} & = & \alert<handout:0| 9>{a} & + ar & + ar^2 & + \cdots & + ar^{n-1} & \\
\alert<handout:0| 8>{-\qquad \uncover<5->{rs_n}} & \uncover<5->{=} &  &  \uncover<5->{ar} & \uncover<5->{+ ar^2} & \uncover<5->{+ \cdots} & \uncover<5->{+ ar^{n-1}} & \uncover<5->{+ \alert<handout:0| 9>{ar^n}}\\
\hline
\uncover<7->{\alert<handout:0| 8>{s_n - rs_n}} & \uncover<7->{=} & \multicolumn{6}{l}{\uncover<7->{\alert<handout:0| 9>{a-ar^n}}}\\
\uncover<10->{s_n} & \uncover<10->{=} & \multicolumn{6}{l}{\uncover<10->{\frac{a(1-r^n)}{1-r}}}
\end{array}
\]
}%

\begin{itemize}
\item<11->  If $-1 < r < 1$, then $r^n\to 0$, so the geometric series is convergent and its sum is $a/(1-r)$.
\item<12->  If $r > 1$ or $r \leq -1$, then $r^n$ is divergent, so $\sum_{n=1}^\infty ar^{n-1}$ diverges.
\end{itemize}
\end{example}
\end{frame}
% end module series-geometric-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/series-geometric-theorem.tex
% begin module series-geometric-theorem
\begin{frame}
This theorem summarizes the results of the previous example.
\begin{theorem}[Convergence of Geometric Series]
The geometric series
\[
\sum_{n=1}^\infty ar^{n-1} = a + ar + ar^2 + \cdots
\]
is convergent if $|r| < 1$ and its sum is
\[
\sum_{n=1}^\infty ar^{n-1} = \frac{a}{1-r}.
\]
If $|r| \geq 1$, the series is divergent.

$a$ is called the first term and $r$ is called the common ratio.
\end{theorem}
\end{frame}
% end module series-geometric-theorem



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/series-geometric-ex.tex
% begin module series-geometric-ex
\begin{frame}
\begin{example}
Find the sum of the geometric series
\[
-2 + \frac{6}{5} - \frac{18}{25} + \frac{54}{125} - \cdots
\]
\begin{itemize}
\item<2-| alert@2-3>  The first term is $a = $ \uncover<3->{$-2$.}
\item<2-| alert@4-5>  The common ratio is $r = $ \uncover<5->{$-\frac{3}{5}$.}
\item<6->  Therefore the sum is
\end{itemize}
\begin{eqnarray*}
\uncover<6->{%
\sum_{n=1}^\infty (-2)\left( - \frac{3}{5}\right)^{n-1}%
}%
& \uncover<6->{ = } &%
\uncover<6->{%
\frac{(-2)}{1-\left( - \frac{3}{5}\right)}%
}\\%
& \uncover<7->{ = } &%
\uncover<7->{%
-\frac{2}{\frac{8}{5}}%
}\\%
& \uncover<8->{ = } &%
\uncover<8->{%
-\frac{5}{4}%
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module series-geometric-ex



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/series-geometric-ex4.tex
% begin module series-geometric-ex4
\begin{frame}
\begin{example} %[Example 4, p. 726]
Write the number $2.3\overline{17} = 2.3171717\ldots$ as a quotient of integers.
\uncover<2->{%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\alert<handout:0| 3>{2.3}%
\alert<handout:0| 4>{17}%
\alert<handout:0| 5>{17}%
\alert<handout:0| 6>{17}%
\ldots = 
\alert<handout:0| 3>{2.3}%
+ \alert<handout:0| 7-11>{\alert<handout:0| 4>{\frac{17}{10^3}}%
+ \alert<handout:0| 5>{\frac{17}{10^5}}%
+ \alert<handout:0| 6>{\frac{17}{10^7}}%
+ \cdots}%
\]
}%
\begin{itemize}
\item<7->  After the first term, we have a geometric series.
\item<8->  \alert<handout:0| 8-9,12-13>{$a =$ \uncover<9->{$\frac{17}{10^3}$}} and \alert<handout:0| 10-11,14-15>{$r =$ \uncover<11->{$\frac{1}{10^2}$.}}
\end{itemize}
\begin{eqnarray*}
\uncover<12->{%
2.3171717\ldots%
}%
& \uncover<12->{ = } &%
\uncover<12->{%
2.3 + \frac{\uncover<13->{\alert<handout:0| 13>{\frac{17}{10^3}}}}{1- \uncover<15->{\alert<handout:0| 15>{\frac{1}{10^2}}}}%
}%
 \uncover<16->{ = } %
\uncover<16->{%
2.3 + \frac{\uncover<13->{\alert<handout:0| 13>{\frac{17}{1000}}}}{\uncover<15->{\alert<handout:0| 15>{\frac{99}{100}}}}%
}\\%
& \uncover<17->{ = } &%
\uncover<17->{%
\frac{23}{10} + \frac{17}{990}%
}%
 \uncover<18->{ = } %
\uncover<18->{%
\frac{1147}{495}%
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module series-geometric-ex4



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/series-telescoping-ex6.tex
% begin module series-telescoping-ex6
\begin{frame}
\begin{example} %[Example 6, p. 727]
Show that the series $\sum_{n=1}^\infty \frac{1}{n(n+1)}$ is convergent and find its sum.
\begin{itemize}
\item<2-| alert@2-3>  Is this a geometric series?  \uncover<3->{No.}%
\item<4->  Use partial fractions:
\end{itemize}
\uncover<4->{%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
a_n = \alert<handout:0| 7>{\frac{1}{n(n+1)} \uncover<5->{ = \frac{1}{n} - \frac{1}{n+1}}}%
\]
}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<6->{%
\alert<handout:0| 15>{s_n}%
}%
& \uncover<6->{ = } &%
\uncover<6->{%
\sum_{i=1}^n \alert<handout:0| 7>{\frac{1}{i(i+1)}}%
}  \uncover<7->{ = } \uncover<7->{%
\sum_{i=1}^n \alert<handout:0| 7>{\left( \frac{1}{i} - \frac{1}{i+1}\right)}%
}\\%
& \uncover<8->{ = } &%
\uncover<8->{%
\left( \alert<handout:0| 13>{1} - \alert<handout:0| 9>{\frac{1}{2}}\right) %
+ \left( \alert<handout:0| 9>{\frac{1}{2}} - \alert<handout:0| 10>{\frac{1}{3}}\right) %
+ \left( \alert<handout:0| 10>{\frac{1}{3}} - \alert<handout:0| 11>{\frac{1}{4}}\right) %
+ \alert<handout:0| 11-12>{\cdots} %
+ \left( \alert<handout:0| 12>{\frac{1}{n}} \alert<handout:0| 13>{- \frac{1}{n+ 1}}\right) %
}\\%
& \uncover<13->{\alert<handout:0| 15>{ = }} &%
\uncover<13->{%
\alert<handout:0| 13,15>{1 - \frac{1}{n+1}}%
}%
\end{eqnarray*}
\uncover<14->{%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\textrm{Therefore}\quad \sum_{i=1}^\infty \frac{1}{i(i+1)} = \lim_{n\to\infty} \alert<handout:0| 15>{s_n} \uncover<15->{= \lim_{n\to\infty} \alert<handout:0| 15>{\left( 1 - \frac{1}{n+1}\right)}} \uncover<16>{= 1}%
\]
}%
\vspace{-.1in}
\end{example}
\end{frame}
% end module series-telescoping-ex6



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/series-harmonic-ex7.tex
% begin module series-harmonic-ex7
\begin{frame}
\begin{example} %[Example 7, p. 727]
Show that the harmonic series %
%\abovedisplayskip=0pt
%\belowdisplayskip=0pt
%\[
$\displaystyle%
\sum_{n=1}^\infty \frac{1}{n} = \alert<handout:0| 2-4>{1} \alert<handout:0| 3-4>{+ \frac{1}{2}} \alert<handout:0| 4>{+ \frac{1}{3} + \frac{1}{4}} + \cdots%
$ %
%\]
diverges.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\begin{array}{rcl}
\uncover<2->{\alert<handout:0| 2>{s_1}} & \uncover<2->{\alert<handout:0| 2>{=}} & \uncover<2->{\alert<handout:0| 2>{1}} \\
\uncover<3->{\alert<handout:0| 3>{s_2}} & \uncover<3->{\alert<handout:0| 3>{=}} & \uncover<3->{\alert<handout:0| 3>{1 + \frac{1}{2}}} \\
\uncover<4->{\alert<handout:0| 4>{s_4}} & \uncover<4->{\alert<handout:0| 4>{=}} & \uncover<4->{\alert<handout:0| 4>{1 + \frac{1}{2} + \alert<handout:0| 5>{\frac{1}{3} + \frac{1}{4}}}} \uncover<5->{ > 1 + \frac{1}{2} + \alert<handout:0| 5>{\frac{1}{4} + \frac{1}{4}}} \uncover<6->{ = 1 + \frac{2}{2}}\\
\uncover<7->{s_8} & \uncover<7->{=} & \uncover<7->{1 + \frac{1}{2} + \alert<handout:0| 8>{\frac{1}{3} + \frac{1}{4}} + \alert<handout:0| 9>{\frac{1}{5} + \frac{1}{6} + \frac{1}{7} + \frac{1}{8}}}\\
 & \uncover<8->{>} & \uncover<8->{1 + \frac{1}{2} + \alert<handout:0| 8,10-11>{\frac{1}{4} + \frac{1}{4}} + \alert<handout:0| 9,12-13>{\frac{1}{8} + \frac{1}{8} + \frac{1}{8} + \frac{1}{8}}}\\
 & \uncover<10->{=} & \uncover<10->{1 + \frac{1}{2} \uncover<11->{\alert<handout:0| 11>{+ \frac{1}{2}}} \uncover<13->{\alert<handout:0| 13>{+ \frac{1}{2}}} \uncover<14->{= 1 + \frac{3}{2}}} \\
\uncover<15->{s_{16}} & \uncover<15->{=} & \uncover<15->{1 + \frac{1}{2} + \alert<handout:0| 16>{\left( \frac{1}{3} +\frac{1}{4}\right)} + \alert<handout:0| 17>{\left( \frac{1}{5} + \cdots + \frac{1}{8}\right)} + \alert<handout:0| 18>{\left( \frac{1}{9} + \cdots + \frac{1}{16}\right)}} \\
 & \uncover<16->{>} & \uncover<16->{1 + \frac{1}{2} + \alert<handout:0| 16,19-20>{\left( \frac{1}{4} +\frac{1}{4}\right)} + \alert<handout:0| 17,21-22>{\left( \frac{1}{8} + \cdots + \frac{1}{8}\right)} + \alert<handout:0| 18,23-24>{\left( \frac{1}{16} + \cdots + \frac{1}{16}\right)}} \\
 & \uncover<19->{=} & \uncover<19->{1 + \frac{1}{2} \uncover<20->{\alert<handout:0| 20>{+ \frac{1}{2}}} \uncover<22->{\alert<handout:0| 22>{+ \frac{1}{2}}} \uncover<24->{\alert<handout:0| 24>{+ \frac{1}{2}}} \uncover<25->{= 1 + \frac{4}{2}}} \\
 & \uncover<26->{\vdots} &  \\
\uncover<26->{\alert<handout:0| 26-27>{s_{2^n}}} & \uncover<26->{\alert<handout:0| 26-27>{>}} & \uncover<27->{\alert<handout:0| 27>{1 + \frac{n}{2}}} 
\end{array}
\]
\uncover<28->{%
Therefore $s_{2^n}\to \infty$ as $n\to\infty$, so $\{s_n\}$ is divergent, so the harmonic series is divergent.
}%
\end{example}
\end{frame}
% end module series-harmonic-ex7



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/series-divergence-test.tex
% begin module series-divergence-test
\begin{frame}[t]
\begin{theorem}
If the series $\sum_{n=1}^\infty a_n$ is convergent, then $\lim_{n\to\infty}a_n = 0$.
\end{theorem}
\begin{proof}
\begin{itemize}
\item<2->  Let $s_n = a_1 + a_2 + \cdots + a_n$.
\item<3->  Then \alert<handout:0| 8>{$a_n = s_n - s_{n-1}$}.
\item<4->  Since $\sum_{n=1}^\infty a_n$ is convergent, the sequence $\{ s_n\}$ is convergent.
\item<5->  Let \alert<handout:0| 9>{$\lim_{n\to\infty} s_n = s$.}
\item<6->  Then \alert<handout:0| 6-7,9>{$\lim_{n\to\infty} s_{n-1} =$ \uncover<7->{$s$.}}
\item<8->  Therefore
\end{itemize}
\[
\uncover<8->{\lim_{n\to\infty}\alert<handout:0| 8>{a_n}} %
\uncover<8->{= \lim_{n\to\infty}\alert<handout:0| 8>{(\alert<handout:0| 9>{s_n}-\alert<handout:0| 9>{s_{n-1}})}} %
\uncover<9->{= \alert<handout:0| 9>{s} - \alert<handout:0| 9>{s}} %
\uncover<10->{= 0\qedhere}%
\]
\end{proof}
\end{frame}


\begin{frame}[t]
\begin{theorem}
If the series $\sum_{n=1}^\infty a_n$ is convergent, then $\lim_{n\to\infty}a_n = 0$.
\end{theorem}
This is just a restatement of the previous theorem:
\begin{theorem}[The Divergence Test]
If $\lim_{n\to\infty} a_n$ doesn't exist or if $\lim_{n\to\infty}a_n \neq 0$, then the series $\sum_{n=1}^\infty a_n$ is divergent.
\end{theorem}
\end{frame}
% end module series-divergence-test



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/series-divergence-test-ex8.tex
% begin module series-divergence-test-ex8
\begin{frame}
\begin{example} %[Example 8, p. 728]
Show that the series $\sum_{n=1}^\infty \frac{n^2}{5n^2+4}$ diverges.
\[
\uncover<2->{%
\lim_{n\to\infty} a_n = \lim_{n\to\infty} \frac{n^2}{5\alert<handout:0| 3>{n^2}+4}\uncover<3->{\alert<handout:0| 3>{\cdot \frac{\frac{1}{n^2}}{\frac{1}{n^2}}}}%
}%
\uncover<4->{%
 = \lim_{n\to\infty} \frac{1}{5+\frac{4}{n^2}} %
}%
\uncover<5->{%
 = \frac{1}{5} \neq 0%
}%
\]
\uncover<6->{%
Therefore, by the Divergence Test, the series diverges.%
}%
\end{example}
\end{frame}
% end module series-divergence-test-ex8



\section{The Integral Test and Estimates of Sums}
\subsection{The Integral Test}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/integral-test-intro.tex
% begin module integral-test-intro
\begin{frame}\frametitle{The Integral Test and Estimates of Sums}
\begin{itemize}
\item  In general, it is not easy to find the sum of a series.
\item  We could do this for $\displaystyle \sum_{n=1}^\infty \frac{1}{n(n+1)}$ because we found a simple formula for the $n$th partial sum $s_n$.
\item  In the next few sections, we'll learn techniques for showing whether a series is convergent or divergent without explicitly computing its sum.
\end{itemize}
\end{frame}
% end module integral-test-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/integral-test-above.tex
% begin module integral-test-above
\begin{frame}
\begin{columns}
\column{.6\textwidth}
\[
\sum_{n=1}^\infty \frac{1}{n^2} = \alert<handout:0| 6-10,14>{\frac{1}{1^2}} \alert<handout:0| 7-10,14>{+\alert<handout:0| 13>{\frac{1}{2^2}}} \alert<handout:0| 8-10,13-14>{+ \frac{1}{3^2}} \alert<handout:0| 9-10,13-14>{+ \frac{1}{4^2}} \alert<handout:0| 10,13-14>{+ \cdots} 
\]
\begin{itemize}
\item<2->  Use a computer to calculate partial sums.
\item<3->  Looks like it's converging.
\item<4->  How do we prove it?
\item<5->  Use $f(x) = \frac{1}{x^2}$.
\end{itemize}
\begin{center}
\uncover<5->{%
\only<handout:0| -5>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-abovea.pdf}%
}%
}%
\only<handout:0| 6>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-aboveb.pdf}%
}%
\only<handout:0| 7>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-abovec.pdf}%
}%
\only<handout:0| 8>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-aboved.pdf}%
}%
\only<handout:0| 9>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-abovee.pdf}%
}%
\only<handout:1| 10-11>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-aboveg.pdf}%
}%
\only<handout:2| 12>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-aboveh.pdf}%
}%
\only<handout:3| 13>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-abovei.pdf}%
}%
\only<handout:4| 14>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-abovej.pdf}%
}%
\end{center}
\column{.4\textwidth}
\uncover<2->{%
\[
\begin{array}{|r@{\ }|c|}
\hline
n & s_n = \sum_{i=1}^n \frac{1}{i^2}\\
\hline
     5 & 1.4636 \\
    10 & 1.5498 \\
    50 & 1.6251 \\
   100 & 1.6350 \\
   500 & 1.6429 \\
  1000 & 1.6439 \\
  5000 & 1.6447 \\
\hline
\end{array}
\]
}%
\begin{itemize}
\item<6->  $\frac{1}{1^2}$ is the area of a rectangle.
\item<7->  So is $\frac{1}{2^2} = \frac{1}{4}$.
\item<handout:2-| 11-| alert@11-12>  The improper integral $\int_1^\infty \frac{1}{x^2}\diff x$ is \uncover<12->{convergent.}
\item<handout:4-| 14->  Therefore $\sum_{n=1}^\infty \frac{1}{n^2}$ is convergent.
\end{itemize}
\end{columns}
\end{frame}
% end module integral-test-above



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/integral-test-below.tex
% begin module integral-test-below
\begin{frame}
\begin{columns}
\column{.6\textwidth}
\[
\sum_{n=1}^\infty \frac{1}{\sqrt{n}} = \alert<handout:0| 6-10>{\frac{1}{\sqrt{1}}} \alert<handout:0| 7-10>{+\frac{1}{\sqrt{2}}} \alert<handout:0| 8-10>{+ \frac{1}{\sqrt{3}}} \alert<handout:0| 9-10>{+ \frac{1}{\sqrt{4}}} \alert<handout:0| 9-10>{+ \cdots} 
\]
\begin{itemize}
\item<2->  Use a computer to calculate partial sums.
\item<3->  Looks like it's diverging.
\item<4->  How do we prove it?
\item<5->  Use $f(x) = \frac{1}{\sqrt{x}}$.
\end{itemize}
\begin{center}
\uncover<5->{%
\only<handout:0| -5>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-belowa.pdf}%
}%
}%
\only<handout:0| 6>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-belowb.pdf}%
}%
\only<handout:0| 7>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-belowc.pdf}%
}%
\only<handout:0| 8>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-belowd.pdf}%
}%
\only<handout:1| 9-10>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-belowf.pdf}%
}%
\only<handout:2| 11>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-belowg.pdf}%
}%
\only<handout:3| 12>{%
\includegraphics[width=6.5cm]{series/pictures/12-03-integral-test-belowh.pdf}%
}%
\end{center}
\column{.4\textwidth}
\uncover<2->{%
\[
\begin{array}{|r@{\ }|r|}
\hline
n & s_n = \sum_{i=1}^n \frac{1}{\sqrt{i}}\\
\hline
     5 & 3.2317 \\
    10 & 5.0210 \\
    50 & 12.7524 \\
   100 & 18.5896 \\
   500 & 43.2834 \\
  1000 & 61.8010 \\
  5000 & 139.9681 \\
\hline
\end{array}
\]
}%
\begin{itemize}
\item<6->  $\frac{1}{\sqrt{1}}$ is the area of a rectangle.
\item<7->  So is $\frac{1}{\sqrt{2}}$.
\item<handout:2-| 10-| alert@10-11>  $\int_1^\infty \frac{1}{\sqrt{x}}\diff x$ is \uncover<11->{divergent.}
\item<handout:3-| 12->  Therefore $\sum_{n=1}^\infty \frac{1}{\sqrt{n}}$ is divergent.
\end{itemize}
\end{columns}
\end{frame}
% end module integral-test-below



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/integral-test-def.tex
% begin module integral-test-def
\begin{frame}
\begin{theorem}[The Integral Test]
Let $f$ be a continuous, positive, decreasing function on $[1, \infty )$ and let $a_n = f(n)$.  Then the series $\sum_{n=1}^\infty a_n$ is convergent if and only if the improper integral $\int_1^\infty f(x)\diff x$ is convergent.  In other words,
\begin{enumerate}
\item  If $\displaystyle \int_1^\infty f(x)\diff x$ is convergent, then $\displaystyle \sum_{n=1}^\infty a_n$ is convergent.
\item  If $\displaystyle \int_1^\infty f(x)\diff x$ is divergent, then $\displaystyle \sum_{n=1}^\infty a_n$ is divergent.
\end{enumerate}
\end{theorem}
\uncover<2->{%
Note that it is not necessary to start the series or the integral at $n = 1$.  For instance, to test the series
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=4}^\infty \frac{1}{(n-3)^2}
\]
we would use
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\int_{4}^\infty \frac{1}{(x-3)^2}\diff x
\]
}%
\end{frame}
% end module integral-test-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/integral-test-ex1.tex
% begin module integral-test-ex1
\begin{frame}
\begin{example}[Example 1, p. 735]
Test the series $\displaystyle \sum_{n=1}^\infty \frac{1}{n^2+1}$ for convergence.

\uncover<2->{%
$f(x) = \frac{1}{x^2+1}$ is continuous, positive, and decreasing on $[1,\infty )$, so use the Integral Test.
}%
\begin{eqnarray*}
\uncover<3->{\int_1^\infty \frac{1}{x^2+1}\diff x} & \uncover<3->{ = } & \uncover<3->{\lim_{t\to\infty} \int_1^t \alert<handout:0| 4-5>{\frac{1}{x^2+1}}\diff x} \\
& \uncover<4->{ = } & \uncover<4->{\lim_{t\to\infty}\left[ \uncover<5->{\alert<handout:0| 5>{\arctan x}}\right]_{\alert<handout:0| 7-8>{1}}^{\alert<handout:0| 6>{t}}}\\
& \uncover<6->{ = } & \uncover<6->{\alert<handout:0| 9-10>{\lim_{t\to\infty}}\left( \alert<handout:0| 6,9-10>{\arctan t} - \uncover<8->{\alert<handout:0| 8>{\pi/4}} \right)}\\
& \uncover<9->{ = } &  \uncover<10->{\alert<handout:0| 10>{\pi/2}} \uncover<9->{- \pi/4} \uncover<11->{= \pi/4} 
\end{eqnarray*}
\uncover<12->{%
Therefore $\sum_{n=1}^\infty \frac{1}{n^2+1}$ is \uncover<13->{convergent.}%
}%
\end{example}
\end{frame}
% end module integral-test-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/integral-test-ex2.tex
% begin module integral-test-ex2
\begin{frame}
\begin{example}[Example 2, p. 735]
For which values of $p$ is the series $\displaystyle \sum_{n=1}^\infty \frac{1}{n^p}$ convergent?
\begin{itemize}
\item<2-| alert@2-3>  If $p < 0$, then $\lim_{n\to\infty}\frac{1}{n^p} = $\uncover<3->{$\infty$.}
\item<4-| alert@4-5>  If $p = 0$, then $\lim_{n\to\infty}\frac{1}{n^p} = $\uncover<5->{$1$.}
\item<6-| alert@6-7>  In either case, the series is \uncover<7->{divergent.}
\item<8->  If $p > 0$, then $f(x) = \frac{1}{x^p}$ is continuous, positive, and decreasing on $[1, \infty)$, so we can use the Integral Test.
\item<9->  $\displaystyle \int_1^\infty \frac{1}{x^p}\diff x$ is \alert<handout:0| 9-10>{convergent if \uncover<10->{$p > 1$.}}
\item<9->  $\displaystyle \int_1^\infty \frac{1}{x^p}\diff x$ is \alert<handout:0| 11-12>{divergent if \uncover<12->{$p \leq 1$.}}
\item<13->  Therefore $\displaystyle \sum_{n=1}^\infty \frac{1}{n^p}$ is convergent if $p > 1$ and divergent if $p \leq 1$.
\end{itemize}
\end{example}
\end{frame}
% end module integral-test-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/p-series.tex
% begin module p-series
\begin{frame}
This theorem summarizes the results of the previous example.
\begin{theorem}[$p$-series Convergence]
The $p$-series $\displaystyle \sum_{n=1}^\infty \frac{1}{n^p}$ is convergent if $p > 1$ and divergent if $p \leq 1$.
\end{theorem}
\end{frame}
% end module p-series



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/integral-test-ex4.tex
% begin module integral-test-ex4
\begin{frame}
\begin{example}[Example 4, p. 736]
Test the series $\displaystyle \sum_{n=1}^\infty \frac{\ln n}{n}$ for convergence.
\begin{itemize}
\item<2->  $f(x) = \frac{\ln x}{x}$ is continuous and positive.
\item<3->  It's not obvious if it's decreasing, so take the derivative.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\uncover<4->{%
\[
f'(x) = \frac{\left(\frac{1}{x}\right)(x) - (\ln x)(1)}{x^2} %
\uncover<5->{ = \frac{1-\ln x}{x^2}}
\]
}%
\item<6->  This is negative for all \alert<handout:0| 6-7>{$x >$ \uncover<7->{$e$.}}
\item<8->  Therefore $f$ is decreasing for all $x > e$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<9->{\int_1^\infty \frac{\ln x}{x}\diff x} & \uncover<9->{ = } & \uncover<9->{\lim_{t\to\infty} \int_1^t \alert<handout:0| 10-11>{\frac{\ln x}{x}}\diff x} %
 \uncover<10->{ = } %
\uncover<10->{\lim_{t\to\infty}\left[ \uncover<11->{\alert<handout:0| 11>{\frac{(\ln x)^2}{2}}}\right]_{\alert<handout:0| 13-14>{1}}^{\alert<handout:0| 12>{t}}}\\
 & \uncover<12->{ = } & %
\uncover<12->{\alert<handout:0| 15-16>{\lim_{t\to\infty}}\left( \alert<handout:0| 12,15-16>{\frac{1}{2}(\ln t)^2} - \uncover<14->{\alert<handout:0| 14>{0}} \right)} %
 \uncover<15->{ = } %
\uncover<16->{\alert<handout:0| 16>{\infty}}
\end{eqnarray*}
\uncover<17->{%
Therefore $\sum_{n=1}^\infty \frac{\ln n}{n}$ is \uncover<18->{divergent.}%
}%
\end{example}
\end{frame}
% end module integral-test-ex4



\subsection{Estimating Sums}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/integral-test-estimate.tex
% begin module integral-test-estimate
\begin{frame}
\frametitle{Estimating the Sum of a Series}
\begin{itemize}
\item  Suppose we have already used the Integral Test to show that $\sum a_n$ converges.
\item  Now we want to find an approximation to the sum of the series.
\item<2->  Any partial sum $s_n$ is an approximation.  But how good?
\item<3->  Estimate the size of the remainder $R_n = s - s_n = a_{n+1}+a_{n+2}+a_{n+3}+\cdots $.
\item<4->  Suppose $f(n) = a_n$.  Draw rectangles with heights $a_{n+1}, a_{n+2}, \ldots$.
\item<5->  Use the right endpoints to find the height: then the rectangles are under the curve $y = f(x)$.
\item<6->  $R_n = a_{n+1}+a_{n+2}+a_{n+3}+\cdots \leq \int_n^\infty f(x)\diff x$.
\item<5->  Use the left endpoints to find the height: then the rectangles are above the curve $y = f(x)$.
\item<7->  $R_n = a_{n+1}+a_{n+2}+a_{n+3}+\cdots \geq \int_{n+1}^\infty f(x)\diff x$.
\end{itemize}
\end{frame}


\begin{frame}
Remainder Estimate for the Integral Test

Suppose $f(k) = a_k$, where $f$ is continuous, positive, and decreasing for $x\geq n$, and $\sum a_k$ is convergent with sum $s$.  If $R_n = s - s_n$, then
\[
\int_{n+1}^\infty f(x)\diff x \leq R_n \leq \int_n^\infty f(x)\diff x%
\]
\end{frame}
% end module integral-test-estimate



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/integral-test-estimate-ex5.tex
% begin module integral-test-estimate-ex5
\begin{frame}
\begin{example}[Example 5, p. 737]
Approximate the sum of $\sum \frac{1}{n^3}$ using the first 10 terms.  Estimate the error involved in this approximation.  How many terms are required to get an accuracy of $0.0005$ or better?
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<2->{%
\alert<handout:0| 2-3>{\int_{\alert<handout:0| 8>{n}}^\infty \frac{1}{x^3}\diff x =} %
}%
\uncover<3->{%
\alert<handout:0| 2-3>{\lim_{t\to\infty} \left[ -\frac{1}{2x^2}\right]_n^t} %
}%
\uncover<4->{%
 = \alert<handout:0| 4-5>{\lim_{t\to\infty}\left( -\frac{1}{2t^2}+\frac{1}{2n^2}\right) = } %
}%
\uncover<5->{%
\alert<handout:0| 4-5>{\frac{1}{2\alert<handout:0| 8>{n}^2}}%
}%
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<6->{%
\sum_{n=1}^\infty \frac{1}{n^3} \approx s_{10} = \frac{1}{1^3} + \frac{1}{2^3} + \cdots + \frac{1}{10^3} \approx 1.975%
}%
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<7->{%
R_{10}\leq \alert<handout:0| 7>{\int_{\alert<handout:0| 8>{10}}^\infty \frac{1}{x^3}\diff x =}%
}%
\uncover<8->{%
\frac{1}{2(\alert<handout:0| 8>{10})^2}
}%
\uncover<9->{%
 = \frac{1}{200}%
}%
\]
\uncover<10->{Therefore the error is at most $0.005$.}

\uncover<11->{To get an accuracy of $0.0005$ or better, we want $R_n \leq 0.0005$.  Since $R_n \leq \frac{1}{2n^2}$, we want}
\[
\uncover<11->{%
\frac{1}{2n^2} \leq 0.0005, \qquad \textrm{or}\qquad n \geq \sqrt{1000} \approx 31.6
}%
\]
\end{example}
\end{frame}
% end module integral-test-estimate-ex5



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/integral-test-estimate-improvement.tex
% begin module integral-test-estimate-improvement
\begin{frame}
\[
\begin{array}{rcccl}
\int_{n+1}^\infty f(x)\diff x & \leq & R_n & \leq & \int_n^\infty f(x)\diff x \\%
\uncover<2->{\alert<handout:0| 2>{s_n}+\int_{n+1}^\infty f(x)\diff x} & \uncover<2->{\leq} & \uncover<2->{\alert<handout:0| 3-4>{\alert<handout:0| 2>{s_n}+R_n}} & \uncover<2->{\leq} & \uncover<2->{\alert<handout:0| 2>{s_n} + \int_n^\infty f(x)\diff x} \\%
\uncover<3->{\alert<handout:0| 2>{s_n}+\int_{n+1}^\infty f(x)\diff x} & \uncover<3->{\leq} & \uncover<4->{\alert<handout:0| 3-4>{s}} & \uncover<3->{\leq} & \uncover<3->{\alert<handout:0| 2>{s_n} + \int_n^\infty f(x)\diff x} \\%
\end{array}
\]
\begin{itemize}
\item<2->  Add $s_n$ to both sides of both inequalities.
\item<5->  This gives upper and lower bounds for $s$.
\item<6->  This is a better approximation than just using $s_n$.
\end{itemize}
\end{frame}
% end module integral-test-estimate-improvement



\section{The Comparison Test}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/comparison-intro.tex
% begin module comparison-intro
\begin{frame}
\frametitle{(12.4)  The Comparison Tests}
\begin{itemize}
\item  In the Comparison Tests, the idea is to compare a given series with another series that is known to be convergent or divergent.
\item  Consider the series $\sum_{n=1}^\infty \frac{1}{2^n+1}$.
\item<1-| alert@2-3>  This reminds us of the series \uncover<3->{$\sum_{n=1}^\infty \frac{1}{2^n}$.}
\item<4->  $\sum_{n=1}^\infty \frac{1}{2^n}$ is a geometric series with \alert<handout:0| 4-5>{$a = $ \uncover<5->{$\frac{1}{2}$}} and \alert<handout:0| 6-7>{$r = $ \uncover<7->{$\frac{1}{2}$.}}
\item<8-| alert@8-9>  Therefore $\sum_{n=1}^\infty \frac{1}{2^n}$ is \uncover<9->{convergent.}
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<10->{%
\alert<handout:0| 10-11>{%
 \frac{1}{2^i+1}}}%
& \uncover<11->{\alert<handout:0| 11>{ < }} &%
\uncover<10->{%
\alert<handout:0| 10-11>{%
\frac{1}{2^i}%
}%
}\\%
\uncover<12->{%
\alert<handout:0| 12>{\sum_{i=1}^n} \frac{1}{2^i+1}%
}%
& \uncover<12->{ < } &%
\uncover<12->{%
\alert<handout:0| 12>{\sum_{i=1}^{\alert<handout:0| 13>{n}}} \frac{1}{2^i}%
}%
\uncover<13->{%
 < \alert<handout:0| 14-15>{\sum_{i=1}^{\alert<handout:0| 13>{\infty}} \frac{1}{2^i} \uncover<14->{ = }}%
}%
\uncover<15->{%
\alert<handout:0| 15>{1}%
}%
\end{eqnarray*}
\begin{itemize}
\item<16->  The partial sums of $\sum_{n=1}^\infty \frac{1}{2^n+1}$ are increasing and are bounded above by 1.
\item<17-| alert@17-18>  Therefore $\sum_{n=1}^\infty \frac{1}{2^n+1}$ is \uncover<18->{convergent.}
\end{itemize}
\end{frame}
% end module comparison-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/comparison-theorem.tex
% begin module comparison-theorem
\begin{frame}
\begin{theorem}[The Comparison Test]
Suppose that $\sum a_n$ and $\sum b_n$ are series with positive terms.
\begin{enumerate}
\item  If $\sum b_n$ is convergent and $a_n \leq b_n$ for all $n$, then $\sum a_n$ is also convergent.
\item  If $\sum b_n$ is divergent and $a_n \geq b_n$ for all $n$, then $\sum a_n$ is also divergent.
\end{enumerate}
\end{theorem}
\uncover<2->{%
When we use the Comparison Test, we need to have some series $\sum b_n$ that we know in order to make a comparison.  Usually $\sum b_n$ is one of
}%
\begin{itemize}
\item<2->  A $p$-series \uncover<3->{($\sum \frac{1}{n^p}$ \alert<handout:0| 3-4>{converges if \uncover<4->{$p>1$}} and \alert<handout:0| 5-6>{diverges if \uncover<6->{$p\leq 1$}})}
\item<2->  A geometric series \uncover<7->{($\sum a r^{n-1}$ \alert<handout:0| 7-8>{converges if \uncover<8->{$|r| <1$}} and \alert<handout:0| 9-10>{diverges if \uncover<10->{$|r| \geq 1$}})}
\end{itemize}
\end{frame}
% end module comparison-theorem



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/comparison-ex1.tex
% begin module comparison-ex1
\begin{frame}
\begin{example}[Example 1, p. 742]
Determine if $\sum_{n=1}^\infty \frac{5}{2n^2+4n+3}$ converges or diverges.
\begin{itemize}
\item<2->  As $n\to \infty$, the dominant term in the denominator is $2n^2$, so compare with $\frac{5}{2n^2}$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<2->{%
\alert<handout:0| 2-3>{%
\frac{5}{2n^2+4n+3} \uncover<3->{<} \frac{5}{2n^2}%
}}%
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<4->{%
\sum_{n=1}^\infty \frac{5}{2n^2} = \frac{5}{2}\sum_{n=1}^\infty \frac{1}{n^{\alert<handout:0| 6>{2}}}%
}%
\]
\begin{itemize}
\item<5->  This is a constant times a $p$-series with \alert<handout:0| 5-6>{$p = $ \uncover<6->{$2 > 1$.}}
\item<7-| alert@7-8>  Therefore $\sum_{n=1}^\infty \frac{5}{2n^2}$ is \uncover<8->{convergent.}
\item<9-| alert@9-10>  Therefore $\sum_{n=1}^\infty \frac{5}{2n^2+4n+3}$ is \uncover<10->{convergent} by the Comparison Test.
\end{itemize}
\end{example}
\end{frame}
% end module comparison-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/comparison-ex2.tex
% begin module comparison-ex2
\begin{frame}
\begin{example}[Example 2, p. 742]
Determine if $\sum_{n=1}^\infty \frac{\ln n}{n}$ converges or diverges.
\begin{itemize}
\item<2->  We could use the Integral Test to find this.
\item<3->  The Comparison Test is even easier.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<4->{%
\alert<handout:0| 4-5>{%
\frac{\ln n}{n} \uncover<5->{ > } \frac{1}{n} \qquad \textrm{if} \ n \geq 3
}}%
\]
\begin{itemize}
\item<6->  $\sum_{n=1}^\infty \frac{1}{n}$ is a $p$-series with \alert<handout:0| 6-7>{$p = $ \uncover<7->{1.}}
\item<8-| alert@8-9>  Therefore $\sum_{n=1}^\infty \frac{1}{n}$ is \uncover<9->{divergent.}
\item<10-| alert@10-11>  Therefore $\sum_{n=1}^\infty \frac{\ln n}{n}$ is \uncover<11->{divergent} by the Comparison Test.
\end{itemize}
\end{example}
\end{frame}
% end module comparison-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/limit-comparison-intro.tex
% begin module limit-comparison-intro
\begin{frame}
In order to use the comparison test to see if $\sum a_n$ is convergent or divergent, we need the terms $a_n$ to be
\begin{enumerate}
\item  \alert<1-2>{smaller} than the terms of a \alert<1-2>{convergent} series, or
\item  \alert<1-2>{bigger} than the terms of a \alert<1-2>{divergent} series.
\end{enumerate}

\uncover<2->{%
If the terms $a_n$ are
\begin{enumerate}
\item  \alert<handout:0| 6>{\alert<1-2>{bigger} than the terms of a \alert<1-2>{convergent} series}, or
\item  \alert<1-2>{smaller} than the terms of a \alert<1-2>{divergent} series,
\end{enumerate}
then \alert<handout:0| 6>{the Comparison Test gives no information}.
}%
\begin{itemize}
\item<3->  Consider the series $\sum_{n=1}^\infty \frac{1}{2^n-1}$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<4->{%
\alert<handout:0| 4-5>{%
\frac{1}{2^n-1} \uncover<5->{ > } \frac{1}{2^n}
}}%
\]
\begin{itemize}
\item<6->  The Comparison Test tells us nothing here.
\item<7->  Nevertheless, we think $\sum \frac{1}{2^n-1}$ should converge, because it's so close to $\sum \frac{1}{2^n}$.
\end{itemize}
\end{frame}
% end module limit-comparison-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/limit-comparison-theorem.tex
% begin module limit-comparison-theorem
\begin{frame}
\begin{theorem}[The Limit Comparison Test]
Suppose that $\sum a_n$ and $\sum b_n$ are series with positive terms.  If
\[
\lim_{n\to\infty} \frac{a_n}{b_n} = c
\]
where \alert<handout:0| 2>{$c$ is a finite number and $c > 0$}, then either both series converge or both series diverge.
\end{theorem}
\uncover<2->{%
The main thing to check is that $c$ is finite and non-zero.%
}%
\end{frame}
% end module limit-comparison-theorem



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/limit-comparison-ex3.tex
% begin module limit-comparison-ex3
\begin{frame}
\begin{example}[Example 3, p. 743]
Test the series $\sum_{n=1}^\infty \frac{1}{2^n-1}$ for convergence or divergence.

\uncover<2->{%
Use the Limit Comparison Test with
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
a_n = \frac{1}{2^n-1}, \qquad b_n = \frac{1}{2^n}
\]
}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<3->{%
\lim_{n\to\infty} \frac{a_n}{b_n}%
}%
& \uncover<3->{ = } &%
\uncover<3->{%
\lim_{n\to\infty} \frac{\frac{1}{2^n-1}}{\frac{1}{2^n}}%
}\\%
& \uncover<4->{ = } &%
\uncover<4->{%
\lim_{n\to\infty} \frac{2^n}{\alert<handout:0| 5>{2^n}-1}\uncover<5->{\alert<handout:0| 5>{\cdot \frac{\frac{1}{2^n}}{\frac{1}{2^n}}}}%
}\\%
& \uncover<6->{ = } &%
\uncover<6->{%
\lim_{n\to\infty} \frac{1}{1-\frac{1}{2^n}}%
}%
\uncover<7->{%
 = 1 > 0%
}%
\end{eqnarray*}
\begin{itemize}
\item<8-| alert@8-9>  $\sum \frac{1}{2^n}$ is a \uncover<9->{convergent} geometric series.
\item<10->  By the Limit Comparison Test $\sum \frac{1}{2^n-1}$ is convergent too.%
\end{itemize}
\end{example}
\end{frame}
% end module limit-comparison-ex3



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/limit-comparison-ex4.tex
% begin module limit-comparison-ex4
\begin{frame}
\begin{example}[Example 4, p. 743]
Test the series $\sum_{n=1}^\infty \frac{2n^2+3n}{\sqrt{5+n^5}}$ for convergence or divergence.

\begin{itemize}
\item<2->  \alert<handout:0| 2-3>{The dominant part of the numerator is \uncover<3->{$2n^2$}} and \alert<handout:0| 4-5>{the dominant part of the denominator is \uncover<5->{$\sqrt{n^5} = n^{5/2}$.}}
\end{itemize}
\uncover<2->{%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
a_n = \frac{\alert<handout:0| 3>{2n^2} + 3n}{\sqrt{5+\alert<handout:0| 5>{n^5}}}, \qquad b_n = \frac{\uncover<3->{\alert<handout:0| 3>{2n^2}}}{\uncover<5->{\alert<handout:0| 5>{n^{5/2}}}} \uncover<6->{=  \frac{2}{n^{1/2}}}
\]
}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<7->{%
\lim_{n\to\infty} \frac{a_n}{b_n}%
}%
& \uncover<7->{ = } &%
\uncover<7->{%
\lim_{n\to\infty} \frac{2n^2+3n}{\sqrt{5+n^5}}\cdot \frac{n^{1/2}}{2}%
}  \uncover<8->{ = } \uncover<8->{%
\lim_{n\to\infty} \frac{2n^{5/2} + 3n^{3/2}}{2\sqrt{5+\alert<handout:0| 9>{n^5}}}\uncover<9->{\alert<handout:0| 9>{\frac{\frac{1}{n^{5/2}}}{\frac{1}{n^{5/2}}}}}%
}\\%
& \uncover<10->{ = } &%
\uncover<10->{%
\lim_{n\to\infty} \frac{2 + \frac{3}{n}}{2\sqrt{\frac{5}{n^5} + 1}}%
}%
\uncover<11->{%
 = 1 > 0%
}%
\end{eqnarray*}
\begin{itemize}
\item<12->  $\sum \frac{2}{n^{\alert<handout:0| 13>{1/2}}}$ is a constant multiple of a $p$-series with \alert<handout:0| 12-13>{$p = $ \uncover<13->{$\frac{1}{2}$.}}
\item<14-| alert@14-15> Therefore $\sum \frac{2}{n^{1/2}}$ is \uncover<15->{divergent}\uncover<16->{, and so is $\sum  \frac{2n^2+3n}{\sqrt{5+n^5}}$.}%
\end{itemize}
\end{example}
\end{frame}
% end module limit-comparison-ex4



}

\lect{Spring 2015}{Lecture 12}{12}{
\section{Alternating Series}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/alternating-def.tex
% begin module alternating-def
\begin{frame}
\frametitle{Alternating Series}
\begin{definition}[Alternating Series]
An alternating series is a series whose terms are alternately positive and negative.
\end{definition}
\uncover<2->{%
\begin{examples}
Here are two examples:
\abovedisplayskip=0pt
\[
\begin{array}{r@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }c@{\ }l}
\alert<handout:0| 3-6>{1} &%
\alert<handout:0| 7-8>{-} &%
\frac{\alert<handout:0| 5-6>{1}}{\alert<handout:0| 3-4>{2}} &%
 + &%
\frac{\alert<handout:0| 5-6>{1}}{\alert<handout:0| 3-4>{3}} &%
\alert<handout:0| 7-8>{-} &%
\frac{\alert<handout:0| 5-6>{1}}{\alert<handout:0| 3-4>{4}} &%
 + &%
\frac{\alert<handout:0| 5-6>{1}}{\alert<handout:0| 3-4>{5}} &%
\alert<handout:0| 7-8>{-} &%
\frac{\alert<handout:0| 5-6>{1}}{\alert<handout:0| 3-4>{6}} &%
 + &%
\cdots &%
\displaystyle  = \sum_{n=1}^\infty \uncover<8->{\alert<handout:0| 8>{(-1)^{n-1}}}\frac{\uncover<6->{\alert<handout:0| 6>{1}}}{\uncover<4->{\alert<handout:0| 4>{n}}} \\%
\alert<handout:0| 13-14>{-} %
\frac{\alert<handout:0| 11-12>{1}}{\alert<handout:0| 9-10>{2}} &%
 + &%
\frac{\alert<handout:0| 11-12>{2}}{\alert<handout:0| 9-10>{3}} &%
\alert<handout:0| 13-14>{-} &%
\frac{\alert<handout:0| 11-12>{3}}{\alert<handout:0| 9-10>{4}} &%
 + &%
\frac{\alert<handout:0| 11-12>{4}}{\alert<handout:0| 9-10>{5}} &%
\alert<handout:0| 13-14>{-} &%
\frac{\alert<handout:0| 11-12>{5}}{\alert<handout:0| 9-10>{6}} &%
 + &%
\frac{\alert<handout:0| 11-12>{6}}{\alert<handout:0| 9-10>{7}} &%
\alert<handout:0| 13-14>{-} &%
\cdots &%
\displaystyle  = \sum_{n=1}^\infty \uncover<14->{\alert<handout:0| 14>{(-1)^{n}}}\frac{\uncover<12->{\alert<handout:0| 12>{n}}}{\uncover<10->{\alert<handout:0| 10>{n+1}}} %
\end{array}
\]
\end{examples}
}%
%\begin{itemize}
\uncover<15->{The $n$th term of an alternating series has the form}
\[
\uncover<15->{%
a_n = (-1)^{n-1}b_n \qquad \textrm{or}\qquad a_n = (-1)^n b_n
}%
\]
\uncover<15->{where $b_n$ is positive.}
%\end{itemize}
\end{frame}
% end module alternating-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/alternating-theorem.tex
% begin module alternating-theorem
\begin{frame}
\begin{theorem}[The Alternating Series Test]
If the alternating series
\[
\sum_{n=1}^\infty (-1)^{n-1} b_n = b_1 - b_2 + b_3 - b_4 + b_5 - \cdots , \qquad b_n > 0 
\]
satisfies
\begin{enumerate}
\item  $b_{n+1} \leq b_n$ for all $n$ and
\item  $\lim_{n\to\infty}b_n = 0$
\end{enumerate}
then the series is convergent.
\end{theorem}
\end{frame}
% end module alternating-theorem



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/alternating-ex1.tex
% begin module alternating-ex1
\begin{frame}
\begin{example} %[Example 1, p. 747]
The alternating harmonic series
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \cdots = \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n}
\]
satisfies
\begin{enumerate}
\item  $b_{n+1} < b_n$ because $\frac{1}{n+1} < \frac{1}{n}$.
\item  $\lim_{n\to\infty} b_n = $\alert<handout:0| 2-3>{$\lim_{n\to\infty} \frac{1}{n}$ \uncover<2->{$ = $} \uncover<3->{\alert<handout:0| 4>{$0$}.}}
\end{enumerate}
\uncover<4->{Therefore the series is \alert<handout:0| 4>{convergent} by the Alternating Series Test.}
\end{example}
\end{frame}
% end module alternating-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/alternating-ex2.tex
% begin module alternating-ex2
\begin{frame}
\begin{example} %[Example 2, p. 747]
The series $\sum_{n=1}^\infty (-1)^n \frac{3n}{4n-1}$ is alternating, but
\[
\lim_{n\to\infty} b_n = \lim_{n\to\infty} \frac{3n}{4\alert<handout:0| 2>{n}-1}\uncover<2->{\alert<handout:0| 2>{\cdot \frac{\frac{1}{n}}{\frac{1}{n}}}}%
\uncover<3->{%
 = \lim_{n\to\infty} \frac{3}{4-\frac{1}{n}}%
}%
\uncover<4->{%
 = \alert<handout:0| 5>{\frac{3}{4}}%
}%
\]
\uncover<5->{Therefore the series is \alert<handout:0| 5>{divergent} by the Alternating Series Test.}
\end{example}
\end{frame}
% end module alternating-ex2



\subsection{Estimating Sums}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/alternating-estimate.tex
% begin module alternating-estimate
\begin{frame}
\frametitle{Estimating Sums}
This theorem allows us to estimate the size of the remainder $R_n = s - s_n$ in an alternating series.
\begin{theorem}[Alternating Series Estimation Theorem]
Let $\displaystyle \sum (-1)^{n-1} b_n$ be the sum of an alternating series that satisfies
\begin{enumerate}
\item  $0\leq b_{n+1}\leq b_n$ and
\item  $\displaystyle \lim_{n\to\infty} b_n = 0$.
\end{enumerate}
Then the size of the error is less than the first omitted term; that is,
\[
|R_n| = |s - s_n| \leq b_{n+1}.
\]
\end{theorem}
\end{frame}
% end module alternating-estimate



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/alternating-estimate-ex4.tex
% begin module alternating-estimate-ex4
\begin{frame}
\begin{example} %[Example 4, p. 749]
Find the sum of $\sum_{n=0}^\infty \frac{(-1)^n}{n!}$ correct to three decimal places.  (\alert<handout:0| 10>{$0! = 1$}.)
\begin{enumerate}
\item<2->  $\displaystyle b_{n+1} = \frac{1}{(n+1)!} \uncover<3->{ = \frac{1}{n!(n+1)} } \uncover<4->{ < \frac{1}{n!} = b_n.}$
\item<5->  $\displaystyle 0 < \frac{1}{n!} \uncover<6->{ < \frac{1}{n} }\uncover<7->{ \to 0 }$\uncover<7->{, so } \uncover<7->{$\displaystyle b_n \to 0$ as $n\to \infty$.}
\end{enumerate}
\begin{itemize}
\item<8->  Therefore the series converges by the Alternating Series Test.
%\item<9->  Compute the first few terms:
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<9->{s} & \uncover<9->{=} & \uncover<9->{\alert<handout:0| 12>{\alert<handout:0| 10>{\frac{1}{0!}} - \frac{1}{1!} + \frac{1}{2!} - \frac{1}{3!} + \frac{1}{4!} - \frac{1}{5!} + \frac{1}{6!}} - \alert<handout:0| 11>{\frac{1}{7!}} + \cdots}\\
 & \uncover<10->{=} & \uncover<10->{\alert<handout:0| 12>{\alert<handout:0| 10>{1} - 1 + \frac{1}{2} - \frac{1}{6} + \frac{1}{24} - \frac{1}{120} + \frac{1}{720}} - \alert<handout:0| 11>{\frac{1}{5040}} + \cdots}
\end{eqnarray*}
\begin{itemize}
\item<11-| alert@11,13>  $|s - s_6| \leq b_7 = \frac{1}{5040} < 0.0002$.
\item<12-| alert@12>  $s_6 = 1 - 1 + \frac{1}{2} - \frac{1}{6} + \frac{1}{24} - \frac{1}{120} + \frac{1}{720} \approx 0.36\alert<handout:0| 13>{80}56$.
\item<13->  The error of less than $0.0002$ doesn't affect the third decimal place\uncover<14->{, so $s \approx s_6 \approx 0.368$.}
\end{itemize}
\end{example}
\end{frame}
% end module alternating-estimate-ex4



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/absolute-convergence-intro.tex
% begin module absolute-convergence-intro
\begin{frame}
\frametitle{Absolute Convergence and the Ratio and Root Tests}
In this section, we start with any series $\displaystyle \sum a_n$ and consider the corresponding series
\[
\sum |a_n| = |a_1| + |a_2| + |a_3| + \cdots
\]
consisting of the absolute values of the terms of the original series.
\end{frame}
% end module absolute-convergence-intro



\subsection{Absolute Convergence}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/absolute-convergence-def.tex
% begin module absolute-convergence-def
\begin{frame}
\frametitle{Absolute Convergence}
\begin{definition}[Absolutely Convergent]
A series $\displaystyle \sum a_n$ is called absolutely convergent if the series of absolute values $\displaystyle \sum |a_n|$ is convergent.
\end{definition}
\uncover<2->{%
If $\displaystyle \sum a_n$ is a series with all positive terms, then $|a_n| = a_n$ and absolute convergence is the same thing as convergence in this case.%
}%
\end{frame}
% end module absolute-convergence-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/absolute-convergence-ex1.tex
% begin module absolute-convergence-ex1
\begin{frame}
\begin{example} %[Example 1, p. 750]
The series
\[
\sum_{n=1}^\infty \frac{(-1)^{n-1}}{n^2} = 1 - \frac{1}{2^2} + \frac{1}{3^2} - \frac{1}{4^2} + \cdots%
\]
is absolutely convergent because
\[
\sum_{n=1}^\infty \left| \frac{(-1)^{n-1}}{n^2}\right|  = 1 + \frac{1}{2^2} + \frac{1}{3^2} + \frac{1}{4^2} + \cdots%
\]
is a convergent $p$-series with $p = 2$.
\end{example}
\end{frame}
% end module absolute-convergence-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/absolute-convergence-ex2.tex
% begin module absolute-convergence-ex2
\begin{frame}
\begin{example} %[Example 2, p. 751]
The alternating harmonic series
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=1}^\infty \frac{(-1)^{n-1}}{n} = 1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \cdots%
\]
is convergent (by the alternating series test, as already demonstrated).
\begin{itemize}
\item<2->  Is it absolutely convergent?
\[
\uncover<2->{%
\sum_{n=1}^\infty \left| \frac{(-1)^{n-1}}{n}\right|  = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \cdots%
}%
\]
\item<3->  This is a $p$-series with \alert<handout:0| 3-4>{$p = \uncover<4->{1.}$}
\item<5->  Therefore $\sum_{n=1}^\infty \left|\frac{(-1)^{n-1}}{n}\right|$ is \uncover<6->{\alert<handout:0| 6>{divergent.}}
\item<5->  Therefore $\sum_{n=1}^\infty \frac{(-1)^{n-1}}{n}$ is \uncover<7->{\alert<handout:0| 7>{not absolutely convergent.}}
\end{itemize}
\end{example}
\end{frame}
% end module absolute-convergence-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/conditional-convergence-def.tex
% begin module conditional-convergence-def
\begin{frame}
\begin{definition}[Conditionally Convergent]
A series $\displaystyle \sum a_n$ is called conditionally convergent if it is convergent but not absolutely convergent.
\end{definition}
\begin{itemize}
\item<2->  The alternating harmonic series is conditionally convergent.
\item<3->  Therefore it is possible for a series to be convergent but not absolutely convergent.
\item<4->  Question: Is it possible for a series to be absolutely convergent but not convergent?
\item<5->  Answer: No.  This is the content of the next theorem.
\end{itemize}
\end{frame}
% end module conditional-convergence-def



% WARNING:  I lack a proof of the fact that absolute convergence
% implies convergence.  I should add it to this next module.
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/absolute-implies-convergence.tex
% begin module absolute-implies-convergence
\begin{frame}
\begin{theorem}[Absolute Convergence Implies Convergence]
If a series is absolutely convergent, then it is convergent.
\end{theorem}
\end{frame}
% end module absolute-implies-convergence



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/absolute-convergence-ex3.tex
% begin module absolute-convergence-ex3
\begin{frame}
\begin{example} %[Example 3, p. 751]
Determine whether
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=1}^\infty \frac{\cos n}{n^2} = \frac{\cos 1}{1^2} + \frac{\cos 2}{2^2} + \frac{\cos 3}{3^2} + \frac{\cos 4}{4^2} + \cdots%
\]
is convergent or divergent.
\begin{itemize}
\item<2->  The series has positive and negative terms, but is not alternating.
\item<3->  Use the Comparison Test:
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\displaystyle \begin{array}{rcccl}
\uncover<3->{%
0%
}%
& \uncover<3->{ \leq } & %
\uncover<3->{%
| \cos n |%
}%
& \uncover<3->{ \leq } & %
\uncover<3->{%
1%
}\\%
\uncover<4->{%
0%
}%
& \uncover<4->{ \leq } & %
\uncover<4->{%
\displaystyle \frac{| \cos n |}{\alert<handout:0| 4>{n^2}}%
}%
& \uncover<4->{ \leq } & %
\uncover<4->{%
\displaystyle \frac{1}{\alert<handout:0| 4>{n^2}}%
}%
\end{array}
\]
\vspace{-.5cm}
\begin{itemize}
\item<5->  $\sum \frac{1}{n^2}$ is a $p$-series with \alert<handout:0| 5-6>{$p = \uncover<6->{2.}$}
\item<7->  Therefore $\sum \frac{1}{n^2}$ is \uncover<8->{\alert<handout:0| 8>{convergent},} and so by the Comparison Test, $\sum \frac{|\cos n|}{n^2}$ is also \uncover<8->{\alert<handout:0| 8>{convergent}.}
\item<9->  Therefore $\sum \frac{\cos n}{n^2}$ is absolutely convergent.
\item<10->  Therefore by the previous theorem, $\sum \frac{\cos n}{n^2}$ is convergent.
\end{itemize}
\end{example}
\end{frame}
% end module absolute-convergence-ex3



\section{Absolute Convergence and the Ratio and Root Tests}
\subsection{The Ratio Test}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/ratio-test.tex
% begin module ratio-test
\begin{frame}
\frametitle{The Ratio Test}
\begin{theorem}[The Ratio Test]
\begin{enumerate}
\item  If $\displaystyle \lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right| = L < 1$, then the series $\sum a_n$ is absolutely convergent (and therefore convergent).
\item  If $\displaystyle \lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right| = L > 1$ or $\displaystyle \lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right| = \infty$, then the series $\sum a_n$ is divergent.
\item  If $\displaystyle \lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right| = L = 1$, then the Ratio Test is inconclusive.
\end{enumerate}
\end{theorem}
\end{frame}
% end module ratio-test



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/ratio-test-inconclusive.tex
% begin module ratio-test-inconclusive
\begin{frame}
\alert<handout:0| 21>{The Ratio Test is inconclusive if $\displaystyle \lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right| = 1.$}

\uncover<2->{%
\begin{example}
\begin{columns}
\column{.2\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=1}^\infty \frac{1}{n^2}
\]
\column{.8\textwidth}
\begin{itemize}
\item<3->  This is a $p$-series with \alert<handout:0| 3-4>{$p = \uncover<4->{2.}$}
\item<3->  Therefore it is \uncover<5->{\alert<handout:0| 5,21>{convergent}.}
\end{itemize}
\end{columns}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<6->{%
\left| \frac{a_{n+1}}{a_n}\right|  = \frac{\frac{1}{(n+1)^2}}{\frac{1}{n^2}}%
}%
\uncover<7->{%
 = \frac{n^2}{(n+1)^2}\uncover<8->{\alert<handout:0| 8>{\cdot \frac{\frac{1}{n^2}}{\frac{1}{n^2}}}}%
}%
\uncover<9->{%
\alert<handout:0| 10-11>{%
 = \frac{1}{\left( 1 + \frac{1}{n}\right)^2}%
}%
}%
\uncover<10->{%
\alert<handout:0| 10-11>{%
 \to \uncover<11->{\alert<handout:0| 21>{1}} \qquad \textrm{ as } n\to\infty
}%
}%
\]
\end{example}

\begin{example}
\begin{columns}
\column{.2\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=1}^\infty \frac{1}{n}
\]
\column{.8\textwidth}
\begin{itemize}
\item<12->  This is a $p$-series with \alert<handout:0| 12-13>{$p = \uncover<13->{1.}$}
\item<12->  Therefore it is \uncover<14->{\alert<handout:0| 14,21>{divergent}.}
\end{itemize}
\end{columns}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<15->{%
\left| \frac{a_{n+1}}{a_n}\right|  = \frac{\frac{1}{n+1}}{\frac{1}{n}}%
}%
\uncover<16->{%
 = \frac{n}{n+1}\uncover<17->{\alert<handout:0| 17>{\cdot \frac{\frac{1}{n}}{\frac{1}{n}}}}%
}%
\uncover<18->{%
\alert<handout:0| 19-20>{%
 = \frac{1}{ 1 + \frac{1}{n}}%
}%
}%
\uncover<19->{%
\alert<handout:0| 19-20>{%
 \to \uncover<20->{\alert<handout:0| 21>{1}} \qquad \textrm{ as } n\to\infty
}%
}%
\]
\end{example}

}%
\end{frame}
% end module ratio-test-inconclusive



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/ratio-test-ex4.tex
% begin module ratio-test-ex4
\begin{frame}
\begin{example} %[Example 4, p. 753]
Test the series $\displaystyle \sum_{n=1}^\infty (-1)^n \frac{n^3}{3^n}$ for absolute convergence.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\left| \frac{a_{n+1}}{a_n}\right| %
}%
 & \uncover<2->{=} & %
\uncover<2->{%
\left| \frac{(-1)^{n+1}\frac{(n+1)^3}{3^{n+1}}}{(-1)^n\frac{n^3}{3^n}}\right| %
}\\%
 & \uncover<3->{=} & %
\uncover<3->{%
\frac{(n+1)^3}{3^{n+1}}\cdot \frac{3^n}{n^3}%
}\\%
 & \uncover<4->{=} & %
\uncover<4->{%
\frac{1}{3} \left( \frac{n+1}{n}\right)^3%
}\\%
 & \uncover<5->{=} & %
\uncover<5->{%
\alert<handout:0| 6-7>{%
\frac{1}{3} \left( 1 + \frac{1}{n}\right)^3%
}%
}\\%
 & \uncover<6->{\alert<handout:0| 6-7>{\to}} & %
\uncover<7->{%
\alert<handout:0| 6-7,9>{%
\frac{1}{3} \uncover<9->{ < 1 }
}%
}%
\end{eqnarray*}
\uncover<8->{%
Therefore the series is \uncover<9->{\alert<handout:0| 9>{absolutely convergent}} by the Ratio Test.%
}%
\end{example}
\end{frame}
% end module ratio-test-ex4



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/ratio-test-ex5.tex
% begin module ratio-test-ex5
\begin{frame}
\begin{example} %[Example 5, p. 754]
Test the convergence of the series $\displaystyle \sum_{n=1}^\infty \frac{n^n}{n!}$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\left| \frac{a_{n+1}}{a_n}\right| %
}%
 & \uncover<2->{=} & %
\uncover<2->{%
\left| \frac{\frac{(n+1)^{n+1}}{(n+1)!}}{\frac{n^n}{n!}}\right| %
}\\%
 & \uncover<3->{=} & %
\uncover<3->{%
\frac{\alert<handout:0| 4>{(n+1)^{n+1}}}{\alert<handout:0| 5>{(n+1)!}}\cdot \frac{n!}{n^n}%
}\\%
 & \uncover<4->{=} & %
\uncover<4->{%
\frac{\alert<handout:0| 4>{(n+1)(n+1)^{n}}}{\alert<handout:0| 5>{(n+1)n!}}\cdot \frac{n!}{n^n}%
}\\%
 & \uncover<6->{=} & %
\uncover<6->{%
\left( \frac{n+1}{n}\right)^n%
}%
  \uncover<7->{=}  %
\uncover<7->{%
\alert<handout:0| 8-9>{%
\left( 1 + \frac{1}{n}\right)^n%
}%
}\\%
 & \uncover<8->{\alert<handout:0| 8-9>{\to}} & %
\uncover<9->{%
\alert<handout:0| 9,11>{%
e \uncover<11->{ > 1 }
}%
}%
\end{eqnarray*}
\uncover<10->{%
Therefore the series is \uncover<11->{\alert<handout:0| 11>{divergent}} by the Ratio Test.%
}%
\end{example}
\end{frame}
% end module ratio-test-ex5



\subsection{The Root Test}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/root-test.tex
% begin module root-test
\begin{frame}
\frametitle{The Root Test}
\begin{theorem}[The Root Test]
\begin{enumerate}
\item  If $\displaystyle \lim_{n\to\infty} \sqrt[n]{\left| a_n\right|} = L < 1$, then the series $\sum a_n$ is absolutely convergent (and therefore convergent).
\item  If $\displaystyle \lim_{n\to\infty} \sqrt[n]{\left| a_n\right|} = L > 1$ or $\displaystyle \lim_{n\to\infty} \sqrt[n]{\left| a_n\right|} = \infty$, then the series $\sum a_n$ is divergent.
\item  If $\displaystyle \lim_{n\to\infty} \sqrt[n]{\left| a_n\right|} = L = 1$, then the Root Test is inconclusive.
\end{enumerate}
\end{theorem}
\uncover<2->{%
If $L = 1$ in the Ratio Test, don't try the Root Test, because it will be inconclusive too.

If $L = 1$ in the Root Test, don't try the Ratio Test, because it will be inconclusive too.
}%
\end{frame}
% end module root-test



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/series/root-test-ex6.tex
% begin module root-test-ex6
\begin{frame}
\begin{example} %[Example 4, p. 753]
Test convergence of the series $\displaystyle \sum_{n=1}^\infty \left( \frac{2n + 3}{3n+2}\right)^n$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
a_n %
}%
 & \uncover<2->{=} & %
\uncover<2->{%
\left( \frac{2n+3}{3n+2}\right)^n%
}\\%
\uncover<3->{%
\sqrt[n]{\left| a_n\right|} %
}%
 & \uncover<3->{=} & %
\uncover<3->{%
\frac{2n+3}{3\alert<handout:0| 4>{n}+2}\uncover<4->{\alert<handout:0| 4>{\cdot \frac{\frac{1}{n}}{\frac{1}{n}}}}%
}\\%
 & \uncover<5->{=} & %
\uncover<5->{%
\alert<handout:0| 6-7>{%
\frac{2 + \frac{3}{n}}{3+\frac{2}{n}}%
}%
}\\%
 & \uncover<6->{\alert<handout:0| 6-7>{\to}} & %
\uncover<7->{%
\alert<handout:0| 6-7,9>{%
\frac{2}{3} \uncover<9->{ < 1 }
}%
}%
\end{eqnarray*}
\uncover<8->{%
Therefore the series is \uncover<9->{\alert<handout:0| 9>{absolutely convergent}} by the Root Test.%
}%
\end{example}
\end{frame}
% end module root-test-ex6



}% end lecture

% begin lecture
\lect{Spring 2015}{Lecture 13}{13}{
\section{Power Series}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-def.tex
% begin module power-series-def
\begin{frame}
\frametitle{Power Series}
\begin{definition}[Power Series]
A power series is a series of the form
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=0}^\infty c_n x^n = c_0 + c_1 x + c_2 x^2 + c_3x^3 + \cdots%
\]
where $x$ is a variable and the $c_n$'s are constants called the coefficients of the series.
\end{definition}
\begin{itemize}
\item<2->  For each fixed $x$, this is a series of constants which either converges or diverges.
\item<3->  A power series might converge for some values of $x$ and diverge for others.
\item<4->  The sum of the series is a function
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<4->{%
f(x) = c_0 + c_1x + c_2x^2 + c_3x^3 + \cdots %
}%
\]
\uncover<4->{whose domain is the set of all $x$ for which the series converges.}
\item<5->  $f$ resembles a polynomial, except it has infinitely many terms.
\end{itemize}
\end{frame}

\begin{frame}
\begin{definition}[Power Series Centered at $a$]
A series of the form
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=0}^\infty c_n (x-a)^n = c_0 + c_1 (x-a) + c_2 (x-a)^2 + c_3(x-a)^3 + \cdots%
\]
is called a power series centered at $a$ or a power series about $a$ or a power series in $(x-a)$.
\end{definition}
\begin{itemize}
\item<2->  We use the convention that $(x-a)^0 = 1$, even if $x = a$.
\item<3->  If $x = a$, then all terms are $0$ for $n \geq 1$, so the series always converges when $x = a$.
\end{itemize}
\end{frame}
% end module power-series-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-ex1.tex
% begin module power-series-ex1
\begin{frame}
\begin{example} %[Example 1, p. 759]
For what values of $x$ is the series $\sum_{n=0}^\infty n! x^n$ convergent?
\begin{itemize}
\item<2->  Use the Ratio Test.
\item<3->  The $n$th term is $a_n = n! x^n$.
\item<4->  If $x\neq 0$, then
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<4->{%
\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right|%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\lim_{n\to\infty} \left| \frac{\alert<handout:0| 5-6>{(n+1)!}\alert<handout:0| 7-8>{x^{n+1}}}{\alert<handout:0| 5-6>{n!}\alert<handout:0| 7-8>{x^n}}\right|%
}\\%
& \uncover<5->{ = } &%
\uncover<5->{%
\lim_{n\to\infty} \alert<handout:0| 6>{\uncover<6->{(n+1)}}\alert<handout:0| 8>{\uncover<8->{|x|}}%
}\\%
& \uncover<9->{ = } &%
\uncover<9->{%
\infty%
}%
\end{eqnarray*}
\begin{itemize}
\item<10->  Therefore by the Ratio Test the series diverges for all $x\neq 0$.
\item<11->  Therefore the series only converges for $x = 0$.
\end{itemize}
\end{example}
\end{frame}
% end module power-series-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-ex2.tex
% begin module power-series-ex2
\begin{frame}
\begin{example} %[Example 2, p. 759]
For what values of $x$ is the series $\sum_{n=1}^\infty \frac{(x-3)^n}{n}$ convergent?
\begin{itemize}
\item<2->  Use the Ratio Test.
\item<3->  The $n$th term is $a_n = \frac{(x-3)^n}{n}$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<4->{%
\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right|%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\lim_{n\to\infty} \left| \frac{\alert<handout:0| 5-6>{(x-3)^{n+1}}}{\alert<handout:0| 7-8>{n+1}} \cdot \frac{\alert<handout:0| 7-8>{n}}{\alert<handout:0| 5-6>{(x-3)^n}}\right|%
}\\%
& \uncover<5->{ = } &%
\uncover<5->{%
\lim_{n\to\infty} \alert<handout:0| 6>{\uncover<6->{|x-3|}}\alert<handout:0| 8>{\uncover<8->{\frac{n}{\alert<handout:0| 9>{n}+1}}}\uncover<9->{\alert<handout:0| 9>{\cdot \frac{\frac{1}{n}}{\frac{1}{n}}}}%
}%
 \uncover<10->{ = } %
\uncover<10->{%
\lim_{n\to\infty} |x-3| \frac{1}{1 + \frac{1}{n}}%
}%
 \uncover<11->{ = } %
\uncover<11->{%
|x-3|%
}%
\end{eqnarray*}
\begin{itemize}
\item<12->  Therefore by the Ratio Test the series \alert<handout:0| 12-13>{converges absolutely if \uncover<13->{$|x-3| < 1$}} and \alert<handout:0| 14-15>{diverges if \uncover<15->{$|x-3|>1$.}}
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<16->{%
|x-3| < 1 \quad \Leftrightarrow \quad -1 < x -3 < 1 \quad %
}%
\uncover<17->{%
\Leftrightarrow \quad 2 < x < 4%
}%
\]
\vspace{-.3in}
\begin{itemize}
\item<18-| alert@18-19>  If we put $x = 4$ in the series, we get $\sum \frac{1}{n}$, which is \uncover<19->{divergent.}
\item<18-| alert@20-21>  If we put $x = 2$ in the series, we get $\sum \frac{(-1)^n}{n}$, which is \uncover<21->{convergent.}
\item<22->  The series converges if $2 \leq x < 4$ and diverges otherwise.
\end{itemize}
\end{example}
\end{frame}
% end module power-series-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-ex3.tex
% begin module power-series-ex3
\begin{frame}
\begin{example} %[Example 3, p. 760]
Find the domain of the Bessel function of order $0$ defined by
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
J_0(x) = \sum_{n=0}^\infty \frac{(-1)^nx^{2n}}{2^{2n}(n!)^2}%
\]
\begin{itemize}
\item<2->  The $n$th term is $a_n = \frac{(-1)^nx^{2n}}{2^{2n}(n!)^2}$.%
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<4->{%
\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right|%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\lim_{n\to\infty} \left| \frac{(-1)^{n+1}\alert<handout:0| 5-6>{x^{2(n+1)}}}{\alert<handout:0| 7-8>{2^{2(n+1)}}\alert<handout:0| 9-10>{[(n+1)!]^2}} \cdot \frac{\alert<handout:0| 7-8>{2^{2n}}\alert<handout:0| 9-10>{(n!)^2}}{(-1)^n\alert<handout:0| 5-6>{x^{2n}}}\right|%
}\\%
& \uncover<5->{ = } &%
\uncover<5->{%
\lim_{n\to\infty} \frac{\alert<handout:0| 6>{\uncover<6->{x^2}}}{\alert<handout:0| 8>{\uncover<8->{4}}\alert<handout:0| 10>{\uncover<10->{(n+1)^2}}}%
}%
 \uncover<11->{ = } %
\uncover<11->{%
0%
}%
 \uncover<12->{ < } %
\uncover<12->{%
1%
}%
\end{eqnarray*}
\begin{itemize}
\item<13->  Therefore by the Ratio Test the series converges for all $x$.
\item<14->  Therefore the domain of the function is $(-\infty , \infty )$, or $\mathbb{R}$.
\end{itemize}
\end{example}
\end{frame}
% end module power-series-ex3



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/radius-of-convergence.tex
% begin module radius-of-convergence
\begin{frame}[t]
\begin{theorem}[Convergence of Power Series]
For a power series $\displaystyle \sum c_n (x-a)^n$, there are three possibilities:
\begin{enumerate}
\item<1-| alert@3,6>  The series converges only when $x = a$.
\item<1-| alert@4,7>  The series converges for all $x$.
\item<1-| alert@2,8>  There is a positive number $R$ such that the series converges if $|x-a| < R$ and diverges if $|x-a|>R$.
\end{enumerate}
\end{theorem}

\uncover<2->{%
\only<handout:1| 1-4>{%
\begin{definition}[Radius of Convergence]
The number $R$ in case three of the theorem is called the radius of convergence of the power series.
\end{definition}
\begin{enumerate}
\item<3-| alert@3>  In the first case, we say $R = 0$.
\item<4-| alert@4>  In the second case, we say $R = \infty$.
\end{enumerate}
}%
\only<handout:2| 5->{%
\begin{definition}[Interval of Convergence]
The interval of convergence of a power series is the interval consisting of all numbers $x$ for which the series converges.
\end{definition}
\begin{enumerate}
\item<6-| alert@6>  In the first case, the interval contains the single point $ a$.
\item<7-| alert@7>  In the second case, the interval is $( - \infty , \infty )$.
\item<8-| alert@8>  In the third case, the inequality $|x - a| < R$ can be rewritten $a - R < x < a + R$.
\end{enumerate}
}%
}%
\end{frame}
% end module radius-of-convergence



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/interval-of-convergence-endpoints.tex
% begin module interval-of-convergence-endpoints
\begin{frame}[t]
What happens at the endpoints of the interval $a - R < x < a + R$?
\begin{itemize}
\item<2->  Anything can happen.
\item<3-| alert@5>  The series might converge at one endpoint.
\item<3-| alert@6>  The series might converge at both endpoints.
\item<3-| alert@7>  The series might diverge at both endpoints.
\item<4->  Thus, in the third case, there are four possibilities for the interval of convergence.
\begin{enumerate}
\item<5-| alert@5>  $[a-R, a+R)$
\item<5-| alert@5>  $(a-R, a+R]$
\item<6-| alert@6>  $[a-R, a+R]$
\item<7-| alert@7>  $(a-R, a+R)$
\end{enumerate}
\item<8->  In general, the Ratio Test (or Root Test) should be used to find the radius of convergence $R$.
\item<9->  The Ratio and Root Tests will always fail when $x$ is an endpoint $a - R$ or $a + R$, so the endpoints must be checked with another test.
\end{itemize}
\end{frame}
% end module interval-of-convergence-endpoints



% WARNING: I'm missing the table that compiles radius and interval
% of convergence for the previous three examples.
% ALSO: Change the order of the examples so it agrees with the order in the theorem.
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-ex4.tex
% begin module power-series-ex4
\begin{frame}
\begin{example} %[Example 4, p. 762]
Find the radius of convergence and interval of convergence of the series $\sum_{n=0}^\infty \frac{(-3)^nx^n}{\sqrt{n+1}}$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right|%
}%
& \uncover<2->{ = } &%
\uncover<2->{%
\lim_{n\to\infty} \left| \frac{\alert<handout:0| 3-4>{(-3)^{n+1}}\alert<handout:0| 5-6>{x^{n+1}}}{\alert<handout:0| 7-8>{\sqrt{n+2}}} \cdot \frac{\alert<handout:0| 7-8>{\sqrt{n+1}}}{\alert<handout:0| 3-4>{(-3)^n}\alert<handout:0| 5-6>{x^n}}\right|%
}\\%
& \uncover<3->{ = } &%
\uncover<3->{%
\lim_{n\to\infty} \alert<handout:0| 4>{\uncover<4->{3}}\alert<handout:0| 6>{\uncover<6->{|x|}}\alert<handout:0| 8>{\uncover<8->{\sqrt{\frac{n+1}{\alert<handout:0| 9>{n}+2}}}}\uncover<9->{\alert<handout:0| 9>{\cdot \frac{\frac{1}{\sqrt{n}}}{\frac{1}{\sqrt{n}}}}}%
}%
 \uncover<10->{ = } %
\uncover<10->{%
\lim_{n\to\infty} 3|x| \sqrt{\frac{1+\frac{1}{n}}{1 + \frac{2}{n}}}%
}%
 \uncover<11->{ = } %
\uncover<11->{%
3|x|%
}%
\end{eqnarray*}
\begin{itemize}
\item<12->  Ratio Test: it \alert<handout:0| 12-13>{converges if \uncover<13->{$3|x| < 1$}} and \alert<handout:0| 14-15>{diverges if \uncover<15->{$3|x|>1$.}}
\item<16->  So it converges if $|x| < \frac{1}{3}$ and diverges if $|x| > \frac{1}{3}$.
\item<17->  Therefore $R = \frac{1}{3}$.
\item<18-| alert@18-19>  If we use $x = \frac{1}{3}$, we get $\sum_{n=0}^\infty \frac{(-1)^n}{\sqrt{n+1}}$, which is \uncover<19->{convergent.}
\item<18-| alert@20-21>  If we use $x = -\frac{1}{3}$, we get $\sum_{n=0}^\infty \frac{1}{\sqrt{n+1}}$, which is \uncover<21->{divergent.}
\item<22->  The interval of convergence is $(-\frac{1}{3}, \frac{1}{3}]$.
\end{itemize}
\end{example}
\end{frame}
% end module power-series-ex4



\section{Power Series as Functions}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-as-function-intro.tex
% begin module power-series-as-function-intro
\begin{frame}
\frametitle{Representations of Functions as Power Series}
\[
\sum_{n=0}^\infty x^n = 1 + x + x^2 + x^3 + \cdots 
\]
\begin{itemize}
\item<2->  This is a geometric series with \alert<handout:0| 2-3,9>{$a = $ \uncover<3->{$1$}} and \alert<handout:0| 4-5,10>{$r = $ \uncover<5->{$x$.}}
\item<6->  It is convergent if \uncover<7->{\alert<handout:0| 7,12>{$|x| < 1$}} and divergent otherwise.
\item<8->  If it converges, the sum is $\frac{\uncover<9->{\alert<handout:0| 9>{1}}}{1 - \uncover<10->{\alert<handout:0| 10>{x}}}$.
\item<11->  The thing that is new in this section is the we now regard the series $\sum_{n=0}^\infty x^n$ as expressing the function $f(x) = \frac{1}{1-x}$.
\item<12->  This only works if $-1 < x < 1$.
\end{itemize}
\end{frame}
% end module power-series-as-function-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-as-function-ex1.tex
% begin module power-series-as-function-ex1
\begin{frame}
\begin{example} %[Example 1, p. 765]
Write $\frac{1}{1+x^2}$ as a power series and find the interval of convergence.
\uncover<2->{%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\frac{1}{1+x^2} = \frac{1}{1-(-x^2)}%
\]
}%
\uncover<3->{%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\begin{array}{c@{\  }c@{\  }l@{\ }c@{\  }c@{\  }c@{  }c@{  }c@{  }c@{  }c@{  }c@{  }c@{  }}
\displaystyle \frac{1}{1-\alert<handout:0| 4>{x}} &%
 = & %
\displaystyle \sum_{n=0}^\infty \alert<handout:0| 4>{x}^n &%
 = & %
1 &%
+ &%
x &%
+ &%
x^2 &%
+ &%
x^3 &%
%+ &%
%x^4 &%
+ \ \cdots \\%
% & \uncover<3->{%
%\displaystyle \frac{1}{1+x^2}%
%} &&&&&&&&&&&&&\\%
\uncover<4->{%
\displaystyle \frac{1}{1-(\alert<handout:0| 4>{-x^2})}%
} &%
\uncover<4->{ = } &%
\uncover<4->{%
\displaystyle \sum_{n=0}^\infty (\alert<handout:0| 4>{-x^2})^n%
} &%
\uncover<5->{ = } &%
\uncover<5->{1} &%
\uncover<5->{+} &%
\uncover<5->{(-x^2)} &%
\uncover<5->{+} &%
\uncover<5->{(-x^2)^2} &%
\uncover<5->{+} &%
\uncover<5->{(-x^2)^3} &%
%\uncover<5->{+} &%
%\uncover<5->{(-x^2)^4} &%
\uncover<5->{+ \ \cdots} \\%
&&&%
\uncover<6->{ = } &%
\uncover<6->{1} &%
\uncover<6->{-} &%
\uncover<6->{x^2} &%
\uncover<6->{+} &%
\uncover<6->{x^4} &%
\uncover<6->{-} &%
\uncover<6->{x^6} &%
%\uncover<6->{+} &%
%\uncover<6->{x^8} &%
\uncover<6->{+ \ \cdots} %
%
\end{array}
\]
}%
\begin{itemize}
\item<7->  Another way to write the series is $\sum_{n=0}^\infty (-x^2)^n = \sum_{n=0}^\infty (-1)^nx^{2n}$.
\item<8->  This converges if $|-x^2| < 1$, that is, if $x^2 < 1$, or $|x| < 1$.
\item<9->  Therefore the interval of convergence is $(-1, 1)$.
\end{itemize}
\end{example}
\end{frame}
% end module power-series-as-function-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-as-function-ex2.tex
% begin module power-series-as-function-ex2
\begin{frame}
\begin{example} %[Example 2, p. 765]
Find a power series representation for $\frac{1}{x+2}$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\frac{1}{2+x}%
}%
 & \uncover<2->{ = } &%
\uncover<2->{%
\frac{1}{2\left( 1 \alert<handout:0| 3>{+} \frac{x}{2}\right)}%
}%
  \uncover<3->{ = } %
\uncover<3->{%
\frac{1}{2}\cdot \frac{1}{\left[ 1 \alert<handout:0| 3>{-} \alert<handout:0| 4>{\left( \alert<handout:0| 3>{-}\frac{x}{2}\right)} \right]}%
}\\%
 & \uncover<4->{ = } &%
\uncover<4->{%
\frac{1}{\alert<handout:0| 9-10>{2}}\sum_{n=0}^\infty \left( \alert<handout:0| 4>{\alert<handout:0| 5-6>{-}\frac{\alert<handout:0| 7-8>{x}}{\alert<handout:0| 9-10>{2}}}\right)^{\alert<handout:0| 5-10>{n}}%
}%
  \uncover<5->{ = } %
\uncover<5->{%
\sum_{n=0}^\infty \frac{\alert<handout:0| 6>{\uncover<6->{(-1)^n}}}{\alert<handout:0| 10>{\uncover<10->{2^{n+1}}}}\alert<handout:0| 8>{\uncover<8->{x^n}}%
}\\%
 & \uncover<11->{ = } &%
\uncover<11->{%
\frac{1}{2} - \frac{x}{4} + \frac{x^2}{8} - \frac{x^3}{16} + \cdots%
}%
\end{eqnarray*}
\uncover<12->{Interval of convergence:}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<13->{%
\alert<handout:0| 13>{\left| - \frac{x}{2}\right|}%
}%
 & \uncover<12->{ \alert<handout:0| 12-13>{<} } &%
\uncover<12->{%
\alert<handout:0| 12-13>{1}%
}\\%
\uncover<14->{%
|x|%
}%
 & \uncover<14->{ \alert<handout:0| 12-13>{<} } &%
\uncover<14->{%
\alert<handout:0| 12-13>{2}%
}%
\end{eqnarray*}
\uncover<15->{Therefore the interval of convergence is $(-2, 2)$.}%
\end{example}
\end{frame}
% end module power-series-as-function-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-as-function-ex3.tex
% begin module power-series-as-function-ex3
\begin{frame}
\begin{example} %[Example 3, p. 765]
Find a power series representation for $\frac{x^3}{x+2}$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\frac{x^3}{x+2}%
}%
 & \uncover<2->{ = } &%
\uncover<2->{%
x^3 \cdot \alert<handout:0| 3-4>{\frac{1}{x+2}}%
}\\%
& \uncover<3->{ = } &%
\uncover<3->{%
\alert<handout:0| 5-6>{x^3} \uncover<4->{\alert<handout:0| 4>{\sum_{n=0}^\infty \frac{(-1)^n}{2^{n+1}}\alert<handout:0| 5-6>{x^n}}}%
}\\%
 & \uncover<5->{ = } &%
\uncover<5->{%
\sum_{n=0}^\infty \frac{(-1)^n}{2^{n+1}} \uncover<6->{\alert<handout:0| 6>{x^{n+3}}}%
}\\%
 & \uncover<7->{ = } &%
\uncover<7->{%
\frac{x^3}{2} - \frac{x^4}{4} + \frac{x^5}{8} - \frac{x^6}{16} + \cdots%
}%
\end{eqnarray*}
\begin{itemize}
\item<8->  Another way to write this is $\frac{x^3}{x+2} = \sum_{n=3}^\infty \frac{(-1)^{n-1}}{2^{n-2}}x^n$.
\item<9->  The interval of convergence is again $(-2, 2)$.
\end{itemize}
\end{example}
\end{frame}
% end module power-series-as-function-ex3



\subsection{Differentiation and Integration of Power Series}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-calculus.tex
% begin module power-series-calculus
\begin{frame}
\frametitle{Differentiation and Integration of Power Series}
\begin{theorem}[Differentiation and Integration of Power Series]
If a power series $\sum c_n (x-a)^n$ has radius of convergence $R >0$, then the function $f$ defined by
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
f(x) = c_0 + c_1(x-a) + c_2(x-a)^2 + c_3(x-a)^3 +\cdots  = \sum_{n=0}^\infty c_n(x-a)^n%
\]
is differentiable (and therefore continuous) on the interval $(a-R, a+R)$ and
\begin{enumerate}
\item  $\displaystyle f'(x) = c_1 + 2c_2(x-a) + 3c_3(x-a)^2 + \cdots = \sum_{n=1}^\infty nc_n(x-a)^{n-1}$.
\item  $\displaystyle \int f(x) \ \diff x  = C + c_0(x-a) + c_1\frac{(x-a)^2}{2} + c_2\frac{(x-a)^3}{3} + \cdots $ $= C + \sum_{n=0}^\infty c_n\frac{(x-a)^{n+1}}{n+1}$.
\end{enumerate}
\end{theorem}
\end{frame}


\begin{frame}
\begin{itemize}
\item  This is called term-by-term differentiation and integration.
\item  Another way of saying it is
\end{itemize}
\begin{eqnarray*}
\frac{\diff}{\diff x} \left[ \sum_{n=0}^\infty c_n (x-a)^n\right] & = & \sum_{n=0}^\infty \frac{\diff}{\diff x} \left[ c_n (x-a)^n\right]\\
\int \left[ \sum_{n=0}^\infty c_n (x-a)^n\right] \diff x & = & \sum_{n=0}^\infty \int \left[ c_n (x-a)^n\right] \diff x
\end{eqnarray*}
\begin{itemize}
\item  We can treat power series like polynomials with infinitely many terms.
\end{itemize}
\end{frame}
% end module power-series-calculus



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-calculus-ex4.tex
% begin module power-series-calculus-ex4
\begin{frame}
\begin{example} %[Example 4, p. 766]
Find the derivative of the Bessel function
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
J_0(x) & = & \sum_{n=0}^\infty \frac{(-1)^n x^{2n}}{2^{2n}(n!)^2}\\%
\uncover<2->{%
J_0'(x)%
}%
 & \uncover<2->{ = } &%
\uncover<2->{%
\sum_{n=0}^\infty \frac{\diff}{\diff x}\left( \frac{(-1)^n x^{\alert<handout:0| 3>{ 2n}}}{2^{2n}(n!)^2}\right) %
}\\%
 & \uncover<3->{\  = \ } &%
\uncover<3->{%
\sum_{n=0}^\infty \frac{(-1)^n \alert<handout:0| 3>{2n}x^{\alert<handout:0| 3>{ 2n -1}}}{2^{2n}(n!)^2}%
}%
\end{eqnarray*}
\begin{itemize}
\item<4-| alert@4-5>  $J_0(x)$ is defined \uncover<5->{everywhere.}
\item<6->  Therefore its derivative $J_0'(x)$ is also defined everywhere.
\end{itemize}
\end{example}
\end{frame}
% end module power-series-calculus-ex4



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-calculus-ex6.tex
% begin module power-series-calculus-ex6
\begin{frame}
\begin{example} %[Example 6, p. 767]
Find a power series for $\ln (1-x)$ and state its radius of convergence.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<2->{%
\alert<handout:0| 2-3>{\frac{\diff}{\diff x} \ln (1-x)}
}%
  \uncover<2->{ \alert<handout:0| 2-3>{=} } %
\uncover<3->{%
\alert<handout:0| 2-3>{-\frac{1}{1-x}}%
}%
\]
\uncover<4->{Therefore}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<4->{%
\alert<handout:0| 10-11>{\ln (1-x)}%
}%
 & \uncover<4->{ = } &%
\uncover<4->{%
- \int \alert<handout:0| 5>{\frac{1}{1-x}} \diff x%
}%
  \uncover<5->{ \ = \ } %
\uncover<5->{%
- \int \alert<handout:0| 5>{(1+x+x^2+x^3+\cdots) } \diff x%
}\\%
 & \uncover<6->{ = } &%
\uncover<6->{%
-\left( x + \frac{x^2}{2} + \frac{x^3}{3} + \frac{x^4}{4} + \cdots \right) \uncover<7->{\alert<handout:0| 7>{+C}}%
}%
  \uncover<8->{ \ \alert<handout:0| 10-11>{=} \ } %
\uncover<8->{%
\alert<handout:0| 10-11>{C - \sum_{n=1}^\infty \frac{1}{n} x^n}%
}%
\end{eqnarray*}
\begin{itemize}
\item<9->  The radius is the same as for the original series: $R = 1$.
\item<10->  To find $C$, plug in $x = 0$: \uncover<11->{\alert<handout:0| 11>{$0 = C$}.}
\end{itemize}
%\abovedisplayskip=0pt
%\belowdisplayskip=0pt
%\begin{eqnarray*}
%\uncover<10->{%
%\ln (1-0)%
%}%
%& \uncover<10->{ = } &%
%\uncover<10->{%
%C - \sum_{n=1}^\infty \frac{1}{n} 0^n%
%}\\%
%\uncover<11->{%
%0%
%}%
%& \uncover<11->{ = } &%
%\uncover<11->{%
%C %
%}%
%\end{eqnarray*}
\uncover<12->{Therefore}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<12->{%
\ln (1-x) = - \sum_{n=1}^\infty \frac{1}{n}x^n%
}%
\]
\end{example}
\end{frame}
% end module power-series-calculus-ex6



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/power-series-calculus-ex7.tex
% begin module power-series-calculus-ex7
\begin{frame}
\begin{example} %[Example 7, p. 767]
Find a power series for $\Arctan x$ and state its radius of convergence.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<2->{%
\alert<handout:0| 2-3>{\frac{\diff}{\diff x} \Arctan x}
}%
  \uncover<2->{ \alert<handout:0| 2-3>{=} } %
\uncover<3->{%
\alert<handout:0| 2-3>{\frac{1}{1+x^2}}%
}%
\]
\uncover<4->{Therefore}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<4->{%
\alert<handout:0| 13-14>{\Arctan x}%
}%
 & \uncover<4->{ = } &%
\uncover<4->{%
\int \alert<handout:0| 5>{\frac{1}{1+x^2}} \diff x%
}%
  \uncover<5->{ \ = \ } %
\uncover<5->{%
\int \alert<handout:0| 5>{(1-x^2+x^4-x^6+\cdots) } \diff x%
}\\%
 & \uncover<6->{ = } &%
\uncover<6->{%
\left( \alert<handout:0| 10-11>{x} \alert<handout:0| 8-9>{-} \frac{x^{\alert<handout:0| 10-11>{3}}}{\alert<handout:0| 10-11>{3}} + \frac{x^{\alert<handout:0| 10-11>{5}}}{\alert<handout:0| 10-11>{5}} \alert<handout:0| 8-9>{-} \frac{x^{\alert<handout:0| 10-11>{7}}}{\alert<handout:0| 10-11>{7}} + \cdots \right) \uncover<7->{\alert<handout:0| 7>{+C}}%
}\\%
&  \uncover<8->{  \alert<handout:0| 13-14>{=}  } &%
\uncover<8->{%
\alert<handout:0| 13-14>{C + \sum_{n=0}^\infty \uncover<9->{\alert<handout:0| 9>{(-1)^n}} \frac{\uncover<11->{x^{\alert<handout:0| 11>{2n+1}}}}{\uncover<11->{\alert<handout:0| 11>{2n+1}}}}%
}%
\end{eqnarray*}
\begin{itemize}
\item<12->  The radius is the same as for the original series: $R = 1$.
\item<13->  To find $C$, plug in $x = 0$: \uncover<14->{\alert<handout:0| 14>{$0 = C$}.}
\end{itemize}
%\uncover<15->{Therefore}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<15->{%
\Arctan  x = \sum_{n=0}^\infty (-1)^n \frac{x^{2n+1}}{2n+1}%
}%
\]
\vspace{-.1in}
\end{example}
\end{frame}
% end module power-series-calculus-ex7



% WARNING: I want to include some integral approximation questions here.
\section{Taylor and Maclaurin Series}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/taylor-series-intro.tex
% begin module taylor-series-intro
\begin{frame}
\frametitle{(12.10)  Taylor and Maclaurin Series}
\begin{itemize}
\item  Let $f$ be a function that can be represented by a power series: 
\item  $f(x) = \alert<handout:0| 3>{c_0} + c_1 (x-a) + c_2 (x-a)^2 + c_3(x-a)^3 + \cdots$
\item<2-| alert@2-3>  $f(a) = $ \uncover<3->{$c_0$.}
\item<4->  $f'(x) = \alert<handout:0| 6>{c_1}  + 2c_2 (x-a) + 3c_3(x-a)^2 + 4c_4 (x-a)^3 + \cdots$
\item<5-| alert@5-6>  $f'(a) = $ \uncover<6->{$c_1$.}
\item<7->  $f''(x) =  \alert<handout:0| 9>{2c_2}  + 2\cdot 3c_3(x-a) + 3\cdot 4c_4 (x-a)^2 + 4\cdot 5 c_5 (x-a)^3 + \cdots$
\item<8-| alert@8-9>  $f''(a) = $ \uncover<9->{$2 c_2$.}
\item<10->  $f'''(x) =   \alert<handout:0| 12>{2\cdot 3c_3} + 2\cdot 3\cdot 4c_4 (x-a) + 3\cdot 4\cdot 5  c_5(x-a)^2 + \cdots$
\item<11-| alert@11-12>  $f'''(a) = $ \uncover<12->{$2\cdot 3 c_3 = 3! c_3$.}
\item<13-| alert@13-14>  $f^{(n)}(a) = $ \uncover<14->{$n! c_n$.}
\item<15->  Therefore $c_n = \frac{f^{(n)}(a)}{n!}$.
\end{itemize}
\end{frame}
% end module taylor-series-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/taylor-series-def.tex
% begin module taylor-series-def
\begin{frame}
\begin{theorem}[Coefficients of a Power Series]
If $f$ has a power series representation at $a$, that is, if
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
f(x) = \sum_{n=0}^\infty c_n (x-a)^n, \qquad |x-a| < R,
\]
then its coefficients are given by the formula
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\alert<handout:0| 2>{c_n = \frac{f^{(n)}(a)}{n!}}.
\]
\end{theorem}
\uncover<2->{%
Here is what we get if we plug these coefficients into the power series:
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
f(x) & = & \sum_{n=0}^\infty \alert<handout:0| 2>{\frac{f^{(n)}(a)}{n!}} (x-a)^n\\
& = & f(a) + \frac{f'(a)}{1!}(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \frac{f'''(a)}{3!}(x-a)^3 + \cdots 
\end{eqnarray*}
}%
\uncover<3->{%
\begin{definition}[Taylor Series]
This series is called the Taylor series of $f$.
\end{definition}
}%
\end{frame}
% end module taylor-series-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/maclaurin-series-def.tex
% begin module maclaurin-series-def
\begin{frame}
The case when $a = 0$ is special enough to have its own name:
\begin{definition}[Maclaurin Series]
The Maclaurin series of $f$ is the Taylor series of $f$ centered at $a = 0$.  In other words, it is the series
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
f(x) = \sum_{n=0}^\infty \frac{f^{(n)}(0)}{n!}x^n = f(0) + \frac{f'(0)}{1!}x + \frac{f''(0)}{2!}x^2 + \frac{f'''(0)}{3!}x^3 + \cdots%
\]
\end{definition}
\end{frame}
% end module maclaurin-series-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/maclaurin-series-ex1.tex
% begin module maclaurin-series-ex1
\begin{frame}
\begin{example}
Find the Maclaurin series of $f(x) = e^x$ and its radius of convergence.
\begin{itemize}
\item<2-| alert@2-3>  $f^{(n)}(x) = $ \uncover<3->{$e^x$.}
\item<4-| alert@4-6>  $f^{(n)}(0) = $ \uncover<5->{$e^0 = 1$.}
\item<6->  Therefore the Maclaurin series is
\end{itemize}
\uncover<6->{%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=0}^\infty \frac{\alert<handout:0| 6>{f^{(n)}(0)}}{n!}x^n = \sum_{n=0}^\infty \frac{\alert<handout:0| 6>{1}}{n!}x^n = 1 + \frac{x}{1!} + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots%
\]
}%
\begin{itemize}
\item<7->  To find the radius of convergence, let $a_n = \frac{x^n}{n!}$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
%\begin{eqnarray*}
\[
\uncover<8->{%
\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right|%
}%
 \uncover<8->{ = } %
\uncover<8->{%
\lim_{n\to\infty} \left| \frac{\alert<handout:0| 9-10>{x^{n+1}}}{\alert<handout:0| 11-12>{(n+1)!}}\cdot \frac{\alert<handout:0| 11-12>{n!}}{\alert<handout:0| 9-10>{x^n}}\right|%
}%
 \uncover<9->{ = } %
\uncover<9->{%
\alert<handout:0| 13-14>{\lim_{n\to\infty} \frac{\uncover<10->{\alert<handout:0| 10>{|x|}}}{\uncover<12->{\alert<handout:0| 12>{n+1}}}}%
}%
 \uncover<13->{\alert<handout:0| 13-14>{ = }} %
\uncover<14->{%
\alert<handout:0| 14-15>{0}%
}%
 \uncover<15->{\alert<handout:0| 15>{ < 1}} %
%\end{eqnarray*}
\]
\begin{itemize}
\item<16->  Therefore by the Ratio Test the series converges for all $x$.
\item<17->  Therefore $R = \infty$.
\end{itemize}
\end{example}
\end{frame}
% end module maclaurin-series-ex1



%\input{../../modules/power-series/taylor-series-representation}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/maclaurin-series-e-ex.tex
% begin module maclaurin-series-e-ex
\begin{frame}
\begin{example}
Find the sum of the series
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=0}^\infty (-1)^n\frac{1}{2^nn!} = 1 - \frac{1}{2\cdot 1!} + \frac{1}{4\cdot 2!} - \frac{1}{8\cdot 3!} + \cdots
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\alert<handout:0| 2-3>{%
e^{\alert<handout:0| 7>{x}}%
}%
}%
& \uncover<2->{\alert<handout:0| 2-3>{=}} & %
\uncover<2->{%
\alert<handout:0| 2-3>{%
\sum_{n=0}^\infty \uncover<3->{\frac{1}{n!}\alert<handout:0| 6-7>{x^n}}%
}%
}\\%
& & \\%
\uncover<4->{%
\sum_{n=0}^\infty (-1)^n\frac{1}{2^nn!}%
}%
& \uncover<4->{=} & %
\uncover<4->{%
\sum_{n=0}^\infty \frac{1}{n!}\alert<handout:0| 4-7>{ \left( \uncover<5->{-\frac{1}{2}}\right)^n}%
}\\%
& \uncover<7->{=} & %
\uncover<7->{%
e^{\alert<handout:0| 7>{-1/2}}
}\\%
& \uncover<8->{=} & %
\uncover<8->{%
\frac{1}{\sqrt{e}}
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module maclaurin-series-e-ex



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/taylor-series-ex3.tex
% begin module taylor-series-ex3
\begin{frame}
\begin{example} 
Find the Taylor series for $f(x) = e^x$ at $a = 3$.
\begin{itemize}
\item<2-| alert@2-3>  $f^{(n)}(x) = $ \uncover<3->{$e^x$.}
\item<4-| alert@4-6>  $f^{(n)}(3) = $ \uncover<5->{$e^3$.}
\item<6->  Therefore the Taylor series is
\end{itemize}
\uncover<6->{%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=0}^\infty \frac{\alert<handout:0| 6>{f^{(n)}(3)}}{n!}(x-3)^n = \sum_{n=0}^\infty \frac{\alert<handout:0| 6>{e^3}}{n!}(x-3)^n %= e^3 + \frac{e^3}{1!}(x-3) + \frac{e^3}{2!}(x-3)^2 + \frac{e^3}{3!}(x-3)^3 + \cdots%
\]
}%
\begin{itemize}
\item<7->  To find the radius of convergence, let $a_n = \frac{e^3}{n!}(x-3)^n$.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
%\begin{eqnarray*}
\[
\uncover<8->{%
\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right|%
}%
 \uncover<8->{ = } %
\uncover<8->{%
\lim_{n\to\infty} \left| \frac{e^3\alert<handout:0| 9-10>{(x-3)^{n+1}}}{\alert<handout:0| 11-12>{(n+1)!}}\cdot \frac{\alert<handout:0| 11-12>{n!}}{e^3\alert<handout:0| 9-10>{(x-3)^n}}\right|%
}%
 \uncover<9->{ = } %
\uncover<9->{%
\alert<handout:0| 13-14>{\lim_{n\to\infty} \frac{\uncover<10->{\alert<handout:0| 10>{|x-3|}}}{\uncover<12->{\alert<handout:0| 12>{n+1}}}}%
}%
 \uncover<13->{\alert<handout:0| 13-14>{ = }} %
\uncover<14->{%
\alert<handout:0| 14>{0}%
}%
% \uncover<15->{\alert<handout:0| 15>{ < 1}} %
%\end{eqnarray*}
\]
\begin{itemize}
\item<15->  Therefore by the Ratio Test the series converges for all $x$.
\item<16->  Therefore $R = \infty$.
\item<17->  Just like the Maclaurin series, this series also represents $e^x$.
\end{itemize}
\end{example}
\end{frame}

\begin{frame}
\begin{example} 
Find the Taylor series for $f(x) = e^x$ at $a = 3$.
\[
\begin{array}{rcll|l}
\displaystyle \uncover<2->{e^{x}}&\uncover<2->{=}&\displaystyle \uncover<2->{{\alert<3,4>{e}}^{\alert<4>{x-3} + \alert<3>{ 3}}} \uncover<3->{= \alert<3>{e^{3}}\alert<4,6>{e^{x-3}}} \uncover<5->{&& \begin{array}{l} \text{Recall that } \alert<6>{e^y=\sum\limits_{n=0}^\infty \frac{{y}^n}{n!}} \\ \uncover<6->{\text{Set } \alert<6>{y=x-3} }\end{array}} \\
&\uncover<6->{=}&\displaystyle \uncover<6->{\alert<7>{e^3} \alert<6>{\sum\limits_{n=0}^\infty \frac{(x-3)^n}{n!}}}\\
&\uncover<7->{=}&\displaystyle \uncover<7->{\sum\limits_{n=0}^\infty  \frac{\alert<7>{e^3}}{n!}(x-3)^n}
\end{array}
\]

\uncover<8->{The radius of convergence was already computed to be $R=\infty$.}
\end{example}
\vskip 10 cm
\end{frame}
% end module taylor-series-ex3



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/maclaurin-series-ex4.tex
% begin module maclaurin-series-ex4
\begin{frame}
\begin{example}
Find the Maclaurin series of $f(x) = \sin x$ and its radius of convergence.
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
\begin{array}{rcl@{\qquad}rcl}
\uncover<2->{%
f(x)%
}%
&%
\uncover<2->{%
=%
}%
&%
\uncover<2->{%
\sin x%
}%

&%
\uncover<2->{%
\alert<handout:0| 2-3,21>{%
f(0)%
}%
}%
&%
\uncover<2->{%
\alert<handout:0| 2-3,21>{%
=%
}%
}%
&%
\alert<handout:0| 2-3,21>{%
\uncover<3->{%
0%
}%
}\\%

\uncover<2->{%
\alert<handout:0| 4-5>{%
f'(x)%
}%
}%
&%
\uncover<2->{%
\alert<handout:0| 4-5>{%
=%
}%
}%
&%
\alert<handout:0| 4-5>{%
\uncover<5->{%
\cos x%
}%
}%

&%
\uncover<2->{%
\alert<handout:0| 6-7,22-23>{%
f'(0)%
}%
}%
&%
\uncover<2->{%
\alert<handout:0| 6-7,22-23>{%
=%
}%
}%
&%
\alert<handout:0| 6-7,22-23>{%
\uncover<7->{%
1%
}%
}\\%

\uncover<2->{%
\alert<handout:0| 8-9>{%
f''(x)%
}%
}%
&%
\uncover<2->{%
\alert<handout:0| 8-9>{%
=%
}%
}%
&%
\alert<handout:0| 8-9>{%
\uncover<9->{%
-\sin x%
}%
}%

&%
\uncover<2->{%
\alert<handout:0| 10-11,24>{%
f''(0)%
}%
}%
&%
\uncover<2->{%
\alert<handout:0| 10-11,24>{%
=%
}%
}%
&%
\alert<handout:0| 10-11,24>{%
\uncover<11->{%
0%
}%
}\\%

\uncover<2->{%
\alert<handout:0| 12-13>{%
f'''(x)%
}%
}%
&%
\uncover<2->{%
\alert<handout:0| 12-13>{%
=%
}%
}%
&%
\alert<handout:0| 12-13>{%
\uncover<13->{%
-\cos x%
}%
}%

&%
\uncover<2->{%
\alert<handout:0| 14-15,25-26>{%
f'''(0)%
}%
}%
&%
\uncover<2->{%
\alert<handout:0| 14-15,25-26>{%
=%
}%
}%
&%
\alert<handout:0| 14-15,25-26>{%
\uncover<15->{%
-1%
}%
}\\%

\uncover<2->{%
\alert<handout:0| 16-17>{%
f^{(4)}(x)%
}%
}%
&%
\uncover<2->{%
\alert<handout:0| 16-17>{%
=%
}%
}%
&%
\alert<handout:0| 16-17>{%
\uncover<17->{%
\sin x%
}%
}%

&%
\uncover<2->{%
\alert<handout:0| 18-19,27>{%
f^{(4)}(0)%
}%
}%
&%
\uncover<2->{%
\alert<handout:0| 18-19,27>{%
=%
}%
}%
&%
\alert<handout:0| 18-19,27>{%
\uncover<19->{%
0%
}%
}%
\end{array}
\]
\uncover<20->{%
The Maclaurin series is
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
\sum_{n=0}^\infty \frac{f^{(n)}(0)}{n!}x^n = %
\uncover<23->{%
\alert<handout:0| 23>{%
\alert<handout:0| 33-34>{x}%
}%
}%
\uncover<26->{%
\alert<handout:0| 26>{%
\alert<handout:0| 31-32>{-} \frac{x^{\alert<handout:0| 33-34>{3}}}{\alert<handout:0| 33-34>{3}!}%
}%
}%
\uncover<29->{%
\alert<handout:0| 29>{%
\alert<handout:0| 31-32>{+} \frac{x^{\alert<handout:0| 33-34>{5}}}{\alert<handout:0| 33-34>{5}!}%
}%
}%
\uncover<30->{%
\alert<handout:0| 30>{%
\alert<handout:0| 31-32>{-} \frac{x^{\alert<handout:0| 33-34>{7}}}{\alert<handout:0| 33-34>{7}!} \alert<handout:0| 31-32>{+} \cdots %
}%
}%
\uncover<31->{%
 = \sum_{n=0}^\infty \uncover<32->{\alert<handout:0| 32>{(-1)^n}}\frac{\uncover<34->{x^{\alert<handout:0| 34>{2n+1}}}}{\uncover<34->{(\alert<handout:0| 34>{2n+1})!}}%
}%
\]
}%
\uncover<35->{%
Use the Ratio Test to find $R$.%
}%
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\begin{eqnarray*}
\uncover<35->{%
\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n}\right|%
}%
& \uncover<35->{ = } &%
\uncover<35->{%
\lim_{n\to\infty} \left| \frac{(-1)^{n+1}\alert<handout:0| 36-37>{x^{2n+3}}}{\alert<handout:0| 38-39>{(2n+3)!}}\cdot \frac{\alert<handout:0| 38-39>{(2n+1)!}}{(-1)^n\alert<handout:0| 36-37>{x^{2n+1}}}\right|%
}\\%
& \uncover<36->{ = } &%
\uncover<36->{%
\alert<handout:0| 40-41>{\lim_{n\to\infty} \frac{\uncover<37->{\alert<handout:0| 37>{x^2}}}{\uncover<39->{\alert<handout:0| 39>{(2n+2)(2n+3)}}}}%
}%
 \uncover<40->{\alert<handout:0| 40-41>{ = }} %
\uncover<41->{%
\alert<handout:0| 41>{0}%
}%
\end{eqnarray*}
\uncover<42->{Therefore $\alert<handout:0| 42-43>{R = \uncover<43->{\infty}}$.  }%
\uncover<44->{It can be shown that this series sums to $\sin x$.}%
\end{example}
\end{frame}
% end module maclaurin-series-ex4



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/maclaurin-series-sin-ex.tex
% begin module maclaurin-series-sin-ex
\begin{frame}
\begin{example}
Find the sum of the series
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\sum_{n=0}^\infty (-1)^n\frac{\pi^{2n+1}}{2^{2n+1}(2n+1)!} = \frac{\pi}{2} - \frac{\pi^3}{8\cdot 3!} + \frac{\pi^5}{32\cdot 5!} - \frac{\pi^7}{128\cdot 7!} + \cdots
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\alert<handout:0| 2-3>{%
\sin {\alert<handout:0| 7>{x}}%
}%
}%
& \uncover<2->{\alert<handout:0| 2-3>{=}} & %
\uncover<2->{%
\alert<handout:0| 2-3>{%
\sum_{n=0}^\infty \uncover<3->{(-1)^n\frac{1}{(2n+1)!}\alert<handout:0| 6-7>{x^{2n+1}}}%
}%
}\\%
& & \\%
\uncover<4->{%
\sum_{n=0}^\infty (-1)^n\frac{\pi^{2n+1}}{2^{2n+1}(2n+1)!}%
}%
& \uncover<4->{=} & %
\uncover<4->{%
\sum_{n=0}^\infty (-1)^n\frac{1}{(2n+1)!}\alert<handout:0| 4-7>{ \left( \uncover<5->{\frac{\pi}{2}}\right)^{2n+1}}%
}\\%
& \uncover<7->{=} & %
\uncover<7->{%
\sin {\alert<handout:0| 7>{\frac{\pi}{2}}}
}\\%
& \uncover<8->{=} & %
\uncover<8->{%
1%
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module maclaurin-series-sin-ex



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/maclaurin-series-ex5.tex
% begin module maclaurin-series-ex5
\begin{frame}
\begin{example}[Example 5, p. 776]
Find the Maclaurin series for $\cos x$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\cos x%
}%
 \uncover<2->{=} %
\uncover<2->{%
\alert<handout:0| 2-3>{%
\frac{\diff}{\diff x}\left( \uncover<3->{\alert<handout:0| 4-5>{\sin x}}\right)%
}%
}%
& \uncover<4->{=} &%
\uncover<4->{%
\alert<handout:0| 6>{\frac{\diff}{\diff x}}\left( \alert<handout:0| 5>{\uncover<5->{\sum_{n=0}^\infty (-1)^n\frac{x^{2n+1}}{(2n+1)!}}}\right)%
}\\%
& \uncover<6->{=} &%
\uncover<6->{%
\sum_{n=0}^\infty\alert<handout:0| 6>{\frac{\diff}{\diff x}}\left( (-1)^n\frac{x^{2n+1}}{(2n+1)!}\right)%
}\\%
& \uncover<7->{=} &%
\uncover<7->{%
\sum_{n=0}^\infty (-1)^n\frac{(\alert<handout:0| 7-9>{2n+1})x^{\alert<handout:0| 7>{2n}}}{\alert<handout:0| 8-9>{(2n+1)!}}%
}\\%
& \uncover<8->{=} &%
\uncover<8->{%
\sum_{n=0}^\infty (-1)^n\frac{x^{2n}}{\alert<handout:0| 9>{\uncover<9->{(2n)!}}}%
}\\%
& \uncover<10->{=} &%
\uncover<10->{%
1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots%
}%
\end{eqnarray*}
\uncover<11->{%
The series for $\sin x$ converges everywhere, so the series for $\cos x$ does too.%
}%
\end{example}
\end{frame}
% end module maclaurin-series-ex5



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/maclaurin-series-ex6.tex
% begin module maclaurin-series-ex6
\begin{frame}
\begin{example}[Example 6, p. 776]
Find the Maclaurin series for $x\cos x$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
x\alert<handout:0| 2-3>{\cos x}%
}%
& \uncover<2->{=} &%
\uncover<2->{\alert<handout:0| 4-5>{x}}%
\uncover<3->{%
\alert<handout:0| 3>{\sum_{n=0}^\infty (-1)^n\frac{\alert<handout:0| 4-5>{x^{2n}}}{(2n)!}}%
}\\%
& \uncover<4->{=} &%
\uncover<4->{%
\sum_{n=0}^\infty (-1)^n\frac{\alert<handout:0| 4-5>{\uncover<5->{x^{2n+1}}}}{(2n)!}%
}\\%
& \uncover<6->{=} &%
\uncover<6->{%
x - \frac{x^3}{2!} + \frac{x^5}{4!} - \frac{x^7}{6!} + \cdots%
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module maclaurin-series-ex6



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/maclaurin-series-list.tex
% begin module maclaurin-series-list
\begin{frame}
Here is a table of some important Maclaurin series we have learned:
\[
\begin{array}{rcl@{\qquad}|r}
\textrm{Function} & \multicolumn{2}{c|}{\textrm{Series}} & R \\
\hline
\displaystyle \frac{1}{1-x} & = & \displaystyle \sum_{n=0}^\infty x^n = 1 + x + x^2 + x^3 + \cdots  & 1\\
\displaystyle \Arctan x & = & \displaystyle \sum_{n=0}^\infty (-1)^n \frac{x^{2n+1}}{2n+1} = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \cdots  & 1\\
\displaystyle e^x & = & \displaystyle \sum_{n=0}^\infty \frac{x^n}{n!} = 1 + \frac{x}{1!} + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots  & \infty \\
\displaystyle \sin x & = & \displaystyle \sum_{n=0}^\infty (-1)^n \frac{x^{2n+1}}{(2n+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots  & \infty \\
\displaystyle \cos x & = & \displaystyle \sum_{n=0}^\infty (-1)^n \frac{x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots  & \infty \\
\end{array}
\]
\end{frame}
% end module maclaurin-series-list



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/maclaurin-series-ex11.tex
% begin module maclaurin-series-ex11
\begin{frame}
\begin{example}[Example 11, p. 780]
Use a power series to find $\displaystyle \lim_{x\to 0}\frac{e^x - 1 - x}{x^2}$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
e^x%
}%
& \uncover<2->{=} &%
\uncover<2->{%
\alert<handout:0| 3>{1 + x } + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots %
}\\%
\uncover<3->{%
e^x \alert<handout:0| 3>{ - 1 - x}%
}%
& \uncover<3->{=} &%
\uncover<3->{%
\frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \cdots %
}\\%
\uncover<4->{%
\frac{e^x  - 1 - x}{x^2}%
}%
& \uncover<4->{=} &%
\uncover<4->{%
\frac{1}{2!} + \frac{x}{3!} + \frac{x^2}{4!} + \cdots %
}\\%
\uncover<5->{%
\lim_{x\to 0}\frac{e^x  - 1 - x}{x^2}%
}%
& \uncover<5->{=} &%
\uncover<5->{%
\alert<handout:0| 6-7>{%
\lim_{x\to 0}\left( \frac{1}{2} + \frac{x}{3!} + \frac{x^2}{4!} + \cdots \right) \uncover<6->{= \uncover<7->{\frac{1}{2}}} %
}%
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module maclaurin-series-ex11



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/power-series/maclaurin-series-limit-ex.tex
% begin module maclaurin-series-limit-ex
\begin{frame}
\begin{example}
Use a power series to find $\displaystyle \lim_{x\to 0}\frac{x - \sin x}{x^3}$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\sin x%
}%
& \uncover<2->{=} &%
\uncover<2->{%
 x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots %
}\\%
\uncover<3->{%
- \sin x%
}%
& \uncover<3->{=} &%
\uncover<3->{%
\alert<handout:0| 4>{- x} + \frac{x^3}{3!} - \frac{x^5}{5!} + \frac{x^7}{7!} - \cdots %
}\\%
\uncover<4->{%
\alert<handout:0| 4>{x} - \sin x%
}%
& \uncover<4->{=} &%
\uncover<4->{%
\frac{x^3}{3!} - \frac{x^5}{5!} + \frac{x^7}{7!} - \cdots %
}\\%
\uncover<5->{%
\frac{x  - \sin x}{x^3}%
}%
& \uncover<5->{=} &%
\uncover<5->{%
\frac{1}{3!} - \frac{x^2}{5!} + \frac{x^4}{7!} - \cdots %
}\\%
\uncover<6->{%
\lim_{x\to 0}\frac{x  - \sin x}{x^3}%
}%
& \uncover<6->{=} &%
\uncover<6->{%
\alert<handout:0| 7-8>{%
\lim_{x\to 0}\left( \frac{1}{6} - \frac{x^2}{5!} + \frac{x^4}{7!} - \cdots \right) \uncover<7->{= \uncover<8->{\frac{1}{6}}} %
}%
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module maclaurin-series-limit-ex



}% end lecture

% begin lecture
\lect{Spring 2015}{Lecture 14 \alert<1->{Rough Draft}}{14}{
\section{Polar Coordinates}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-coordinates/polar-intro.tex
% begin module polar-intro
\begin{frame}[t]
\frametitle{Polar Coordinates}
\begin{itemize}
\item<1->  The polar coordinate system is an alternative to the Cartesian coordinate system.
%\item  Instead of specifying horizontal distance and vertical distance, we specify angle and distance from the origin.
\item<2-> Choose a point in the plane called $O$ (the origin).
\item<3-> Draw a ray starting at $O$. The ray is called the polar axis.  This ray is usually drawn horizontally to the right.
\end{itemize}
\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=5cm, yunit=5cm}
\begin{pspicture}(-0.2, -0.2)(1.500000,0.6)
\tiny
%force a boudning box:
\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
\psline[linecolor=red!1](1.1, 0.6)(1.1,0.61)

\uncover<5->{
%Calculator input: plotCurve{}(1/5 \cos{}t, 1/5 \sin{}t, 0, 1/6 \pi)
\parametricplot[arrows=->, linecolor=red, plotpoints=1000] {0}{0.523599}{t 57.29578 mul cos 0.2 mul t 57.29578 mul sin 0.2 mul }
\psline[linecolor=blue](0,0)(0.866025404, 0.5)
\rput(0.22, 0.06){$\alert<5>{\theta}$}
}

\uncover<4->{
\fcFullDotBlue{0.866025404}{0.5}
\rput[l](0.88, 0.5){$P\uncover<7->{\alert<7>{(r,\theta)}}$}
}

\uncover<2->{
\fcFullDotBlue{0}{0}
\rput(-0.1, 0){$O$}
}
\uncover<6->{
\rput(0.4, 0.3){$\alert<6>{r}$}
}
\uncover<3->{
\psline{->}(0,0)(1,0)
\rput (0.5, -0.05){polar axis}
}
\end{pspicture}

\vspace{1cm}

%\includegraphics[height=4cm]{polar-curves/pictures/11-03-polar.pdf}%
\column{.5\textwidth}
\begin{itemize}
\only<1-7>{\item<4->  Let $P$ be a point in the plane.
\item<5-> Let $\theta$ denote the angle between the polar axis and the line $OP$.
\item<6-> Let $r$ denote the length of the segment $OP$.
\item<7-> Then $P$ is represented by the ordered pair $(r, \theta )$.
}
\only<8->{
\item<8-> The letters $(x,y)$ imply Cartesian coordinates and the letters $(r, \theta)$- polar. \uncover<9->{When we use other letters, it should be clear from context whether we mean Cartesian or polar coordinates.} \uncover<10->{If not, one must request clarification.}
}
\end{itemize}
\end{columns}
\end{frame}
% end module polar-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-coordinates/polar-questions.tex
% begin module polar-questions
\begin{frame}
\begin{enumerate}
\item<1-| alert@2>  What if $\theta$ is negative?
\item<1-| alert@3>  What if $r$ is negative?
\item<1-| alert@4>  What if $r$ is $0$?
\end{enumerate}
\begin{columns}[c]
\column{.5\textwidth}
\uncover<2->{
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.9, -1.2)(2,0.2)
\tiny
%force a boudning box:
%\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
%\psline[linecolor=red!1](1.1, 0.6)(1.1,0.61)
\fcFullDotBlue{0}{0}

%Calculator input: plotCurve{}(1/10 \cos{}t, 1/10 \sin{}t, 0, -3/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=100]{0} {-2.35619} {t 57.29578 mul cos 0.3000000 mul t 57.29578 mul sin 0.3000000 mul }
\rput[t] (0,-0.1){$O$}
\rput[l](0.3, -0.2){$\theta=-\frac{3\pi}{4}$}

\psline{->}(0,0)(2,0)
\psline[linecolor=blue](0,0)(-0.707106781, -0.707106781)
\fcFullDotBlue{-0.707106781}{-0.707106781}
\rput[tl](-0.6, -0.7){$\begin{array}{l}(r,\theta)=\left(1, -\frac{3\pi}{4}\right)\\ (x,y)=\left(-\frac{\sqrt{2}}2, -\frac{\sqrt{2}}2 \right) \end{array}$}
\end{pspicture}
}

\uncover<3->{
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.9, -1.5)(1.7,0.8)
\tiny
%force a boudning box:
%\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
%\psline[linecolor=red!1](1.1, 0.6)(1.1,0.61)
\fcFullDotBlue{0}{0}

\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=100]{0} {0.523598776 } {t 57.29578 mul cos 0.3000000 mul t 57.29578 mul sin 0.3000000 mul }
\parametricplot[arrows=->, linecolor=brown, plotpoints=100]{0} {3.665191429 } {t 57.29578 mul cos 0.25 mul t 57.29578 mul sin 0.25 mul }

\rput[t] (0,-0.1){$O$}

\psline{->}(0,0)(1,0)
\psline[linecolor=blue](0,0)(0.866025404, 0.5)
\fcFullDotBlue{0.866025404}{0.5}
\rput[tl](-0.75, -0.5){
$(-r, \theta)$
}
\fcFullDotBlue{-0.866025404}{-0.5}
\psline[linecolor=blue, linestyle=dashed](0,0) (-0.866025404,-0.5)
\rput[tl](0.6, 0.7){$(r, \theta) $}
\end{pspicture}
}
%\ \uncover<2->{%
%\includegraphics[height=3cm]{polar-curves/pictures/11-03-ex1b.pdf}%
%}%
%\ \uncover<3->{%
%\includegraphics[height=3cm]{polar-curves/pictures/11-03-negativer.pdf}%
%}%
\column{.5\textwidth}
\begin{enumerate}
\item<2-| alert@2>  Positive angles $\theta$ are measured in the counterclockwise direction from $O$.  Negative angles are measured in the clockwise direction.
\item<3-| alert@3>  Points with polar coordinates $(-r, \theta)$ and $(r, \theta)$ lie on the same line through $O$ and at the same distance from $O$, but on opposite sides.
\item<4-| alert@4>  If $r = 0$, then $(0, \theta)$ represents $O$ for all values of $\theta$.
\end{enumerate}
\end{columns}
\end{frame}
% end module polar-questions



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-coordinates/polar-many-representations.tex
% begin module polar-many-representations
\begin{frame}
\begin{columns}[c]
\column{.5\textwidth}
\uncover<1->{
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.9, -1.1)(2,0.5)
\tiny
%force a boudning box:
%\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
%\psline[linecolor=red!1](1.1, 0.6)(1.1,0.61)
\fcFullDotBlue{0}{0}

%Calculator input: plotCurve{}(1/10 \cos{}t, 1/10 \sin{}t, 0, -3/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=100]{0} {3.926990817} {t 57.29578 mul cos 0.3000000 mul t 57.29578 mul sin 0.3000000 mul }
\rput[t] (0,-0.1){$O$}
\rput[l](0.3, 0.3){$\theta=\frac{5\pi}{4}$}

\psline{->}(0,0)(2,0)
\psline[linecolor=blue](0,0)(-0.707106781, -0.707106781)
\fcFullDotBlue{-0.707106781}{-0.707106781}
\rput[tl](-0.6, -0.7){$(r,\theta)=\left(1, \frac{5\pi}{4}\right)$}
\end{pspicture}
}
\uncover<2->{
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.9, -1.1)(2,0.5)
\tiny
%force a boudning box:
%\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
\psline[linecolor=red!1](1.1, 0.5)(1.1,0.51)
\fcFullDotBlue{0}{0}

%Calculator input: plotCurve{}(1/10 \cos{}t, 1/10 \sin{}t, 0, -3/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=100]{0} {-2.35619} {t 57.29578 mul cos 0.3000000 mul t 57.29578 mul sin 0.3000000 mul }
\rput[t] (0,-0.1){$O$}
\rput[l](0.3, -0.2){$\theta=-\frac{3\pi}{4}$}

\psline{->}(0,0)(2,0)
\psline[linecolor=blue](0,0)(-0.707106781, -0.707106781)
\fcFullDotBlue{-0.707106781}{-0.707106781}
\rput[tl](-0.6, -0.7){$(r,\theta)=\left(1, -\frac{3\pi}{4}\right)$}
\end{pspicture}
}

%\ \uncover<1->{%
%\includegraphics[height=3cm]{polar-curves/pictures/11-03-ex1a.pdf}%
%}%

%\ \uncover<2->{%
%\includegraphics[height=3cm]{polar-curves/pictures/11-03-ex1b.pdf}%
%}%
\column{.5\textwidth}
\uncover<3->{
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.9, -1.1)(2,0.5)
\tiny
%force a boudning box:
%\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
%\psline[linecolor=red!1](1.1, 0.6)(1.1,0.61)
\fcFullDotBlue{0}{0}

%Calculator input: plotCurve{}(1/50 t \cos{}t+3/20 \cos{}t, 1/50 t \sin{}t+3/20 \sin{}t, 0, 13/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=400] {0} {10.2102} {t 57.29578 mul cos 0.1500000 mul t 57.29578 mul cos t mul 0.0200000 mul add t 57.29578 mul sin 0.1500000 mul t 57.29578 mul sin t mul 0.0200000 mul add }

\rput[t] (0,-0.1){$O$}
\rput[l](0.3, 0.3){$\theta=\frac{13\pi}{4}$}

\psline{->}(0,0)(2,0)
\psline[linecolor=blue](0,0)(-0.707106781, -0.707106781)
\fcFullDotBlue{-0.707106781}{-0.707106781}
\rput[tl](-0.6, -0.7){$(r,\theta)=\left(1, \frac{13\pi}{4}\right)$}
\end{pspicture}
}

\uncover<4->{
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.9, -1.1)(2,0.5)
\tiny
%force a boudning box:
%\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
\psline[linecolor=red!1](1.1, 0.5)(1.1,0.51)
\fcFullDotBlue{0}{0}

%Calculator input: plotCurve{}(1/10 \cos{}t, 1/10 \sin{}t, 0, -3/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=100]{0} {0.785398163} {t 57.29578 mul cos 0.3000000 mul t 57.29578 mul sin 0.3000000 mul }
\rput[t] (0,-0.1){$O$}
\rput[l](0.35, 0.15){$\theta=\frac{\pi}{4}$}

\psline{->}(0,0)(2,0)
\psline[linecolor=blue](0,0)(-0.707106781, -0.707106781)
\fcFullDotBlue{-0.707106781}{-0.707106781}
\psline[linestyle=dashed](0,0)(0.707106781, 0.707106781)
\fcFullDotBlack{0.707106781}{0.707106781}
\rput[tl](-0.6, -0.7){$(r,\theta)=\left(-1, \frac{\pi}{4}\right)$}
\end{pspicture}
}
%\ \uncover<3->{%
%\includegraphics[height=3cm]{polar-curves/pictures/11-03-ex1c.pdf}%
%}%

%\ \uncover<4->{%
%\includegraphics[height=3cm]{polar-curves/pictures/11-03-ex1d.pdf}%
%}%
\end{columns}
\begin{itemize}
\item  There are many ways to represent the same point.
\item<2-| alert@2>  We could use a negative $\theta$.
\item<3-| alert@3>  We could go around more than once.
\item<4-| alert@4>  We could use a negative $r$.
\end{itemize}
\end{frame}
% end module polar-many-representations



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-coordinates/polar-two-points-coincide-iff.tex
%begin module polar-two-points-coincide-iff
\begin{frame}
\begin{itemize}
\item Let $P_1$ be point  with polar coordinates $(r_1, \theta_1)$.
\item Let $P_2$ be point  with polar coordinates $(r_2, \theta_2)$.
\end{itemize}

\uncover<2->{
\begin{observation}
$P_1$ coincides with $P_2$ if one of the three mutually exclusive possibilities holds:
\begin{itemize}
\item<alert@3> $r_1=r_2\neq 0$ and $\theta_2=\theta_1+2k\pi, k\in \mathbb Z $,
\item<alert@4> $r_1=-r_2\neq 0$ and $\theta_2=\theta_1+(2k+1)\pi, k\in \mathbb Z$,
\item $r_1=r_2=0 $ and $\theta$ is arbitrary.
\end{itemize}
\end{observation}
}
\begin{columns}
\column{.5\textwidth}
\only<3>{
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.9, -1.1)(2,0.75)
\tiny
%force a boudning box:
%\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
%\psline[linecolor=red!1](1.1, 0.6)(1.1,0.61)
\fcFullDotBlue{0}{0}

%Calculator input: plotCurve{}(1/10 \cos{}t, 1/10 \sin{}t, 0, -3/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=100]{0} {3.926990817} {t 57.29578 mul cos 0.3000000 mul t 57.29578 mul sin 0.3000000 mul }
\rput[t] (0,-0.1){$O$}
\rput[l](0.3, 0.3){$\theta_1$}

\psline{->}(0,0)(2,0)
\psline[linecolor=blue](0,0)(-0.707106781, -0.707106781)
\fcFullDotBlue{-0.707106781}{-0.707106781}
\rput[tl](-0.6, -0.7){$(r_1,\theta_1)$}
\end{pspicture}
}
\uncover<4>{
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.9, -1.1)(2,0.75)
\tiny
%force a boudning box:
%\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
\psline[linecolor=red!1](1.1, 0.5)(1.1,0.51)
\fcFullDotBlue{0}{0}

%Calculator input: plotCurve{}(1/10 \cos{}t, 1/10 \sin{}t, 0, -3/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=100]{0} {-2.35619} {t 57.29578 mul cos 0.3000000 mul t 57.29578 mul sin 0.3000000 mul }
\rput[t] (0,-0.1){$O$}
\rput[l](0.3, -0.2){$\theta_1$}

\psline{->}(0,0)(2,0)
\psline[linecolor=blue](0,0)(-0.707106781, -0.707106781)
\fcFullDotBlue{-0.707106781}{-0.707106781}
\rput[tl](-0.6, -0.7){$(r_1,\theta_1)$}
\end{pspicture}
}

%\ \uncover<1->{%
%\includegraphics[height=3cm]{polar-curves/pictures/11-03-ex1a.pdf}%
%}%

%\ \uncover<2->{%
%\includegraphics[height=3cm]{polar-curves/pictures/11-03-ex1b.pdf}%
%}%

\vspace{2cm}
\column{.5\textwidth}
\only<3>{
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.9, -1.1)(2,0.75)
\tiny
%force a boudning box:
%\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
%\psline[linecolor=red!1](1.1, 0.6)(1.1,0.61)
\fcFullDotBlue{0}{0}

%Calculator input: plotCurve{}(1/50 t \cos{}t+3/20 \cos{}t, 1/50 t \sin{}t+3/20 \sin{}t, 0, 13/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=400] {0} {10.2102} {t 57.29578 mul cos 0.1500000 mul t 57.29578 mul cos t mul 0.0200000 mul add t 57.29578 mul sin 0.1500000 mul t 57.29578 mul sin t mul 0.0200000 mul add }

\rput[t] (0,-0.1){$O$}
\rput[l](0.3, 0.3){$\theta_2=\theta_1+2\pi$}

\psline{->}(0,0)(2,0)
\psline[linecolor=blue](0,0)(-0.707106781, -0.707106781)
\fcFullDotBlue{-0.707106781}{-0.707106781}
\rput[tl](-0.6, -0.7){$(r_2, \theta_2)=(r_1,\theta_1+2\pi)$}
\end{pspicture}
}

\uncover<4>{
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.9, -1.1)(2,0.75)
\tiny
%force a boudning box:
%\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
\psline[linecolor=red!1](1.1, 0.5)(1.1,0.51)
\fcFullDotBlue{0}{0}

%Calculator input: plotCurve{}(1/10 \cos{}t, 1/10 \sin{}t, 0, -3/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=100]{0} {0.785398163} {t 57.29578 mul cos 0.3000000 mul t 57.29578 mul sin 0.3000000 mul }
\rput[t] (0,-0.1){$O$}
\rput[l](0.35, 0.15){$\theta_2=\theta_1+\pi$}

\psline{->}(0,0)(2,0)
\psline[linecolor=blue](0,0)(-0.707106781, -0.707106781)
\fcFullDotBlue{-0.707106781}{-0.707106781}
\psline[linestyle=dashed](0,0)(0.707106781, 0.707106781)
\fcFullDotBlack{0.707106781}{0.707106781}
\rput[tl](-0.6, -0.7){$(r_2, \theta_2)=(-r_1,\theta_1+\pi)$}
\end{pspicture}
}
%\ \uncover<3->{%
%\includegraphics[height=3cm]{polar-curves/pictures/11-03-ex1c.pdf}%
%}%

%\ \uncover<4->{%
%\includegraphics[height=3cm]{polar-curves/pictures/11-03-ex1d.pdf}%
%}%

\vspace{2cm}
\end{columns}
\end{frame}
%end module polar-two-points-coincide-iff



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-coordinates/polar-to-cartesian.tex
% begin module polar-to-cartesian
\begin{frame}
\begin{itemize}
\item  How do we go from polar coordinates to Cartesian coordinates?
\item<2->  Suppose a point has polar coordinates $(r, \theta )$ and Cartesian coordinates $(x,y)$.
\item<8->  How do we go from Cartesian coordinates to polar coordinates?
\end{itemize}
\begin{columns}[c]
\column{0.5\textwidth}
\psset{xunit=4cm, yunit=4cm}
\begin{pspicture}(-0.2, -0.2)(1.400000,0.9)
\tiny
%force a boudning box:
\psline[linecolor=red!1](-0.1, -0.1)(-0.21,0.2)
\psline[linecolor=red!1](1.1, 0.6)(1.1,0.61)
\psaxes[arrows=<->, ticks=none, labels=none](0,0)(-0.2, -0.2)(1, 0.8)
\rput(-0.03, 0.8){$y$}
\rput(1,-0.03){$x$}
%\fcAxesStandard{-0.2}{-0.2}{1}{0.8}

%Calculator input: plotCurve{}(1/5 \cos{}t, 1/5 \sin{}t, 0, 1/6 \pi)
\parametricplot[arrows=->, linecolor=red, plotpoints=1000] {0}{0.523599}{t 57.29578 mul cos 0.2 mul t 57.29578 mul sin 0.2 mul }
\psline[linecolor=blue](0,0)(0.866025404, 0.5)
\rput(0.22, 0.06){$\theta$}

\fcFullDotBlue{0.866025404}{0.5}
\psline(0.866025404,0.5)(0.866025404,0)
\psline(0.846025404, 0)(0.846025404, 0.02)(0.866025404, 0.02)
\rput[l](0.9, 0.5){$P(r,\theta) =(x,y)$}

\uncover<6>{
\psline{<-}(0.89, 0)(0.89, 0.2)
}
\uncover<6->{
\rput(0.89,0.25){$\alert<6,10>{y}$}
}
\uncover<6>{
\psline{->}(0.89, 0.3)(0.89, 0.5)
}
\uncover<4>{
\psline{<-}(0, -0.02)(0.385, -0.02)
}
\uncover<4->{
\rput(0.435,-0.02){$\alert<4,10>{x}$}
}
\uncover<4>{
\psline{->}(0.485, -0.02)(0.866025404, -0.02)
}
\rput[tr](-0.03, -0.03){$O$}
\rput(0.4, 0.3){$\alert<4,6,9,10>{r}$}
\end{pspicture}
%\ \uncover<2->{%
%\includegraphics[height=5cm]{polar-curves/pictures/11-03-conversion.pdf}%
%}%
\column{.5\textwidth}
$
\renewcommand{\arraystretch}{1.5}
\begin{array}{rcl}
\alert<7>{x} &\alert<7>{=}&\uncover<7->{\alert<7>{r\cos \theta} } \\
\alert<7>{y}&\alert<7>{=}& \uncover<7->{\alert<7>{r\sin \theta}} \\\hline
\uncover<3->{\alert<3,4,7>{\cos\theta}} & \uncover<3->{\alert<3,4,7>{=}} &\displaystyle \uncover<4->{\alert<4,7>{\frac{x}{r} }} \\
\uncover<3->{\alert<5,6,7>{\sin \theta}} &\uncover<3->{ \alert<5,6,7>{= }} & \displaystyle \uncover<6->{\alert<6,7>{\frac{y}{r}}}\\
\uncover<9->{\alert<handout:0| 9-10>{r^2} &\alert<9,10>{=}& \uncover<10->{\alert<10>{x^2 + y^2}}}\\\hline
\alert<8,9,10,11>{ r}&\alert<8,9,10,11>{=}&\uncover<11->{\alert<11>{ \sqrt{x^2+y^2}}} \\
\alert<12,13>{\theta} &\alert<12,13>{=}&  
\uncover<13->{\alert<13>{\arcsin \left(\frac{y}{r}\right)  \text{\quad if } x>0}}\\ 
\uncover<13->{
&\alert<13>{=}&\alert<13>{\arccos \left(\frac{x}{r}\right)  \text{\quad if } y>0}}\\
\uncover<13->{&\alert<13>{=}&\alert<13>{\arctan \left(\frac{y}{x}\right)  \text{\quad if } x>0}}
\end{array}
$


\end{columns}
\end{frame}
% end module polar-to-cartesian



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-coordinates/polar-to-cartesian-ex2.tex
% begin module polar-to-cartesian-ex2
\begin{frame}
\begin{example} 
Convert the point $(\alert<handout:0| 4>{2}, \alert<handout:0| 6>{\frac{\pi}{3}})$ from polar to Cartesian coordinates.
\[
\uncover<2->{%
x = \alert<handout:0| 3-4>{r}\cos \alert<handout:0| 5-6>{\theta} = %
}%
\uncover<3->{%
\alert<handout:0| 3-4>{\uncover<4->{2}}\alert<handout:0| 7-8>{ \cos } \alert<handout:0| 5-8>{\uncover<6->{\frac{\pi}{3}}} %
}%
\uncover<7->{%
= 2\left( \alert<handout:0| 7-8>{\uncover<8->{\frac{ 1}{ 2 } } } \right) \uncover<9->{ = 1}%
}%
\]
\[
\uncover<2->{%
y = r\sin \theta = %
}%
\uncover<10->{%
2\alert<handout:0| 11-12>{\sin \frac{\pi}{3}}%
}%
\uncover<11->{%
= 2\left( \alert<handout:0| 11-12>{ \uncover<12->{ \frac{ \sqrt{ 3 }}{2}}}\right) \uncover<13->{ = \sqrt{3}}%
}%
\]
\uncover<14->{%
Therefore the point with polar coordinates $(2,\frac{\pi}{3})$ has Cartesian coordinates $(1,\sqrt{3})$.
}%
\end{example}
\end{frame}
% end module polar-to-cartesian-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-coordinates/polar-to-cartesian-ex3.tex
% begin module polar-to-cartesian-ex3
\begin{frame}
\begin{example}
\begin{columns}
\column{0.25\textwidth}
\psset{xunit=0.65cm, yunit=0.65cm}
\begin{pspicture}(-1,-1)(2,2)
\tiny
\fcAxesStandard{-1.5}{-1.5}{1.5}{1.5}
\fcLabels{1.5}{1.5}
\uncover<9->{%
\fcFullDot{1}{-1}%
}%
\uncover<11->{% 
\fcAngleDegrees[arrows=->, linecolor=red]{0}{315}{0.2} { $\frac{7\pi}{4}$}%
\psline(0,0)(1,-1)
}%
\uncover<13->{%
\fcAngleDegrees{0}{-45}{0.4}{$~~-\frac{\pi}{4}$}
}%
\end{pspicture}
\column{0.75\textwidth}
Represent the point with Cartesian coordinates $(1,-1)$ in terms of polar coordinates.
\end{columns}
\begin{columns}
\column{.6\textwidth}
\begin{itemize}
\item<3-| alert@3-4>  Suppose $r$ is positive.
\item<7->  $\tan \theta = -1$ for $\theta = \alert<handout:0| 10>{\frac{3\pi}{4}}, \alert<handout:0| 10-11>{\frac{7\pi}{4}}$, and many other angles.
\item<8-| alert@8-9>  $(1,-1)$ is in the \uncover<9->{fourth} quadrant.
\item<10->  Of the two values above, only \alert<handout:0| 10-11>{$\theta = \uncover<11->{\frac{7\pi}{4}}$} gives a point in the fourth quadrant.
\item<12->  Therefore one possible representation of $(1,-1)$ in polar coordinates is $(\sqrt{2}, 7\pi/4)$.
\item<13->  $(\sqrt{2}, -\pi /4)$ is another.
\end{itemize}
\column{.4\textwidth}
\begin{eqnarray*}
\uncover<2->{%
r%
}%
& \uncover<2->{ = } &%
\uncover<2->{%
\uncover<-3>{\alert<handout:0| 3>{\pm}} \sqrt{x^2+y^2}%
}\\%
& \uncover<5->{ = } &%
\uncover<5->{%
\sqrt{1^2 + (-1)^2}%
}\\% = \sqrt{2}%
& \uncover<5->{ = } &%
\uncover<5->{%
\sqrt{2}%
}\\% = \sqrt{2}%
&&\\
\uncover<2->{%
\tan \theta%
}%
& \uncover<2->{ = } &%
\uncover<2->{%
\frac{y}{x}%
}\\%
& \uncover<6->{ = } &%
\uncover<6->{%
-1%
}\\%
\end{eqnarray*}
\end{columns}
\end{example}
\end{frame}
% end module polar-to-cartesian-ex3



\section{Complex numbers}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-definition.tex
\begin{frame}
\frametitle{Complex numbers definition}
\begin{definition}The set of complex numbers $\mathbb C$ is defined as the set
\[
\{a+  b i  | a,b-\text{real~numbers}\},
\]
where the number $i$ is a number for which 
\[
\alert<4>{i^2=-1}\quad .
\]
The number $i$ is called the imaginary unit.
\end{definition}
\begin{itemize}
\item<2-> Complex numbers are added/subtracted according to the rule
\[
(a+b i)\pm(c+d i)= (a\pm c) + (b\pm d)i\quad .
\]
\item<3-> Complex numbers are multiplied according to the rule
\[
(a+b i)(c+d i)= a c + a d i+ b ci + \alert<4>{bd i^2}= \uncover<4>{(ac \alert<4>{- bd}) + (bc+ad)i}  \quad .
\]
\end{itemize}

\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-terminology.tex
\begin{frame}
\begin{columns}
\column{0.25\textwidth}
\begin{pspicture}(-1,-1)(1,1)
\tiny
\fcAxesStandard{-0.7}{-0.6}{2.5}{2.5}
\fcLabels[$\Re$][$\Im$]{2.5}{2.5}
\uncover<8-10>{%
\fcPerpendicular{[0.5 1]}{[1 0] [0 0]}{0.1}%
\fcPerpendicular{[0.5 1]}{[0 1] [0 0]}{0.1}%
}%
\uncover<8->{% 
\fcFullDot{0.5}{1}%
}%
\uncover<14>{%
\rput[tl](1,1.9 ){$c(x+yi)$}%
\fcFullDot{1}{2}%
\psline[arrows=->](0,0)(1,2)%
}%
\uncover<15>{%
\rput[tl](0.25,0.4){$c(x+yi), 0<c<1$}%
\fcFullDot{0.25}{0.5}%
\psline[arrows=->](0,0)(0.25,0.5)%
}%
\uncover<16>{%
\rput[bl](-0.25,-0.4 ){$~~~~~c(x+yi), c<0$}%
\fcFullDot{-0.25}{-0.5}%
\psline[arrows=->](0,0)(-0.25,-0.5)%
}%
\uncover<10->{\psline[arrows=->](0,0)(0.5,1)}%
\uncover<11-13>{%
\fcFullDot{1}{0.5}%
\psline[arrows=->](0,0)(1,0.5)%
}%
\uncover<12-13>{%
\fcFullDot{1.5}{1.5}%
\psline[arrows=->](0.5,1)(1.5,1.5)%
\psline[arrows=->](1,0.5)(1.5,1.5)%
}%
\uncover<12>{\rput[b](1.5,1.6){$\alert<12>{x+u+(y+w)i}$}}
\uncover<13>{\rput[b](1.5,1.6){$\alert<13>{(x+u,y+w)}$}}
\uncover<8,13>{\rput[lb](0,1.1){$\alert<8,13>{(x,y)}$}}
\uncover<11,12>{\rput[tl](1,0.5){$\alert<11,12>{~u+wi}$}}
\uncover<13>{\rput[tl](1,0.5){$\alert<13>{~(u,w)}$}}
\uncover<9-12,14->{\rput[lb](0,1.1){$\alert<9,11,12>{x+yi}$}}
\end{pspicture}
\column{0.75\textwidth}
\begin{definition}[Complex numbers]
The complex numbers are the set $\{x+yi|x,y\in\alert<2>{\mathbb R}\}$. 
\end{definition}
\begin{itemize}
\item<2-> Real numbers are usually denoted by $\mathbb R$.
\item<3-> Complex numbers are usually denoted by $\mathbb C$.
\end{itemize}
\end{columns}
\uncover<4->{Consider $z= \alert<5>{x}+\alert<6>{y}i$.}
\begin{itemize}
\item<5-> \alert<5,7>{$x$} is called the \alert<5,7>{real part} of $z$, \uncover<6->{ \alert<6,7>{$y$} is called the \alert<6,7>{imaginary part} of $z$.} \uncover<7->{We write $ \alert<7>{x=\Re z} =\Re(x+yi)$, $\alert<7>{y=\Im z} = \Im (x+yi)$.}
\item<8-> Real \& imaginary part of $z$ can be used as $x,y$-coords. to depict $z$. 
\item<10-> In this way we view complex number $x+iy$ as the point (position vector) $(x,y)$ in a two-dimensional space. 
\item<11-> The addition of complex numbers corresponds to \alert<11-13>{vector addition}.
\item<14-> \alert<14,15,16>{Multiplication by a real number $c$ } corresponds to \alert<14,15,16>{vector scalar multiplication by $c$ \alert<14,15,16>{(scaling)}}.
\item<17-> The space the complex numbers is referred to as the \alert<17>{complex plane} (sometimes alternatively called the complex line).
\end{itemize}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-addition-multiplication-example-1.tex
\begin{frame}
Let $u=2+3i$, $v=5-7i$.
\begin{example}[Addition]
$u+v= \fcQuestion{2}{(2+3i)+(5-7i) =} \fcAnswer{3}{(2+5)+(3-7)i= 7-4i}$.
\end{example}
\begin{example}[Subtraction]
$u-v=\fcQuestion{4} {(2+3i)-(5-7i)=}\fcAnswer{5}{(2-5)+(3-(-7))i= -3+10i}$.
\end{example}
\begin{example}[Multiplication]
$
\begin{array}{rcl}
u\cdot v&=& \uncover<6->{(\alert<7,8>{2}+\alert<9,10>{3i})\alert<7,8,9,10>{\cdot} ( \alert<7,9>{5}\alert<8,10>{-7i})}\\
\uncover<7->{&=& \alert<7,11>{2\cdot 5 }+ \alert<8,12>{2\cdot(-7)i} +\alert<9,13>{3i\cdot 5}+\alert<10,14>{3i(-7i)}} \\
\uncover<11->{&=& \alert<11>{10} \alert<15>{ \alert<12>{-14 i}+ \alert<13>{15i} } \alert<14>{-\alert<16>{21 i^2}} }\\
\uncover<15->{&=&10+\alert<15>{i}-(\alert<16>{-21})}\\
\uncover<17>{ &=&31+i}
\end{array}
$
\end{example}

\vskip 10cm
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-conjugation.tex
\begin{frame}

\begin{columns}
\column{0.2\textwidth}
\begin{pspicture}(-1,-1)(1,1)
\tiny
\fcAxesStandard{-0.4}{-1.5}{1.8}{1.5}%
\fcLabels[$\Re$][$\Im$]{1.8}{1.5}%
\fcFullDot{1}{0.5}%
\rput[lb](1,0.5){$~x+iy$}%
\psline[arrows=->](0,0)(1,0.5)%
\uncover<3->{%
\fcFullDot{1}{-0.5}%
\psline[arrows=->](0,0)(1,-0.5)%
\rput[lt](1,-0.5){$~x-iy$}%
\fcPerpendicular{[1 0.5]}{[0 0] [1 0]}{0.07}%
\fcPerpendicular{[1 -0.5]}{[0 0] [1 0]}{0.07}%
}%
\uncover<13->{%
\rput[br](0.5, 0.25){$\alert<13>{|z|~}$}
\psline[linecolor=red, linewidth=2pt](0,0)(1,0.5)
}%
\uncover<12->{%
\rput[t](0.5, -0.1){$\alert<12,13>{x}$}
\psline[linecolor=red, linewidth=2pt](0,0)(1,0)
\rput[l](1, 0.25){$~~\alert<12,13>{y}$}
\psline[linecolor=red, linewidth=2pt](1,0)(1,0.5)
}%
\end{pspicture}
\column{0.8\textwidth}
Let $z=x+iy$ be a complex number. 
\begin{definition}[Complex conjugation]
We say that $\alert<handout:0|1>{\bar z = \overline{(x+iy)}=x-iy}$ is the \alert<handout:0|1>{\emph{complex conjugate of $z$}}.
\uncover<2->{
The transformation that maps $z$ to $\bar z$ is called \emph{complex conjugation}.
}
\end{definition}
\end{columns}
\uncover<3->{In the complex plane, complex conj. = reflection across real axis.}
\uncover<4->{%
\begin{theorem}
$z \bar z$ is a non-negative real number. $z\bar z$ equals $0$ if and only if $z=0$.
\end{theorem}
}%
\uncover<5->{
\begin{proof}
$z \bar z= \uncover<6->{(x+iy)(x-iy)=}\uncover<7->{x^2\alert<8>{-}(\alert<8>{i}y)^{\alert<8>{2}}=} \uncover<8->{x^2\alert<8>{+}y^2}$ \uncover<8->{is real and non-negative.} \uncover<9->{ $z \bar z=0$ implies $x^2+y^2=0$,} \uncover<10->{which implies $x=y=0$.}
\end{proof}
}
\uncover<11->{
\begin{definition}
The quantity $\alert<11,13>{|z|}=\sqrt{z\bar z}= \sqrt{ {\alert<12>{x}}^2+ { \alert<12>{y }}^2}$ is called the \alert<11>{\emph{absolute} value of $z$}.
\end{definition}
}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-conjugation-is-field-hmm.tex
\begin{frame}
\begin{theorem}[Conjugation preserves $+,\cdot$]
\begin{enumerate}
\item $\alert<18>{\overline {z\cdot w}=\overline z\cdot \overline w}$
\item $\alert<25>{\overline {z+w}=\overline z+\overline w}$
\end{enumerate}
\end{theorem}
\uncover<2->{
\begin{proof}
Let $\alert<4,11>{z=x+yi}$, $\alert<5,12>{w=u+vi}$.
\begin{itemize}
\item<3-> $\begin{array}{rcl}
\alert<18>{\overline {\alert<4>{z}}\cdot \overline{\alert<5>{w}}}  &=& \uncover<4->{ \overline{(\alert<4>{x+yi})}\cdot \overline{(\alert<5>{u+vi})} } \uncover<6->{=  (\alert<7,9>{x} \alert<8,10>{-yi})( \alert<7,10>{u}\alert<8,9>{-vi})}\\
\uncover<7->{&=& \alert<18>{(\alert<7>{xu}\alert<8>{-yv})\alert<9,10>{-}( \alert<9>{xv} +\alert<10>{yu} )\alert<9,10>{ i}}} \\
\alert<18>{\overline{\alert<11>{z} \cdot \alert<12>{w}}} &=& \uncover<11->{ \overline{ (\alert<11>{\alert<13,15>{x} +\alert<14,16>{yi}})\alert<12>{ ( \alert<13,16>{u} +\alert<14,15>{iv})}}} \uncover<13->{ = \overline{ \alert<13>{xu} \alert<14>{-yv} + (\alert<15>{xv}+\alert<16>{yu})\alert<15,16>{i}}} \\
\uncover<17->{&=&\alert<18>{ (xu-yv)-(xv+yu)i }\quad .}
\end{array}
$
\item<19-> $\begin{array}{rcl}
\alert<25>{\overline {z}+\overline{w}} &=&\uncover<19->{ \overline{(x+yi)}+\overline{(u+vi)}} \uncover<20->{=(x-yi)+(u-vi)}\\
\uncover<21->{&=&\alert<25>{ (x+u)-(y+v)i}} \\
\alert<25>{\overline{z+ w}} &=& \uncover<22->{\overline{(x+yi)+(u+iv)}} \uncover<23->{=\overline{(x+u)+(y+v)i}}\\
\uncover<24->{&=&\alert<25>{(x+u)-(y+v)i }\quad .}
\end{array}
$
\end{itemize}
\end{proof}
}
\end{frame}

\begin{frame}
In the preceding slide we proved the following.
\begin{theorem}[Conjugation preserves $\cdot$]
$\overline {z\cdot w}=\overline z\cdot \overline w$.
\end{theorem}
\begin{corollary}
\alert<3>{$|zw|=|z||w|$}.
\end{corollary}
\begin{proof}
$\uncover<2->{|zw|= \sqrt{zw \alert<3>{\overline{zw}}}} \uncover<3->{= \sqrt{zw \alert<3>{\bar z \bar w}} } \uncover<4->{ = \sqrt{z\bar z}\sqrt{w\bar w}} \uncover<5->{ = |z| |w|} $.
\end{proof}
\uncover<6->{
\begin{corollary}
$|\frac{z}{w}|=\frac{|z|}{|w|}$, $w\neq 0$.
\end{corollary}
}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-division-example-1.tex
\begin{frame}
Let $u=2+3i$, $v=5-7i$.
\begin{example}[Division]
$\begin{array}{rcll|l}
\displaystyle\frac{u}{v}&=& \displaystyle\frac{2+3i}{5-7i}~~~~~~~~~~~~~~~~~~~~~~~~~~\\
&\uncover<2->{=}&\displaystyle \uncover<2->{ \frac{(2+3i)}{ \fcQuestion{2}{(5 -7i)}} \frac{\alert<4,5>{ \fcAnswer{3}{(5+7i)}}}{\alert<4,5>{\fcAnswer{3}{(5+7i)}}}} & & \fcQuestion{2}{ \begin{array}{l}
\text{Multiply and divide } \\
\text{by complex conjugate }\\
\text{of denominator}
\end{array}
}
\\
\uncover<4->{ &=& \displaystyle \frac{(2+3i)(5+7i)}{\fcAnswer{5}{5^2-(7i)^2}} }\\
\uncover<6->{&=&\displaystyle \frac{10+15i+14i+21i^2}{5^2+7^2}}\\
\uncover<7->{&=&\displaystyle \frac{10-21+29i}{25+49}}\\
\uncover<8->{&=&\displaystyle \frac{-11+29i}{74}}\\
\uncover<9->{&=&\displaystyle -\frac{11}{74}+\frac{29}{74}i}
\end{array}
$
\end{example}

\vskip 10cm
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-division.tex
\begin{frame}
Let $u=a+bi$, $v=c+di$, $v\neq 0$.
\begin{example}[Complex number division]
$\begin{array}{rcll|l}
\displaystyle\frac{u}{v}&\uncover<1->{=}& \displaystyle\frac{a+bi}{c+di}~~~~~~~~~~~~~~~~~~~~~~~~~~\\
&\uncover<1->{=}&\displaystyle \frac{(a+bi)}{(c+di)}\frac{(c-di)}{(c-di)} & & \begin{array}{l}
\text{Multiply and divide } \\
\text{by complex conjugate }\\
\text{of denominator}
\end{array}
\\
&\uncover<1->{=}&\displaystyle \frac{(a+bi)(c-di)}{c^2-(di)^2}\\
&\uncover<1->{=}&\displaystyle \frac{ac-adi+cbi-bdi^2}{c^2+d^2}\\
&\uncover<1->{=}&\displaystyle \frac{ac+bd+(bc-ad)i}{c^2+d^2}\\
&\uncover<1->{=}&\displaystyle \frac{ac+bd}{c^2+d^2}+\frac{(bc-ad)}{c^2+d^2}i\\
\end{array}
$
\end{example}
\begin{definition}[Complex number division]
The quotient $\frac{u}{v}$, $v\neq 0$ is defined via the formula above.
\end{definition}
\vskip 10cm
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/product-of-exponents-is-exponent-of-sum.tex
\begin{frame}
\begin{theorem}
Let $\alert<2>{e(z)= \sum\limits_{n=0}^{\infty}\frac{z^n }{ n!}}$, \uncover<2->{\alert<2>{$z\in \mathbb C$}.} \uncover<3->{Then $e(z ) e ( w ) =e(z+w)$.}
\end{theorem}
\uncover<2->{\alert<2>{Power series over $\mathbb C$ are defined similarly to power series over $\mathbb R$. }} \uncover<4->{\alert<4>{The following proof lies outside of scope Calc II. Details are omitted and get filled in a course of Complex Analysis. You will not be tested on it. }}
\uncover<4->{
\begin{proof}
\uncover<5->{
$
\begin{array}{rcll|l}
\displaystyle e(z)e(w)&=&\displaystyle  \sum_{n=0}^{\infty} \frac{z^n}{n!} \sum_{m=0}^{\infty} \frac{w^m}{m!} =  \displaystyle  \sum_{s=0}^{ \infty} \sum_{ k=0 }^s \frac{z^{k}w^{s-k}}{k! (s-k)!} \\ &=& \displaystyle  \sum_{s=0}^{\infty} \alert<6>{ \sum_{k=0 }^s  } \frac{\alert<6>{ z^{k} w^{s -k} }}{ s!}\alert<6>{ \frac{s!}{k! (s-k)! }} =\displaystyle  \sum_{s=0}^{\infty} \frac{ \alert<6>{ (z+w)^s} }{s!}=e(z+w).
\end{array}
$
} %uncover
\end{proof}
} %uncover
\uncover<6->{
\begin{lemma}[Newton Binomial formula]
\alert<6>{$(z+w)^s=\sum_{k=0 }^s z^{k}w^{s-k} \frac{s!}{k! (s-k)!}$}.
\end{lemma}
}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-exponent-def.tex
\begin{frame}
\begin{definition}[Real exponent, Definition I]
Let $z\in \mathbb R$. The real exponent $e^z$ is defined as $\displaystyle \lim\limits_{\substack{p\to x \\ p\text{ is rational}}} e^p$.
\end{definition}
\uncover<2->{
\begin{definition}[Exponent, Definition II]
Let $z\in \mathbb C$. The complex exponent $e^z$ is defined by $\displaystyle e^z=e(z)= \sum \limits_{ n=0 }^\infty \frac{z^n}{n!}.$
\end{definition}
}
\only<handout:1|1-8>{
\begin{itemize}
\item<3-> For real $z$, $e^z$ may be defined via Definition I. 
\item<4-> For complex $z$, $e^z$ is defined via Definition II. 
\item<5-> Real numbers are complex numbers (with zero imaginary part). Thus Definition II is also valid when $z$ is a real number, and therefore Definition II is more general.
\item<6-> \alert<handout:0|8>{A calculus course may be built by presenting Definition II first and proving Definition I as a theorem.}
\item<7-> \alert<handout:0|8>{Alternatively, a calculus course may be built by first presenting Definition I, and then expanding it to Definition II.}
\end{itemize}
}
\only<handout:2|9->{
\begin{theorem}
\alert<9>{When $z\in \mathbb R$, Definition I and Definition II are equivalent.}
\end{theorem}
\only<handout:2|10-12>{
\begin{proof}[Sketch of Proof. Definition I implies Definition II over $\mathbb R$]
Under Definition I the Maclaurin series of $e^z$ was computed to be $\sum\limits_{n=0}^\infty \frac{z^n}{n!}$. \uncover<11->{Under Definition I, it can be shown that $e^z$ equals its Maclaurin series,} \uncover<12->{which is the defining expression for Definition II.}
\end{proof}
}
\only<handout:3|13->{
\begin{proof}[Sketch of Proof. Definition II implies Definition I over $\mathbb R$]
We showed that $e(z+w)=e(z)e(w)$. \uncover<14->{Using that statement alone, one can show that the two definitions agree over the rational numbers.} \uncover<15->{Two continuous functions are equal if they are equal over the rationals,} \uncover<16->{and the theorem follows.}
\end{proof}
} %only
} %only
\vskip 10cm
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/trigonometry/trig-Euler-formula.tex

\begin{frame}
\frametitle{Euler's Formula}
\begin{theorem}[Euler's Formula]
\[
e^{i x}= \cos x + i\sin x,
\]
where $e \approx 2.71828$ is Euler's/Napier's constant .
\end{theorem}
\begin{proof} 
Recall $n!=1\cdot2\cdot 3\cdot \dots \cdot(n-1)*n$. Borrow from Calc II the f-las:
\only<1>{\\ \vspace{5cm} ~}
\only<2>{
\[
\sin x= x-\frac{x^3}{3!}+\frac{x^5}{5!}-\dots +\frac{(-1)^nx^{2n+1}}{(2n+1)!}+\dots 
\]
\[
\cos x= 1-\frac{x^2}{2!}+\frac{x^4}{4!}-\dots +\frac{(-1)^nx^{2n}}{(2n)!} +\dots
\]
\[
e^{x}=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\dots + \frac{x^n}{n!}+\dots 
\]
} 
\only<3->{
\\~\\
\begin{tabular}{rclllllll}
$\uncover<6->{\alert<6>{i}}\sin x$ & $ =$  & & $\phantom{+}\uncover<6->{\alert<6>{i}} x$ & &$-\uncover<6->{\alert<6>{i}}\frac{~~x^3~~}{3!}$ & & $+\uncover<6->{\alert<6>{i}}\frac{~~x^5~~}{5!}$ & $-\dots$ \\
\\
$\cos x$ & $ =$  & $1$ &  & $-\frac{~~~x^{2}~~~}{2!}$ & & $+\frac{~~~x^4~~~}{4!}$ &  & $+\dots$ \\\hline
$e^{\only<3>{z} \only<4->{ \alert<4>{ix}} }$& $= $ & $1$ 
& $+\only<3>{z} \only<4->{\alert<4>{ix}}  $
&$\only<-4>{+}\only<5->{\alert<5>{-}} \frac{ 
\only<3>{z^2}\only<4>{\alert<4>{(ix)^2}}\only<5->{\alert<5>{~~x^2~~}}  \vphantom{(ix)^2}
}{2!}$ 
&$\only<-4>{+}\only<5->{\alert<5>{-i}} \frac{ 
\only<3>{z^3}\only<4>{\alert<4>{(ix)^3}}\only<5->{\alert<5>{~x^3~}}  \vphantom{(ix)^3}
}{3!}$ 
& $+ \frac{ 
\only<3>{z^4}\only<4>{\alert<4>{(ix)^4}}\only<5->{\alert<5>{~~~x^4~~~}}  \vphantom{(ix)^4}
}{4!}$ 
&$+ \uncover<5->{\alert<5>{i}}\frac{ 
\only<3>{z^5}\only<4>{\alert<4>{(ix)^5}}\only<5->{\alert<5>{~~x^5~~}}  \vphantom{(ix)^4}
}{5!}$ 
& $\only<-4>{+}\only<5->{\alert<5>{-}}\dots$ 
\end{tabular}
\\~ \\~\\
\alert<3>{Rearrange.} \uncover<4->{\alert<4>{Plug-in ${z=ix}$}.} \uncover<5->{\alert<5>{Use ${i^2=-1}$.}} \uncover<6->{\alert<6>{Multiply $\sin x$ by $i$}.} \uncover<7->{\alert<7>{Add to get $e^{ix}=\cos x+i\sin x$}.}
}
\end{proof}
\end{frame}



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-polar-form.tex
\begin{frame}
\begin{columns}
\column{0.4\textwidth}
\uncover<4->{
\begin{pspicture}(-2,-2)(2,2)
\tiny
\fcAxesStandard{-1.3}{-1.3}{2}{2}
\fcLabels[\Re][\Im]{2}{2}
\uncover<7->{%
\psparametricplot{0}{360}{t cos t sin}%
}%
\rput[br](-0.03,1.03){$i$}
\rput[tl](1.1,-0.1){$1$}
\fcFullDot{0}{1}
\fcFullDot{1}{0}
\uncover<8->{\fcAngle{0}{1.047197551}{0.1}{$\theta$}}%
\uncover<6->{%
\psline(0,0)(! 0.5 3 sqrt 2 div)%
\psline[linestyle=dotted](0,0)(! 1 3 sqrt)%
}%
\rput(1.1,1.81){$~~z$}
\fcFullDot{1}{3 sqrt}
\uncover<5->{%
\fcFullDot{0.5}{3 sqrt 2 div}%
\rput[bl](0.6,1){$\frac{z}{|z|} \uncover<10->{=\alert<10>{\cos \theta} + i\alert<11>{\sin \theta}}$}%
}%
\uncover<handout:0|5>{%
\psline[linewidth=2pt, arrows=->, linecolor=red](0,0)(! 1 3 sqrt )%
}%
\uncover<9->{\fcPerpendicular{[0.5 3 sqrt 2 div]}{[0 0 ] [1 0]}{0.1}}%
\uncover<handout:0|10>{\psline[linecolor=red, linewidth=2pt](0,0)(0.5, 0)}%
\uncover<handout:0|11>{\psline[linecolor=red, linewidth=2pt](! 0.5 3 sqrt 2 div)(0.5, 0)}%
\end{pspicture}
}%
\column{0.6\textwidth}
\uncover<12->{
\begin{theorem}[Euler's formula]
\alert<12,15>{$e^{i\theta}=\cos \theta+i\sin \theta$}.
\end{theorem}
} 
\begin{lemma}
$\alert<handout:0|1>{\left|\frac{z}{|z|}\right| } \uncover<2->{\alert<2>{=\frac{|z|}{|z|}}} \uncover<3->{ \alert<3>{ =1 }.}$
\end{lemma}
\end{columns}
\begin{itemize}
\item<4-> Let $z=x+iy$ be a non-zero complex number.
\item<5-> Then $0$, $z$, $\frac{z}{|z|}$ lie on a ray \uncover<7->{and $\frac{z}{|z|}$ lies on the unit circle.}
\item<8-> Let $\theta$ - angle between the real axis and the ray between $0$ and $z$.
\item<9-> Then $\alert<14>{\frac{z}{|z|}= \alert<12>{ \alert<10>{ \cos \theta} +i \alert<11>{\sin \theta}}} \uncover<12->{ \alert<12>{= e^{i\theta}}} $.
\uncover<13->{
\begin{definition}[Polar form of complex numbers]
Let $z\neq 0$. $\alert<14>{z=|z|(\alert<15>{\cos\theta+i\sin \theta)}}= |z| \alert<15>{ e^{i\theta}} $ is called polar form of $z $.
\end{definition}
}
\item<16-> Let $\alert<19>{\rho = \ln \alert<17>{|z|} } \uncover<17->{ = \ln \alert<17>{\sqrt{ x^2+y^2} }}  \uncover<18->{ = \frac{1}{2}\ln(x^2+y^2)}$.
\item<19-> Then $z=\alert<19>{|z|} ( \cos\theta+ i\sin\theta) = \alert<19>{ e^{\rho}}( \cos \theta +i\sin \theta) \uncover<20->{ =e^{\rho} e^{i\theta } }\uncover<21->{=e^{\rho + i \theta}.} $
\end{itemize}
\end{frame}

\begin{frame}
\begin{columns}
\column{0.3\textwidth}
\begin{pspicture}(-2,-2)(2,2)
\tiny
\fcAxesStandard{-1.3}{-1.3}{2}{2}
\fcLabels[\Re][\Im]{2}{2}
\psparametricplot{0}{360}{t cos t sin}%
\rput[br](-0.03,1.03){$i$}
\rput[tl](1.1,-0.1){$1$}
\fcFullDot{0}{1}
\fcFullDot{1}{0}
\fcAngle{0}{1.047197551}{0.1}{$\theta$}
\psline(0,0)(! 0.5 3 sqrt 2 div)%
\psline[linestyle=dotted](0,0)(! 1 3 sqrt)%
\rput[l](1.1,1.81){$z\uncover<2->{\alert<2>{= |z| e^{ i \theta}}}$}
\fcFullDot{1}{3 sqrt}
\fcFullDot{0.5}{3 sqrt 2 div}%
\rput[lb](0.47,1){$\frac{z}{|z|}=e^{i\theta} $}%
\fcPerpendicular{[0.5 3 sqrt 2 div]}{[0 0 ] [1 0]}{0.1}%
\end{pspicture}
\column{0.7\textwidth}
\begin{definition}[Polar form of complex numbers]
Let $z\neq 0$. Then $z=|z|(\cos \alert<2>{ \theta} +i\sin \alert<2>{\theta} )$ is called polar form of $z $.
\end{definition}
\begin{itemize}
\item<2-> \alert<2>{$\theta$} is called an argument of $z$. We write \[\theta=\arg z.\]
\end{itemize}
\end{columns}

\begin{itemize}
\item<3-> If $\theta$ is an argument of $z$, so is $\theta + 2k\pi$ for all integers $k$.
\item<4-> If $\theta\in (-\pi, \pi]$, we say that $\theta$ is the principal argument of $z$.
\item<5-> If we write $\theta=\arg z$ without clarifying the choice of the argument, it is implied that $\theta$ is the principal argument of $z$, $\theta\in (-\pi,\pi]$.
\item<6-> One should never write $\theta=\arg z$ without clarifying the choice of argument.
%\item<7-> Euler's formula implies: $\alert<8>{z= ( \cos \theta +i\sin \theta)= e^{\rho} e^{i\theta}}$.
\end{itemize}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-polar-form-example-1.tex
\begin{frame}
\begin{example}
\begin{columns}
\column{0.35\textwidth}
\begin{pspicture}(-2.1,-2.1)(2.1,2.1)
\tiny
\fcBoundingBox{-2.2}{-2.2}{2.2}{2.2}
\fcAxesStandard{-2}{-2}{2}{2}
\fcLabels[$\Re$][$\Im$]{2}{2}
\end{pspicture}
\column{0.65\textwidth}
Plot the number $z$. Write $z$ in polar form, using the principal value of the argument of $z$ (polar angle). 

Recall that $\theta$ is the principal argument $\Rightarrow$ $\theta\in (-\pi,\pi]$.

\begin{tabular}{c|c|c|c}
$z$ & $|z|$ & $\theta$ & $|z|(\cos\theta +i\sin \theta)$\\\hline
$1$ & 1 & $0 $ & $\cos 0+i\sin 0$\\
$i$ & 1 & $\frac{\pi}{2} $& $\cos\left(\frac{\pi}{2}\right)+i\sin\left(\frac{\pi}{2}\right)$   \\
$-1$ & $1$&$\pi$&$\cos \pi +i\sin\pi$ \\
$-i$ & $1$&$-\frac{\pi}{2}$& $\cos\left(-\frac{\pi}{2}\right)+ i \sin \left(- \frac{\pi}{2}\right)$  \\
\end{tabular} 
\end{columns}

\end{example}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-polar-form-example-2.tex




\begin{frame}
\begin{example}
\begin{columns}
\column{0.35\textwidth}
\begin{pspicture}(-2.1,-2.1)(2.1,2.1)
\tiny
\fcBoundingBox{-2.2}{-2.2}{2.2}{2.2}
\fcAxesStandard{-2}{-2}{2}{2}
\fcLabels[$\Re$][$\Im$]{2}{2}
\end{pspicture}
\column{0.65\textwidth}
Plot the number $z$. Write $z$ in polar form, using the principal value of the argument of $z$ (polar angle). 

Recall that $\theta$ is the principal argument $\Rightarrow$ $\theta\in (-\pi,\pi]$.
\end{columns}
\begin{tabular}{c|c|c|c}
$z$ & $|z|$ & $\theta$ & $|z|(\cos\theta +i\sin \theta)$\\\hline
$\frac{1}{2}+\frac{\sqrt{3}}{2}i$&$1$& $\frac{\pi}{3}$& $\cos \left( \frac{ \pi}{3}\right)+ i \sin \left( \frac{\pi }{3} \right) $\\
$1+i$&$2$&$\frac{\pi}{4}$& $2\left( \cos\left(\frac{\pi}{4} \right)+ i \sin \left( \frac{\pi}{4}\right)\right) $\\
$1-i$&$2$&$-\frac{\pi}{4}$& $2\left( \cos\left(-\frac{\pi}{4} \right)+ i \sin \left( -\frac{\pi}{4}\right)\right) $\\
$-\sqrt{3}-i $&$2$& $-\frac{2\pi}{3}$&$ 2\left( \cos \left( \frac{ 2\pi}{3} \right)+ i \sin \left( \frac{2\pi }{3} \right) \right) $\\
$\frac{3}{5}+\frac{4}{5}i$&$5$&$\Arctan\left(\frac{4}{3}\right)$& $5\left(\cos \left(\Arctan\left(\frac{4}{3}\right)\right)+i \sin \left(\Arctan\left(\frac{4}{3}\right)\right) \right) $ \\
\end{tabular}
\end{example}
\end{frame}




%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-exponent-definition1-multiplication-angles-add.tex
\begin{frame}
\begin{columns}[t]
\column{0.5\textwidth}
\begin{definition}[Real exponent]
Let $\rho\in \mathbb R$. The real exponent $e^\rho$ is defined as $\displaystyle \lim\limits_{\substack{p\to \rho \\ p\text{ is rational}}} e^p$.
\end{definition}
\column{0.5\textwidth}
\uncover<2->{
\begin{definition}[Extension to $\mathbb{C}$]
Let $\rho,\theta\in \mathbb R$. Define the complex exponent $e^{\rho+i\theta} $ via ${\alert<3>{e}}^{\rho+\alert<3>{i\theta} } = e^{\rho} ( \alert<3>{\cos \theta + i\sin \theta})$
\end{definition}
}
\end{columns}
\begin{itemize}
\item For the duration of this slide, assume Definition I of real exponent.
\item<2-> Extend this def. to complex numbers \uncover<3->{(motivation: \alert<3,6,7,14>{Euler's f-la}).} 
\uncover<4->{
\begin{theorem}
(a) Let $\alpha, \beta\in \mathbb R $. Then $e^{i\alpha} e^{ i \beta} = e^{ i\alpha+i\beta}= e^{i(\alpha+\beta) }$.

(b) Let $z,w\in \mathbb C$. Then $e^{z }e^{w}=e^{z+w}$.
\end{theorem}
}
\uncover<4->{
\begin{proof}[Proof of (a)]
$\uncover<5->{\alert<6>{e^{i\alpha}} \alert<7>{e^{i\beta}} = (\alert<6>{\alert<8,10>{ \cos \alpha} +\alert<9,11>{i \sin \alpha}})(\alert<7>{ \alert<8,11>{\cos \beta} + \alert<9,10>{ i\sin \beta}} )} \uncover<8->{ = ( \alert<12,15>{ \alert<8>{ \cos \alpha\cos \beta} \alert<9>{ - \sin\alpha \sin \beta} } ) + \alert<10,11>{i} ( \alert<13,15>{ \alert<10>{\cos \alpha \sin \beta }+ \alert<11>{ \sin \alpha \cos \beta}}) } \uncover<12->{ =\alert<14>{ \alert<12,15>{\cos (\alpha +\beta) }+ i \alert<13,15>{ \sin (\alpha+\beta) } }} \uncover<14->{ \alert<14>{ = e^{i(\alpha+ \beta)} }}
$.
\end{proof}
}
\item<15-> The trig. f-las used above need separate (relatively long) proof.
\end{itemize}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-exponent-definition2-multiplication-angles-add.tex
\begin{frame}[t]
\vskip -0.5cm
\begin{columns}[t]
\column{0.5\textwidth}
\begin{definition}[Exponent, Def. II]
$e^{z}=e(z)=\sum\limits_{n=0}^{\infty}\frac{z^n}{n!}$.
\end{definition}
\column{0.5\textwidth}
\uncover<2->{
\begin{definition}[Polar form]
$|z|=e^{\rho}$, $z=e^{\rho}(\cos \theta+i\sin \theta)$  \vphantom{$\sum\limits_{n=0}^{\infty}\frac{z^n}{n!}$}
\end{definition}
}
\end{columns}
\begin{itemize}
\item<1-> For the duration of this slide, assume Definition II of exponent.
\item<3-> In preceding slides/lectures, by algebraic manipulations of series, we showed that $e(z) e(w)= e^{z} e^{w} = e^{z+w}=e(z+w)$.
\uncover<4->{
\begin{theorem}
$\sin (\alpha+\beta)=\sin \alpha\cos \beta+i\sin \beta \cos \alpha$ 

$\cos (\alpha+\beta)=\cos\alpha\cos \beta-\sin \alpha\sin \beta$, \quad \quad where $\alpha,\beta\in \mathbb R$
\end{theorem}

\begin{proof}
\small
$\begin{array}{r@{~}c@{~}l}
\uncover<5->{ \alert<10>{\cos (\alpha+\beta)} +i \alert<11>{ \sin (\alpha+\beta)} &=& e^{i(\alpha+ \beta)}} \uncover<6->{ = e^{i\alpha+ i\beta}} \uncover<7->{ =e^{ i \alpha }e^{i\beta}}\\
\uncover<8->{&=&(\cos \alpha +i \sin \alpha)(\cos \beta +i\sin \beta)} \\
\uncover<9->{&=& \alert<10>{(\cos \alpha\cos \beta- \sin\alpha \sin \beta )} \\
&&+ i\alert<11>{( \cos \alpha\sin \beta +\sin\alpha\cos \beta)}.}
\end{array}$

\uncover<10->{Compare \alert<10>{real} and \alert<11>{imaginary} part to get the desired trig identities.}
\end{proof}
}
\end{itemize}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-multiplication-arguments-add.tex
\begin{frame}
\frametitle{Geometric interpretation of complex multiplication}
\begin{columns}
\column{0.35\textwidth}

\begin{pspicture}(-0.5, -0.5)(3,3)
\tiny
\fcAxesStandard{-0.5}{-0.5}{2.5}{2.5}
\fcLabels[$\Re$][$\Im$]{2.5}{2.5}
\pstVerb{10 dict begin /erho 2 def /esigma 1.4 def /alpha 10 def /beta 50 def }%
\uncover<handout:0|14->{%
\parametricplot[linecolor=gray, linewidth=0.5pt]{-10}{120}{t cos t sin}%
\rput[t](1,-0.1){$~~1$}%
}%
\only<handout:0|15>{\pstVerb{/esigma 1.2 def}}%
\only<handout:0|16>{\pstVerb{/esigma 1 def}}%
\only<handout:0|17>{\pstVerb{/esigma 0.8 def}}%
\only<handout:0|19>{\pstVerb{/beta 40 def}}%
\only<handout:0|20>{\pstVerb{/beta 30 def}}%
\only<handout:0|21>{\pstVerb{/beta 20 def}}%
\uncover<handout:0|14->{\parametricplot[linecolor=gray, linewidth=0.5pt, linestyle=dashed]{5}{85}{t cos erho mul t sin erho mul} }%
\pstVerb{
/zx erho alpha cos mul def 
/zy erho alpha sin mul def 
/wx esigma beta cos mul def 
/wy esigma beta sin mul def 
/zwx erho esigma mul alpha beta add cos mul def 
/zwy erho esigma mul alpha beta add sin mul def 
}%
\fcFullDot{wx}{wy}
\fcFullDot{zx}{zy}
\psline(0,0)(! zx zy)
\psline(0,0)(! wx wy)
\uncover<handout:0|3,12>{\psline[linecolor=red, linewidth=2pt](0,0)(! zx zy)}
\uncover<handout:0|4,12>{\psline[linecolor=red, linewidth=2pt](0,0)(! wx wy)}
\rput[tl](! zx zy){$~z$}
\rput[tl](! wx wy){$~w$}
\uncover<6->{\fcAngleDegrees{0}{alpha}{0.7}{$\alert<handout:0|6,10,11>{\alpha} $}}
\uncover<7->{\fcAngleDegrees{0}{beta}{0.3}{$\alert<handout:0|7,10,11>{\beta}$}}
\uncover<handout:0|6,10,11>{\fcAngleDegrees[linewidth=2pt, linecolor=red ] {0}{alpha}{0.7}{}}
\uncover<handout:0|7,10,11>{\fcAngleDegrees[linewidth=2pt, linecolor=red ] {0}{beta}{0.3}{}}
\uncover<9->{
\fcFullDot{zwx}{zwy}
\rput[tl](! zwx zwy){$~~ zw$}
\psline(0,0)(!zwx zwy)
}
\uncover<handout:0|12>{\psline[linewidth=2pt, linecolor=red ](0,0)(!zwx zwy)}
\uncover<10->{%
\fcAngleDegrees{0}{alpha beta add}{0.8}{$~~~\alpha+\beta$}%
}%
\uncover<handout:0|10,11>{%
\fcAngleDegrees[linewidth=2pt, linecolor=red ]{0}{alpha beta add}{0.8}{$~~~\alert<10,11>{\alpha+\beta}$}%
}%
\pstVerb{end}
\end{pspicture}

\column{0.65\textwidth}
\begin{itemize}
\item Let $z,w\neq 0 $ \uncover<2->{and let 

\hfil $\alert<12>{ \alert<3>{ |z| =e^\rho},\quad \alert<4>{ |w|=e^\sigma}}.$
}
\item<5-> Let $\alpha,\beta$ be arguments of $z,w$. 
$
\begin{array}{rcl}
z&=& e^{\rho}(\cos \alert<handout:0|6>{\alpha} + i \sin \alert<handout:0|6>{\alpha} )=e^{\rho +i\alpha} \\
w&=& e^{\sigma}(\cos \alert<handout:0|7>{\beta} +i\sin \alert<handout:0|7>{\beta} )=e^{\sigma +i\beta} .\end{array} 
$
\end{itemize}
\end{columns}
\uncover<8->{%
\begin{theorem}[Summary]
$\begin{array}{rcl}
\alert<9>{z w} &=& \alert<12>{|z|}( \cos\alpha+ i\sin\alpha) \alert<12>{ |w|} ( \cos \beta +i\sin \beta )\\
&=&e^\rho ( \cos\alpha+ i\sin\alpha) e^\sigma ( \cos \beta +i\sin \beta )= e^{ \rho + i \alpha} e^{\sigma+i\beta} \\
&=&e^{\rho+\sigma +i(\alpha+\beta)} = \alert<12>{|z||w|} ( \cos (\alert<10>{\alpha+\beta})+i\sin (\alert<10>{\alpha+\beta}) ) .\end{array}$
\end{theorem}
}%
\begin{itemize}
\item<10-> An argument (polar angle) of $zw$ is $\alert<10>{\alpha+\beta} $.
\item<11-> $\Rightarrow$ Multiplying complex numbers adds arguments (polar angles).
\item<12-> Multiplying complex numbers multiplies absolute values.
\item<13-> \alert<13-17>{What happens to $zw$ when we change $|w|$?} \uncover<18->{ \alert<18-21>{When we change $\beta$?} }
\end{itemize}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-de-Moivre-formula.tex
\begin{frame}
\begin{theorem}[de Moivre's formula]
$\left(\cos \alpha+i\sin \alpha \right)^n=\cos (n\alpha)+i\sin (n\alpha)$.
\end{theorem}
\begin{proof}
$\uncover<2->{\left(\cos \alpha+i\sin \alpha\right)^n =\left( e^{i\alpha} \right)^n}\uncover<3->{=e^{in\alpha}} \uncover<4->{= \cos (n\alpha)+i\sin (n\alpha).}$
\end{proof}
The formula is named after the French mathematician A. de Moivre (1667-1754).
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-numbers-de-Moivre-formula-example.tex
\begin{frame}
Polar form $z =\alert<2,3>{|z|}(\cos \alert<4,5>{\theta} +i\sin \alert<4,5>{\theta} )$.
\begin{example}
Compute $\left(\sqrt{3}+i\right)^{2014}$ and its polar form. 
~\\~\\


\uncover<2->{Write $ \sqrt{3}+i$ in polar form: $\alert<2-5,7>{\sqrt{3}+i=} \fcAnswer{3}{2} \left( \cos \left( \uncover<5->{ \alert<5>{\frac{\pi}{6}}} \uncover<2-4>{ \alert<4>{ \textbf{?}}}\right)  +i\sin \left( \uncover<5->{ \alert<5>{\frac{\pi}{6}} } \uncover<2-4>{ \alert<4>{ \textbf{?}}}\right) \right) \uncover<6->{ =\alert<7>{2e^{i\frac{\pi}{6}}}}$. }

\[
\begin{array}{rcl}
\uncover<7->{\left(\alert<7>{\sqrt{3}+i}\right)^{2014}&=& \left(\alert<7>{2 e^{i\frac{\pi}{ 6}}} \right)^{2014}} \\
\uncover<8->{&=& 2^{2014} e^{i \alert<9>{2014} \cdot \frac{ \pi}{\alert<9>{6}} }}\\
\uncover<9->{&=& 2^{2014}( e^{i \left( \alert<9>{335+ \frac{2}{3}} \right)\pi})}\\
\uncover<10->{& =& 2^{2014}\alert<11>{e^{i335\pi}} \alert<12>{e^{i\frac{2}{3} \pi }}} \\
\uncover<11->{&=& 2^{2014} \alert<11>{(-1)} \left( \alert<12>{ \alert<13,14>{ \cos \left(\frac{2\pi}{3} \right)} +i\alert<15,16>{\sin \left( \frac{2\pi}{ 3} \right) }} \right)} \\
\uncover<13->{ &=& -2^{2014} \left(\fcAnswer{14}{- \frac{1 }{ 2}} + i \uncover<13-15>{ \alert<15>{\textbf{?}}} \uncover<16->{\alert<16>{\frac{\sqrt{3}}{2}}} \right)} \\
\uncover<17->{&=& 2^{2013}\left(1-\sqrt{3}i\right).}
\end{array}
\]

\end{example}

\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-roots-example-1.tex
\begin{frame}
\begin{example}
\begin{columns}
\column{0.3\textwidth}
\begin{pspicture}(-1.5,-1.5)(1.5,1.5)
\tiny
\fcAxesStandard{-1.5}{-1.5}{1.5}{1.5}
\fcLabels[$\Re$][$\Im$]{1.5}{1.5}
\uncover<10->{ 
\fcFullDot{ 0}{1}
\rput[l](0,1){~~$i$}
\fcFullDot{ 1}{0}
\rput[t](1,-0.1){$1$}
\fcFullDot{-1}{0}
\rput[b](-1,0.1){$-1$}
\fcFullDot{ 0}{-1}
\rput[r](0,-1){$-i~~$}
}
\end{pspicture}
\column{0.7\textwidth}
Find all complex solutions of the equation $z^4=1$.

\medskip

\uncover<2->{Let $ z=|z|(\cos \theta+i\sin \theta) $ be the polar form of $z$ with $\theta\in(-\pi, \pi]$.} \uncover<3->{Since $|z|^4=|z^4|=1$ it follows that $|z|=1$} \uncover<4->{and so $z=\cos \theta+i\sin \theta $. }
\end{columns}
\uncover<5->{By de Moivre's equality $ z^4=\cos (4\theta ) + i \sin (4\theta)=1$.} \uncover<6->{This implies $\sin (4\theta)=0$, $\cos (4\theta)=1$} \uncover<7->{and so $4\theta=2k\pi$, $k$-integer.} \uncover<8->{Therefore $\theta = k\frac{\pi}{2}$.} \uncover<9->{Among those values, $\theta=-\frac{\pi}{2}, 0,\frac{\pi}{2}, \pi$ belong to $(-\pi,\pi]$. } \uncover<10->{We may discard the other values of $\theta$ as do not give rise to new points.} \uncover<11->{Therefore the equation $z^4=1$ has 4 roots given by
$\begin{array}{rcl}
z&=&\cos \left( -\frac{\pi}{2}\right)+i\sin \left(-\frac{\pi } {2} \right)=-i\\
z&=&\cos 0+i\sin 0=1\\
z&=&\cos \left( \frac{\pi}{2}\right)+i\sin \left(\frac{\pi } {2} \right)=i\\
z&=&\cos \pi+i\sin \pi =-1\quad .
\end{array}
$}
\end{example}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/complex-numbers/complex-roots-example-2.tex
\begin{frame}
\begin{example}
\begin{columns}
\column{0.3\textwidth}
\begin{pspicture}(-1.5,-1.5)(1.5,1.5)
\tiny
\fcAxesStandard{-1.5}{-1.5}{1.5}{1.5}
\fcLabels[$\Re$][$\Im$]{1.5}{1.5}
\uncover<3->{ 
\fcFullDot{ 3 sqrt 2 div }{0.5}
\rput[b](! 3 sqrt 2 div 0.5){$\frac{\sqrt{3} }{2} +\frac{1}{2}i$}
\fcFullDot{ 3 sqrt -2 div }{0.5}
\rput[b](! 3 sqrt -2 div 0.5){$-\frac{\sqrt{3} }{2} +\frac{1}{2}i$}
\fcFullDot{0}{-1}
\rput[tl](0, -1){$~-i$}
}
\end{pspicture}
\column{0.7\textwidth}
Find all complex numbers $z$ such that $\alert<3>{z^3=i}$.

\uncover<2->{Let $z= |z|(\cos \theta +i\sin \theta)$ be the polar form of $z$ for which $\theta \in (-\pi, \pi]$.} \uncover<3->{We have that $ 1=|\alert<3>{i}| =|\alert<3>{z^3}|= |z|^3 $. }\uncover<4->{Since $|z|$ is a positive real number, $|z|^3=1$ implies $|z|=1$. } 


\end{columns}
\[
\begin{array}{rcll|l}
i&= &\left(\cos (\theta)+i\sin (\theta)\right)^3 &&\text{de Moivre}\\
\cos \left(\frac{\pi}{2}\right) + i \sin \left(\frac{\pi}{2}\right) &=& \cos(3\theta)+i\sin (3 \theta )&&\text{Polar form } i\\
3\theta &=& \frac{\pi }{2} +2k\pi&&k \text{ any integer}\\
\theta &=&\frac{\pi}{6}+\frac{2k}{3}\pi &&k \text{ any integer}
\end{array}
\]
Values of $\theta $ that differ by even multiple of $\pi$ produce the same value for $z$ $\Rightarrow$ restrict our attention to $\theta\in\left(-\pi,\pi\right]$, i.e. $k=0,1,-1$  $\Rightarrow$ $\theta = \frac{\pi}{6}, \frac{5\pi}{6}, -\frac{\pi}{2}$. Our final answer is \textbf{to be continued.}
%$\begin{array}{rcl}
%z&=&\cos\left(\frac{\pi}{6}\right)=\\
%z&=&\cos\left(\frac{\pi}{6}\right)=\\
%z&=&\cos\left(\frac{\pi}{6}\right)=
%\end{array}
%$


\end{example}
\end{frame}


} %end lecture

% begin lecture
\lect{Spring 2015}{Lecture 15}{15}{
\section{Curves}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/parametric-intro.tex
% begin module parametric-intro
\begin{frame}
\frametitle{Curves Defined by Parametric Equations}
\begin{columns}[c]
\column{.4\textwidth}

\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-2.2, -0.5)(2.2,3.7)
\tiny
\fcAxesStandard{-2}{-0.5}{2}{3.5}
%Calculator input: plotCurve{}(\cos{}(t^{2}), t \sin{}t+\sin{}t, 0, 3)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=500] {0}{0.75}{t 2 exp 57.29578 mul cos t 57.29578 mul sin t 57.29578 mul sin t mul add }
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=500] {0.75}{1.5}{t 2 exp 57.29578 mul cos t 57.29578 mul sin t 57.29578 mul sin t mul add }
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=500] {1.5}{2.25}{t 2 exp 57.29578 mul cos t 57.29578 mul sin t 57.29578 mul sin t mul add }
\parametricplot[linecolor=\fcColorGraph, plotpoints=500] {2.25}{3}{t 2 exp 57.29578 mul cos t 57.29578 mul sin t 57.29578 mul sin t mul add }

\uncover<1>{\fcFullDot{0.987227}{ 0.545186} }
\uncover<2>{\fcFullDot{0.689498}{ 1.488321} }
\uncover<3>{\fcFullDot{-0.379452}{ 2.365079}}
\uncover<4>{\fcFullDot{-0.892288}{ 2.744270}}
\uncover<5->{\fcFullDot{0.866232}{ 2.296575} }
\uncover<6->{
\rput[l](0.89,2.396575){$\begin{array}{l}(x,y)\uncover<7->{= (f(t), g(t))} \\\phantom{(x,y)}\uncover<8->{=(x(t), y(t))}\end{array}$}
}
\end{pspicture}
%\ \only<handout:0| -1>{%
%\includegraphics[height=7cm]{parametric-curves/pictures/11-01-parametrica.pdf}%
%}%
%\only<handout:0| 2>{%
%\includegraphics[height=7cm]{parametric-curves/pictures/11-01-parametricb.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[height=7cm]{parametric-curves/pictures/11-01-parametricc.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[height=7cm]{parametric-curves/pictures/11-01-parametricd.pdf}%
%}%
%\only<handout:0| 5-7>{%
%\includegraphics[height=7cm]{parametric-curves/pictures/11-01-parametrice.pdf}%
%}%
%\only<8->{%
%\includegraphics[height=4cm]{parametric-curves/pictures/11-01-parametricf.pdf}%
%}%
\column{.6\textwidth}
\begin{itemize}
\item  Suppose a particle moves along the curve in the picture.
\item<6->  The $x$-coordinate and $y$-coordinate of the particle are some functions of the time $t$.
\item<7->  We can write $x = f(t)$ and $y = g(t)$.
\item<8->  Less formally, we may directly write $(x,y)=(x(t), y(t))$.
\item<9->  We say that the equations $\left| \begin{array}{rcl}x &=& f(t)\\y&=&g(t)\end{array}\right.$ are parametric equations of a parametric curve.
\item<9->  Note that the curve can't be written as $y = f(x)$: it fails the vertical line test.
\end{itemize}
\end{columns}
\end{frame}
% end module parametric-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/parametric-curve-definition.tex
%begin module parametric-curve-definition
\begin{frame}
%Let $[a,b]$ be an interval, and let $f_1, \dots, f_n$ be functions on the interval $[a,b]$. 
\begin{definition}[Curve in $n$-dimensional space]
We define an arbitrary $n$-tuple of functions $f_1,\dots, f_n$ on $[a,b]$ to be a \emph{parametric curve} (or simply \emph{curve}). If $C$ is a curve, we write $C$ as:
\[
C:\left| 
\begin{array}{rcl}
x_1&=&f_1(t)\\
x_2&=&f_2(t)\\
&\vdots & \\
x_n&=&f_n(t)
\end{array} \right., t\in [a,b]\quad 
\]
where $x_1,\dots, x_n$ are the labels of the $n$-dimensional coordinate system.
\end{definition}
Curves in 2- and 3-dimensional space will be of special interest:
\begin{columns}
\column{0.5\textwidth}
A curve in dimension 2 is given by:
\[
C:\left| 
\begin{array}{rcl}
x&=&f(t)\\
y&=&g(t)\\
\end{array} \right., t\in [a,b]\quad .
\]

\column{0.5\textwidth}
A curve in dimension 3 is given by:
\[
C:\left| 
\begin{array}{rcl}
x&=&f(t)\\
y&=&g(t)\\
z&=&h(t)\\
\end{array} \right., t\in [a,b]\quad .
\]

\end{columns}

\end{frame}
%end module parametric-curve-definition


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/curve-image-definition-intro.tex
%begin module curve-image-definition-intro
\begin{frame}
Consider the two parametric curves:
\begin{columns}
\column{0.5\textwidth}
\[
\gamma_1:
\left|
\begin{array}{rcl}
x&=&t^2\\
y&=&t^2\\
\end{array} \right., t\in [0,1]\quad
\]
\begin{center}
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.5, -0.5)(1.4,1.4)
\psframe*[linecolor=white](-0.5, -0.5)(1.400000,1.4)
\tiny
\fcAxesStandard{-0.200000}{-0.2}{1.2}{1.2}
\uncover<8->{
\psline[linecolor=\fcColorGraph](0,0)(1,1)
}
\uncover<2->{
\fcFullDot{0}{0}
}
\uncover<3->{
\fcFullDot{0.04}{0.04}
}
\uncover<4->{
\fcFullDot{0.16}{0.16}
}
\uncover<5->{
\fcFullDot{0.36}{0.36}
}
\uncover<6->{
\fcFullDot{0.64}{0.64}
}
\uncover<7->{
\fcFullDot{1}{1}
}
\end{pspicture}
\end{center}

\column{0.5\textwidth}
\[
\gamma_2:
\left|
\begin{array}{rcl}
x&=&t\\
y&=&t\\
\end{array} \right., t\in [0,1]\quad
\]
\begin{center}
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.5000000, -0.5)(1.400000,1.4)
\psframe*[linecolor=white](-0.5000000, -0.5)(1.400000,1.4)
\tiny
\fcAxesStandard{-0.200000}{-0.2}{1.2}{1.2}
\uncover<8->{
\psline[linecolor=\fcColorGraph ](0,0)(1,1)
}
\uncover<2->{
\fcFullDot{0}{0}
}
\uncover<3->{
\fcFullDot{0.2}{0.2}
}
\uncover<4->{
\fcFullDot{0.4}{0.4}
}
\uncover<5->{
\fcFullDot{0.6}{0.6}
}
\uncover<6->{
\fcFullDot{0.8}{0.8}
}
\uncover<7->{
\fcFullDot{1}{1}
}
\end{pspicture}
\end{center}
\end{columns}
\uncover<2->{Plug in} \uncover<2->{\alert<2>{$ t=0 $}}\uncover<3->{, \alert<3>{$t=0.2$}}\uncover<4->{, \alert<4>{$t = 0.4 $}}\uncover<5->{, \alert<5>{$t = 0.6$}}\uncover<6->{, \alert<6>{$t=0.8$}}\uncover<7->{, \alert<7>{$t = 1$}.}
\uncover<9->{
\begin{question}
Are the above curves different?
\end{question}
}
\uncover<10->{
To answer this question we need a definition.
}
\end{frame}
%end module curve-image-definition-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/curve-image-definition.tex

\begin{frame}
Recall a parametric curve $C$  was defined as the data
\[
C:
\left| 
\begin{array}{rcl}
x_1&=&f_1(t)\\
x_2&=&f_2(t)\\
&\vdots & \\
x_n&=&f_n(t)
\end{array} \right., t\in [a,b]\quad 
\]
\begin{definition}
A \emph{curve image} (or simply a curve) is any set of points that arises by traversing some \alert<2>{continuous} curve. In other words, a curve image is any set that can be written in the form
\[
\left\{(f_1(t),\dots, f_n(t))~|~ t\in [a,b]\right\}\quad ,
\]
for some \alert<2>{continuous} functions $f_1, \dots, f_n$.
\end{definition}
\only<2>{If we don't require that the functions be continuous, every set of points will be a curve and the definition would be pointless.}

\uncover<3->{Informally, a curve image ``remembers'' only the points lying on the curve but forgets the ``speed'' with which each point was visited and ``how many times'' each point was visited.
}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/parametric-curve-vs-curve-image-terminology.tex
%begin module parametric-curve-vs-curve-image-terminology
\begin{frame}[t]
\begin{columns}
\column{0.5\textwidth}
\begin{center}
\psset{xunit=1.3cm, yunit=1.3cm}
\begin{pspicture}(-0.2, -0.2)(1.2,1.2)
\tiny
\fcAxesStandard{-0.2}{-0.2}{1.2}{1.2}
\psline[linecolor=\fcColorGraph](0,0)(1,1)
\rput[l](0.4,0.3){$C_1:
\left|
\begin{array}{rcl}
x&=&t^2\\
y&=&t^2\\
\end{array} \right., t\in [0,1]
$}
\end{pspicture}
\end{center}

\column{0.5\textwidth}
\begin{center}
\psset{xunit=1.2cm, yunit=1.2cm}
\begin{pspicture}(-0.4, -0.4)(1.4,1.4)
\tiny
\fcAxesStandard{-0.200000}{-0.2}{1.2}{1.2}
\psline[linecolor=\fcColorGraph ](0,0)(1,1)
\rput[l](0.4,0.3){$C_2:
\left|
\begin{array}{rcl}
x&=&t\\
y&=&t\\
\end{array} \right., t\in [0,1]$
}
\end{pspicture}
\end{center}
\end{columns}
\begin{question}
$\begin{array}{l|l}
\only<1-3>{\text{ Are the above curves different?}}
\only<4->{\alert<4>{\xcancel{\text{ Are the above curves different?}}}} &\begin{array}{l} \uncover<2->{\alert<2>{\text{Are the above parametric curves} }
\\
\alert<2>{\text{different? Yes.}}}
\\
\uncover<3->{\alert<3>{\text{Are the above curve images}}\\
\alert<3>{\text{ different? No.}}}
\end{array}
\end{array}
$
\end{question}
\begin{itemize}
\only<1-4>{
\item<2-> As parametric curves, $C_1$ and $C_2$ are different: $C_1, C_2$ are given by different functions.
\item<3-> As curve images, $C_1,C_2$ coincide.
\item<4-> The original question is incorrectly posed: the word ``curve'' does not have a mathematical definition without the words ``parametric'' or ``image'' attached to it. 
}
\item<5-> Nonetheless we sometimes use the word ``curve'' \alert<5>{informally}, without specifying ``parametric curve'' or ``curve image''.
\item<6-> In this case, whether we mean  ``parametric curve'' or ``curve image'' should be clear from the context. \uncover<7->{\alert<7>{If not, we are using mathematical language incorrectly.}}
\end{itemize}

\vspace{5cm}

\end{frame}



%end module parametric-curve-vs-curve-image-terminology



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/graphs-of-functions-as-curves.tex
%begin module graphs-of-functions-as-curves
\begin{frame}
\frametitle{Graphs of functions as curve images}
\begin{itemize}
\item Consider a graph of a function given by 
\[
y=f(x)
\]
\item<2-> Write $\alert<3>{x=t}$. Then $y=f(x)\uncover<3->{ =f(\alert<3>{t})}$\uncover<4->{, so we get the system }
\uncover<4->{
\[
C: \left|\begin{array}{rcl}
x&=&t\\
y&=&f(t)
\end{array}\right., t\in [a,b]
\]
}
\end{itemize}
\uncover<5->{
\begin{observation}
The graph of an arbitrary function can be written as the image of a curve $C$ using the above transformation.
\end{observation}
}
\end{frame}

%end module graphs-of-functions-as-curves



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/eliminate-parameter-ex.tex
% begin module eliminate-parameter-ex
\begin{frame}
\begin{example}
Sketch and identify the curve image defined by the equations
%\abovedisplayskip=2pt
%\belowdisplayskip=2pt
$
\left|\begin{array}{rcl}
\alert<handout:0| 15>{x } & \alert<handout:0| 15>{=} & \alert<handout:0| 15>{ -{\alert<2, 4,6,8,10> {t}}^2 + 2}\\
\alert<14>{y}&\alert<14>{=}&\alert<14>{ \alert<2, 4,6,8,10> {t}-1}
\end{array}\right.
$
\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=0.8cm, yunit=0.8cm}
\begin{pspicture}(-4.5,-4.2)(3.2,2.2)
\psframe*[linecolor=white](-4.5,-4.2)(3.2,2.2)
\tiny
\psaxes[arrows=<->](0,0)(-4.3, -4)(3, 2)
\fcLabels{3}{2}
%Calculator input: plotCurve{}(- t^{2}+2, t-1, -2, 2)

\uncover<3->{
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=150]{ -2.5 }{-2.25}{2 t 2 exp -1 mul add -1 t add }
\parametricplot[linecolor=\fcColorGraph, plotpoints=150]{ -2.25 }{-2}{2 t 2 exp -1 mul add -1 t add }
}
\uncover<5->{
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=150]{ -2 }{-1.5}{2 t 2 exp -1 mul add -1 t add }
\parametricplot[linecolor=\fcColorGraph, plotpoints=150]{ -1.5 }{-1}{2 t 2 exp -1 mul add -1 t add }
}
\uncover<7->{
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=150]{ -1 }{-0.5}{2 t 2 exp -1 mul add -1 t add }
\parametricplot[linecolor=\fcColorGraph, plotpoints=150]{ -0.5 }{0}{2 t 2 exp -1 mul add -1 t add }
}
\uncover<9->{
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=150]{ 0}{0.5}{2 t 2 exp -1 mul add -1 t add }
\parametricplot[linecolor=\fcColorGraph, plotpoints=150]{ 0.5 }{1}{2 t 2 exp -1 mul add -1 t add }
}
\uncover<11->{
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=150]{ 1 }{1.5}{2 t 2 exp -1 mul add -1 t add }
\parametricplot[linecolor=\fcColorGraph, plotpoints=150]{ 1.5 }{2}{2 t 2 exp -1 mul add -1 t add }
}
\uncover<12->{
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=150]{ 2 }{2.25}{2 t 2 exp -1 mul add -1 t add }
\parametricplot[linecolor=\fcColorGraph, plotpoints=150]{ 2.25 }{2.5}{2 t 2 exp -1 mul add -1 t add }
}
\uncover<3->{
\fcFullDot{-2}{-3}
}
\uncover<5->{
\fcFullDot{1}{-2}
}
\uncover<7->{
\fcFullDot{2}{-1}
}
\uncover<9->{
\fcFullDot{1}{0}
}
\uncover<11->{
\fcFullDot{-2}{1}
}
\end{pspicture}

\vspace{1cm}
%\ \only<handout:0| -2>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex1a.pdf}%
%}%
%\only<handout:0| 3-4>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex1b.pdf}%
%}%
%\only<handout:0| 5-6>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex1c.pdf}%
%}%
%\only<handout:0| 7-8>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex1d.pdf}%
%}%
%\only<handout:0| 9-10>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex1e.pdf}%
%}%
%\only<handout:0| 11>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex1f.pdf}%
%}%
%\only<12->{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex1g.pdf}%
%}%
\column{.5\textwidth}
\hfil \hfil
$
\begin{array}{|r|r|r|}
\hline
\alert<2,4,6,8,10>{ t} & x & y\\
\hline
\alert<handout:0| 2-3>{-2} &%
\alert<handout:0| 2-3>{\uncover<3->{-2}} &%
\alert<handout:0| 2-3>{\uncover<3->{-3}} \\%
\alert<handout:0| 4-5>{-1} &%
\alert<handout:0| 4-5>{\uncover<5->{1}} &%
\alert<handout:0| 4-5>{\uncover<5->{-2}} \\%
\alert<handout:0| 6-7>{0} &%
\alert<handout:0| 6-7>{\uncover<7->{2}} &%
\alert<handout:0| 6-7>{\uncover<7->{-1}} \\%
\alert<handout:0| 8-9>{1} &%
\alert<handout:0| 8-9>{\uncover<9->{1}} &%
\alert<handout:0| 8-9>{\uncover<9->{0}} \\%
\alert<handout:0| 10-11>{2} &%
\alert<handout:0| 10-11>{\uncover<11->{-2}} &%
\alert<handout:0| 10-11>{\uncover<11->{1}} \\%
\hline
\end{array}
$
\hfil

\uncover<14->{%
\noindent Eliminate $t$: from second equation we have $\alert<handout:0| 14,16>{t = y + 1}$ \uncover<15->{%
and therefore:}  %
}%
$\begin{array}{rcl}
\uncover<15->{%
\alert<handout:0| 15,18>{x}%
}%
&\uncover<15->{\alert<handout:0| 15>{ =}}&%
\uncover<15->{%
\alert<handout:0| 15>{ -\alert<handout:0| 16>{t}^2 + 2}%
}\\%
& \uncover<16->{ = }&%
\uncover<16->{%
 -(\alert<handout:0| 16>{y+1})^2 + 2
}\\%
& \uncover<17->{\alert<handout:0| 18>{ = }}&%
\uncover<17->{%
\alert<handout:0| 18>{-y^2 - 2y + 1}
}%
\end{array}
$

\uncover<18->{Thus our curve image is a parabola, as expected.}
\end{columns}
\end{example}
\end{frame}

\begin{frame}
\begin{columns}[c]
\column{.5\textwidth}
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex1chopped.pdf}%
\psset{xunit=0.8cm, yunit=0.8cm}
\begin{pspicture}(-4.5,-4.2)(3.2,2.2)
\psframe*[linecolor=white](-4.5,-4.2)(3.2,2.2)
\tiny
\psaxes[arrows=<->](0,0)(-4.3, -4)(3, 2)
\fcLabels{3}{2}
%Calculator input: plotCurve{}(- t^{2}+2, t-1, -2, 2)

\uncover<1-3>{
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=150]{ -2.5 }{-1.25}{2 t 2 exp -1 mul add -1 t add }
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=150]{ -1.25 }{0}{2 t 2 exp -1 mul add -1 t add }
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=150]{ 0 }{1.25}{2 t 2 exp -1 mul add -1 t add }
\parametricplot[linecolor=\fcColorGraph, plotpoints=150]{ 1.25 }{2.5}{2 t 2 exp -1 mul add -1 t add }
}
\uncover<4->{
\parametricplot[linecolor=\fcColorGraph, plotpoints=150]{ -1 }{0}{2 t 2 exp -1 mul add -1 t add }
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=150]{ 0 }{1}{2 t 2 exp -1 mul add -1 t add }
\parametricplot[linecolor=\fcColorGraph, plotpoints=150]{ 1 }{2}{2 t 2 exp -1 mul add -1 t add }
}
\uncover<5->{
\fcFullDot{-2}{1}
\fcFullDot{1}{-2}
}
\end{pspicture}
\[
\left|
\begin{array}{rcl}
x & = & -t^2 + 2\\
y & = & t-1
\end{array}
\right.
\uncover<4->{, \alert<handout:0| 4>{-1 \leq t \leq 2}}
\]
\column{.5\textwidth}
\begin{itemize}
\item<1->  There was no restriction placed on $t$ in the last example.
\item<2->  In such a case we assume $t\in (-\infty,\infty)$, i.e., $t$ runs over all real numbers.
\item<3->  In general we are expected to specify the interval in which $t$ lies.
\item<4->  For example, if we restrict the previous example to $t\in [-1,2]$, we get the part of the parabola that begins at $(1,-2)$ and ends at $(-2,1)$.
\item<5->  We say that  $(1,-2)$ is the initial point and $(-2,1)$ is the terminal point of the curve.
\end{itemize}
\end{columns}
\end{frame}
% end module eliminate-parameter-ex



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/implicit-vs-explicit-parametrization.tex
\begin{frame}
\frametitle{Implicit vs Explicit (Parametric) Curve Equations}
\begin{itemize}
\item Consider the parametric curve 
\[\alert<3->{
\left|\begin{array}{rcl}x  & = & -t^2 + 2\\
y&=&t-1 \quad .
\end{array}\right.
}\]
\item<2-> As we saw in preceding slides/lectures, all points $(x,y)$ on the image of this curve satisfy the equation 
\[ \alert<4>{x+(y+1)^2 -2=0}\]
\item<3-> Equations of the first form are called explicit (parametric) curve equations.
\item<4-> Equations of the second form are called implicit equations of the curve image.
\item<5-> Explicit (parametric) curve equations have the advantage that it is easy to generate points on the curve. 
\item<6-> Implicit curve equations have the advantage that it is easy to check whether a point is on the curve.

\end{itemize}
\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/parametric-ex2.tex
% begin module parametric-ex2
\begin{frame}
\begin{example} %[Example 2, p. 658]
Sketch and identify the curve defined by the parametric equations
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
\alert<handout:0| 15>{x = \cos t}, \qquad \alert<handout:0| 14>{y = \sin t}.
\]
\begin{columns}[c]
\column{.55\textwidth}

\psset{xunit=2, yunit=2cm}
\begin{pspicture}(-1.5, -1.5)(1.5,1.5)

\tiny
\fcAxesStandard{-1.4}{-1.4}{1.4}{1.4}

\fcXTick{1}
\rput[rb](0.95, 0.05){$(1,0)$}

%Calculator input for full circle: plotCurve{}(\cos{}t, \sin{}t, 0, 2 \pi)
\uncover<handout:0| 3->{
\fcFullDot{1}{0}
\rput[bl](1.05, 0.05){$t=0$}
}

\uncover<handout:0| 5->{
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=200] {0} {0.261799388}{t 57.29578 mul cos t 57.29578 mul sin }
\parametricplot[ linecolor=\fcColorGraph, plotpoints=200] {0.261799388} {0.523598776}{t 57.29578 mul cos t 57.29578 mul sin }
\rput[bl](0.9, 0.5){$t=\frac{\pi}{6}$}
\fcFullDot{0.866025} {0.500000}
}

\uncover<handout:0| 7->{
\tiny
%Calculator input: plotCurve{}(\cos{}t, \sin{}t, 1/4 \pi, 1/3 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{0.785398}{1.0472}{t 57.29578 mul cos t 57.29578 mul sin }
%Calculator input: plotCurve{}(\cos{}t, \sin{}t, 1/6 \pi, 1/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=1000]{0.523599}{0.785398}{t 57.29578 mul cos t 57.29578 mul sin }
\fcFullDot{0.500000}{0.866025}
\rput[bl](0.55, 0.9){$t=\frac{\pi}{3}$}
}
\uncover<handout:0| 9->{
%Calculator input: plotCurve{}(\cos{}t, \sin{}t, 5/12 \pi, 1/2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{1.309}{1.5708}{t 57.29578 mul cos t 57.29578 mul sin }
%Calculator input: plotCurve{}(\cos{}t, \sin{}t, 1/3 \pi, 5/12 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=1000]{1.0472}{1.309}{t 57.29578 mul cos t 57.29578 mul sin }
\fcFullDot{0.000000}{ 1.000000}
\rput[bl](0.1, 1.05){$t=\frac{\pi}{2}$}
}
\uncover<handout:0| 11->{
%Calculator input: plotCurve{}(\cos{}t, \sin{}t, 3/4 \pi, \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{2.35619}{3.14159}{t 57.29578 mul cos t 57.29578 mul sin }
%Calculator input: plotCurve{}(\cos{}t, \sin{}t, 1/2 \pi, 3/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=1000]{1.5708}{2.35619}{t 57.29578 mul cos t 57.29578 mul sin }
\fcFullDot{-1}{0}
\rput[rb](-1, 0.1){$t=\pi$}
}
\uncover<handout:0| 13->{
%Calculator input: plotCurve{}(\cos{}t, \sin{}t, 5/4 \pi, 3/2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{3.92699}{4.71239}{t 57.29578 mul cos t 57.29578 mul sin }
%Calculator input: plotCurve{}(\cos{}t, \sin{}t, \pi, 5/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=1000]{ 3.14159} {3.92699}{t 57.29578 mul cos t 57.29578 mul sin }
\fcFullDot{0}{-1}
\rput[tr](-0.1, -1.05){$t=\frac{3\pi}{2}$}
}
\uncover<handout:0| 15->{
%Calculator input: plotCurve{}(\cos{}t, \sin{}t, 7/4 \pi, 2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000 ]{ 5.49779}{6.28319}{t 57.29578 mul cos t 57.29578 mul sin }
%Calculator input: plotCurve{}(\cos{}t, \sin{}t, 3/2 \pi, 7/4 \pi)
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=1000]{4.71239}{5.49779}{t 57.29578 mul cos t 57.29578 mul sin }
\rput[tl](1, -0.1){$t=2\pi$}
}
\end{pspicture}

%\ \only<handout:0| -2>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex2a.pdf}%
%}%
%\only<handout:0| 3-4>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex2b.pdf}%
%}%
%\only<handout:0| 5-6>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex2c.pdf}%
%}%
%\only<handout:0| 7-8>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex2d.pdf}%
%}%
%\only<handout:0| 9-10>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex2e.pdf}%
%}%
%\only<handout:0| 11-12>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex2f.pdf}%
%}%
%\only<handout:0| 13-14>{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex2g.pdf}%
%}%
%\only<15->{%
%\includegraphics[height=6cm]{parametric-curves/pictures/11-01-ex2h.pdf}%
%}%

\column{.45\textwidth}
\[
\begin{array}{|r|r|r|}
\hline
t & x & y\\
\hline
\alert<handout:0| 2-3>{0} &%
\alert<handout:0| 2-3>{\uncover<3->{1}} &%
\alert<handout:0| 2-3>{\uncover<3->{0}} \\%
\alert<handout:0| 4-5>{\frac{\pi}6} &%
\alert<handout:0| 4-5>{\uncover<5->{\frac{\sqrt{3}}{2}}} &%
\alert<handout:0| 4-5>{\uncover<5->{\frac12}} \\%
\alert<handout:0| 6-7>{\frac{\pi}3} &%
\alert<handout:0| 6-7>{\uncover<7->{\frac12}} &%
\alert<handout:0| 6-7>{\uncover<7->{\frac{\sqrt{3}}2}} \\%
\alert<handout:0| 8-9>{\frac{\pi}2} &%
\alert<handout:0| 8-9>{\uncover<9->{0}} &%
\alert<handout:0| 8-9>{\uncover<9->{1}} \\%
\alert<handout:0| 10-11>{\pi} &%
\alert<handout:0| 10-11>{\uncover<11->{-1}} &%
\alert<handout:0| 10-11>{\uncover<11->{0}} \\%
\alert<handout:0| 12-13>{\frac{3\pi}2} &%
\alert<handout:0| 12-13>{\uncover<13->{0}} &%
\alert<handout:0| 12-13>{\uncover<13->{-1}} \\%
\alert<handout:0| 14-15>{2\pi} &%
\alert<handout:0| 14-15>{\uncover<15->{1}} &%
\alert<handout:0| 14-15>{\uncover<15->{0}} \\%
\hline
\end{array}
\]
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
\uncover<16->{%
x^2 + y^2 = %
}%
\uncover<17->{%
\cos^2 t+ \sin^2 t = %
}%
\uncover<18->{%
1%
}%
\]
\uncover<19->{%
Therefore $(x,y)$ travels on the unit circle $x^2 + y^2 = 1$.
}%
\end{columns}
\end{example}
\end{frame}
% end module parametric-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/parametric-ex4.tex
% begin module parametric-ex4
\begin{frame}[t]
\begin{example} %[Example 4, p. 659]
Find parametric equations for the circle with center $(h, k)$ and radius $r$.
\begin{columns}
\column{0.37\textwidth}
\psset{xunit=1.5cm, yunit=1.5cm}
\begin{pspicture}(-0.5, -0.5)(2.8,2.7)
\tiny
\psframe*[linecolor=white](-0.5, -0.5)(2.8,2.7)
\psaxes[arrows=<->, ticks=none, labels=none](0,0)(-0.5,-0.5)(2.7,2.5)
\parametricplot[algebraic=true, linecolor=\fcColorGraph] {0}{6.283185307}{1.4+cos(t)|1.2+sin(t)}
\uncover<2->{%
\fcFullDot{1.4}{1.2}
\rput[tr](1.35, 1.1){$(h,k)=O$}
}
\uncover<3->{%
\rput[bl](1.6, 1.65){$r$}
\rput[bl](1.9, 2.1){$P=(x,y)$}
\psline(1.4,1.2)(1.9,2.066025)
\fcFullDot{1.900000}{2.066025}
}
\uncover<4->{
\rput(1.4,1.2){\fcAngle{0}{1.047197551}{0.2}{} }
\rput[bl](1.6,1.3){$t$ }
\rput[tl](1.9, 1.1){$Q$}
\psline(1.9,2.066025)(1.9,1.2)
\psline(1.8,1.2)(1.8, 1.3)(1.9,1.3)
\psline(1.4, 1.2)(2.4,1.2)
}
\uncover<9->{
\psline[linestyle=dashed](1.4,1.2)(1.4,0)
\psline[linestyle=dashed](1.4,1.2)(0,1.2)
\psline(1.3,0)(1.3,0.1)(1.4,0.1)
\psline(0,1.1)(0.1,1.1)(0.1,1.2)
\psline[linecolor=red, arrows=<->](0,-0.12)(1.4,-0.12)
\psline[linecolor=red, arrows=<->](-0.12,0)(-0.12,1.2)
\psline[linecolor=red, arrows=<->](1.4,-0.12)(1.9,-0.12)
\psline[linecolor=red, arrows=<->](-0.12,1.2) (-0.12,2.066025)
\rput[t](1.65, -0.14){$r\cos t$}
\rput[r](-0.14, 1.63){$r\sin t$}
\rput[t](0.7, -0.14){$h$}
\rput[r](-0.14, 0.6) {$k$}
\psline[linestyle=dashed](1.9, 1.2)(1.9,0)
\psline[linestyle=dashed](1.9, 2.066025)(0,2.066025)
\psline(1.8,0)(1.8,0.1)(1.9, 0.1)
\psline(0,1.966025)(0.1, 1.966025)(0.1, 2.066025)
}
\end{pspicture}
\vspace{1.4cm}
\column{0.63\textwidth}
\begin{itemize}
\only<1-10>{ \item<2->  Let $O$ be the center of the circle with coordinates $(h,k)$.
\item<3->  Let $P$ be a point on the circle with coordinates $(x,y)$.
\item<4->  Let $t$, $Q$ be as indicated on the figure.
\item<5->  Then $\alert<5,6>{|OQ|=}\uncover<5>{\alert<5>{\textbf{?}}} \uncover<6->{ \alert<6>{r \cos t}}$.
\item<7->  $\alert<7,8>{|PQ|=} \uncover<7>{ \alert<7>{ \textbf{?}}} \uncover<8->{\alert<8>{r \sin t}}$.
\item<9-> Then the coordinates of $P$ are $ (h+r\cos t, k+r\sin t)$.
\item<10-> In this way we get the parametric equations $\left|\begin{array}{l}x=h+r\cos t\\ y=k+r\sin t\end{array}\right., t\in [0,2\pi]$
}
\only<11->{
\item<11-> Alternative solution: $x=\cos t$, $y=\sin t$ are parametric equations of the unit circle.
\item<12-> Multiply by $r$ to scale the circle to have radius $r$: $x = r\cos t,\ \  y = r\sin t$.
\item<13-> Add $h$ to $x$ and $k$ to $y$ to translate the circle $h$ units to the left and $k$ units up: $x =h+ r\cos t,\ \  y =k+  r\sin t$
}
\end{itemize}
\end{columns}
\end{example}
\end{frame}
% end module parametric-ex4



\subsection{The Cycloid}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/cycloid-def.tex
% begin module cycloid-def
\begin{frame}
\frametitle{The Cycloid}

\psset{xunit=0.8cm, yunit=0.8cm}
\begin{pspicture}(-1.499950, -0.5)(14.066321,5)
\psframe*[linecolor=white](-1.499950,-0.1)(14.066321,5)
\tiny

%circles generated by calculator commands:
%precision:=0.99995;f{}{{t}}:=plot2D(\sqrt{1-(x-t)^2}+1, t-precision, t+precision )+plot2D(-\sqrt{1-(x-t)^2}+1, t-precision, t+precision );f{}(0)+f{}(0.5\pi)+f{}(\pi)+f{}(1.5\pi)+f{}(2\pi)+f{}(2.5\pi)+f{}(3\pi)+f{}(3.5\pi)+f{}(4\pi)

\fcAxesStandard{-1.1}{-0.5}{13.566321}{2.3}

%calcululator commands: f{}{{t}}:=(DoubleValue (t\pi-sin (t\pi) ), 1-cos (\pi t));(f{}0, f{}0.5, f{}1, f{}1.5, f{}2, f{}2.5, f{}3, f{}3.5, f{}4)
%generate the following points:
%(0.000000, 0.000000), (0.570796, 1.000000), (3.141593, 2), (5.712389, 1.000000), (6.283185, 0.000000), (6.853982, 1.000000), (9.424778, 2.000000), (11.995574, 1.000000), (12.566371, 0.000000)

\uncover<1>{
%Function formula: (- x^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{-0.999990}{0.999990}{1.0000000 1.0000000 x 2.0000000 exp -1.0000000 mul add 0.5000000 exp add }
%Function formula: - (- x^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{-0.999990}{0.999990}{1.0000000 1.0000000 x 2.0000000 exp -1.0000000 mul add 0.5000000 exp -1.0000000 mul add }
\fcFullDot{0}{0}
\rput[bl](0.1, 0.1){$P$}
}

\uncover<2>{
%Function formula: (- (x-1/2 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{0.570806}{2.570786}{1.0000000 1.0000000 3.141592654 -0.5000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp add }
%Function formula: - (- (x-1/2 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{0.570806}{2.570786}{1.0000000 1.0000000 3.141592654 -0.5000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp -1.0000000 mul add }
\fcFullDot{0.570796}{1}
\rput[l](0.670796, 1.000000){$P$}
}

\uncover<3>{
%Function formula: (- (x- \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{2.141603}{4.141583}{1.0000000 1.0000000 3.141592654 -1.0000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp add }
%Function formula: - (- (x- \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{2.141603}{4.141583}{1.0000000 1.0000000 3.141592654 -1.0000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp -1.0000000 mul add }
\fcFullDot{3.141593}{2}
\rput[t](3.141593, 1.9){$P$}
}

\uncover<4>{
%Function formula: (- (x-3/2 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{3.712399}{5.712379}{1.0000000 1.0000000 3.141592654 -1.5000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp add }
%Function formula: - (- (x-3/2 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{3.712399}{5.712379}{1.0000000 1.0000000 3.141592654 -1.5000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp -1.0000000 mul add }
\fcFullDot{5.712389}{1}
\rput[r](5.612389, 1){$P$}
}

\uncover<5>{
%Function formula: - (- (x-2 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{5.283195}{7.283175}{1.0000000 1.0000000 3.141592654 -2.0000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp -1.0000000 mul add }
%Function formula: (- (x-2 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{5.283195}{7.283175}{1.0000000 1.0000000 3.141592654 -2.0000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp add }
\fcFullDot{6.283185}{0}
\rput[lb](6.283185, 0.1){$P$}
}

\uncover<6>{
%Function formula: (- (x-5/2 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{6.853992}{8.853972}{1.0000000 1.0000000 3.141592654 -2.5000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp add }
%Function formula: - (- (x-5/2 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{6.853992}{8.853972}{1.0000000 1.0000000 3.141592654 -2.5000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp -1.0000000 mul add }
\fcFullDot{6.853982}{1}
\rput[l](6.953982, 1.000000){$P$}
}

\uncover<7>{
%Function formula: (- (x-3 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{8.424788}{10.424768}{1.0000000 1.0000000 3.141592654 -3.0000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp add }
%Function formula: - (- (x-3 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{8.424788}{10.424768}{1.0000000 1.0000000 3.141592654 -3.0000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp -1.0000000 mul add }
\fcFullDot{9.424778}{2}
\rput[t](9.424778, 1.9){$P$}
}

\uncover<8>{
%Function formula: - (- (x-7/2 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{9.995584}{11.995564}{1.0000000 1.0000000 3.141592654 -3.5000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp -1.0000000 mul add }
%Function formula: (- (x-7/2 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{9.995584}{11.995564}{1.0000000 1.0000000 3.141592654 -3.5000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp add }
\fcFullDot{11.995574}{1}
\rput[r](11.895574, 1.000000){$P$}
}

\uncover<9>{
%Function formula: (- (x-4 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{11.566381}{13.566361}{1.0000000 1.0000000 3.141592654 -4.0000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp add }
%Function formula: - (- (x-4 \pi)^{2}+1)^{1/2}+1
\psplot[linecolor=\fcColorTangent, plotpoints=1000]{11.566381}{13.566361}{1.0000000 1.0000000 3.141592654 -4.0000000 mul x add 2.0000000 exp -1.0000000 mul add 0.5000000 exp -1.0000000 mul add }
\fcFullDot{12.566371}{0}
\rput[lb](12.566371, 0.1){$P$}
}

%Calculator input:f{}{{p}}:=plotCurve(t+\cos(- t+3\pi/2), 1+\sin(3\pi/2- t),p, p+\pi/4)+ plotCurve(t+\cos(- t+3\pi/2), 1+\sin(3\pi/2- t), p+\pi/4, p+\pi/2); f{}0+f{}(0.5\pi)+ f{}(\pi)+f{}(1.5\pi)+f{}(2\pi)+f{}(2.5\pi)+f{}(3\pi)+f{}(3.5\pi)+f{}(4\pi)


\uncover<2->{
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 0, 1/4 \pi)
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=1000]{0}{0.785398}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 1/4 \pi, 1/2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{ 0.785398}{1.5708}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
}
\uncover<3->{
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 1/2 \pi, 3/4 \pi)
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=1000]{1.5708}{2.35619}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 3/4 \pi, \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{2.35619}{3.14159}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
}
\uncover<4->{
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, \pi, 5/4 \pi)
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=1000]{3.14159}{3.92699}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 5/4 \pi, 3/2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{3.92699}{4.71239}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
}
\uncover<5->{
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 3/2 \pi, 7/4 \pi)
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=1000]{4.71239}{5.49779}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 7/4 \pi, 2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{5.49779}{6.28319}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
}
\uncover<6->{
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 2 \pi, 9/4 \pi)
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=1000]{6.28319}{7.06858}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 9/4 \pi, 5/2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{7.06858}{7.85398}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
}
\uncover<7->{
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 5/2 \pi, 11/4 \pi)
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=1000]{7.85398}{8.63938}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 11/4 \pi, 3 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{8.63938}{9.42478}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
}
\uncover<8->{
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 3 \pi, 13/4 \pi)
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=1000]{9.42478}{10.2102}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 13/4 \pi, 7/2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{10.2102}{10.9956}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
}
\uncover<9->{
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 7/2 \pi, 15/4 \pi)
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=1000]{10.9956}{11.781}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 15/4 \pi, 4 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{11.781}{12.5664}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
}
\uncover<10->{
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 4 \pi, 17/4 \pi)
\parametricplot[linecolor=\fcColorGraph, arrows=->, plotpoints=1000]{12.5664}{13.3518}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
%Calculator input: plotCurve{}(\cos{}(- t+3/2 \pi)+t, \sin{}(- t+3/2 \pi)+1, 17/4 \pi, 9/2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{13.3518}{14.1372}{t 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul cos add 1.0000000 3.141592654 1.5000000 mul t -1.0000000 mul add 57.29578 mul sin add }
}
\end{pspicture}

\begin{definition}[Cycloid]
The curve traced out by a point $P$ on the circumference of a circle as the circle rolls along a straight line is called a cycloid. \uncover<11>{}
\end{definition}

%\ \only<handout:0| 1>{%
%\includegraphics[width=12cm]{parametric-curves/pictures/11-01-cycloida.pdf}%
%}%
%\only<handout:0| 2>{%
%\includegraphics[width=12cm]{parametric-curves/pictures/11-01-cycloidb.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[width=12cm]{parametric-curves/pictures/11-01-cycloidc.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[width=12cm]{parametric-curves/pictures/11-01-cycloidd.pdf}%
%}%
%\only<handout:0| 5>{%
%\includegraphics[width=12cm]{parametric-curves/pictures/11-01-cycloide.pdf}%
%}%
%\only<handout:0| 6>{%
%\includegraphics[width=12cm]{parametric-curves/pictures/11-01-cycloidf.pdf}%
%}%
%\only<handout:0| 7>{%
%\includegraphics[width=12cm]{parametric-curves/pictures/11-01-cycloidg.pdf}%
%}%
%\only<8>{%
%\includegraphics[width=12cm]{parametric-curves/pictures/11-01-cycloidh.pdf}%
%}%
%\only<handout:0| 9>{%
%\includegraphics[width=12cm]{parametric-curves/pictures/11-01-cycloidi.pdf}%
%}%
%\only<handout:0| 10->{%
%\includegraphics[width=12cm]{parametric-curves/pictures/11-01-cycloidj.pdf}%
%}%

\end{frame}
% end module cycloid-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/cycloid-equations-ex7.tex
% begin module cycloid-equations-ex7
\begin{frame}
\begin{example} %[Example 7, p. 660]
Find parametric equations of a cycloid made using a circle with radius $r$ that rolls along the $x$-axis such that $P$ hits the origin.
\begin{columns}[c]
\column{.4\textwidth}

\psset{xunit=1.6cm, yunit=1.6cm}
\begin{pspicture}( -0.6, -0.6)(2.65,2.3)
\psframe*[linecolor=white](-0.6, -0.6)(2.65,2.3)
\tiny%
\psaxes[arrows=<->, ticks=none, labels=none ](0,0)( -0.500000, -0.5)(2.55,2.2)%
\parametricplot[linecolor=\fcColorTangent, plotpoints=1000, algebraic=true]{0}{6.283185307}{cos(t)+1.256637061|sin(t)+1}%
\uncover<2->{%
\psplot[linecolor=green, plotpoints=300]{0.305581} {1.256637061} {1 1 -1.25664 x add 2 exp -1 mul add 0.5 exp -1 mul add }%
}%
%Calculator input: plotCurve{}(- \sin{}t+t, - \cos{}t+1, 0, \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000] { 0}{2.8}{t t 57.29578 mul sin -1 mul add 1 t 57.29578 mul cos -1 mul add }

\fcFullDot{0.305581}{0.690983}
\rput[r](0.2, 0.69){$P$}
\fcFullDot{1.256637061}{1}
\rput[bl](1.286637061,1.05){\uncover<5->{\alert<5>{$ C=(r\theta,r)$}}}

\uncover<6->{\psline[linestyle=dashed](0.305581,0)(0.305581,0.690983)
\rput[b](0.15, 0.05){\alert<6>{$x$}}
\rput[l](0.32, 0.35){\alert<6>{$y$}}
}

\psline(0.305581,0.690983)(1.256637061,1)
\rput[b](0.75, 0.85){$r$}

\uncover<7->{
\psline[linestyle=dashed](0.305581,0.690983)(1.256637061,0.690983)
\psline(1.156637061,0.690983)(1.156637061,0.590983)(1.256637061,0.590983)
\rput[l](1.306637061,0.690983){$Q$}
}

\psline(1.256637061,0.1)(1.356637061,0.1)(1.356637061,0)
\rput[lt](1.256637061,-0.1){$T$}
\psline(1.256637061,1)(1.256637061,0)

\uncover<3->{\psline[linecolor=green](0,0)(1.256637061, 0)}

\uncover<4->{
\psline{<-}(0,-0.2)(0.5, -0.2)
\psline{->}(0.72,-0.2)(1.256637061, -0.2)
\rput(0.62, -0.2){\alert<4>{$r\theta$}}
}
\rput(1.2, 0.9){\uncover<2->{\alert<2>{$\theta$}}}
\rput (-0.2, -0.2){$O$}
\end{pspicture}

%\ \only<handout:0| -2>{%
%\includegraphics[width=5cm]{parametric-curves/pictures/11-01-cycloideqa.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[width=5cm]{parametric-curves/pictures/11-01-cycloideqb.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[width=5cm]{parametric-curves/pictures/11-01-cycloideqc.pdf}%
%}%
%\only<handout:0| 5>{%
%\includegraphics[width=5cm]{parametric-curves/pictures/11-01-cycloideqd.pdf}%
%}%
%\only<handout:0| 6>{%
%\includegraphics[width=5cm]{parametric-curves/pictures/11-01-cycloideqe.pdf}%
%}%
%\only<7->{%
%\includegraphics[width=5cm]{parametric-curves/pictures/11-01-cycloideqf.pdf}%
%}%
\column{.6\textwidth}
\begin{itemize}
\item<2->  We choose our parameter to be \alert<2>{$\theta$}, the angle of rotation of the circle.
\item<3->  How far has the circle moved if it has rolled through $\theta$ radians?
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<3->{%
{|OT|} = \alert<handout:0| 4>{{ \textrm{arc} PT} }%
}%
\uncover<4->{%
\alert<handout:0| 4>{ = r\theta}%
}%
\]
\item<5->  Then the center is $\alert<5>{C = (r\theta , r)}$.
\item<6->  Let the coordinates of $P$ be $(x,y)$.
\end{itemize}
\[
\begin{array}{cccccc}
\uncover<6->{%
\alert<handout:0| 8>{x}%
}&%
\uncover<6->{%
\alert<handout:0| 8>{=}%
}&%
\uncover<8->{%
\alert<handout:0| 8>{\alert<handout:0| 9-10>{|OT|} - \alert<handout:0| 11-12>{|PQ|}}%
}&%
\uncover<9->{%
=%
}&%
\uncover<10->{%
\alert<handout:0| 10>{r\theta}%
}%
\uncover<9->{-}%
\uncover<12->{%
\alert<handout:0| 12>{r\sin \theta}%
}\\%

\uncover<6->{%
\alert<handout:0| 13>{y}%
}&%
\uncover<6->{%
\alert<handout:0| 13>{=}%
}&%
\uncover<13->{%
\alert<handout:0| 13>{\alert<handout:0| 14-15>{|CT|} - \alert<handout:0| 16-17>{|CQ|}}%
}&%
\uncover<14->{%
=%
}&%
\uncover<15->{%
\alert<handout:0| 15>{r}%
}%
\uncover<14->{-}%
\uncover<17->{%
\alert<handout:0| 17>{r\cos \theta}%
}\\%
\end{array}
\]
\end{columns}
\uncover<18->{%
Therefore the equations are
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
x = r(\theta - \sin \theta ),\qquad y = r(1-\cos \theta ),\qquad \theta \in \mathbb{R}
\]
}%
\end{example}
\end{frame}
% end module cycloid-equations-ex7



\subsection{Polar Curves}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-curve-definition.tex
\begin{frame}
\begin{itemize}
\item Recall polar coordinates:
\[
\left|\begin{array}{rcl}
x&=& r\cos \theta \\
y&=& r\sin \theta
\end{array}\right.
\]
\item<2-> A curve in polar coordinates is given by specifying explicit or implicit equations in polar coordinates.
\end{itemize}

\end{frame}


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-curve-ex4.tex
% begin module polar-curve-ex4
\begin{frame}
\begin{example} %[Example 4, p. 677]
What curve is represented by the polar equation $r = 2$?
\begin{columns}[c]
\column{.5\textwidth}

\psset{xunit=0.5cm, yunit=0.5cm, algebraic=true}
\begin{pspicture}(-4.8, -4.8)(4.8,4.8)
\tiny
\psframe*[linecolor=white](-4.8, -4.8)(4.8, 4.8)
%Force a bounding box for pdflatex:
\psline[linecolor=red!1](4.6, 4.6)(4.6001,4.6)
\psline[linecolor=red!1](-4.6, -4.6)(-4.6001,-4.6)%
\fcFullDotBlue{0}{0}%
\psline{->}(0,0)(4.4,0)%
\uncover<3->{%
\rput[bl](1.5, 1.7){\alert<3>{$r=2$}}%
}%
\uncover<3>{%
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-3.14159}{3.14159}{2*cos(t)|2*sin(t) }
}
\uncover<4->{
\parametricplot[plotpoints=1000]{-3.14159}{3.14159}{2*cos(t)|2*sin(t) }
}
\uncover<4->{
\rput[bl](0.6, 0.88){\alert<4>{$r=1$}}
}
\uncover<4>{
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-3.14159}{3.14159}{cos(t)|sin(t)}
}
\uncover<5->{
\parametricplot[plotpoints=1000]{-3.14159}{3.14159}{cos(t)|sin(t)}
}
\uncover<5->{
\rput[bl](3.2, 3.4){\alert<5>{$r=4$}}
}
\uncover<5>{
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-3.14159}{3.14159}{4*cos(t)|4*sin(t)}
}
\end{pspicture}
%\only<handout:0| -2>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex4a.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex4b.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex4c.pdf}%
%}%
%\only<5->{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex4d.pdf}%
%}%
\column{.5\textwidth}
\begin{itemize}
\item<2->  The equation describes all points that are $2$ units away from $O$.
\item<3->  This is the circle with center $O$ and radius $2$.
\item<4->  The equation $r = 1$ describes the unit circle.
\item<5->  The equation $r = 4$ describes the circle with center $O$ and radius $4$.
\end{itemize}
\end{columns}
\end{example}
\end{frame}
% end module polar-curve-ex4



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-curve-ex6.tex
% begin module polar-curve-ex6
\begin{frame}[t]
\begin{example} %[Example 6, p. 678]
\begin{enumerate}
\item<1-| alert@2-21> Sketch the curve with polar equation \alert<handout:0| 26>{$r = 2\cos \theta$}.
\item<1-| alert@22-> Find a Cartesian equation for this curve.
\end{enumerate}
\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=1.75cm, yunit=1.75cm}
\begin{pspicture}(-0.6, -1.5)(2.5,1.5)

\tiny
\fcAxesStandard{-0.52}{-1.4}{2.4}{1.4}

\uncover<21->{
%Calculator input: plotCurve{}(2 \cos^{2}{}t, 2 \cos{}t \sin{}t, 0, 2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=200]{0}{6.28319}{t 57.29578 mul cos 2.0000000 exp 2.0000000 mul t 57.29578 mul sin t 57.29578 mul cos mul 2.0000000 mul }
}
\uncover<4->{
\fcFullDot{2}{0}
\rput[bl](2.05,0.05){$(2,0)$}
}
\uncover<6->{
\fcFullDot{1.500000}{0.866025}
\rput[bl](1.55,0.9){$\left(\sqrt{3}, \frac{\pi}{6}\right)$}
}

\uncover<8->{
\fcFullDot{1}{1}
\rput[bl](1.05,1.05){$\left(\sqrt{2}, \frac{\pi}{4}\right)$}
}
\uncover<10->{
\fcFullDot{0.5}{0.866025}
\rput[br](0.45,0.86){$\left(1, \frac{\pi}{3}\right)$}
}
\uncover<12->{
\fcFullDot{0}{0}
\rput[tr](-0.05,-0.05){$\left(0,\frac{\pi}{2}\right)$}
}
\uncover<14->{
\fcFullDot{0.5}{ -0.866025}
\rput[t](0.5,-0.88){$\left(-1, \frac{2\pi}{3}\right)$}
}
\uncover<16->{
\fcFullDot{1}{-1}
\rput[t](1,-1.05){$\left(-\sqrt{2},\frac{3\pi}{4}\right)$}
}
\uncover<18->{
\fcFullDot{1.5}{-0.866025}
\rput[lt](1.5,-0.9){$\left(-\sqrt{3},\frac{5\pi}{6}\right)$}
}
\uncover<4-5>{
\psline[linecolor=blue](0,0)(2,0)
}
\uncover<6-7>{
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=200] {0}{0.523598776 }{t 57.29578 mul cos 0.3 mul t 57.29578 mul sin 0.3 mul }
\psline[linecolor=blue](0,0)(1.5,0.866025)
}
\uncover<8-9>{
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=200] {0}{0.785398163}{t 57.29578 mul cos 0.3 mul t 57.29578 mul sin 0.3 mul }
\psline[linecolor=blue](0,0)(1,1)
}
\uncover<10-11>{
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=200] {0}{1.047197551}{t 57.29578 mul cos 0.3 mul t 57.29578 mul sin 0.3 mul }
\psline[linecolor=blue](0,0)(0.5,0.866025)
}
\uncover<12-13>{
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=200] {0}{1.570796327}{t 57.29578 mul cos 0.3 mul t 57.29578 mul sin 0.3 mul }
}
\uncover<14-15>{
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=200] {0}{2.094395102}{t 57.29578 mul cos 0.3 mul t 57.29578 mul sin 0.3 mul }
\psline[linecolor=blue](0,0)(0.5, -0.866025)
\psline[linecolor=blue, linestyle=dashed](0,0)(-0.500000, 0.866025)
}
\uncover<16-17>{
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=200] {0}{2.35619449}{t 57.29578 mul cos 0.3 mul t 57.29578 mul sin 0.3 mul }
\psline[linecolor=blue, linestyle=dashed](0,0)(-0.5, 0.5)
\psline[linecolor=blue](0,0)(1, -1)
}
\uncover<18-19>{
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=200] {0}{2.617993878}{t 57.29578 mul cos 0.3 mul t 57.29578 mul sin 0.3 mul }
\psline[linecolor=blue, linestyle=dashed](0,0)(-0.500000, 0.288675)
\psline[linecolor=blue](0,0)(1.500000, -0.866025)
}
\uncover<20>{
\parametricplot[arrows=->, linecolor=\fcColorGraph, plotpoints=200] {0}{3.141592654}{t 57.29578 mul cos 0.3 mul t 57.29578 mul sin 0.3 mul }
\psline[linecolor=blue, linestyle=dashed](0,0)(-0.5,0)
\psline[linecolor=blue](0,0)(2,0)
}
\end{pspicture}
\vspace{1cm}
%\ \only<handout:0| -3>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex6z.pdf}%
%}%
%\only<handout:0| 4-5>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex6a.pdf}%
%}%
%\only<handout:0| 6-7>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex6b.pdf}%
%}%
%\only<handout:0| 8-9>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex6c.pdf}%
%}%
%\only<handout:0| 10-11>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex6d.pdf}%
%}%
%\only<handout:0| 12-13>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex6e.pdf}%
%}%
%\only<handout:0| 14-15>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex6f.pdf}%
%}%
%\only<handout:0| 16-17>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex6g.pdf}%
%}%
%\only<handout:0| 18-19>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex6h.pdf}%
%}%
%\only<handout:0| 20>{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex6i.pdf}%
%}%
%\only<21->{%
%\includegraphics[height=6cm]{polar-curves/pictures/11-03-ex6j.pdf}%
%}%
\column{.5\textwidth}
\only<handout:1| -21>{\uncover<2->{%
\[
\begin{array}{|@{\ }l@{\ }|r@{\ }|}
\hline
\theta & r \\
\hline
\alert<handout:0| 3-4>{%
0%
}&%
\uncover<4->{\alert<handout:0| 4>{%%
2%
}}\\%%
\alert<handout:0| 5-6>{%
\pi /6%
}&%
\uncover<6->{\alert<handout:0| 6>{%%
\sqrt{3}%
}}\\%%
\alert<handout:0| 7-8>{%
\pi /4%
}&%
\uncover<8->{\alert<handout:0| 8>{%%
\sqrt{2}%
}}\\%%
\alert<handout:0| 9-10>{%
\pi /3%
}&%
\uncover<10->{\alert<handout:0| 10>{%%
1%
}}\\%%
\alert<handout:0| 11-12>{%
\pi /2%
}&%
\uncover<12->{\alert<handout:0| 12>{%%
0%
}}\\%%
\alert<handout:0| 13-14>{%
2\pi /3%
}&%
\uncover<14->{\alert<handout:0| 14>{%%
-1%
}}\\%%
\alert<handout:0| 15-16>{%
3\pi /4%
}&%
\uncover<16->{\alert<handout:0| 16>{%%
-\sqrt{2}%
}}\\%%
\alert<handout:0| 17-18>{%
5\pi /6%
}&%
\uncover<18->{\alert<handout:0| 18>{%%
-\sqrt{3}%
}}\\%%
\alert<handout:0| 19-20>{%
\pi%
}&%
\uncover<20->{\alert<handout:0| 20>{%%
-2%
}}\\%%
\hline
\end{array}
\]
}}%
\only<handout:2| 22->{%
\begin{itemize}
\item<22-| alert@22-23>  $x = $ \uncover<23->{$r\cos \theta$.}
\item<24-| alert@24-25>  $\cos \theta = $ \uncover<25->{$x/r$.}
\item<26-| alert@26-27>  $r = 2\cos \theta = $ \uncover<27->{$\alert<handout:0| 28>{2x}/r$.}
\item<28-| alert@28-30>  $2x = $ \uncover<29->{$r^2 = $ \uncover<30->{$x^2+y^2$.}}
\item<31->  $x^2 + y^2 - 2x = 0$.
\item<32->  Complete the square:
\end{itemize}
\begin{eqnarray*}
\uncover<32->{%
(x^2 - 2x \uncover<33->{\alert<handout:0| 33>{+ 1}}) + y^2%
}%
& \uncover<32->{ = } &%
\uncover<32->{%
0 \uncover<33->{\alert<handout:0| 33>{+ 1}}%
}\\%
\uncover<34->{%
(x-1)^2 + y^2%
}%
& \uncover<34->{ = } &%
\uncover<34->{%
1%
}%
\end{eqnarray*}
}%
\end{columns}
\end{example}
\end{frame}
% end module polar-curve-ex6



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/cardioid-ex7.tex
% begin module cardioid-ex7
\begin{frame}
\begin{example} [\uncover<10->{Cardioid}] %[Example 7, p. 679]
Sketch the curve $r = 1 + \sin \theta$.
\begin{columns}[c]
\column{.3\textwidth}
\psset{xunit=1cm, yunit=1cm, algebraic=true}
\begin{pspicture}(-1.499038, -0.700000)(1.6,2.4)

\tiny
\fcAxesStandard{-1.4}{-0.6}{1.4}{2.3}
\fcLabelXOne
\fcLabelYOne
\uncover<handout:0| 3>{%
\psline[linecolor=blue](0,0)(1.207107, 1.207107)
\fcAngle{0}{0.785398}{0.4}{$\theta$}
\rput[b](0.6, 0.68){$r$}
}
\uncover<handout:0| 4>{%
\psline[linecolor=blue](0,0)(1.017510, 1.522811)
\fcAngle{0}{0.981748}{0.4}{$\theta$}
\rput[b](0.45, 0.8){$r$}
}
\uncover<handout:0| 5>{
\psline[linecolor=blue](0,0)(0.736237, 1.777433)
\fcAngle{0}{1.178097}{0.4}{$\theta$}
\rput[b](0.3, 0.9){$r$}
}
\uncover<handout:0| 6>{
\fcAngle{0}{1.374447}{0.4}{$\theta$}
\psline[linecolor=blue](0,0)(0.386432, 1.942725)
\rput[b](0.1, 1.1){$r$}
}
\uncover<2-6>{%
\fcDrawPolar[linecolor=red, plotpoints=400, arrows=->]{0}{1.570796327 1 mul} {1+sin(t)}%
}%
\uncover<handout:0| 7->{%
\fcDrawPolar[linecolor=blue, plotpoints=400]{0}{1.570796327 1 mul} {1+sin(t)}%
}%
\uncover<7>{%
\fcDrawPolar[arrows=->]{1.570796327 1 mul}{1.570796327 2 mul} {1+sin(t)}%
}%
\uncover<handout:0| 8->{%
\fcDrawPolar[arrows=->, linecolor=\fcColorGraph, plotpoints=400]{1.570796327 1 mul}{1.570796327 2 mul} {1+sin(t)}%
}%
\uncover<8>{%
\fcDrawPolar[arrows=->, linecolor=\fcColorGraph, plotpoints=400]{1.570796327 2 mul}{1.570796327 3 mul} {1+sin(t)}%
}%
\uncover<handout:0| 9->{%
\fcDrawPolar[linecolor=\fcColorGraph, plotpoints=400, arrows=->]{1.570796327 2 mul}{1.570796327 3 mul} {1+sin(t)}%
}%
\uncover<9>{%
\fcDrawPolar[linecolor=\fcColorGraph, plotpoints=400, arrows=->]{1.570796327 3 mul}{1.570796327 4 mul} {1+sin(t)}%
}%
\uncover<handout:0| 10->{%
\fcDrawPolar[linecolor=\fcColorGraph, plotpoints=400, arrows=->]{1.570796327 3 mul}{1.570796327 4 mul} {1+sin(t)}%
}%
\end{pspicture}

%\ \only<handout:0| 1>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7a.pdf}%
%}%
%\only<handout:0| 2>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7b.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7ba.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7bb.pdf}%
%}%
%\only<handout:0| 5>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7bc.pdf}%
%}%
%\only<handout:0| 6>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7bd.pdf}%
%}%
%\only<handout:0| 7>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7c.pdf}%
%}%
%\only<handout:0| 8>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7d.pdf}%
%}%
%\only<9->{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7e.pdf}%
%}%
\column{.7\textwidth}
\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-0.700000, -0.700000)(6.55,2.4)

\tiny
\psframe*[linecolor=white](-0.7, -0.7)(6.55, 2.4)
\psaxes[arrows=<->, Dx=1.570796327, Dy=1, labels=none](0,0)(-0.5, -0.5)(6.4, 2.3)
\rput[r](-0.1,2.3){$r$}
\rput[t](6.48,-0.01){$\theta$}
\rput[r](-0.15,1){$1$}
\rput[r](-0.15,2){$2$}

\rput[t](! 1.570796327 -0.15){$\frac{\pi}2$}
\rput[t](! 1.570796327 2 mul -0.15){$\pi$}
\rput[t](! 1.570796327 3 mul -0.15){$\frac{3\pi}{2}$}
\rput[t](! 1.570796327 4 mul -0.15){$2\pi$}

\rput[l](3.4, 1){$r=1+\sin \theta$}

\uncover<handout:0| 3>{
\fcLengthIndicator{0}{-0.1}{0.785398163}{-0.1}{$\theta$}
\psline[linecolor=blue](0.785398163, 0)(0.785398163, 1.707107)
}
\uncover<handout:0| 4>{
\fcLengthIndicator{0}{-0.1}{0.981747704}{-0.1}{$\theta$}
\psline[linecolor=blue](0.981747704, 0)(0.981747704, 1.831470)
}
\uncover<handout:0| 5>{
\fcLengthIndicator{0}{-0.1}{1.178097245}{-0.1}{$\theta$}
\psline[linecolor=blue](1.178097245, 0)(1.178097245, 1.923880)
}
\uncover<handout:0| 6>{
\fcLengthIndicator{0}{-0.1}{1.374446786}{-0.1}{$\theta$}
\psline[linecolor=blue](1.374446786, 0)(1.374446786, 1.980785)
}


%Function formula: \sin{}x+1
\psplot[linecolor=blue, plotpoints=1000]{0.000000}{6.283185}{1.0000000 x 57.29578 mul sin add }
\uncover<handout:0| 2-6>{
\psplot[linecolor=red, plotpoints=400]{0.000000}{1.570796327}{1.0000000 x 57.29578 mul sin add }
\fcFullDot{0}{1}
\fcFullDot{1.570796327}{2}
}
\uncover<handout:0| 7>{
\psplot[linecolor=red, plotpoints=400]{1.570796327}{3.141592654} {1.0000000 x 57.29578 mul sin add }
\fcFullDot{1.570796327}{2}
\fcFullDot{3.141592654}{1}
}
\uncover<handout:0| 8>{
\psplot[linecolor=red, plotpoints=400]{3.141592654} {4.71238898} {1.0000000 x 57.29578 mul sin add }
\fcFullDot{3.141592654}{1}
\fcFullDot{4.71238898}{0}
}
\uncover<handout:0| 9>{
\psplot[linecolor=red, plotpoints=400]{4.71238898}{6.283185307}{1.0000000 x 57.29578 mul sin add }
\fcFullDot{4.71238898}{0}
\fcFullDot{6.283185307}{1}
}
\end{pspicture}


%\ \only<handout:0| 1>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7helpera.pdf}%
%}%
%\only<handout:0| 2>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7helperb.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7helperba.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7helperbb.pdf}%
%}%
%\only<handout:0| 5>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7helperbc.pdf}%
%}%
%\only<handout:0| 6>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7helperbd.pdf}%
%}%
%\only<handout:0| 7>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7helperc.pdf}%
%}%
%\only<handout:0| 8>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7helperd.pdf}%
%}%
%\only<9->{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex7helpere.pdf}%
%}%
\end{columns}
\uncover<1-10>{}
\end{example}
\end{frame}
% end module cardioid-ex7



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-curve-ex8.tex
% begin module polar-curve-ex8

%plots a section of the second graph:
\newcommand{\plotSection}[1]{%
\psplot[linecolor=red, plotpoints=200]{#1\space 1 sub 6.283185 mul 8 div}{#1\space  6.283185 mul 8 div}{cos(2*x)}%
\fcFullDot{#1\space  1 sub 6.283185 mul 8 div} {#1\space  1 sub 6.283185 mul 8 div 57.29578 mul 2 mul cos }%
\fcFullDot{#1\space  6.283185 mul 8 div} {#1\space  6.283185 mul 8 div 57.29578 mul 2 mul cos }%
}

\begin{frame}
\begin{example} %[Example 8, p. 679]
Sketch the curve $r = \cos (2\theta)$.
\begin{columns}[c]
\column{.3\textwidth}
\psset{xunit=1cm, yunit=1cm,algebraic=true}
\begin{pspicture}(-1.4, -1.6)(1.6,1.6)
\tiny%
\fcAxesStandard{-1.3}{-1.3}{1.6}{1.6}%
\fcLabelXOne%
\fcLabelYOne%
\uncover<2>{%
\fcDrawPolar[linecolor=red, plotpoints=200, arrows=->]{3.141592654 0 mul 4 div}{3.141592654 1 mul 4 div}{cos(2*t)}%
}%
\uncover<3->{%
\fcDrawPolar[linecolor=blue, plotpoints=200]{3.141592654 0 mul 4 div}{3.141592654 1 mul 4 div}{cos(2*t)}%
}%
\uncover<3>{%
\fcDrawPolar[linecolor=red, plotpoints=200, arrows=->]{3.141592654 1 mul 4 div}{3.141592654 2 mul 4 div}{cos(2*t)}%
}%
\uncover<4->{%
\fcDrawPolar[linecolor=blue, plotpoints=200]{3.141592654 1 mul 4 div}{3.141592654 2 mul 4 div}{cos(2*t)}%
}%
\uncover<4>{%
\fcDrawPolar[linecolor=red, plotpoints=200, arrows=->]{3.141592654 2 mul 4 div}{3.141592654 3 mul 4 div}{cos(2*t)}%
}%
\uncover<5->{%
\fcDrawPolar[linecolor=blue, plotpoints=200]{3.141592654 2 mul 4 div}{3.141592654 3 mul 4 div}{cos(2*t)}%
}%
\uncover<5>{%
\fcDrawPolar[linecolor=red, plotpoints=200, arrows=->]{3.141592654 3 mul 4 div}{3.141592654 4 mul 4 div}{cos(2*t)}%
}%
\uncover<6->{%
\fcDrawPolar[linecolor=blue, plotpoints=200]{3.141592654 3 mul 4 div}{3.141592654 4 mul 4 div}{cos(2*t)}%
}%
\uncover<6>{%
\fcDrawPolar[linecolor=red, plotpoints=200, arrows=->]{3.141592654 4 mul 4 div}{3.141592654 5 mul 4 div}{cos(2*t)}%
}%
\uncover<7->{%
\fcDrawPolar[linecolor=blue, plotpoints=200]{3.141592654 4 mul 4 div}{3.141592654 5 mul 4 div}{cos(2*t)}%
}%
\uncover<7>{%
\fcDrawPolar[linecolor=red, plotpoints=200, arrows=->]{3.141592654 5 mul 4 div}{3.141592654 6 mul 4 div}{cos(2*t)}%
}%
\uncover<8->{%
\fcDrawPolar[linecolor=blue, plotpoints=200]{3.141592654 5 mul 4 div}{3.141592654 6 mul 4 div}{cos(2*t)}%
}%
\uncover<8>{%
\fcDrawPolar[linecolor=red, plotpoints=200, arrows=->]{3.141592654 6 mul 4 div}{3.141592654 7 mul 4 div}{cos(2*t)}%
}%
\uncover<9->{%
\fcDrawPolar[linecolor=blue, plotpoints=200]{3.141592654 6 mul 4 div}{3.141592654 7 mul 4 div}{cos(2*t)}%
}%
\uncover<9>{%
\fcDrawPolar[linecolor=red, plotpoints=200, arrows=->]{3.141592654 7 mul 4 div}{3.141592654 8 mul 4 div}{cos(2*t)}%
}%
\uncover<10->{%
\fcDrawPolar[linecolor=blue, plotpoints=200]{3.141592654 7 mul 4 div}{3.141592654 8 mul 4 div}{cos(2*t)}%
}%
\end{pspicture}

%\ \only<handout:0| 1>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8a.pdf}%
%}%
%\only<handout:0| 2>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8b.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8c.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8d.pdf}%
%}%
%\only<handout:0| 5>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8e.pdf}%
%}%
%\only<handout:0| 6>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8f.pdf}%
%}%
%\only<handout:0| 7>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8g.pdf}%
%}%
%\only<handout:0| 8>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8h.pdf}%
%}%
%\only<9->{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8i.pdf}%
%}%
\column{.7\textwidth}
\psset{xunit=1cm, yunit=1cm, algebraic=true}
\begin{pspicture}(-0.7, -1.6)(6.55,1.6)

\tiny
\psframe*[linecolor=white](-0.7, -1.6)(6.55, 1.6)
\psaxes[arrows=<->, Dx=0.785398163, Dy=1, labels=none](0,0)(-0.5, -1.4)(6.4, 1.4)
\rput[r](-0.1,1.4){$r$}
\rput[t](6.48,-0.01){$\theta$}
\rput[r](-0.15,1){$1$}

\rput[t](! 1.570796327 2 div 1 mul -0.2){$\frac{\pi}4$}
\rput[t](! 1.570796327 2 div 2 mul -0.2){$\frac{\pi}2$}
\rput[t](! 1.570796327 2 div 3 mul -0.2){$\frac{3\pi}4$}
\rput[t](! 1.570796327 2 div 4 mul -0.2){$\pi$}
\rput[t](! 1.570796327 2 div 5 mul -0.2){$\frac{5\pi}4$}
\rput[t](! 1.570796327 2 div 6 mul -0.2){$\frac{3\pi}{2}$}
\rput[t](! 1.570796327 2 div 7 mul -0.2){$\frac{7\pi}{2}$}
\rput[t](! 1.570796327 2 div 8 mul -0.2){$2\pi$}

\rput[l](3.4, 1){$r=\cos (2\theta)$}
\psplot[linecolor=blue, plotpoints=1000]{0.000000}{6.283185}{cos(2*x)}
\uncover<2>{
\plotSection{1}
}
\uncover<3>{
\plotSection{2}
}
\uncover<4>{
\plotSection{3}
}
\uncover<5>{
\plotSection{4}
}
\uncover<6>{
\plotSection{5}
}
\uncover<7>{
\plotSection{6}
}
\uncover<8>{
\plotSection{7}
}
\uncover<9>{
\plotSection{8}
}
\end{pspicture}
\uncover<1-10>{}
%\ \only<handout:0| 1>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8helpera.pdf}%
%}%
%\only<handout:0| 2>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8helperb.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8helperc.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8helperd.pdf}%
%}%
%\only<handout:0| 5>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8helpere.pdf}%
%}%
%\only<handout:0| 6>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8helperf.pdf}%
%}%
%\only<handout:0| 7>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8helperg.pdf}%
%}%
%\only<handout:0| 8>{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8helperh.pdf}%
%}%
%\only<9->{%
%\includegraphics[height=3.6cm]{polar-curves/pictures/11-03-ex8helperi.pdf}%
%}%
\end{columns}
\end{example}
\end{frame}
% end module polar-curve-ex8



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-symmetry.tex
% begin module polar-symmetry
\begin{frame}
\frametitle{Symmetry}
\begin{itemize}
\item<1-| alert@2>  If the polar equation is unchanged when $\theta$ is replaced by $-\theta$, the curve is symmetric about the polar axis.
\item<1-| alert@3>  If the equation is unchanged when $\theta$ is replaced by $\pi + \theta$, the curve is symmetric under rotation about the pole.
\item<1-| alert@4>  If the equation is unchanged when $\theta$ is replaced by $\pi - \theta$, the curve is symmetric about the vertical line $\theta = \frac{\pi}{2}$.
\end{itemize}
\begin{center}
\psset{xunit=0.65cm, yunit=0.65cm, algebraic=true}%
\begin{pspicture}(-3.4, -3.4)(3.4,3.4)
\tiny
\psaxes[labels=none, ticks=none, arrows=<->](0,0)(-3.3, -3.3)(3.3, 3.3)%
\uncover<2>{%
\fcDrawPolar[linecolor=red, plotpoints=1000]{0}{6.28319}{2+cos(3*t)}%
\fcAngle[linecolor=\fcColorGraph, arrows=->] {0}{1.047197551}{0.6}{$\theta$}%
\psline[linecolor=blue](0,0)(0.500000, 0.866025)
\fcFullDot{0.500000}{0.866025}%
\rput[bl](0.6, 1){$(r, \theta)$}%
\fcAngle[linecolor=\fcColorGraph, arrows=->] {0}{-1.047197551}{0.8}{$-\theta$}%
\psline[linecolor=blue](0,0)(0.500000, -0.866025)
\fcFullDot{0.500000}{-0.866025} %
\rput[tl](0.6, -1){$(r, -\theta)$}%
}%
\uncover<3>{%
\fcDrawPolar[linecolor=red, plotpoints=1000] {0}{6.28319}{2+cos(2*t-0.5)}%
\fcAngle[linecolor=\fcColorGraph, arrows=->] {0}{1.047197551}{0.8}{$\theta$}%
\psline[linecolor=blue](0,0)(0.988202, 1.711616)
\fcFullDot{0.988202}{1.711616}%
\rput[b](1, 1.8){$(r, \theta)$}%
\fcAngle[linecolor=\fcColorGraph, arrows=->] {0}{4.188790205}{0.6}{$\pi+\theta$}%
\psline[linecolor=blue](0,0)(-0.988202, -1.711616)
\fcFullDot{-0.988202}{-1.711616}%
\rput[t](-1, -1.8){$(-r, \theta)$}%
}%
\uncover<4>{%
\fcDrawPolar[linecolor=red, plotpoints=1000]{0}{6.28319}{2+sin(5*t)}%
\fcAngle[linecolor=\fcColorGraph, arrows=->] {0}{0.523598776}{0.8}{$\theta$}%
\psline[linecolor=blue](0,0)(2.165064, 1.250000)
\fcFullDot{2.165064}{1.250000}%
\rput[b](2.1, 1.3){$(r, \theta)$}%
\fcAngle[linecolor=\fcColorGraph, arrows=->] {0}{2.617993878}{0.5}{$\pi-\theta$}%
\psline[linecolor=blue](0,0)(-2.165064, 1.250000)
\fcFullDot{-2.165064}{1.250000}%
\rput[b](-2.1, 1.3){$(r,\pi- \theta)$}%
}%
\end{pspicture}
%\ \only<handout:1| -2>{%
%\uncover<2>{%
%\ \includegraphics[height=3cm]{polar-curves/pictures/11-03-symmetrya.pdf}%
%}}%
%\only<handout:2| 3>{%
%\ \includegraphics[height=3cm]{polar-curves/pictures/11-03-symmetryb.pdf}%
%}%
%\only<handout:3| 4->{%
%\ \includegraphics[height=3cm]{polar-curves/pictures/11-03-symmetryc.pdf}%
%}
\end{center}
\end{frame}
% end module polar-symmetry



}% end lecture

% begin lecture
\lect{Spring 2015}{Lecture 16}{16}{
\section{Tangents to Curves}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/parametric-tangents-definition.tex
% begin module parametric-tangents-intro-version2
\begin{frame}
\frametitle{Tangents}
Let $C $ be the curve $C:\left|\begin{array}{rcl}x&=&f(t)\\y&=&g(t)\end{array} \right., t\in [a,b]$.
\begin{definition}
Suppose \alert<4,5>{ $f'(t)$ and $g'(t)$ are not simultaneously equal to $0$.} 
\begin{itemize}
\item  We define $(f'(t), g'(t))$ to be the \emph{tangent vector} to $C$ at $t$.
\item<2->  We define the line passing through $(f(t), g(t))$ with direction vector equal to the tangent vector to be \emph{tangent line} to $C$ at $t$. In other words, the tangent line has equation
\[
(x-f(t))g'(t) =(y-g(t))f'(t)\quad .
\]
\item<3->  We say that the tangent to $C$ at $t$ is vertical if $f'(t)=0$ (\alert<4>{and therefore $g'(t)\neq 0$}).
\end{itemize}
\end{definition}
\uncover<5->{\alert<5->{Note.} When $f'(t)=g'(t)=0$, for curves $C$ with additional properties, natural definition(s) of tangent(s) do exist but are beyond Calc II.}
\end{frame}
\begin{frame}
\begin{example}

\end{example}
\end{frame}

\begin{frame}
Recall $C:\left|\begin{array}{rcl}x&=&\only<1>{f}\only<2->{\alert<2>{x}}(t)\\y&=& \only<1>{g}\only<2->{\alert<2>{y}}(t)\end{array} \right., t\in [a,b]$, tangent vector at $t$ is $(\only<1>{f}\only<2->{\alert<2>{x}}'(t), \only<1>{g}\only<2->{\alert<2>{y}}'(t))$. \uncover<2->{We write informally $\alert<2>{x=x(t)}, \alert<2>{y=y(t)}$ to simplify notation.}

\begin{itemize}
\item<3-> Suppose we could eliminate the parameter $t$ and write $y=F(x)$ for some function $F$ near the point $(x,y)=(x(t), y(t))$. 
\item<4-> Suppose in $x'(t)\neq 0$ for some $t$. 
\uncover<5->{
\[
\begin{array}{rcll|l}
\displaystyle y&=&\displaystyle  F(x) &&\text{apply } \frac{\diff }{\diff t}\\
\displaystyle \frac{\diff y}{\diff t}&=&\displaystyle \frac{\diff} {\diff t} \left(F(x)\right)&&\text{use chain rule}\\
&=&\displaystyle  \frac{\diff F}{\diff x} \frac{\diff x}{\diff t}=\frac{\diff y}{\diff  x} \frac{\diff x}{\diff t} &&\text{divide by } x'(t)\\
\displaystyle \frac{\diff y}{\diff x} &=&\displaystyle  \frac{\frac{\diff y}{\diff t} }{\frac{\diff x}{\diff t}}
\end{array}
\] 
}
\end{itemize}
\begin{observation}
If $\frac{\diff x}{\diff t}\neq 0$, we have $\displaystyle \frac{ \diff y}{ \diff x}= \frac{\frac{\diff y}{\diff t}}{\frac{\diff x}{\diff t}}\quad .
$
\end{observation}
\end{frame}
% begin module parametric-tangents-intro-version2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/parametric-tangents-ex1.tex
% begin module parametric-tangents-ex1
\begin{frame}[t]
\begin{example}
\begin{columns}
\column{0.25\textwidth}
\psset{xunit=0.4cm, yunit=0.4cm}
\begin{pspicture}(-0.9, -2.4)(4.4,2.499997)
\tiny
\fcAxesStandard{-0.650000}{-2.150000}{4.150000}{2.149997}
%Calculator input: plotCurve{}(t^{2}, t^{3}-3 t, -2, 2)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-2}{2}{t 2.0000000 exp t -3.0000000 mul t 3.0000000 exp add }
\end{pspicture}
\column{0.75\textwidth}
A curve $C$ is defined by $x = t^2, y = t^3 - 3t$.
\end{columns}
\begin{enumerate}
\item Show $C$ traverses $(x,y)=(3,0)$ for two values of $t$; find the tangent slopes for both of these values.
\item Find the points on $C$ where the tangents are horizontal or vertical.
\item Find two intervals where we can write $y$ as a function of $x$.
\item Determine concavity intervals of the functions found in item 3.
\end{enumerate}
\end{example}
\vspace{4cm}
\end{frame}




\begin{frame}[t]
\begin{example}
\begin{columns}
\column{0.25\textwidth}
\psset{xunit=0.4cm, yunit=0.4cm}
\begin{pspicture}(-0.9, -2.4)(4.4,2.499997)
\tiny%
\fcAxesStandard{-0.650000}{-2.150000}{4.150000}{2.149997}%
%Calculator input: plotCurve{}(t^{2}, t^{3}-3 t, -2, 2)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-2}{2}{t 2.0000000 exp t -3.0000000 mul t 3.0000000 exp add }%
\fcFullDotBlue{3}{0}%
\uncover<15->{%
\psline[linecolor=\fcColorTangent](2,1.732050808)(4,-1.732050808)%
\psline[linecolor=\fcColorTangent](2,-1.732050808)(4,1.732050808)%
}%
\end{pspicture}
\column{0.75\textwidth}
A curve $C$ is defined by \alert<handout:0| 2>{$x = t^2, y = t^3 - 3t$}.
\end{columns}
\begin{enumerate}
\item Show $C$ traverses $(x,y)=(3,0)$ for two values of $t$; find the tangent slopes for both of these values.
\end{enumerate}
\begin{itemize}
\item<2-| alert@3-4>  $3 = \alert<handout:0| 2>{x = t^2}$ \ if \ $t = $ \uncover<4->{$\pm \sqrt{3}$.}
\item<2-| alert@5-6>  $0 = \alert<handout:0| 2>{y = t^3 - 3t} = t(t^2-3)$\  if \ $t = $ \uncover<6->{$0$\  or\  $\pm \sqrt{3}$.}
\item<7->  Therefore the point $(3,0)$ is traversed when $t$ equals $\sqrt{3}$ or $-\sqrt{3}$.
\item<8-> $ \uncover<8->{ \frac{\diff y}{\diff x} = \frac{\alert<handout:0| 9-10>{\diff y / \diff t}}{\alert<handout:0| 11-12>{\diff x / \diff t}} %
} \uncover<9->{= \frac{\alert<handout:0| 10>{\uncover<10->{3t^2-3 }}}{\alert<handout:0| 12>{\uncover<12->{2t }}}}$\uncover<12->{\quad .}
\item<13->
Plug in $t = \pm \sqrt{3}$:
$\displaystyle
\uncover<13->{%
\frac{\diff y}{\diff x} _{|t = \pm \sqrt{3}} = \frac{3(\pm \sqrt{3})^2 - 3}{2(\pm \sqrt{3})} = %
}%
\uncover<14->{%
\pm \frac{6}{2\sqrt{3}} = \pm \sqrt{3}%
}%
$
\uncover<15->{%
Therefore the tangents at $(3,0)$ have slopes $\pm \sqrt{3}$.
}%
\end{itemize}
\end{example}
\vspace{4cm}
\end{frame}

\begin{frame}[t]
\begin{example}
\begin{columns}
\column{0.25\textwidth}
\psset{xunit=0.4cm, yunit=0.4cm}
\begin{pspicture}(-0.9, -2.4)(4.4,2.499997)
\tiny
\fcAxesStandard{-0.650000}{-2.150000}{4.150000}{2.149997}
%Calculator input: plotCurve{}(t^{2}, t^{3}-3 t, -2, 2)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-2}{2}{t 2.0000000 exp t -3.0000000 mul t 3.0000000 exp add }
\uncover<6->{%
\fcFullDotBlue{1}{2}
\fcFullDotBlue{1}{-2}
\psline[linecolor=\fcColorTangent](0.1,2)(1.9,2)
\psline[linecolor=\fcColorTangent](0.1,-2)(1.9,-2)
}%
\uncover<10->{%
\fcFullDotBlue{0}{0}
\psline[linecolor=\fcColorTangent](0,-1)(0,1)
}%
\end{pspicture}
\column{0.75\textwidth}
A curve $C$ is defined by $x = t^2, y = t^3 - 3t$.
\end{columns}
\begin{enumerate}
\setcounter{enumi}{1}
%\item  Show that $C$ has two tangents at $(3,0)$ and find their slopes.
\item  Find the points on $C$ where the tangents are horizontal or vertical.
%\item  Determine where the curve is concave up or down.
\end{enumerate}
\begin{columns}[t]
\column{.5\textwidth}
Horizontal tangent:
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\frac{\diff y}{\diff t} & = & 0\\
\uncover<2->{%
3t^2 - 3%
}%
& \uncover<2->{ = } & %
\uncover<2->{%
0
}\\%
\uncover<3->{%
3(t^2 - 1)%
}%
& \uncover<3->{ = } & %
\uncover<3->{%
0
}\\%
\uncover<4->{%
t%
}%
& \uncover<4->{ = } & %
\uncover<4->{%
\pm 1%
}%
\end{eqnarray*}
\uncover<5->{$\frac{\diff x}{\diff t} \neq 0$ when $t = \pm 1$, so there are horizontal tangents when $t = \pm 1$.}

\uncover<6->{%
The points are $(1, 2)$ and $(1, -2)$.
}%
\column{.5\textwidth}
Vertical tangent:
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\frac{\diff x}{\diff t} & = & 0\\
\uncover<7->{%
2t%
}%
& \uncover<7->{ = } & %
\uncover<7->{%
0%
}\\%
\uncover<8->{%
t%
}%
& \uncover<8->{ = } & %
\uncover<8->{%
0%
}%
\end{eqnarray*}
\uncover<9->{$\frac{\diff y}{\diff t} \neq 0$ when $t =  0$, so there is a vertical tangent when $t = 0$.}

\uncover<10->{%
The points is $(0,0)$.
}%
\end{columns}
\end{example}
\vspace{4cm}
\end{frame}



\begin{frame}[t]
\begin{example} %[Example 1, p. 667]
\begin{columns}
\column{0.25\textwidth}
\psset{xunit=0.4cm, yunit=0.4cm}
\begin{pspicture}(-0.9, -2.4)(4.4,2.499997)
\tiny
\fcAxesStandard{-0.650000}{-2.150000}{4.150000}{2.149997}
\uncover<1-4,6->{%
%Calculator input: plotCurve{}(t^{2}, t^{3}-3 t, -2, 2)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-2}{0}{t 2.0000000 exp t -3.0000000 mul t 3.0000000 exp add }%
}%
\uncover<1-5>{%
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{0}{2}{t 2.0000000 exp t -3.0000000 mul t 3.0000000 exp add }%
}%
\end{pspicture}
\column{0.75\textwidth}
A curve $C$ is defined by $x = t^2, y = t^3 - 3t$.
\end{columns}
\begin{enumerate}
\setcounter{enumi}{2}
%\item  Show that $C$ has two tangents at $(3,0)$ and find their slopes.
%\item  Find the points on $C$ where the tangents are horizontal or vertical.
\item  Find two intervals where we can write $y$ as a function of $x$.
\end{enumerate}
\uncover<2->{From $x=t^2$ we have that $t=\pm \sqrt{x}$.} \uncover<3->{Therefore, when $t>0$, we have that $t=\sqrt{x}$.} \uncover<4->{Since that determines uniquely $t$ via $x$, this means that for $t>0$  $y$ is a function of $x$.} \uncover<5->{In other words, for $t>0$, the curve satisfies the vertical line test. } \uncover<6->{Similarly we conclude that when $t<0$, $y$ is a function of $x$.}
\end{example}
\vspace{5cm}
\end{frame}

\begin{frame}[t]
\begin{example} %[Example 1, p. 667]
\begin{columns}
\column{0.25\textwidth}
\psset{xunit=0.4cm, yunit=0.4cm}
\begin{pspicture}(-0.9, -2.4)(4.4,2.499997)
\tiny
\fcAxesStandard{-0.650000}{-2.150000}{4.150000}{2.149997}
\uncover<1-11,13->{%
%Calculator input: plotCurve{}(t^{2}, t^{3}-3 t, -2, 2)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-2}{0}{t 2.0000000 exp t -3.0000000 mul t 3.0000000 exp add }%
}%
\uncover<1-12>{%
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{0}{2}{t 2.0000000 exp t -3.0000000 mul t 3.0000000 exp add }%
}%
\end{pspicture}
\column{0.75\textwidth}
A curve $C$ is defined by $x = t^2, y = t^3 - 3t$.
\end{columns}
\begin{enumerate}
\setcounter{enumi}{3}
\item  Determine the concavity intervals of the functions found in item 3.
\end{enumerate}
\uncover<2->{Find the second derivative:}%

$\begin{array}{rcl}
\displaystyle \uncover<2->{%
\frac{\diff^2 y}{\diff x^2}%
}%
& \uncover<2->{ = } &%
\displaystyle \uncover<2->{%
\frac{\frac{\diff}{\diff t}\left( \alert<handout:0| 3-4>{\frac{\diff y}{\diff x}}\right)}{\alert<handout:0| 5-6>{\frac{\diff x}{\diff t}}}%
}  \uncover<3->{ = }  \uncover<3->{%
\frac{\frac{\diff}{\diff t}\left( \alert<handout:0| 3-4,7>{\uncover<4->{\frac{3t^2-3}{2t}}}\right)}{\alert<handout:0| 5-6>{\uncover<6->{2t}}}%
}\\%
& \uncover<7->{ = } &\displaystyle
\uncover<7->{%
\frac{\alert<handout:0| 8-9>{\frac{\diff}{\diff t}\left( \alert<handout:0| 7>{\frac{3}{2}\left( t - \frac{1}{t}\right)}\right)}}{2t}%
}  \uncover<8->{ = }  \uncover<8->{%
\frac{\alert<handout:0| 8-9>{\uncover<9->{\frac{3}{2} + \frac{3}{2t^2} }}}{2t}%
}\\%
& \uncover<10->{ = } &\displaystyle
\uncover<10->{%
\frac{\frac{3t^2 + 3}{2t^2}}{2t}%
}  \uncover<11->{ = } \uncover<11->{%
\frac{3(t^2 + 1)}{4t^3}%
}%
\end{array}
$

\uncover<12->{%
Therefore $y$ as a function of $x$ (which is a function of $t$) is concave up when $t > 0$}\uncover<13->{ and concave down when $t < 0$.}%
\end{example}
\vspace{4cm}
\end{frame}
% end module parametric-tangents-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/cycloid-tangents-ex2.tex
% begin module cycloid-tangents-ex2
\begin{frame}[t]
\begin{example} %[Example 2, p. 667]
Consider the cycloid $x = r(\theta - \sin \theta )$, $y = r(1 - \cos \theta )$.
\psset{xunit=0.43cm, yunit=0.43cm}
\begin{pspicture}(-6.683185, -0.900000)(20.5,2.6500000)
\tiny
\fcAxesStandard{-6.433185}{-0.650000}{20.5}{2.550000}

\fcYTickWithLabel{2}{$2r$}
\fcXTickWithLabel{6.283185307}{$2\pi r$}
\fcXTickWithLabel{12.566370614}{$4\pi r$}
\fcXTickWithLabel{18.849555922}{$6\pi r$}
%Calculator input: plotCurve{}(- \sin{}t+t, - \cos{}t+1, -2 \pi, 6 \pi+1)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-6.28319}{20.9}{t t 57.29578 mul sin -1.0000000 mul add 1.0000000 t 57.29578 mul cos -1.0000000 mul add }
\end{pspicture}
\begin{enumerate}
\item  At what points is the tangent horizontal?
\item  At what points is the tangent vertical?
\end{enumerate}
\end{example}
\end{frame}


\begin{frame}[t]
\begin{example} %[Example 2, p. 667]
Consider the cycloid \alert<handout:0| 5-6>{$x = r(\theta - \sin \theta )$}, \alert<handout:0| 3-4>{$y = r(1 - \cos \theta )$}.
\psset{xunit=0.43cm, yunit=0.43cm}
\begin{pspicture}(-6.683185, -0.900000)(20.5,2.6500000)
\tiny
\fcAxesStandard{-6.433185}{-0.650000}{20.5}{2.550000}

\fcYTickWithLabel{2}{$2r$}
\fcXTickWithLabel{6.283185307}{$2\pi r$}
\fcXTickWithLabel{12.566370614}{$4\pi r$}
\fcXTickWithLabel{18.849555922}{$6\pi r$}
%Calculator input: plotCurve{}(- \sin{}t+t, - \cos{}t+1, -2 \pi, 6 \pi+1)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-6.28319}{20.9}{t t 57.29578 mul sin -1.0000000 mul add 1.0000000 t 57.29578 mul cos -1.0000000 mul add }
\uncover<14->{%
\fcFullDotBlue{3.141592654}{2}
\psline[linecolor=\fcColorTangent](1.141592654, 2)(5.141592654,2)
\fcFullDotBlue{-3.141592654}{2}
\psline[linecolor=\fcColorTangent](-1.141592654, 2)(-5.141592654,2)
\fcFullDotBlue{9.424777961}{2}
\psline[linecolor=\fcColorTangent](7.424777961, 2)(11.424777961,2)
\fcFullDotBlue{15.707963268}{2}
\psline[linecolor=\fcColorTangent](13.707963268, 2)(17.707963268,2)
}%
\end{pspicture}

%\ \only<handout:0| -13>{%
%\includegraphics[height=1.5cm]{parametric-curves/pictures/11-02-ex2a.pdf}%
%}%
%\only<14->{%
%\includegraphics[height=1.5cm]{parametric-curves/pictures/11-02-ex2b.pdf}%
%}%
\begin{enumerate}
\item  At what points is the tangent horizontal?
%\item  At what points is the tangent vertical?
\end{enumerate}
\begin{itemize}
\item<2->  The slope of the tangent is $
\uncover<2->{%
\frac{\diff y}{\diff x} = \frac{\alert<handout:0| 3-4>{\diff y /\diff \theta}}{\alert<handout:0| 5-6>{\diff x/\diff \theta}}%
}%
\uncover<3->{%
 = \frac{\alert<handout:0| 3-4>{\uncover<4->{r\sin \theta}}}{\alert<handout:0| 5-6>{\uncover<6->{r(1-\cos \theta )}}}%
}%
\uncover<7->{%
 = \frac{\sin \theta}{1-\cos \theta}%
}%
$
\item<8->  The tangent is horizontal when $\diff y/\diff x = 0$, that is, when $\diff y/\diff \theta = 0$ and $\diff x/\diff \theta \neq 0$.
\item<9-| alert@10-11>  $r\sin\theta = \diff y/\diff \theta = 0$ if $\theta = $ \uncover<11->{$n\pi$, where $n$ is any integer.}
\item<9-| alert@12-13>  $r(1 - \cos\theta ) = \diff x/\diff \theta = 0$ if $\theta = $ \uncover<13->{$2n\pi$, where $n$ is any integer.}
\item<14->  Therefore there is a horizontal tangent when $\theta = (2n+1)\pi$.
\end{itemize}
\end{example}
\end{frame}



\begin{frame}[t]
\begin{example} %[Example 2, p. 667]
Consider the cycloid $x = r(\theta - \sin \theta )$, $y = r(1 - \cos \theta )$.
\psset{xunit=0.43cm, yunit=0.43cm}
\begin{pspicture}(-6.683185, -0.900000)(20.5,2.6500000)
\tiny
\fcAxesStandard{-6.433185}{-0.650000}{20.5}{2.550000}

\fcYTickWithLabel{2}{$2r$}
\fcXTickWithLabel{6.283185307}{$2\pi r$}
\fcXTickWithLabel{12.566370614}{$4\pi r$}
\fcXTickWithLabel{18.849555922}{$6\pi r$}
%Calculator input: plotCurve{}(- \sin{}t+t, - \cos{}t+1, -2 \pi, 6 \pi+1)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-6.28319}{20.9}{t t 57.29578 mul sin -1.0000000 mul add 1.0000000 t 57.29578 mul cos -1.0000000 mul add }
\uncover<15->{%
\fcFullDotBlue{0}{0}%
\fcFullDotBlue{6.283185307}{0}%
\fcFullDotBlue{12.566370614}{0}%
\fcFullDotBlue{18.849555922}{0}%
\psline[linecolor=\fcColorTangent](0,-0.6)(0,1.2)
\psline[linecolor=\fcColorTangent](6.283185307,-0.6)(6.283185307,1.2)
\psline[linecolor=\fcColorTangent](12.566370614,-0.6)(12.566370614,1.2)
\psline[linecolor=\fcColorTangent](18.849555922,-0.6)(18.849555922,1.2)
}
\end{pspicture}

%\ \only<handout:0| -14>{%
%\includegraphics[height=1.5cm]{parametric-curves/pictures/11-02-ex2a.pdf}%
%}%
%\only<15->{%
%\includegraphics[height=1.5cm]{parametric-curves/pictures/11-02-ex2c.pdf}%
%}%
\begin{enumerate}
\setcounter{enumi}{1}
%\item  At what points is the tangent horizontal?
\item  At what points is the tangent vertical?
\end{enumerate}
\begin{itemize}
\item<2->  When $\theta = 2n\pi$ both $\diff y/\diff \theta$ and $\diff x/\diff \theta$ are $0$.
\item<3->  To see if there is a vertical tangent, \alert<handout:0| 5-8>{use L'Hospital's Rule}.
%\abovedisplayskip=0pt
%\belowdisplayskip=0pt
$\displaystyle
\uncover<4->{%
\lim_{\theta\to 2n\pi^+} \frac{\diff y}{\diff x} = \lim_{\theta\to 2n\pi^+} \frac{\alert<handout:0| 5-6>{\sin \theta}}{\alert<handout:0| 7-8>{1-\cos \theta}}%
}%
\uncover<5->{%
 = \lim_{\theta\to 2n\pi^+} \frac{\alert<handout:0| 5-6,9-10>{\uncover<6->{\cos \theta}}}{\alert<handout:0| 7-8,11-12>{\uncover<8->{\sin \theta}}}%
}%
\uncover<9->{%
{%
\uncover<9->{\alert<handout:0| 9-10>{\to}} \atop%
\uncover<11->{\alert<handout:0| 11-12>{\to}} }%
\frac{\uncover<10->{\alert<handout:0| 9-10>{1}}}{\uncover<12->{\alert<handout:0| 11-12>{0^+}}} %
}%
$
\item<13->  Therefore $\lim_{\theta\to 2n\pi^+} (\diff y/\diff x) = \infty$.
\item<14->  A similar argument shows $\lim_{\theta\to 2n\pi^-} (\diff y/\diff x) = -\infty$.
\item<15->  Therefore there is a vertical tangent when $\theta = 2n\pi$.
\end{itemize}
\end{example}
\end{frame}
% end module cycloid-tangents-ex2



\subsection{Tangents to Polar Curves}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-tangents.tex
% begin module polar-tangents
\begin{frame}
\frametitle{Tangents to Polar Curves}
To find the tangent line to a polar curve \alert<handout:0| 9>{$r = f(\theta )$}, regard $\theta$ as a parameter and write the parametric equations as
\[
\alert<handout:0| 4>{x = r\cos \theta = f(\theta )\cos \theta \qquad y = r\sin\theta = f(\theta )\sin\theta}%
\]
\uncover<2->{Then use the formula for the slope of a parametric curve:}
\begin{eqnarray*}
\uncover<2->{%
\alert<handout:0| 2-3>{\frac{\diff y}{\diff x}}%
}%
& \uncover<2->{\alert<handout:0| 2-3>{ = }} &%
\uncover<3->{%
\alert<handout:0| 3>{\frac{\frac{\diff \alert<handout:0| 4>{y}}{\diff \theta}}{\frac{\diff \alert<handout:0| 4>{x}}{\diff \theta}}}%
}\\%
& \uncover<4->{ = } &%
\uncover<4->{%
\frac{\alert<handout:0| 5-6>{\frac{\diff }{\diff \theta}\alert<handout:0| 4>{\left( f(\theta )\sin \theta\right)}}}{\alert<handout:0| 7-8>{\frac{\diff }{\diff \theta}\alert<handout:0| 4>{\left( f(\theta ) \cos\theta\right)}}}%
}\\%
& \uncover<5->{ = } &%
\uncover<5->{%
\frac{\uncover<6->{\alert<handout:0| 6>{\alert<handout:0| 9>{f'(\theta )}\sin\theta + \alert<handout:0| 9>{f(\theta )}\cos \theta }}}{\uncover<8->{\alert<handout:0| 8>{\alert<handout:0| 9>{f'(\theta )}\cos\theta + \alert<handout:0| 9>{f(\theta )}(-\sin\theta ) }}}
}\\%
& \uncover<9->{ = } &%
\uncover<9->{%
\frac{\alert<handout:0| 9>{\frac{\diff r}{\diff \theta}}\sin\theta + \alert<handout:0| 9>{r}\cos \theta }{\alert<handout:0| 9>{\frac{\diff r}{\diff \theta}}\cos\theta - \alert<handout:0| 9>{r}\sin\theta }
}%
\end{eqnarray*}
\end{frame}
% end module polar-tangents



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/cardioid-tangents-ex9.tex
% begin module cardioid-tangents-ex9
\begin{frame}
\begin{example} %[Example 9, p. 681]
Find the points on \alert<handout:0| 3-6>{$r = 1+\sin\theta$} where the tangent is horizontal or vertical.
\begin{columns}[c]
\column{.4\textwidth}
\psset{xunit=1.2cm, yunit=1.2cm}
\begin{pspicture}(-2.2, -0.900000)(2.2,2.6)
\tiny
\fcAxesStandard{-2.1}{-0.650000}{2.1}{2.4}
%Calculator command: drawPolar{}(\sin{}t+1, 0, 2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000, algebraic=false]{0}{6.28319}{1.0000000 t 57.29578 mul sin add t 57.29578 mul cos mul 1.0000000 t 57.29578 mul sin add t 57.29578 mul sin mul }

\uncover<15->{%
\fcFullDotBlue{1.299038}{0.75}
\psline[linecolor=\fcColorTangent](1.299038,0.35)(1.299038,1.15)
\rput[l](1.35, 0.75){$\left(\frac{3}{2},\frac{\pi}{6}\right)$}
}%
\uncover<14->{%
\fcFullDotBlue{0}{2}
\psline[linecolor=\fcColorTangent](-0.4,2)(0.4,2)
\rput[bl](0.05,2.05){$\left(2,\frac{\pi}{2}\right)$}
}%
\uncover<15->{%
\fcFullDotBlue{-1.299038}{0.75}
\psline[linecolor=\fcColorTangent](-1.299038,0.35)(-1.299038,1.15)
\rput[r](-1.35,0.75){$\left(\frac{3}{2},\frac{5\pi}{6}\right)$}
}%
\uncover<14->{%
\fcFullDotBlue{-0.433013}{-0.25}
\psline[linecolor=\fcColorTangent](-0.033013,-0.25)(-0.833013,-0.25)
\rput[t](-0.433013,-0.3){$\left(\frac{1}{2},\frac{7\pi}{6}\right)$}
}
\uncover<22->{%
\fcFullDotBlue{0}{0}
\psline[linecolor=\fcColorTangent](0,-0.4)(0,0.4)
\rput[bl](0.05,0.05){$\left(0,\frac{3\pi}{2}\right)$}
}%
\uncover<14->{%
\fcFullDotBlue{0.433013}{-0.25}
\psline[linecolor=\fcColorTangent](0.033013,-0.25)(0.833013,-0.25)
\rput[t](0.433013,-0.3){$\left(\frac{1}{2},\frac{11\pi}{6}\right)$}
}%
\end{pspicture}

%\ \only<handout:0| -13>{%
%\includegraphics[height=4cm]{polar-curves/pictures/11-03-tangenta.pdf}%
%}%
%\only<handout:0| 14>{%
%\includegraphics[height=4cm]{polar-curves/pictures/11-03-tangentb.pdf}%
%}%
%\only<handout:0| 15>{%
%\includegraphics[height=4cm]{polar-curves/pictures/11-03-tangentc.pdf}%
%}%
%\only<handout:0| 16-21>{%
%\includegraphics[height=4cm]{polar-curves/pictures/11-03-tangentd.pdf}%
%}%
%\only<22->{%
%\includegraphics[height=4cm]{polar-curves/pictures/11-03-tangente.pdf}%
%}%
\column{.62\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\begin{array}{r@{\ }c@{\ }l}
\uncover<2->{%
\frac{\diff y}{\diff x} %
}%
&\uncover<2->{ = } & %
\uncover<2->{\frac{\alert<handout:0| 5-6>{\frac{\diff r}{\diff\theta}}\sin \theta + \alert<handout:0| 3-4>{r}\cos \theta}{\alert<handout:0| 5-6>{\frac{\diff r}{\diff \theta}}\cos \theta - \alert<handout:0| 3-4>{r}\sin \theta}}%
\uncover<3->{ = \frac{\uncover<6->{\alert<handout:0| 6>{\cos\theta }}\sin\theta + \uncover<4->{\alert<handout:0| 4>{(1+\sin\theta )}}\cos\theta}{\uncover<6->{\alert<handout:0| 6>{\cos\theta }}\cos \theta - \uncover<4->{\alert<handout:0| 4>{(1+\sin \theta )}}\sin\theta}}\\%
&\uncover<7->{ = } & %
\uncover<7->{\frac{\cos\theta (1+2\sin \theta )}{1 - 2\sin^2\theta - \sin\theta}}%
\uncover<8->{ = \frac{\cos\theta (1+2\sin\theta)}{(1+\sin\theta )(1-2\sin\theta )}}%
\end{array}
\]
\begin{itemize}
\item<9->  $\cos\theta (1+2\sin \theta ) = 0$ \\
 when \alert<handout:0| 10-11>{$\theta =$ \uncover<11->{$\alert<handout:0| 14>{\frac{\pi}{2}}, \alert<handout:0| 16>{\frac{3\pi}{2}}, \alert<handout:0| 14>{\frac{7\pi}{6}}, \alert<handout:0| 14>{\frac{11\pi}{6}}$.}}%
\item<9->  $(1+\sin \theta ) (1-2\sin \theta ) = 0$ \\
 when \alert<handout:0| 12-13>{$\theta = $ \uncover<13->{$\alert<handout:0| 16>{\frac{3\pi}{2}}, \alert<handout:0| 15>{\frac{\pi}{6}}, \alert<handout:0| 15>{\frac{5\pi}{6}}$.}}%
\end{itemize}
\end{columns}
\begin{itemize}
\item<14->  Horizontal tangents at $(2,\alert<handout:0| 14>{\pi /2})$, $(1/2, \alert<handout:0| 14>{7\pi /6})$, and $(1/2, \alert<handout:0| 14>{11\pi /6})$.
\item<15->  Vertical tangents at $(3/2,\alert<handout:0| 15>{\pi /6})$, and $(3/2, \alert<handout:0| 15>{5\pi /6})$.
\item<16->  If \alert<handout:0| 16>{$\theta = 3\pi /2$}, top and bottom are both $0$, so \alert<handout:0| 20-21>{use L'Hospital's Rule}.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\begin{array}{l}
\uncover<17->{{\displaystyle \lim_{\theta\to 3\pi/2^-}}\frac{\diff y}{\diff x} = }%
\uncover<17->{ \alert<handout:0| 18-19>{{\displaystyle \lim_{\theta\to 3\pi/2^-}}\frac{1+2\sin\theta}{1-2\sin\theta}}\cdot %
 \alert<handout:0| 20-21>{{\displaystyle \lim_{\theta\to 3\pi/2^-}}\frac{\cos\theta}{1+\sin\theta}} }%
\uncover<18->{=} \uncover<19->{\alert<handout:0| 19>{-\frac{1}{3}}} \uncover<21->{\alert<handout:0| 21>{{\displaystyle \lim_{\theta\to 3\pi/2^-}}\frac{-\sin\theta}{\cos\theta}}} %
\uncover<22->{= \infty}
\end{array}
\]
\end{example}
\end{frame}
% end module cardioid-tangents-ex9



\section{Arc Length}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/arc-length/arc-length-intro.tex
% begin module arc-length-intro
\begin{frame}
\frametitle{Arc Length}
\begin{center}

\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-1, -1)(1,1)
\tiny %
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000, algebraic=true]{0}{6.283185307}{cos(t)|sin(t)}%
\uncover<3>{ %
\fcRegularNgon[linecolor=\fcColorTangent]{3}{1}%
}
\uncover<4>{ %
\fcRegularNgon[linecolor=\fcColorTangent]{4}{1}%
}
\uncover<5>{ %
\fcRegularNgon[linecolor=\fcColorTangent]{6}{1}%
}
\uncover<6>{ %
\fcRegularNgon[linecolor=\fcColorTangent]{8}{1}%
}
\uncover<7>{ %
\fcRegularNgon[linecolor=\fcColorTangent]{12}{1}%
}
\uncover<8>{ %
\fcRegularNgon[linecolor=\fcColorTangent]{16}{1}%
}
\uncover<9>{ %
\fcRegularNgon[linecolor=\fcColorTangent]{32}{1}%
}
\end{pspicture}

\uncover<1-9>{}
%\ \only<-2>{%
%\includegraphics[height=4cm]{arc-length/pictures/09-01-circlea.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[height=4cm]{arc-length/pictures/09-01-circleb.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[height=4cm]{arc-length/pictures/09-01-circlec.pdf}%
%}%
%\only<handout:0| 5>{%
%\includegraphics[height=4cm]{arc-length/pictures/09-01-circled.pdf}%
%}%
%\only<handout:0| 6>{%
%\includegraphics[height=4cm]{arc-length/pictures/09-01-circlee.pdf}%
%}%
%\only<handout:0| 7->{%
%\includegraphics[height=4cm]{arc-length/pictures/09-01-circlef.pdf}%
%}%
\end{center}
\begin{itemize}
\item  What do we mean by the length of a curve?
\item<2->  The length of a polygon is easy to compute: add up the length of the line segments that form the polygon.
\item<3->  If the curve is a circle, approximate it by a polygon.
\item<4->  Then take the limit as the number of segments of the polygon goes to $\infty$.
\end{itemize}
\end{frame}
% end module arc-length-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/arc-length/arc-length-derivation-parametric.tex
%begin module arc-length-derivation-parametric
{% scoping block for the following command:
%Calculator input: plotCurve{}(t, 8 t^{4}-40 t^{3}+70 t^{2}-50 t+13, 2/5, 2)
\newcommand{\theCurve}{t 13 t -50 mul add t 2 exp 70 mul add t 3 exp -40 mul add t 4 exp 8 mul add}
\newcommand{\lowBound}{0.4}
\newcommand{\highBound}{2}
\begin{frame}
Let $\gamma $ be the curve
$ \gamma: \left|
\begin{array}{rcl}
x=x(t)\\
y=y(t)
\end{array}, t\in [a,b]
\right.$

\begin{itemize}
\item<2->  Divide $[a,b]$ into $n$ subintervals with endpoints $t_0, t_1, \ldots , t_n$ and equal width $\Delta t$.
\item<3->  The points $P_i = (x(t_i), y(t_i))$ lie on the curve $\gamma$. The lengths of the segments with endpoints with consecutive indices from $P_0, P_1, \ldots , P_n$ approximate the length of the curve $\gamma$.
\item<4->  The length $L$ of the curve $\gamma$ is the limit of the lengths of these segments as $n\rightarrow \infty$.
\end{itemize}
\begin{columns}[c]
\column{.6\textwidth}
\begin{center}
\psset{xunit=1.4cm, yunit=1.4cm}
\begin{pspicture}(-0.4,-0.3)(2.3,1.994800)
\tiny
\fcAxesStandard{-0.3}{-0.3}{2.146803}{1.994800}
%\theCurve is defined in the beginning of this module, has limited scope
\parametricplot{\lowBound}{\highBound}{\theCurve}
\uncover<2-4>{%
\fcPolylineAlongCurveWithLabels[linecolor=\fcColorGraph]{3}{\lowBound}{\highBound}{\theCurve}{P}%
}
\uncover<5>{%
\fcPolylineAlongCurveWithLabels[linecolor=\fcColorGraph]{4}{\lowBound}{\highBound}{\theCurve}{P}%
}
\uncover<6>{%
\fcPolylineAlongCurveWithLabels[linecolor=\fcColorGraph]{5}{\lowBound}{\highBound}{\theCurve}{P}%
}
\uncover<7>{%
\fcPolylineAlongCurveWithLabels[linecolor=\fcColorGraph]{6}{\lowBound}{\highBound}{\theCurve}{P}%
}
\uncover<8>{%
\fcPolylineAlongCurveWithLabels[linecolor=\fcColorGraph]{10}{\lowBound}{\highBound}{\theCurve}{P}%
}
\uncover<9->{%0
\fcPolylineAlongCurveWithLabels[linecolor=\fcColorGraph]{14}{\lowBound}{\highBound}{\theCurve}{P}%
}
\end{pspicture}
%\ \only<handout:0| -1>{%
%\includegraphics[height=4.5cm]{arc-length/pictures/09-01-arclengtha.pdf}%
%}%
%\only<handout:0| 2-4>{%
%\includegraphics[height=4.5cm]{arc-length/pictures/09-01-arclengthb.pdf}%
%}%
%\only<handout:0| 5>{%
%\includegraphics[height=4.5cm]{arc-length/pictures/09-01-arclengthc.pdf}%
%}%
%\only<handout:0| 6>{%
%\includegraphics[height=4.5cm]{arc-length/pictures/09-01-arclengthd.pdf}%
%}%
%\only<handout:0| 7>{%
%\includegraphics[height=4.5cm]{arc-length/pictures/09-01-arclengthe.pdf}%
%}%
%\only<8>{%
%\includegraphics[height=4.5cm]{arc-length/pictures/09-01-arclengthf.pdf}%
%}%
%\only<handout:0| 9->{%
%\includegraphics[height=4.5cm]{arc-length/pictures/09-01-arclengthg.pdf}%
%}%
%\only<10->{%
%\includegraphics[height=4.5cm]{arc-length/pictures/09-01-arclengthh.pdf}%
%}%
\end{center}
\column{.4\textwidth}
\uncover<10->{%
\[
L = \lim_{n\rightarrow \infty} \sum_{i=1}^n |P_{i-1}P_i|
\]
}%
\end{columns}
\end{frame}



\begin{frame}
Let $\gamma $ be the curve
$ \gamma: \left|
\begin{array}{rcl}
x=x(t)\\
y=y(t)
\end{array}, t\in [a,b]
\right.$

$\begin{array}{rcl}
\uncover<1->{%
L = \lim_{n\rightarrow \infty} \sum_{i = 1}^n \alert<handout:0| 10>{|P_{i-1}P_i|}%
}%
& \uncover<10->{ = } &%
\uncover<10->{%
\alert<handout:0| 12>{\lim_{n\rightarrow\infty} \sum_{i=1}^n} \alert<handout:0| 10>{\sqrt{\alert<handout:0|13>{ (x'(s_i))^2}+\alert<handout:0| 13>{(y'(r_i))^2}}\ \alert<handout:0| 14>{\Delta t}}%
}\\%
& \uncover<11->{ = } &%
\uncover<11->{%
\alert<handout:0| 12>{\int_a^b} \sqrt{ \alert<handout:0| 13>{(x'(t))^2} +\alert<handout:0| 13>{(y'(t))^2}} \ \alert<handout:0| 14>{\diff t}%
}%
\end{array}
$
\begin{itemize}
\item If $f$ has continuous derivative, we can compute the above limit.
\item<2-> Let 
$\left|\begin{array}{r@{~}c@{~}l} 
x_i &=& x(t_i)\\ 
y_i &=& y(t_i)
\end{array}\right.$, 
and 
$\left|\begin{array}{rcl}
\Delta x &=& x_i - x_{i-1} = x(t_i) - x(t_{i-1})\\ 
\Delta y &=& y_i - y_{i-1} = y(t_i) - y(t_{i-1}) 
\end{array}\right. $.
\item<3-| alert@6> Then $|P_iP_{i-1}| = \sqrt{(\Delta x)^2 + (\Delta y)^2}$.
\item<4-> Mean Value Theorem: there exist numbers $s_i$ and $r_i$ between $t_{i-1}$ and $t_i$ such that $\alert<handout:0| 5>{x(t_i) - x(t_{i-1}) = x'(s_i )(t_i- t_{i-1})}$  and $\alert<handout:0| 5>{y(t_i) - y(t_{i-1}) = y'(r_i)( t_i-t_{i-1})}$
\item<5-| alert@5,7> $\Delta x = x'(s_i)\Delta t$, $\Delta y = y'(r_i)\Delta t$.
\end{itemize}
$\begin{array}{rcl}
\uncover<6->{%
\alert<handout:0| 10>{|P_{i-1}P_i|}%
}%
& \uncover<6->{\alert<handout:0| 10>{ = }} &%
\uncover<6->{%
\sqrt{(\alert<handout:0| 7>{\Delta x})^2 + (\alert<handout:0| 7>{\Delta y})^2}%
}  \uncover<7->{ = } \uncover<7->{%
\sqrt{ (\alert<handout:0| 7>{x'(s_i)\Delta t})^2 + (\alert<handout:0| 7>{y'(r_i)\Delta t})^2}%
}\\%
& \uncover<8->{ = } &%
\uncover<8->{%
\sqrt{(x'(s_i))^2 + (y'(r_i))^2}\sqrt{(\Delta t)^2}%
}  \uncover<9->{ = } \uncover<9->{%
\alert<handout:0| 10>{\sqrt{(x'(s_i))^2 + (y'(r_i))^2}\ \Delta t }%
}\\%
\end{array}
$
\end{frame}
}% end of scoping block
%end module arc-length-derivation-parametric



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/arc-length/arc-length-def-parametric.tex
% begin module arc-length-def
\begin{frame}
\frametitle{The Arc Length Formula}
Let $\gamma:\left|\begin{array}{rcl} x&=&x(t)\\ y&=&y(t)\end{array}  \right., t\in [a,b]$.


\begin{definition}
Suppose $x'(t)$ and $y'(t)$ (exist and) are continuous on $[a,b]$. Then the length of the curve $\gamma$ is defined as 
\[
\begin{array}{rclll}
\displaystyle L(\gamma) &=&\displaystyle  \int_a^b \sqrt{(x'(t))^2 +(y'(t))^2} ~ \diff t\\
\uncover<2->{&=& \displaystyle \int_a^b \sqrt{\left(\frac{\diff x}{\diff t}\right)^2 + \left( \frac{\diff y}{\diff t}\right)^2} ~ \diff t &&\text{in Leibniz notation .}}
\end{array}
\]

\end{definition}
\end{frame}
% end module arc-length-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/arc-length/arc-length-does-not-depend-on-parametrization-when-one-to-one.tex
%begin module arc-length-does-not-depend-on-parametrization-when-one-to-one

%end module arc-length-does-not-depend-on-parametrization-when-one-to-one


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/arc-length/arc-length-function-graph-from-parametric-curve-length.tex
%begin module arc-length-function-graph-from-parametric-curve-length

\begin{frame}
\frametitle{Arc length of graph of a function}
\begin{question}
What is the length of the graph of the curve given by the graph of $y=f(x)$?
\end{question}
\begin{itemize}
\item<2-> The graph of $y=f(x)$ is written as a curve as 
\[
\gamma:\left|
\begin{array}{rcl}
x&=&t\\
y&=&f(t) 
\end{array}\right.,t\in [a,b]\quad .
\]
\item<3-> In other words, the question asks what is the length $L(\gamma)$ of $\gamma$. \uncover<4->{That is a straightforward computation: 
$
\begin{array}{rcl}
\uncover<4->{\alert<4>{L(\gamma)}}&\uncover<4->{\alert<4>{=}}&\displaystyle \int \sqrt{\uncover<5->{( \alert<5>{x'(t)})^2 +(y'(t))^2 } \uncover<4>{ \alert<4>{ \textbf{?}}} } \diff t= \uncover<5->{\int \sqrt{\alert<5>{1} +(f'(t))^2 } \diff t }
\end{array}
$
}
\end{itemize}

\end{frame}
%end module arc-length-function-graph-from-parametric-curve-length


%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/arc-length/arc-length-def.tex
% begin module arc-length-def
\begin{frame}
\frametitle{The Arc Length Formula}

\begin{definition}
Suppose $f'$ exists and is continuous on $[a,b]$. Then the length of the curve $y = f(x)$, $a\leq x \leq b$, is
\[
\begin{array}{rclll}
\displaystyle L& =&\displaystyle  \int\limits_a^b \sqrt{1 +( f' (x))^2} \ \diff x\\
 &=&\displaystyle  \int\limits_a^b \sqrt{1 + \left( \frac{\diff y}{\diff x}\right)^2} \ \diff x&&\text{(in Leibniz notation)\quad .}
\end{array}
\]
\end{definition}

\end{frame}
% end module arc-length-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/arc-length/arc-length-ex1.tex
% begin module arc-length-ex1
\begin{frame}
\begin{example} %[Example 1, p. 562]
Find the length of the arc of $y^2 = x^3$ between $(1,1)$ and $(4,8)$.
\begin{columns}[c]
\column{.3\textwidth}
%\includegraphics[height=6cm]{arc-length/pictures/09-01-ex1.pdf}%
\psset{xunit=0.4cm, yunit=0.4cm}
\begin{pspicture}(-0.9, -8.955949)(6,9.055949)
\tiny
\fcAxesStandard{-0.65}{-8.705949}{5.5}{8.705949}
%Function formula: - \sqrt{x^{3}}
\psplot[linecolor=gray, plotpoints=1000]{0}{4.2}{x 3 exp sqrt -1 mul }
%Function formula: \sqrt{x^{3}}
\psplot[linecolor=gray, plotpoints=1000]{0}{4.2}{x 3 exp sqrt }
%Function formula: \sqrt{x^{3}}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{1}{4}{x 3 exp sqrt }
\fcFullDot{1}{1}
\fcFullDot{4}{8}
\rput[tl](4.2, 8){$(4,8)$}
\rput[tl](1.2, 1){$(1,1)$}
\rput[l](2.7, 4){$y^2=x^3$}
\end{pspicture}
\column{.7\textwidth}
\begin{itemize}
\item<2->  For the top half of the curve we have:
\item<2->  \alert<handout:0| 3-4>{$y = \uncover<4->{x^{3/2}}$} and  \alert<handout:0| 5-6,8>{$y' = \uncover<6->{\frac{3}{2}x^{1/2}}$}.
\item<9->  \alert<handout:0| 10-11>{$u = \uncover<11->{1 + \frac{9}{4}x}$} and  \alert<handout:0| 12-13>{$\diff u = \uncover<13->{\frac{9}{4}\diff x}$}.
\item<9-| alert@14-15>  When $x = 1$, $u = \uncover<15->{\frac{13}{4}}$.
\item<9-| alert@16-17>  When $x = 4$, $u = \uncover<17->{10}$.
\end{itemize}
\begin{eqnarray*}
\uncover<7->{%
L %
}%
& \uncover<7->{ = } &%
\uncover<7->{%
\int_1^4 \sqrt{1+\left( \alert<handout:0| 8>{y'} \right)^2}\diff x%
}\\%
& \uncover<8->{ = } &%
\uncover<8->{%
\int_{\alert<handout:0| 14-15>{1}}^{\alert<handout:0| 16-17>{4}} \sqrt{\alert<handout:0| 11>{1+} \alert<handout:0| 8,11>{\frac{9}{4}x} }\ \alert<handout:0| 12-13>{\diff x}%
} \uncover<9->{ = } \uncover<9->{%
\int_{\alert<handout:0| 14-15>{\uncover<15->{13/4}}}^{\alert<handout:0| 16-17>{\uncover<17->{10}}} \alert<handout:0| 12-13>{\uncover<13->{\frac{4}{9}}}\uncover<11->{\sqrt{\alert<handout:0| 10-11>{u}}}\ \alert<handout:0| 12-13>{\uncover<13->{\diff u}}%
}\\%
& \uncover<18->{ = } &%
\uncover<18->{%
\frac{4}{9}\left[ \frac{2}{3} u^{3/2}\right]_{13/4}^{10}%
} \uncover<19->{ = } \uncover<19->{%
\frac{8}{27}\left( 10^{3/2} - \left( \frac{13}{4}\right)^{3/2}\right)%
}\\%
\end{eqnarray*}
\end{columns}
\end{example}
\end{frame}
% end module arc-length-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/arc-length/arc-length-flip-xy.tex
% begin module arc-length-flip-xy
\begin{frame}
If a curve has equation $x = g(y)$, $c\leq y \leq d$, and $g'(y)$ is continuous, then we can get the length of the curve by interchanging the roles of $x$ and $y$ in the arc length formula:
\[
L = \int_c^d \sqrt{1+(g'(y))^2}\ \diff y = \int_c^d \sqrt{1 + \left( \frac{\diff x}{\diff y}\right)^2}\ \diff y
\]
\end{frame}
% end module arc-length-flip-xy



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/arc-length/arc-length-flip-xy-ex2.tex
% begin module arc-length-flip-xy-ex2
\begin{frame}
\begin{example} %[Example 2, p. 563]
Find the length of the arc of $x = y^2$ from $(0,0)$ to $(1,1)$.
\begin{itemize}
\item<2->  $x = y^2$, so \alert<handout:0| 3-4>{$\diff x / \diff y = \uncover<4->{2y}$}.
\item<5->  Substitute \alert<handout:0| 6-7>{$y = \uncover<7->{\frac{1}{2}\tan \theta}$}, so  \alert<handout:0| 8-9>{$\diff y = \uncover<9->{\frac{1}{2}\sec^2 \theta \diff\theta}$}, and  \alert<handout:0| 10-11>{$\sqrt{1+4y^2} =  \uncover<11->{\sec \theta}$}.
\item<12->  When $y = 0$, \alert<handout:0| 12-13>{$\tan \theta = \uncover<13->{0}$}, so \alert<handout:0| 14-15>{$\theta = \uncover<15->{0}$}.
\item<12->  When $y = 1$, \alert<handout:0| 16-17>{$\tan \theta = \uncover<17->{2}$}, so \alert<handout:0| 18-19,23-26>{$\theta = \uncover<19->{\Arctan (2)}$ \uncover<19->{(call this $\alpha$)}}.
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
L &  = & \int_0^1 \sqrt{1 + \alert<handout:0| 3-4>{\left(\diff x / \diff y\right)^2}} \ \diff y  \uncover<2->{ = } \uncover<2->{%
\int_{\alert<handout:0| 12-15>{0}}^{\alert<handout:0| 16-19>{1}} \alert<handout:0| 10-11>{\sqrt{1 + \alert<handout:0| 4>{\uncover<4->{4y^2}}}}\ \alert<handout:0| 8-9>{\diff y}%
}\\%
& \uncover<5->{ = } &%
\uncover<5->{%
\int_{\alert<handout:0| 15>{\uncover<15->{0}}}^{\alert<handout:0| 19>{\uncover<19->{\alpha}}} \alert<handout:0| 11>{\uncover<11->{\sec \theta }}\uncover<11->{\cdot} \alert<handout:0| 9>{\uncover<9->{\frac{1}{2}\sec^2 \theta \ \diff \theta}}%
} \uncover<20->{ = } \uncover<20->{%
\frac{1}{2}\int_0^{\alpha} \sec^3 \theta \ \diff \theta%
}\\%
& \uncover<21->{ = } &%
\uncover<21->{%
\frac{1}{2}\cdot \frac{1}{2}\left[ \sec \theta \tan \theta +\ln| \sec \theta + \tan \theta | \right]_0^\alpha%
}\\%
& \uncover<22->{ = } &%
\uncover<22->{%
\frac{1}{4}\left( \alert<handout:0| 25-26>{\sec \alpha} \alert<handout:0| 23-24>{\tan \alpha} +\ln| \alert<handout:0| 25-26>{\sec \alpha} + \alert<handout:0| 23-24>{\tan \alpha} | \right)%
}\\%
& \uncover<23->{ = } &%
\uncover<23->{%
\frac{1}{4}\left( \alert<handout:0| 23-24>{\uncover<24->{2}}\alert<handout:0| 25-26>{\uncover<26->{\sqrt{5}}}  +\ln| \alert<handout:0| 25-26>{\uncover<26->{\sqrt{5}}} + \alert<handout:0| 23-24>{\uncover<24->{2}} | \right)%
}\\%
\end{eqnarray*}
\vspace{-.3in}
\end{example}
\end{frame}
% end module arc-length-flip-xy-ex2



% WARNING: This section needs an example in which y' = (a - b)^2 with 2ab = .5 
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/arc-length/arc-length-half-ex.tex
% begin module arc-length-half-ex
\begin{frame}
\begin{example}[$(a+b)^2$, $(a-b)^2$, $2ab=1/2$]
\begin{columns}
\column{0.15\textwidth}
\psset{xunit=0.25cm, yunit=0.25cm}
\begin{pspicture}(-1.4, -0.9)(1.4,3.855887)
\tiny
\fcAxesStandard{-1.15}{-0.65}{1.15}{3.505887}
%Function formula: 1/6 e^{3 x}+1/6 e^{-3 x}
\psplot[linecolor=gray, plotpoints=1000]{-1}{1}{ 2.718281828 x -3. mul exp 0.166667 mul 2.718281828 x 3. mul exp 0.166667 mul add }
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{0}{1}{ 2.718281828 x -3. mul exp 0.166667 mul 2.718281828 x 3. mul exp 0.166667 mul add }
\end{pspicture}
\column{0.85\textwidth}
Find the length of the arc of $y = \frac{1}{6}e^{3x} + \frac{1}{6} e^{ -3x}$ from $x = 0$ to $x = 1$.
\end{columns}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\uncover<2->{\alert<handout:0| 2-3>{y'}} %
& \uncover<2->{\alert<handout:0| 2-3>{=}}  %
\uncover<3->{\alert<handout:0| 3>{\frac{1}{2}e^{3x} - \frac{1}{2}e^{-3x}}.} \\%
\uncover<4->{\alert<handout:0| 8>{(y')^2}} %
& \uncover<4->{=}  %
\uncover<4->{\frac{1}{4}e^{6x} \alert<handout:0| 5-6>{- \frac{1}{4}e^{3x}e^{-3x} - \frac{1}{4}e^{3x}e^{-3x}} + \frac{1}{4}e^{-6x}} \\%
& \uncover<6->{\alert<handout:0| 8>{=}}  %
\uncover<6->{\alert<handout:0| 8>{\frac{1}{4}e^{6x} \alert<handout:0| 6>{- \frac{1}{2}} + \frac{1}{4}e^{-6x}}.} \\%
\uncover<7->{L} %
& \uncover<7->{=}  %
\uncover<7->{\int_0^1 \sqrt{1 + \alert<handout:0| 8>{(y')^2}} \diff x} %
 \uncover<8->{=}  %
\uncover<8->{\int_0^1 \sqrt{\alert<handout:0| 9>{1} + \alert<handout:0| 8>{\frac{1}{4}e^{6x} \alert<handout:0| 9>{- \frac{1}{2}} + \frac{1}{4}e^{-6x}}} \diff x} \\%
& \uncover<9->{=}  %
\uncover<9->{\int_0^1 \sqrt{\frac{1}{4}e^{6x} \alert<handout:0| 9>{+ \frac{1}{2}} + \frac{1}{4}e^{-6x}} \diff x} %
 \uncover<10->{=}  %
\uncover<10->{\int_0^1 \sqrt{\left( \frac{1}{2}e^{3x} + \frac{1}{2}e^{-3x}\right)^2} \diff x} \\%
& \uncover<11->{=}  %
\uncover<11->{\int_0^1 \left( \alert<handout:0| 12-13>{\frac{1}{2}e^{3x}} + \alert<handout:0| 14-15>{\frac{1}{2}e^{-3x}}\right) \diff x} %
 \uncover<12->{=}  %
\uncover<12->{{\left[ \uncover<13->{\alert<handout:0| 13>{\frac{1}{6}e^{3x}}} \uncover<15->{\alert<handout:0| 15>{- \frac{1}{6}e^{-3x}}}\right]}^1_0} %
 \uncover<16->{=}  %
\uncover<16->{\frac{ e^3 - e^{-3}}{6}.} %
\end{align*}
\end{example}
\end{frame}
% end module arc-length-half-ex



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/cycloid-arc-length-ex5.tex
% begin module cycloid-arc-length-ex5
\begin{frame}
\begin{example} 
\begin{columns}[c]
\column{.4\textwidth}
\psset{xunit=0.6cm, yunit=0.6cm}
\begin{pspicture}(-0.9, -0.9)(6.8,2.6)
\tiny
\fcAxesStandard{-0.8}{-0.65}{6.8}{2.4}
\fcYTickWithLabel{2}{$2 r$}
\fcXTickWithLabel{6.28319}{$2\pi r$}
%Calculator input: plotCurve{}(- \sin{}t+t, - \cos{}t+1, 0, 2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{0}{6.28319}{t t 57.29578 mul sin -1 mul add 1 t 57.29578 mul cos -1 mul add }
\end{pspicture}
%\ \includegraphics[height=2.2cm]{parametric-curves/pictures/11-02-ex5.pdf}%
\column{.6\textwidth}
Find the length of one arch of the cycloid
\[
\alert<handout:0| 3-4>{x = r(\theta - \sin \theta )}, \quad  \alert<handout:0| 5-6>{y = r(1-\cos \theta )}.%
\]
\uncover<2->{%
The first arch is \alert<handout:0| 2,12>{$0\leq \theta \leq 2\pi$}.
}%
\end{columns}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<2->{%
L = \int_{\alert<handout:0| 2>{0}}^{\alert<handout:0| 2>{2\pi}}\sqrt{\left( \alert<handout:0| 3-4>{\frac{\diff x}{\diff \theta}}\right)^2+\left( \alert<handout:0| 5-6>{\frac{\diff y}{\diff \theta}}\right)^2} \diff \theta%
}%
\uncover<3->{%
 = \int_0^{2\pi}\sqrt{\left( \alert<handout:0| 3-4>{\uncover<4->{r(1-\cos \theta )}}\right)^2+\left( \alert<handout:0| 5-6>{\uncover<6->{r\sin \theta}}\right)^2} \diff \theta%
}%
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<7->{%
 = \int_0^{2\pi} \sqrt{r^2(1 - 2\cos \theta + \cos^2\theta + \sin^2\theta)}\diff \theta%
}%
\uncover<8->{%
 = r \int_0^{2\pi} \sqrt{2(1 - \cos \theta)}\diff \theta%
}%
\]
\uncover<9->{%
Use the identity \alert<handout:0| 10>{$\sin^2 x = \frac{1}{2}(1-\cos 2x)$}.  %
}%
\uncover<10->{%
Then %
}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<9->{%
\sqrt{\alert<handout:0| 10>{2(1-\cos \theta )}}%
}%
\uncover<10->{%
 = \sqrt{\alert<handout:0| 10>{4\sin^2 (\theta /2) }}%
}%
\uncover<11->{%
 = 2\alert<handout:0| 12>{|}\sin (\theta /2)\alert<handout:0| 12>{|}%
}%
\uncover<12->{%
 = 2\sin (\theta /2)%
}%
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<13->{%
L = r\int_0^{2\pi}2\sin (\theta /2)\diff \theta%
}%
\uncover<14->{%
 = r\left[ -4\cos (\theta / 2)\right]_0^{2\pi}%
}%
%\uncover<15->{%
% = r\left( (-4)(-1) - (-4)(1)\right)%
%}%
\uncover<15->{%
 = 8r%
}%
\]
\end{example}
\end{frame}
% end module cycloid-arc-length-ex5



\subsection{Arc Length in Polar Coordinates}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-arc-length-formula.tex
% begin module polar-arc-length-formula
\begin{frame}
\frametitle{Arc Length}
To find the arc length of a polar curve $r = f(\theta )$, $a\leq \theta \leq b$, regard $\theta$ as a parameter.  
\uncover<2->{%
Then the derivatives of the parametric equations are%
}%
\uncover<2->{%
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\[
\alert<handout:0| 4>{\frac{\diff x}{\diff \theta} = \frac{\diff r}{\diff \theta}\cos \theta - r\sin \theta} \qquad%
\alert<handout:0| 5>{\frac{\diff y}{\diff \theta} = \frac{\diff r}{\diff \theta}\sin \theta + r\cos \theta}%
\]
}%
\uncover<3->{%
and%
}%
\abovedisplayskip=2pt
\belowdisplayskip=2pt
\begin{eqnarray*}
\uncover<3->{%
\alert<handout:0| 11>{%
\alert<handout:0| 4>{\left( \frac{\diff x}{\diff \theta}\right)^2}%
 + \alert<handout:0| 5>{\left( \frac{\diff y}{\diff \theta}\right)^2}%
}%
}%
& \uncover<3->{ = } &%
\uncover<4->{%
\alert<handout:0| 4>{%
\alert<handout:0| 6-7>{\left( \frac{\diff r}{\diff \theta}\right)^2 \cos^2\theta} \alert<handout:0| 8>{- 2r\frac{\diff r}{\diff \theta}\cos \theta\sin\theta} + \alert<handout:0| 9-10>{r^2\sin^2\theta}%
}%
}\\%
%& \uncover<1->{ = } &%
&  &%
\uncover<3->{\ + }%
\uncover<5->{%
\alert<handout:0| 5>{%
\alert<handout:0| 6-7>{\left( \frac{\diff r}{\diff \theta}\right)^2 \sin^2\theta} \alert<handout:0| 8>{+ 2r\frac{\diff r}{\diff \theta}\sin \theta\cos\theta} + \alert<handout:0| 9-10>{r^2\cos^2\theta}%
}%
}\\%
& \uncover<6->{ = } &%
\uncover<6->{%
\alert<handout:0| 11>{%
\uncover<7->{\alert<handout:0| 7>{\left( \frac{\diff r}{\diff \theta}\right)^2}} \uncover<10->{+ \alert<handout:0| 10>{r^2}}%
}%
}%
\end{eqnarray*}
The arc length is
\[
L = \int_a^b \sqrt{\alert<handout:0| 11>{\left(\frac{\diff x}{\diff \theta}\right)^2 + \left( \frac{\diff y}{\diff \theta}\right)^2}}\diff \theta%
\uncover<11->{%
 = \int_a^b\sqrt{\alert<handout:0| 11>{r^2 + \left( \frac{\diff r}{\diff \theta}\right)^2}}\diff \theta
}%
\]
\end{frame}
% end module polar-arc-length-formula



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/cardioid-arc-length-ex4.tex
% begin module cardioid-arc-length-ex4
\begin{frame}[t]
\begin{example} %[Example 4, p. 688]
\begin{columns}
\column{0.2\textwidth}
\psset{xunit=0.5cm, yunit=0.5cm}
\begin{pspicture}(-1.699025, -0.9)(1.699025,2.499985)
\tiny
\fcAxesStandard{-1.449025}{-0.65}{1.449025}{2.149985}
%Calculator command: drawPolar{}(\sin{}t+1, 0, 2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000, algebraic=false]{0}{6.28319}{ 1 t 57.29578 mul sin add t 57.29578 mul cos mul 1 t 57.29578 mul sin add t 57.29578 mul sin mul }
\end{pspicture}
\column{0.8\textwidth}
Find the length of the cardioid \alert<handout:0| 3-6>{$r = 1 + \sin \theta$}.
\uncover<2->{%
The full length is given by \alert<handout:0| 2>{$0\leq \theta \leq 2\pi$}.
}%
\end{columns}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
%\begin{eqnarray*}
\[
\begin{array}{l}
\uncover<2->{%
\displaystyle L  = \displaystyle  \int_{\alert<handout:0| 2>{0}}^{\alert<handout:0| 2>{2\pi}} \sqrt{\alert<handout:0| 3-4>{r^2} + \alert<handout:0| 5-6>{\left( \frac{\diff r}{\diff \theta}\right)^2}}\diff \theta%
}%
\uncover<3->{%
\displaystyle  = \int_0^{2\pi} \sqrt{\alert<handout:0| 4>{\uncover<4->{(1+\sin \theta )^2}} + \alert<handout:0| 6>{\uncover<6->{\cos^2\theta}}}\diff \theta%
}\\%
 \uncover<7->{ = } %
\uncover<7->{%
\displaystyle \int_0^{2\pi} \sqrt{2 + 2\sin\theta}\only<8->{\alert<handout:0| 8>{\frac{\sqrt{2-2\sin\theta}}{\sqrt{2-2\sin\theta}}}}\diff \theta%
}%
\uncover<9->{%
\displaystyle  = \int_0^{2\pi} \frac{\sqrt{4 - 4\sin^2\theta}}{\sqrt{2-2\sin\theta}}\diff \theta%
}\\%
 \uncover<10->{ = } %
\uncover<10->{%
\displaystyle \int_0^{2\pi} \frac{\alert<handout:0| 11>{\sqrt{4\cos^2\theta}}}{\sqrt{2-2\sin\theta}}\diff \theta%
}%
\uncover<11->{%
\displaystyle  = \int_{\alert<handout:0| 12>{0}}^{\alert<handout:0| 12>{2\pi}} \frac{\alert<handout:0| 11-12>{2|\cos\theta |}}{\sqrt{2-2\sin\theta}}\diff \theta%
}\\%
 \uncover<12->{ = } %
\uncover<12->{%
\displaystyle \int_{\alert<handout:0| 12>{0}}^{\alert<handout:0| 12>{\pi/2}}\frac{\alert<handout:0| 12>{2\cos \theta}}{\sqrt{2-2\sin\theta}}\diff\theta%
 + \int_{\alert<handout:0| 12>{\pi/2}}^{\alert<handout:0| 12>{3\pi /2}}\frac{\alert<handout:0| 12>{-2\cos \theta}}{\sqrt{2-2\sin\theta}}\diff\theta%
 + \int_{\alert<handout:0| 12>{3\pi/2}}^{\alert<handout:0| 12>{2\pi}}\frac{\alert<handout:0| 12>{2\cos \theta}}{\sqrt{2-2\sin\theta}}\diff\theta%
}\\%
 \uncover<13->{ = } %
\uncover<13->{%
\displaystyle \left[ -2\alert<handout:0| 14-17>{\sqrt{2-2\sin\theta}}\right]_{\alert<handout:0| 16-17>{0}}^{\alert<handout:0| 14-15>{\pi/2}}%
\displaystyle  + \left[ 2\alert<handout:0| 18-21>{\sqrt{2-2\sin\theta}}\right]_{\alert<handout:0| 20-21>{\pi/2}}^{\alert<handout:0| 18-19>{3\pi/2}}%
\displaystyle  + \left[ -2\alert<handout:0| 22-25>{\sqrt{2-2\sin\theta}}\right]_{\alert<handout:0| 24-25>{3\pi/2}}^{\alert<handout:0| 22-23>{2\pi}}%
}\\%
 \uncover<14->{ = } %
\uncover<14->{%
\displaystyle -2\left( \uncover<15->{\alert<handout:0| 15>{0}} - \uncover<17->{\alert<handout:0| 17>{\sqrt{2}}}\right)%
\displaystyle +2\left( \uncover<19->{\alert<handout:0| 19>{2}} - \uncover<21->{\alert<handout:0| 21>{0}}\right)%
\displaystyle -2\left( \uncover<23->{\alert<handout:0| 23>{\sqrt{2}}} - \uncover<25->{\alert<handout:0| 25>{2}}\right)%
}%
 \uncover<26->{ = } %
\uncover<26->{%
8%
}%
%\end{eqnarray*}
\end{array}
\]
\end{example}
\end{frame}
% end module cardioid-arc-length-ex4



}

%end lecture
\lect{Spring 2015}{Lecture 17}{17}{
\section{Areas Locked by Curves}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/parametric-area-formula.tex
% begin module parametric-area-formula
\begin{frame}
\frametitle{Areas}
\begin{itemize}
\item  The area under a curve $y = F(x)$ from $a$ to $b$ is
\[
A = \int_a^b F(x) \diff x
\]
\item  Suppose the curve has parametric equations \alert<handout:0| 5-6>{$x = f(t)$}, \alert<handout:0| 3-4>{$y = g(t)$},  $\alpha \leq t \leq \beta$.
\item<2->  Then use the Substitution Rule to find the area:
\end{itemize}
\[
\uncover<2->{%
A = \int_{\alert<handout:0| 7-8>{a}}^{\alert<handout:0| 7-8>{b}} \alert<handout:0| 3-4>{y} \alert<handout:0| 5-6>{\diff x}%
}%
\uncover<3->{%
 = \int_{\alert<handout:0| 7-8>{\alpha}}^{\alert<handout:0| 7-8>{\beta}} \alert<handout:0| 3-4>{\uncover<4->{g(t)}} \alert<handout:0| 5-6>{\uncover<6->{f'(t)\diff t}}%
}%
\]
\begin{itemize}
\item<7->  How do we know where to put $\alpha$ and $\beta$?
\item<8->  When $x = a$, $t$ will be either $\alpha$ or $\beta$.  When $x = b$, $t$ will take the other value.
\end{itemize}
\end{frame}
% end module parametric-area-formula



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/parametric-curves/cycloid-area-ex3.tex
% begin module cycloid-area-ex3
\begin{frame}
\begin{example} %[Example 3, p. 668]
\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=0.6cm, yunit=0.6cm, algebraic=true}
\begin{pspicture}(-1.290703, -0.7)(7.5, 2.8)%
\tiny
\psframe*[linecolor=white](-1.290703, -0.7)(7.5, 2.8)
\pscustom*[linecolor=\fcColorAreaUnderGraph]{%
\parametricplot{0}{6.283185307}{t-sin(t)|1-cos(t)}%
\psline(6.283185307, 0)(0,0)%
}%
\parametricplot[linecolor=\fcColorGraph]{-2}{8.283185307}{t-sin(t)|1-cos(t)}%
\fcAxesStandardNoFrame{-1.090703}{-0.5}{7.373888}{2.5}%
\fcYTickWithLabel{2}{$2r$}
\fcXTickWithLabel{6.283185307}{$2\pi r$}
\end{pspicture}
%\ \includegraphics[height=1.7cm]{parametric-curves/pictures/11-02-ex3.pdf}%
\column{.5\textwidth}
Find the area under one arch of the cycloid
\[
\alert<handout:0| 6-7>{x = r(\theta - \sin \theta )},\qquad \alert<handout:0| 4-5>{y = r(1-\cos \theta )}
\]
\end{columns}
\uncover<2->{%
One arch is given by $\alert<handout:0| 8-11>{0\leq \theta \leq 2\pi}$.
}%
\begin{eqnarray*}
\uncover<3->{%
A & = & \int_{\alert<handout:0| 8-9>{0}}^{\alert<handout:0| 10-11>{2\pi r}} \alert<handout:0| 4-5>{y}\alert<handout:0| 6-7>{\diff x}%
} \uncover<4->{ = } \uncover<4->{%
\int_{\alert<handout:0| 8-9>{\uncover<9->{0}}}^{\alert<handout:0| 10-11>{\uncover<11->{2\pi}}} \alert<handout:0| 4-5>{\uncover<5->{r(1-\cos \theta )}}\alert<handout:0| 6-7>{\uncover<7->{r(1-\cos \theta )\diff \theta}}%
}\\%
& \uncover<12->{ = } &%
\uncover<12->{%
r^2 \int_0^{2\pi} (1-\cos \theta )^2\diff \theta%
}  \uncover<13->{ = } \uncover<13->{%
r^2 \int_0^{2\pi} (1-2\cos \theta + \alert<handout:0| 14>{\cos^2 \theta}) \diff \theta%
}\\%
& \uncover<14->{ = } &%
\uncover<14->{%
r^2 \int_0^{2\pi} \left( 1-2\cos \theta + \alert<handout:0| 14>{\frac{1}{2}(1+\cos 2 \theta)}\right) \diff \theta%
}\\%
&  \uncover<15->{ = } &%
\uncover<15->{%
r^2 \left[ \frac{3}{2}\theta -2\sin \theta + \frac{1}{4}\sin 2\theta \right]_0^{2\pi}%
}  \uncover<16->{ = } \uncover<16->{%
r^2 \left( \frac{3}{2} \cdot 2\pi \right) = 3\pi r^2%
}\\%
\end{eqnarray*}
\end{example}
\end{frame}
% end module cycloid-area-ex3



\section{Areas in Polar Coordinates}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-area-intro.tex
% begin module polar-area-intro
\begin{frame}
\frametitle{Areas and Lengths in Polar Coordinates}
Suppose we have a polar curve $r = f(\theta )$, $a\leq \theta \leq b$.
\begin{definition} We say that the figure obtained as the union of the segments connecting the origin with the points of the curve is the figure \emph{swept} by the curve as  $\theta$ varies from $a$ to $b$.
\end{definition}
\begin{center}
\psset{xunit=0.6cm, yunit=0.6cm}
\begin{pspicture}(-0.5,-0.5)(2,2.4)
\tiny
\pstVerb{/theFunction {3 t sub} def}
\uncover<2->{%
\fcPolarWedge{0}{0.05}{theFunction}%
}%
\uncover<3->{%
\fcPolarWedge{0.05}{0.1}{theFunction}%
}%
\uncover<4->{%
\fcPolarWedge{0.1}{0.15}{theFunction}%
}%
\uncover<5->{%
\fcPolarWedge{0.15}{0.2}{theFunction}%
}%
\uncover<6->{%
\fcPolarWedge{0.2}{0.25}{theFunction}%
}%
\uncover<7->{%
\fcPolarWedge{0.25}{0.3}{theFunction}%
}%
\uncover<8->{%
\fcPolarWedge{0.3}{0.35}{theFunction}%
}%
\uncover<9->{%
\fcPolarWedge{0.35}{0.4}{theFunction}%
}%
\uncover<10->{%
\fcPolarWedge{0.4}{0.45}{theFunction}%
}%
\uncover<11->{%
\fcPolarWedge{0.45}{0.5}{theFunction}%
}%
\uncover<12->{%
\fcPolarWedge{0.5}{0.55}{theFunction}%
}%
\uncover<13->{%
\fcPolarWedgeSequence{0.55}{0.05}{20}{theFunction}%
}%
\fcAxesStandardNoFrame{-0.5}{-0.5}{3.2}{2.2}
\rput[bl](1.5, 1.7){$r=f(\theta)$}
\end{pspicture}
\end{center}
\uncover<14->{
\begin{theorem}
Suppose no two points on the curve lie on the same ray from the origin. Then the area swept by the curve equals $\displaystyle A = \int_a^b \frac{1}{2}\left(f(\theta )\right)^2\diff \theta$.
\end{theorem}
}
%A geometric explanation of this formula can be found in the textbook. I am preparing a geometric explanation, no need to refer to Stewart.

\end{frame}
% end module polar-area-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-area-justification.tex
% begin module polar-area-justification
\begin{frame}[t]
\begin{columns}
\frametitle{Area swept by a polar curve: justification}
\column{0.5\textwidth}
\psset{xunit=1cm, yunit=1cm, algebraic=false}
\begin{pspicture}(-2.65,-1)(1.4,2.3)%
\tiny%
\psline[linecolor=red!1](1.4, 2.3)(1.39, 2.3)%
\psline[linecolor=red!1](-2.65, -1)(-2.649, -1)%
\rput[t](0,-0.1){$O$}%
\pstVerb{%
10 dict begin
/thePolarR {t 2 div 1 add} def
/thePolarX {t 57.295779513 mul cos thePolarR mul} def
/thePolarY {t 57.295779513 mul sin thePolarR mul} def
/thetaMax 3.5 def
}%
\uncover<1>{%
\pscustom*[linecolor=cyan]{%
\fcDrawPolar[linecolor=red, plotpoints=1000]{0}{thetaMax}{thePolarR}%
\pstVerb{1 dict begin /t thetaMax def}%
\psline(! thePolarX thePolarY )(0,0)(1,0)%
\pstVerb{end}%
}%
\pstVerb{1 dict begin /t thetaMax def}%
\psline[linecolor=red](! thePolarX thePolarY )(0,0)(1,0)%
\pstVerb{end}%
}%
\rput[t](1.2,-0.1){$x$}%
\uncover<2-15>{%
\rput[b](-0.832294, 1.85){$\alert<4>{P_2}$}%
\rput[bl](0.84, 1.3){$\alert<4>{P_1}$}%
\pstVerb{1 dict begin /t 1 def}%
\fcFullDot{thePolarX}{thePolarY}%
\pstVerb{/t 2 def}%
\fcFullDot{thePolarX}{thePolarY}%
\pstVerb{end}%
}%
\uncover<5-15>{%
\pstVerb{1 dict begin /t 1 def}%
\psline[linecolor=cyan](0,0)(! thePolarX thePolarY)%
\pstVerb{/t 2 def}%
\psline[linecolor=cyan](0,0)(! thePolarX thePolarY)%
\pstVerb{end}%
}%
\uncover<7-15>{%
\fcPolarWedge{1}{2}{thePolarR}%
}%
\uncover<8,9,10>{%
\pstVerb{1 dict begin /t 1 def}%
\psline[linecolor=red, linewidth=2pt](0,0)(! thePolarX thePolarY)%
\pstVerb{/t 2 def}%
\psline[linecolor=red, linewidth=2pt](0,0)(! thePolarX thePolarY)%
\pstVerb{end}%
}%
\uncover<5-15>{%
\rput[bl](0.50, 0.6){$r_1$}%
\rput[l](-0.45, 1.1){$r_2$}%
}%
\uncover<6-15>{%
\fcAngle{1}{2}{0.7}{}%
\fcAngle{0}{2}{0.45}{}%
\fcAngle{0}{1}{0.15}{}%
\rput[bl](0.15, 0.05){$\alert<6>{\theta_1}$}%
\rput[b](0, 0.46){$\alert<6>{\theta_2}$}%
\rput[b](0, 0.73){$ \alert<9,10>{\Delta}$}%
}%
\uncover<11-15>{%
\fcPolarWedgeSequence{0}{1}{3}{thePolarR}%
}%
\uncover<16>{%
\fcPolarWedgeSequence{0}{0.75}{4}{thePolarR}%
}%
\uncover<17>{%
\fcPolarWedgeSequence{0}{0.5}{6}{thePolarR}%
}%
\uncover<18>{%
\fcPolarWedgeSequence{0}{0.3}{10}{thePolarR}%
}%
\uncover<19>{%
\fcPolarWedgeSequence{0}{0.2}{15}{thePolarR}%
}%
\uncover<20->{%
\fcPolarWedgeSequence{0}{0.1}{30}{thePolarR}%
}%
\fcDrawPolar[linecolor=red, plotpoints=1000]{0}{3.5}{thePolarR}%
\psline[arrows=->](0,0)(1.2, 0)%
\pstVerb{end}%
\end{pspicture}

\column{0.5\textwidth}
\uncover<2->{Split $[a,b]$ into $N$ equal segments via points $a=\theta_0 \leq \theta_1 \leq \dots \leq \theta_{N-1} \leq \theta_N=b$.} \uncover<3->{The length of each segment is $\Delta=\frac{b-a}{N}$.} \uncover<4->{Let $r_i=f(\theta_i)$. Then each $\theta_i$ gives a \alert<4>{point $P_i$} with polar coordinates $(\alert<5>{r_i},\alert<6>{\theta_i})$.}
\end{columns}

\only<1-12>{ \uncover<7->{The area swept by the curve is approximated by sum of areas of triangles given by connecting the origin with two consecutive vertices. Consider one such triangle, say, $OP_1P_2$.} \uncover<8->{By Euclidean geometry, the area of $\triangle OP_1P_2 $ is $\alert<8,9>{\frac{|OP_1| |OP_2| \uncover<8>{\alert<8>{ \textbf{?} }} \uncover<9->{\alert<9>{ \sin \Delta}}}{2}} \uncover<10->{=\frac{ r_1 r_2 \sin \Delta}{2}= \frac{ f(\theta_1) f(\theta_2) \sin \Delta}{2}} $.}
}

\uncover<11->{\alert<12,13>{ Therefore the area swept by the curve \only<1-14>{is approximated by} \only<15->{\alert<15>{equals \alert<16->{the limit} of}} the sum:}
\[\begin{array}{rcl}
\uncover<15->{ A&=&}\alert<12,13>{\uncover<15->{\lim\limits_{\Delta\to 0}} \sum\limits_{i=0}^{N-1} \frac{f(\theta_i)f(\theta_{i+1}) \alert<14>{ \sin \Delta} }{2}} \uncover<14->{= \uncover<15->{ \lim \limits_{\Delta\to 0}} \alert<14>{ \frac{ \sin\Delta}{ \Delta}} \sum\limits_{i=0}^{N-1} \frac{ f( \theta_i) f(\theta_{i} + \Delta)\alert<14>{\Delta}}{2}}\\
\uncover<21->{\uncover<24>{\alert<24>{\text{{\tiny(can be proved)}}}}  &=&   \alert<22,23>{ \lim \limits_{\Delta\to 0}\frac{ \sin\Delta}{ \Delta  }}  \lim \limits_{\alert<24>{\Delta\to 0} } \sum\limits_{i=0}^{N-1} \frac{ f( \theta_i) f( \alert<24>{ \theta_{i} + \Delta} )\Delta}{2} \uncover<22->{=\uncover<22>{\alert<22>{\textbf{?}}} \uncover<23->{\alert<23>{1}}\cdot \lim \limits_{\Delta\to 0} \sum\limits_{i=0}^{N-1} \frac{\alert<25>{ f( \theta_i) f(\alert<24>{ \theta_{i}} )} \Delta}{2}}} \\
\uncover<25->{\uncover<27->{{\tiny\text{\alert<27>{(Riemann sum)}}}} &=& \lim \limits_{\Delta\to 0} \sum \limits_{i=0}^{N-1} \frac{ \alert<25>{ f^2( \theta_i)}  \Delta }{2}}\uncover<26->{=\uncover<26>{\alert<26>{\textbf{?}}} \uncover<27->{\alert<27>{  \int\limits_{a}^b \frac{ f^2(\theta)}{2}\diff \theta}} }
\end{array}
\]
}
\end{frame}
%end module polar-area-justification



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-area-ex1.tex
% begin module polar-area-ex1
\begin{frame}
\begin{example} %[Example 1, p. 686]
Find the area enclosed by one loop of the four-leaved rose $r = \cos 2\theta$.
\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=2cm, yunit=2cm, algebraic=true}
\begin{pspicture}(-1.5,-1.5)(1.5,1.5)
\tiny%
\fcBoundingBox{-1.25}{-1.25}{1.25}{1.25}
\uncover<2->{%
\pscustom*[linecolor=\fcColorAreaUnderGraph]{%
\parametricplot{-0.785398163}{0.785398163}{cos(2*t)*cos(t)|cos(2*t)*sin(t)}%
}%
\rput(-0.8,0.8){$r=\cos (2\theta)$}
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000] {0}{6.283185307}{cos(2*t)*cos(t)|cos(2*t)*sin(t)}%
}
\fcAxesStandardNoFrame{-1.2}{-1.2}{1.2}{1.2}%
\uncover<3->{
\psline[linecolor=\fcColorTangent](0,0)(1.2,1.2)
\psline[linecolor=\fcColorTangent](0,0)(1.2,-1.2)
\rput[r](1, 1.1){$\theta=\frac{\pi}{4}$}
\rput[r](1, -1.1){$\theta=-\frac{\pi}{4}$}
}
\end{pspicture}
%\ \uncover<2->{%
%\includegraphics[height=5cm]{polar-curves/pictures/11-04-ex1a.pdf}%
%}%

\uncover<2->{%
The region enclosed by the right loop corresponds to points whose  \alert<2,3>{$\theta$ polar coordinate lies in the interval} $\uncover<3->{ \alert<3,4>{ -\frac{\pi}{4}}} \uncover<2>{ \alert<2>{\textbf{?}}} \alert<2,3,4>{\leq\theta\leq }\uncover<2>{\alert<2>{ \textbf{?}}} \uncover<3->{ \alert<3,4>{\frac{\pi}{4}}} $.
}%
\column{.5\textwidth}
\begin{eqnarray*}
\uncover<4->{%
A%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\int_{\alert<4>{-\frac{\pi}{4}} }^{\alert<4>{\frac{\pi} {4} }}\frac{1}{2}\alert<handout:0| 5>{r^2}\diff \theta%
}\\%
& \uncover<5->{ = } &%
\uncover<5->{%
\alert<handout:0| 6>{\frac{1}{2}} \int_{\alert<handout:0| 6>{-\frac{\pi}{4}}}^{\alert<handout:0| 6>{\frac{\pi}{4}}}\alert<handout:0| 5>{\cos^22\theta} \diff \theta%
}\\%
& \uncover<6->{ = } &%
\uncover<6->{%
\int_{\alert<handout:0| 6>{0}}^{\alert<handout:0| 6>{\frac{\pi}{4}}}\alert<handout:0| 7>{\cos^22\theta} \diff \theta%
}\\%
& \uncover<7->{ = } &%
\uncover<7->{%
\int_{0}^{\frac{\pi}{4}}\alert<handout:0| 7>{\frac{1}{2}(1+\cos 4\theta )}\diff \theta%
}\\%
& \uncover<8->{ = } &%
\uncover<8->{%
\frac{1}{2}\left[ \theta + \frac{1}{4}\sin 4\theta\right]_0^{\frac{\pi}{4}}%
}\\%
& \uncover<9->{ = } &%
\uncover<9->{%
\frac{\pi}{8}%
}%
\end{eqnarray*}
\end{columns}
\end{example}
\end{frame}
% end module polar-area-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-intersection-ex3.tex
% begin module polar-intersection-ex3
\begin{frame}
\begin{example} %[Example 3, p. 688]
Find all points of intersection of the polar curves $r = \frac{1}{2}$ and $r = \cos (2\theta)$.
\begin{columns}[c]
\column{.4\textwidth}

\psset{xunit=1.8cm, yunit=1.8cm}
\begin{pspicture}(-1.5, -1.5)(1.5,1.5)
\tiny
\fcAxesStandard{-1.4}{-1.4}{1.4}{1.4}
%Calculator command: drawPolar{}(1/2, 0, 2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000, algebraic=false]{0}{6.28319}{ 0.5 t 57.29578 mul cos mul 0.5 t 57.29578 mul sin mul }
%Calculator command: drawPolar{}(\cos{}(2 t), 0, 2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000, algebraic=false]{0}{6.28319}{t 2 mul 57.29578 mul cos t 57.29578 mul cos mul t 2 mul 57.29578 mul cos t 57.29578 mul sin mul }

\rput[tr](-0.8, -0.8){$r=\frac{1}{2}$}
\psline{->}(-0.75, -0.75)(-0.353553391, -0.353553391)
\rput[lt] (0.2, -1){$r=\cos (2\theta)$}

\uncover<4->{
\fcFullDotBlack{0.433013}{0.25}
\fcFullDotBlack{-0.433013}{0.25}
\fcFullDotBlack{-0.433013}{-0.25}
\fcFullDotBlack{0.433013}{-0.25}
}
\uncover<6->{
\fcFullDotBlack{0.25}{0.433013}
\fcFullDotBlack{0.25}{-0.433013}
\fcFullDotBlack{-0.25}{-0.433013}
\fcFullDotBlack{-0.25}{0.433013}
}
\uncover<9>{
\pscircle*[linecolor=red](0.433013,0.25){0.09}
\pscircle*[linecolor=red](-0.433013,0.25){0.09}
\pscircle*[linecolor=red](-0.433013,-0.25){0.09}
\pscircle*[linecolor=red](0.433013,-0.25){0.09}
}
\uncover<10>{
\pscircle*[linecolor=red](0.25,0.433013){0.09}
\pscircle*[linecolor=red](0.25,-0.433013){0.09}
\pscircle*[linecolor=red](-0.25,-0.433013){0.09}
\pscircle*[linecolor=red](-0.25,0.433013){0.09}
}
\end{pspicture}

%\ \only<handout:0| -3>{%
%\includegraphics[height=5cm]{polar-curves/pictures/11-04-ex3a.pdf}%
%}%
%\only<handout:0| 4-5>{%
%\includegraphics[height=5cm]{polar-curves/pictures/11-04-ex3b.pdf}%
%}%
%\only<6-8>{%
%\includegraphics[height=5cm]{polar-curves/pictures/11-04-ex3c.pdf}%
%}%
%\only<handout:0| 9>{%
%\includegraphics[height=5cm]{polar-curves/pictures/11-04-ex3d.pdf}%
%}%
%\only<handout:0| 10->{%
%\includegraphics[height=5cm]{polar-curves/pictures/11-04-ex3e.pdf}%
%}%
\column{.6\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\cos 2\theta%
}%
& \uncover<2->{ = } &%
\uncover<2->{%
\frac{1}{2}%
}\\%
\uncover<3->{%
2\theta%
}%
& \uncover<3->{ = } &%
\uncover<3->{%
\frac{\pi}{3}, \frac{5\pi}{3}, \frac{7\pi}{3}, \frac{11\pi}{3}%
}\\%
\uncover<4->{%
\theta%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\frac{\pi}{6}, \frac{5\pi}{6}, \frac{7\pi}{6}, \frac{11\pi}{6}%
}%
\end{eqnarray*}
\begin{itemize}
\item<5->  This only gives four points.
\item<6->  There are actually eight.
\item<7->  The circle $r = \frac{1}{2}$ also has polar equation $r = -\frac{1}{2}$.
\item<8->  To find all eight points, solve \alert<handout:0| 9>{$\cos (2\theta )= \frac{1}{2}$} and \alert<handout:0| 10>{$\cos (2\theta) = -\frac{1}{2}$}.
\end{itemize}
\end{columns}
\end{example}
\end{frame}
% end module polar-intersection-ex3



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/polar-curves/polar-area-ex2.tex
% begin module polar-area-ex2
\begin{frame}
\begin{example} %[Example 2, p. 687]
Find the area that lies within the circle $r = 3\sin\theta$ and outside of the cardioid $r = 1+\sin \theta$.
\begin{columns}[c]
\hspace{-.1in}
\column{.3\textwidth}
\psset{xunit=0.9cm, yunit=0.9cm, algebraic=true}
\begin{pspicture}(-2.3, -0.6)(2.3,3.4)
\tiny
\psframe*[linecolor=white](-2.3,-0.6)(2.3,3.4)
\pscustom*[linecolor=\fcColorAreaUnderGraph]{
\parametricplot[linecolor=\fcColorGraph]{2.617993878}{0.523598776}{(1+sin(t))*cos(t)|(1+sin(t))*sin(t)}
\parametricplot[linecolor=\fcColorGraph]{0.523598776}{2.617993878}{(3*sin(t))*cos(t)|(3*sin(t))*sin(t)}
}
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000] {0}{6.283185307}{(1+sin(t))*cos(t)|(1+sin(t))*sin(t)}
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000] {0}{6.283185307}{(3*sin(t))*cos(t)|(3*sin(t))*sin(t)}
\fcAxesStandardNoFrame{-2.3}{-0.5}{2.2}{3.3}
\uncover<2->{
\psline[linecolor=\fcColorTangent](0, 0)(! 2 2 3 sqrt div)
\psline[linecolor=\fcColorTangent](0, 0)(! -2 2 3 sqrt div)
\fcFullDot{1.299038106}{0.75}
\fcFullDot{-1.299038106}{0.75}
\rput[t](1.8, 0.8){$\theta=\frac{\pi}{6}$}
\rput[t](-1.8, 0.8){$\theta=\frac{5\pi}{6}$}
}
\rput[l](1, 2.8){$r=3\sin\theta$}
\rput[t](-1.2, -0.35){$r=1+\sin\theta$}
\end{pspicture}
%\ \uncover<2->{%
%\includegraphics[height=4cm]{polar-curves/pictures/11-04-ex2.pdf}%
%}%

\uncover<2->{%
The curves meet if
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
3\sin \theta & = & 1 + \sin \theta\\
\sin \theta & = & \frac{1}{2}\\
\theta & = &\frac{\pi}{6}, \ \frac{5\pi}{6}
\end{eqnarray*}
}%
\column{.65\textwidth}
%\begin{eqnarray*}
$
{\renewcommand{\arraystretch}{1.7}
\begin{array}{l}
 \uncover<3->{ A = } %
\uncover<3->{%
\frac{1}{2}\int_{\frac{\pi}{6}}^{\frac{5\pi}{6}}(3\sin \theta )^2\diff \theta%
%}\\%
%&&\uncover<3->{%
- \frac{1}{2}\int_{\frac{\pi}{6}}^{\frac{5\pi}{6}}(1+\sin \theta )^2\diff \theta%
}\\%
 \uncover<4->{\phantom{A} = } %
\uncover<4->{%
\frac{1}{2} \int_{\frac{\pi}{6}}^{\frac{5\pi}{6}}\left( 9\sin^2\theta - (1 + 2\sin \theta + \sin^2\theta)\right)\diff \theta%
}\\%
 \uncover<5->{\phantom{A} = } %
\uncover<5->{%
\alert<handout:0| 6>{\frac{1}{2}} \int_{\alert<handout:0| 6>{\frac{\pi}{6}}}^{\alert<handout:0| 6>{\frac{5\pi}{6}}}\left( 8\sin^2\theta - 1 - 2\sin \theta\right)\diff \theta%
}\\%
 \uncover<6->{\phantom{A} = } %
\uncover<6->{%
\int_{\alert<handout:0| 6>{\frac{\pi}{6}}}^{\alert<handout:0| 6>{\frac{\pi}{2}}}\left( \alert<handout:0| 7>{8\sin^2\theta - 1} - 2\sin \theta\right)\diff \theta%
}\\%
 \uncover<7->{\phantom{A} = } %
\uncover<7->{%
\int_{\alert<handout:0| 6>{\frac{\pi}{6}}}^{\alert<handout:0| 6>{\frac{\pi}{2}}}\left( \alert<handout:0| 7>{3 - 4\cos 2\theta } - 2\sin \theta\right)\diff \theta%
}\\%
 \uncover<8->{\phantom{A} = } %
\uncover<8->{%
\left[ 3\alert<handout:0| 9-10,15-16>{\theta} - 2\alert<handout:0| 11-12,17-18>{\sin 2\theta} + 2\alert<handout:0| 13-14,19-20>{\cos \theta} \right]_{\alert<handout:0| 15-20>{\frac{\pi}{6}}}^{\alert<handout:0| 9-14>{\frac{\pi}{2}}}%
}\\%
 \uncover<9->{\phantom{A} = } %
\uncover<9->{%
\left( 3\alert<handout:0| 10>{\uncover<10->{\frac{\pi}{2}}} - 2\cdot \alert<handout:0| 12>{\uncover<12->{0}} + 2\cdot \alert<handout:0| 14>{\uncover<14->{0}}\right) - \left( 3\alert<handout:0| 16>{\uncover<16->{\frac{\pi}{6}}} - 2\alert<handout:0| 18>{\uncover<18->{\frac{\sqrt{3}}{2}}} + 2\alert<handout:0| 20>{\uncover<20->{\frac{\sqrt{3}}{2}}}\right)%
}\\%
 \uncover<21->{\phantom{A} = } %
\uncover<21->{%
\pi%
}%
\end{array}
}%
$
\end{columns}
\end{example}
\end{frame}
% end module polar-area-ex2



}% end lecture

\lect{Spring 2015}{Lecture 18}{18}{
\section{Modeling with Differential Equations}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/diff-eq-def.tex
% begin module diff-eq-def
\begin{frame}
\frametitle{Modeling with Differential Equations}
\begin{itemize}
\item  When modeling real-world problems, we often have a relationship between an unknown function and some of its derivatives.  
\item  Such a relationship is called a differential equation.
\item  It is not always possible to find an explicit solution to a differential equation, but sometimes a graphical or approximate answer can be good enough for applications.
\end{itemize}
\end{frame}
% end module diff-eq-def



\subsection{Models of Population Growth}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/diff-eq-natural-growth.tex
% begin module diff-eq-natural-growth
\begin{frame}
\frametitle{Models of Population Growth}
\begin{itemize}
\item  One model for population growth assumes that the population grows at a rate proportional to its size.
\item  In other words, if a certain number of bacteria produce a certain number of offspring in a certain time, then ten times that many bacteria produce ten times that many offspring in the same time.
\item  This is plausible when the population has unlimited food and environment and no restrictions on its size.
\item<2->  Name the variables:
\uncover<2->{%
\begin{quote}
$t = $ time %(the independent variable)

$P = $ the number of individuals in the population %(the dependent variable)
\end{quote}
}%
\item<3->  The rate of growth is $\diff P/\diff t$.
\item<4->  Then ``rate of growth proportional to population size'' means
\end{itemize}
\uncover<4->{%
\[
\frac{\diff P}{\diff t} = k P
\]
where $k$ is the proportionality constant.
}%
\end{frame}
% end module diff-eq-natural-growth



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/diff-eq-natural-growth-solution.tex
% begin module diff-eq-natural-growth-solution
\begin{frame}
\begin{columns}[c]
\column{.4\textwidth}
\[
\frac{\diff P}{\diff t} = k P
\]
\column{.6\textwidth}
\psset{xunit=0.5cm, yunit=0.5cm}
\begin{pspicture}(-2.200000, -3.836002)(2.200000,3.836002)
\tiny
\fcAxesStandard{-2.000000}{-3.686002}{2.000000}{3.66}
\uncover<10>{
%Function formula: -1/5 e^{x}
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.000000}{2.000000}{2.718281828 x exp -0.2000000 mul }
%Function formula: -1/2 e^{x}
\psplot[linecolor=blue, plotpoints=1000]{-2.000000}{2.000000}{2.718281828 x exp -0.5000000 mul }
%Function formula: -2/5 e^{x}
\psplot[linecolor=cyan, plotpoints=1000]{-2.000000}{2.000000}{2.718281828 x exp -0.4000000 mul }
%Function formula: -3/10 e^{x}
\psplot[linecolor=brown, plotpoints=1000]{-2.000000}{2.000000}{2.718281828 x exp -0.3000000 mul }
}
\uncover<10->{%
%Function formula: 3/10 e^{x}
\psplot[linecolor=orange, plotpoints=1000]{-2.000000}{2.000000}{2.718281828 x exp 0.3000000 mul }
%Function formula: 2/5 e^{x}
\psplot[linecolor=magenta, plotpoints=1000]{-2.000000}{2.000000}{2.718281828 x exp 0.4000000 mul }
%Function formula: 1/2 e^{x}
\psplot[linecolor=green, plotpoints=1000]{-2.000000}{2.000000}{2.718281828 x exp 0.5000000 mul }
%Function formula: 1/5 e^{x}
\psplot[linecolor=red, plotpoints=1000]{-2.000000}{2.000000}{2.718281828 x exp 0.2000000 mul }
}
\end{pspicture}

%\ \only<handout:0| -9>{%
%\includegraphics[height=4cm]{diff-eq-models/pictures/10-01-natgrowtha.pdf}%
%}%
%\only<handout:0| 10>{%
%\includegraphics[height=4cm]{diff-eq-models/pictures/10-01-natgrowthb.pdf}%
%}%
%\only<11->{%
%\includegraphics[height=4cm]{diff-eq-models/pictures/10-01-natgrowthc.pdf}%
%}%
\end{columns}
\begin{itemize}
\item  This is a differential equation.
\item<2->  Exponential functions satisfy this condition.
\item<3->  Let $\alert<handout:0| 8>{P(t) = Ce^{kt}}$ ($C$ is a constant).  Then
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<4->{%
\frac{\diff P}{\diff t} = %
}%
\uncover<5->{%
\frac{\diff}{\diff t} (Ce^{kt}) = %
}%
\uncover<6->{%
 Cke^{kt} = %
}%
\uncover<7->{%
 k\alert<handout:0| 8>{Ce^{kt}} = %
}%
\uncover<8->{%
 k\alert<handout:0| 8>{P(t)} %
}%
\]
\item<9->  Therefore any function of the form $P(t) = Ce^{kt}$ satisfies the equation.  We will see later that there is no other solution.
\item<10->  Letting $C$ vary over the real numbers gives a family of solutions.
\item<11->  Since populations are non-negative, only solutions with $C > 0$ are relevant.
\end{itemize}
\end{frame}
% end module diff-eq-natural-growth-solution



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/diff-eq-logistic.tex
% begin module diff-eq-logistic
\begin{frame}
\begin{itemize}
\item  This model works well under ideal conditions.
\item  In real life, most populations are constrained by the environment, the amount of food, etc.
\item  Many populations start by increasing exponentially, but then level off when they approach some upper bound, called the carrying capacity $K$.
\item<2->  To take this into account, make two assumptions:
\begin{itemize}
\item<2->  $\frac{\diff P}{\diff t} \approx kP$ if $P$ is small (Initially, the growth rate is proportional to $P$).
\item<2->  $\frac{\diff P}{\diff t} < 0$ if $P > K$ ($P$ decreases if it ever exceeds $K$).
\end{itemize}
\item<3->  Here is an expression that takes both assumptions into account:
\[
\uncover<3->{%
\frac{\diff P}{\diff t} = kP\left( 1 - \frac{P}{K}\right)
}%
\]
\item<4->  This is called the logistic differential equation.
\end{itemize}
\end{frame}
% end module diff-eq-logistic



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/diff-eq-logistic-graph.tex
% begin module diff-eq-logistic-graph
\begin{frame}
\[
\frac{\diff P}{\diff t} = kP\left( 1 - \frac{P}{K}\right)
\]
\begin{itemize}
\item  What do the solutions look like?
\item<2->  $P = 0$ and $P = K$ are special solutions, called equilibrium solutions.
\item<3->  If $P > K$, then $1 - P/K < 0$ , so $\diff P/ \diff t < 0$, and $P$ decreases.
\item<4->  If $P < K$, then $1 - P/K > 0$, so $\diff P/\diff t > 0$, and $P$ increases.
\item<5->  As $P \rightarrow K$, $1 - P/K \rightarrow 0$, so $\diff P/\diff t \rightarrow 0$ and $P$ levels off.
\end{itemize}
\begin{center}

\psset{xunit=0.8cm, yunit=0.8cm}
\begin{pspicture}(-2.000000, -0.700000)(3.200000,5.2) 
\tiny 
\psaxes[ticks=none, labels=none, arrows=<->](0, 0)(-2, -0.550000)(5.000000, 3.873671)
\rput[t](5.000000, -0.1){$t$}
\rput[r](-0.1,3.873671){$P$}

\uncover<2->{
\psline(-1.95, 1)( 5,1)
\rput[rt](-0.05, 0.95){$P=K$}
\rput[rt](-0.05, -0.05){$P=0$}
}

\uncover<3->{
%Function formula: \frac{3/2*e^{x}}{3/2*e^{x}-1/2} 
\psplot[linecolor=red, plotpoints=1000]{-0.800000}{5.000000}{2.718281828 x exp 1.5000000 mul -0.5000000 2.718281828 x exp 1.5000000 mul add div }

%Function formula: \frac{7/5*e^{x}}{7/5*e^{x}-2/5} 
\psplot[linecolor=purple, plotpoints=1000]{-0.9}{5.000000}{2.718281828 x exp 1.4000000 mul -0.4000000 2.718281828 x exp 1.4000000 mul add div }

%Function formula: \frac{13/10*e^{x}}{13/10*e^{x}-3/10} 
\psplot[linecolor=green, plotpoints=1000]{-1.100000}{5.000000}{2.718281828 x exp 1.3000000 mul -0.3000000 2.718281828 x exp 1.3000000 mul add div }

%Function formula: \frac{11/10*e^{x}}{11/10*e^{x}-1/10} 
\psplot[linecolor=brown, plotpoints=1000]{-1.95}{5.000000}{2.718281828 x exp 1.1000000 mul -0.1000000 2.718281828 x exp 1.1000000 mul add div }
}

\uncover<4->{
%Function formula: \frac{2/5*e^{x}}{2/5*e^{x}+3/5} 
\psplot[linecolor=orange, plotpoints=1000]{-1.95}{5.000000}{2.718281828 x exp 0.4000000 mul 0.6000000 2.718281828 x exp 0.4000000 mul add div }

%Function formula: \frac{3/10*e^{x}}{3/10*e^{x}+7/10} 
\psplot[linecolor=blue, plotpoints=1000]{-1.95}{5.000000}{2.718281828 x exp 0.3000000 mul 0.7000000 2.718281828 x exp 0.3000000 mul add div }

%Function formula: \frac{1/5*e^{x}}{1/5*e^{x}+4/5} 
\psplot[linecolor=red, plotpoints=1000]{-1.95}{5.000000}{2.718281828 x exp 0.2000000 mul 0.8000000 2.718281828 x exp 0.2000000 mul add div }

%Function formula: \frac{1/10*e^{x}}{1/10*e^{x}+9/10} 
\psplot[linecolor=cyan, plotpoints=1000]{-1.95}{5.000000}{2.718281828 x exp 0.1000000 mul 0.9000000 2.718281828 x exp 0.1000000 mul add div }
}
\end{pspicture} 


%\ \only<handout:0| -1>{%
%\includegraphics[height=4cm]{diff-eq-models/pictures/10-01-logistica.pdf}%
%}%
%\only<handout:0| 2>{%
%\includegraphics[height=4cm]{diff-eq-models/pictures/10-01-logisticb.pdf}%
%}%
%\only<handout:0| 3-4>{%
%\includegraphics[height=4cm]{diff-eq-models/pictures/10-01-logisticc.pdf}%
%}%
%\only<5->{%
%\includegraphics[height=4cm]{diff-eq-models/pictures/10-01-logisticd.pdf}%
%}%
\end{center}
\end{frame}
% end module diff-eq-logistic-graph



\subsection{A Model for the Motion of a Spring}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/diff-eq-spring.tex
% begin module diff-eq-spring
\begin{frame}
\frametitle{A Model for the Motion of a Spring}
\begin{itemize}
\item  Suppose we have an object with mass $m$ attached to a spring.
\item  Hooke's Law: if the spring is stretched or compressed $x$ units from its natural length, then it exerts a force that is proportional to $x$.
\item  Force equals mass times acceleration.
\item  Acceleration is the second derivative of displacement with respect to time.
\[
m\frac{\diff^2 x}{\diff t^2} = -kx
\]
\item<2->  This is called a second-order differential equation because it involves second derivatives.
\item<3->  Sine and cosine functions are solutions.
\end{itemize}
\end{frame}
% end module diff-eq-spring



\subsection{General Differential Equations}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/diff-eq-terminology.tex
% begin module diff-eq-terminology
\begin{frame}
\frametitle{General Differential Equations}
\begin{definition}[Differential Equation]
A differential equation is an equation that contains an unknown function and some of its derivatives.
\end{definition}
\begin{definition}[Order of a Differential Equation]
The order of a differential equation is the highest derivative that appears in it.
\end{definition}
\begin{definition}[Solution]
A function $f$ is called a solution of a differential equation if the equation is satisfied when $f$ and its derivatives are plugged in.
\end{definition}
\begin{definition}[To Solve a Differential Equation]
When we are asked to solve a differential equation we are expected to find all possible solutions.
\end{definition}
\end{frame}
% end module diff-eq-terminology



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/diff-eq-ex1.tex
% begin module diff-eq-ex1
\begin{frame}
\begin{example} %[Example 1, p. 606]
Show that every member of the family of functions 
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
y = \frac{1 + ce^t}{1-ce^t}
\]
is a solution of the differential equation $\alert<handout:0| 2-4>{y'} = \alert<handout:0| 5->{\frac{1}{2} (y^2 - 1)}$.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\textrm{LHS} %
}%
& \uncover<2->{ = } &%
\uncover<2->{%
\frac{(1-ce^t)(ce^t) - (1+ce^t)(-ce^t)}{(1-ce^t)^2}%
}\\%
& \uncover<3->{ = } &%
\uncover<3->{%
\frac{ce^t - c^2 e^{2t} + ce^t + c^2 e^{2t}}{(1-ce^t)^2}%
}  \uncover<4->{ = } \uncover<4->{%
\alert<handout:0| 9>{\frac{2ce^t}{(1-ce^t)^2}}%
}\\%
\end{eqnarray*}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<5->{%
\textrm{RHS} %
} 
& \uncover<5->{ = } & 
\uncover<5->{%
\frac{1}{2}\left[ \left( \frac{1+ce^t}{1-ce^t}\right)^2 - 1\right]
} \uncover<6->{ = } \uncover<6->{%
\frac{1}{2}\left[  \frac{(1+ce^t)^2 - (1-ce^t)^2}{(1-ce^t)^2} \right]
}\\ 
& \uncover<7->{ = } &
\uncover<7->{%
\frac{1}{2}\left[  \frac{1+2ce^t +c^2e^{2t} - 1 + 2ce^t - c^2e^{2t}}{(1-ce^t)^2} \right]
}\\
 & \uncover<8->{ = } & %
\uncover<8->{%
\frac{1}{2}  \frac{4ce^t }{(1-ce^t)^2} 
} \uncover<9->{ = } \uncover<9->{%
  \alert<handout:0| 9>{\frac{2ce^t }{(1-ce^t)^2}} \uncover<10->{= \textrm{LHS}}
}\\%
\end{eqnarray*}
\end{example}
\end{frame}
% end module diff-eq-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/diff-eq-initial-condition.tex
% begin module diff-eq-initial-condition
\begin{frame}
\begin{itemize}
\item  Often we don't want to find all solutions (the general solution).
\item  Instead, we only want to find a single solution that satisfies some additional requirement.
\item  Often that requirement has the form $y(t_0) = y_0$.
\item  This is called an initial condition.
\item  This type of problem is called an initial value problem.
\end{itemize}
\end{frame}
% end module diff-eq-initial-condition



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/diff-eq-initial-condition-ex2.tex
% begin module diff-eq-initial-condition-ex2
\begin{frame}
\begin{example} %[Example 2, p. 606]
Find a solution of the differential equation $y' = \frac{1}{2}(y^2 - 1)$ that satisfies the initial condition $y(0) = 2$.

\uncover<2->{%
Substitute $t = 0$ and $y = 2$ into the formula 
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
y = \frac{1+ce^t}{1-ce^t}
\]
from Example 1.
}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<3->{%
2 %
}%
& \uncover<3->{ = } &%
\uncover<3->{%
\frac{1+ce^0}{1-ce^0}
} \uncover<4->{ = } \uncover<4->{%
\frac{1+c}{1-c}
}\\%
\uncover<5->{%
2(1-c) %
}%
& \uncover<5->{ = } &%
\uncover<5->{%
1+c%
}\\%
\uncover<6->{%
2-2c %
}%
& \uncover<6->{ = } &%
\uncover<6->{%
1+c%
}\\%
\uncover<7->{%
c %
}%
& \uncover<7->{ = } &%
\uncover<7->{%
1 / 3
}\\%
\end{eqnarray*}

\uncover<8->{%
Therefore the solution to the initial-value problem is
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
y = \frac{1+\frac{1}{3}e^t}{1 - \frac{1}{3} e^t} = \frac{3 + e^t}{3 - e^t}.
\]
}%
\end{example}
\end{frame}
% end module diff-eq-initial-condition-ex2



\section{Direction Fields and Euler's Method}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-direction-fields/direction-fields-intro.tex
% begin module direction-fields-intro
\begin{frame}
\frametitle{Direction Fields and Euler's Method} 
\begin{itemize}
\item  Often we don't know how to find explicit solutions to a differential equation.
\item  Nevertheless, we can learn a lot about the solutions using:
\begin{itemize}
\item  A graphical approach (direction fields)
\item  A numerical approach (Euler's method)
\end{itemize}
\item<2->  Today we will discuss direction fields, but not Euler's method.
\end{itemize}
\end{frame}
% end module direction-fields-intro



\subsection{Direction Fields}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-direction-fields/direction-fields-procedure.tex
% begin module direction-fields-procedure
\begin{frame}
\frametitle{Direction Fields}
\begin{itemize}
\item  How do we sketch the graph of the solution to $y' = x + y$ that satisfies the initial condition $y(0) = 1$?
\item<2->  Make a table of values of $y'$.
\end{itemize}
\begin{columns}[c]

\column{.25\textwidth}
\uncover<2->{%
\[%
\begin{array}{|c|r|}
\hline
\textrm{Point} & y' \\
\hline
\alert<handout:0| 3-4>{(1,0)}&%
\alert<handout:0| 3-4>{\uncover<4->{1}}\\%
\alert<handout:0| 5-6>{(-1,0)}&%
\alert<handout:0| 5-6>{\uncover<6->{-1}}\\%
\alert<handout:0| 7-8>{(0,1)}&%
\alert<handout:0| 7-8>{\uncover<8->{1}}\\%
\alert<handout:0| 9-10>{(0,-1)}&%
\alert<handout:0| 9-10>{\uncover<10->{-1}}\\%
\alert<handout:0| 11-12>{(0,0)}&%
\alert<handout:0| 11-12>{\uncover<12->{0}}\\%
\alert<handout:0| 13-14>{(1,1)}&%
\alert<handout:0| 13-14>{\uncover<14->{2}}\\%
\alert<handout:0| 15-16>{(1,-1)}&%
\alert<handout:0| 15-16>{\uncover<16->{0}}\\%
\alert<handout:0| 17-18>{(-1,1)}&%
\alert<handout:0| 17-18>{\uncover<18->{0}}\\%
\alert<handout:0| 19-20>{(-1,-1)}&%
\alert<handout:0| 19-20>{\uncover<20->{-2}}\\%
\hline
\end{array}
\]%
}%


\column{.45\textwidth}
\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-2.8,-2.8)(2.8,2.8)
\tiny
\fcAxesStandard{-2.7}{-2.7}{2.7}{2.7}%
%WARNING THE LATEX MESSES UP WHITE SPACE. DO NOT USE SPACES
\fcXTickWithLabel{1}{$1$}%
\fcXTickWithLabel{2}{$2$}%
\uncover<4-33>{%
\fcDirectionFieldOneTangent{x y add}{1}{0}{0.2}{0.02}{linecolor=blue}%
}%
\uncover<6-33>{%
\fcDirectionFieldOneTangent{x y add}{-1}{0}{0.2}{0.02}{linecolor=blue}%
}%
\uncover<8-33>{%
\fcDirectionFieldOneTangent{x y add}{0}{1}{0.2}{0.02}{linecolor=blue}%
}%
\uncover<10-33>{%
\fcDirectionFieldOneTangent{x y add}{0}{-1}{0.2}{0.02}{linecolor=blue}%
}%
\uncover<12-33>{%
\fcDirectionFieldOneTangent{x y add}{0}{0}{0.2}{0.02}{linecolor=blue}%
}%
\uncover<14-33>{%
\fcDirectionFieldOneTangent{x y add}{1}{1}{0.2}{0.02}{linecolor=blue}%
}%
\uncover<16-33>{%
\fcDirectionFieldOneTangent{x y add}{1}{-1}{0.2}{0.02}{linecolor=blue}%
}%
\uncover<18-33>{%
\fcDirectionFieldOneTangent{x y add}{-1}{1}{0.2}{0.02}{linecolor=blue}%
}%
\uncover<20-33>{%
\fcDirectionFieldOneTangent{x y add}{-1}{-1}{0.2}{0.02}{linecolor=blue}%
}%
\uncover<23>{%
\psline(-2.5,2.5)(2.5,-2.5)%
}%
\uncover<24>{%
\multido{\ra=-2.5+0.5}{11}{%
\fcDirectionFieldOneTangent{x y add}{\ra}{\ra\space -1 mul} {0.2}{0.02}{linecolor=red}%
}%
}%
\uncover<25-33>{%
\multido{\ra=-2.5+0.5}{11}{%
\fcDirectionFieldOneTangent{x y add}{\ra}{\ra\space -1 mul} {0.2}{0.02}{linecolor=blue}%
}%
}%
\uncover<25>{%
\psline(-2,2.5)(2.5,-2)%
}%
\uncover<26>{%
\multido{\ra=-2.5+0.5}{10}{%
\fcDirectionFieldOneTangent{x y add}{\ra\space 0.5 add}{\ra\space -1 mul} {0.2}{0.02}{linecolor=red}%
}%
}%
\uncover<27-33>{%
\multido{\ra=-2.5+0.5}{10}{%
\fcDirectionFieldOneTangent{x y add}{\ra\space 0.5 add}{\ra\space -1 mul} {0.2}{0.02}{linecolor=blue}%
}%
}%
\uncover<27>{%
\psline(-1.5,2.5)(2.5,-1.5)%
}%
\uncover<28>{%
\multido{\ra=-2.5+0.5}{9}{%
\fcDirectionFieldOneTangent{x y add}{\ra\space 1 add}{\ra\space -1 mul} {0.2}{0.02}{linecolor=red}%
}%
}%
\uncover<28-33>{%
\multido{\ra=-2.5+0.5}{9}{%
\fcDirectionFieldOneTangent{x y add}{\ra\space 1 add}{\ra\space -1 mul} {0.2}{0.02}{linecolor=blue}%
}%
}%
\uncover<29>{%
\psline(-2.5,2)(2,-2.5)%
}%
\uncover<30-33>{%
\multido{\ra=-2.5+0.5}{10}{%
\fcDirectionFieldOneTangent{x y add}{\ra}{\ra\space -1 mul 0.5 sub} {0.2}{0.02}{linecolor=red}%
}%
}%
\uncover<31-33>{%
\multido{\ra=-2.5+0.5}{10}{%
\fcDirectionFieldOneTangent{x y add}{\ra}{\ra\space -1 mul 0.5 sub} {0.2}{0.02}{linecolor=blue}%
}%
}%
\uncover<31>{%
\psline(-2.5,1.5)(1.5,-2.5)%
}%
\uncover<32>{%
\multido{\ra=-2.5+0.5}{9}{%
\fcDirectionFieldOneTangent{x y add}{\ra}{\ra\space -1 mul 1 sub} {0.2}{0.02}{linecolor=red}%
}%
}%
\uncover<33>{%
\multido{\ra=-2.5+0.5}{9}{%
\fcDirectionFieldOneTangent{x y add}{\ra}{\ra\space -1 mul 1 sub} {0.2}{0.02}{linecolor=blue}%
}%
}%
\uncover<34->{%
\fcDirectionFieldDefault{x y add}{-2.5}{-2.5}{0.5}{11}%
}%
\uncover<35->{%
%Function formula: 2 e^{x}- x-1
\psplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.7}{0.814045}{-1 x -1 mul add 2.718281828 x exp 2 mul add }
}%
\end{pspicture}

%\ \only<handout:0| -3>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfielda.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldb.pdf}%
%}%
%\only<handout:0| 5>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldc.pdf}%
%}%
%\only<handout:0| 6>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldd.pdf}%
%}%
%\only<handout:0| 7>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfielde.pdf}%
%}%
%\only<handout:0| 8>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldf.pdf}%
%}%
%\only<handout:0| 9>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldg.pdf}%
%}%
%\only<handout:0| 10>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldh.pdf}%
%}%
%\only<handout:0| 11>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldi.pdf}%
%}%
%\only<handout:0| 12>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldj.pdf}%
%}%
%\only<handout:0| 13>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldk.pdf}%
%}%
%\only<handout:0| 14>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldl.pdf}%
%}%
%\only<handout:0| 15>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldm.pdf}%
%}%
%\only<handout:0| 16>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldn.pdf}%
%}%
%\only<handout:0| 17>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldo.pdf}%
%}%
%\only<handout:0| 18>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldp.pdf}%
%}%
%\only<handout:0| 19>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldq.pdf}%
%}%
%\only<handout:0| 20>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldr.pdf}%
%}%
%\only<handout:0| 21-22>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfields.pdf}%
%}%
%\only<handout:0| 23>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldt.pdf}%
%}%
%\only<handout:0| 24>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldu.pdf}%
%}%
%\only<handout:0| 25>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldv.pdf}%
%}%
%\only<handout:0| 26>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldw.pdf}%
%}%
%\only<handout:0| 27>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldx.pdf}%
%}%
%\only<handout:0| 28>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldy.pdf}%
%}%
%\only<handout:0| 29>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldz.pdf}%
%}%
%\only<handout:0| 30>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldaa.pdf}%
%}%
%\only<handout:0| 31>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldab.pdf}%
%}%
%\only<handout:0| 32>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldac.pdf}%
%}%
%\only<handout:0| 33>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldad.pdf}%
%}%
%\only<handout:0| 34>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldae.pdf}%
%}%
%\only<35>{%
%\includegraphics[height=5cm]{diff-eq-direction-fields/pictures/10-02-dirfieldaf.pdf}%
%}%

\column{.3\textwidth}
\uncover<22->{%
\[%
\begin{array}{|l|r|}
\hline
\textrm{Line} & y' \\
\hline
\alert<handout:0| 23-24>{y = -x}&%
\alert<handout:0| 23-24>{\uncover<24->{0}}\\%
\alert<handout:0| 25-26>{y = -x+\frac{1}{2}}&%
\alert<handout:0| 25-26>{\uncover<26->{\frac{1}{2}}}\\%
\alert<handout:0| 27-28>{y = -x+1}&%
\alert<handout:0| 27-28>{\uncover<28->{1}}\\%
\alert<handout:0| 29-30>{y = -x-\frac{1}{2}}&%
\alert<handout:0| 29-30>{\uncover<30->{-\frac{1}{2}}}\\%
\alert<handout:0| 31-32>{y = -x-1}&%
\alert<handout:0| 31-32>{\uncover<32,33,34,35->{-1}}\\%
\hline
\end{array}
\]%
}%
\end{columns}
\end{frame}
% end module direction-fields-procedure



\section{Separable Equations}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-separable/diff-eq-separable-def.tex
% begin module diff-eq-separable-def
\begin{frame}
\frametitle{Separable Equations}
In this section, we will discuss a type of differential equation, called a separable equation, for which it is possible to find an explicit solution.

\begin{definition}[Separable Equation]
A separable equation is a first-order equation in which the expression for $\diff y/\diff x$ can be factored as a function of $x$ times a function of $y$.  In other words,
\[
\frac{\diff y}{\diff x} = g(x)f(y).
\]
\end{definition}

\uncover<2->{%
Let $f(y) = 1/h(y)$.  Then
\[
\frac{\diff y}{\diff x} = \frac{g(x)}{h(y)}.
\]
}%
\end{frame}
% end module diff-eq-separable-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-separable/diff-eq-separable-solution.tex
% begin module diff-eq-separable-solution
\begin{frame}
\[
\frac{\diff y}{\diff x} = \frac{g(x)}{h(y)}.
\]
\begin{itemize}
\item<2->  To solve, write this in differential form:
\uncover<2->{%
\abovedisplayskip=0pt
\belowdisplayshortskip=0pt
\belowdisplayskip=0pt
\[
h(y) \diff y = g(x)\diff x
\]
}%
\item<3->  Now integrate:
\uncover<3->{%
\abovedisplayskip=0pt
\belowdisplayshortskip=0pt
\belowdisplayskip=0pt
\[
\int h(y) \diff y = \int g(x)\diff x
\]
}%
\item<4->  This defines $y$ implicitly as a function of $x$.
\item<5->  Sometimes we might be able to solve explicitly for $y$ in terms of $x$.
\end{itemize}
\end{frame}

\begin{frame}
Why does this process yield a function that satisfies the original differential equation?  Suppose that $\int h(y) \diff y = \int g(x) \diff x$.  Then we will use the Chain Rule to show that $y$ satisfies the original equation.
\begin{eqnarray*}
\int h(y) \diff y & = & \int g(x) \diff x\\
\uncover<2->{%
\frac{\diff}{\diff x}\left( \int h(y)\diff y\right)%
}%
& \uncover<2->{ = } &%
\uncover<2->{%
\frac{\diff}{\diff x}\left( \int g(x)\diff x\right)%
}\\%
\uncover<3->{%
\frac{\diff}{\diff y}\left( \int h(y)\diff y\right)\frac{\diff  y}{\diff x}%
}%
& \uncover<3->{ = } &%
\uncover<3->{%
\frac{\diff}{\diff x}\left( \int g(x)\diff x\right)%
}\\%
\uncover<4->{%
h(y) \frac{\diff y}{\diff x}%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
g(x)%
}\\%
\frac{\diff y}{\diff x} & = & \frac{g(x)}{h(y)}
\end{eqnarray*}
\end{frame}
% end module diff-eq-separable-solution



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-separable/diff-eq-separable-ex1.tex
% begin module diff-eq-separable-ex1
\begin{frame}
\begin{example} %[Example 1, p. 617]
Solve the differential equation $\frac{\diff y}{\diff x} = \frac{x^2}{y^2}$, and find the solution that satisfies the intial condition $y(0) = 2$.
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
y^2 \diff y %
}%
& \uncover<2->{ = } &%
\uncover<2->{%
x^2 \diff x %
}\\%
\uncover<3->{%
\int y^2 \diff y %
}%
& \uncover<3->{ = } &%
\uncover<3->{%
\int x^2 \diff x %
}\\%
\uncover<4->{%
\frac{y^3}{3}%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\frac{x^3}{3} + C
}\\%
\uncover<5->{%
y%
}%
& \uncover<5->{ = } &%
\uncover<5->{%
\sqrt[3]{x^3 + 3C}%
}\\%
\uncover<6->{%
y%
}%
& \uncover<6->{ = } &%
\uncover<6->{%
\sqrt[3]{x^3 + K}%
}%
\end{eqnarray*}
\uncover<7->{%
To find the solution satisfying the initial condition, set $2 = y(0) = \sqrt[3]{0^3 + K} = \sqrt[3]{K}$.  %
}%
\uncover<8->{%
Then $\sqrt[3]{K} = 2$, so $K = 8$.%
}%
\uncover<9->{%
\belowdisplayskip=0pt
\abovedisplayskip=0pt
\[
y = \sqrt[3]{x^3 + 8}.
\]
}%
\end{example}
\end{frame}
% end module diff-eq-separable-ex1



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-separable/diff-eq-separable-ex3.tex
% begin module diff-eq-separable-ex3
\begin{frame}
\begin{example} %[Example 3, p. 617]
Solve the equation $\alert<handout:0| 9>{y' =} \alert<handout:0| 9>{x^2y}$.
\belowdisplayskip=0pt
\abovedisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\frac{\diff y}{\diff x}%
}%
& \uncover<2->{ = } &%
\uncover<2->{%
x^2y%
}\\%
\uncover<3->{%
\frac{1}{y}\diff y%
}%
& \uncover<3->{ = } &%
\uncover<3->{%
x^2\diff x \qquad y\neq 0%
}\\%
\uncover<4->{%
\int \frac{1}{y}\diff y%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\int x^2\diff x%
}\\%
\uncover<5->{%
\ln |y|%
}%
& \uncover<5->{ = } &%
\uncover<5->{%
\frac{1}{3}x^3 + C%
}\\%
\uncover<6->{%
e^{\ln |y|}%
}%
& \uncover<6->{ = } &%
\uncover<6->{%
e^{x^3/3 + C}%
}\\%
\uncover<7->{%
\alert<handout:0| 8>{|}y\alert<handout:0| 8>{|}%
}%
& \uncover<7->{ = } &%
\uncover<7->{%
e^Ce^{x^3/3}%
}\\%
\uncover<8->{%
y%
}%
& \uncover<8->{ = } &%
\uncover<8->{%
\alert<handout:0| 8,10>{\pm} \alert<handout:0| 10>{e^C}e^{x^3/3}%
}%
\end{eqnarray*}
\uncover<9->{%
The function $y = 0$ satisfies the equation.  }%
\uncover<10->{ General solution:
\belowdisplayskip=0pt
\abovedisplayskip=0pt
\[
y = \alert<handout:0| 10>{A}e^{x^3/3}.
\]
\vspace{-.2in}
}%
\end{example}
\end{frame}
% end module diff-eq-separable-ex3



\subsection{Orthogonal Trajectories}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-separable/orthogonal-trajectory-def.tex
% begin module orthogonal-trajectory-def
\begin{frame}
\frametitle{Orthogonal Trajectories}
\begin{definition}[Orthogonal Trajectory]
An orthogonal trajectory to a family of curves is a curve that intersects each curve of the family orthogonally (that is, at right angles).
\end{definition}

\begin{columns}[c]
\column{.5\textwidth}
\psset{xunit=1cm, yunit=1cm}
\begin{pspicture}(-1.649994, -1.649998)(1.65,1.749998)
\tiny
\fcAxesStandard{-1.399994}{-1.399998}{1.4}{1.399998}

%Calculator input: plotCurve{}(5/4 \cos{}t, 5/4 \sin{}t, 0, 2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{0}{6.28319}{t 57.29578 mul cos 1.25 mul t 57.29578 mul sin 1.25 mul }

%Calculator input: plotCurve{}(\cos{}t, \sin{}t, 0, 2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{0}{6.28319}{t 57.29578 mul cos t 57.29578 mul sin }

%Calculator input: plotCurve{}(3/4 \cos{}t, 3/4 \sin{}t, 0, 2 \pi)
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{0}{6.28319}{t 57.29578 mul cos 0.75 mul t 57.29578 mul sin 0.75 mul }

\psline[linecolor=blue] (1.293431, 0.535757) (-1.293431, -0.535757)
\psline[linecolor=blue] (0.989949, 0.989949) (-0.989949, -0.989949)
\psline[linecolor=blue] (0.535757, 1.293431) (-0.535757, -1.293431)
\psline[linecolor=blue] (-0.535757, 1.293431) (0.535757, -1.293431)
\psline[linecolor=blue] (-0.989949, 0.989949) (0.989949, -0.989949)
\psline[linecolor=blue] (-1.293431, 0.535757) (1.293431, -0.535757)
\end{pspicture}

%\ \uncover<2->{%
%\includegraphics[height=5.5cm]{diff-eq-separable/pictures/10-03-orthcirc.pdf}%
%}%
\column{.5\textwidth}
\uncover<2->{%
Each member of the family $y = mx$ of straight lines passing through the origin is an orthogonal trajectory to the family $x^2 + y^2 = r^2$ of circles centered at the origin.
}%
\end{columns}
\end{frame}
% end module orthogonal-trajectory-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-separable/orthogonal-trajectory-ex5.tex
% begin module orthogonal-trajectory-ex5
\begin{frame}
\begin{example} %[Example 5, p. 619]
Find the orthogonal trajectories of the family $x = ky^2$, where $k$ is an arbitrary constant.  \uncover<3->{\alert<handout:0| 3>{Differentiate implicitly:}}
\begin{columns}[c]
\column{.5\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\alert<handout:0| 5>{x}%
}%
& \uncover<2->{ \alert<handout:0| 5>{=} } &%
\uncover<2->{%
\alert<handout:0| 5>{ky^2}%
}\\%
\uncover<3->{%
1%
}%
& \uncover<3->{ = } &%
\uncover<3->{%
2\alert<handout:0| 4-5>{k}y\frac{\diff y}{\diff x}%
}\\%
\uncover<4->{%
1%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
2\left(\alert<handout:0| 4-5>{\uncover<5->{\frac{x}{y^2}}}\right) y\frac{\diff y}{\diff x}%
}\\%
\uncover<6->{%
\frac{\diff y}{\diff x}%
}%
& \uncover<6->{ = } &%
\uncover<6->{%
\frac{y}{2x}%
}%
\end{eqnarray*}
\begin{center}

\psset{xunit=0.4cm, yunit=0.4cm}
\begin{pspicture}(-4.4, -3.228427)(4.4,3.317125)
\tiny
\fcAxesStandard{-4.15}{-2.978427}{4.15}{2.967125}

%Calculator input: plotCurve{}(1/2 t^{2}, t, - (8)^{1/2}, (8)^{1/2})
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.82843}{2.82843}{t 2 exp 0.5 mul t}

%Calculator input: plotCurve{}(-1/2 t^{2}, t, - (8)^{1/2}, (8)^{1/2})
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-2.82843}{2.82843}{t 2 exp -0.5 mul t}

%Calculator input: plotCurve{}(t^{2}, t, - (4)^{1/2}, (4)^{1/2})
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-2}{2}{t 2 exp t}

%Calculator input: plotCurve{}(- t^{2}, t, - (4)^{1/2}, (4)^{1/2})
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-2}{2}{t 2 exp -1 mul t}

%Calculator input: plotCurve{}(-2 t^{2}, t, - (2)^{1/2}, (2)^{1/2})
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-1.41421}{1.41421}{t 2 exp -2 mul t}

%Calculator input: plotCurve{}(2 t^{2}, t, - (2)^{1/2}, (2)^{1/2})
\parametricplot[linecolor=\fcColorGraph, plotpoints=1000]{-1.41421}{1.41421}{t 2 exp 2 mul t}
\uncover<11->{%
%Calculator input: plotCurve{}(1/2 \cos{}t, 1/2\sqrt{2} \sin{}t, 0, 2 \pi)
\parametricplot[linecolor=blue, plotpoints=1000]{0}{6.28319}{t 57.29578 mul cos 0.5 mul t 57.29578 mul sin 0.707107 mul }%
%Calculator input: plotCurve{}(3/2 \cos{}t, 3/2\sqrt{2} \sin{}t, 0, 2 \pi)
\parametricplot[linecolor=blue, plotpoints=1000]{0}{6.28319}{t 57.29578 mul cos 1.5 mul t 57.29578 mul sin 2.12132 mul }%
%Calculator input: plotCurve{}(\cos{}t, \sqrt{2} \sin{}t, 0, 2 \pi)
\parametricplot[linecolor=blue, plotpoints=1000]{0}{6.28319}{t 57.29578 mul cos t 57.29578 mul sin 1.414214 mul }%
}%
%\fcFullDot{1.081139}{1.470469}
\end{pspicture}

%\ \only<handout:0| -10>{%
%\includegraphics[height=3cm]{diff-eq-separable/pictures/10-03-ex5a.pdf}%
%}%
%\only<11->{%
%\includegraphics[height=3cm]{diff-eq-separable/pictures/10-03-ex5b.pdf}%
%}%
\end{center}
\column{.5\textwidth}
\uncover<7->{%
An orthogonal trajectory will have a slope that is the negative reciprocal of the slope of the curve.
}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<7->{%
\frac{\diff y}{\diff x}%
}%
& \uncover<7->{ = } &%
\uncover<7->{%
-\frac{2x}{y}%
}\\%
\uncover<8->{%
\int y \diff y%
}%
& \uncover<8->{ = } &%
\uncover<8->{%
-\int 2x\diff x%
}\\%
\uncover<9->{%
\frac{y^2}2%
}%
& \uncover<9->{ = } &%
\uncover<9->{%
-x^2 + C%
}\\%
\uncover<10->{%
x^2 + \frac{y^2}{2} %
}%
& \uncover<10->{ = } &%
\uncover<10->{%
C%
}%
\end{eqnarray*}
\uncover<11->{%
The ellipses $x^2 + \frac{y^2}{2} = C$ are all orthogonal trajectories to $x = ky^2$.
}%
\end{columns}
\end{example}
\end{frame}
% end module orthogonal-trajectory-ex5



\subsection{Mixing Problems}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-separable/mixing-problem-intro.tex
% begin module mixing-problem-intro
\begin{frame}
\frametitle{Mixing Problems}
\begin{itemize}
\item  Typical mixing problems involve:
\item  A tank of fixed capacity.
\item  A completely mixed solution of some substance in the tank.
\item  A solution of a certain concentration enters the tank at a fixed rate.
\item  In the tank, the solution immediately becomes completely stirred.
\item  The mixture leaves at the other end at a fixed rate (possibly a different rate).
\item<2->  Let $y(t)$ denote the amount of substance in the tank at time $t$.
\item<2->  Then $y'(t)$ denotes the rate at which the substance is being added minus the rate at which it is being removed.
\item<2->  This often gives a differential equation.
\end{itemize}
\end{frame}
% end module mixing-problem-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-separable/mixing-problem-ex6.tex
% begin module mixing-problem-ex6
\begin{frame}[t]
\begin{example} %[Example 6, p. 621]
\alert<handout:0| 5>{A tank contains 20 kg of salt} dissolved in 5000 L of water.  \alert<handout:0| 11>{Brine that contains 0.03 kg of salt per liter of water enters the tank} \alert<handout:0| 13>{at a rate of 25 L/min}.  \alert<handout:0| 16>{The solution is kept thoroughly mixed} and \alert<handout:0| 18>{drains from the tank at the same rate}.  \alert<handout:0| 7>{How much salt is in the tank after half an hour?}
\begin{itemize}
\item<2->  Let $y(t)$ denote the amount of salt (in kg) after $t$ minutes.
\item<3->  \alert<handout:0| 4-5>{Given: $y(0) = \uncover<5->{20.}$}  \alert<handout:0| 6-7>{We want to know: $\uncover<7->{y(30).}$}
\end{itemize}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<8->{%
\frac{\diff y}{\diff t}%
}%
& \uncover<8->{ = } &%
\uncover<8->{%
\textrm{(rate in) $-$ (rate out)}%
} \uncover<20->{ = 0.75 - \frac{y(t)}{200} = \frac{150 - y(t)}{200}}\\%
\uncover<9->{%
\textrm{rate in}%
}%
& \uncover<9->{ = } &%
\uncover<9->{%
\textrm{(\alert<handout:0| 10-11>{concentration in})(\alert<handout:0| 12-13>{rate of volume in})}%
}\\%
& \uncover<10->{ = } &%
\uncover<10->{%
\left(\alert<handout:0| 10-11>{\uncover<11->{0.03 \frac{\textrm{kg}}{\textrm{L}}}}\right)\left(\alert<handout:0| 12-13>{\uncover<13->{25 \frac{\textrm{L}}{\textrm{min}}}}\right)%
} \uncover<14->{ = } \uncover<14->{%
0.75 \frac{\textrm{kg}}{\textrm{min}}%
}\\%
\uncover<9->{%
\textrm{rate out}%
}%
& \uncover<9->{ = } &%
\uncover<9->{%
\textrm{(\alert<handout:0| 15-16>{concentration out})(\alert<handout:0| 17-18>{rate of volume out})}%
}\\%
& \uncover<15->{ = } &%
\uncover<15->{%
\left(\alert<handout:0| 15-16>{\uncover<16->{\frac{y(t)}{5000} \frac{\textrm{kg}}{\textrm{L}}}}\right)\left(\alert<handout:0| 17-18>{\uncover<18->{25 \frac{\textrm{L}}{\textrm{min}}}}\right)%
} \uncover<19->{ = } \uncover<19->{%
\frac{y(t)}{200} \frac{\textrm{kg}}{\textrm{min}}%
}%
\end{eqnarray*}
\end{example}
\end{frame}





\begin{frame}[t]
\begin{example}[Example 6, p. 621]
A tank contains 20 kg of salt dissolved in 5000 L of water.  Brine that contains 0.03 kg of salt per liter of water enters the tank at a rate of 25 L/min.  The solution is kept thoroughly mixed and drains from the tank at the same rate.  \alert<handout:0| 11>{How much salt is in the tank after half an hour?}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<1->{%
\frac{\diff y}{\diff t}%
}%
& \uncover<1->{ = } &%
\uncover<1->{%
\frac{150 - y(t)}{200}%
}\\%
\uncover<2->{%
\int \frac{\diff y}{150-y}%
}%
& \uncover<2->{ = } &%
\uncover<2->{%
\int \frac{\diff t}{200}%
}\\%
\uncover<3->{%
-\ln |150 - y|%
}%
& \uncover<3->{ = } &%
\uncover<3->{%
t /200 \alert<handout:0| 6>{+ C}%
}  \qquad \uncover<4->{%
y(0) = 20, \textrm{ so } \alert<handout:0| 4-6>{C = \uncover<5->{-\ln 130}}%
}\\%
\uncover<6->{%
-\ln |150 - y|%
}%
& \uncover<6->{ = } &%
\uncover<6->{%
t /200 \alert<handout:0| 6>{- \ln 130}%
}\\%
\uncover<7->{%
\uncover<-8>{\alert<handout:0| 8>{|}}150 - y\uncover<-8>{\alert<handout:0| 8>{|}}%
}%
& \uncover<7->{ = } &%
\uncover<7->{%
130e^{-t/200}%
}\\%
& & \uncover<8->{%
y < 150 = (0.03)(5000), \textrm{ so } \alert<handout:0| 8-9>{|150 - y| = 150 - y}%
}\\%
\uncover<10->{%
y%
}%
& \uncover<10->{ = } &%
\uncover<10->{%
150 - 130e^{-t/200}%
}\\%
\uncover<11->{%
y(30)%
}%
& \uncover<11->{ = } &%
\uncover<11->{%
150 - 130e^{-30/200} \approx 38.1 \textrm{kg}%
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module mixing-problem-ex6



\section{Models for Population Growth}
\subsection{The Law of Natural Growth}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/natural-growth-reminder.tex
% begin module natural-growth-reminder
\begin{frame}
\frametitle{The Law of Natural Growth}
\begin{itemize}
\item  Recall that differential equations could be used to model population growth.
\item  The Law of Natural Growth works in ideal cases, where populations are unconstrained by lack of food, or the environment.
\item  Let $P(t)$ be the population at time $t$.
\item  Then the Law of Natural Growth says:
\end{itemize}
\[
\frac{\diff P}{\diff t} = kP
\]
\begin{itemize}
\item  The constant $k$ is sometimes called the relative growth rate.
\end{itemize}
\end{frame}
% end module natural-growth-reminder



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/natural-growth-solution.tex
% begin module natural-growth-solution
\begin{frame}
\[
\frac{\diff P}{\diff t} = kP
\]

This is a separable equation, so we can solve it.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\uncover<2->{%
\int \frac{\diff P}{P}%
}%
& \uncover<2->{ = } &%
\uncover<2->{%
\int k\diff t%
}\\%
\uncover<3->{%
\ln |P|%
}%
& \uncover<3->{ = } &%
\uncover<3->{%
kt + C%
}\\%
\uncover<4->{%
 |P|%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
e^Ce^{kt}%
}\\%
\uncover<5->{%
 P%
}%
& \uncover<5->{ = } &%
\uncover<5->{%
\pm e^Ce^{kt}%
}%
\end{eqnarray*}
\begin{itemize}
\item<6->  Let $A = \pm e^C$.  Then the solution is $P = A e^{kt}$.
\item<7->  $A = \pm e^C$ can be any positive or negative number.
\item<8->  The function $P = 0$ is also a solution, so $A$ can be any number.
\item<9->  $P(0) = Ae^{k\cdot 0} = A$.
\end{itemize}
\uncover<10->{%
The solution to the initial value problem
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\frac{\diff P}{\diff t} = kP, \qquad P(0) = P_0
\]
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\textrm{is}\qquad P(t) = P_0e^{kt}.
\]
}%
\end{frame}
% end module natural-growth-solution



\subsection{The Logistic Model}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/logistic-reminder.tex
% begin module logistic-reminder
\begin{frame}
\frametitle{The Logistic Model}
\begin{itemize}
\item  The Logistic Model works in cases when the population is constrained by its environment.
\item  Let $P(t)$ be the population at time $t$.
\item  Then the Logistic Equation is:
\end{itemize}
\[
\frac{\diff P}{\diff t} = kP\left( 1 - \frac{P}{K}\right)
\]
\begin{itemize}
\item  The constant $K$ is called the carrying capacity.  It represents how many individuals the environment can sustain in the long run.
\end{itemize}
\end{frame}
% end module logistic-reminder



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/logistic-solution.tex
% begin module logistic-solution
\begin{frame}
\begin{columns}[c]
\column{.6\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{eqnarray*}
\frac{\diff P}{\diff t} & = & kP\left( 1 - \frac{P}{K}\right)\\
\uncover<2->{%
\int \frac{1}{P(1-P/K)}\diff P%
}%
& \uncover<2->{ = } &%
\uncover<2->{%
\int k\diff t%
}\\%
\uncover<3->{%
\int \frac{K}{P(K-P)}\diff P%
}%
& \uncover<3->{ = } &%
\uncover<3->{%
\int k\diff t%
}\\%
\uncover<4->{%
\int \left( \frac{1}{P} + \frac{1}{K-P}\right)\diff P%
}%
& \uncover<4->{ = } &%
\uncover<4->{%
\int k\diff t%
}\\%
\uncover<5->{%
\ln |P| - \ln |K-P|%
}%
& \uncover<5->{ = } &%
\uncover<5->{%
kt + C%
}\\%
\uncover<6->{%
\ln  \left| \frac{K-P}{P}\right|%
}%
& \uncover<6->{ = } &%
\uncover<6->{%
-kt - C%
}\\%
\uncover<7->{%
\alert<handout:0| 11>{ \frac{K-P}{P}}%
}%
& \uncover<7->{ = } &%
\uncover<7->{%
\alert<handout:0| 8>{\pm e^{-C}}e^{-kt}%
}\uncover<8->{\alert<handout:0| 11>{ = \alert<handout:0| 8>{A} e^{-kt}}}\\%
\uncover<9->{%
K%
}%
& \uncover<9->{ = } &%
\uncover<9->{%
P(1+Ae^{-kt})%
}\\%
\uncover<10->{%
P%
}%
& \uncover<10->{ = } &%
\uncover<10->{%
\frac{K}{1+Ae^{-kt}}%
}\\%
\end{eqnarray*}
\column{.4\textwidth}
\uncover<11->{%
Plug in $P(0) = P_0$:
\[
\frac{K - P_0}{P_0} = Ae^{-k\cdot 0} = A.
\]
}%
\end{columns}
\end{frame}


\begin{frame}
The solution to the initial value problem
\[
\frac{\diff P}{\diff t} = kP\left( 1 - \frac{P}{K}\right), \qquad P(0) = P_0
\]
is
\[
P = \frac{K}{1+Ae^{-kt}},\qquad A = \frac{K-P_0}{P_0}.
\]
\end{frame}
% end module logistic-solution



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/diff-eq-models/logistic-ex2.tex
% begin module logistic-ex2
\begin{frame}
\begin{example} %[Example 2, p. 631]
Write the solution of the initial value problem
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\frac{\diff P}{\diff t} = 0.08P\left( 1 - \frac{P}{1000}\right),\qquad P(0) = 100
\]
and use it to \alert<handout:0| 8>{find when the population reaches 900}.
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\uncover<2->{%
P(t) = %
\frac{1000}{1+Ae^{-0.08t}},\qquad %
}%
\uncover<2->{%
A = \alert<handout:0| 5-6>{\frac{\uncover<3->{\alert<handout:0| 3>{1000}} - \uncover<4->{\alert<handout:0| 4>{100}}}{\uncover<4->{\alert<handout:0| 4>{100}}} \uncover<5->{ = } \uncover<6->{ 9}}
}%
\]
\uncover<7->{%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\[
\textrm{Therefore}\qquad  P(t) = \frac{1000}{1+9e^{-0.08t}}.
\]
}%
%\uncover<8->{%
%The population reaches 900 when
%}%
\begin{eqnarray*}
\uncover<8->{%
\textrm{Set } \ P(t) = 900:\qquad \frac{1000}{1+9e^{-0.08t}}%
}%
& \uncover<8->{ = } & %
\uncover<8->{%
900 %
}\\%
\uncover<9->{%
1+9e^{-0.08t}%
}%
& \uncover<9->{ = } & %
\uncover<9->{%
1000/ 900 %
}\\%
\uncover<10->{%
e^{-0.08t}%
}%
& \uncover<10->{ = } & %
\uncover<10->{%
\frac{1000/ 900-1}{9}  = \frac{1}{81}%
}\\%
\uncover<11->{%
-0.08t%
}%
& \uncover<11->{ = } & %
\uncover<11->{%
-\ln 81%
}\\%
\uncover<12->{%
t%
}%
& \uncover<12->{ = } & %
\uncover<12->{%
\frac{\ln 81}{0.08} \approx 54.9%
}%
\end{eqnarray*}
\end{example}
\end{frame}
% end module logistic-ex2



}% end lecture

% begin lecture
\lect{Spring 2015}{Lecture  19}{19}{
\section{Volumes}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/volumes/volumes-intro.tex
% begin module volumes-intro
\begin{frame}
\frametitle{Volumes}
\begin{center}
\begin{pspicture}(-3,-3)(3,3)
\renewcommand{\fcScreen}{[-1 -1 -1] 0}
\pscustom*[linecolor=cyan]{%
\fcPolyLineIIId{[-2 -2 0] [-2 2 0] [2 2 0] [2 -2 0] [-2 -2 0]}%
}%
\pscustom*[linecolor=white]{%
\fcCurveIIId{0}{360}{[2 t cos mul 2 t sin mul 0]}%
}%
%\fcAxesIIId{2}{2}{2}
\fcBoxIIId[linecolor=gray]{[2 2 2]}{[2 2 0]}{[2 -2 2]}{[-2 2 2]}%
\fcPlotIIIdXconst[linewidth=0.3pt, linecolor=\fcColorGraph]{iterationsX=15, iterationsY=15}{-2}{4 x x mul sub sqrt -1 mul}{2}{4 x x mul sub sqrt}{1 dict begin /rho x x mul y y mul  add sqrt def rho rho mul 2 rho  sub mul  0 max end}%
\fcPlotIIIdYconst[linewidth=0.3pt, linecolor=\fcColorGraph]{iterationsX=10, iterationsY=10}{4 y y mul sub sqrt -1 mul}{-2}{4 y y mul sub sqrt}{2}{1 dict begin /rho x x mul y y mul  add sqrt def rho rho mul 2 rho  sub mul  0 max end}%
\fcCurveIIId[linecolor=\fcColorGraph]{0}{360}{[2 t cos mul 2 t sin mul 0]}%
\end{pspicture}
%

Volumes of solids are found/defined via integration.%
\end{center}
\end{frame}

\begin{frame}
\begin{columns}[c]
\column{.35\textwidth}
\psset{xunit=2cm, yunit=2cm}
\begin{pspicture}(-0.3,-0.3)(2,1.2)%
\renewcommand{\fcScreen}{[-1 1.6 -1] 0}%
\fcBoundingBox{-0.3}{-0.3}{2}{1.2}%
\tiny%
\uncover<handout:0| 2>{%
\fcParallelogramIIId[linecolor=pink!70]{[0.3 0 0]}{[0.3 1 0]}{[0.3 0 1]}%
\fcParallelogramIIId[linecolor=cyan!70]{[0.3 0.35 0.35]}{[0.3 0.65 0.35]}{[0.3 0.35 0.65]}%
\fcParallelogramHalfVisibleIIId[linecolor=gray]{[0.3 0.35 0.65]}{[0.3 0.35 0.35]}{[0.3 0.65 0.65]}%
\fcPutIIId{[0.3 0.5 0.5]}{$A(x)$}%
\fcPutIIId[t]{[0.3 0 -0.1]}{$x$}%
}%
\uncover<handout:0| 3>{%
\fcParallelogramIIId[linecolor=pink!70]{[0.35 0 0]}{[0.35 1 0]}{[0.35 0 1]}%
\fcParallelogramIIId[linecolor=cyan!70]{[0.35 0.325 0.325]}{[0.35 0.675 0.325]}{[0.35 0.325 0.675]}%
\fcParallelogramHalfVisibleIIId[linecolor=gray!70]{[0.35 0.325 0.675]}{[0.35 0.325 0.325]}{[0.35 0.675 0.675]}%
\fcPutIIId{[0.35 0.5 0.5]}{$A(x)$}%
\fcPutIIId[t]{[0.35 0 -0.1]}{$x$}%
}%
\uncover<handout:0| 4>{%
\fcParallelogramIIId[linecolor=pink!70]{[0.4 0 0]}{[0.4 1 0]}{[0.4 0 1]}%
\fcParallelogramIIId[linecolor=cyan!70]{[0.4 0.3 0.3]}{[0.4 0.7 0.3]}{[0.4 0.3 0.7]}%
\fcParallelogramHalfVisibleIIId[linecolor=gray!70]{[0.4 0.3 0.7]}{[0.4 0.3 0.3]}{[0.4 0.7 0.7]}%
\fcPutIIId{[0.4 0.5 0.5]}{$A(x)$}%
\fcPutIIId[t]{[0.4 0 -0.1]}{$x$}%
}%
\uncover<handout:0| 5>{%
\fcParallelogramIIId[linecolor=pink!70]{[0.45 0 0]}{[0.45 1 0]}{[0.45 0 1]}
\fcParallelogramIIId[linecolor=cyan!70]{[0.45 0.275 0.275]}{[0.45 0.725 0.275]}{[0.45 0.275 0.725]}
\fcParallelogramHalfVisibleIIId[linecolor=gray!70]{[0.45 0.275 0.725]}{[0.45 0.275 0.275]}{[0.45 0.725 0.725]}
\fcPutIIId{[0.45 0.5 0.5]}{$A(x)$}
\fcPutIIId[t]{[0.45 0 -0.1]}{$x$}
}%
\uncover<handout:1| 7->{%
\fcParallelogramIIId[linecolor=cyan!70]{[0.5 0.25 0.25]}{[0.5 0.75 0.25]}{[0.5 0.25 0.75]}%
\fcParallelogramHalfVisibleIIId[linecolor=gray!70]{[0.5 0.25 0.75]}{[0.5 0.25 0.25]}{[0.5 0.75 0.75]}%
}%
\uncover<6,7>{%
\fcParallelogramHalfVisibleIIId[linecolor=gray!70]{[0.4 0.3 0.7]}{[0.4 0.3 0.3]}{[0.4 0.7 0.7]}%
}
\uncover<6,7>{%
\fcParallelogramHalfVisibleIIId[linecolor=gray!70]{[0.6 0.2 0.8]}{[0.6 0.2 0.2]}{[0.6 0.8 0.8]}%
}%
\uncover<7->{%
\fcPutIIId[t]{[0.5 0 -0.1]}{$x^*$}%
\fcLineIIId{[0.5 0 0]}{[0.5 0.05 0]}%
}%
\uncover<8->{%
\fcBoxIIIdFilled[linecolor=cyan!30]{[0.6 0.25 0.75]}{[0.4 0.25 0.75]}{[0.6 0.25 0.25]}{[0.6 0.75 0.75]}%
\fcParallelogramHalfVisibleIIId{[0.5 0.25 0.75]}{[0.5 0.25 0.25]}{[0.5 0.75 0.75]}%
\fcBoxIIId{[0.6 0.25 0.75]}{[0.4 0.25 0.75]}{[0.6 0.25 0.25]}{[0.6 0.75 0.75]}%
\fcLineIIId[arrows=<->]{[0.4 0.2 0.2]}{[0.6 0.2 0.2]}%
\fcPutIIId[t]{[0.5 0.16 0.16]}{$\Delta x$}%
}%
\fcLineIIId[arrows=->]{[0 0 0]}{[1.2 0 0]}%
\fcLineIIId[arrows=->]{[0 0 0]}{[0 1.2 0]}%
\fcLineIIId[arrows=->]{[0 0 0]}{[0 0 1.2]}%
\fcParallelogramHollowIIId{[1 0 0]}{[1 1 0]}{[1 0 1]}%
\fcLineIIId{[1 0 0]}{[0 0.5 0.5]}%
\fcLineIIId{[1 0 1]}{[0 0.5 0.5]}%
\fcLineIIId{[1 1 1]}{[0 0.5 0.5]}%
\fcLineIIId[linestyle=dashed]{[1 1 0]}{[0 0.5 0.5]}%
\end{pspicture}

%\only<handout:1| -1>{%
%\includegraphics[height=4cm]{volumes/pictures/06-02-pyramida.pdf} %
%}%
%\only<handout:0| 2>{%
%\includegraphics[height=4cm]{volumes/pictures/06-02-pyramidb.pdf}%
%}%
%\only<handout:0| 3>{%
%\includegraphics[height=4cm]{volumes/pictures/06-02-pyramidc.pdf}%
%}%
%\only<handout:0| 4>{%
%\includegraphics[height=4cm]{volumes/pictures/06-02-pyramidd.pdf}%
%}%
%\only<handout:2| 5>{%
%\includegraphics[height=4cm]{volumes/pictures/06-02-pyramide.pdf}%
%}%
%\only<handout:0| 6-7>{%
%\includegraphics[height=4cm]{volumes/pictures/06-02-pyramidf.pdf}%
%}%
%\only<handout:3| 8->{%
%\includegraphics[height=4cm]{volumes/pictures/06-02-pyramidg.pdf}%
%}%

\uncover<handout:3| 9->{Approx. volume of slab:}
\abovedisplayskip=1pt
\belowdisplayskip=1pt
\[
\uncover<handout:3| 9->{A(x^*)\Delta x}%
\]
\uncover<handout:3| 10->{Approx. volume of $S$:}
\abovedisplayskip=1pt
\belowdisplayskip=1pt
\[
\uncover<handout:3| 10->{V \approx \sum_{i=1}^n A(x_i^*)\Delta x}%
\]
\uncover<handout:3| 11->{Exact volume of $S$:}
\abovedisplayskip=1pt
\belowdisplayskip=1pt
\[
\uncover<handout:3| 11->{V = \lim_{n\to\infty}\sum_{i=1}^n A(x_i^*)\Delta x}%
\]
\column{.65\textwidth}
\begin{itemize}
\item  How do we find the volume of a solid $S$?
\item<handout:2-| 2->  Let $P_x$ be the plane perpendicular to the $x$-axis and passing through the point $x$.
\item<handout:2-| 2->  The intersection of $P_x$ with $S$ is called a cross-section.
\item<handout:2-| 2->  Let $A(x)$ be the area of this cross-section.
\item<handout:3| 6->  Consider the part of $S$ between two planes $P_{x_1}$ and $P_{x_2}$.
\item<handout:3| 7->  Approximate this part of $S$:
\item<handout:3| 7->  Pick a sample point $x^*$ between $x_1$ and $x_2$.  Use a solid that has the same constant cross-sectional area $A(x^*)$ between $x_1$ and $x_2$.
\item<handout:3| 8->  Let $\Delta x$ be the distance from $x_1$ to $x_2$.
\end{itemize}
\end{columns}
\end{frame}
% end module volumes-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/volumes/volumes-def.tex
% begin module volumes-def
\begin{frame}
\begin{definition}[Volume]
Let $S$ be a solid that lies between $x = a$ and $x = b$.  If the cross-sectional area of $S$ in the plane $P_x$ is a continuous function $A(x)$, then the volume of $S$ is
\[
V = \lim_{n\to\infty} \sum_{i=1}^n A(x_i^*)\Delta x = \int_a^b A(x)\diff x%
\]
\end{definition}
\end{frame}
% end module volumes-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/volumes/volumes-ex2.tex
% begin module volumes-ex2
\begin{frame}
\begin{example} %[Example 2, p. 440]
Find the volume of the solid obtained by rotating about the $x$-axis the region under the curve $y = \sqrt{x}$ from $0$ to $1$.
\begin{itemize}
\item<8->  The cross-sections of this solid are all circles.
\item<9->  The circular cross-section through the point $(x, 0)$ has radius $\sqrt{x}$.
\item<10->  The area of the cross-section is \alert<handout:0| 10-11>{$A(x) = $ \uncover<11->{$\pi (\sqrt{x})^2$}} \uncover<12->{$ = \pi x$.}
\item<13->  The volume of a single approximating section is $A(x) \Delta x = \pi x \ \Delta x$.
\item<14->  The solid lies between $0$ and $1$, so its volume is
\end{itemize}
\begin{columns}[c]
\column{.4\textwidth}
\begin{center}
\only<handout:0| 1>{%
\includegraphics[height=3.5cm]{volumes/pictures/06-02-ex2a.pdf} %
}%
\only<handout:0| 2>{%
\includegraphics[height=3.5cm]{volumes/pictures/06-02-ex2b.pdf} %
}%
\only<handout:0| 3>{%
\includegraphics[height=3.5cm]{volumes/pictures/06-02-ex2c.pdf} %
}%
\only<handout:0| 4>{%
\includegraphics[height=3.5cm]{volumes/pictures/06-02-ex2d.pdf} %
}%
\only<handout:0| 5>{%
\includegraphics[height=3.5cm]{volumes/pictures/06-02-ex2e.pdf} %
}%
\only<handout:0| 6>{%
\includegraphics[height=3.5cm]{volumes/pictures/06-02-ex2f.pdf} %
}%
\only<7->{%
\includegraphics[height=3.5cm]{volumes/pictures/06-02-ex2g.pdf} %
}%
\end{center}
\column{.6\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\uncover<14->{%
V%
}%
& \uncover<14->{ = } %
\uncover<14->{%
\int_0^1 A(x) \ \diff x%
}%
 \uncover<15->{ = } %
\uncover<15->{%
\int_0^1 \pi x \ \diff x%
}\\%
& \uncover<16->{ = } %
\uncover<16->{%
\left[ \pi \frac{x^2}{2}\right]_0^1%
}%
 \uncover<17->{ = } %
\uncover<17->{%
\frac{\pi}{2}%
}%
\end{align*}
\end{columns}
\end{example}
\end{frame}
% end module volumes-ex2



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/volumes/volumes-washer.tex
% begin module volumes-washer
\begin{frame}
\begin{example}[Typical Cross-Section is a Washer]
\begin{columns}[c]
\column{.35\textwidth}
\begin{center}
\only<handout:0| 1>{%
\includegraphics[height=7.3cm]{volumes/pictures/06-02-washera.pdf} %
}%
\only<handout:0| 2>{%
\includegraphics[height=7.3cm]{volumes/pictures/06-02-washerb.pdf} %
}%
\only<handout:0| 3>{%
\includegraphics[height=7.3cm]{volumes/pictures/06-02-washerc.pdf} %
}%
\only<handout:0| 4>{%
\includegraphics[height=7.3cm]{volumes/pictures/06-02-washerd.pdf} %
}%
\only<handout:0| 5>{%
\includegraphics[height=7.3cm]{volumes/pictures/06-02-washere.pdf} %
}%
\only<handout:0| 6>{%
\includegraphics[height=7.3cm]{volumes/pictures/06-02-washerf.pdf} %
}%
\only<7->{%
\includegraphics[height=7.3cm]{volumes/pictures/06-02-washerg.pdf} %
}%
\end{center}
\column{.65\textwidth}
Find the volume of the solid obtained by rotating about the $x$-axis \alert<handout:0| 6>{the region bounded by \alert<handout:0| 2>{$y = x^2+1$}, \alert<handout:0| 3>{$y = x$}, \alert<handout:0| 4>{$x = 0$}, and \alert<handout:0| 5>{$x = 1$}}.

\uncover<7->{%
The typical cross-section is a washer centered at $(x, 0)$.
}%

\uncover<8->{%
\alert<handout:0| 8-9>{Area of the inner circle: \uncover<9->{$\pi x^2$}}

\alert<handout:0| 10-11>{Area of the outer circle: \uncover<11->{$\pi (x^2+1)^2$}}
}%
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\uncover<12->{%
V%
}%
& \uncover<12->{ = } %
\uncover<12->{%
\int_0^1 \left( \pi (x^2+1)^2 - \pi x^2    \right) \ \diff x%
}\\%
& \uncover<13->{ = } %
\uncover<13->{%
\pi \int_0^1 \left( \alert<handout:0| 14-15>{x^4} + \alert<handout:0| 16-17>{x^2} + \alert<handout:0| 18-19>{1} \right) \  \diff x%
}\\%
& \uncover<14->{ = } %
\uncover<14->{%
\pi \left[ \alert<handout:0| 15>{\uncover<15->{\frac{x^5}{5}}} + \alert<handout:0| 17>{\uncover<17->{\frac{x^3}{3}}} + \alert<handout:0| 19>{\uncover<19->{x}} \right]_0^1%
}\\%
& \uncover<20->{ = } %
\uncover<20->{%
\pi \left( \frac{1}{5} + \frac{1}{3} + 1\right) \uncover<21->{= \frac{23}{15}\pi}
}%
\end{align*}
\end{columns}
\end{example}
\end{frame}
% end module volumes-washer



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/volumes/volumes-otherline.tex
% begin module volumes-otherline
\begin{frame}
\begin{example}[Rotated About a Line Other Than the $x$-axis]
Find the volume of the solid obtained by rotating about the line $y = 1$ \alert<handout:0| 4>{the region bounded by \alert<handout:0| 2>{$y = -x^2+2x+1$} and \alert<handout:0| 3>{$y = 1$}.}

\uncover<5->{%
The typical cross-section is a circle centered at $(x, 1)$.
}%

\uncover<6->{%
\alert<handout:0| 6-7>{Area of cross-section: \uncover<7->{$\pi ((-x^2+2x+1)-1)^2$}}
}%
\begin{columns}[c]
\column{.4\textwidth}
\begin{center}
\only<handout:0| 1>{%
\includegraphics[height=5cm]{volumes/pictures/06-02-otherlinea.pdf} %
}%
\only<handout:0| 2>{%
\includegraphics[height=5cm]{volumes/pictures/06-02-otherlineb.pdf} %
}%
\only<handout:0| 3>{%
\includegraphics[height=5cm]{volumes/pictures/06-02-otherlinec.pdf} %
}%
\only<handout:0| 4>{%
\includegraphics[height=5cm]{volumes/pictures/06-02-otherlined.pdf} %
}%
\only<5->{%
\includegraphics[height=5cm]{volumes/pictures/06-02-otherlinee.pdf} %
}%
\end{center}
\column{.6\textwidth}

\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\uncover<8->{%
V%
}%
& \uncover<8->{ = } %
\uncover<8->{%
\int_0^2  \pi \left( (-x^2+2x+1) -  1\right)^2  \ \diff x%
}\\%
& \uncover<9->{ = } %
\uncover<9->{%
\pi \int_0^2 \left( \alert<handout:0| 10-11>{x^4} - \alert<handout:0| 12-13>{4x^3} + \alert<handout:0| 14-15>{4x^2} \right) \  \diff x%
}\\%
& \uncover<10->{ = } %
\uncover<10->{%
\pi \left[ \alert<handout:0| 11>{\uncover<11->{\frac{x^5}{5}}} - \alert<handout:0| 13>{\uncover<13->{x^4}} + \alert<handout:0| 15>{\uncover<15->{\frac{4x^3}{3}}} \right]_0^2%
}\\%
& \uncover<16->{ = } %
\uncover<16->{%
\pi \left( \frac{32}{5} - 16 + \frac{32}{3} \right) \uncover<17->{= \frac{16}{15}\pi}
}%
\end{align*}
\end{columns}
\end{example}
\end{frame}
% end module volumes-otherline



\section{Volumes by Cylindrical Shells}
%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/volumes/cylindrical-shells-intro.tex
% begin module cylindrical-shells-intro
\begin{frame}
Find the volume of the solid obtained by rotating the region bounded by $y = 2x^2 - x^3$ and the $x$-axis around $\ldots$
\begin{tabular}{p{6cm}@{\ }p{6cm}}
\ \only<handout:0| -1>{%
\includegraphics[height=4cm]{volumes/pictures/06-03-setupz.pdf}%
}%
\only<2->{%
\includegraphics[height=4cm]{volumes/pictures/06-03-setupa.pdf}%
}%
&%
\ \only<handout:0| -4>{%
\includegraphics[height=4cm]{volumes/pictures/06-03-setupz.pdf}%
}%
\only<5->{%
\includegraphics[height=4cm]{volumes/pictures/06-03-setupb.pdf}%
}%
\\%
\begin{itemize}
\item<1->  $\ldots$ the $x$-axis.
\item<2->  Approximate the volume using circular cylinders with radius $2x^2 - x^3$ and height $\Delta x$.
\item<3->  $V = \int_0^2 \pi (2x^2 - x^3)^2 \diff x$.
\item<4->  We can solve this.
\end{itemize}
&%
\begin{itemize}
\item<1->  $\ldots$ the $y$-axis.
\item<5->  Approximate the volume using circular cylinders with radii $x_R$ and $x_L$.
\item<6->  We don't know $x_R$ and $x_L$.
\item<7->  We need new techniques.
\end{itemize}
\end{tabular}
\end{frame}
% end module cylindrical-shells-intro



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/volumes/cylindrical-shells-def.tex
% begin module cylindrical-shells-def
\begin{frame}
\begin{tabular}{cc}
\includegraphics[height=4cm]{volumes/pictures/06-03-setup3d.pdf}%
&%
\uncover<2->{%
\includegraphics[height=4cm]{volumes/pictures/06-03-setupcylinders.pdf}%
}%
\end{tabular}
\begin{itemize}
\item<1->  Consider the solid obtained by rotating around the $y$-axis the region bounded above by $y = 2x^2 - x^3$ and below by the $x$-axis.
\item<2->  Approximate this solid by nested cylindrical shells.
\item<3->  Cylindrical shells are solids obtained by taking a cylinder and removing from its center another cylinder of equal height but smaller radius.
\end{itemize}
\end{frame}

\begin{frame}
\begin{tabular}{p{3cm}p{7cm}}
\ \includegraphics[height=4cm]{volumes/pictures/06-03-cylinder.pdf}%
&%
\begin{itemize}
\item<1->  Consider a cylindrical shell with:
\item<2->  outer radius $r_2$.
\item<2->  inner radius $r_1$.
\item<2->  height $h$.
\item<3->  $V = \pi r_2^2 h - \pi r_1^2 h \uncover<4->{ = \pi (r_2 - r_1)(r_2 + r_1)h}$.
\item<5->  Let $\Delta r = r_2 - r_1$.
\item<5->  Let $r = \frac{r_2+r_1}{2}$.
\item<6->  Then $V = 2\pi rh\Delta r$.
\end{itemize}
\end{tabular}
\end{frame}


\begin{frame}
\[
V = 2\pi rh\Delta r.
\]
\uncover<2->{
If we are approximating the solid obtained by rotating the region under $f(x)$, let the height $h = f(r)$.  Then
\[
V = 2\pi rf(r)\Delta r .
\]
}
\uncover<3->{
If there are $n$ cyclindrical shells $C_1, \ldots , C_n$, let $x_1, \ldots , x_n$ be their radii.  Then
\[
\sum_{i=1}^n 2\pi x_i f(x_i)\Delta x
\]
is the volume of the approximating cylinders.
}

\uncover<4->{
Taking the limit as the number of shells goes to $\infty$, we get
\[
V = \lim_{n\rightarrow\infty} \sum_{i=1}^n 2\pi x_i f(x_i)\Delta x = \int_{\uncover<5->{\alert<handout:0| 5>{a}}}^{\uncover<5->{\alert<handout:0| 5>{b}}}2\pi xf(x) \diff x .
\]
\uncover<5->{
If we are considering the region bounded by $f(x)$ between $a$ and $b$, this gives us the endpoints.
}
}
\end{frame}

\begin{frame}
\begin{definition}[Volume by Cylindrical Shells]
The volume of the solid obtained by rotating around the $y$-axis the region under the curve $y = f(x)$ from $a$ to $b$ is
\[
V = \int_a^b 2\pi xf(x)\diff x .
\]
\end{definition}
\end{frame}
% end module cylindrical-shells-def



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/volumes/cylindrical-shells-ex.tex
% begin module cylindrical-shells-ex
\begin{frame}
\begin{example}[Example 1, p. 451]%
\begin{columns}
\column{0.6\textwidth}
\only<handout:0| -1>{%
\includegraphics[width=7cm]{volumes/pictures/06-03-exa.pdf} %
}%
\only<handout:0| 2>{%
\includegraphics[width=7cm]{volumes/pictures/06-03-exb.pdf} %
}%
\only<handout:0| 3>{%
\includegraphics[width=7cm]{volumes/pictures/06-03-exc.pdf} %
}%
\only<handout:0| 4>{%
\includegraphics[width=7cm]{volumes/pictures/06-03-exd.pdf} %
}%
\only<5->{%
\includegraphics[width=7cm]{volumes/pictures/06-03-exe.pdf} %
}%
\column{0.4\textwidth}
Find the volume of the solid obtained by rotating about the $y$-axis \alert<handout:0| handout:0| 4>{the region bounded by \alert<handout:0| handout:0| 2>{$y = 2x^2 - x^3$} and \alert<handout:0| handout:0| 3>{the $x$-axis}}.
\end{columns}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
\uncover<6->{V} & \uncover<6->{ = }  \uncover<6->{\int_0^2(2\pi x)(2x^2 - x^3)\diff x} %\\
  \uncover<7->{ = }  \uncover<7->{2\pi \int_0^2 (\alert<handout:0| 8-9>{2x^3} - \alert<handout:0| 10-11>{x^4})\diff x} \\
 & \uncover<8->{ = }  \uncover<8->{2\pi \left[ \alert<handout:0| 9>{\uncover<9->{\frac{x^4}{2}}} - \alert<handout:0| 11>{\uncover<11->{\frac{x^5}{5}}}\right]_0^2 } %\\
  \uncover<12->{ = }  \uncover<12->{2\pi \left( \frac{16}{2} - \frac{32}{5}\right) } %\\
  \uncover<13->{ = }  \uncover<13->{\frac{16}{5}\pi } 
\end{align*}
\end{example}
\end{frame}
% end module cylindrical-shells-ex



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/volumes/cylindrical-shells-otherline.tex
% begin module cylindrical-shells-otherline
\begin{frame}
\begin{example}[Rotated About a Line Other Than the $y$-axis]
Find the volume of the solid obtained by rotating about \alert<handout:0| handout:0| 5>{the line $x = 1$} \alert<handout:0| handout:0| 4>{the region to the right of $x = 1$ bounded by \alert<handout:0| handout:0| 2>{$y = x^3 - 4x^2 + 3x$} and \alert<handout:0| handout:0| 3>{the $x$-axis}}.

\uncover<6->{%
The radius of the typical cylindrical shell is $x - 1$.%
}%
\begin{columns}
\column{0.4\textwidth}
\only<handout:0| -1>{%
\includegraphics[width=5cm]{volumes/pictures/06-03-otherlinea.pdf} %
}%
\only<handout:0| 2>{%
\includegraphics[width=5cm]{volumes/pictures/06-03-otherlineb.pdf} %
}%
\only<handout:0| 3>{%
\includegraphics[width=5cm]{volumes/pictures/06-03-otherlinec.pdf} %
}%
\only<handout:0| 4>{%
\includegraphics[width=5cm]{volumes/pictures/06-03-otherlined.pdf} %
}%
\only<handout:0| 5>{%
\includegraphics[width=5cm]{volumes/pictures/06-03-otherlinee.pdf} %
}%
\only<6->{%
\includegraphics[width=5cm]{volumes/pictures/06-03-otherlinef.pdf} %
}%
\column{0.6\textwidth}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\begin{align*}
%\uncover<7->{V}%
& \uncover<7->{  }  \uncover<7->{\int_1^3 2\pi (x-1)(-x^3 + 4x^2- 3x)\diff x} \\
& \uncover<8->{ = }   \uncover<8->{2\pi \int_1^3 (-\alert<handout:0| 9-10>{x^4} + \alert<handout:0| 11-12>{5x^3} - \alert<handout:0| 13-14>{7x^2} + \alert<handout:0| 15-16>{3x})\diff x} \\
 & \uncover<9->{ = }  \uncover<9->{2\pi \left[ -\alert<handout:0| 10>{\uncover<10->{\frac{x^5}{5}}} + \alert<handout:0| 12>{\uncover<12->{\frac{5x^4}{4}}} - \alert<handout:0| 14>{\uncover<14->{\frac{7x^3}{3}}} + \alert<handout:0| 16>{\uncover<16->{\frac{3x^2}{2}}} \right]_1^3 } \\
& \uncover<17->{ = }  \uncover<17->{2\pi \left( \left( -\frac{243}{5} + \frac{405}{4} - 63 + \frac{27}{2} \right) \right.} \\
&  \uncover<17->{\left. - \left( -\frac{1}{5} + \frac{5}{4} - \frac{7}{3} + \frac{3}{2} \right) \right)} %\\
 \uncover<18->{ = }  \uncover<18->{\frac{88}{15}\pi }
\end{align*}
\end{columns}
\end{example}
\end{frame}
% end module cylindrical-shells-otherline



%input from file: /home/todor/math/freecalc/lectures/UMB-M141-2015-Spring/../../modules/volumes/volumes-guidelines.tex
% begin module volumes-guidelines
\begin{frame}
\begin{center}
\begin{tabular}{|l||c|c|}
\hline
&  \multicolumn{2}{|c|}{Rotate about $\ldots$}\\
\cline{2-3}
& $\ldots$ a horizontal line & $\ldots$ a vertical line \\
\hline
\hline
$y$ is a & Cross-sections & Cylindrical shells \\
function of $x$ & $\displaystyle \int \ \cdot \ \diff x$ & $\displaystyle \int \ \cdot \ \diff x$ \\
\hline
$x$ is a & Cylindrical shells & Cross-sections \\
function of $y$ & $\displaystyle \int \ \cdot \ \diff y$ & $\displaystyle \int \ \cdot \ \diff y$ \\
\hline
\end{tabular}
\end{center}

\begin{itemize}
\item  $\displaystyle \int \ \cdot \ \diff x$ means integrate with respect to $x$.
\item  $\displaystyle \int \ \cdot \ \diff y$ means integrate with respect to $y$.
\item  Some equations express $y$ as a function of $x$ and $x$ as a function of $y$.  In such cases, you may use either method.
%\item  If you are rotating the region bounded by two functions, first find the volume of the region obtained by rotating the inner function (the one closer to the axis of rotation), then subtract it from the volume obtained by rotating the outer function (the one further from the axis of rotation).
\end{itemize}
\end{frame}
% end module volumes-guidelines



}% end lecture

% begin lecture

%\section{(Appendix G) Complex Numbers}
% WARNING:  Appendix G is missing here.
% end lecture
\end{document}

