> g := 9*x^2-14; > h:=-x^2; > plot([g,h],x=-2..2); > solve(g=h,x);The plot shows that there are two intersection points and the solve command finds both values. It is good to get into the habit of naming your output so you can use it in a later command. Giving the values a name makes it easy to plug them into the expression to find the values.
> ip:=solve(g=h,x);Since there are two values called , use [ ] to call up the one you want.
> subs(x=ip[1],g); > subs(x=ip[2],h);Therefore the two intersection points are and . This seems like the answer shown on the graph.
> f:=theta->-1/2*theta+sin(theta); > plot(f(theta),theta=-8*Pi..8*Pi); > solve(f(theta)=0,theta);Wow, what is that?!?! We know from the graph that there should be three answers and solve wasn't a great option so try fsolve.
> fsolve(f(theta)=0,theta);Where are the other two answers!? This is actually how fsolve usually works. It shoots for one answer and only gives that one. But you can tell fsolve where to look by getting an idea from the graph and typing that domain into the fsolve command.
> a:=fsolve(f(theta)=0,theta=-5..-1); > b:=fsolve(f(theta)=0,theta=-1..1); > c:=fsolve(f(theta)=0,theta=1..5);To find the values just plug in the names of the values.
> f(a); > f(b); > f(c);(Of course the y-values are zero!)
> limit((f(x+h)-f(x))/h,h=0);The example below shows how to use the limit definition of derivative to find with Maple.
> f := x -> x^2+3*x+5; > limit((f(1+h)-f(1))/h,h=0);
When you use the D operator to compute the derivative of a function, be careful with the parentheses. It is one of the only commands in Maple where the gets its own parentheses.
> f:=x->x^2; > D(f)(x);Finding the derivative at a specific value is easy. (Again be careful of the parentheses.)
> D(f)(2);
The D operator CANNOT be used on expressions. To differentiate expressions, you need to use the diff command. Here is an example.
> p:=3*x+2; > diff(p,x);Remember the diff command can also be applied to functions. However, the syntax for plugging in an value is a little longer with the diff command. To compute the value of the derivative at a specific value of requires you to use the subs command. First, give the diff command a name so you can call it up in the subs command.
> pprime:=diff(p,x); > subs(x=2,pprime);Another option is to embed the commands.
>subs(x=2,diff(p,x));