A Maple Oriented Review of Limits and Derivatives Limits Please take a moment to review the four following definitions. Function. Given two sets U and V, a function is a rule or algorithm that assigns each element of U to a single element of V. Plug an element from U into a function, and the function produces a single element of V. Domain of a function. The set of all values for which a function is defined (the U elements). The V elements compose the range of a function, the set of values it produces. Some points on the symbols that represent
functions: A function is a whole process. It is not just the rule used to
compute range values, and it is not just the values produced. The different symbols
that represent a function express the distinctions between its different parts. The
symbol f represents the whole function f, the domain, the range, and the
rule that produces range values from domain values. The symbol f(x)
represents the range of the function f (it represents the whole set V).
However, in many cases the symbol f(x) is used to mean f. The
collection of symbols Open interval. Let a and b be real numbers such that a < b. The open interval (a , b) is the set of all numbers x such that a < x < b. Note that a and b are not in the open interval (a , b). Limit of f at p. Assume a < p < b such that both (a , p) and (p , b) are in the domain of f. If, as x approaches p from both the "left" and the "right", f(x) approaches a specific number L, then L is called the limit of f as x approaches p. This is written as
Note that a, p, and b are not in the intervals (a , p) and (p , b). The definition above relies on another definition that you can look up in a calculus book. As it stands now it suffices for our purpose if you accept that the phrase "approaches a specific number" is at some point defined appropriately. Some limit examples: > f := x -> (x^5-1)/(x^2-1);
Graph f for domain values close to the origin. > plot( f(x), x=-2..2, discont=true, labels=["x","f(x)"], title=`a deceptive coupling of a domain and its range`, view=[-2..2,-20..20] );
The function f has a discontinuity at x = -1, i.e. -1 is not in the domain of f. The plot option discont tells Maple to look for discontinuous points in the domain of f, then to make adjustments in the plot execution to produce nice results. Use this option whenever a function has (or you think it might have) discontinuities in the span of domain values for which you are graphing. Try removing the discont option to see how the graph looks without it. The effect of the view option should be obvious (think about the behavior of f around x = -1), but if not, remove it and see how the plot behaves. Now assign > p := 1;
Then > Limit( f(x), x = p );
The value of this expression is > value( % );
> evalf( % );
The function Limit is the inert version of the limit function. Use Limit to produce the pretty display of a limit. Use limit to calculate the value of the limit right away. If you use Limit to produce the pretty display of a limit, note two things. One, Limit produces objects, and these objects can be assigned to variables; and two, use value to evaluate all objects produced by Limit. Some other functions that have inert forms: sum, diff, and int (see the Maple Index). As a rough check of this calculation, click the mouse on the graph of f just above p = 1. Is p = 1 in the domain of the function f ? Just as in the case of -1, plugging 1 into f produces a divide by zero operation. But Maple doesn't show a blank spot on the screen at p = 1 in the graph of f. Why? The limit of f as x approaches p = 1 is very, very close to the values f produces for inputs just to the left and right of p. An infinite number of domain and corresponding range points exist near the limit of f at p, and although the screen has no where near that kind of resolution, Maple does attempt to produce a decent approximation of them on the screen. Due to the discont option Maple does not attempt to plot the point (1, f(1) ), because this point is not in the function f. But the f(x) values that it does plot for are so close to (1, 5/2), and represented by such large pixels, that they just blur over the point (1, 5/2) on the screen, which of course is not in the graph of f. Keep this kind of limitation in mind whenever you graph functions in Maple or any other CAS. If you want more information on how to use Maple to find the discontinuities of a function, check out ?discont and/or ?fdiscont. Note that even though p = 1 is not in the domain of f, the limit of f still exists at p. The definition of the limit is constructed very carefully to allow for cases like this one. The definition requires that only the open intervals (a , p) and (p , b) be in the domain of f. By the definition of an open interval this means that a, p, and b need not be in the domain of f. To satisfy the conditions of the limit definition in this case, let a be any real number less that 1, and b any real number greater than 1. To motivate the discussion below, take another good look at the function f and its graph, and then look over the calculations below for a numeric visualization of the differences in the behavior of f close to q = -1 and p = 1. > f(x);
> f( -1001/1000 );
> evalf( % );
> evalf( f( -999/1000 ) );
> evalf( f( 1001/1000 ) );
> evalf( f( 999/1000 ) );
> f( 1 ); Error, (in f) division by zero And once again take note of the value of the limit of f as x approaches p = 1. > L := Limit( f(x), x=p );
> value( L );
Two more review definitions: Right-hand limit of f at p. Assume that the domain of the function f contains the open interval (p , b). As x approaches p from the "right", if f approaches a specific number L, then L is the right-hand limit of f as x approaches p. This is written as
Left-hand limit of f at p. Assume that the domain of the function f contains the open interval (a , p). As x approaches p from the "left", if f approaches a specific number L, then L is the left-hand limit of f as x approaches p. This is written as
> limit( f(x), x=p, right );
> limit( f(x), x=p, left );
But the left and right-hand limits of a function at a point need not be equivalent, as a quick look at the graph of f around q = -1 reveals. > q := -1;
> limit( f(x), x=q, right );
> limit( f(x), x=q, left );
Infinity is not a number, but is used to indicate that the limit of f at q = -1 is not defined, and that f gets arbitrarily large in the vicinity of q = -1. The point p = 1 displays a case where the left and right-hand limits of a function are equal. The point q = -1 displays a case where they are undefined and arbitrarily large in opposite directions. The example below is a case where the left and right-hand limits of a function at a point are both defined yet are unequal. > g := t -> t/abs(t);
> plot( g(t), t=-5..5, labels=["t","g(t)"], discont=true, scaling=constrained, view=[-5..5,-4..4] );
> limit( g(x), x=0, right);
> limit( g(x), x=0, left );
If you are interested, pull out your calculus book and find an example where both the left and right-hand limits of a function are undefined and not arbitrarily large at a certain point. Use Maple to graph the function for values near the undefined point, and then see how Maple responds when you attempt to find the limit of the function at that point (depending on the function you find, you might need to look at ?piecewise).
A friendly warning: Do not use eval or evalf to find the value of inert function objects, use value. It may seem somewhat logical (at least it did to me until I ended up with some obviously wrong answers), but eval and evalf invoke non-typical solution algorithms on the inert versions of some functions. Check out the following calculations with the inert version of the sum function. > Sum( 1/sqrt(k), k=1..infinity );
> value( % );
> evalf( %% );
In some advanced mathematical contexts the second answer has validity, and
Maple provides algorithms to produce the result. The function evalf invokes these algorithms whenever its argument is an
inert function. But the infinite series The example above is not how I discovered the differences between the uses for evalf and value, but is the example given in the book where I found the reason for the differences. I used this one because it's a simpler example of the occurence than the situattion in which I first encountered it. If you are interested, the book is Essential Maple, An Introduction for Scientific Programmers, by Roger Corless, Springer-Verlag, 1995. It is an "accelerated introduction to Maple", and it provides many useful insights into the complexities of Maple. Although it was written for Maple V release 3, most of the information it provides is still relevant for release 5, and I wouldn't be surprised if an edition for release 5 exists. You'll find a massive list of Maple books at the Waterloo Maple web site. For more details on limit, Limit, or value, place the cursor on any one of them in your Maple worksheet, and select "Help on..." from the Help menu.
One last definition: Derivative of f at x. Let
the open interval (a , b) be in the domain of f, and let x and
v be numbers in (a , b). If The derivative is a limiting process. For example, compute the
derivative of > f := x -> x^3;
For convenience, define the ratio in the definition above as a function of the variable v. > df := v -> (f(v) - f(x))/(v-x);
> Limit( df(v) , v=x );
> value( % );
And, of course, you can find the derivative of f and many other functions much more easily with the D function. > D( f );
> g := % ;
> D( g );
> h := % ;
> D( h );
> D( % );
Note that you can use the definition of a derivative as a check on the calculations of the D function. > big_fat_func := t -> sin( exp( cos(t) ) );
> D( big_fat_func );
But did D get it right? > dbig := v -> (big_fat_func(v)-big_fat_func(t))/(v-t);
> limit( dbig(v), v=t );
While this isn't a total confirmation of D's calculation, because limit might make a mistake, also, it is a reasonably confirming check. A little use of the chain rule tells you that in this case both D and limit found the correct solution.
Tutorial Index Maple Index How to... Problem Set Index
|