next up previous
Next: About this document ... Up: Labs and Projects for Previous: Labs and Projects for

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);

\begin{maplelatex}
\begin{displaymath}
8\end{displaymath}\end{maplelatex}
  > limit(sin(x)/x,x=0);

\begin{maplelatex}
\begin{displaymath}
1\end{displaymath}\end{maplelatex}
  > f := x -> (x+3)/(x^2+7*x+12) ;

\begin{maplelatex}
\begin{displaymath}
{f} := {x} \rightarrow {\displaystyle \frac {{x} + 3}{{x}^{2} + 7
\,{x} + 12}}\end{displaymath}\end{maplelatex}
  > limit(f(x),x=-3);

\begin{maplelatex}
\begin{displaymath}
1\end{displaymath}\end{maplelatex}
  > limit(f(x),x=-4);

\begin{maplelatex}
% latex2html id marker 77
\begin{displaymath}
{\it undefined}\end{displaymath}\end{maplelatex}
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);

\begin{maplelatex}
% latex2html id marker 82
\begin{displaymath}
{\it undefined}\end{displaymath}\end{maplelatex}
  > limit(sin(1/x),x=0);

\begin{maplelatex}
\begin{displaymath}
-1 .. 1\end{displaymath}\end{maplelatex}
You can also use Maple to compute limits as x goes to $\pm \infty$as shown below.
  > f(x);

\begin{maplelatex}
\begin{displaymath}
{\displaystyle \frac {{x} + 3}{{x}^{2} + 7\,{x} + 12}}\end{displaymath}\end{maplelatex}
  > limit(f(x),x=infinity);

\begin{maplelatex}
\begin{displaymath}
0\end{displaymath}\end{maplelatex}
  > limit(f(x),x= -infinity);

\begin{maplelatex}
\begin{displaymath}
0\end{displaymath}\end{maplelatex}
The formal definition for a limit is given below.

Definition

We say that the number L is the limit of f(x) as x approaches a provided that, given any number $\varepsilon \gt 0$, there exists a number $\delta \gt 0$ such that

\begin{displaymath}
\mid f(x) - L \mid < \varepsilon \end{displaymath}

for all x such that

\begin{displaymath}
0 < \mid x - a \mid < \delta .\end{displaymath}

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

  > f := x -> x^2;

\begin{maplelatex}
\begin{displaymath}
{f} := {x} \rightarrow {x}^{2}\end{displaymath}\end{maplelatex}
  > limit(f(x),x=2);

\begin{maplelatex}
\begin{displaymath}
4\end{displaymath}\end{maplelatex}
  > L := 4; epsilon := 0.2; delta := 0.1;

\begin{maplelatex}
\begin{displaymath}
L := 4\end{displaymath}\end{maplelatex}


\begin{maplelatex}
\begin{displaymath}
\varepsilon := .2\end{displaymath}\end{maplelatex}


\begin{maplelatex}
\begin{displaymath}
\delta := .1\end{displaymath}\end{maplelatex}

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

\begin{maplelatex}
\begin{displaymath}
\delta := .048\end{displaymath}\end{maplelatex}
  > plot({-epsilon, epsilon, f(x) - L},x=2-delta..2+delta);
In the first of the two plot commands, the value of $\delta$ is 0.1. This is too large, since the graph intersects the lines y=-0.2 and y=0.2. The value of 0.048 for $\delta$ in the second plot command, however, is small enough, since the graph of f(x) 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 L, $\varepsilon$, and $\delta$, 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 f(x) defined by a single formula, $\lim_{x \rightarrow a}
f(x) = f(a)$ when f(a) 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 f(x) at a is L if f(x) approaches L as x approaches a from the right. That is, the values of x satisfy x > a. The left-hand limit is defined in an analogous manner, with the values of x approaching a 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);

\begin{maplelatex}
\begin{displaymath}
1\end{displaymath}\end{maplelatex}
  > limit(floor(x),x=1,left);

\begin{maplelatex}
\begin{displaymath}
0\end{displaymath}\end{maplelatex}
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.

\begin{displaymath}
g(x) = \left\{ \begin{array}
{ll}
 -x & \mbox{if $x < 0$} \\  x^2+1 & \mbox{if $x \geq 0$}
 \end{array} \right. \end{displaymath}

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

\begin{maplelatex}
\begin{displaymath}
g := x\rightarrow {\rm piecewise}(x < 0, \, - x, \,x^{2} + 1)\end{displaymath}\end{maplelatex}
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 x, Maple checks the conditions from left to right until it finds the one that your value of x satisifies. It then plugs the value of x into the next formula. However, notice that the command above only has one condition and two formulas. This is because any value of x is either less than zero or it is greater than or equal to zero, so if a particular value of x 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);

\begin{maplelatex}
% latex2html id marker 169
\begin{displaymath}
{\it undefined}\end{displaymath}\end{maplelatex}
  > limit(g(x),x=0, left);

\begin{maplelatex}
\begin{displaymath}
0\end{displaymath}\end{maplelatex}
  > limit(g(x),x=0, right);

\begin{maplelatex}
\begin{displaymath}
1\end{displaymath}\end{maplelatex}
  > plot(g(x), x=-0.1..0.1);

Exercises

1.
For the functions and values of a given below, go through the following steps.
i.
Find whether the $\lim_{x \rightarrow a} f(x)$ exists or not. If it does, determine the limit.
ii.
For the limits that exist, find a value of $\delta$ that works for $\varepsilon = 0.1$.
(a)
$\displaystyle f(x) =\frac{\tan(\pi x)}{x} , \, a= 0$.
(b)
$\displaystyle f(x) = \frac{x^3+4x^2-12 x-1}{x^2+3x+5},\, a = 5$
(c)
$\displaystyle f(x) = \frac{\sqrt{(t+4)(t-2)^4}}{(3t-6)^2},\, a = 2$

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

\begin{displaymath}
f(x) = \left\{ \begin{array}
{ll}
 x-\sin(x) & \mbox{if $x \geq 0$} \\  -x^3 & \mbox{if $x < 0$}
 \end{array} \right. \end{displaymath}

Does $\lim_{x \rightarrow 0} f(x)$ exist? Explain your reasoning.

3.
Suppose that the function g(x) is defined by

\begin{displaymath}
g(x) = \left\{ \begin{array}
{ll}
 x^3+1 & \mbox{if $x < -1 ...
 ... = -1 $} \\  b-x & \mbox{if $x \gt -1$}
 \end{array} \right. , \end{displaymath}

where a and b are parameters. Can you find values for a and b that will make g(x) continuous at x=-1? Justify your answer.

next up previous
Next: About this document ... Up: Labs and Projects for Previous: Labs and Projects for

Dina Solitro
1/18/2000