- Solving Equations
- The Limit Definition of the Derivative
- The Maple D and diff commands
- The Equation of a Tangent Line
- Finding Horizontal Tangents
- Exercises

> f := x-> 2*x^3-5*x^2-2*x+5; > solve(f(x)=0,x);If you forget to type in an equation and only type in an expression without setting it equal to something, Maple automatically sets the expression to zero. In the examples below, you can see some of the solving capabilities of Maple.

> plot({x^2+2*x-1,x^2+1},x=-2..2); > solve(x^2+2*x-1=x^2+1,x);Unfortuately, many equations cannot be solved analytically. For example, even the relatively simple equation sin(x) = x/2 has no analytical solution. In this case, the only possibility is to solve it numerically. In Maple, the command to use is

> solve(sin(x)=x/2,x);This is not incorrect, as some of the zeros of a function may be imaginary and others may be real. However, it is much better to solve numerically as shown below:

> fsolve(sin(x) = x/2, x);A plot of both equations on the same graph will show that this solution is not complete. There are two other intersection points that the

> f:=x->sin(x); > g:=x->x/2; > plot({f(x),g(x)},x=-2*Pi..2*Pi); > a:=fsolve(f(x)=g(x),x=-3..-1); > b:=fsolve(f(x)=g(x),x=-1..1); > c:=fsolve(f(x)=g(x),x=1..3); > evalf(f(a)); > evalf(f(b)); > evalf(f(c));Once you have solved an equation, you may want to use the output or the solution later. In order to label the output to a solution, you need to assign a label in the same line as the

> f:=x->x^2+2*x-5; > answer:=solve(f(x)=0,x); > f(answer[1]); > f(answer[2]);Here an expression was defined first and then the solution was assigned to the label ``answer''. Note that there was more than one solution. In order to substitute the answer that was listed first back into the expression, the

The derivative of a function at a point , often written , can be interpreted algebraically as the following limit

It can be interpreted geometrically as the slope of the tangent line to the graph of at and functionally as the instantaneous rate of change of at . Probably the second and third interpretations are the most important; they are certainly closer to what makes the derivative useful. In this lab, we will use Maple to explore each of these different aspects of the derivative. You can use the definition and the Maple limit command to compute derivatives directly, as shown below. You can also compute derivatives using Maple's

> f := x -> x^2+3*x+5; > limit((f(1+h)-f(1))/h,h=0);The following limit determines f'(x).

> limit((f(x+h)-f(x))/h,h=0);

- The
`D`operator acts on a function to produce the derivative of that function. - The
`diff`command acts on an expression and differentiates that expression with respect to a variable specified by the user.

When you use the `D` operator to compute the derivative of a function, the result is also a function, as shown below.

> f:=x->x^2; > D(f);If you provide a label, then you get a function you can use later in the session,

> df := D(f);However, this is usually not necessary. See the examples below.

If you want to evaluate the derivative at a specific value of or just get the expression for the derivative, you can use the following forms of the `D` operator.

> D(f)(2); > D(f)(x);This last form is the one to use for plotting, as shown below.

> plot(D(f)(x),x=-2..2);

The `D` operator cannot be used on expressions, for example trying to use it to differentiate the expresssion we defined above results in an error.

> p:=3*x+2; > D(p);If you recall that Maple uses

> D(f(x));

To differentiate expressions, you need to use the `diff` command. Here is an example.

> diff(p,x);The

> df:=diff(f(x),x); > subs(x=2,df);

> tanline := D(f)(5)*(x-5)+f(5); > plot{f(x),tanline},x=0..10);

> f := x-> 2*x^3-3*x^2-36*x+12; > plot(D(f)(x),x=-10..10); > solve(D(f)(x),x); > f(-2); > f(3);

- For the functions
and
, plot both functions on the same graph using an -domain that clearly shows all the intersection points and then find the and coordinates of the intersection points using Maple's solving capabilities.
- Find the dervative of the function
using the limit definition of the derivative, the
`diff`command and then the`D`command and then use all three methods to find the slope of at . - Find the equation of the line tangent to the graph of the function
at . Include a plot of the function and the tangent line on the same graph over the interval
.
- For the function in the last exercise, find all points on the graph of where the tangent line is horizontal. Remember that a point has an and a value.

2010-10-27