224 63 1MB
Russian Pages 116 [115] Year 2001
. . .Г. К
а
Бе уче
М
а
ва
,
ы
я к х а а в Maple
е
е ва е а и -и а е с и с ве с су а с ве у иве си е а в ачес ве с и с у е в с иа - сих ичес и ес ес ве - е а ичес а у е в Бе с су а с ве у иве си е а
2001
я
Maple
К 22.11 13
:Ч
.А. . .- . ., Э. . . .- . .,
. ., К
Г ;
. . Maple: , 2001. – 116 .
13 –
Г Х .
:
.
ISBN 5-7414-0046-9 « а е а и а и и
а и а», «
а и
е
ех
ии».
Maple. .
Maple. 1 -
2
, , . К 22.11
ISBN 5-7414-0046-9
©
Сав че 2001
2
С.Е., у
ичева .Г.,
я
Maple
Maple. , Maple.
Maple.
, , . :
.
:
–
Maple; – Maple
; ;
–
; – . №1
. 2
2-
,
4,
.
№1-5, 1 ,
, №6-7,
, 2 ,
А
,«
». . ., .
3
я
Maple. А
I.
,
,
Э 1. 2.
Maple
.
я Maple.
А
, Maple.
3. 4.
.
. .
§1.
Maple
Maple −
, , ,
,
,
, , Windows Maple. Maple а
че у
С
и.
с в е е
File ( , . . Edit (
View (
,
:
и а ва и , с в е С и с с и , , Па е
с в )−
и с
е
Windows, , Па е и и с у е и е и П С
Maple 6, у е в:
у
:
:
) − , ,
Г ав
Maple, а
П
,
,
:
, . .
)– Maple.
,
4
. е
в, с
а ва и ,
я Insert (
Maple
) –
: ,
. Format ( : Options (
) –
, ,
. ) – ,
,
,
. Windows ( . Help ( Maple.
)– )– Maple (
– ,
,
), Maple.
: 1)
. К
>;
2)
, ;
3)
,
. Maple .
,
Па е и и с
у е
,
в Па е и и с
у е
в
За ани 1. 1. 2.
Maple. Maple « ,
3.
№1» Enter. «
Enter. 4.
« 5
. :
. . » №1».
.
я
Maple
5.
.
Fail :
Save
_1, .
1– 6.
: «
№1
:
_N». . : « : «
N», N –
.
N».
restart. «К
». .
:
_N,
N– §2. А
. ,
Pi – Gamma –
+*^-
.
Maple .
: π; I – i; infinity – Э ; true, false – . : ; –; ; /; ; !– .
; ,
: , >=, z:=x+I*y;
: . .
(integer) 36
:
я
Maple
1)
, : 28/70;
2) 3)
: 2.3; : 1,602*10^(-19)
(float), , 1,602⋅10-19. ,
, ),
( .0.
:
> 75/4; 75 4
> 75/4.0; 18.75000000 Maple
α
. . alpha.
α - alpha β - beta γ - gamma δ - delta ε - epsilon ς - zeta
,
μ - mu ξ -xi π - pi ρ - rho σ - sigma υ - upsilon
η - eta θ - theta ι - ita κ - kappa λ - lambda ν - nu
,
φ - phi χ - chi ψ - psi ω -omega
:
,
Ω,
,
,
Omega. . За ани 2. 1.
№2».
« .
2.
6+2 5 − 6−2 5 3
.
: > (sqrt(6+2*sqrt(5))-sqrt(6-2*sqrt(5)))/sqrt(3);
7
я
Maple
Enter. ω=
3.
θ t
2 3. 3
f (x ) − δ < ε .
: > omega=theta/t; abs(f(x)-delta) a+b; a+b
> %+c; a+b+c.
(:=).
К
,
Maple
,
. , .
readlib(command),
command – Maple
.
,
. . : with(package)
1) package –
; 8
я
Maple command
-
2) package
,
: > package[command](options); package, , command, options . К Maple : linalg – geometry – ; geom3d – ; student – , . . Maple Maple exp(x)
x
e ln x lg x
ln(x) log10(x) log[a](x)
log a x
sqrt(x)
x
x
abs(x)
sin x cos x tgx ctgx sec x cos ecx arcsin x arccos x arctgx arcctgx shx chx
sin(x) cos(x) tan(x) cot(x) sec(x) csc(x) arcsin(x) arccos(x) arctan(x) arccot(x) sinh(x) cosh(x)
9
,
, ;
я
Maple tanh(x) coth(x) Dirac(x) Нeaviside(х)
thx cthx
δ(x ) θ(x ) -
Maple ,
, Э
-
,
, ,
–
,
. exp(x) exp(1).
е=2.718281828…
За ани 3.
№3».
«
1.
14 π π + tg 3 3 > cot(Pi/3)+tan(14*Pi/3); Enter. 2 : − 3. 3 3π 5π 7π π sin 4 + cos4 + sin 4 + cos4 . 8 8 8 8 : > combine((sin(Pi/8))^4+(cos(3*Pi/8))^4+ (sin(5*Pi/8))^4+ (cos(7*Pi/8))^4); Enter. ( combine – , , ). 3 : . 2
.
2.
3.
:
cos
§4.
Maple
. К ,
, 10
я
Maple
,
, .
В
.
, , eq:=exp1=exp2;
: > , exp1 –
eq –
, exp2
–
. rhs(eq),
lhs(eq).
–
: > eq:=a^2-b^2=c;
eq := a 2 − b 2 = c
> lhs(eq);
a 2 − b2
> rhs(eq);
с a/b, numer
. : > f:=(a^2+b)/(2*a-b);
f :=
> numer(f);
a2 + b 2a − b
a2 + b 2a − b
> denom(f);
я
. eq
expand(eq). : > eq:=(x+1)*(x-1)*(x^2-x+1)*(x^2+x+1);
eq := ( x + 1)( x − 1)( x 2 − x + 1)( x 2 + x + 1) > expand(eq); x6 − 1
factor(eq).
: 11
denom,
я
Maple
> p:=x^5-x^4-7*x^3+x^2+6*x;
p := x 5 − x 4 − 7 x 3 + x 2 + 6 x x ( x − 1)( x − 3)( x + 2)( x + 1)
> factor(p); К
expand
, .
ln x + e − y x
, 2
(x+a).
: > expand((x+a)*(ln(x)+exp(x)-y^2), (x+a)); ( x + a ) ln x + ( x + a )e x − ( x + a ) y 2
normal(eq). : > f:=(a^4-b^4)/((a^2+b^2)*a*b); a 4 − b4
f :=
> normal(f);
( a 2 + b 2 )ab a 2 − b2 ab
simplify(eq). : > eq:=(cos(x)-sin(x))*(cos(x)+sin(x)): > simplify(eq); 2 cos( x ) 2 − 1
collect(exp,var), , simplify . simplify(eq,trig)
exp –
, var – . , , .
: power – ; radical exp –
sqrt – ; ln –
simplify.
12
; .
я
combine(eq,param), ,
Maple
eq –
, param – , . :
, , trig –
, power – > combine(4*sin(x)^3, trig); − sin( 3 x ) + 3 sin( x ) , , , radnormal(eq). : > sqrt(3+sqrt(3)+(10+6*sqrt(3))^(1/3))= radnormal(sqrt(3+sqrt(3)+(10+6*sqrt(3))^(1/3))); 3 + 3 + (10 + 6 3 )1 / 3 = 1 + 3
convert(exp,
param),
, ,
, ,
tan,
exp – param. sinx cosx,
tgx,
, ,
, tgx, ctgx sincos. convert
sinx
osx, . .
: convert(list, vector) – list string) – . convert , convert[termin]. Maple. , F1. ( ).
; convert(expr,
,
, Maple
За ани 4.
1.
№4».
« .
13
я
Maple
restart;
p = x3 + 4x2 + 2x − 4 .
2. : > factor(x^3+4*x^2+2*x-4);
Enter ( x + 2)( x 2 + 2 x − 2) . 1 + sin 2 x + cos 2 x . : 3. 1 + sin 2 x − cos 2 x > eq:=(1+sin(2*x)+cos(2*x))/(1+sin(2*x)-cos(2*x)): > convert(eq, tan): > eq=normal(%); 1 + sin(2 x ) + cos(2 x ) 1 . = 1 + sin(2 x ) − cos(2 x ) tan( x ) 3(sin 4 x + cos4 x ) − 2(sin 6 x + cos6 x ) .
4.
: > eq:=3*(sin(x)^4+cos(x)^4)-2*(sin(x)^6+cos(x)^6): > eq=combine(eq, trig); 5.
3 sin( x ) 4 + 3 cos( x ) 4 − 2 sin( x ) 6 + cos( x ) 6 = 1 . «К
». . .
6. 7.
. К
1. 2. 3. 4. 5. 6.
я.
: ( −1 + i ) .
: eiπ / 2 .
5
: arctg3 − arcsin
5 . 5
: ω( k ) = αk 2 + βk 4 ; ξ = ae − γ r cos( ω t + ϕ ) . p = x 3 − 4 x 2 + 5x − 2 .
sin 2 3x − sin 2 2 x − sin 5 x sin x .
14
я
Maple
К
.
Maple
1. 2. 3.
?
Maple. Maple ?
К
4. 5. 6. 7.
К
8.
К
?
Maple? Maple
.
Maple? Maple ?
Maple. 9. 10. К ? 11. К Maple ? 12. К ? 13. factor, expand, normal, simplify, combine, convert.
II. Ф
я.
Maple.
1. 2. 3. 4.
.
.
. . . я
§1.
.З
Maple
. 1. (:=):
: > f:=sin(x)+cos(x); f := sin( x ) + cos( x ) 15
,
я
Maple
х,
х.
f
, f
: > x:=Pi/4;
x :=
x = π/4,
π 4
> f; 2
х
π/4 .
, subs({x1=a1,
x2=a2,…, хi
},f), f.
:
аi (i=1,2,…),
> f:=x*exp(-t);
f := xe ( − t ) > subs({x=2,t=1},f);
2e ( −1)
Maple
,
, e, π
,
. ,
evalf(expr,t),
expr – .
, t –
,
,
, : > evalf(%); .7357588824 (%)
.
2. , (x1,x2,…)
(f1,f2,…).
: > f:=(x,y)->sin(x+y); f := sin( x + y ) 16
,
я
Maple
, . : > f(Pi/2,0);
1 unapply(expr,x1,x2,…), , expr
3. expr – ,
, x1,x2,… –
. : > f:=unapply(x^2+y^2,x,y);
f := ( x, y ) − > x 2 + y 2
> f(-7,5);
74
Maple ⎧ f1 ( x ), x < a1 ⎪ f ( x ), a < x < a ⎪ 1 2 f ( x) = ⎨ 2 .......... .......... .... ⎪ ⎪⎩ f n ( x ), x > a n
> piecewise(cond_1,f1, cond_2, f2, …). , ⎧0, x < 0 ⎪ f ( x ) = ⎨ x, 0 ≤ x < 1 ⎪sin x, x ≥ 1 ⎩
: > f:=piecewise(x f:=simplify(%);
3.
f = 1 − ρ2
⎧ x, x < −1 ⎪ f ( x ) = ⎨− x 2 , − 1 ≤ x < 1 ⎪− x , x ≥ 1 ⎩
х.
: > f:=piecewise(x z:=3+I*2: > Re(z);Im(z);
3, 2 z=x+iy, conjugate(z).
w=z*=x–iy : w:=conjugate(z);
w:=3–2 I z polar(z), readlib.
:
> readlib(polar): polar(I); ⎛ 1 ⎞ polar ⎜1, π ⎟ ⎝ 2 ⎠
π/2 .
, Re(z)
, . z
i,
Im(z)
,
evalc(z). > z:=ln(1-I*sqrt(3))^2;
19
:
я
Maple
z := ln(1 − I 3 ) 2 > evalc(Re(z)); evalc(Im(z)); 1 1 ln(4) 2 − π 2 4 9 1 − ln(4) π 3
1.
а=57/13. , a=x+y. > a:=57/13: > y:=frac(a);
За ани 2.
x
y
:
5 13
> x:=trunc(a);
4 > x+y; 57 13 z=
2. ,
, w+z=2Re(z).
2 − 3i 6 +i . 1 + 4i
: > z:=(2-3*I)/(1+4*I)+I^6: > Re(z); Im(z); 27 − 17 11 − 17 > w:=conjugate(z); 27 11 + I w := − 17 17 > z+w; 54 − 17 20
w
я
Maple z = −1 − i 3
3. z4. : > z:=-1-I*sqrt(3): > readlib(polar): polar(z); 2 ⎞ ⎛ polar ⎜ 2,− π ⎟ 3 ⎠ ⎝ ? > evalc(z^4);
− 8 − 8 3I
§3. .
Maple eq –
solve(eq,x),
, x – .
, ,
. > solve(a*x+b=c,x);
−
:
b−c a
, solve -
, name.
k > x:=solve(x^2-a=0,x);
: name[k].
x := − a , a
> x[1];
− a
> x[2];
a > x[1]+x[2];
0
21
k–
:
я
Maple .
solve({eq1,eq2,…},{x1,x2,…}),
, , . assign(name).
solve
, name.
. > s:=solve({a*x-y=1,5*x+a*y=1},{x,y}); a −5 a +1 ,y= s:={ x = } 2 5+a 5 + a2 > assign(s); simplify(x-y); 6
:
5 + a2
Ч
.
,
, ,
fsolve(eq,x), , solve. : > x:=fsolve(cos(x)=x,x); x:=.7390851332 .
К
rsolve(eq,f) eq
f. f(n),
. > eq:=2*f(n)=3*f(n-1)-f(n-2); eq := 2 f ( n ) = 3 f ( n − 1) − f ( n − 2) > rsolve({eq,f(1)=0,f(2)=1},f); ⎛1⎞ 2 − 4⎜ ⎟ ⎝2⎠ solve , : n
22
:
я
Maple
> F:=solve(f(x)^2-3*f(x)+2*x,f); F:= proc(x) RootOf(_Z^2 - 3*_Z + 2*x) end . .
Maple
convert.
, : > f:=convert(F(x),radical); 3 1 f := + 9 − 8x 2 2 .
К
solve,
,
, [0,2π].
,
,
_EnvAllSolutions:=true. : > _EnvAllSolutions:=true: > solve(sin(x)=cos(x),x); 1 π + π_Z ~ 4 Maple _Z~ x := π / 4 + πn ,
n–
,
. . solve _EnvExplicit:=true.
: > eq:={ 7*3^x-3*2^(z+y-x+2)=15, 2*3^(x+1)+ 3*2^(z+y-x)=66, ln(x+y+z)-3*ln(x)-ln(y*z)=-ln(4) }: > _EnvExplicit:=true: > s:=solve(eq,{x,y,z}): > simplify(s[1]);simplify(s[2]); {x=2, y=3, z=1}, {x=2, y=1, z=3}
23
я
Maple За ани 3.
1.
⎧⎪ x 2 − y 2 = 1, ⎨ 2 ⎪⎩ x + xy = 2.
: > eq:={x^2-y^2=1,x^2+x*y=2}; > _EnvExplicit:=true: > s:=solve(eq,{x,y}); 1 1 2 2 3} , {x = − 3} 3, y = 3, y = − s := {x = 3 3 3 3 . : > x1:=subs(s[1],x): y1:=subs(s[1],y): x2:=subs(s[2],x): y2:=subs(s[2],y): > x1+x2; y1+y2; ? 2.
3.
4.
x 2 = cos( x ) . > x=fsolve(x^2=cos(x),x); x=.8241323123 f(x),
:
f 2 ( x) − 2 f ( x) = x . : > F:=solve(f(x)^2-2*f(x)=x,f); F:= proc(x) RootOf(_Z^2−2*_Z−x) end > f:=convert(F(x), radical);
f := 1 + 1 + x 5 sin x + 12 cos x = 13 . > _EnvAllSolutions:=true: > solve(5*sin(x)+12*cos(x)=13,x); ⎛ 5⎞ arctan ⎜ ⎟ + 2π _ Z ~ ⎝ 12 ⎠
:
§4. .
К
solve
.
. ,
, RealRange(–∞, Open(a)), 24
я
,
Maple
x∈(–∞, a), а –
,
. .
Open , .
: > s:=solve(sqrt(x+3) convert(s,radical); ⎛ ⎞ ⎞ ⎛2 RealRange ⎜⎜ Open⎜ 21 ⎟, ∞ ⎟⎟ ⎠ ⎠ ⎝3 ⎝ x∈(a, b), a solve(1-1/2*ln(x)>2,{x});
{0 < x, x < e ( −2) }
. solve
. : > solve({x+y>=2,x-2*y=0,x-2*y>=1},{x,y}); 1 {x = 1 + 2 y , ≤ y} 3 За ани 4.
1.
13x − 25 x 2 − x 4 − 129 x + 270 > 0 . : > solve(13*x^3-25*x^2-x^4-129*x+270>0,x); RealRange(Open(-3), Open(2)), RealRange(Open(5), Open(9)) . 3
.
2.
.
( 2 x + 3)
e solve(exp(2*x+3) plot(sin(x)/x, x=-4*Pi..4*Pi, labels=[x,y], labelfont=[TIMES,ITALIC,12], thickness=2);
28
я
Maple
x y= 2 . x −1 > plot(x/(x^2-1),x=-3..3,y=-3..3,color=magenta);
2.
За еча ие: . 3. y = sin 2t , x = cos 3t , 0 ≤ t ≤ 2π . : > plot([sin(2*t),cos(3*t),t=0..2*Pi], axes=BOXED, color=blue);
4.
ρ = 1 + cosϕ . : > plot(1+cos(x), x=0..2*Pi, title="Cardioida", coords=polar, color=coral, thickness=2);
29
я
Maple
5.
: 3 y = ln(3 x − 1) y = x − ln 2 . 2 > plot([ln(3*x-1), 3*x/2-ln(2)], x=0..6, scaling=CONSTRAINED, color=[violet,gold], linestyle=[1,2], thickness=[3,2]);
,
,
я
.
:
F ( x, y ) = 0 .
implicitplot implicitplot(F(x,y)=0, x=x1..x2, y=y1..y2). В plots options),
xo, yo – ’text’.
plots:
. textplot : textplot([xo,yo,’text’], ,
30
я
Maple
В
.
, ,
,
plot,
, textplot.
,
: > p:=plot(…): t:=textplot(…): . plots: > with(plots): display([p,t], options). ,
. , f1 ( x, y ) > c1 , f 2 ( x, y ) > c 2 ,..., f n ( x, y ) > c n , inequal plots. inequals({f1(x,y)>c1,…,fn(x,y)>cn}, x=x1…x2, y=y1..y2, options) , , . , , : – optionsfeasible=(color=red) – ; – optionsexcluded=(color=yellow) – ; – optionsopen(color=blue, thickness=2) – ; – optionsclosed(color=green,thickness=3) – . За ани 1.2.
1.
(
):
x2 y2 − = 16 . 4 2
> with(plots): > implicitplot(x^2/4-y^2/2=16, x=-20..20, y=-16..16, color=green, thickness=2);
31
я
Maple
x = 4 cos3 t ,
2.
x = 2 sin 3 t ( 0 ≤ t ≤ 2π )
x2 y2 + =1. 16 4
Astroida Ellips . : > with(plots): > eq:=x^2/16+y^2/4=1: > el:=implicitplot(eq, x=-4..4, y=-2..2, scaling=CONSTRAINED, color=green, thickness=3): > as:=plot([4*cos(t)^3,2*sin(t)^3, t=0..2*Pi], color=blue, scaling=CONSTRAINED, thickness=2): > eq1:=convert(eq,string): > t1:=textplot([1.5,2.5,eq1], font=[TIMES, ITALIC, 10], align=RIGHT): > t2:=textplot([0.2,2.5,"Ellips:"], font=[TIMES, BOLD,10], align=RIGHT): > t3:=textplot([1.8,0.4,Astroida], font=[TIMES, BOLD,10], align=LEFT): > display([as,el,t1,t2,t3]);
32
я
Maple
3. , : x + y > 0 , x − y ≤ 1, y =2. > with(plots): > inequal({x+y>0, x-y spacecurve([x(t),y(t),z(t)],t=t1..t2), t t1 t2. А Maple
:
я. animate (
animate3d ( animate3d frames=8).
)
plot.
–
(
) frames
plot3d,
. К , , К
. :
34
. . ,
я
Maple За ани 2.
1.
z = x sin 2 y + y cos 3x
( x, y ) ∈ [ − π, π] .
z = x2 + y2 − 7
x+ y. > plot3d({x*sin(2*y)+y*cos(3*x), sqrt(x^2+y^2)-7}, x=-Pi..Pi, y=-Pi..Pi, grid=[30,30], axes=FRAMED, color=x+y);
2.
z=
1
x +y
+
0,2
+
0,3
( x + 1,2) + ( y − 1,5) ( x − 0,9) + ( y + 1,1) 2 : > plot3d(1/(x^2+y^2)+0.2/((x+1.2)^2+(y-1.5)^2)+ 0.3/((x-0.9)^2+(y+1.1)^2), x=-2..2, y=-2..2.5, view=[-2..2, -2..2.5, 0..6], grid=[60,60], shading=NONE, light=[100,30,1,1,1], axes=NONE, orientation=[65,20], style=PATCHCONTOUR); 2
2
2
2
35
2
я
Maple
3.
. : l – . P( x ) =
1
dn
2 n n! dx n
Y (ϕ ) =
m – :
( x 2 − 1) n .
y ( θ, ϕ) = Y (ϕ) sin ϕ sin θ ,
, m=0
:
2l + 1 P(cos ϕ) . 4π
x( θ, ϕ) = Y (ϕ) sin ϕ cos θ , z ( θ, ϕ) = Y (ϕ) cos ϕ ,
l=3.
: > l:=3: > P:=(x,n)->1/(2^n*n!)*diff((x^2-1)^n,x$n); >Y:=(phi)->abs(sqrt((2*l+1)/(4*Pi))* subs(x=cos(phi),P(x,l))); > X0:=Y(phi)*sin(phi)*cos(theta); > Y0:=Y(phi)*sin(phi)*sin(theta); > Z0:=Y(phi)*cos(phi); > plot3d([X0,Y0,Z0],phi=0..Pi,theta=0..2*Pi, scaling=CONSTRAINED, title="Э е о ое о а о");
36
я
Maple
l=1
l=2.
4. x2 + y2 + z2 = 4 : > with(plots): implicitplot3d(x^2+y^2+z^2=4, x=-2..2, y=-2..2, z=-2..2, scaling=CONSTRAINED);
: x = sin t , y = cos t , z = e t
5.
> with(plots): > spacecurve([sin(t),cos(t),exp(t)], t=1..5, color=blue, thickness=2, axes=BOXED);
37
я
6.
Щ
Maple
. : > animate3d(cos(t*x)*sin(t*y), x=-Pi..Pi, y=-Pi..Pi, t=1..2); .
Animation→Continuous. Animation→Play.
,
, Animation→Stop.
. 7. .
. . . К
я.
1.
Jn(x) 6
n –20 Limit(arctan(1/(1-x)),x=1,right)= limit(arctan(1/(1-x)),x=1, right); 1 ⎛ 1 ⎞ lim arctan ⎜ ⎟ = −π 1 2 x − x →1+ ⎝ ⎠
41
x →1+
lim arctg
1 . 1− x
я
Maple
§2. В
. Maple – diff(f,x), f– , x – . – Diff(f,x), .
1)
2) ,
: , ,
∂ f (x ) . ∂x
, simplify
. factor
expand,
,
. : > Diff(sin(x^2),x)=diff(sin(x^2),x); ∂ sin( x 2 ) = 2 cos( x 2 ) x ∂x x$n, n– ; : > Diff(cos(2*x)^2,x$4)=diff(cos(2*x)^2,x$4);
∂4
∂x 4
cos(2 x ) 2 = −128 sin(2 x ) 2 + 128 cos(2 x ) 2
: > simplify(%); ∂4
∂x > combine(%);
4
cos(2 x ) 2 = 256 cos(2 x ) 2 − 128
∂4 ⎛ 1 1⎞ cos(4 x ) + ⎟ = 128 cos(4 x ) 4 ⎜2 2⎠ ∂x ⎝ 2
. D(f) – f> D(sin);
.
: cos : 42
я
Maple
> D(sin)(Pi):eval(%); -1
> f:=x-> ln(x^2)+exp(3*x): > D(f); 1 x → 2 + 3e ( 3 x ) x За ани 2.
1.
2.
f ( x ) = sin 3 2 x − cos3 2 x > Diff(sin(2*x)^3-cos(2*x)^3,x)= diff(sin(2*x)^3-cos(2*x)^3,x); ∂ (sin(2 x ) 3 − cos(2 x ) 3 ) = 6 sin(2 x ) 2 cos(2 x ) + 6 cos(2 x ) 2 sin(2 x ) ∂x ∂ 24
( e x ( x 2 − 1)) .
∂x > Diff(exp(x)*(x^2-1),x$24)= diff(exp(x)*(x^2-1),x$24): > collect(%,exp(x)); 24
∂ 24
∂x 24 3.
:
e x ( x 2 − 1) = e x ( x 2 + 48 x + 551)
y = sin 2 x /(2 + sin x )
x=π/2, x=π. > y:=sin(x)^2/(2+sin(x)): d2:=diff(y,x$2): > x:=Pi; d2y(x)=d2; x:=π d2y(π)=1 > x:=Pi/2;d2y(x)=d2; 1 ⎛1 ⎞ −5 х:= π d2y⎜ π ⎟ = 2 9 ⎝2 ⎠ §3. И
,
,
,
. 43
я
(
Maple
.
II).
,
, ,
,
. . f(x) iscont(f,x=x1..x2). ,
[x1,x2] f true – ( ,
f
);
false – ( ). x=-infinity..+infinity, . , , . : discont(f,x), f – , x – . Э
true, .Э 1)
2)
singular(f,x),
.Э
, f
, . , x –
f –
, . readlib(name),
name –
. .
set.
, ,
set
convert
. За ани 3.1.
y = e x +3 > readlib(iscont): readlib(discont): > iscont(exp(1/(x+3)),x=-infinity..+infinity); false Э , . : > discont(exp(1/(x+3)),x); 1
1.
44
я
Maple
{-3} “ 2.
x=−3.”
: y = tg
x 2−x
> readlib(singular): > iscont(tan(x/(2-x)),x=-infinity..infinity); false > singular(tan(x/(2-x)),x); π( 2 _ N + 1) {x=2},{x=2 } − 2 + 2 _ Nπ + π _N – . : “ : x=2 x=2π(2n+1)/(π(2n+1)-2).” Э
. . Maple extrema(f,{cond},x,’s’) , f , , {cond} , х – , , ’s’ – , . {}, . set. : > readlib(extrema): > extrema(arctan(x)-ln(1+x^2)/2,{},x,’x0’);x0; π 1 { − ln( 2)} 4 2 {{x=1}} , – . К , , , – . f(x) х x ∈ [ x1, x 2] maximize(f,x,x=x1..x2), f(x) х minimize(f, x, x=x1..x2). x ∈ [ x1, x 2] ’infinity’
45
я
Maple
x=-infinity..+infinity, , ,
maximize
minimize
, .
,
. : > maximize(exp(-x^2),{x}); 1 , ,
.
, y=f(x)
(max min) (x, y) : > extrema(f,{},x,’s’);s; maximize(f,x); minimize(f,x). К
(max min). minimize
maximize
,
.К
extrema
, .
, . x=x0
f(x) f ′′( x0 ) > 0 ,
,
f ′′( x0 ) < 0 −
:
x0
min,
max. maximize
. К , (
Maple 6 minimize
location. )
( ). x, location); − 1⎤ ⎡ − 1⎤ 1 1 −1 ⎡ 2 }, ⎥ , ⎢{x = 2 }, ⎥ } , { ⎢{x = − 4 ⎦ ⎣ 4 ⎦ 2 2 4 ⎣
> minimize(x^4-x^2,
.
46
:
я
К
Maple
extrema,
readlib(name),
maximize
minimize
name –
.
За ани 3.2. x π 2 1 1 max min y = ( x 2 − ) arcsin x + x . 1 − x2 − 2 2 4 12 > readlib(extrema): > y:=(x^2-1/2)*arcsin(x)/2+x*sqrt(1-x^2)/4Pi*x^2/12: > extrema(y,{},x,'s');s; 1 1 {0, − π+ 3} 24 16 1 {{x = 0},{x = }} 2
1.
.
x– .
,
(1/2, –π/24+ 3 / 16 ). , – maximize minimize. > readlib(maximize):readlib(minimize): > ymax:=maximize(y,{x}); ymax := 0 > ymin:=minimize(y,{x}); 1 1 ymin := − π+ 3 24 16 : : max y ( x ) = y (0) = 0 ,
,
(0,0)
“Э
min y ( x ) = y (1 / 2) = − π / 24 + 3 / 16 .”
Па е и и с у е Па е и и с Maple,
в. у е
в Enter.
, sqrt(3).
3
47
.
я
Maple
« ».
: : miny(x)=y(1/2)= ;
,
: -Pi/24+sqrt(3)/16 Enter;
.
f ( x ) = x 2 ln x
2.
x ∈ [1,2] . : > f:=x^2*ln(x): > maximize(f,{x},{x=1..2}); 4 ln(2) > minimize(f,{x},{x=1..2}):simplify(%); 1 − e ( −1) 2 : ” : max f ( x ) = 4 ln 2 , min f ( x ) = −1 / 2e “.
3.
y=
x3
4 − x2
. : > restart:y:=x^3/(4-x^2): readlib(extrema): readlib(maximize): readlib(minimize): > extrema(y,{},x,'s');s; { − 3 3, 3 3 }
{{x=0},{ x = 2 3 },{ x = −2 3 }} . : > d2:=diff(y,x$2): x:=0: d2y(x):=d2; d2y(0):=0 48
я
Maple
> x:=2*sqrt(3):d2y(x):=d2;
d2y( 2 3 ) := −
3 3 4
> x:=-2*sqrt(3):d2y(x):=d2; y ′′(0) = 0 ,
y ′′(2 3 ) < 0 ,
y ′′( −2 3 ) > 0 ,
d2y( −2 3 ) :=
3 3 4 x=0
;
x=2 3
max;
x = −2 3
min. :
“
( − 2 3 , 3 3 / 4 )”.
( 2 3 , − 3 3 / 4 ),
И 1.
.
f(x) –
. f(x) 2. : > iscont(f, x=-infinity..infinity); > d1:=discont(f,x); > d2:=singular(f,x); d1 d2 x1 2( ). 3. А . f(x). : > yr:=d2; f(x) ( ). y=kx+b, f ( x) k = lim b = lim ( f ( x ) − kx ) . x → +∞ x → +∞ x x → −∞ . А
:
: > k1:=limit(f(x)/x, x=+infinity); > b1:=limit(f(x)-k1*x, x=+infinity); 49
я
Maple
> k2:=limit(f(x)/x, x=-infinity); > b2:=limit(f(x)-k2*x, x=-infinity); , k1=k2 b1=b2, x → +∞ x → −∞ . > yn:=k1*x+b1; 4. Э .
f(x)
: > extrema(f(x), {}, x, ’s’); > s; > fmax:=maximize(f(x), x); > fmin:=minimize(f(x), x); (x, y) f(x). .
f(x) – . f(x) ,
max
min.
III. За ани 3.3.
1.
f ( x) =
x4
(1 + x ) 3
. “
: “. : > f:=x^4/(1+x)^3: “ : > readlib(iscont): readlib(discont): readlib(singular): > iscont(f, x=-infinity..infinity); false Э , “ : 50
”.
. ”.
я
Maple
> discont(f,x); {-1}
К
set convert,
`+`.
,
,
, , > xr:=convert(%,`+`); xr:= −1
: “
x=−1”. .”.
.
:“ “
: x=−1” (
, ). :”.
: “К : > k1:=limit(f/x, x=+infinity); k1 :=1 > b1:=limit(f-k1*x, x=+infinity); b1 := −3 > k2:=limit(f/x, x=-infinity); k2 :=1 > b2:=limit(f-k2*x, x=-infinity); b2 := −3
x → −∞
x → +∞
. “
> y=k1*x+b1;
:”. : y = x−3 “
: > readlib(extrema): readlib(maximize): readlib(minimize): > extrema(f,{},x,'s');s; −256 { , 0} 27 {{x= −4},{x=0}} , , . 51
”.
я
Maple
> fmax:=maximize(f,{x},{x=-infinity..-2}); −256 fmax := 27 > fmin:=minimize(f,{x},{x=-1/2..infinity}); fmin := 0 “
(−4, −256/27);
y = arctg( x 2 ) .
2.
: (0, 0).” ,
. . > restart: y:=arctan(x^2): > iscont(y, x=-infinity..infinity); true > k1:=limit(y/x, x=-infinity); k1:=0 > k2:=limit(y/x, x=+infinity); k2:=0 > b1:=limit(y-k1*x, x=-infinity); 1 b1 := π 2 > b2:=limit(y-k1*x, x=+infinity); 1 b2 := π 2 > yh:=b1; 1 yh := π 2 > extrema(y,{},x,'s');s; {0} {{x=0}} > ymax:=maximize(y,{x}); ymin:=minimize(y,{x}); ymax := ymin := 0 > with(plots): yy:=convert(y,string): > p1:=plot(y,x=-5..5, linestyle=1, thickness=3, color=BLACK): > p2:=plot(yh,x=-5..5, linestyle=1,thickness=1): 52
я
Maple
> t1:=textplot([0.2,1.7,"Асим о а:"], font=[TIMES, BOLD, 10], align=RIGHT): > t2:=textplot([3.1,1.7,"y=Pi/2"], font=[TIMES, ITALIC, 10], align=RIGHT): > t3:=textplot([0.1,-0.2,"min:(0,0)"], align=RIGHT): > t4:=textplot([2,1,yy], font=[TIMES, ITALIC, 10], align=RIGHT): > display([p1,p2,t1,t2,t3,t4]);
§4. И
∫ f ( x)dx
А
: 1) ,x– 2)
– int(f, x), ; – Int(f, x) –
, .
53
.
2f – int. К
Int
я
Maple
∫ f ( x)dx b
a
int
Int > Int((1+cos(x))^2, x=0..Pi)= int((1+cos(x))^2, x=0..Pi);
,
,
∫ (1 + cos( x )) dx = 2 π π
3
2
0
continuous: int(f, x, continuous),
Maple
. Э . int
, , x=0..+infinity.
,
evalf(int(f, x=x1..x2), e), ( ). И
e –
я
, .
.
я
я
,
, -
∫e
+∞ 0
. − ax
dx ,
,
,
а>0 а Int(exp(-a*x),x=0..+infinity)= int(exp(-a*x),x=0..+infinity);
,
Definite integration: Can't determine if the integral is convergent. Need to know the sign of --> a Will now try indefinite integration and then take limits.
∫
+∞ 0
e ( − ax ) dx = lim − x→∞
54
e ( − ax ) − 1 . a
я
Maple
. -
,
. Э
assume(expr1), additionally(expr2),
expr1 expr2
–
.
–
, . Maple
a,
(~), ,
: a~. a
about(a). : , a>-1, a≤3: > assume(a>-1); additionally(a about(a);
a
Originally a, renamed a~: is assumed to be: RealRange(Open(-1),3)
∫e
+∞
− ax
dx ,
0
: > assume(a>0); > Int(exp(-a*x),x=0..+infinity)= int(exp(-a*x),x=0..+infinity);
∫e
+∞
( −a ~ x )
dx =
0
1 a~
я. student,
Maple .
, , ,
changevar.
,
. К inparts
∫ u( x)v' ( x)dx = u( x)v( x) − ∫ u' ( x)v( x)dx :
55
я
Maple
f=u(x)v’(x), intparts(Int(f, x), u),
: u(x),
u –
. t=h(x), changevar(h(x)=t, Int(f, . intparts , ,
x),
t),
−
t
x=g(t) :
changevar
. , value(%);
, % -
. , student
with(student).
∫ cos x cos 2 x cos 3xdx ;
За ани 4.
1. )
: )
∫ x 2 ( x 2 + 1)3 dx . 3x 4 + 4
∫
> Int(cos(x)*cos(2*x)*cos(3*x),x)= int(cos(x)*cos(2*x)*cos(3*x), x); 1 1 1 1 cos( x ) cos(2 x ) cos(3x )dx = sin(2 x ) + sin(4 x ) + sin(6 x ) + x 8 16 24 4 > Int((3*x^4+4)/(x^2*(x^2+1)^3),x)= int((3*x^4+4)/(x^2*(x^2+1)^3),x);
∫ x 2 ( x 2 + 1)3 dx = −4 x − 8 arctan( x) − 8 3x 4 + 4
1
57
25
∫
π/2
2.
0
x
x +1 2
−
x 7 2 4 ( x + 1) 2
sin x cos xdx
(a cos 2 x + b 2 sin 2 x ) 2 2
,
a>0, b>0. > assume (a>0); assume (b>0); > Int(sin(x)*cos(x)/(a^2*cos(x)^2+b^2*sin(x)^2), x=0..Pi/2)=int(sin(x)*cos(x)/(a^2*cos(x)^2+b^2 * 56
я
∫
Maple
sin(x)^2),x=0..Pi/2); π/2 0
sin( x ) cos( x )
( a ~ cos( x ) + b ~ sin( x ) ) 2
2
2
2 2
∫
+∞
3.
dx =
1 − e − ax xe x
0
2
ln(b ~) − ln( a ~) − a ~ 2 +b ~ 2
2
dx ,
a>-1
> restart; assume(a>-1); > Int((1-exp(-a*x^2))/(x*exp(x^2)), x=0..+infinity)=int((1-exp(-a*x^2))/(x*exp(x^2)), x=0..+infinity);
∫
+∞
1 − e( −a ~ x xe
0
x
4.
2
dx =
)
2
∫
π/4 π/6
1 ln(a ~ +1) 2
cos x dx x
> Int(cos(x)/x, x=Pi/6..Pi/4)=evalf(int(cos(x)/x, x=Pi/6..Pi/4), 15);
∫
π/4
5.
∫x
π/6 3
cos( x ) dx = .322922981113732 x
.
sin xdx
∫x
> restart; with(student): J=Int(x^3*sin(x),x); J=
3
sin( x )dx
∫
> J=intparts(Int(x^3*sin(x),x),x^3); J = − x 3 cos( x ) − − 3x 2 cos( x )dx
> intparts(%,x^2);
∫
J = − x 3 cos( x ) + 3x 2 sin( x ) + − 6 x sin( x )dx
> intparts(%,x);
∫
J = − x 3 cos( x ) + 3x 2 sin( x ) + 6 x cos( x ) − 6 cos( x )dx
> value(%);
57
я
Maple
J = − x 3 cos( x ) + 3x 2 sin( x ) + 6 x cos( x ) − 6 sin( x )
∫
π/2
6.
dx 1 + cos x
−π / 2
x tg = t . 2 > J=Int(1/(1+cos(x)), x=-Pi/2..Pi/2); J =
∫
π/2
−π / 2
1 dx 1 + cos( x )
> J=changevar(tan(x/2)=t,Int(1/(1+cos(x)), x=-Pi/2..Pi/2), t); J=
∫ (1 + cos(2 arctan(t )))(1 + t 2 ) dt 1
1
−1
> value(%); J=2 К
⎛ x2 − 2x + 1 ⎞ ⎟ . lim ⎜ 2 x → ∞⎜ x − 4 x + 2 ⎟ ⎝ ⎠ 1 y= 1 + 21 / x
я.
x
1. 2. 3.
∂5
∂x 5
(ln x ) . y=
4.
5.
x → +0
1 x 1 − e 1− x
.
f ( x ) = x sin x + cos x − x 2 / 4 , .
x ∈ [−1,1]
y=
6.
y = x 3 − 3x 2 + 2
7. .
58
x 2 ( x − 1) . x +1
x → −0 .
я
Maple
∫ x 4 + 6x2 + 8 . ( x 3 − 6)dx
8.
∫
+∞
9.
0
b>0
a>b, a=b, a0
2
x4
0,1
∫x
sin( ax ) cos(bx )dx x
dx .
11.
π/2
3
.
cos xdx
∫
0
π/2
12.
0
dx 5 − 4 sin x + 3 cos x
tg(x/2)=t. К
.
1.
? .
? К
2. ?
3. 4.
К
5.
К max min К extrema?
6.
? , . (x, y)? maximize, minimize
7. 8.
К
Maple. ?
.
9. , 10. 11. 12.
? student?
. . 59
я
Maple
я
V. 1. 2. 3. 4.
. . . .
.
§1. В
я
linalg. with(linalg). я
.
Maple vector([x1,x2,…,xn]),
. : > x:=vector([1,0,0]); x:=[1, 0, 0] К , x[i] , , : > x[1]; 1
x i−
, convert(vector,
list)
.
, convert(list,
vector). . a b 1) evalm(a+b); 2) matadd(a,b). add К a b: αa + βb , α, β − : matadd(a,b,alpha,beta).
60
:
,
я я
Maple
, . ( a, b) =
∑ ai bi n
i =1
dotprod(a,b).
[ a, b ] crossprod(a,b).
a
b
angle(a,b). a = ( x1 ,..., x n ) ,
. a =
(
)
x 12 + ... + x n2 ,
norm(а,2).
а
normalize(a), a . a
я
. -Ш . {a1 , a2 ,..., an } ,
n basis([a1,a2,…,an]) GramSchmidt([a1,a2,…,an]) {a1 , a2 ,..., an } .
1.
За ани 1. : a = ( 2,1,3,2) b = (1,2,−2,1) .
a b. > with(linalg): > a:=([2,1,3,2]); b:=([1,2,-2,1]); a:=[2,1,3,2] b:=[1,2,-2,1] > dotprod(a,b); 0 > phi=angle(a,b); 61
.
( a, b )
:
я φ=
2.
π 2
Maple c = [ a, b ] ,
( a, c ) , a = ( 2,−2,1) , b = ( 2,3,6) . > restart; with(linalg): > a:=([2,-2,1]); b:=([2,3,6]); a:=[2,−2,1] b:=[2,3,6] > c:=crossprod(a,b); c:=[−15,−10,10] > dotprod(a,c); 0 a = ( 2,−2,1) . 3. > restart; with(linalg): > a:=vector([1,2,3,4,5,6]): norm(a,2);
91 4. : a1 = (1,2,2,−1) , a2 = (1,1,−5,3) , a3 = (3,2,8,7) , a4 = (0,1,7,−4) , a5 = ( 2,1,12,−10) : > restart; with(linalg): > a1:=vector([1,2,2,-1]): a2:=vector([1,1,-5,3]): a3:=vector([3,2,8,7]): a4:=vector([0,1,7,-4]): a5:=vector([2,1,12,-10]): > g:=basis([a1,a2,a3,a4,a5]); g:= [a1, a2, a3, a5] > GramSchmidt(g); ⎡ 81 − 93 327 549 ⎤ , , , [[1,2,2,−1], [2,3,−3,2], ⎢ , ⎣ 65 65 65 65 ⎥⎦ ⎡ 1633 − 923 − 71 − 355 ⎤ ⎤ ⎢⎣ 724 , 724 , 724 , 724 ⎥⎦ ⎥ ⎦
я
§2. . matrix(n,
m,
Maple [[a11,a12,…,a1n], 62
[a21,a22,…,a2m],…,
я
Maple
n −
[an1,an2,…,anm]]), .Э
, m – , .
: > A:=matrix([[1,2,3],[-3,-2,-1]]); 2 3⎤ ⎡ 1 A := ⎢ ⎥ ⎣− 3 − 2 − 1⎦ Maple . diag. : > J:=diag(1,2,3); ⎡ 1 0 0⎤ J := ⎢⎢0 2 0⎥⎥ ⎢⎣0 0 3⎥⎦ f(i, j) i, j – ,m– . > f:=(i, j)->x^i*y^j;
: matrix(n, m, f), :
f := (i, > A:=matrix(2,3,f); ⎡ xy A := ⎢ 2 ⎣⎢ x y
j) → xi y j
xy 2 x2 y2
А
rowdim(A),
xy 3 ⎤ ⎥ x 2 y 3 ⎦⎥
coldim(A).
–
А
.
: evalm(A+B)
, matadd(A,B).
: 1) evalm(A&*B); 2) multiply(A,B). , , , > A:=matrix([[1,0],[0,-1]]); > B:=matrix([[-5,1], [7,4]]);
63
:
n-
я
⎡ 1 0⎤ ⎡− 5 A := ⎢ B := ⎢ ⎥ ⎣0 − 1⎦ ⎣ 7 > v:=vector([2,4]); v := [2,4] > multiply(A,v); [2,−4] > multiply(A,B); 1⎤ ⎡− 5 ⎢ − 7 − 4⎥ ⎦ ⎣ > matadd(A,B); ⎡ − 4 1⎤ ⎢ 7 3⎥ ⎦ ⎣ К evalm . : > :=matrix([[1,1],[2,3]]): > evalm(2+3* ); ⎡5 3⎤ ⎢6 11⎥ ⎦ ⎣
Maple 1⎤ 4⎥⎦
я.
, .
А det(A). minor(A,i,j) , А ij. aij А Mij det(minor(A,i,j)). А rank(A). А, trace(A). 7 , > A:=matrix([[4,0,5],[0,1,-6],[3,0,4]]); ⎡4 0 5 ⎤ A := ⎢⎢0 1 − 6⎥⎥ ⎣⎢ 3 0 4 ⎦⎥ > det(A); 1 > minor(А,3,2);
К
64
я
Maple 5⎤ ⎡4 ⎢ 0 − 6⎥ ⎣ ⎦
> det(%);
-24 > trace(A);
9 я
я
А−1 ,
, 1) evalm(1/A); 2) inverse(A). .
. А−1А=АА−1=Е, :
Е −
А– А'. transpose(A).
,
А' А,
: > inverse(A);
> multiply(A,%);
⎡ 4 0 ⎢ − 18 1 ⎢ ⎢⎣ − 3 0
⎡1 0 0⎤ ⎢0 1 0⎥ ⎥ ⎢ ⎢⎣0 0 1⎥⎦
> transpose(A);
0 ⎡4 ⎢0 1 ⎢ ⎢⎣ 5 − 6
В я
.
param
− 5⎤ 24⎥⎥ 4⎥⎦
3⎤ 0⎥⎥ 4⎥⎦
definite(A,param), : 'positive_def' (A>0), 'positive_semidef' ( A ≥ 0) , 'negative_def'
65
– – –
я
Maple (A A:=matrix([[2,1],[1,3]]); ⎡2 1⎤ A := ⎢ ⎥ ⎣1 3⎦ > definite(А,'positive_def'); true
А
orthog(A). > В:=matrix([[1/2,1*sqrt(3)/2], [1*sqrt(3)/2,-1/2]]); 1 ⎤ ⎡ 1 3 ⎢ 2 2 ⎥ B := ⎢ 1 −1 ⎥ ⎥ ⎢ 3 2 ⎦ ⎣2 > orthog(В); true Ф
.
А
n eA
evalm(A^n). exponential(A). : > :=matrix([[5*a,2*b],[-2*b,5*a]]); ⎡ 5a 2b⎤ T := ⎢ ⎥ ⎣ − 2b 5a ⎦ > exponential( ); ⎡ e (5a ) cos(2b) e (5a ) sin( 2b)⎤ ⎢ (5a ) ⎥ sin(2b) e (5a ) cos(2b) ⎦⎥ ⎣⎢ − e > evalm( ^2); ⎡25a 2 − 4b 2 20ab ⎤ ⎢ ⎥ 25a 2 − 4b 2 ⎦⎥ ⎣⎢ − 20ab
66
−
я
1.
2.
Maple
За ани 2. 93 ⎤ ⎡ − 28 ⎡4 3⎤ ⎡7 3⎤ , B=⎢ : A=⎢ : , C=⎢ ⎥ ⎥ ⎥. ⎣ 38 − 126⎦ ⎣7 5⎦ ⎣2 1⎦ (AB)C , detA, detB, detC, det[(AB)C]. : > with(linalg):restart; > A:=matrix([[4,3],[7,5]]): > B:=matrix([[-28,93],[38,-126]]): > C:=matrix([[7,3],[2,1]]): > F:=evalm(A&*B&*C); ⎡ 2 0⎤ F=⎢ ⎥ ⎣0 3⎦ > Det(A)=det(A); Det(B)=det(B); Det(C)=det(C); Det(F)=det(F); Det(A)=−1 Det(B)=−6 Det(C)=1 Det(F)=6 5 7⎤ ⎡2 ⎢ A = ⎢6 : detA, A−1 , A’, det(M22). 3 4⎥⎥ , ⎢⎣ 5 − 2 − 3⎥⎦
: > A:=matrix([[2,5,7],[6,3,4],[5,-2,-3]]); 5 7⎤ ⎡2 ⎢ A := ⎢ 6 3 4⎥⎥ ⎢⎣ 5 − 2 − 3⎥⎦ > Det(A)=det(A); Det(A)=−1 > transpose(A);
5⎤ ⎡2 6 ⎢ 5 3 − 2⎥ ⎥ ⎢ ⎢⎣7 4 − 3⎥⎦
> inverse(A);
67
я
3.
4.
Maple
−1 1⎤ ⎡ 1 ⎢ − 38 41 − 34⎥⎥ ⎢ ⎢⎣ 27 − 29 24⎥⎦ > det(minor(A,2,2)); −41 5 5 9⎤ ⎡8 − 4 ⎢ 1 − 3 − 5 0 − 7⎥ ⎥. A=⎢ ⎢7 − 5 1 4 1⎥ ⎥ ⎢ 3 2 5⎦ ⎣3 − 1 > A:=matrix([[8,-4,5,5,9], [1,-3,-5,0,-7], [7,-5,1,4,1], [3,-1,3,2,5]]): > r(A)=rank(A); r(A)=3 3 ⎡ − 1⎤ . eT , T =⎢ 1⎥⎦ ⎣1 > exponential([[3,-1],[1,1]]); ⎡2e 2 − e 2 ⎤ ⎢ 2 ⎥ 0 ⎦⎥ ⎣⎢ e ⎡ 5 1 4⎤ A = ⎢⎢ 3 3 2⎥⎥ . ⎢⎣6 2 10⎥⎦
5.
P( A) = A3 − 18 A2 + 64 A . > A:=matrix([[5,1,4],[3,3,2],[6,2,10]]): > P(A)=evalm(A^3-18*A^2+64*A); ⎡64 0 0⎤ P( A) = ⎢⎢ 0 64 0⎥⎥ ⎢⎣ 0 0 64⎥⎦
§3.
,
68
Ах=λх, А,
.
х λ –
я
Maple
, . . k
,
,
k.
А
eigenvalues(A). А
eigenvectors(A).
, . , eigenvectors, 1⎤ ⎡ 3 −1 A = ⎢⎢ − 1 5 − 1⎥⎥ 3 : ⎢⎣ 1 − 1 3⎥⎦ λ1 = 2 a1 = ( −1,0,1) , a2 = (1,1,1) , λ2 = 3 a3 = (1,−2,1) , λ3 = 6 Maple: > A:=matrix([[3,-1,1],[-1,5,-1],[1,-1,3]]): > eigenvectors(A); [2,1,{[-1,0,1]}], [3,1,{[1,1,1]}], [6,1,{[1,-2,1]}]
: 1, 1, 1.
, ,
. .
PA (λ ) = det(λE − A) charpoly(A,lambda).
A
( ) minpoly(A,lambda). К
К
А
.
А jordan(A).
А
: 69
я
1) 2)
Maple А
gausselim(A) ; ffgausselim(A)
А
.Э ,
, ; 3)
gaussjord(A) -
А .
F ( A) = λE − A
charmat(A,lambda).
1.
За ани 3. 2 − i⎤ ⎡ 3 . U =⎢ 7 ⎥⎦ ⎣2 + i . > U:=matrix([[3,2-I],[2+I,7]]): > eigenvectors(U); ⎡ ⎡2 1 ⎤ ⎤ ⎢8, 1, {⎢ 5 − 5 I , 1⎥}⎥ , [2, 1, {[− 2 + I , 1]}] ⎦⎦ ⎣ ⎣ ⎡3 − i 0⎤ A = ⎢⎢ i 3 0⎥⎥ . ⎢⎣0 0 4⎥⎦
2.
, , . > A:=matrix([[3,-I,0],[I,3,0],[0,0,4]]): > eigenvectors(A); [2, 1, {([1, −I, 0])}], [4, 2, {([0, 0, 1]), ([−I, 1, 0])}] > P(lambda):=charpoly(A,lambda); P (λ ) := λ3 − 10λ2 + 32λ − 32 > d(lambda):=minpoly(A,lambda); d (λ ) := 8 − 6λ + λ2
> jordan(A);
70
,
я
Maple
⎡2 0 0⎤ ⎢0 4 0⎥ ⎥ ⎢ ⎢⎣0 0 4⎥⎦ ⎡1 − 3 4⎤ A = ⎢⎢4 − 7 8⎥⎥ . ⎣⎢6 − 7 7⎦⎥
3.
А
, , > A:=matrix([[1,-3,4],[4,-7,8],[6,-7,7]]): > j:=jordan(A); 0 0⎤ ⎡3 ⎢ j := ⎢0 − 1 1⎥⎥ ⎢⎣0 0 − 1⎥⎦
.
> g:=gausselim(A);
⎡1 − 3 4⎤⎥ ⎢ g := ⎢0 5 − 8⎥ ⎢ 3⎥ 0 ⎢0 5 ⎥⎦ ⎣ > F(A):=charmat(A,lambda); 3 −4 ⎤ ⎡λ − 1 F ( A) := ⎢⎢ − 4 λ + 7 − 8 ⎥⎥ ⎢⎣ − 6 7 λ − 7⎥⎦ , ffgausselim(A) gausselim(A) .
§4.
я
. я.
Ax = b
. solve
1: ,
:
71
я
⎧a11 x1 + a12 x2 + ... + a1n xn = b1 ⎪ . ⎨............................................... ⎪a x + a x + ... + a x = b m2 2 mn n m ⎩ m1 m linsolve(A,b) linalg Ax = b . А :А–
2: –
Maple
.
,
А А .
linsolve(A,b) АХ=В, , А В. . А–
х , : Ax = 0 . А
kernel(A).
За ани 4.
1.
⎧ 2 x − 3 y + 5 z + 7t = 1 ⎪ ⎨4 x − 6 y + 2 z + 3t = 2 ⎪2 x − 3 y − 11z − 15t = 1 ⎩
:
> eq:={2*x-3*y+5*z+7*t=1, 4*x-6*y+2*z+3*t=2, 2*x-3*y-11*z-15*t=1}: > s:=solve(eq,{x,y,z}); 3 1 1 11 s:={ z = − t , y=y, x = y − t + } 2 16 2 8
2.
subs: > subs({y=1,t=1},s); 31 −11 , 1=1} , x= {z = 8 16 ⎡ 3 5⎤ ⎡1 2⎤ A= ⎢ : АX=В; ⎥ , B = ⎢5 9⎥ 3 4 ⎦ ⎣ ⎦ ⎣ > A:=matrix([[1,2],[3,4]]): > B:=matrix([[3,5],[5,9]]):
72
,b
я
Maple
> X:=linsolve(A,B);
⎡ − 1 − 1⎤ X := ⎢ 3⎥⎦ ⎣ 2 ⎡1 1 0 ⎤ A = ⎢⎢0 2 − 1⎥⎥ . ⎣⎢1 3 − 1⎦⎥
3.
,
: d(A)=n–r(A),
n– ,r– . А. : > A:=matrix([[1,1,0],[0,2,-1],[1,3,-1]]): > r(A):=rank(A); r(A):=2 > d(A):=rowdim(A)-r(A); d(A):=1 > k(A):=kernel(A); k(A):={[−1,1,2]} К
1) 2) 3)
я.
( a, b ) ϕ : a = (1, 2, 2, 3) , b = (3, 1, 5, 1) . . 3 : a = ( 2, − 3, 1) , b = (−3, 1, 2) c = (1, 2, 3) . : [[a, b], c ] [a, [b, c ]] . a1 = (2,1, 3, − 1) , : a2 = (7, 4, 3, − 3) , a3 = (1, 1, − 6, 0) , a4 = (5, 3, 0, 4) . ,
2
{a1, a2 , a3, a4}
,
⎡5 ⎢7 4) A=⎢ ⎢6 ⎢ ⎣8 AB, BA, detA, detB.
. 7 − 3 − 4⎤ 6 − 4 − 5⎥⎥ 4 − 3 − 2⎥ ⎥ 5 − 6 − 1⎦
73
⎡1 ⎢2 B=⎢ ⎢1 ⎢ ⎣2
2 3 4⎤ 3 4 5⎥⎥ . 3 5 7⎥ ⎥ 4 6 8⎦
:
я
⎡1 ⎢2 : A=⎢ ⎢1 ⎢ ⎣1
5)
2
3
3
1
1
1
4⎤ 2⎥⎥ . − 1⎥ ⎥ − 6⎦ 4 8
0 −2
⎡− 6 ⎢− 5 ⎢ : C=⎢ 7 ⎢ ⎢ 2 ⎢⎣ 3
6)
С
7)
λ ⎡4 T = ⎢⎢6 ⎢⎣ 5
( 8)
: detA, А-1, M32, A'.
− 1 6⎤ 1 3⎥ ⎥ 2 4 1 3⎥ . ⎥ 4 8 − 7 6⎥ 2 4 − 5 3⎥⎦ 2 4
.
⎡5 ⎢4 ⎢ A = ⎢3 ⎢ ⎢2 ⎢⎣ 1
Maple
4 3 2 8 6 4 6 9 6 4 6 8 2 3 4
1⎤ 2⎥ ⎥ 3⎥ . ⎥ 4⎥ 5⎥⎦
PА (λ) 2 − 5⎤ 4 − 9⎥⎥ . 3 − 7⎥⎦
0 2⎤ ⎡3 − 4 ⎢4 − 5 − 2 4⎥⎥ . U =⎢ ⎢0 0 3 − 2⎥ ⎢ ⎥ 0 2 − 1⎦ ⎣0
9)
,
А). eT , det( eT ), eT ,
.
,
, .
74
я
Maple
⎡ 1 2 − 3⎤ A = ⎢⎢ 3 2 − 4⎥⎥ , ⎢⎣2 − 1 0⎥⎦
: АХ=В,
10) ⎡ 1 − 3 0⎤ B = ⎢⎢10 2 7⎥⎥ . 7 8⎥⎦ ⎣⎢10
К
1.
.
К Maple?
2. 3.
К
4.
К
5. 6. 7.
К К
8.
К
9.
К
, (2
?
)? Maple
? ? ? . (
)? ,
,
,
10.
?
.К
11. К
? ?
Maple?
12.
? К
? ?
Maple
? 13.
, .
14. 15. К
, ? ?
75
я
Maple
я
VI. 1. 2.
А
. .
§1. А . Maple dsolve(eq,var,options), , var –
eq – , options – , , : type=exact. diff,
, :
y''+y=x diff(y(x),x$2)+y(x)=x. , . Maple _С1, _С2, . .
,
,
. К
,
, ,
. , ( ), ( К
). dsolve . (
, ,
) rhs(%).
76
.
я
Maple За ани 1.1.
1. y'+ycosx=sinxcosx. > restart; > de:=diff(y(x),x)+y(x)*cos(x)=sin(x)*cos(x); ⎞ ⎛ ∂ de:= ⎜ y( x ) ⎟ + y( x ) cos( x ) = sin( x ) cos( x ) x ∂ ⎠ ⎝ > dsolve(de,y(x)); y( x ) = sin( x ) − 1 + e (− sin( x )) _ C 1
,
y( x ) = sin( x ) − 1 + e (− sin( x )) _ C 1. За еча ие: Maple 2. y''−2y'+y=sinx+e−x. > restart; > deq:=diff(y(x),x$2)-2*diff(y(x),x)+y(x) =sin(x)+exp(-x); ⎛ ∂2 ⎞ ⎛ ∂ ⎞ deq:= ⎜ 2 y( x ) ⎟ − 2⎜ y( x ) ⎟ + y( x ) = sin( x ) + e ( − x ) ⎜ ∂x ⎟ ⎝ ∂x ⎠ ⎝ ⎠ > dsolve(deq,y(x)); 1 1 y( x ) = _ C1e x + _ C2e x x + cos( x ) + e ( − x ) 2 4 За еча ие:
_С1.
, ,
Maple
_С1
_С2.
,
– .
3. y''+k2y=sin(qx) : q≠k q=k ( ). > restart; de:=diff(y(x),x$2)+k^2*y(x)=sin(q*x); ⎛ ∂2 ⎞ de:= ⎜ 2 y( x ) ⎟ + k 2 y( x ) = sin( qx ) ⎜ ∂x ⎟ ⎝ ⎠ > dsolve(deq,y(x)); 77
я
Maple
⎛ 1 cos((k + q) x ) 1 cos((k − q) x ) ⎞ ⎟⎟ sin(kx ) ⎜⎜ − + k+q k −q 2 2 ⎠ ⎝ − y( x ) = k ⎛ 1 sin(( k − q) x ) 1 sin(( k + q) x ) ⎞ ⎜⎜ ⎟⎟ cos(kx ) − k−q k+q 2 ⎝2 ⎠ + _ C1 sin(kx ) + _ C2 cos(kx ) k . dsolve q=k. > q:=k: dsolve(de,y(x)); 1 ⎞ ⎛ 1 ⎜ − cos(kx ) sin(kx ) + kx ⎟ cos(kx ) 2 1 cos(kx ) sin(kx ) ⎝ 2 2 ⎠ + − y( x ) = − 2 2 2 k k _ C1 sin(kx ) + _ C2 cos(kx ) За еча ие: , , .
Ф К
я( dsolve
я)
. (
)
. output=basis.
dsolve
За ани 1.2. : y(4)+2y''+y=0. > de:=diff(y(x),x$4)+2*diff(y(x),x$2)+y(x)=0; ⎛ ∂4 ⎞ ⎛ ∂2 ⎞ de:= ⎜ 4 y( x ) ⎟ + 2⎜ 2 y( x ) ⎟ + y ( x ) = 0 ⎜ ∂x ⎟ ⎜ ∂x ⎟ ⎝ ⎠ ⎝ ⎠ > dsolve(de, y(x), output=basis); [cos( x ), sin( x ), x cos( x ), x sin( x )] К
К dsolve ,
.
К .
78
я y''(0)=2 y'(1)=0:
Maple
D ( y )(1) = 0 . , ( D @@ n )( y ) .
D, ( D @@ 2)( y )(0) = 2 ,
, n-
За ани 1.3. К : y(4)+y''=2cosx, y(0)=−2, y'(0)=1, y''(0)=0,
1. y'''(0)=0. > de:=diff(y(x),x$4)+diff(y(x),x$2)=2*cos(x); ⎛ ∂4 ⎞ ⎛ ∂2 ⎞ de := ⎜ 4 y( x ) ⎟ + ⎜ 2 y( x ) ⎟ = 2 cos( x ) ⎜ ∂x ⎟ ⎜ ∂x ⎟ ⎝ ⎠ ⎝ ⎠ > cond:=y(0)=-2, D(y)(0)=1, (D@@2)(y)(0)=0, (D@@3)(y)(0)=0; cond:=y(0)=−2, D(y)(0)=1, (D(2))(y)(0)=0, (D(3))(y)(0)=0 > dsolve({de,cond},y(x)); y(x)=−2cos(x)−xsin(x)+х ⎛π⎞ 2. : y ' ' + y = 2 x − π , y ( 0) = 0 , y ⎜ ⎟ = 0 . ⎝2⎠ . > restart; de:=diff(y(x),x$2)+y(x)=2*x-Pi; ⎞ ⎛ ∂2 de:= ⎜ 2 y( x ) ⎟ + y( x ) = 2 x − π ⎜ ∂x ⎟ ⎠ ⎝ > cond:=y(0)=0,y(Pi/2)=0; ⎛π⎞ cond := y (0) = 0, y ⎜ ⎟ = 0 ⎝2⎠ > dsolve({de,cond},y(x)); y(x)=2x−π+πcos(x) За еча ие: . > y1:=rhs(%):plot(y1,x=-10..20,thickness=2);
79
я
К
Maple
. dsolve
( К ), dsolve({sys},{x(t),y(t),…}), sys , x(t),y(t),… − .
−
:
За ани 1.4. :
⎧ , ⎪⎪ x ′ = −4 x − 2 y + t e −1 ⎨ ⎪ y′ = 6x + 3 y − 3 ⎪⎩ et − 1 > sys:=diff(x(t),t)=-4*x(t)-2*y(t)+2/(exp(t)-1), diff(y(t),t)=6*x(t)+3*y(t)-3/(exp(t)-1): > dsolve({sys},{x(t),y(t)}); 2
{x (t ) = −3 _ C1 + 4C1 _ e ( −t ) − 2C2 _+ 2C2 _ e ( −t ) + 2e ( −t ) ln( e t − 1), y(t ) = 6 _ C1 − 6 _ C1e −t − 3 _ C2e ( −t ) + 4 _ C2 − 3e ( −t ) ln( e ( t ) − 1)} x(t) y(t), _С1 _С2.
я
. .
80
я ,
Maple ,
, . , dsolve type=series ( series). n, . . , , dsolve Order:=n.
,
х
, y(0) . .
D(y)(0)=у2, (D@@2)(y)(0)=у3
D(y)(0), (D@@2)(y)(0) , , х. y(0)=у1, . .,
. series, convert(%,polynom), rhs(%). За ани 1.5.
1.
: y ′ = y + xe y , y (0) = 0 5. > restart; Order:=5: > dsolve({diff(y(x),x)=y(x)+x*exp(y(x)), y(0)=0}, y(x), type=series); 1 1 1 y ( x ) = x 2 + x 3 + x 4 + O( x 5 ) 2 6 6 К
O( x 5 )
5-
,
.
2. y''(х)−y3(х)=е−хcosx,
4: y(0)=1, y'(0)=0. > restart; Order:=4: de:=diff(y(x),x$2)y(x)^3=exp(-x)*cos(x): 81
.
я
Maple
> f:=dsolve(de,y(x),series); 1⎞ ⎛1 f := y( x ) = y(0) + D( y )(0) x + ⎜ y(0) 3 + ⎟ x 2 + 2⎠ ⎝2 1⎞ 3 ⎛1 2 4 ⎜ y(0) D( y )(0) − ⎟ x + O( x ) 6 2 ⎠ ⎝ За еча ие: D(y)(0) : y'(0). : > y(0):=1: D(y)(0):=0:f; 1 y ( x ) = 1 + x 2 − x 3 + O( x 4 ) 6 3. 62 К : y ′′′ − y ′ = 3( 2 − x ) sin x , y (0) = 1 , y ′(0) = 1 , y ′′(0) = 1 . . > restart; Order:=6: > de:=diff(y(x),x$3)-diff(y(x),x)= 3*(2-x^2)*sin(x); ⎞ ⎛ ∂ ⎛ ∂3 ⎞ de:= ⎜ 3 y( x ) ⎟ − ⎜ y( x ) ⎟ = 3( 2 − x 2 ) sin( x ) ⎟ ⎝ ∂x ⎜ ∂x ⎠ ⎠ ⎝ > cond:=y(0)=1, D(y)(0)=1, (D@@2)(y)(0)=1; cond:=y(0)=1, D(y)(0)=1, D(2)(y)(0)=1 > dsolve({de,cond},y(x)); 21 3 7 3 y(x)= cos( x ) − x 2 cos( x ) + 6 x sin( x ) − 12 + e x + e ( − x ) 2 2 4 4 > y1:=rhs(%): > dsolve({de,cond},y(x), series); 1 1 7 4 1 5 y(x)= 1 + x + x 2 + x 3 + x + x + O( x 6 ) 2 6 24 120 За еча ие: series, ( ) convert > convert(%,polynom): y2:=rhs(%): > p1:=plot(y1,x=-3..3,thickness=2,color=black): > p2:=plot(y2,x=-3..3, linestyle=3,thickness=2, color=blue): 82
я
Maple
> with(plots): display(p1,p2);
, −1 restart; with(DЕtools): > DEplot(diff(y(x),x$3)+x*sqrt(abs(diff(y(x),x))) +x^2*y(x)=0, {y(x)}, =-4..5, [[y(0)=0,D(y)(0)=1, (D@@2)(y)(0)=1]], stepsize=.1, linecolor=black, thickness=2);
. DEplot , . DEplot (x, y), dx dy = f ( x, y , t ), = g ( x, y, t ) , dt dt scene=[x,y].
:
, 87
я
Maple
. arrows=SMALL, MEDIUM, LARGE, LINE ,
NONE. , :
, DEplots t: [[x(0)=x1, y(0)=y1], y(0)=y2],…, [x(0)=xn, y(0)=yn]]. [t0, x0, y0], , x0 y0 −
t0 −
[x(0)=x2, :
, t0.
phaseportrait(sys, [x,y],x1..x2,[[cond]]), − . Э
, x1..x2 − ,
sys − , [x,y]
, DEtools, .
За ани 2.3. 1.
⎧⎪ x ' = y : ⎨ ⎪⎩ y ' = x − x 3
: х(0)=1, у(0)=0.2; х(0)=0, у(0)=1; х(0)=1, у(0)=0.4; х(0)=1, у(0)=0.75; х(0)=0, у(0)=1.5; х(0)=−0.1, у(0)=0.7. > restart; with(DЕtools): > DEplot({diff(x(t),t)=y, diff(y(t),t)=x-x^3}, [x(t),y(t)], t=0..20, [[0,1,0.2], [0,0,1], [0,1,0.4], [0,1,0.75], [0,0,1.5], [0,-0.1,0.7]], stepsize=0.1, arrows=none, linecolor=black);
88
я
2.
Maple
⎧ x' = y ⎨ ⎩ y ' = sin x
х(0)=1, у(0)=0; х(0)=−1, у(0)=0; х(0)=π, у(0)=1; х(0)=−π, у(0)=1; х(0)=3π, у(0)=0.2; х(0)=3π, у(0)=1; х(0)=3π, у(0)=1.8; х(0)=−2π, у(0)=1;. > restart; with(DЕtools): > sys:=diff(x(t),t)=y, diff(y(t),t)=sin(x): > DEplot({sys},[x(t),y(t)], t=0..4*Pi, [[0,1,0], [0,-1,0], [0,Pi,1], [0,-Pi,1], [0,3*Pi,0.2], [0,3*Pi,1], [0,3*Pi,1.8], [0,-2*Pi,1]], stepsize=0.1, linecolor=black);
3.
⎧ x ' = 3x + y : ⎨ ⎩ y' = y − x
, . 89
я
Maple
> restart; with(DЕtools): > sys:=diff(x(t),t)=3*x+y, diff(y(t),t)=-x+y: > phaseportrait([sys],[x(t),y(t)],t=-10..10, [[0,1,-2], [0,-3,-3], [0,-2,4], [0,5,5], [0,5,-3], [0,-5,2], [0,5,2], [0,-1,2]], x=-30..30,y=-20..20, stepsize=.1, colour=blue,linecolor=black);
К 1.
я.
y ' '−2 y '−3 y = xe
: 4x
sin x
2. : 3. y ' ' ( 0) = 1 4.
y ' ' '+ y ' ' = 1 − 6 x 2 e − x К : y ' ' '− y ' = tgx , y (0) = 3 , y ' (0) = −1 ,
⎧ x ' '+5 x '+2 y '+ y = 0 ⎨ ⎩3x' '+5 x + y '+3 y = 0 х(0)=1, х'(0)=0; у(0)=1.
y ' '+ y = y 2
5. у(0)=2а, у'(0)=а
6-
.
К
6. у(0)=1. 7.
:
К
у'=sin(xy),
: y ' ' = xy '− y 2 , y (0) = 1 , y ' (0) = 2 .
90
я
Maple
. .
у''−xу'+ xу=0, DEplot.
К
8. у(0)=1, у'(0)=−4 9.
[−1.5; 3], ⎧ x ' = 3x − 4 y ⎨ ⎩ y' = x − 2 y , . К
1.
.
К
? .
2. 3.
К
4.
К
? dsolve
,
dsolve
,
? ? К ? ,
5.
, ,
6.
К
7.
К
8.
К
. dsolve
, ?
-
? ?
9.
К
? ?
10. 11.
odeplot
.
91
DEplot?
я
Maple
VII.
: , я я
, 1. 2. 3. 4. 5.
, . .
. . .
§1.
Maple ,
, .
Ч
.
xm$nm),
f(x1,…, xm) diff. : diff(f,x1$n1,x2$n2,…, , $
x1,…, xm – ,
.
,
: diff(f,x,y). За ани 1.1.
1.
∂f ∂x
∂f ∂y
f = arctg
x . y
> f:=arctan(x/y): D> iff(f,x)=simplify(diff(f,x)); x y ∂ arctan = 2 y x + y2 ∂x
> Diff(f,y)=simplify(diff(f,y)); 92
∂2 f ∂x∂y
я
2.
x x ∂ . arctan = − 2 ∂y y x + y2 2-
Maple
x−y . x+ y > restart; f:=(x-y)/(x+y): > Diff(f,x$2)=simplify(diff(f,x$2));
f ( x, y ) =
∂2 x − y y = −4 2 x+ y ( x + y)3 ∂x
> Diff(f,y$2)=simplify(diff(f,y$2));
∂2 x − y x =4 2 x+ y ( x + y)3 ∂y > Diff(f,x,y)=diff(f,x,y);
∂2 x − y x− y =2 . ∂x∂y x + y ( x + y)3
.
extrema(f,{cond},{x,y,…},'s'), ,
cond –
. , s–
f,
, .
,
К
. extrema
, ,
, .
,
subs.
,
,
,
maximize(f,{x1,…,xn},range), minimize(f,{x1,…,xn}, range), ,
93
я
Maple
,
, . , (
)
, ,
simplex, minimize),
maximize ( range
simplex .
. maximize
minimize
. , .
NONNEGATIVE. За ани 1.2.
f ( x, y ) = 2 x 4 + y 4 − x 2 − 2 y 2 . > restart: readlib(extrema): > f:=2*x^4+y^4-x^2-2*y^2: > extrema(f,{},{x,y},'s');s; −9 {0, } 8 −1 1 , y=0}, {x=0, y=1}, {x=0, y=-1}, {{x=0, y=0}, {x= y=0}, {x= 2 2 1 1 −1 −1 , y=1}, {x= , y=-1}} {x= , y=1}, {x= , y=-1}, {x= 2 2 2 2 , , fmax=0 fmin=−9/8, (0,0). . , . > subs([x=1/2,y=1],f); −9 8 > subs([x=1/2,y=0],f);
1.
94
.
я
−1 8
Maple
> subs([x=0,y=1],f); -1 , : fmax=f(0,0)=0
⎛ 1 ⎞ ⎛ 1 ⎞ fmin=f ⎜ ± ,±1⎟ =f ⎜ ± ,m1⎟ =−9/8. 2 2 ⎝ ⎠ ⎝ ⎠
2.
f ( x, y ) = x 2 + 2 xy − 4 x + 8 y x=0, y=0, x=1, y=2. За еча ие: : 0 minimize(f,{x,y},{x=0..1,y=0..2}); -4 , fmax=17 fmin=−4. f(х,у)=xy+yz 3. x2+y2=2, y+z=2, x>0, y>0, z>0. > restart: readlib(extrema): f:=x*y+y*z: > assume(x>0);assume(y>0);assume(z>0); > simplify(extrema(f,{x^2+y^2=2,y+z=2},{x,y,z}, 's')); 3 1 3 1 {min( RootOf(_Z2+4_Z+1)+ , 0), max( RootOf(_Z2+4_Z+1)+ , 2)} 2 2 2 2
simplify, , , convert. > convert(%,radical); ⎛ 5 3 ⎛ 5 3 ⎞ ⎞ 3 , 0 ⎟ , max ⎜ − + 3, 2 ⎟ } {min ⎜ − + ⎝ 2 2 ⎝ 2 2 ⎠ ⎠ > convert(s,radical); {{x~=1,z~=1,y~=1},{x~=-1,z~=1,y~=1}, 1 1 1 5 1 3 ,y~= − ( −2 + 3 )(1 + 3 ) , z~= − 3 }} {x~= − − 2 2 2 2 2
95
я
Maple extrema
,
,
, .
> subs(s[1],f); 2 > subs(s[2],f); 0 > subs(s[3],f):convert(%,radical):simplify(%); 5 3 3 − + 2 2 , : fmax=f(1,1,1)=2 fmin=f(−1,1,1)=0; . 4. f(x,y,z)=−x+2y+3z , x+2y−3z≤4, 5x−6y+7z≤8, 9x+10z≤11, ? > restart: with(simplex): Warning, new definition for maximize Warning, new definition for minimize
> f:=-x+2*y+3*z: > cond:={x+2*y-3*z Int(Int(y^3/(x^2+y^2),x=0..y),y=2..4)= int(int(y^3/(x^2+y^2), x=0..y),y=2..4);
∫ ∫ x 2 + y 2 dx = y
4
dy
2
y3
14 π 3
∫∫ sin( x + 2 y )dxdy
0
2.
D
y = 0, y = x, x + y =
97
π . 2
,
я
Maple
За еча ие:
D π π : D = {( x, y ) : y ≤ x ≤ − y, 0 ≤ y ≤ } 2 2 > restart: with(student): > J:=Doubleint(sin(x+2*y), x=y..Pi/2-y, y=0..Pi/2); J :=
1 1 π π− y 2 2
∫ ∫ sin( x + 2 y)dxdy 0
> J:=value(%);
y
J :=
2 3
∫ ∫ ∫ 1
dy ( 4 + z )dz .
1
2
dx
3.
−1
За еча ие:
x2
0
,
, , . > J:=Tripleint(4+z, y=x^2..1,x=-1..1, z=0..2); J :=
∫ ∫ ∫ 4 + zdydxdz 2 1 1
0 −1x 2
> J:=value(%); J :=
40 3
§3. В
Maple linalg. f(x, y, z) –
, ,
⎛ ∂f ∂f ∂f ⎞ : grad f ( x, y , z ) = ⎜⎜ , , ⎟⎟ . Maple grad ⎝ ∂x ∂y ∂z ⎠ grad(f,[x,y,z],c),
98
я f–
.
Maple
, [x,y,z] –
,
с
(
). Э Maple
. coords=cylindrical, coords=spherical. Δf =
∂2 f
+
∂2 f
+
– f(x, y, z) f(x, y, z)
∂2 f
. ∂x 2 ∂y 2 ∂z 2 laplacian(f,[x,y,z],c). (
F(x, y, z)
–
: divF ( x, y , z ) =
),
, :
∂Fx ∂Fy ∂Fz + + . ∂x ∂y ∂z
Maple diverge(F,[x,y,z],c), F – , [x,y,z] – , . F(x, y, z) ⎡⎛ ∂F ∂F y ⎞ ⎛ ∂Fx ∂Fz ⎞ ⎛ ∂F y ∂Fx ⎞⎤ ⎟⎥ . ⎟, ⎜ : rotF = ⎢⎜⎜ z − − − ⎟, ⎜ ∂y ⎟⎠⎥⎦ ∂x ⎠ ⎜⎝ ∂x ∂z ⎟⎠ ⎝ ∂z ⎢⎣⎝ ∂y curl(F,[x,y,z],c). F(x, y, z) ⎡ ∂Fx ∂F y ∂Fz ⎤ ⎥ ⎢ ∂x ∂x ⎥ ⎢ ∂x F ∂ ∂F ∂Fz ⎥ y J =⎢ x ⎢ ∂y ∂y ∂y ⎥ ⎥ ⎢ ∂F F ∂ ∂Fz ⎥ y ⎢ x ∂z ∂z ⎦⎥ ⎣⎢ ∂z jacobian(F,[x,y,z]).
99
я
Maple
За ани 3. y u( x , y ) = arctg . 1. x grad u ? u(x,y) q=[1,1]. > restart: with(linalg):
grad u( x, y ) . К
Warning, new definition for norm Warning, new definition for trace
> u:=arctan(y/x): g:=simplify(grad(u, [x, y])); ⎡ y x ⎤ , g := ⎢ − 2 2 2 2⎥ ⎣⎢ x + y x + y ⎦⎥ > alpha:=simplify(angle(g, [1, 0])); ⎞ ⎛ ⎟ ⎜ ⎟ ⎜ y α := π − arccos⎜ ⎟ 1 ⎟ ⎜ (x2 + y2 ) 2 2 ⎟ ⎜ x y + ⎠ ⎝ > beta:=simplify(angle(g, [0, 1])); ⎛ ⎞ ⎜ ⎟ ⎜ ⎟ x β := arccos⎜ ⎟ 1 ⎜ (x2 + y2 ) ⎟ 2 2 ⎟ ⎜ + x y ⎝ ⎠ К grad u( x, y ) . , . > simplify(cos(alpha)^2+cos(beta)^2); 1 u q q: ∂u q = ( gradu, e ) , e= − q. q ∂q > q:=vector([1,1]);e:=normalize(q); q:=[1, 1] 1 ⎡1 ⎤ 2⎥ е:= ⎢ 2 , 2 ⎦ ⎣2 > udq:=simplify(dotprod(g,e)); 100
я
Maple 1 2
udq:=
2 (− y + x) x2 + y2
2. F(x, y, z)= [ x 2 yz, xy 2 z, xyz 2 ] . rotF . > F:=vector([x^2*y*z, x*y^2*z, x*y*z^2]); > divF:=diverge(F, [x, y, z]); divF:=6xyz > rotF:=curl(F, [x, y, z]);
3.
4.
divF
rotF := [ xz 2 − xy 2 , x 2 x − xz 2 , y 2 z − x 2 z ] а u=x3+axy2 Δu=0? > u:=x^3+a*x*y^2: > Delta(u):=laplacian(u, [x,y]); Δ(x3+axy2):=6x+2ax > a=solve(%=0,a); a=-3
,
u=
e − kr + e kr , r
r = x2 + y2 + z2
Δu − k 2u = 0 , k −
. > u:=(exp(-k*r)+exp(k*r))/r: > Delta(u):=simplify(laplacian(u, [r, theta, phi], coords=spherical)); ⎛ e ( − kr ) + e ( kr ) ⎞ k 2 e ( −2kr ) + 1 e ( kr ) ⎟ := Δ⎜ ⎜ ⎟ r r ⎝ ⎠ > simplify(%-k^2*u); 0 5. v=[x, y/x]. > v:=vector([x, y/x]): jacobian(v, [x, y]); 0⎤ ⎡ 1 ⎢ y 1⎥ − ⎢ x2 x ⎥ ⎣ ⎦ > det(%); 1 x
(
101
)
я
Maple
§4. я В
я
∑ S (n)
я
.
b
К
n=a
Sum. А n=a..b), expr – , a..b –
sum
: sum(expr, , , n=a
,
n=b.
, infinity.
∏ P( n ) b
А
n=a
product(P(n),n=a..b) Product P(n),n=a..b). За ани 4.1.
1.
N, 1 . : a n= (3n − 2)(3n + 1) > restart: a[n]:=1/((3*n-2)*(3*n+1)); 1 an:= (3n − 2)(3n + 1) > S[N]:=Sum(a[n], n=1..N)=sum(a[n], n=1..N); S N :=
∑ (3n − 2)(3n + 1) = − 3 3N + 1 + 3 N
1
1
1
1
n =1
> S:=limit(rhs(S[N]), N=+infinity); 1 S := 3
∑(−1) n +1 n 2 x n ? ∞
2. К
:
n =1
> Sum((-1)^(n+1)*n^2*x^n, n=1..infinity)= sum((-1)^(n+1)*n^2*x^n, n=1..infinity);
102
я
∑(−1) n +1 n 2 x n = ∞
n =1
∑ ∞
3.
n =0
Maple x ( − x + 1) ( x + 1) 3
.
(1 + x ) n . ( n + 1)n!
> Sum((1+x)^n/((n+1)*n!), n=0..infinity)= sum((1+x)^n/((n+1)*n!), n=0..infinity);
∑ (n + 1)n! = ∞
n =0
(1 + x ) n
e ( x +1) (1 − e ( − x −1) ) x +1
4.
∑Cn4 (1 − x)n . ∞
n =1
> Sum(binomial(n,4)*(1-x)^n, n=1..infinity)= sum(binomial(n,4)*(1-x)^n, n=1..infinity);
∑ ∞
n =1
binomial( n,4)(1 − x ) n =
:
x5
∏ n3 + 1 ∞
5.
(1 − x ) 4
n =2
n3 − 1
> Product((n^3-1)/(n^3+1),n=2..infinity)= product((n^3-1)/(n^3+1), n=2..infinity);
∏ n3 + 1 = 3 . ∞
n =2
n3 − 1
2
я
я
.
f(x)
f ( x ) = C0 + C1 ( x − a ) + C2 ( x − a ) + ... + O ( x ) series(f(x), x=a, n), а– , n – n
. А
taylor(f(x), x=a
f(x)
К series.
. series ,
taylor
103
а
n
,
x=a,
,
n) n-1
я
Maple
, convert(%,polynom). f(x1,…,xn) (x1,…,xn) (a1,…,an) mtaylor(f(x), [x1,…,xn], , readlib(mtaylor).
n n). Э
За ани 4.2.
f ( x) = e − x x + 1
1.
х0=0,
5 . > f(x)=series(exp(-x)*sqrt(x+1), x=0, 5); 1 1 13 3 79 4 f ( x) = 1 − x − x 2 + x − x + O( x 5 ) 2 8 48 384 2. erf ( x ) =
2
π
∫ x
e − t dt 2
0
. > taylor(erf(x),x,8): p:=convert(%,polynom); p := 2
2 x3 1 x5 1 x7 + − π 3 π 5 π 21 π > plot({erf(x),p},x=-2..2,thickness=[2,2], linestyle=[1,3], color=[red,green]); x
−
, .
3. f ( x, y ) = sin( x 2 + y 2 ) (0, 0) 6. > readlib(mtaylor): 104
–
я
Maple
> f=mtaylor(sin(x^2+y^2), [x=0,y=0], 7); 1 1 1 1 f = x2 + y2 − x6 − y2 x4 − y4 x2 − y6 6 2 2 6 Ф
я
. . Maple
. . (
), :=
proc,
. , , ( ). local,
. , , . end.
( ): > name:=proc(var1, var2, …) local vloc1, vloc2,…; > expr1; > expr2; …………… > exprn; > end; Maple , . . [x1, x2] 2lf(x). : f ( x) = l=(x2−x1)/2;
a0 + 2
∑ ∞
k =1
a k cos
105
kπx + l
∑bk sin ∞
k =1
kπx , l
a0 =
1 l
∫
x2
я f ( x )dx ; ak =
x1
1 l
∫
Maple
x2
f ( x ) cos
x1
1 kπx dx ; bk = l l
∫ f ( x) sin
x2
x1
kπx dx . l
n : > fourierseries:=proc(f,x,x1,x2,n) local k, l, a, b, s; > l:=(x2-x1)/2; > a[0]:=int(f,x=x1..x2)/l; > a[k]:=int(f*cos(k*Pi*x/l),x=x1..x2)/l; > b[k]:=int(f*sin(k*Pi*x/l),x=x1..x2)/l; > s:=a[0]/2+sum(a[k]*cos(k*Pi*x/l)+ b[k]*sin(k*Pi*x/l), k=1..n); > end; : fourierseries(f,x,x1,x2,n), f– , х – х1, x2 – , n –
, , .
За ани 4.3.
1. [0; 2π],
f(x)=x/2 .
6 n-
2π . fourierseries,
. > f:=x/2:x1:=0:x2:=2*Pi: > fr:=fourierseries(f,x,x1,x2,6); 1 1 1 1 1 1 fr := π − sin( x ) − sin( 2 x ) − sin(3x ) − sin(4 x ) − sin(5 x ) − sin(6 x ) 6 5 4 3 2 2 > plot({fr,f}, x=x1..x2, color=[blue,black], thickness=2, linestyle=[3,1]]);
106
я
,
Maple
–
. f ( x) =
π − 2
∑ ∞
k =1
nn: sin kx . k
f ( x) = e − x
2. 2π
[π;−π],
2, 4
8
.
n. > f:=exp(-x);x1:=-Pi;x2:=Pi: > fr1:=fourierseries(f,x,x1,x2,2): > fr2:=fourierseries(f,x,x1,x2,4): > fr3:=fourierseries(f,x,x1,x2,8): > plot({f,fr1,fr2,fr3},x=x1..x2,color=[black, blue, green, red], thickness=2, linestyle= [1,3,2,2]);
, n-
. , .
107
,
–
я
Maple
§5. И
я inttrans,
Maple
. Ф
.
f(x) F (k ) =
x−
Maple fourier(f(x),x,k), , k −
∫ f ( x )e
∞
−∞
− ikx
dx .
, ,
. f ( x) =
1 2π
∫ F ( k )e
∞
ikx
−∞
dk
invfourier(F(k),k,x).
f(x)
, f(x)
.
х>0,
-
-
. F (k ) =
А
2 π
∫
f(x)
∞
f ( x ) sin kxdx
0
f ( x) =
2 π
∫ F (k ) sin kxdk .
∞
−∞
x k, Maple , : fouriersin(f(x),x,k) − ; fouriersin(F(k),k,x) − . , f(x)
108
-
F (k ) =
2 π
∫
я
Maple
∞
f ( x ) cos kxdx
f ( x) =
0
2 π
∫ F (k ) cos kxdk .
∞
−∞
Maple
,
fourierсоs(f(x),x,k) − ; fourierсоs(F(k),k,x) − .
1.
2.
−a x
За ани 5.1.
f ( x) = e , a>0 > restart:with(inttrans): assume(a>0): > fourier(exp(-a*abs(x)),x,k); a~ 2 2 k + a ~2 1 F (k ) = 2 , a>0 k − a2 . > invfourier(1/(k^2-a^2),k,x); −
: -
.
1 I ( Heaviside( x ) − Heaviside( − x ))( −e ( Ia ~ x ) + e ( − Ia ~ x ) ) 4 a~
(
. ⎧1, x > 0 Heaviside(x)= ⎨ ⎩0, x < 0
№1). :
convert(%,trig). > convert(%,trig); 1 ( Heaviside( x ) − Heaviside( − x )) sin( a ~ x ) − 2 a~
3.
f ( x ) = e − ax sin bx , a>0 . > f:=exp(-a*x)*sin(b*x): > fouriercos(f,x,k);
109
-
-
я
Maple
⎛1 ⎞ k +b b−k 1 ⎟ + 2⎜ ⎜ 2 a ~ 2 + ( k + b) 2 2 a ~ 2 + (b − k ) 2 ⎟ ⎝ ⎠ π > fouriercos(f,x,k); ⎛ ⎞ 1 1 ⎟ − 2a ~ ⎜ 2 2 2 2⎟ ⎜ + − + + a b k a k b ~ ( ) ~ ( ) 1 ⎝ ⎠ 2 π
.
f(x) ( : F ( p) =
∫ f ( x )e
∞
− px
)
dx .
0
F(p)
.
x−
Maple laplace(f(x),x,p) , , p −
, ,
. ( : f ( x) =
f(x) ( F(p)
1.
2.
1 2πi
∫ F ( p )e
a + i∞
) px
a − i∞
dp .
) invlaplace(F(p),p,x).
За ани 5.2. f ( x ) = cos axshbx . > restart:with(inttrans): > F(p)=laplace(cos(a*x)*sinh(b*x), x, p); p−b p+b 1 1 F ( p) = − . 2 2 2 ( p − b) + a 2 ( p + b) 2 + a 2 F ( p) =
1
, a>0. p + 2ap > assume(a>0): invlaplace(1/(p^2+2*a*p),p,x): 110
2
я
Maple
> combine(%,trig);
1 1 − e ( −2a ~ x ) . 2 a~
К
1.
я. x+ y . 1 − xy
2–
f ( x, y ) = arctg
2.
f ( x, y , z ) = y 2 + 4 z 2 − 4 yz − 2 xz − 2 xy , 3. ,
2 x 2 + 3 y 2 + 6z 2 = 1
f ( x, y , z ) = x + y + z
,
x+y≤2, z≤1.
∫ dx ∫
4.
e −1 0
∫
:
x + y +e
e − x −1
dy
0
f = xy − z . 1-
e
ln( z − x − y )dz . ( x − e)( x + y − e)
2
5.
gradf
f .
6.
Oz Ω = [0,0, ω] . V = [ Ω, r ] ; w − . а, b с
,
divV , rotV , divw, V − , , w = [ Ω, V ] ; r=[x,y,z] – 7. ω u = cos( ax + by − ωt )
1 ∂ 2u Δu = 2 2 ? c ∂t
8.
1 r
, ,
9.
ln
1 – ρ
F = ( r cos ϕ sin θ, r sin ϕ sin θ, r cos θ).
111
. -
я
Maple
∑ n(n + 1)(n + 2) ∞
10.
1
N
n =1
11.
∑ n(n + 1) x n . ∞
,
n =1
12.
f(x)=arcsinx .
x=0
f ( x, y ) = arctg
13.
14. [0;4],
6 n-
f(x)= e
15. 16. : sin t 1 − cos 2t − 3t а) ; ) e . t t
f ( x) =
− ax 2
F ( p) =
17. .
∫
∞ 0
9-
x− y 1 + xy
6–
⎧6, 0 < x < 2 f ( x) = ⎨ ⎩3x, 2 ≤ x < 4 .
(0, 0).
18.
.
1 − cos xt x2
4 .
, a>0.
1
( p − 1) ( p 2 + 1) 2
dx ,
. К
1. 2.
К
,
.
Maple ?
3.
. . simplex?
maximize minimize minimize?
maximize
112
я
Maple f(x)? К
4.
8.
Maple? К К К ? К
9.
К
5. 6. 7.
-
?
Maple?
Maple .
? Maple? .
я 1. 2. 3. 4. 5. 6. 7. 8.
К .:
9.
. . Maple 6: . .: , 2001. . . Maple V R3/R4/R5. .: , 1998. . . Maple V Power Edition. .: , 1998. . ., . . Maple V. . .: , 1997. . ., .А., К . . Maple V. .: , 1997. . ., . . Э . .: . 1989. . ., . . . .: . 1989. . ., . . . . . . , 1989. .А., Э. . А . .: .
1970. 10. 11.
.А.,
1991. 12. Э .
. .К .Э. .: Э
Э. .
.
, 2000.
113
.:
. 1970. (2 .). .:
.
я
Maple
А И I.
§1. §2. А §3. §4. II. Ф §1. §2. §3. §4. III. §1. §2. IV. §1. §2. §3. §4. V. §1. §2. §3. §4. VI. §1. А §2. VII. §1. §2. §3.
ВИ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Maple. А , , .Э я . . . . . . .. . . . . . . . . Maple. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . , Maple.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ................. ............... Maple. я. .................................. . ............. ................................... .................................... .................................... ................................. .................................... .А ......................... : ....... ................................... ................................... ................................. ....................................... я ..................................... ..................................... .................................. ........................... . ....... я. . . . . . . . . . . . . . . . . . . . . . . . . ...... .......... : , , я , я. . . . . . ..... ......................................
114
3
4 4 6 8 10 15 15 19 21 24 27 27 33 40 40 42 43 53 60 60 62 68 71 76 76 83 92 92 96 98
я
§4. §5.
Maple
................................... ........................... я ................................ А И ..........................................
115
102 108 113 114