The following commands are briefly summarized for your use. For further information about any of these commands, as well as examples of their usage, use the on-line Help Browser or type ?commandname. Note: The plotting commands we will be using are described in the next section.
, xn use
diff(f, x1, x2, ..., xn);For example, the derivative of
is
computed by
diff( x^3-3*x^2 - sin(Pi*x), x);
?
evalf(expr, n);For example,
evalf( 1 + (Pi/12)^21, 20);
use
int(f, x);To compute the definite integral
use
int(f, x=a..b);To numerically evaluate the definite integral
, use
evalf(Int(f, x=a..b));For example, the indefinite integral of
is
int(x*sin(x^2), x); while a definite integral is
int(x*sin(x^2), x=0..sqrt(Pi));
? What is approximate numerical value?
limit(f,x=a);
simplify(expr);For example,
simplify( (x+3)^3 - (x-3)^3 );
solve({equations},{variables});
fsolve({equations},{variables});
For example, solve( {x-y=3, 3*x-2*y=-1}, {x,y} );
will solve for values of x and y that satisfy the two equations.
The fsolve command sometimes doesn't find all of the roots of an
equation. If you know how many roots you expect to find, you can use
the option fsolve( -4*x^3 + 4*x + 1, x, maxsols=3 );
subs(subexpression=newexpression, expression );For example, if you want to evaluate the expression
when
x=3: subs(x=3, x^3-4*x-1 ); Or if you want to substitute
a more complicated expression (perhaps x is parametrized by
: subs(x=sin(t), x^3-4*x-1 );
Linear Algebra
The following commands are found in the package linalg. In order to use
these commands, you should load the package linalg using the command
with(linalg);.
vector(m,[list]);If you omit the parameter m, a vector is created of length equal to the number of elements on the list. If you eliminate the list parameter, Maple creates a vector of length m with no predefined elements. For example,
vector([1,2,3]) sets up the vector with components
. Often we can shorten this notation (see the next example)
since many operations on vectors accept lists.
crossprod(u, v);
For example, crossprod([1,2,3], [4,5,6]);
dotprod(u, v);
For example, dotprod([1,2,3], [4,5,6]);
use
grad(x^2+x*y*z, [x,y,z]);
, use
diverge([x,x*y,x*z], [x,y,z]);
, use
curl([x,x*y,x*z], [x,y,z]);