|
Using symbolic computation
The main feature of Maple is symbolic computation. In other words, Maple does algebra. Here are some examples.
|
Example
|
Output
|
Comments
|
| (x + y)^2; |
(x + y)2
|
A basic expression. |
| k := x*y - y^2; |
k := xy + y2
|
k is now an alias for the expression. Note that k is simply another name for the expression - they
are not equal in the mathematical sense. |
| p := k /(x-y); |
|
You can now use k to refer to the expression. Maple immediately substitutes the value of k. |
| k := 'k'; |
k
|
You can unassign a variable by assigning it to its own name in single quotes. |
| simplify(p); |
y
|
The simplify command does algebraic simplification. |
| p := x^2 - 8*x +15; |
p := x2 - 8x
+ 15 |
Maple doesn't mind if you re-use names. The old value is lost. |
| solve(p=3,x); |
2,6
|
Use the solve command to solve equations. Note the use of the = sign. Here, it is used in a mathematical sense. Maple will try different
values for x until it finds all of them that make the mathematical statement x2 - 8x + 15 = 3 true. |
| dpdx := diff(p,x); |
dpdx := 2x - 8
|
The diff command differentiates an expression with respect to a variable. |
| int(p,x); |
|
The int command integrates an expression. Note that the constant of integration
is left off. |
subs(x=4,p);
subs(x=t^2,p); |
-1
t4 - 8t2 + 15
|
The subs command substitutes expressions into other expressions. Notice that p's value is unchanged. |
Each of the commands listed here has many powerful, advanced features. See the help files for more information.
Use the restart; command to unassign all variables, reset built-in
variables (such as Digits) to their original values, and unload all packages.
Of course, this should be used with care.
Back to the content
|