\chapter[Approximating Functions]{Taylor's Theorem}
\def\eqn#1{\def\theequation{#1}}


%\def\C{\makebox[.8em][l]{\makebox[.25em][l]{C}\rule{.03em}{1.5ex}}}
 

The dominant theme in this chapter is \index{approximation} approximation 
and the main result, an extension of the Mean Value Theorem 
called \index{Taylor's Theorem} Taylor's Theorem, is of fundamental importance because
it provided a method of approximating functions by
polynomials.  Thus, such problems as computing
$ e^x $, $ \sin \: x $, or
$ \ln \: x $ to a desired degree of accuracy 
can be solved by simply evaluating a polynomial.
The idea behind Taylor's theorem also explains the 
technique for evaluating certain limits called indeterminate 
forms and provides a way of estimating the rate of 
convergence of \index{Newton's method} Newton's method for approximating 
roots of equations.
\vspace{.1in}


\section{Taylor Polynomials}
 

We know
that if the function $f$ is differentiable (has a derivative)
at $ x = a $, then the tangent line
\[ P_1 (x) = f(a) + f ^{'} (a) ( x - a ) \]
at the point $ ( a , f(a) ) $ is a good local approximation 
to the graph of $f$, that is, $ P_1 (x) \approx
f(x) $
if $ x \approx a $.  For example,
the tangent to the function $ f (x) = \sqrt{ x } $ at 
$ x = 4 $ is
\[ P_1 (x) = 2 + 0.25 ( x - 4 ) . \]
Now choose a value of $x$ reasonably near 4, say 4.3.
Then $ P_1 ( 4.3 ) = 2.075 $
and $ \sqrt{ 4.3 } = 2.0736 ... $ so that the error in the 
approximation $ \sqrt{ 4.3} \approx 2.075 $ is less than 
$ 0.0014 $ in absolute value.

The proper generalization of this notion of approximation by the
tangent stems from the observation that $ P_1 (x) $ is a polynomial of 
degree one that agrees with $f$ and $ f ^{'} $ at $ x = a $:
\[ P_1 (a) = f(a) , ~~ P_1 ^{'} (a) = f ^{'} (a) . \]
The idea is to construct polynomials $ P_n (x) $ of
higher degree whose value and first $n$ derivatives match
those of $f$ at $x$.  Thus, for $ n = 2 $, we seek
a polynomial $ P_2 (x) $ such that
\eqn{1}
\begin{equation}
P_2 (a) = f(a) , ~~ P_2 ^{'} (a) = f ^{'} 
(a) , ~~ P_2 ^{''} (a) = f ^{''} (a) . \end{equation} 
Since $ P_1 (x) $ has the form $ c_0 + c_1 ( x - a ) $, it is reasonable 
to expect that $ P_2 (x) $ will have the form
\[ P_2 (x) = c_0 + c_1 ( x - a ) + c_2 ( x - a ) ^2 \]
for some choice of the coefficients $ c_0 , c_1 $ and $ c_2 $.
The condition $ P_2 (a) = f(a) $ is satisfied by choosing $ c_0 
= f(a) $ and since $ P_2 ^{'} (x) = c_1 + 2 c_2 ( x - a ) $,
the condition $ P_2 ^{'} (a) = f ^{'} (a) $ is satisfied if
$ c_1 = f ^{'} (a) $.  And, finally, from $ P_2 ^{''} (x) 
= 2 c_2 $ it follows that $ P_2 ^{''} (a) = 
f ^{''} (a) $ if $ c_2 = \frac{ 1 }{ 2 } f ^{''} (a) $.  Hence 
\eqn{2}
\begin{equation}
P_2 (x) = f(a) + f ^{'} (a) ( x - a ) + \frac{ f ^{''} (a) }{ 2 } 
( x - a ) ^2 \end{equation}
is a polynomial that satisfies the conditions in (1).  And,
as we shall see in the next section, there is no other choice,
that is, there is exactly one polynomial of degree two such that 
the value of the polynomial and its first two derivatives agree with
the value of $f$ and its first two derivatives at 
$ x = a $.  Similarly,
\[ P_3 (x) = f(a) + f ^{'} (a) ( x - a ) + \frac{ f ^{''} (a) }{ 2 ! } ( x - a ) ^2 + 
\frac{ f ^{'''} (a) }{ 3 ! } ( x - a ) ^3 \]
is the unique polynomial of degree three such that 
\[ P_3 (a) = f(a) , ~~ P_3 ^{'} (a) = 
f ^{'} (a) , ~~ P_3 ^{''} (a) = 
f ^{''} (a) , ~~ P_3 ^{'''} (a) = 
f ^{'''} (a) . \]

The following definition extends this idea to polynomials of 
degree $n$.
We remind you that $ 0 ! = 1 , ~~ 1 ! = 1 , ~~ n ! = 
1 \cdot 2 \cdot 3 \cdots n , ~~ f ^{ (0) } = f $,
and $ f ^{ (n) } $ denotes the $n$th derivative of $f$.
\vspace{.1in}

\noindent 
{\bf Definition of \index{Taylor Polynomials} Taylor Polynomials}.  If the 
first $n$ derivatives of $f$ exist at $a$,
then the $n$th {\em degree Taylor polynomial}\footnote{After
one of the contributors to the subject, English mathematician 
\index{Brook Taylor} Brook Taylor (1685-1731)} for $f$ at $a$ is defined by
\eqn{2}
\begin{equation}
P_n (x) = f(a) + f ^{'} 
(a) ( x - a ) + \frac{ f ^{''} (a) }{ 2 ! } ( x - a ) ^2 + \cdots + 
\frac{ f^{ (n) } (a) }{ n ! } ( x - a ) ^n , 
\end{equation}
or, in summation notation,
\eqn{3}
\begin{equation}
P_n (x) = \sum_{ k = 0 }^n \:
\frac{ f^{ (k) } (a) }{ k ! } ( x - a ) ^k . 
\end{equation}

The $n$th-degree Taylor polynomials is structured so that the
value of $ P_n (x) $ and its first $n$ derivatives match those of $f$
at $a$.  Having thus constructed $ P_n (x) $ like $f$ at $a$,
we expect $ P_n (x) $ to closely approximate $ f (x) $
if $x$ is near $a$.  It does, and in the next
section we will estimate the accuracy of that approximation.
\vspace{.1in}

\noindent 
{\bf Example 1}.  Write the \index{third degree Taylor polynomial} third degree Taylor polynomial for
$ f (x) = \sqrt{ x } $ at $ a = 81 $ and use it 
to approximate $ \sqrt{ 85 } $.  
\vspace{.1in}

\noindent 
{\bf Solution}.  According to formula (2)
\[ P_3 (x) = f (81) + 
f ^{'} (81) ( x - 81 ) 
+ \frac{ f^{ (2) } (81) }{ 2 ! } ( x - 81 )^2 
+ \frac{ f ^{ (3) } (81) }{ 3 ! } 
( x - 81 ) ^3 \]
with $ f (x) = \sqrt{ x } $.  From the computations
\[ f (x) = \sqrt{ x } , ~~ 
f ^{'} (x) = \frac{ 1 }{ 2 } x^{ - 1/2 } , ~~
f^{ (2) } (x) = - \frac{1}{4} x^{ - 3/2 } , ~~
f^{ (3) } (x) = \frac{ 3 }{ 8 } x^{ - 5/2 } , \]
\[ f (81) = 9 , ~~ 
f ^{'} (81) = \frac{ 1 }{ 2 \cdot 9 } x^{ - 1/2 } , ~~
f^{ (2) } (81) = - \frac{1}{4 \cdot 9^3 } , ~~
f^{ (3) } (81) = \frac{ 3 }{ 8 \cdot 9^5 } , \]
we obtain the Taylor polynomial
\[ P_3 (x) = 9 + \frac{ 1 }{ 2 \cdot 9 }
( x - 81 ) - \frac{ 1 }{ 2 \cdot 4 \cdot 9^3 } ( x - 81 )^2 
+ \frac{ 1 }{ 2 \cdot 8 \cdot 9^5 } ( x - 81 )^3 . \]
Notice that the linear part, the first two terms
on the right, correspond to the tangent to 
$ f (x) = \sqrt{ x } $ at the point $ ( 81 , 9 ) $.
At the $ x = 85 $, 
\[ P_3 (85) = 9 + \frac{ 1 }{ 2 \cdot 9 } (4) -
\frac{ 1 }{ 2 \cdot 4 \cdot 9^3 } 
(4)^2 + \frac{ 1 }{ 2 \cdot 8 \cdot 9^5 }
(4)^3 = 9 + \frac{ 2 }{ 9 } 
- \frac{ 2 }{ 9^3 } + \frac{ 4 }{ 9^5 } = 9.2195464 ... ~ . \]
Clearly, this is a good approximation 
to $ \sqrt{ 85 } = 9.2195444 ... ~ $.  Actually, 
$ | P_3 (85) - \sqrt{ 85 } < .21 \times 10^{ - 5 } $.
$\ddagger$
\vspace{.1in}

\noindent 
{\bf Example 2}.  Write the 3rd-degree Taylor polynomial
for $ f (x) = x^3 - x^2 
+ x - 1 $ at $ a = 2 $.
\vspace{.1in}

\noindent 
{\bf Solution}.  First, $ f (2) = 5 $, and from the derivatives
\[ f ^{'} (x) = 3 x^2 - 2x 
+ 1 , ~~ f ^{''} (x) = 6x - 2 , ~~ f^{ (3) } (x) = 6 \]
we have
\[ f ^{'} (2) = 9 , ~~ f ^{''} (2) = 10 , ~~
f^{ (3) } (2) = 6 . \]
Hence,
\[ \begin{array}{rl}
P_3 (x) & = f (2) + f ^{'} (2) ( x - 2 ) 
+ {\displaystyle \frac{ f ^{''} (2) }{ 2 ! }} ( x - 2 )^2 
+ {\displaystyle \frac{ f ^{ (3) } (2) }{ 3 ! }} ( x - 2 )^3 \\ [0.2in]
& = 5 + 9 ( x - 2 ) + 5 ( x - 2 )^2 + 
( x - 2 )^3 . ~~~ \ddagger \end{array} \]

In Example 2, it important to observe that $ P_3 (x) $ is
more than just a good approximation to $ f (x) $ near $ a = 2 $;
indeed, $ P_3 (x) = f (x) $ for 
{\em all} $x$.  In other words, $ P_3 (x) = 5 + 9 ( x - 2 ) + 5 ( x - 2
)^2 
+ ( x - 2 )^3 $ is simply another way
of writing $ f (x) = x^3 - x^2 + x - 1 $.  One way to see this is to
expand and collect terms in $ P_3 (x) $.
In the next section we shall establish the general 
fact that if $ f (x) = c_0 + c_1 x + \cdots 
c_n x^n $ is a polynomial of degree $n$ and $ P_n (x) $ is
the $n$th-degree Taylor polynomial for $f$ at $a$,
then $ P_n (x) = f (x) $ for all $x$.
\vspace{.1in}



\section{Taylor's Theorem}


Now we turn to the problem of estimating the accuracy of the
approximation $ f (x) \approx P_n (x) $.  Our method 
will be to find a bound for the quantity
\[ R_n (x) = f (x) - P_n (x) , \]
called the {\em error} of the nth {\em remainder term}.
The key step is the following important result 
known as Taylor's Theorem.
\vspace{.1in}

\noindent 
{\bf Theorem 1.  \index{Taylor's Theorem} Taylor's Theorem}
If the function $f$ has derivatives of all orders up to
and including $ n + 1 $ on an open interval $ ( a - r , a + r ) $
about $a$ and $x$ is any number between $ a - r $
and $ a + r $ other than $a$, then there is a number
$c$ between $a$ and $x$ such that 
\eqn{1}
\begin{equation}
f (x) = f(a) + f ^{'} ( x - a ) + \cdots + 
\frac{ f^{ (n) } (a) }{ n ! } + 
\frac{ f ^{(n+1)} (a) }{ ( n + 1 ) ! } ( x-a ) ^{n+1} , 
\end{equation}
that is, $ f (x) = P_n (x) + R_n (x) $ and
\eqn{2}
\begin{equation}
R_n (x) = \frac{ f^{ (n + 1) } (c) }{ ( n + 1 ) ! }
( x-a ) ^{n+1} . 
\end{equation}
Further, if $ | f^{ ( n + 1 ) } (t) | \leq M $ on 
the interval from $a$ to $x$,
\eqn{3}
\begin{equation}
| R_n (x) | \leq \frac{ M }{ ( n + 1 ) ! } |
x - a | ^{n+1} . 
\end{equation}

We shall refer to formula (1) as {\em Taylor's formula 
with remainder}.  Once $a$ and $n$ are chosen, it expresses
$f(x) $ as the sum of a Taylor polynomial of degree $n$
in powers of $x - a$ plus a remainder (2) which we will
routinely estimate by (3).
\vspace{.1in}

\noindent 
{\bf Proof}.   The proof rests on a shrewd choice of a 
constant $K$ followed by successive applications of Rolle's
Theorem to the function $ g $ defined by
\eqn{4}
\begin{equation}
g (t) = f (t) - P_n (t) - K ( t - a ) ^{n+1} 
\end{equation}
in which $t$ varies over the closed interval from $a$
to $x$.  First, because $ f(a) = P_n (a) , ~
g (a) = f(a) - P_n (a) - K ( a - a ) ^{n+1} = 0 $
and, also,
\[ g (x) = f (x) - P_n (x) - K ( x-a ) ^{n+1} = 0 \]
provided
\[ K = \frac{ f (x) - P_n (x) }{ ( x-a ) ^{n+1} } \: . \]
Remember:  $x$ is fixed, $t$ is the variable.
Using this value of $K$, we may apply Rolle's Theorem on the 
interval from $a$ to $x$ to conclude that $ g ^{'} 
( c _1 ) = 0 $ for at least one choice of $ c_1 $
between $a$ and $x$.  
%If $ x < a $, the relation 
%between $ a,x $ and $ c_1 $ is shown in Figure 13.3.
%Further, since
%\vspace{2in} 

\noindent 
$ f ^{'} (a) = P_n ^{'} (a) $, the derivative $ g ^{'} (t)
= f ^{'} (t) - P_n ^{'} (t) - ( n + 1 ) ( t - a )^n $ is also
zero at $ t = a $.  Hence $ g ^{'} (a) = 
g ^{'} ( c_1 ) = 0 $, and a second application of
Rolle's Theorem shows that there is a number $ c_2 $ between 
$ c_1 $ and $a$ at which $ g ^{''} ( c_2 ) = 0 $.

The idea is to continue attacking with Rolle's Theorem, obtaining
numbers $ c_1 \leq c_2 < \cdots c_k $ at which $ g ^{'} 
( c_1 ) = 0 , ~ g ^{'} ( c_2 ) = 0 ,..., 
g ^{'} ( c_k ) = 0 $.  This is possible so long as $ g^{ (k) }
(a) = 0 $.  Since $ f^{ (k) } (a) = P_n ^{ (k) } (a) $
for $ k = 0 , 1 ,..., n $ and
\[ g ^{(k)} (t) = f ^{(k)} (t) - 
P_n ^{(k)} (t) - ( n + 1 ) (n) ( n - 1 ) \cdots 
( n - k + 2 ) K ( t - a )^{ n + 1 - k } , \]
it follows that $ g ^{(k)} (a) = 0 $ if $ k = 0,1 ,..., n $ but
\[ \begin{array}{rl}
g ^{ (n + 1) } (t) 
& = f^{ (n + 1) } (t) - 0 - 
( n + 1 ) ! K \\ [0.2in]
& = f^{ (n + 1) } (t) - ( n + 1 ) ! K 
\end{array} \]
need not be zero at $ t = a $.  Therefore, after
$n$ applications, we find that $ g ^{ (n) } (a) 
= g^{ (n) } ( c_n ) = 0 $.  A final approximation of Rolle's Theorem
yields a number $ c_{ n + 1 } = c $ between $ c_n $
and $a$ such that $ g^{ (n + 1) } (c) = 0 $, that is
\[ \begin{array}{rl}
g ^{(n+1)} (c) & = f ^{(n+1)} (c) - ( n + 1 ) ! K = 0 \\ [0.2in]
K & = {\displaystyle \frac{ f ^{(n+1)} (c) }{ ( n + 1 ) ! }} \: .
\end{array} \]
Substitution of this new expression for $K$ in (4) gives
\[ g (t) = f (t) - P_n (t) -
\frac{ f ^{(n+1)} (c) }{ ( n + 1 ) ! } ( t - 
a ) ^{n+1} . \]
But $ g (x) = 0 $.  Hence 
\[ f (x) = P_n (x) + \frac{ f ^{(n+1)} (c) }{ ( n + 1 ) ! }
( x-a ) ^{n+1} . \]
This establishes formula (1).

Estimate (3) follows directly from the remainder 
formula (2).  For if $ | f ^{(n+1)} (t) | \leq M $ everywhere between 
$a$ and $x$, then, in particular $ | f ^{(n+1)} (c) 
| \leq M $ and
\[ | R_n (x) | = 
\left | \frac{ f ^{(n+1)} (c) }{ ( n + 1 ) ! }
( x-a ) ^{n+1} \right | \leq 
\frac{ M }{ ( m + 1 ) ! } | x - a | ^{n+1} . ~~~~ \ddagger \]
\vspace{.1in}

\noindent 
{\bf Example 1}.  (a) Write Taylor's formula with remainder for 
$ n = 3 , ~ a = 0 $ and $ f (x) 
= \sqrt{ 1 + x } $.  (b) Use it to approximate $ \sqrt{ 1.15 } $
and estimate the error.
\vspace{.1in}

\noindent 
{\em Solution}.  (a) The third degree Taylor polynomial for 
$ f (x) = \sqrt{ 1 + x } $ at $ a = 0 $ is
\[ P_3 (x) = 1 + \frac{ 1 }{ 2 } x
- \frac{ 1 }{ 8 } x^2 + \frac{ 1 }{ 16 } x^3 , \]
by Example 3 of the last section and, since
$ f^{ (4) } (x) = 
\frac{ - 3 \cdot 5 }{ 2^4 } ( 1 + x )^{ - 7/2 } $,
\[ R_3 (x) = - \frac{ 3 \cdot 5 }{ 2^4 \cdot 4 ! } ( 1 + c )^{ - 7/2
} x^4 \]
for some $c$ between 0 and $x$.  Hence Taylor's formula (1) is
\[ \sqrt{ 1 + x } = 1 + 
\frac{ 1 }{ 2 } x - \frac{ 1 }{ 8 } x^2 + 
\frac{ 1 }{ 16 } x^3 
- \frac{ 3 \cdot 5 }{ 2^4 \cdot 4 ! } ( 1 + c )^{ - 7/2 }
x^4 . \]
(b) At $ x = 0.15 $, this formula gives the approximation 
\[ \begin{array}{rl}
\sqrt{ 1.15} & \approx 1 + \frac{ 1 }{ 2 } (0.15) - \frac{ 1 }{ 8 } (0.15)^2 + 
\frac{ 1 }{ 16 } (0.15)^3 \end{array} \]
rounded to six places.

Estimation of the error
\[ R_3 (0.15) = - \frac{ 15 }{ 384 } ( 1 + c )^{ - 7/2 }
(0.15)^4 \]
begins with the admission that we simply don't know the value of $c$;
the theory only tells us that $ 0 < c < 0.15 $.  The best we can hope
for is to put an upper bound on the error.  To do this, we argue that,
since $ 0 < c , ~ ~ 1 < 1 + c $ and, therefore,
$ ( 1 + c )^{ - 7/2 } = {\displaystyle \frac{ 1 }{ ( 1
+ c ) ^{ - 7/2 } }} < 1 $.  This gives the bound 
\[ \begin{array}{rl}
| R_3 ( 0.15 ) | & = \left | - {\displaystyle \frac{ 15 }{ 384 }}
( 1 + c )^{ - 7/2 } ( 0.15 )^4 \right |
\leq {\displaystyle \frac{ 15 }{ 384 }} ( 0.15 )^4 \\ [0.1in]
& = 0.00001977 ... ~~ . \end{array} \]
Consequently, $ | R_3 ( 0.15 ) | < 0.00002 $
and the approximation $ \sqrt{ 1.15 } \approx 1.072398 $
is off by no more than 2 units in the fifth decimal place.
Thus
\[ \sqrt{ 1.15 } \approx 1.0724 \: , \]
meaning that 1.0724 is the best 4 decimal place approximation
to $ \sqrt{ 1.15 } $.  $ \ddagger $
\vspace{.1in}

Some remarks on procedure are now in order.  In the initial
approximation $ \sqrt{ 1.15 } \approx 1.072398 $, we rounded
to six decimal places, our strategy being to 
keep more digits than would be justified in the 
final result because we were uncertain as to the magnitude of the 
remainder term.  Then, once we obtained a bound for the 
error, we rounded further to reflect the accuracy justified.
Also, we should observe that the process of bounding
the remainder usually amounts to placing $c$ at one end
or the other of the interval connecting $a$ to $x$.
Although useful, the resulting estimate may be too great by
several factors.

The use of absolute values in the error estimates (3) 
is natural because usually we are only interested in
the magnitude of the error, not whether it is positive
or negative.  Nonetheless, it is frequently worthwhile
to look at the sign of $ R_n (x) $ when making the approximation 
$ f (x) \approx P_n (x) $.  Thus, in the
preceding example, we can see that $ \sqrt{1.15} < 
1.072398 $ because $ R_3 ( 0.15 ) < 0 $.
\vspace{.1in}

\noindent 
{\bf Example 2}.  In \index{applying Taylor's formula} applying Taylor's formula (1)
as an approximation tool, it is essential 
that $x$, the point at which the approximation is desired,
be as near as possible to the base point
$a$, where the derivatives are to be computed.
On the other hand, you want the derivatives to
be easily computable.  In practice, the choice
of a $a$ represents a compromise between these two goals.
Take $ f (x) = x^x $ so that $ f ^{(k)} (x) = e^x $; hence the 
only reasonable choice is $ a = 0 $ because $ f ^{(k)} (0) = 1 $
(easy to compute)
for $ k = 0 , 2 , 3 ,... $.  Taylor's formula with remainder 
at $ a = 0 $ for $ f (x) = e^x $ is
\[ e^x = 1 + x + 
\frac{ x^2 }{ 2 ! } + \frac{ x^3 }{ 3 ! } + 
\cdots + \frac{ x^n }{ n ! } + 
\frac{ e^c }{ ( n + 1 ) ! } x ^{n+1} , \]
where $c$ is between 0 and $x$.  At $ x = 
\frac{ 1 }{ 2 } = 0.5 $, this formula reduces to
\[ \sqrt{ e } = e^{ 0.5 } = 1 
+ (0.5) + \frac{ ( 0.5 )^2 }{ 2 ! } 
+ \cdots + \frac{ ( 0.5)^n }{ n ! } 
+ \frac{ e^c }{ ( n + 1 ) ! } (0.5) ^{n+1} \]
and the challenge is to find a small positive integer $n$
such that
\[ R_n ( 0.5 ) = \frac{ e^c }{ ( n + 1 ) ! }
( 0.5 ) ^{n+1} < 0.5 \times 10^{ - 6 } . \]
First we find a bound for $ e^c $.  Since $ e < 3 $
and $ 0 < c < 0.5 $, it follows that $ e^c < 3^{0.5} 
< 2 $.  Therefore
\[ R_n (0.5) < \frac{ 2 }{ ( n + 1 ) ! }
(0.5) ^{n+1} . \]
If, now, $ n $ is chosen so that the right side is less
than $ 0.5 \times 10 ^{ - 6 } $.
The smallest such $n$, found by examining the following
table, is $ n = 7 $ where
$ R_7 (0.5) < 0.2 \times 10^{ - 6 } $.
\vspace{.1in}


\begin{center} 
{\bf TABLE 13.1}
\end{center} 
\vspace{.1in}

\begin{center}
\begin{tabular}{c|l}
$n$ & $ {\displaystyle \frac{ 2 }{ ( n + 1 ) ! }} (0.5) ^{n+1} $ \\
\hline 1 & 0.25 \\
2 & 0.04166667 \\
3 & 0.00520833 \\
4 & 0.00052083 \\
5 & 0.00004340 \\
6 & 0.00000310 \\
7 & 0.00000019 
\end{tabular}
\end{center}
\vspace{.1in}

\noindent 
Hence the approximation
\[ \begin{array}{rl}
\sqrt{ e } & \approx 1 + (0.5) + 
{\displaystyle \frac{ (0.5)^2 }{ 2 }} + \cdots + 
{\displaystyle \frac{ (0.5)^7 }{ 7 ! }} \\ [0.1in]
& \approx 1.6487212 \end{array} \]
has an error of at most 2 units 
in the seventh decimal place and, therefore, 
$ \sqrt{ e } \approx 1.648721 $.  $ \ddagger $
\vspace{.1in}

In this example we obtained the best (rounded)
six decimal place approximation by forcing the error
under $ 0.5 \times 10^{ - 6 } $.  This suggests
that five place accuracy will be obtained by forcing the error 
under $ 0.5 \times 10^{ - 5 } $, four place accuracy 
if the error is less than $ 0.5 \times 10^{ - 4 } $,
and so on.  This often is the case and the rule is 
worth using, but it does not always work as may be
seen in the problem of approximating
\[ \ln \: 1.25 = 0.2231435 ... \]
to four place accuracy.  Suppose we obtain 
the approximation 0.22314 with a maximum 
error of $ 0.5 \times 10^{ - 4 } $, meaning that $ \ln \:
1.25 $ is greater than or equal to $ 0.22314 - 
0.00005 = 0.22309 $ and less than or equal to
$ 0.22134 + 0.00005 = 0.22319 $.
However, approximation is obtained by rounding down to 
0.2231 or up to 0.2232.
\vspace{.1in}

\noindent 
{\bf Example 3}.  (a) If $ f (x) = \ln x $, write Taylor's formula 
with remainder for $ n = 5 $ at $ a = 1 $.  (b) Use the
formula to approximate $ \ln \: 0.8 $ and estimate the error.
\vspace{.1in}

\noindent 
{\bf Solution}.  (a) Based on the derivatives
\[ \begin{array}{ll}
f (x) = \ln \: , ~~ f (1) = 0 &
f^{ (4) } (x) = 
- {\displaystyle \frac{ 3 ! }{ x^4 }} , ~~
f^{ (4) } (1) = - 3 ! 
\\ [0.2in] 
f ^{'} (x) = {\displaystyle \frac{ 1 }{ x }} , ~~
f ^{'} (1) = 1 & 
f^{ (5) } (x) = 
{\displaystyle \frac{ 4 ! }{ x^5 }} , ~~
f^{ (5) } (1) = 4 !  
\\ [0.2in] 
f^{ (2) } (x) = {\displaystyle \frac{ 1 }{ x^2 }} , ~~
f^{ (2) } (1) = - 1 & 
f^{ (6) } (x) = - {\displaystyle \frac{ 5 ! }{ x^6 }} , ~~
f^{ (6) } (c) = - {\displaystyle \frac{ 5 ! }{ c^6 }} 
\\ [0.2in] 
f^{ (3) } (x) = {\displaystyle \frac{ 2 }{ x^3 }} , ~~
f^{ (3) } (1) = 2 & \end{array} \]
the fifth degree Taylor's formula is
\[ \ln \: x = ( x - 1 ) - 
\frac{ 1 }{ 2 } ( x - 1 )^2 
+ \frac{ 1 }{ 3 } 
( x - 1 )^3 - \frac{ 1 }{ 4 }
( x - 1 )^4 + \frac{ 1 }{ 5 }
( x - 1 )^5 - 
\frac{ 1 }{ 6 c^6 }
( x - 1 )^6 . \]
In the remainder 
\[ R_6 (x) = - \frac{ 1 }{ 6c^6 }
( x - 1 )^6 , \]
$c$ denotes a number between 1 and $x$.

\noindent 
(b) The error in the approximation
\[ \begin{array}{rl}
\ln \: 0.8 & \approx - 0.2 - 
\frac{ 1 }{ 2 } 
(-0.2)^2 + \frac{ 1 }{ 3 }
(-0.2)^3 - \frac{ 1 }{ 4 } 
(-0.2)^4 + \frac{ 1 }{ 5 }
(-0.2)^5 \\ [0.1in]
& \approx - 0.223131 \end{array} \]
is
\[ R_6 (0.8) = - \frac{ 1 }{ 6 c^6 } (-0.2)^6 . \]
It is worth recording that $ R_6 (0.8) < 0 $
so that $ \ln \: 0.8 < - 0.223131 $.  Because $ 0.8
< c < 1 , ~~ {\displaystyle \frac{ 1 }{ c } < 
\frac{ 1 }{ 0.8 } } $
and $ {\displaystyle \frac{ 1 }{ c^6 } < \frac{ 1 }{ ( 0.8 )^6 }} $;
therefore,
\[ | R_6 (0.8) | = - \frac{ 1 }{ 6 c^6 }
(- 0.2)^6 | = \frac{ 1 }{ 6c^6 } (0.2)^6 
< \frac{ 1 }{ 6 } \left ( \frac{ 0.2 }{ 0.8 } \right )^6
= 0.0000406 ... ~~ . \]
Hence $ - 0.000041 < R_6 (0.8) < 0 $ and
\[ - 0.223172 < \ln \: 0.8 < 
- 0.223131 . \]
From this we can conclude that $ \ln \: 0.8 =
- 0.2231 ... $, meaning that the 
first four decimal digits are the actual digits in the complete
representation of $ \ln \: 0.8 $, but only that $ \ln 
\: 0.8 \approx - 0.223 $, not knowing whether the
fifth digit is less than or greater than or equal to 5.
Note that the error is less than
$ 0.5 \times 10^{ - 4 } $.  $ \ddagger $
\vspace{.1in}

In the Taylor's formula expansion of $ \ln \: x $
in powers of $ x - 1 $ plus a remainder,
\[ \begin{array}{rl}
\ln \: x & = 
( x - 1 ) - {\displaystyle \frac{ 1 }{ 2 }}
( x - 1 )^2 + \cdots + 
{\displaystyle \frac{ ( - 1 )^{ n - 1 }}{ n }} 
( x - 1 )^n + {\displaystyle \frac{ ( - 1 )^{ n + 1 }}{ n
+ 1 } \frac{ 1 }{ c ^{n+1} }}  
( x - 1 )^{n+1} \\ [0.2in]
& = P_n (x) + R_n (x) , \end{array} \]
the approximation $ \ln \: x \approx P_n (x) $ is good
for small $n$ only so long as $x$ is
near 1.  The following table illustrates this dependence
for two values of $x$.  The actual value $ \ln \: 1.2 = 0.1823215 ...  $
is approximated well by $ P_n (1.2) $.
\vspace{.1in}

\begin{center}
Table 13.2
\end{center}
\vspace{.1in}

\begin{center} 
\begin{tabular}{|c|l|l|l|l|}
\hline
$n$ & $ ~~~ P_n (1.2) $ & ACTUAL ERROR & $ ~~~ P_n (2) $ & ACTUAL ERROR
\\ \hline
1 & 0.2 & $-$ 0.017678... & 1 & $-$0.306852... \\
2 & 0.18 &  0.002321... &  0.5 &  0.193147... \\
3 & 0.182266... & $-$0.000345... &  0.833333... & $-$0.140186... \\   
4 & 0.182266... &  0.000054... &  0.583333... &  0.1098138... \\ 
5 & 0.182330... & $-$0.000009... & 0.783333... & $-$0.090186... \\
6 & 0.1823200 &  0.000001... &  0.616666... &  0.076480... \\
\hline \end{tabular} 
\end{center}

\noindent
for $ n = 2 ,,3,4,5,6 $.  In fact $ P_6 ( 0.8 ) 
= 0.1823200 $ is accurate through 5 decimal places.  But at
$ x = 2 $, the approximation of the actual value $ \ln \: 2 
= 0.693147... $ by $ P_n (2) $ is 
worthless for small $n$.  At $ n = 6 $ the best estimate 
we can make for the remainder $ R_6 (2) = \frac{ 1 }{ 7 }
c^{ -7 } = \frac{ 1 }{ 7 } c^{ - 7 } $ 
is $ R_6 (2) < \frac{ 1 }{ 7 } \approx
0.14 $, while the absolute value of the actual error 
in the approximation $ P_n (2) \approx \ln \: 2 $
is about half the remainder, that is, $ | tlj \: 2 
- P_n (2) | \approx {\displaystyle \frac{ 1 }{ 2 ( n + 1 ) }} $.
This means it would take an $n$ of about 10,000 to reduce the
error to $ 0.5 \times 10^{ - 4 } $.  Such computations
dramatically illustrate why we insist that $ x - a $
be small in Taylor's formula when the goal is the approximation 
of $ f(x) $.  In general, $x$ is given and the initial problem is to
find a nearby point $a$ at which $f$ and its derivatives can be
easily calculated.
\vspace{.1in}

\noindent 
{\bf Example 4}.  Approximate $ \cos \: 68^{ \circ } $ to four
decimal place accuracy.
\vspace{.1in}

\noindent 
{\bf Solution}.  The point nearest to $ 68^{ \circ } $ at which
$ f(x) = \cos \: x $ and its derivatives are easily evaluated
is $ a = 60^{ \circ } = \frac{ \pi }{ 3 } $ radians.  For this
reason our decision is to expand $ \cos \: x $
in powers of $ x - \frac{ \pi }{ 3 } $ plus a remainder.
Since $ | \sin \: c | \leq 1 $
and $ | \cos \: c | \leq 1 $, we have the estimate
\[ | rn (x) | = \left | \frac{ f ^{n+1} (c) }{ ( n + 1 ) ! } \:
\left ( x - \frac{ \pi }{ 3 } \right ) ^{n+1} \right | 
\leq \frac{ 1 }{ ( n + 1 ) ! } \:
| x - \frac{ \pi }{ 3 } | ^{n+1} \: . \]
To obtain the desired accuracy, we let
$ x = {\displaystyle \frac{ 68 \pi }{ 180 }} $
in the remainder and increase $n$ until
\[ \frac{ 1 }{ ( n + 1 ) ! } \:
\left | \frac{ 68 \pi }{ 180 } 
- \frac{ \pi }{ 3 } \right |^{ n + 1 } < 
0.5 \times 10^{ - 4 } . \]
This inequality is first satisfied at $ n = 3 $
where $ R_3 \left ( {\displaystyle \frac{ 68 \pi }{ 180 }} 
\right ) < 0.000012 $.  From the derivatives
\[ \begin{array}{ll}
f (x) = \cos \: x , ~~ f \left ( \frac{ \pi }{ 3 } \right ) = \frac{ 1 }{ 2 } , 
& f ^{ (3) } (x) = \sin \: x , ~~ f^{ (3) } 
\left ( \frac{ \pi }{ 3 } \right ) = \frac{ \sqrt{ 3 }}{ 2 } , 

\\ [0.2in]

f ^{'} (x) = - \sin \: x , ~~ f ^{'} 
\left ( \frac{ \pi }{ 3 } \right ) 
= - \frac{ \sqrt{ 3 }}{ 2 } ,  
& 
f^{ (4) } (x) = \cos \: x , ~~ f^{ (4) } (c) 
= \cos \: c ; 

\\ [0.2in]

f^{ (2) } (x) = - \cos \: x , ~~
f^{ (2) } 
\left ( \frac{ \pi }{ 3 } \right ) 
= - \frac{ 1 }{ 2 } , & \end{array} \]
it follows that Taylor's formula with remainder 
at $ a = \frac{ \pi }{ 3 } $ and with
$ n = 3 $ is
\[ \cos \: x = \frac{ 1 }{ 2 } -
\frac{ \sqrt{ 3 }}{ 2 } \left (
x - \frac{ \pi }{ 3 } \right )
- \frac{ 1 }{ 2 } \: \frac{ 1 }{ 2 ! } \:
\left ( x - \frac{ \pi }{ 3 } \right )^2
+ \frac{ \sqrt{ 3 }}{ 2 } \: \frac{ 1 }{ 3 ! } \:
\left ( x - \frac{ x }{ 3 } \right )^3
+ \frac{ \cos \: c }{ 4 ! } \:
\left ( x - \frac{ x }{ 3 } \right )^3 . \]
Hence, in the approximation
\[ \begin{array}{rl} \cos \: 68^{ \circ } = \cos \: 
\frac{ 68 \pi }{ 180 } & \approx
\frac{ 1 }{ 2 } - \frac{ \sqrt{ 3 }}{ 2 }
\left ( \frac{ 68 \pi }{ 180 } \right ) - 
\frac{ 1 }{ 2 } \frac{ 1 }{ 2 ! } 
\left ( \frac{ 68 \pi }{ 180 } \right )^2
+ \frac{ \sqrt{ 3 }}{ 2 } \frac{ 1 }{ 3 ! }
\left ( \frac{ 68 \pi }{ 180 } \right )^3 \end{array} \]
the error is no more than two units in the 
fifth decimal digit and, therefore, $ \cos \: 68^{ \circ }
\approx 0.3746 $ rounded to four decimal places.  $ \ddagger $
\vspace{.1in}

Our final example on approximation illustrates the power of Taylor's
formula in a different setting.
\vspace{.1in}

\noindent 
{\bf Example 5}.  Approximate the integral $ {\displaystyle 
\int_{ 0 }^{0 \cdot 2 } } \: \sqrt{ x } \: \sin \: x \: d x $
by making a substitution based on the approximation $ \sin \: x
\approx x - {\displaystyle \frac{ x^3 }{ 3 ! }} $.
Estimate the error.
\vspace{.1in}

\noindent 
{\bf Solution}.  Since the integral is one which cannot be evaluated
by finding an antiderivative, we simply
replace $ \sin \: x $ by $ x - 
{\displaystyle \frac{ x^3 }{ 3 ! }} $ and write
\[ \begin{array}{rl}
{\displaystyle \int_{ 0 }^{ 0 \cdot 2 }} \:
\sqrt{ x } \: \sin \: x \: d x & \approx 
{\displaystyle \int_{ 0 }^{ 0 \cdot 2 }} \:
\sqrt{ x } \left ( x - 
\frac{ x^3 }{ 3 ! } \right ) \: d x 
\: {\displaystyle \int_{ 0 }^{ 0 \cdot 2 }} \:
\left ( x^{ 3/2 } - \frac{ 1 }{ 6 } x^{ 7/2 }
\right ) \: d x 
\\ [0.2in]
& = \left [ \frac{ 2 }{ 5 } x^{ 5/2 } - \frac{ 1 }{ 27 }
x^{ 9/2 } \right ]_0^{ 0 \cdot 2 } = 
\frac{ 2 }{ 5 } ( 0.2 )^{ 5/2 } - \frac{ 1 }{ 27 }
( 0.2 )^{ 9/2 } 
\\ [0.2in]
& \approx 0.00712892 \: . \end{array} \]
Of course, the error committed depends on the size of the
remainder term in the expansion
\[ \begin{array}{rl}
\sin \: x & = x = 0 + x - 0 
\cdot 
\frac{ x^2 }{ 2 ! } -
\frac{ x^3 }{ 3 ! } + 
0 \cdot \frac{ x^4 }{ 4 ! } + \cos \: c \cdot 
\frac{ x^5 }{ 5 ! } \\ [0.2in]
& = x - \frac{ x^3 }{ 3 ! } + 
+ \cos \: c \cdot 
\frac{ x^5 }{ 5 ! } \: . \end{array} \]
In the remainder terms $ R_4 (x) $, $c$ is between 0 and $x$.
(We could have chosen $ n = 3 $, but the term involving
$ x^4 $ is absent and $ R_4 (x) $ is smaller than 
$ R_3 (x) $ in absolute value on the interval 
$ [0,0.2] $.)  It follows from the last equation 
that the difference between the function  and its Taylor 
approximation is given by
\[ \sqrt{ x } \: \sin \: x - 
\sqrt{ x } \left ( x - \frac{ x^3 }{ 3 ! } \right ) 
= \sqrt{ x } \: \cos \: c \] 
and hence that
\[ | \sqrt{ x } \: \sin \: x - \sqrt{ x } \left (
x - \frac{ x^3 }{ 3 ! } \right ) | 
= | \sqrt{ x } \: \cos \: c \:
\frac{ x^5 }{ 5 ! } | \leq 
\frac{ x^{ 11/2 }}{ 5 ! } \]
on the interval $ [ 0,0.2] $.  This inequality provides a concrete
statement about how well $ \sqrt{x} \: \left ( x - \frac{ x^3 }{ 3 ! } 
\right ) $ approximates $ \sqrt{ x } \: \sin \: x $.
Next we use the integral inequality 
$ \left | {\displaystyle \int_a^b } \: ( (u(x) - v(x) ) \: d x 
\right | \leq 
{\displaystyle \int_a^b } \: | u (x) - v (x) | \:
d x $ to obtain the following estimate:
\[ \begin{array}{l} \left | \: 
{\displaystyle \int_{ 0 }^{ 0 \cdot 2 }} \: \sqrt{ x }
\: \sin \: x \: d x - 
{\displaystyle \int_{ 0 }^{ 0 \cdot 2 }} \: \sqrt{ x }
\: x - \frac{ x^3 }{ 3 ! } \: d x \right |
\leq {\displaystyle \int_{ 0 }^{ 0 \cdot 2 }} \: | \sqrt{ x }
\: \sin \: x - \sqrt{x} \: \left ( 
x - \frac{ x^3 }{ 3 ! } \right ) | \: d x \leq 
{\displaystyle \int_{ 0 }^{ 0 \cdot 2 }} \: 
\frac{ x^{ 11 / 2 }}{ 5 ! } \: d x 
\\ [0.2in]
~~~~~~ = \frac{ 1 }{ 120 } \: \frac{ 2 }{ 13 } \: ( 0.2 )^{ 13 / 2 }
= 0.000000036... \: . \end{array} \]
To sum up, the error in the approximation 
$ {\displaystyle \int_{ 0 }^{ 0 \cdot 2 }} \: \sqrt{ x } \:
\sin \: x \: d x \approx 0.00712892 $
is no more than 0.00000004, accordingly,
$ {\displaystyle \int_{ 0 }^{ 0 \cdot 2 }} \: \sqrt{ x } \:
\sin \: x \: d x \approx 0.007129 "$
rounded to six decimal places.  $ \ddagger $ 
\vspace{.1in}

 


\section{ 
\index{L'Hospital's Rule} L'Hospital's Rule:  The \index{Indeterminate Form} Indeterminate Form 
$ \boldmath \mbox{$ {\displaystyle \frac{0}{0}} $}$}
 

In our previous work we have been frequently asked to find
the limit of a quotient $ f(x) / g(x) $.  The method 
introduced in Section 2.5 asserted that if
$ {\displaystyle \lim_{ x \rightarrow a }} \: f(x) = A $
and $ {\displaystyle \lim_{ x \rightarrow a }} \:  g(x) = B $,
and $ B \neq 0 $, then
\[ {\displaystyle \lim_{ x \rightarrow a }} \:  \frac{ f(x) }{ g(x) }
= \frac{ A }{ B } . \]
However, nothing was said there about the case
$ B = 0 $.  Of course, one possibility is 
$ B = 0 $ and $ A \neq 0 $.  If, for
instance, $ f(x) = x , ~~ g(x) = x - 4 $, and $ a = 4 $, then
\[ A = {\displaystyle \lim_{ x \rightarrow 4 }} \: f(x) = 4 , ~~
B = {\displaystyle \lim_{ x \rightarrow 4 }} \: g(x) = 0 \]
and 
\[ {\displaystyle \lim_{ x \rightarrow 4 }} \: \frac{ f(x) }{ g(x) }
= {\displaystyle \lim_{ x \rightarrow 4 }} \: \frac{ x }{ x - 4 } \]
fails to exist because the ratio increases to $ \infty $
as $ x \rightarrow 4^+ $ and decreases to $ - \infty $ as 
$ x \rightarrow 4^- $.  The more interesting situation
is $ B = 0 $ and $ A = 0 $.  In this case the limit of the quotient 
$ f(x) / g(x) $ is said to be ``indeterminate at $a$''
because it assumes the form ``$0/0$'' as $x$ approaches $a$.
The actual limit may or may not exist and, if it
does any real number is a possible limit.  Consider
$ f(x) = x $ and $ g(x) = x^2 $.  Then 
$ {\displaystyle \lim_{ x \rightarrow 0 }}\:  f(x) = 0 , ~~
{\displaystyle \lim_{ x \rightarrow 0 }}\:  g(x) = 0 $ and
\[ {\displaystyle \lim_{ x \rightarrow 0 }}\:  \frac{ f(x) }{ g(x) } = 
{\displaystyle \lim_{ x \rightarrow 0 }}\:  \frac{ x }{ x^2 } = 
{\displaystyle \lim_{ x \rightarrow 0 }}\:  \frac{ 1 }{ x } ~~
\mbox{does not exist);} \]
but the functions $ f(x) = k \: \sin \: x $ ($k$ a real number) and
$ g(x) = x $ both have limit zero
at $ x = 0 $ and, as we saw in Section ,
\[ {\displaystyle \lim_{ x \rightarrow 0 }}\:  \frac{ f(x) }{ g(x) }
= {\displaystyle \lim_{ x \rightarrow 0 }}\:  \frac{ k \: \sin \: x }{ x }
= k \: {\displaystyle \lim_{ x \rightarrow 0 }}\:  
\frac{ \sin \: x }{ x } = k \cdot 1 = k . \]
Taylor's formula suggests a method for evaluation
limits which have the \index{indeterminate form $ 0/0 $} indeterminate form $ 0/0 $.

Let $f$ and $g$ be two functions which
have continuous second derivatives in some open
interval about $a$.  Then, using Taylor's formula, we may write
\[ f(x) = f(a) + f ^{'} (a) ( x-a ) 
+ \frac{ f ^{''} ( z_1 ) }{ 2 } ( x-a ) ^2 \]
for some $ z_1 $ between $a$ and $ x $, and
\[ g(x) = g(a) + g ^{'} (a) ( x-a ) 
+ \frac{ g ^{''} ( z_2 ) }{ 2 } ( x-a ) ^2 \]
for some $ z_2 $ between $a$ and $x$.  Now assume that
\[ {\displaystyle \lim_{ x \rightarrow a }} \:  f(x) = f(a) = 0 ~~
\mbox{and} ~~ {\displaystyle \lim_{ x \rightarrow a }} \:  g(x) = g(a) = 0 . \]
Thus for $x$ in the indicated interval and $ x \neq a $,
\[ \begin{array}{rl}
{\displaystyle \frac{ f(x) }{ g(x) }} & =
{\displaystyle \frac{ f(a) + f ^{'} (a) ( x-a ) + 
\frac{ f ^{''} ( z_1 ) }{ 2 } ( x-a ) ^2 }{ g(a) 
+ g ^{'} (a) ( x-a ) 
+ \frac{ g ^{''} ( z_2 ) }{ 2 } 
( x-a ) ^2 }} = 
{\displaystyle \frac{ f ^{'} (a) ( x-a ) + \frac{ f ^{''} ( z_1 ) }{ 2 } 
( x-a ) ^2 }{ g ^{'} (a) ( x-a ) + 
\frac{ g ^{''} ( z_2 ) }{ 2 } ( x-a ) ^2 }} \\ [0.3in]
& = {\displaystyle 
\frac{ f ^{'} (a) + \frac{ f ^{''} ( z_1 ) }{ 2 } ( x-a ) } {
g ^{'} (a) + \frac{ g ^{''} ( z_2 ) }{ 2 } ( x-a ) }} . \end{array} \] 
 
As $ x \rightarrow a , ~~ z_1 $ and $ z_2 $ must also
tend to $a$ and the second term in both the numerator and 
denominator of this last quotient tend to zero.  Hence 
\[ {\displaystyle \lim_{ x \rightarrow a }} \:  \frac{ f(x) }{ g(x) }
= \frac{ f ^{'} (a) }{ g ^{'} (a) } \]
provided that $ g ^{'} (a) \neq 0 $.  This analysis suggests
that, under certain conditions, a quotient 
$ f(x) / g(x) $ that has the indeterminate form $ 0/0 $
at $ x = a $ and the quotient of 
derivatives $ f ^{'} (x) / g ^{'} (x) $ have the same limit
as $x$ tends to $a$.  The various conditions that permit
this procedure are commonly known as L'Hospital's rules
after the 17th century French mathematician who popularized them.
\vspace{.1in}

\noindent 
{\bf Theorem 2}.  Suppose that $f$ and $g$ are continuous functions on
the closed
interval $ [ a,b ] $, differentiable on the open interval 
$ ( a,b ) $, and that
\eqn{1}
\begin{equation}
{\displaystyle \lim_{ x \rightarrow a^+ }} \: f(x) = f(a) = 0 , ~~
{\displaystyle \lim_{ x \rightarrow a^+ }} \: g(x) = g(a) = 0 .
\end{equation}
Suppose also that 
\eqn{2} 
\begin{equation} 
g ^{'} (x) \neq 0 ~~ \mbox{for} ~~ a < x < b . 
\end{equation}
Then,
\eqn{3}
\begin{equation} 
\mbox{if $ {\displaystyle \lim_{ x \rightarrow a^+ }} \:
{\displaystyle \frac{ f ^{'} (x) }{ g ^{'} (x) }} = 
\infty $ [or $ - \infty $], it follows that 
$ {\displaystyle \lim_{ x \rightarrow a^+ }} \: {\displaystyle \frac{ f(x) }{ g(x) }}
= \infty $ [or $ - \infty $].}  
\end{equation}
\vspace{.1in}

\noindent 
{\bf Proof}.  Our proof skirts Taylor's formula, depending
rather on an approach which avoids assuming that $f$ is differentiable 
at $ x = a $.  To begin, we choose a number $x$,
$ a < x < b $, and consider the new function 
\eqn{5}
\begin{equation}
H (t) = f(x) g (t) - g(x) f(t) , ~~
a \leq t \leq x . 
\end{equation}
As a function of $t$, $H$ is continuous on $ [a,x] $
and differentiable for $ a < t < x $.
Further, $ H (x) = f(x) g(x) - g(x) f(x) = 0 $,
$ H (a) = f(x) g(a) - g(x) f(a) = 0 $ by (1) and, since $x$
is fixed,
\[ H ^{'} (t) = f(x) g ^{'} (t) 
- g(x) f ^{'} (t) . \]
According to Rolle's theorem this derivative must be zero 
at least once between 0 and $x$.  Hence there
is a number $ z , ~~ a < z < x $, such that $ H ^{'} (z)
= f(x) g ^{'} (z) - g(x) f ^{'} (z) = 0 $ or,
since $ g ^{'} (z) \neq 0 $ by (2),
\[ \frac{ f(x) }{ g(x) } = 
\frac{ f ^{'} (z) }{ g ^{'} (z) } . \]
Because $ a < z < x $, we see that $ z \rightarrow a^+ $ if
$ x \rightarrow a^+ $ and, therefore,
\[ {\displaystyle \lim_{ x \rightarrow a^+ }} \: 
\frac{ f(x) }{ g(x) } = 
{\displaystyle \lim_{ x \rightarrow a^+ }} \:  
\frac{ f ^{'} (z) }{ g ^{'} (z) } = 
{\displaystyle \lim_{ z \rightarrow a^+ }} \:  
\frac{ f ^{'} (z) }{ g ^{'} (z) } . \]
Clearly, if $ {\displaystyle \lim_{ z \rightarrow a^+ }} \:
{\displaystyle \frac{ f ^{'} (z) }{ g ^{'} (z) }} = L $, then
$ {\displaystyle \lim_{ x \rightarrow a^+ }} \: {\displaystyle \frac{ f(x) }{ g(x) }}
= L $.  On the other hand, if $ {\displaystyle \frac{ f ^{'} (z) }{ 
g ^{'} (z) }} $ increases without bound as $ z \rightarrow a^+ $,
that is if $ {\displaystyle \lim_{ z \rightarrow a^+ }} \:
{\displaystyle \frac{ f ^{'} (z) }{ g ^{'} (z) }} = \infty $,
then $ {\displaystyle \lim_{ x \rightarrow a^+ }} \: {\displaystyle \frac{ f(x) }{ g(x) }}
= \infty $ also.  The same analysis applies if
$ {\displaystyle \lim_{ z \rightarrow a^+ }} \:
{\displaystyle \frac{ f ^{'} (z) }{ g ^{'} (z) }} = - \infty $.
$ \ddagger $
\vspace{.1in}

Although our result applies only to right-hand limits, the same
argument establishes the result for
left-hand limits.  In combination, the result for right-
and left-hand limits establishes the same result for 
two-sided limits.  Thus the results of Theorem 2 are valid
if $ {\displaystyle \lim_{ x \rightarrow a^+ }} $ is replaced everywhere by
$ {\displaystyle \lim_{ x \rightarrow a^- }} $ or everywhere by 
$ {\displaystyle \lim_{ x \rightarrow a }} $ and the assumptions on 
$f$ and $g$ are modified accordingly.
\vspace{.1in}

\noindent 
{\bf Example 1}.  Find $ {\displaystyle \lim_{ x \rightarrow 0^+ }} \: 
{\displaystyle \frac{ e^x - 1 }{ \sqrt{ x } }} $.
\vspace{.1in}

\noindent 
{\bf Solution}.  Since $ {\displaystyle \lim_{ x \rightarrow 0 ^+ }} \:
( e^x - 1 ) 
= {\displaystyle \lim_{ x \rightarrow 0  ^+ }} \: \sqrt{ x } = 0 $, the
given limit has the indeterminate form $ 0/0 $.  Further, both
numerator and denominator are continuous 
for $ 0 \leq x $, differentiable for $ 0 < x $
and $ \frac{ d }{ d x } ( \sqrt{ x } ) $
is never 0.  Thus, L'Hospital's rule,
\[ {\displaystyle \lim_{ x \rightarrow 0^+ }} \:
\frac{ e^x - 1 }{ \sqrt{ x } }
= {\displaystyle \lim_{ x \rightarrow 0^ + }} \:
\frac{ \frac{d}{d x} [ e^x - 1 ] }{ \frac{d}{d x} [ \sqrt{ x } ] }
= {\displaystyle \lim_{ x \rightarrow 0^ + }} \: 
\frac{ e^x }{ \frac{ 1 }{ 2 \sqrt{x} } } 
= {\displaystyle \lim_{ x \rightarrow 0^ + }} \: \frac{ 1 }{ 2 }
\sqrt{ x } e^x = 0 . \]
Note that $ \sqrt{ x } $ does not have a derivative 
at $ x = 0 $.  $ \ddagger $
\vspace{.1in}

\noindent 
{\bf Remark}.  Strictly speaking, the first equality in the
calculation is not justified until the limit on the right
is shown to exist or to tend to $ \infty $
or $ - \infty $.  However, it is common practice in applying 
L'Hospital's rule to streaming the computations as shown.
\vspace{.1in}

\noindent 
{\bf Example 2}.  Find $ {\displaystyle \lim_{ x \rightarrow 0 }}\:  
{\displaystyle \frac{ \sin \: 4x }{ 3x }} $.
\vspace{.1in}
\noindent 
{\bf Solution}.  This quotient also has the indeterminate
form $ 0/0 $ because $ {\displaystyle \lim_{ x \rightarrow 0 }}\:  
\sin \: 4x = 
{\displaystyle \lim_{ x \rightarrow 0 }}\: \sin \: 3x = 0 $.  
Hence we may apply L'Hospital's rule to find that
\[ {\displaystyle \lim_{ x \rightarrow 0 }} \:  
\frac{ \sin \: 4x }{ \sin \: 3x } 
= {\displaystyle \lim_{ x \rightarrow 0 }} \:  \frac{ \frac{d}{d x} [ 
\sin \: 4x ] }{ \frac{d}{d x} [ \sin \: 3x ] } 
= {\displaystyle \lim_{ x \rightarrow 0 }} \:  
\frac{ 4 \: \cos \: 4x }{ 3 \: \cos \: 3x }
= \frac{ 4 }{ 3 } . ~~~ \ddagger \]
\vspace{.1in}

\noindent 
{\bf Example 3}.  Find $ {\displaystyle \lim_{ x \rightarrow 0 }}\:  
{\displaystyle \frac{ x e^x - \sin \: x }{ \sin \: ( x^2 ) }} $.
\vspace{.1in}

\noindent 
{\bf Solution}.  First we check to see that 
$ {\displaystyle \lim_{ x \rightarrow 0 }}
\: ( x e^x - \sin \: x ) = {\displaystyle \lim_{ x \rightarrow 0 }} \:  
\sin \: ( x^2 ) = 0 $.  Then, by L'Hospital's rule,
\[ {\displaystyle \lim_{ x \rightarrow 0 }}\:  
\frac{ x e^x - \sin \: x }{ \sin \: ( x^2 ) }
= {\displaystyle \lim_{ x \rightarrow 0 }}\:  
\frac{ \frac{d}{d x} [ x e^x - \sin \: x ] }{ \frac{d}{d x} [ \sin \:
( x^2 ) ] } = 
{\displaystyle \lim_{ x \rightarrow 0 }}\:  \frac{ x e^x + e^x - \cos \: x }{ 2 x
\: \cos \: ( x^2 ) } . \]
But the last limit tells us nothing because 
$ {\displaystyle \lim_{ x \rightarrow 0 }}\:  ( x e^x + e^x - \cos \: x )
= {\displaystyle \lim_{ x \rightarrow 0 }}\:  2 x \: \cos \: ( x^2 ) = 0 $,
that is, we are again faced with an indeterminate 
form $ 0/0 $.  Our response is to apply 
L'Hospital's rule a second time:
\[ {\displaystyle \lim_{ x \rightarrow 0 }}\:  
\frac{ x e^x + e^x - \cos \: x }{ 2x \: \cos \: ( x^2 ) }
= {\displaystyle \lim_{ x \rightarrow 0 }}\:  
\frac{ \frac{d}{d x} [ x e^x + e^x - \cos \: x ] }{ \frac{d}{d x} 
[ 2 x \: \cos \: ( x^2 ) ] } 
= {\displaystyle \lim_{ x \rightarrow 0 }}\:  
\frac{ 2 e^x + x e^x + \sin \: x }{ 2 \: \cos \: ( x^2 ) - 4 x^2 \: 
\sin \: ( x^2 ) } = \frac{ 2 }{ 2 } = 1 . \]
Therefore
\[ {\displaystyle \lim_{ x \rightarrow 0 }}\:  
\frac{ x e^x - \sin \: x }{ \sin \: ( x^2 ) } = 1 . ~~~~ \ddagger \]
\vspace{.1in}

\noindent 
{\bf Example 4}.  Find $ {\displaystyle \lim_{ \theta \rightarrow 0 }} \:
{\displaystyle \frac{ 2 \sin \: \theta - \sin \: 2 \theta }{ \theta 
- \sin \: \theta } } $.
\vspace{.1in}

\noindent 
{\bf Solution}.  This limit may be found by three applications
of L'Hospital's rule:
\[ \begin{array}{rl}
{\displaystyle \lim_{ \theta \rightarrow 0 }}\:
{\displaystyle \frac{ 2 \sin \: \theta - \sin \: 2 \theta }{ 
\theta - \sin \: \theta }} & = 
{\displaystyle \lim_{ \theta \rightarrow 0 }}\:
{\displaystyle \frac{ 2 \cos \: \theta - \cos \: 2 \cos \: 2 \theta }{ 
1 - \cos \: \theta }} = 
{\displaystyle \lim_{ \theta \rightarrow 0 }}\:
{\displaystyle \frac{ - 2 \: \sin \: \theta + 
4 \: \sin \: 2 \theta }{ \sin \: \theta }} \\ [0.3in]
& = {\displaystyle \lim_{ \theta \rightarrow 0 }}\:
{\displaystyle \frac{ - 2 \: \cos \: \theta + 8 \: \cos \: 2 \theta }{
\cos \: \theta }} 
= {\displaystyle \frac{ 6 }{ 1 }} = 6 . ~~~~~~~~ \ddagger \end{array} \]
\vspace{.1in}

\noindent 
{\bf CAUTION}.  Never apply L'Hospital's rule 
$ {\displaystyle \lim_{ x \rightarrow a }} \:  {\displaystyle \frac{ f(x) }{ g(x) }}
= {\displaystyle \lim_{ x \rightarrow a }} \:  {\displaystyle \frac{ f ^{'} 
(x) }{ g ^{'} (x) }} $ without first
verifying that $ {\displaystyle \lim_{ x \rightarrow a }} \:  f(x) = 
{\displaystyle \lim_{ x \rightarrow a }} \:  g(x) = 0 $.  For example,
$ {\displaystyle \lim_{ x \rightarrow 1 }} \:
{\displaystyle \frac{ \sin \: \frac{ \pi }{ 6 } x }{ 1 
+ \ln \: x }} 
= {\displaystyle \frac{ 1 }{ 2 }} $ because $ {\displaystyle \lim_{ x \rightarrow 1 }} \:
( 1 + \ln \: x ) = 1 $
and $ {\displaystyle \lim_{ x \rightarrow 1 }} \: \sin \: \frac{ \pi }{ 6 } x 
= \frac{ 1 }{ 2 } $.  Clearly, it is not
legitimate to apply L'Hospital's rule. Also, keep in mind
that L'Hospital's rule replaces the quotient $ f(x) / g(x) $ with 
the quotient of derivatives
$ f ^{'} (x) / g ^{'} (x) $, which is not at all the same as 
differentiating $ f(x) / g(x) $ according to the quotient rule.



\vspace{.1in}
\section{Other Indeterminate  Forms} 


A second version of L'Hospital's rule applies to quotients
$ f(x) / g(x) $ in which both $ f(x) $ and $ g(x) $ tend to
one of $ \infty $ or $ - \infty $
as $ x \rightarrow a^+ , x \rightarrow a^- , x \rightarrow a , 
x \rightarrow \infty $, or $ x \rightarrow - \infty $.  For example,
it may be that $ f(x) \rightarrow - \infty $ and 
$ g(x) \rightarrow \infty $ as in
\[ \lim_{ x \rightarrow 0^+ } \: 
\frac{ \ln \: x }{ \mbox{csc} \: x } , \]
or that $ f(x) \rightarrow \infty $ and $ g(x) \rightarrow \infty $ as in
\[ \lim_{ x \rightarrow \infty  } \: 
\frac{ x^2 }{ e^x } . \]
We cover all possibilities by saying that 
$ f(x) / g(x) $ has {\em the indeterminate form}
$ \frac{ \infty }{ \infty } $.
\vspace{.1in}

\noindent
{\bf Theorem 3.  L'Hospital's rule 
$ \boldmath \mbox{$ \frac{ \infty }{ \infty } $}$}.

Let $f$ and $g$ be differentiable functions in the open interval
$ (a,b) $ and suppose that

\noindent 
(a) $ ~~~~ {\displaystyle \lim_{ x \rightarrow a^+ }} \:
f(x) = \infty (\mbox{or} ~ - \infty ) $
and $ {\displaystyle \lim_{ x \rightarrow a^+ }} \:  g(x) = \infty 
(\mbox{or} ~ - \infty ) $.

\noindent 
Suppose also that

\noindent 
(b) $ ~~~~ g ^{'} (x) \neq 0 $ for $ a < x < b $.

\noindent 
Then, if

\noindent  
(c) $ ~~~~ {\displaystyle \lim_{ x \rightarrow a^+ }} \:  
{\displaystyle \frac{ f ^{'} (x) }{ g ^{'} (x) }} 
= L $ or is $ \infty $ or $ - \infty $,

\noindent 
it follows that
\[ {\displaystyle \lim_{ x \rightarrow a^+ }} \:  
\frac{ f(x) }{ g(x) } = {\displaystyle \lim_{ x \rightarrow a^+ }} \:
\frac{ f ^{'} (x) }{ g ^{'} (x) } . \]

Exactly as in Theorem 2, this result remains valid if the 
limit $ x \rightarrow a^+ $ is replaced by any one of
$ x \rightarrow a^- , x \rightarrow a , 
x \rightarrow \infty $, or $ x \rightarrow - \infty $.  The proof, 
while following the pattern set in proving L'Hospital's rule
for the case $ 0/0 $, is tedious and we omit it.
It can be found in any advanced calculus text.
\vspace{.1in}

\noindent 
{\bf Example 1}.  Find (a) $ {\displaystyle \lim_{ x \rightarrow
\infty }} \:  {\displaystyle \frac{ x }{ e^x }} $ and
(b) $ {\displaystyle \lim_{ x \rightarrow \infty }} \:  
{\displaystyle \frac{ x^2 }{ e^x }} $.
\vspace{.1in}

\noindent 
{\bf Solution}.   Since $ {\displaystyle \lim_{ x \rightarrow \infty
}} \:  
x = {\displaystyle \lim_{ x \rightarrow \infty }} \:  x^2 = \infty $
and $ {\displaystyle \lim_{ x \rightarrow \infty }} \:  e^x = \infty $,
both quotients have the 
indeterminate form $ \infty / \infty $.  Thus, by L'Hospital's rule,

\noindent 
(a) \hspace{2in} 
$ {\displaystyle \lim_{ x \rightarrow \infty }} \:  
{\displaystyle \frac{ x }{ e^x }}
= {\displaystyle \lim_{ x \rightarrow \infty }} \:  
{\displaystyle \frac{ \frac{d}{d x} [x] }{ \frac{d}{d x} [ e^x ] }} 
= {\displaystyle \lim_{ x \rightarrow \infty }} \:  
{\displaystyle \frac{ 1 }{ e^x }} = 0 $

\noindent 
and, applying the rule twice,

\noindent 
(b) \hspace{1in} 
$ {\displaystyle \lim_{ x \rightarrow \infty }} \:  {\displaystyle \frac{ x^2 }{ e^x }}
= {\displaystyle \lim_{ x \rightarrow \infty }} \:  
{\displaystyle \frac{ \frac{d}{d x} [ x^2 ] }{ \frac{d}{d x} [ e^x ] }}
= {\displaystyle \lim_{ x \rightarrow \infty }} \:  
{\displaystyle \frac{ 2x }{ e^x }} = 
{\displaystyle \lim_{ x \rightarrow \infty }} \:  
{\displaystyle \frac{ \frac{d}{d x} [ 2x ] }{ \frac{d}{d x} [ e^x ] }} = 
{\displaystyle \lim_{ x \rightarrow \infty }} \:  
{\displaystyle \frac{ 2 }{ e^x }}
= 0 . ~~ \ddagger $

More generally, we may choose any positive
integer $k$ and apply L'Hospital's rule $k$
times to find that
\[ {\displaystyle \lim_{ x \rightarrow \infty }} \:  
\frac{ x^k }{ e^x } = {\displaystyle \lim_{ x \rightarrow \infty }}
\:  \frac{ k ! }{ e^x } = 0 , \]
thereby showing that $ e^x $ increases much
faster than $ x^k $, for any positive integer $k$.
\vspace{.1in}

\noindent 
{\bf Example 2}.  Find $ {\displaystyle \lim_{ x \rightarrow \infty }}
\:  {\displaystyle \frac{ \ln \: x }{ x^2 }} $.
\vspace{.1in}

\noindent 
{\bf Solution}.  Both numerator and denominator
tend to $ \infty $ as 
$ x \rightarrow \infty $.  Hence 
\[ {\displaystyle \lim_{ x \rightarrow \infty }} \:  \frac{ \ln \: x
}{ x^2 } 
= {\displaystyle \lim_{ x \rightarrow \infty }} \:  
\frac{ \frac{ 1 }{x} }{ 2x } 
= {\displaystyle \lim_{ x \rightarrow \infty }} \:  \frac{ 1 }{ 2
x^2 } = 0 . \]
Thus, $ \ln \: x $ increases at a much slower rate than $ x^2 $.  $ \ddagger $
\vspace{.1in}

\noindent 
{\bf Example 3}.  Find $ {\displaystyle \lim_{ x \rightarrow 0^+ }} \:
{\displaystyle \frac{ \ln \: ( \sin \: x ) }{ \ln \: x }} $.
\vspace{.1in}

{\bf Solution}.  Since both numerator and denominator tend to
$ - \infty $ as $ x \rightarrow 0^+ $,
\[ {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  
\frac{ \ln \: ( \sin \: x ) }{ \ln \: x }
= {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  
\frac{ \frac{ \cos \: x }{ \sin \: x } }{ \frac{ 1 }{ x } } 
= {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  \frac{ x \: \cos \: x
}{ \sin \: x } . \]
To proceed, note that the last quotient has the 
indeterminate form $ 0/0 $.  Hence 
\[ {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  
\frac{ \ln \: ( \sin \: x ) }{ \ln \: x } 
= {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  
\frac{ x \: \cos \: x }{ \sin \: x } = 
{\displaystyle \lim_{ x \rightarrow 0^+ }} \:  \frac{ \cos \: x - x \:
\sin \: x }{ \cos \: x } = 1 . \]
or
\[ {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  
\frac{ x \: \cos \: x }{ \sin \: x } 
= {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  
\frac{ x }{ \sin \: x } 
\cdot {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  \cos \: x 
= {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  
\frac{ 1 }{ \cos \: x } 
\cdot {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  \cos \: x 
= 1 \cdot 1 = 1 ~~~ \ddagger \]

We now turn our attention to some \index{limit problems} limit problems
which can be treated by our technique only after some 
algebraic manipulations.  Consider,
for example, the product $ f(x) g(x) $ in which
$ f(x) \rightarrow 0 $ which $ g(x) \rightarrow \infty $
or $ - \infty $.  We say that the resulting indeterminate form
is of {\em type} $ 0 $.$ \infty $ and we handle it 
by rearranging $ f(x) g(x) $ to
\[ \frac{ \frac{ f(x) }{ 1 }}{ g(x) } ~~ \mbox{or} ~~
\frac{ \frac{ g(x) }{ 1 }}{ f(x) } , \]
thus reducing the product to one of the forms
$ \frac{ 0 }{ 0 } $ or $ \frac{ \infty }{ \infty } $.
\vspace{.1in}

\noindent 
{\bf Example 4}.
Find $ {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  x \: \ln \: x $.
\vspace{.1in}

\noindent 
{\bf Solution}.
This product is indeterminate 
of type $ 0 \cdot \infty $
since $ {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  x = 0 $
and $ {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  \ln \: x = -
\infty $.  We change it into the form 
$ \infty / \infty $ and apply L'Hospital's rule as follows:
\[ {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  x \: \ln \: x = 
{\displaystyle \lim_{ x \rightarrow 0^+ }} \:  \frac{ \frac{ \ln \: x
}{ 1 } }{ \frac{ 1 }{ x }}
= {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  
\frac{ \frac{ 1 }{ x }}{ - \frac{ 1 }{ x^2 }} 
= {\displaystyle \lim_{ x \rightarrow 0^+ }} \:  ( - x ) 
= 0 . ~~~ \ddagger \]


