Basic Algebra in Maple

Original by Dave Hart
Updated by Clinton Wolfe
Also available as a Maple 5.1 worksheet

Basic Polynomial Manipulation

> z:=(x+y)^2 + 9*(2+x)*(x+y);
[Maple Math]

Here an algebraic expression has been typed. Maple reads in the statement, assigns the right hand side to the variable z, and "prettyprints" it. The letters x, y, and z are here considered variables; legal variables start with a letter and have at most 494 characters. Examples of legal variable names are: g, G, new_term, x13a, and the_answer_is. Maple is case sensitive, so the variables g and G are distinct.

Notice also that the line ends with a semicolon. All commands entered in Maple must end in with a semicolon. If one is not entered at the end of the line, then Maple will wait for one to be entered on the next line.

> expand(z);
[Maple Math]

This command expanded the algebraic expression assigned to z.

> %^3;
[Maple Math]

Here, this command tells Maple to take the previous result and cube it. (The percent sign refers to the most recent result.) Maple does not expand the result. To see the multiplication explicitly, the following command is issued:

> expand(%);
[Maple Math]
[Maple Math]

Notice that Maple does not list the elements in any specific order.

> sort(%);
[Maple Math]
[Maple Math]

Use the "sort" command to see it in a prettier form.

> factor(%);
[Maple Math]

Here Maple factors the previous result. Notice that the result does not look like the expressions previously entered. Maple will not always be able to return an expression to its previous form.

Operations on Polynomials

> integrate(x/(1-x^3), x);
[Maple Math]

Maple integrates x/(1-x^3) with respect to x. Because any letter used in a Maple session is considered a variable, you must specify with respect to what variable differentiation and integration should occur.

> diff(%, x);
[Maple Math]

Differentiation.

The result is not exactly like the integrand, but it is in a form similar enough to recognize that they are the same expression. Simplification is a difficult problem.

> series(exp(-x)*sin(2*x), x);
[Maple Math]

The command will find a series (either Taylor, Laurent, or generalized) around the point x=0 if no value is given. Generally, the last term of the series will be the order term, where the order is decided by a global Maple variable which can be defined by the user.