next up previous
Next: About this document ... Up: lab_template Previous: lab_template

Subsections


Limits of Functions.

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 $x$ goes to $\pm \infty$ as shown below.
> f(x);
> limit(f(x),x=infinity);
> limit(f(x),x=-infinity);

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.

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);
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 $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);
> limit(g(x),x=0,left);
> limit(g(x),x=0,right);
> plot(g(x), x=-0.1..0.1);

Exercises

  1. Use Maple to evaluate each of the limits given below.
    1. $\displaystyle \lim_{x \rightarrow 0} \frac{x}{\sin^2(x)}$
    2. $\displaystyle \lim_{x \rightarrow \pi} \frac{x}{\sin^2(x)}$
    Although the above limits do not exist, the output to each Maple command is different. Use a plot to help you explain the difference between the two limits.
  2. Given the following peicewise function:

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

    Plot the function. Does $\displaystyle \lim_{x \rightarrow 0} f(x)$ exist? To answer this, you must show that the left and right hand limits agree and are finite. Is the function continuos at $x=0$? Explain your reasoning.

  3. Evaluate each of the following limits.

    \begin{displaymath}\lim_{x \rightarrow 0} \frac{\sin(x)-x\cos(x)}{x^2} \end{displaymath}


    \begin{displaymath}\lim_{x \rightarrow 0} \frac{\sin(x)+x\cos(x)}{x^2} \end{displaymath}

    For each of these limits, can you explain whether or not the limit of the sum is equal to the sum of the limits? To answer this, you will need to look at the following limits:

    \begin{displaymath}\lim_{x \rightarrow 0} \frac{\sin(x)}{x^2} \end{displaymath}


    \begin{displaymath}\lim_{x \rightarrow 0} \frac{-\cos(x)}{x} \end{displaymath}


    \begin{displaymath}\lim_{x \rightarrow 0} \frac{\cos(x)}{x} \end{displaymath}


next up previous
Next: About this document ... Up: lab_template Previous: lab_template
Dina Solitro
2006-10-31