next up previous
Next: The diff (and Diff) Up: Preliminaries about Maple Previous: Assignments, Functions and Constants

The limit command

The limit command is used to compute limits. Its syntax is basically
> 
  limit(f,x=a);

where f is a Maple algebraic expression which (in general) depends on the variable x and a is the expression which x approaches. For example, to compute

$\displaystyle \lim_{x\rightarrow 2}^{}$$\displaystyle {\frac{3x-6}{x^2-4}}$ ,

we execute the Maple command
> 
  limit((3*x-6)/(x^2-4),x=2);


\begin{maplelatex}
\begin{displaymath}\frac{3}{4} \end{displaymath}\end{maplelatex}

Maple can also deal with limits which do not exist, for example $\displaystyle \lim_{x\rightarrow 0}^{}$$\displaystyle {\frac{1}{x}}$:

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


\begin{maplelatex}
\begin{displaymath}
undefined
\end{displaymath}\end{maplelatex}

In the following exercise, we define the slope of a straight line passing through the points (x1, y1), (x2, y2), use this function to find the slope m(x) of the line passing through the points (1, 1) and (x, x2), and finally compute the limit of m(x) as x $ \rightarrow$ 1:

> 
  slope:=(x1,y1,x2,y2)->(y2-y1)/(x2-x1);
  m:=x->slope(1,1,x,x^2);


\begin{maplelatex}
\begin{displaymath}\mathit{slope} := (x1, y1, x2, y2) \righta...
...h}\mathit{m} := x \rightarrow slope(1,1,x,x^2) \end{displaymath}\end{maplelatex}

> 
  limit(m(x),x=1);


\begin{maplelatex}
\begin{displaymath}2 \end{displaymath}\end{maplelatex}

Maple is sometimes unable to determine a limit or whether it exists. In such a case, it will return nothing after you execute the limit command.

Maple computes two-sided limits. For example, if you specify the argument x=1 as in the previous example, Maple assumes you mean that x approaches 1 from either the right or the left through real values only (as opposed to complex ones). However, Maple can compute one sided and complex limits also:

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


\begin{maplelatex}
\begin{displaymath}\infty \end{displaymath}\end{maplelatex}

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


\begin{maplelatex}
\begin{displaymath}-\infty \end{displaymath}\end{maplelatex}

> 
  limit(x*log(x),x=0,complex);


\begin{maplelatex}
\begin{displaymath}0 \end{displaymath}\end{maplelatex}

You can also compute limits as x $ \rightarrow$ $ \infty$ and limits of functions of more than one variable:

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


\begin{maplelatex}
\begin{displaymath}\frac{\pi}{2} \end{displaymath}\end{maplelatex}

> 
  limit(x/(x^2+y^2),x=0,y=0);


\begin{maplelatex}
\begin{displaymath}
undefined
\end{displaymath}\end{maplelatex}


A common error is to try to compute the limit of a function f(x) when x has been previously given a value. If you find yourself in this situation, unassign the value of x executing the command x:='x';. The previous example will fail if y still has the value assigned to it in section 4.2.


next up previous
Next: The diff (and Diff) Up: Preliminaries about Maple Previous: Assignments, Functions and Constants

Translated from LaTeX by Scott Sutherland
2002-08-29