> f:=x->x^2+7*x+5; > g:=x^3-5*x+8;Here are some examples that show how D and diff work. Check the difference between these two commands.
> D(f)(x); > diff(g,x); > diff(f(x),x);See what happens with these.
> diff(g(x),x); > diff(f,x);After the last four examples, you should be convinced that proper notation is very important in doing derivatives in Maple. Maple can also do higher derivatives. Check these commands.
> diff(g,x,x); > (D@@2)(f)(x);If you want to evaluate the derivative at a specific value of x, you can use the following
> D(f)(2); > subs(x=3,diff(g,x));Suppose you wanted to find the equation of the tangent line to the graph of f(x) at the point x = 5. This can be done in Maple using the point-slope form of a line as shown below. It is not necessary to label the command tanline; but giving the line a name makes it can easy to call it up if it is needed later.
> tanline := D(f)(5)*(x-5)+f(5);More information on D and diff can be obtained through Maple help screens.
> f:=x^2*y^2+y^3; > implicitdiff(f,y,x);where f is an expression or equation, y is the dependent variable and x is the independent variable. Thus the command as just stated would compute . If f is given as an expression Maple will assume the implicit equation is f = 0. Check the results of the following commands.
> g:=x^2+y^3=1; > implicitdiff(g,y,x);Second derivatives can also be taken with implicitdiff. The following command computes .
> implicitdiff(g,y,x,x);Maple also has a command for plotting implicitly defined functions. It is in the package plots which must be called before using the command.
> with(plots): > implicitplot(x^2-y^2=1,x=-3..3,y=-3..3);