You are on page 1of 4

Maple Cheat Sheet Keyboard Shortcuts

Based on Maple 12/13 Windows Version Enter Evaluate and display result on new line
Shift + Enter Continue on next line without executing
Ctrl + = Evaluate and display inline (Document Mode)
Syntax Ctrl + Space Complete symbol/command
; Ends a command with a semicolon. e.g. 5+6; plot(x); F5 Toggle Math/Text entry (Document Mode)
Toggle 2-D/1-D Math entry (Worksheet Mode)
: Suppresses the display of output by ending a command with a Ctrl + F1 Maple help
colon. Useful for lengthy outputs or loading packages. e.g.
with(plots): 5000!:

:= Assigns an expression to a variable. e.g. x:=3; x:=x;


unassigns the variable . Dened Constants
Pi 3.14159265...
= Denes mathematical equations. e.g. y = x2 + 3*x + 4;
I complex number = 1
% Refers to the last result. of the % symbols refers to the infinity
previous result. e.g. %%% gives the third previous presult. gamma Eulers constant 0.5772156649...
Catalan Catalans constant 0.915965594...
f :=(x,y,...)->... Denes a function. e.g. f := (x,y) -> exp(1) 2.718281828
x2+y2; denes the function (, ) = 2 + 2 . f(0,1)
evaluates (0, 1).

L :=[x1, x2, ..., xn ] Denes a list (ordered sequence) of


expressions 1 , 2 , . . . , . Refer to the list item by []. Commands
To extract the contents of a list, use the empty selection General
operator []. e.g. A:=[1,2,3]; A[3]; returns 3. A[] returns
1,2,3. with(package ): Loads the specied Maple package.
S :={x1, x2, ..., xn } Denes a set of expressions 1 , 2 ,
unassign(var ); Deletes a value stored in the given variable.
. . . , . Use the empty selection operator[] to extract the
e.g. unassign(a);
contents of a set. e.g. S:={5,3,3,2,1}; S[]; returns
1,2,3,5.
restart; Clears internal memory. The settings of all identiers
name [expression ] Indexed name. e.g. b[1]; A[x,y,z]; are resetted.

?topic Displays help on topic. unapply(expression, x, y, ...); Returns a functional op-


erator from an expression and variables. e.g. f := x2 +
#expression Comment (not interpreted as commands).
y2; g:=unapply(f, x, y); returns the functional opera-
All identiers (variables and functions) are case sensitive. e.g. tor g := (x,y) -> x2 + y2; such that g(1, 2) returns
X is dierent from x. Pi and pi are dierent! 5.

In general, a function whose name begins with a capital let-


ter is an inert form of the function who has the same name
but begins with lower case. Inert functions are unevaluated
and may be manipulated and printed in a prettyprinted for- Common Mathematical Operations
mat. e.g. Int(x,x); returns and is the inert form of
int(x,x);, which evaluates to 2 /2. x + y - z; addition and subtraction
x * y; multiplication
x / y; division
xy; power
sqrt(x); square root
Usages and Icons exp(x); exponential
Right-click Perform context operation on math expression ln(x); natural log ()
! Execute the current line log[b](x); logarithm ()
surd(x,n); real root
!!! Execute the entire worksheet
sin(x); cos(x); tan(x); trigonometric functions
[> Insert prompt arcsin(x); arccos(x); inverse trig functions
T Insert text paragraph arctan(x);

1
Numerical Manipulation factor(expression ); Factors the given expression of a mul-
tivariate polynomial. Does NOT factor integers or integer
eval(expression ); Evaluates the given expression. e.g.
coecients in a polynomial. e.g. factor(4*x2+12*x+8);
a:=b2; b:=c+1; c:=2; eval(a); returns 9.
returns 4( + 1)( + 2).
eval(expression, x=value ); Evaluates expression at the
ifactor(expression ); Factors an integer or rational number
given point = . e.g. eval(x2+5*x, x=1); eval-
2 into a product of primes. e.g. ifactor(24/19); returns
uates the polynomial + 5 at = 1 and returns 6. (2)3 (3)
(19) . ifactor(210-1); returns (3)(11)(31).
eval(expression, {x=value1, y=value2,...}); Evaluates
expression at the given points = 1, = 2,... expand(expression ); Distributes the given expression. e.g.
expand((x+3)*(x+5)); returns 2 + 8 + 15.
subs(x=value,expression ); Substitutes the given value into
expression. e.g. subs(x=2,x2+2*x+1); gives 9. solve(equations, variables ); Solves for the unknown vari-
subs(x=0, sin(x)/cos(x)); returns (0)/(0). ables in the given equations or inequalities.

evalf(expression ); Numerically evaluates expression and re- e.g. solve(x2-25=0, x); solves the equation 2 25 = 0 and
turns its decimal approximation. e.g. evalf(Pi); returns returns 5,-5.
3.141592654.
e.g. solve({x+y+z = 6, x-y+2*z = 5, 2*x+2*y+z = 9},
value(expression ); Evaluates the given inert expression. e.g. [x, y, z]); solves the system of three equations and re-
F:=Sum(i,i=1..5); value(F); evaluates the inert sum turns the solution [[x = 1, y = 2, z = 3]].
5
=1 and returns 15.
e.g. solve(abs(x+5) > 3, x); solves the inequality +
assume(x, domain ); Restricts variable to . Exam- 5 > 3 and returns ((2), ),
ples of are positive, negative, posint, integer, ( , (8)).
real, and complex. e.g. assume(x, integer); forces
to be an integer. fsolve(equations, variable, [complex]); Numerically
solves for the unknown in .
assume(relation ); Enforces the given relational property. e.g. Use the complex option to nd a complex so-
assume(x > 0); restricts to be positive. lution. e.g. fsolve(x2+5*x-4,x); returns
5.701562119, .7015621187.
additionally(x, domain ); additionally(relation );
Places further restrictions on the given variable. Usages sum(f, k=m..n ); Returns the summation
= (). e.g.
are similar to that for assume. e.g. assume(x, real); sum(x2, x=1..n); computes =1 2 .
additionally(x > 0); forces to be real as well as
positive.

map(f, expression, arg1, ..., argN ); Applies to each


Calculus
of the operands or elements in along with the
given arguments 1, . . . , . e.g. map((x,y)->x+y, limit(f, x=a, dir ); Computes the limit of as approaches
[0,1,2], 1); adds one to each element in the given list to . can be any algebraic expression or infinity. Direction
produce the result [1, 2, 3]. is optional and is real bidirectional by default (except for
and ). Possible values of direction are left, right,
real, and complex. e.g. limit(1/exp(x), x=infinity);
computes lim 1 and returns 0.

Algebra
diff(f, x1, ..., xj ); Dierentiates with respect to vari-
simplify(expression ); Applies simplica-
ables 1 , . . . , : ... . e.g. diff(sin(x), x); takes
tion rules to the given expression. e.g.
simplify(cos(Pi*cos(x)2+Pi*sin(x)2)); returns the rst derivative of (). diff(f(x,y),x,y); computes
2
-1. (, ).


collect(expression, variable ); Combines like terms in diff(f, x$n ); Computes the derivative of : . e.g.
expression with respect to the given variable. e.g. diff(x4, x$2); computes the second derivative of 4 and
collect(a2*x+b*x+5, x); returns 5 + (2 + ). returns 122 .

normal(expression ); Simplies and normalizes the given ra- implicitdiff(eq, x1, ..., xj ); Implicitly dierentiates
tional expression so that the result is of factored nor- with respect to variables 1 , . . . , . The equation denes
mal form, where the numerator and denomator are rel- as a function of 1 , . . . , implicitly. e.g. f:= y=x2/z2;
atively prime polynomials with integer coecients. e.g. implicitdiff(f, y, x); computes / and returns
2
normal(1/x+x/(x+1)); returns +1+
(+1) . 2/ 2 .

2
[ ]
int(f, x ); Computes an indenite integral of withrespect to Vector[] ([, , ]); row vector
the variable . e.g. int(cos(x), x); computes ()
and returns (). Matrix addition, subtraction, multiplication: A + B , A - B ,
A . B
int(f, x=a..b ); Computes the denite integral of with re- The following commands are in the LinearAlgebra package.
spect to the variable on the interval from to . e.g. Precede commands by with(LinearAlgebra):
2
int(x2, x=0..2); computes 0 2 and returns 8/3.
CrossProduct(u, v ); Computes the cross product of vectors
and .

Dierential Equations DotProduct(u, v ); Computes the dot product of vectors and


.
dsolve(ODE, y(x) ); Solves ordinary dierential equations for
the unknown (). can be a single dierential equa- Determinant(A ); Computes the determinant of matrix .
tion, or a set or a list of equations.
Norm(A, p ); Computes the -norm of a matrix or vector .
e.g. ode:=diff(y(x),x$2)=2*y(x)+1; dsolve(ode,
2
y(x)); solves the dierential equation Basis(v ); Computes the vector or set of vectors that forms a
2 () = 2() + 1.
basic for the vector space spanned by .
dsolve({ODE, ICs}, y(x) ); Solves ordinary dierential equa-
tions for () given initial conditions. are initial Eigenvalues(A ); Computes the eigenvalues of matrix .
conditions given in the form y(a)=b, D(y)(c)=d, .... Eigenvectors(A ); Computes the eigenvectors of matrix .
e.g. ics := y(0) = 1, (D(y))(0) = 0; dsolve({ode,
ics}, y(x); MatrixInverse(A ); Computes the inverse of square matrix .

DEplot(deqns, vars, trange, inits, xrange, yrange ); Transpose(A ); Computes the transpose of .
In the DEtools package. Plots solution curves to a system
of dierential equations by numerical methods. -
list of rst order ordinary dierential equations or a single
dierential equation of any order. - list of dependent Plots
variables. - range of the independent variable. plot(f, x=xmin..xmax, options ); Creates a two-
- list of initial conditions. , - range of the dimensional plot of the real function () over the
two dependent variables. horizontal range from to . Options are specied
e.g. with(DEtools): in the form option=value (see box below).
de1:=diff(x(t),t)=-0.5*x(t)*y(t);
is an expression or function with an independent vari-
de2:=diff(y(t),t)=0.5*x(t)*y(t);
able. e.g. plot(x2, x=-5..5);.
DEplot([de1,de2],[x(t),y(t)],t=0..50,
x=-2..2,y=-2..2,[[x(0)=0.9,y(0)=0]]); is represented parametrically:
[x(t),y(t),t=t0..t1]. e.g.
plot([cos(t),sin(t),t=-2*Pi..2*Pi]);
Linear Algebra is a list of functions to be graphed on the same
plot: [f1, f2, ..., fn]. e.g. plot([1,x,x2],
Matrix(..); Creates a matrix.
x=-2..2); puts the functions = 1, = , and = 2
Matrix(a ); square matrix x lled with 0s on the same plot.
Matrix(a, b, c ); matrix x lled with cs implicitplot(eqn, x=xmin..xmax, y=ymin..ymax, options );
[ ]
In the plots package. i.e. Must be preceded by
Matrix([[a, b, c],[d, e, f]]);
with(plots): Creates the two-dimensional plot of an
implicitly dened curve on the specied intervals:
1 [, ] and [, ]. Options are speci-
2
ed in the form option=value (see box below). e.g.
< 1 , 2 , . . . , > Creates a column vector .

.. implicitplot(x2+y2=1, x=-1..1, y=-1..1);.
inequal(ineqs, x=xmin..xmax, y=xmin..xmax, options );
Vector[](..); Creates a vector of orientation (either row or In the plots package. Plots regions dened by inequalities
column). Default orientation is column. in the specied and intervals. Options are in the
form optionsfeasible / optionsopen / optionsclosed
Vector(a, b ); column vector of size lled with s / optionsexcluded = (optionsList), where

is of the format (option=value, option2=value2, ...).
Vector([, , ]); column vector e.g. inequal({x+y>0, x-y<=1}, x=-3..3, y=-3..3,
optionsexcluded=(color=blue,thickness=2));

3
plot3d(f, x=a..b, y=c..d, options ); Creates a three- transform(f ); In the plottools package. Creates a func-
dimensional plot of the real function (, ) over the hor- tion that applies the given function to all points in
izontal range [, ] and vertical range [, ]. Options are a plot data structure. Useful for embedding 2-D plots
specied in the form option=value (see box below). into 3-D ones and transforming coordinate systems. e.g.
g:=transform((x,y)->(x,y,-1)); creates a procedure
is an expression or function with two indepen- that transforms points with two coordinates (, ) in a plot
dent variables. e.g. plot3d(sin(x+y), x=-1..1, to points with three coordinates (, , 1).
y=-1..1);.
animate(plotcommand, plotargs, t=a..b, options ); In
is represented parametrically: [f1(x,y), f2(x,y),
the plots package. Creates a 2-D or 3-D animation on
f3(x,y)]. e.g. plot3d([x*sin(x)*cos(y),
paramter , ranging from to . is a Maple
x*cos(x)*cos(y), x*sin(y)], x=0..2*Pi,
command that generates a 2-D or 3-D plot (e.g. plot,
y=0..Pi);
plot3d, implicitplot). is a list of arguments
is a list of functions to be graphed on to the plot command. Possible options are those used in
the same plot: [f1(x,y), f2(x,y), ..., the plot command or the following:
fn(x,y)]. If there are three functions, use the
plotlist option to avoid a parametric plot. e.g. Number of frames frames=n
plot3d([sin(x*y),cos(x*y),x+y], x=-1..1, Display a trace of n frames trace=n
y=-1..1, plotlist); puts the functions = (),
e.g. animate(plot, [A*sin(x), x=0..10], A=0..2,
= (), and = + on the same plot.
frames=50, trace=5);
implicitplot3d(eqn, x=a..b, y=c..d, z=i..j, options );
In the plots package. Creates the three-dimensional plot display(L, options ); In the plots package. Combines the
of an implicitly dened surface on the specied in- list of plot structures into a single plot or animation.
tervals: = [, ], = [, ] and = [, ]. Options are are those used for plot or plot3d.
specied in the form option=value (see box below). e.g.
implicitplot3d(x2+y2+z2=1, x=-1..1, y=-1..1, e.g. with(plots):
z=-1..1);. p1:=plot3d(sin(x*y), x=-Pi..Pi, y=-Pi..Pi):
p2:=plot3d([x+y, sin(x)], x=-Pi..Pi, y=-Pi..Pi):
contourplot(f, x=a..b, y=c..d, options ); In the plots display([p1,p2], axes=boxed, title="test plot");
package. Creates a 2-D contour plot of the real function
(, ) over the horizontal range [, ] and vertical range Options for 2D Plots
[, ]. Options are specied in the form option=value and
can be those used in the plot commands or the following: Type of axes axes=boxed/frame/none/normal
Color of curves color=blue/black/green/red/etc.
Number of contours contours=c Determine input discont=true/false
Locations of contours contours=[a, b, c, ...] discontinuities
Filled contours filledregions=true Draw gridlines gridlines=true/false
Gradation coloring coloring=[color1,color2] Label Axes labels=[x,y]
e.g. contourplot(cos(x*y), x=-3..3, Scaling scaling=constrained/unconstrained
y=-3..3, contours=4, filledregions=true, Line thickness thickness=number
coloring=[red,blue]); Title title="plot title"
Min/max y values y=ymin..ymax
View window view=[xmin..xmax,ymin..ymax]
contourplot3d(f, x=a..b, y=c..d, options ); In the
plots package. Creates a 3-D contour plot where contours Additional
Contours
Options for 3D Plots
contours=number
are raised to their appropriate levels. Usages are similar to Coordinate System coords=cartesian/cylindrical/
contourplot. spherical/etc.
spacecurve(curves, t=a..b, options ); In the plots pack- Grid Dimensions grid=[m,n]
age. Creates a curve or a set of curves in 3-D space. Label Axes labels=[x,y,z]
can be a list of points, a list of the , , and View window view=[xmin..xmax,ymin..ymax,
components, or a set of such lists. Options are similar to zmin..zmax]
those in plot3d. e.g. spacecurve({[cos(t),sin(t),t],
[t,sin(t),cos(t)]},t=0..4*Pi);

polarplot(r(theta), theta=a..b, options ); In the plots


package. Creates a plot for () for =
... in polar coordinates with polar axes. e.g.
polarplot(sin(theta),theta=0..2*Pi);

Maple Cheat Sheet. v. 2010.2 4 Margaret Yau.

You might also like