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


Limits and Derivatives


The purpose of this lab is to calculate limits using Maple and to find derivatives using the definition of the derivative.


Limits of functions and expressions can be computed in Maple using the limit command. The syntax of the limit command used to evaluate $\displaystyle \lim_{x \rightarrow c} f(x)$, using Maple is:
> limit(expression or function, x=c);
Notice that the first argument in the parentheses is the expression or function that you are taking the limit of; the second is the value that $x$ is approaching. You can type the expression directly into the limit command or another approach is to first define the expression or function with a label in Maple and use the variable name within the limit command. Below are some examples of each method.
> limit(x^2+8*sin(-3*Pi*x), x=1/2);
> f:=x->(cos(x)-1)/x;
> limit(f(x),x=0);
If the limit exists, Maple can usually find it. In cases where the limit doesn't exist, such as $\displaystyle \lim_{x \rightarrow 0} \frac{1}{x}$ or $\displaystyle \lim_{x \rightarrow 0} f(x)$ where $f(x)=\left\{ \begin{array}{cc} -x^2+4 & \mbox{if $x<0$}\\ x-2 & \mbox{if $\ x \geq 0$} \end{array} \right .$, Maple gives the answer undefined. Look at the plots of the functions to see why the limits are undefined.
> limit(1/x,x=0);
> plot(1/x,x=-5..5,y=-10..10);
> p := piecewise(x<0,-x^2+4,x>=0,x-2);
> plot(p,x=-5..5);
> limit(p,x=0);
Another reason that a limit may not exist at a particular point is because of oscillations. For instance, the limit as $x$ approaches 0 of $\displaystyle \cos (1/x)$ is undefined. To get a better idea of why, look at the plot. When evaluating the limit using Maple, the result is the range -1..1. When the limit doesn't exist, but the expression or function is bounded, this is the type of answer that Maple will give.
> plot(cos(1/x),x=-2..2);
> limit(cos(1/x),x=0);
Maple also can find one-sided limits. Suppose that you want to find the limit as $x$ approaches 0 from the right for the function $\displaystyle f(x)= x \sin (1/x)$.

> f:=x->x*sin(1/x);
> limit(f(x),x=0,right);
Similarly, you can evaluate one-sided limits from the left by replacing the second argument with the word left.


The derivative of a function $f(x)$, often written $f'(x)$, is defined by the following limit.

\begin{displaymath}f'(x)=\lim_{h \rightarrow 0} \frac{f(x+h)-f(x)}{h} \end{displaymath}

When using the definition to compute a derivative in Maple, it is easiest to first define the function $f(x)$. You can then find the difference quotient of $f(x)$ and take the limit as $h$ approaches 0 in either one or two steps. Both examples are shown below.
> f := x -> x^2+3*x+5;
> DQ:=(f(x+h)-f(x))/h;
> derivative:=limit(DQ,h=0);
To evaluate the derivative at a given x value, you can use one of two methods. Both are given below for $f'(1)$.
> subs(x=1,derivative);
> limit((f(1+h)-f(1))/h,h=0);


  1. Use Maple to evaluate each of the limits given below. If the limit exists, state the limit. If the limit does not exist, explain why. A plot may be necessary to support your answer.
    1. $\displaystyle \lim_{x \rightarrow -1} x \sin(\frac{1}{x^2-1)})$
    2. $\displaystyle \lim_{x \rightarrow -1} \frac{x^4-1}{x^3-4x-3}$
    3. $\displaystyle \lim_{x \rightarrow -1} \frac{x^4+1}{x^3-4x-3}$

  2. State whether or not the limit $\displaystyle \lim_{x \rightarrow 1} f(x)$ of the piecewise defined function $f(x)=\left\{ \begin{array}{cc} -x^3-5 & \mbox{if $x<1$}\\ 2x+3 & \mbox{if $\ x \geq 1$} \end{array} \right .$ exists or not and support your answer using one sided limits.
  3. Find the derivative of each function below using the definition of the derivative. Also, evaluate the derivative at the given value.
    1. $\displaystyle f(x)=\frac{3x^4+8x^2-1}{\sqrt{x^2+2}}$, $f'(-2.5)$
    2. $\displaystyle f(x)=\frac{\tan(x)}{x+1} f'(\pi)$

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