Limits problem 09 (L'Hospital).mws

1. L'Hospital's Rule.

One form of L'Hospitals rule says that if limit(f(x),x = a) = 0 and limit(g(x),x = a) = 0 then limit(f(x)/g(x),x = a) = limit(D(f)(x)/D(g)(x),x = ... , provided that the right hand limit either exists or is equal to plus or minus infinity. In this activity, we will investigate this theorem graphically by graphing both f/g and D(f)/D(g) near x = a , to see whether they approach the same value.  Let us verify that the functions f and g given by

> f:=x->sin(x)^2;g:=x->tan(x^2);

f := proc (x) options operator, arrow; sin(x)^2 end...

g := proc (x) options operator, arrow; tan(x^2) end...

satisfy the hypotheses of L'Hospital's rule at x = 0 .

> limit(f(x),x=0);limit(g(x),x=0);

0

0

Since they both have limit zero, we can proceed to investigate their graphs.

> plot([f(x)/g(x),D(f)(x)/D(g)(x)],x=-1..1,color=[red,blue]);

[Maple Plot]

Both of these curves appear to be approaching the value 1 as proc (x) options operator, arrow; 0 end proc . Now let us investigate algebraically what is happening by computing the derivatives.

> D(f)(x)/D(g)(x);

sin(x)*cos(x)/(1+tan(x^2)^2)/x

This is very interesting. Both the numerator and the denominator are approaching zero as proc (x) options operator, arrow; 0 end proc . This means that the derivatives also satisfy the hypotheses of L'Hospital's rule, so we can apply the same reasoning process, and obtain that in this case, limit(D(f)(x)/D(g)(x),x = 0) = limit(`@@`(D,2)(f)(x... .  Thus, we can check graphically what happens to all three ratios of functions.

> plot([f(x)/g(x),D(f)(x)/D(g)(x),(D@@2)(f)(x)/(D@@2)(g)(x)],x=-1..1,color=[red,blue,black]);

[Maple Plot]

Just as expected, all three of these curves seem to approach the same value as proc (x) options operator, arrow; 0 end proc . Now let compute `@@`(D,2)(f)(x)/`@@`(D,2)(g)(x) algebraically, to see what the limit really is.

> (D@@2)(f)(x)/(D@@2)(g)(x);

(2*cos(x)^2-2*sin(x)^2)/(8*tan(x^2)*(1+tan(x^2)^2)*...

Since both the sine function and tangent function approach zero as x approaches zero, it is easy to see that the limit of the numerator is 2 (since the cosine function approaches 1) and the limit of the denominator is also 2. Thus, as expected, we obtain that the the limit is 1. Of course, Maple has no problem computing any of the limits above.

> limit(f(x)/g(x),x=0);limit(D(f)(x)/D(g)(x),x=0);limit((D@@2)(f)(x)/(D@@2)(g)(x),x=0);

1

1

1

Submission:

For the following functions illustrate l'Hospital's Rule by graphing both f(x)/g(x) and f '(x)/g'(x) near x=0 to see that these ratios have the same limit as proc (x) options operator, arrow; 0 end proc . Also calculate the exact value of the limit.

(a) f(x) = e^x-1 and g(x) = x^3+4*x

(b) f(x) = 2*x*sin(x) and g(x) = sec(x)-1

Submission worksheet:

 

2. L' Hospital's Rule and the Tangent line.

Consider the graphs of two differentiable functions f and g , where f(a) = g(a) = 0 . For example

> f:=x->ln(x); g:=x-> 2*ln(x);

f := ln

g := proc (x) options operator, arrow; 2*ln(x) end ...

> plot([f(x),g(x)],x=0.4..1.6,y=-1..1,thickness=2,scaling=constrained);

[Maple Plot]

By zooming in we see that the two graphs appear to be linear.

> plot([f(x),g(x)],x=0.98..1.02,y=-.01..0.01,thickness=2,scaling=constrained);

[Maple Plot]

These figures suggests that if f(a) = 0 , and we consider the tangent line y = m[1](x-a) , where m[1] = D(f)(a) , to the curve y = f(x) at x = a , then it is such a good approximation to the original curve, that we can use it to estimate f(x) even when we take the limit limit(f(x)/g(x),x = a) . Similarly, if g(a) = 0 , and y = m[2](x-a) , where m[2] = D(g)(a) is the tangent line to the curve y = g(x) at x = a , and we assume that m[2] <> 0 , then we can use its tangent line to estimate g(x) in this limit, and we expect that limit(f(x)/g(x) = limit(m[1](x-a)/(m[2]*(x-a)) = m[....  Since m[1] = f '( a ) and m[2] = g '( a ), this is a special case of L'Hospital's rule. Let us consider an example which illustrates this special case.

Submission:

Let f(x) = x^3-3*x+2 , and g(x) = 4*exp(x-1)-4 . Write Maple procedures for these functions, and then show with Maple that limit(f(x),x = 1) = 0 and limit(g(x),x = 1) = 0 . Next, graph both functions and their tangent lines at x = 1 on the same axes. Finally, calculate D(f)(1) , D(g)(1) , and limit(f(x)/g(x),x = 1) using Maple, and show that limit(f(x)/g(x),x = 1) = D(f)(1)/D(g)(1)

Submission worksheet:

 

3. More complicated examples of L'Hospital's Rule.

Define the functions f and g by the rules f(x) = sin(x)-x , g(x) = x(cos(x)-1) . Then f(0) = 0 and g(0) = 0 , so that we can apply L' Hospital's rule to calculate limit(f(x)/g(x),x = 0) . In the previous exercise, we were able to evaluate such a limit by just plugging in the values for the derivatives; that is, we used the property limit(f(x)/g(x),x = a) = D(f)(a)/D(g)(a) . But this rule only applies when D(g)(a) <> 0 .

Show that for the functions above, D(f)(0) = 0 and D(g)(0) = 0 . Nevertheless, we can still use L'Hospital's rule to evaluate the limit. To convince yourself that it still applies, evaluate limit(f(x)/g(x),x = 0) andlimit(D(f)(x)/D(g)(x),x = 0) to see that they are the same. Next, show that `@@`(D,2)(f)(0) = 0 and`@@`(D,2)(g)(0) = 0 , but that `@@`(D,3)(f)(0) <> 0 and `@@`(D,3)(g)(0) <> 0 . Finally calculate`@@`(D,3)(f)(0)/`@@`(D,3)(g)(0) and show that this value is equal to the limit limit(f(x)/g(x),x = 0) .

Submission:

Your calculations of the values of the functions and their derivatives above, as well as the limits. Explain why it turns out that limit(f(x)/g(x) = `@@`(D,3)(f)(0)/`@@`(D,3)(g)(0),x... . What is it about the quadratic approximations for the functions f and g of this activity that is fundamentally different from the quadratic approximations for the functions f and g of the first activity?

Submission worksheet:

 

4. Other types of indeterminate forms.

In the previous activity, we considered the type 0 / 0 case of an indeterminate form, which is similar to the type infinity / infinity case. In this activity, we consider how to compute limit(f(x)^g(x),x = a) , which gives rise to three different types of indeterminate forms, type 0^0 , type infinity^0 and type 1^infinity . The trick in all three cases is to write f(x)^g(x) in the form f(x)^g(x) = exp(g(x)*ln(f(x))) , and then considerlimit(g(x)*ln(f(x)),x = a) . When this limit exists, or is equal to plus or minus infinity, we can calculate the desired limit easily.  Let us consider an example of type 1^infinity , given by

> f:=x->cos(2*x);g:=x->csc(x);

f := proc (x) options operator, arrow; cos(2*x) end...

g := csc

Of course, Maple can calculate limit(f(x)^g(x),x = 0) directly.

> limit(f(x)^g(x),x = 0);

1

But we want to study how to use L'Hospital's Rule to solve the problem. We consider the expression g(x)*ln(f(x)) = csc(x)*ln(cos(2*x)) which is an indeterminate of type infinity times 0 . To use L'Hospital's rule, rewrite the expression in the form ln(cos(2*x))/sin(x).  Then we can apply the 0 / 0 form of the rule to obtain the following.

> diff(ln(cos(2*x)),x)/diff(sin(x),x);

-2*sin(2*x)/cos(2*x)/cos(x)

It is easy to see that the limit as proc (x) options operator, arrow; 0 end proc of the expression above is zero, and since exp(0) = 1 , we see that the limit we wished to calculate is just 1.

Submission:

Let f(x) = piecewise(x <> 0,abs(x)^x,x = 0,1) .

(a) Show that f is continuous at 0.

(b) Investigate graphically whether f is differentiable at 0 by zooming in several times toward the point (0,1) on the graph of f .

(c) Show that f is not differentiable at 0. How can you reconcile this fact with the appearance of the graphs in part (b)?

Submission worksheet: