Maple 11 Cheat Sheet Syntax Ends A Command
Maple 11 Cheat Sheet Syntax Ends A Command
Enter Evaluate
Syntax Ctrl + = Evaluate and display inline (Document Mode)
; Ends a command with a semicolon. e.g. 5+6; plot(x); Ctrl + Space Complete symbol/command
F5 Toggle Math/Text entry (Document Mode)
: Suppresses the display of output by ending a command with Toggle 2-D/1-D Math entry (Worksheet Mode)
a colon. Useful for lengthy outputs or loading packages. Ctrl + F1 Maple help
e.g. with(plots): 5000!:
L :=[x1, x2, ..., xn ] Defines a list (ordered sequence) L with(package ); Loads the specified Maple package.
of expressions x1 , x2 , . . . , xn . Refer to the nth list item unassign(var ); Deletes a value stored in the given variable.
by L[n]. To extract the contents of a list, use the empty e.g. a:=1; unassign(’a’); unassigns the identifier a so
selection operator []. e.g. A:=[1,2,3]; A[3]; returns 3. that it does not contain the value of 1 anymore.
A[] returns 1,2,3.
restart; Clears internal memory. The settings of all identi-
S: :={x1, x2, ..., xn } Defines a set S of expressions x1 , x2 , fiers are resetted.
. . . , xn . Use the empty selection operator[] to extract the
contents of a set. e.g. S:={5,3,3,2,1}; S[]; returns
1,3,4,5.
Common Mathematical Operations
?topic Displays help on topic. x + y - z; addition and subtraction
x * y; multiplication
All identifiers (variables and functions) are case sensitive. x / y; division
e.g. X is different from x. Pi and pi are different! x^y; power xy √
sqrt(x); square root x
In general, a function whose name begins with a capital letter
exp(x); exponential ex
is an inert form of the function who has the same name but
ln(x); natural log ln(x)
begins with lower case. Inert functions are unevaluated
log[b](x); logarithm logb√(x)
and may be manipulated and printed R in a prettyprinted
surd(x,n); real nth root n x
format. e.g. Int(x,x); returns xdx and is the inert
sin(x); cos(x); tan(x); trigonometric functions
form of int(x,x);, which evaluates to x2 /2.
arcsin(x); arccos(x); inverse trig functions
arctan(x);
1
eval(expression, {x=value1, y=value2,...}); Evaluates e.g. solve(x^2-25=0, x); solves the equation x2 − 25 =
expression at the given points x = value1, y = value2,... 0 and returns 5,-5.
subs(x=value,expression ); Substitutes the given value into e.g. solve({x+y+z = 6, x-y+2*z = 5, 2*x+2*y+z =
expression. e.g. subs(x=2,x^2+2*x+1); gives 9. 9}, [x, y, z]) solves the system of three equations
subs(x=0, sin(x)/cos(x)); returns sin(0)/cos(0). and returns the solution [[x = 1, y = 2, z = 3]].
e.g. solve(abs(x+5) > 3, x); solves the inequality |x+
evalf(expression ); Numerically evaluates expression and
5| > 3 and returns RealRange(Open(−2), inf inity),
returns its decimal approximation. e.g. evalf(Pi); re-
RealRange(−inf inity, Open(−8)).
turns 3.141592654.
fsolve(equations, variable, [complex]); Numerically
value(expression ); Evaluates the given inert expression.
solves for the unknown variable in equations. Use
F:=Sum(i,i=1..5); value(F); evaluates the inert
e.g. P
5 the complex option to find a complex solution.
sum i=1 i and returns 15.
e.g. fsolve(x^2+x+1 = 0, x, complex); returns
assume(x, domain ); Restricts variable x to domain. Exam- −.5000000000 − .8660254038I, −.5000000000 +
ples of domain are positive, negative, posint, integer, .8660254038I.
real, and complex. e.g. assume(x, ’integer’); forces
x to be an integer.
assume(relation ); Enforces the given relational property. Calculus
e.g. assume(x > 0); restricts x to be positive.
diff(f, x1, ..., xj ); Differentiates f with respect to vari-
additionally(x, domain ); additionally(relation ); ables x1 , . . . , xj . e.g. diff(sin(x), x); takes the
Places further restrictions on the given variable. Usages first derivative of sin(x). diff(f(x,y),x,y); computes
are similar to that for assume. e.g. assume(x, real); ∂2
∂y∂x f (x, y).
additionally(x > 0); forces x to be real as well as
positive. diff(f, x$n ); Computes the nth derivative of f . e.g.
diff(x^4, x$2); computes the second derivative of x4
and returns 12x2 .
Algebra int(f, x ); Computes an indefinite integral of f with re-
simplify(expression ); Applies simplifica- Rspect to the variable x. e.g. int(cos(x), x); computes
cos(x)dx and returns sin(x).
tion rules to the given expression. e.g.
simplify(cos(Pi*cos(x)^2+Pi*sin(x)^2)); returns -1. int(f, x=a..b ); Computes the definite integral of f with re-
collect(expression, variable ); Combines like terms in spect to the variable x on the Rinterval from a to b. e.g.
2
expression with respect to the given variable. e.g. int(x^2, x=0..2); computes 0 x2 dx and returns 8/3.
collect(a^2*x+b*x+5, x); returns 5 + (a2 + b)x. limit(f, x=a, [dir] ); Computes the limit of f as x ap-
normal(expression ); Simplifies and normalizes the given ra- proaches a. a can be any algebraic expression or infinity.
tional expression so that the result is of factored nor- Direction dir is optional and is real bidirectional by default
mal form, where the numerator and denomator are rel- (except for ∞ and −∞). Possible values of direction are
atively prime polynomials with integer coefficients. e.g. left, right, real, and complex. e.g. limit(1/exp(x),
normal(1/x+x/(x+1)); returns x+1+x
2
x=infinity); computes lim e1x and returns 0.
x(x+1) . x→∞
Pn
factor(expression ); Factors the given expression of a mul- sum(f, k=m..n ); Returns the summation
Pn k=m f (k). e.g.
tivariate polynomial. Does NOT factor integers or integer sum(x^2, x=1..n); computes x=1 x2 .
coefficients in a polynomial. e.g. factor(4*x^2+12*x+8)
returns 4(x + 1)(x + 2).
ifactor(expression ); Factors an integer or rational number
into a product of primes. e.g. ifactor(24/19); returns
(2)3 (3)
(19) . ifactor(2^10-1); returns (3)(11)(31).
2
Plots • f is represented parametrically:
[f1(x,y), f2(x,y), f3(x,y)]. e.g.
plot(f, x=xmin..xmax, options ); Creates a two-
plot3d([x*sin(x)*cos(y), x*cos(x)*cos(y),
dimensional plot of the real function f (x) over the
x*sin(y)], x=0..2*Pi, y=0..Pi);
horizontal range from xmin to xmax. Options are
specified in the form option=value (see box below). • f is a list of functions to be graphed on
the same plot: [f1(x,y), f2(x,y), ...,
• f is a function with an independent variable. e.g. fn(x,y)]. If there are three functions, use
plot(x^2, x=-5..5);. the plotlist option to avoid a parametric
plot. e.g. plot3d([sin(x*y),cos(x*y),x+y],
• f is represented parametrically:
x=-1..1, y=-1..1, plotlist); puts the functions
[x(t),y(t),t=t0..t1]. e.g.
z = sin(xy), z = cos(xy), and z = x + y on the same
plot([cos(t),sin(t),t=-2*Pi..2*Pi]);
plot.
• f is a list of functions to be graphed on the same
plot: [f1, f2, ..., fn]. e.g. plot([1,x,x^2], implicitplot3d(eqn, x=a..b, y=c..d, z=i..j, options );
x=-2..2); puts the functions y = 1, y = x, and In the plots package. Creates the three-dimensional plot
2
y = x on the same plot. of an implicitly defined surface eqn on the specified
intervals: x = [a, b], y = [c, d] and z = [i, j]. Options are
implicitplot(eqn, x=xmin..xmax, y=ymin..ymax, options ); specified in the form option=value (see box below). e.g.
In the plots package. i.e. Must be preceded by implicitplot3d(x^2+y^2+z^2=1, x=-1..1, y=-1..1,
with(plots); Creates the two-dimensional plot of an z=-1..1);.
implicitly defined curve eqn on the specified intervals: Options for Plot3d and Implicitplot3d
[xmin, xmax] and [ymin, ymax]. Options are speci-
fied in the form option=value (see box below). e.g. Type of axes axes=boxed/frame/none/normal
implicitplot(x^2+y^2=1, x=-1..1, y=-1..1);. Color of curves color=blue/black/green/red/etc.
Contours contours=number
inequal(ineqs, x=xmin..xmax, y=xmin..xmax, options ); Coordinate System coords=cartesian/cylindrical/
In the plots package. Plots regions defined by spherical/etc.
inequalities ineqs in the specified x and y inter- Grid Dimensions grid=[m,n]
vals. Options are in the form optionsfeasible / Label Axes labels=[x,y,z]
optionsopen / optionsclosed / optionsexcluded Scaling scaling=constrained/unconstrained
= (optionsList), where optionsList is of the Line thickness thickness=number
format (option=value, option2=value2, ...). Title title="plot title"
e.g. inequal(x+y>0, x-y<=1, x=-3..3, y=-3..3, View window view=[xmin..xmax,ymin..ymax,
optionsexcluded=(color=blue,thickness=2)); zmin..zmax]