Maple Help Page

The basic start to any problem is entering a function. Below is a line entering two functions, f(x) and g(x). (Note that Maple is case sensitive.)

> f:=x->x^4-8*x^2+10; g:=x->exp(-2*x);

The next command shows how to graph a function. The limit on the range is optional, but helps make graphs easier to view.

> plot(f(x),x=-4..4,y=-10..50);

To plot both functions you type the following:

> plot({f(x),g(x)},x=-4..4,y=-10..40);

To find the x-intercepts of f(x), you can use either Maple's solve or fsolve commands. The command has two parts: 1. The equation to be solved. 2. The variable to solve for. For a polynomial, Maple finds all possible intersections, but this is only for polynomials.

> solve(f(x)=0,x);

> fsolve(f(x)=0,x);

To find where f(x) and g(x) intersect, we can use the fsolve command again.

> fsolve(f(x)=g(x),x);

Notice that this gave only the middle point of intersection. (You never know exactly which point of intersection Maple will find, but it often stops with the first one that it finds.) Say you want the first point of intersection, and that you want the y value of this intersection. We use the fsolve command with a restricted domain of searching and assign it to a variable named xi ( := is Maple's way of assigning a variable), then we evaluate f at xi.

> xi:=fsolve(f(x)=g(x),x=-2..0);f(xi);

Next we want to find the derivative of both f(x) and g(x). We will assign the derivative of f(x) to df to use later for finding extrema. The Maple command for differentiation is diff. Notice that again this is a two part command: 1. The function to be differentiated 2. The variable that you are differentiating with respect to.

> df:=diff(f(x),x); diff(g(x),x);

Now we want to find the extrema.

> xm:=fsolve(df=0,x);

Notice that xm has 3 values, so to find the corresponding y values, we type:

> f(xm[1]);f(xm[2]);f(xm[3]);

Notice that if you want decimal answers, then the evalf command can be very useful.

> g(5); evalf(g(5));