You are on page 1of 32

12

addcol 29 interface 47
addrow 29 Interp 40
addtable 52 laplace 51
AiryAi 5 lhs 37
alias 27 limit 20
allvalues 42 List & Set 6
assign 38 map 35
assume 41 minimize 44
augment 30 mulrow 29
BesselI 3 normal 13
ceil 23 op 49
coeff 16 plot 24
collect 14 plot3d 24
combine 17 print 25
contourplot 24 radsimp 39
convert 18 rhs 37
dsolve 10 round 23
erfc 2 rref 33
evalc 53 seq 34
evalf 9 simplify 19
expand 12 solve 7
extrema 46 sort 15
factor 11 sum 48
feasible 45 swaprow 29
floor 23 trunc 23
for 26 unapply 22
frac 23 with(inttrans) 50
fsolve 8 with(linalg) 28
function name 21 with(simplex) 43
Gamma 4 || 36
Gausselim 31 % 1
Gaussjord 32

1
.
" "
.
3 :

algebraic expressions :

;> a*x^2+b*x*c
a x2 + b x c
.

) ( .

;> 5^2*3/4

;> 5^2*3/4.
18.75000000

)(The work sheet interface .


.
: menu bar ( 1
file , view , edit .
: tool bar ( 2
.... .
:contex bar ( 3
.
: work sheet ( 4
maple
.
:
C
. 10 % . 90 %
.
:
(1 : .
.
( with

2
;) ( with
( .
; ) , f1 , f2 , . , fn ( with
(2 :
.
;)readlib(cost cost

:
: student(1

: plot ( 2

: linaly ( 3

:stats ( 4

.
(1 . ) ( 3.14
.
;)> evalf(Pi,3

;)> evalf(pi,3

;)> evalf(PI,3

(2 - ) ; ( .
" ) ( : " .
(3 ) ( , .
;> 2^5,2^10,2^15

); ( .
;> 2^5;2^10;2^15

(4 Enter
Shift , Enter .
(5 )( .
.

3
; > A :=A
; restart .

% (1 :
.
;> 4+56

;> %*2

)erfc(n,x (2 :
x .
erfc(x) = 1 -

x:
n: -1
: .
2
= ) (1, ), ( = 1


= )erfc(n, x erfc(n-1,t).dt (n ) 0
0

4
)erfc(0, x) = erfc(x

> ;

2 3 .

)BesselI(v, x (3 :


x 2 y'' + x 2 y' + (x 2 - v 2 ) y = 0
v: )(
x: )(

> ;

2 4 .

Gamma(z) , (4 :
.

,Re(z)>0
z:
:

> ;

> ;

2 6 .

)AiryAi(x), AiryBi(x (5 :
AiryAi AiryBi w w " z w = 0.

2 z3 4 z3
; ; (AiryAi(z) = c1.0F1 ; ; () - c2.z.0F1 )
3 9 3 9
1
2 z3 4 z3
; (AiryBi(z) =3 2 .[ c1.0F1 ; ; ; () - c2.z.0F1 )
3 9 3 9

5
0F1 ) (hypergeometric function .
)c1 = AiryAi(0 )c2 = -AiryAi'(0

;)> AiryAi(0

;)> AiryBi(0

8 2 .
2 1

) (ctrl+F1 .

50 .

List & Set (6 :


:
;])> L := [seq(x[i], i = 1 .. 4

;]> L[2 ] [ .

;]> L[2..2

;]> L[2..2][]=L[-3

)solve ( equations, variables (7 :


.
equations:
variables :
solve .
;)> solve(2*y-(x-1)^2 = 2, y

6
;)]> solve(x^2-x = 2025, [x

;)]> solve({x^2 = 9, x+y < 10}, [x, y :

)fsolve( equations, complex (8 :


. .
). (
equations:
complex :

;> polynomial:=2*x^5-11*x^4-7*x^3+12*x^2-4*x =0
;)fsolve(polynomial

.
> f:=sin(x+y)-exp(x)*y=0: g:= x^2-y = 2:
;)}fsolve({f, g},{x=-1..1,y=-2..0

.
> fsolve(sin(x), x, avoid = {x = 0, x = Pi, x = -Pi}, -10 ..
;)10


.
;)> fsolve(sinh(2*x)-6*x=0,x=1
1.419223190

)evalf(expression,n (9 :

.
.
.
expression :
n: ) (

: n 10 .

7
; )> evalf ( Pi
3.141592654
;)> evalf[3](Pi)=evalf(Pi,3

)dsolve({ODE, ICs}, y(x), options (10 :


, .

ODE :
y(x) : ODE

ICs: y(a)=b , D(y)(c)=d,, } {a,b,c,d

option : ODE method=laplace

f x ) D(f)(x ) diff(f(x),x .

$ n
;)] > diff(f(x),[x $ n

;> ode := diff(y(x), x, x) = 2*y(x)+1

;> ics := y(0) = 1, (D(y))(0) = 0

;)> sol := dsolve({ics, ode}, y(x), method = laplace

8:
;> Order:= 8
;)series_sol := dsolve({ics, ode}, y(x), series

;)> sys_ode := diff(y(t), t) = x(t), diff(x(t), t) = -x(t


;ics := x(0) = 1, y(1) = 0

8
;)]> dsolve([sys_ode, ics

6-2-1 .

;> sys:=diff(x(t),t)=x(t)*y(t)+a*t,diff(y(t),t)=x(t)-t



Solve DE
Interactively


) (1 ) (2 ) (3
. ) (2 .
:
Solve DE Interactively .



Add an Initial
Condition

>

9
>


2
-1
-2 ) ( x-t,y-t,x'-t,y'-t
.
-3 Show Maple Commands

.
Quit .
= )> sol2 := dsolve([diff(x(t),t) = x(t)*y(t)+t, diff(y(t),t
;)x(t)-t, x(0) = 0, y(0) = 1], numeric
;)> plots[odeplot](sol1, 0..1, color = red

10
;)> sol2(0.1
][t = .1, x(t) = 0.517039559380228464e-2, y(t) =0.995170919331011540

)factor(a, K (11 :
.

a:
K:

;)> factor(6*x^2+18*x-24

ifactor .
;)> ifactor(30

.
;)> factor(x^3+5

;))> factor(x^3+5,5^(1/3

;)})> factor(x^3+5, {(-3)^(1/2), 5^(1/3

)expand(expr, expr1, expr2, ...,exprn (12 :



.
expr :
expr1:

;))> expand((x+1)*(x+2)/(x+3

;))> expand(sin(x+y

11
;)> ee := (a+b)*z+sin(a+b)+exp(a+b

;)> expand(ee

) sin(a+b .
;))> expand(ee, sin(a+b

.
;))))]> expand(ee, op(indets(ee, specfunc(anything, [exp, sin

)normal(f, expanded (13 :


. .
f:
expanded:

;)> normal(x^2-(x+1)*(x-1)-1

;))> normal((f(x)^2-1)/(f(x)-1

expanded normal .
;))> 1/x+x/(x+1)=normal(1/x+x/(x+1

;)> 1/x+x/(x+1)=normal(1/x+x/(x+1), expanded

)collect(a, x, form, func (14 :


.
a:
x:
form : `) `recursive( `) `distributed (
func :
;> f := a*ln(x)-ln(x)*x-x
;))collect(f,ln(x

;> p := x*y+a*x*y+y*x^2-a*y*x^2+x+a*x

;)]> collect(p, [x,y

12

;)> collect(p, [x,y], recursive

;)> collect(p, [x, y], distributed

;)> f := a^3*x-x+a^3+a;collect(f, x

;)> collect(f, x, factor

)sort(L, F) , sort(A, V (15 :


.
L: ;
F:
A:
V:
;)]> sort([2, 1, 3


;)`>` > sort([2, 1, 3],

;> p:=y^3+y^2*x^2+x^3+x^2+y^2+x*y

;)]> sort(p, [x, y


;)> sort(p, [x, y], ascending

: collect sort .
;)> collect(x^3*y+x^2*y^3+x+3, y

;)> sort(x^3*y+x^2*y^3+x+3, y

)coeff(p, x, n (16 :

.
p:
x:

13
n:
: ) coeff(p,x,n ) coeff(p,x^n n 0.
;> p := 2*x^2+3*y^3-5

;)> coeff(p, x, 2

;)> coeff(p, y^3

expand .
;)> q := 3*a*(x+1)^2+sin(a)*x^2*y-y^2*x+x-a; coeff(q, x

)combine(f, n, opt1, opt2, ... (17 :


) (exp,ln,power, .

f:
n:
opt1,opt2, :

n .
@@ abs arctan conjugate errors
exp icombine ln piecewise polylog
power product Psi radical range
signum trig units
Help Maple .
;)> combine((exp(x))^2*exp(y), exp

=))>exp(sin(a)*cos(b))*exp(cos(a)*sin(b
;)]combine(exp(sin(a)*cos(b))*exp(cos(a)*sin(b)), [trig, exp

;)> abs(x^2)*abs(y+1)=combine(abs(x^2)*abs(y+1), abs

)convert(expr, form, arg3, ... (18 :


.

expr :
form :
arg3, :

;)> convert(1.23456, rational
14
;)> convert(22, units, inches, m

;)> convert(f, parfrac, x

;)> s := series(f, x, 4

.
;)> convert(s, polynom

Help Maple .

)simplify(expr, n1, n2, ... (19 :


.... .
expr :
n1,n2, :

>

>

>

)limit(f, x=a, dir (20 :


limit .
f:
x:
a:
dir : ) (left, right, real, or complex

15
: Limit limit Limit
limit . integral
.
;)> Limit(sin(x)/x, x = 0

;)> limit(sin(x)/x, x = 0

;)> limit(1/x, x = 0, left

combine .

>

function name:= variable -> expression (21 :


)> ( - .


)proc(parameter sequence ;)>bisec:=proc(f,a,b,epsilon
;local variable sequence ;> left:=a;right:=b
;))> n:=evalf(ln((ba)/epsilon)/ln(2
;> m:=(a+b)/2
options option sequence
remember, builtin,
operator, trace, arrow
;statement-1 > for j from 1 to trunc(n+1) do if
;statement-2 evalf(subs(N=m,f(N))*subs(N=left,f(N)))>0
;statement-n then left:=m;else
;right:=m;fi;m:=(left+right)/2;od
;end ;end proc
;> f := proc (x) options operator, arrow; 3*x+5 end proc

; > f := x-> 3*x+5

;)> f(3

16
;)> h := x-> (2*x, x^3
;)h(3

@ .
;)> (sin@cos)(x

:
.

)unapply(expr, x, y, ... (22 :


.

expr :
x,y, :
;)> f(x):=erf(x
;)f[1]:=diff(f(x),x

;)> F[1]:=unapply(%,x

;))> evalf(F[1](0.5

;))]> evalf(subs(x=0.5,f[1

)trunc(n, x (23 :
.
n:
x:
;)> trunc(2.65

17

)round(x x
)frac(x x frac(x) = x - trunc(x). :
)floor(x x.
)ceil(x x

;)>trunc(-2.6
;)>round(-2.6
;)>frac(-2.6
;)>floor(-2.6
;)>ceil(-2.6

)plot(f, x (24 :
plot
. plot .
> f(x):=x^2: g(x):=x^3:h(x):=sin(x):
plot([f(x),g(x),h(x)],x=-1..1, -10..10
color=[black],style=[point,line,line],
linestyle=[solid,DASH,SOLID],
symbol = [cross],
legend=["x^2","x^3","sin(x)"],
;)]thickness=[0,2,0

" title="PLOT NAME plot .

18
plot3d .

;)> plot3d(sin(x+y),x=-1..1,y=-1..1



plots Plot Builder

:
.

) print(e1, e2, ... (25 :


.

e1,e2, :

>

>

19
>for <name> | | from <expr> | | by <expr> | | to<expr
| >| | while <expr (26 :
;do <statement sequence> end do
for
|| .

;> for i from 6 by 2 to 10 do print(i) end do

;> for i from 6 by 2 while i<=10 do print(i) od

i 6 2 10 i 10
2 i 10 .

: end do od .

;)> g1:=sin(x
s := series(g, x, 4):
;)g2:=convert(s, polynom

> for k from 0.0 by 0.25 to 1.0 do


print(k,evalf(subs(x=k,g1)),evalf(subs(x=k,g2)),evalf(abs(subs
;(x=k,g1)-subs(x=k,g2))));od

)alias(e1, e2, ..., eN (27 :



.

20
e1, e2, ..., eN :

;> restart
;)C(7,2
;)alias(C = binomial
;)C(7,2

;))> alias(F = F(x), Fx = diff(F(x), x

;)> diff(Fx, x

;))> alias( Fxx = diff(F(x),x, x

;)> diff(Fx, x

: .

>
Error, aliases cannot be numeric or string constants

with(linalg) LinearAlgebra (28 :


linalg ) ( Linear Algebra
- . . . .

;)> with(linalg

[BlockDiagonal,GramSchmidt,JordanBlock,LUdecomp,QRdecomp,Wronskian,addcol,addro

)addrow(A, r1, r2, m (29 :

21
. m r1
r2 .

A:
r1, r2:
m:
> with(linalg):A:=matrix(3,3, [[1, 2, 3], [2, 3, 4], [3, 4,
;)]]5

;)> addrow(A, 1, 2, 10

]10 [1 2 3] + [2 3 4] = [12 23 34
.

;)> addcol(A, 1, 2, -x

;)> B:=swaprow(A, 1, 3

mulrow mulcol .

;)> mulrow(B, 2, x

31 .

)augment(A, B, ... (30 :


.

A, B , ... :

22
;)]> with(linalg):a := matrix(2, 2, [1, 2, 2,1

;)]> b := matrix(2, 3, [3, 4, 5, 6, 7, 8

;)> augment(a, b

Gausselim(A, 'r', 'd') mod p (31 :


.

A:
r: ) (rank
d:
p:
> with(linalg):
A := matrix(4,4,[8,3,-1,-5,4,-5,0,-2,-5,8,3,-1,-5,5,-4,-9]):
b:=matrix(4,1,[4, 0, -8, -5]):
;)> Ab:=augment(A, b

;)'> gausselim(Ab,'r','d

;> r

;> d

Gaussjord(A, 'r', 'd') mod p


(32 :
- .

23
A:
r: ) (rank
d:
p:

;)'> gaussjord(Ab,'r','d

;> r

;> d

2 3 .

)rref(A (33 :
) ReducedRowEchelonForm(A -
.
;)> rref(Ab

)seq(f, i = m..n, step (34 :


)( .
f:
i=m..n :
step :
;) > seq(i^2, i = 1 .. 5, 2

24
;])> X := [seq(i, i = 0 .. 6

)map(fcn, expr, arg1, ..., argN (35 :



.
fcn :
expr :
arg1,argN :
;)> map(f, x+y*z

;> g:=proc(x,y) x^2+y end proc


;))evalf(g(x,y
;)map(g, [1,2,3,4], 2

][3, 6,11,18] = [12 + 2, 2 2 + 2, 32 + 2, 42 + 2

(36 :
||
.
;> i:=5
;p || i

;)> a || (1 .. 3

13 3 .
> for k from 1 to 9 do
;sol||k:=fsolve(subs(S=0.1*k,Eq1),lambda=0..5);od

k

.

25
;)> plot([seq([0.1*k,sol||k],k=1..9)],color=black

seq
x y

.

)rhs(expr) , lhs(expr (37 :


( Left Hand Side ,Right Hand Side).
;> e := y = a*x^2+b

;)> lhs(e

;)> rhs(e


)= (: .
;))> dsolve(diff(f(x),x,x)+diff(f(x),x)=0,f(x

;)> f(x):=rhs(%

;> f := y = x^2+2*x+1

;)> solve(f = 0, x
Error, (in solve) invalid arguments
;)> solve(rhs(f) = 0, x

)assign(t (38 :
.
;)> assign(a=d, c=5
;> a,c

26
;)}> s := solve({x+y = 1, 2*x+y = 3}, {x, y

;)> assign(s
;> x,y

)radsimp(expr (39 :
.

>

>

>

)Interp(x, y, v (40 :

x,y interp .
x:
y:
v:
;)> interp([2, 5, 6], [9, 8, 3], x

>

27
;)> simplify(%

)assume(x1, prop1, x2, prop2, ... (41 :


assume
... .
xi :
propi :
;)> assume(0 < a

;)> sqrt(a^2 ;)sqrt(b^2

x .
;)> assume(-5 < x, x < 0
;)about(x
Originally x, renamed x~:
))is assumed to be: RealRange(Open(-5),Open(0

)allvalues(expr (42 :
.

>

>

(43 :
;)with(simplex
.
;)> with(simplex

28
)minimize(f, C (44 :
.
f:
C:

>
>

)feasible(C, vartype (45 :


.
C:
vartype: NONNEGATIVE
or UNRESTRICTED

>
>

>

)extrema(expr, constraints (46 :


.

>

>

29

) interface(arg1, arg2, ... (47 :


.
> assume(L>0); interface(showassumed=0):
;)> sqrt(L^2

> interface(showassumed=2):
;)> sqrt(L^2

showassumed
) ~ (
.
) (ctrl+F1 .

)sum(f, k=m..n (48 :


.
;)> Sum(k^2, k

;)> sum(k^2, k

;> e[j,m]$m=1..4

;)> sum(e[j,m],m=1..4

)op(i..j, e (49 :
(operand).
i..j :
e:

;]> u := [1, 4, 9

30
;)> op(2, u

;)> v := f(x, y, z

;)> op(0, v

;)> op(2, v

;> g := x^3+3*x^2+5*x-6

;)> op(3, g

)with(inttrans (50 :
.
;)> with(inttrans

)laplace(expr, t, s (51 :

expr :
t:
r:
> with(inttrans):
;)> laplace(t^2+sin(t) = y(t), t, s

;)> laplace(diff(y(t), t, t)-y(t) = sin(a*t), t, s

.
;)> invlaplace(1/(s-a)+1/(s^2+b)+1, s, t

;)> invlaplace(1/(s^3+a)+laplace(y(t), t, s), s, t

31
addtable(tname, patt, expr, t, s, parameter, (52 :
)condition
.
tname :
.
patt :
expr :
t:
s:
parameter :

condition :

> addtable(invlaplace,exp(-p*sqrt(s))/s^(1+(n/2)),
;)(4*t)^(n/2)*erfc(n,p/(2*sqrt(t))),s,t
.

)evalc(expr (53 :
.
;))> evalc(sqrt(1+I

)( Re )( Im .
;)))> evalc(Re(sqrt(1+I

;))> evalc(sin(3+5*I

;)))> evalc(Im(sin(3+5*I

32

You might also like