Subsections

# Limits of functions.

## Purpose

The purpose of this lab is to use Maple to become more familiar with limits of functions, including one-sided limits.

## Background

### Simple limits and Maple

Limits of many functions and expressions can be computed in Maple with the limit command. Some examples are given below.
  > limit(x^2+2*x,x=2);


  > limit(sin(x)/x,x=0);


  > f := x -> (x+3)/(x^2+7*x+12) ;


  > limit(f(x),x=-3);


  > limit(f(x),x=-4);


If the limit exists, Maple can usually find it. In cases where the limit doesn't exist, Maple gives the answer undefined or sometimes infinity for an unbounded limit or gives a range like -1..1 if the limit doesn't exist, but the expression or function is bounded. See the examples below.
  > limit(1/x,x=0);


  > limit(sin(1/x),x=0);


You can also use Maple to compute limits as goes to as shown below.
  > f(x);


  > limit(f(x),x=infinity);


  > limit(f(x),x= -infinity);


The formal definition for a limit is given below.

Definition 1   We say that the number is the limit of as approaches provided that, given any number , there exists a number such that

for all such that

This definition may seem complicated, but its graphical interpretation is not so bad. It says that if you plot with the range set to you can always choose a value of small enough so that when you shrink the plot range to and plot the function, its graph will not intersect the top or the bottom edges of your plot. For example, suppose , and . Then any value of smaller than about will work. To see what is going on, look at the plots generated by the following commands.
  > f := x -> x^2;


  > limit(f(x),x=2);


  > L := 4; epsilon := 0.2; delta := 0.1;


  > plot({-epsilon, epsilon, f(x) - L},x=2-delta..2+delta);

  > delta := 0.048;


  > plot({-epsilon, epsilon, f(x) - L},x=2-delta..2+delta);

In the first of the two plot commands, the value of is . This is too large, since the graph intersects the lines and . The value of for in the second plot command, however, is small enough, since the graph of goes off the sides of the plot. Make sure that you understand this example. If you don't understand, ask for help. Note that by using labels for the values of , , and , we were able to use the same plot command. By copying and pasting, you can save yourself some typing. Using labels also helps prevent errors.

### Limits of more complicated functions

It should be no secret by now that for most functions defined by a single formula, when exists. For more complicated functions, this may not be true. For dealing with some of these exceptional cases, we need to define right-hand and left-hand limits. Loosely speaking, the right-hand limit of at is if approaches as approaches from the right. That is, the values of satisfy . The left-hand limit is defined in an analogous manner, with the values of approaching from the left. Maple can compute these special limits with commands like those shown below. The Maple floor function is actually the greatest integer function.
  > plot(floor(x),x=0..4);

  > limit(floor(x),x=1,right);


  > limit(floor(x),x=1,left);


The floor function is one of Maple's defined functions, so you might expect things to work properly. If you want to define your own piecewise-defined function, then the Maple piecewise command is the best way to do it. Suppose you wanted to define the following function.

Then the Maple command would be the following.
  > g := x -> piecewise(x < 0, -x, x^2+1);


If you want to see your function in a more familiar form, just run a command like the one below.
  > g(x);


The way the piecewise command works is that you give it a sequence of pairs of conditions and formulas that define your function. When you want to evaluate your function at a particular value of , Maple checks the conditions from left to right until it finds the one that your value of satisifies. It then plugs the value of into the next formula. However, notice that the command above only has one condition and two formulas. This is because any value of is either less than zero or it is greater than or equal to zero, so if a particular value of fails the first condition, i.e. is not less than zero, it must be greater than or equal to zero and the second formula is the one to use. For more information, see the help page for piecewise.

The limit command works fine for functions that are defined via the piecewise command, as shown in the example below.

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


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


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


  > plot(g(x), x=-0.1..0.1);


## Exercises

1. For the functions and values of given below, go through the following steps.
i.
Find whether the exists or not. If it does, determine the limit.
ii.
For the limits that exist, find a value of , close to the maximum such value of delta, that works for .

1. .

2. Find the right- and left-hand limits of the following function at . Also, plot the function and relate your limits to the graph.

3. Suppose that the function is defined by

where and are parameters. Can you find values for and that will make continuous at ? Justify your answer.