# Maple 8 講習班

 2002/12/28 jcchuan@math.nthu.edu.tw 新竹中學

photos

# 基本指令

> 123!;
> evalf(100!);
> evalf(Pi,20);
> simplify(a/b+c/d);
> expand((a+b+c)^2);
> factor(x^12-1);
> factor(x^12-1,3^(1/2));
> factor(x^12-1,I);
> factor(x^12-1,{3^(1/2),I});
> ifactor(2^100+1);
> diff(x^4,x);
> diff(x^4,x\$2);
> int(x^4,x);
> int(x^4*cos(3*x)*exp(2*x),x);
> evalf(int(cos(x^2),x=0..1));
> series(cos(x),x=0,20);
> combine(cos(a)*cos(b));
> expand(cos(a+b));
> combine(cos(a)*cos(b)*cos(c));
> solve(x^2-3*x-7);
> solve({2*x+3=4,3*x-y=1});
> solve({x+y+z=1,2*x+y-3=0},{x,y});
> simplify(1/(1+1/(1+x)));
> sum(k^2,k = 1 .. 20);
> sum(k^2,k = 1 .. n);
> implicitdiff(x^2*y+y^3*x-y,y,x);
> series(x/cos(x^2+x),x = 0,10);
> evalf(exp(Pi*163^(1/2)),30);

# 作圖

## 平面作圖

> plot(sin(x),x=0..2*Pi);
> plot([cos(t),sin(t),t=0..2*Pi],scaling=constrained,axes=none);
> m:=[cos(x),cos(n*x),x=0..Pi];
> plot({m\$n=1..6},axes=none);
> w:=1+cos(t)/2:z:=t/6-sin(2*t)/12:x:=w*cos(z):y:=w*sin(z):
> plot([x,y,t=0..12*Pi],axes=none,scaling=constrained);

> restart;
> m:=[x,binomial(100,k)*x^(100-k)*(1-x)^k,x=0..1]:
> plot({m\$k=0..100},axes=none);

> r:=exp(t);
> m:=64;
> a:=plot([[r*cos(t+2*Pi*k/m),r*sin(t+2*Pi*k/m),t=3..5]\$k=1..m],scaling=constrained,color=red,axes=none):
> b:=plot([[r*cos(t+2*Pi*k/m),-r*sin(t+2*Pi*k/m),t=3..5]\$k=1..m],scaling=constrained,color=blue,axes=none):
> with(plots):
> display(a,b);

> plot(cos(7*t/2)+1/4,t=0..4*Pi,coords=polar,axes=none,scaling=constrained);
> plot(2-cos(3*t)-cos(31*3*t/32),t=0..64*Pi,coords=polar, numpoints=1000,axes=none,scaling=constrained);
> plot(2-cos(7*t)-cos(31*7*t/32),t=0..64*Pi,coords=polar, numpoints=1000,axes=none,scaling=constrained);
> plot(100+t+15*cos(3.05*t), t = 0 .. 200, coords = polar, axes = none,scaling=constrained);
> plot((1+cos(3*t)+sin(3*t)^2), t=0..2*Pi,coords=polar,axes=none,scaling=constrained);

### 線段作圖

> x:=cos(t);
> y:=sin(t);
> m:=[[x,0],[0,y]];
> t:=n*Pi/50;
> plot([m\$n=1..100],color=green,scaling=constrained,axes=none);

> x:=cos(t);
> y:=sin(t);
> m:=[[x,y],[x-y,y+x]];
> t:=n*Pi/50;
> plot([m\$n=1..100],color=red,scaling=constrained,axes=none);

> x:=cos(t);
> y:=sin(t);
> m:=[[x,y],[x-t*y,y+t*x]];
> t:=n*Pi/50;
> plot([m\$n=1..100],color=brown,scaling=constrained,axes=none);

> x:=0.7;
> a:=3.7;
> y:=a*x*(1-x);
> m:=[ ];
> for k to 100 do m:=[op(m),[x,x],[x,y]]: x:=y:y:=a*x*(1-x): od:
> plot(m,scaling=constrained);

> m:=1.7123:x:=0:y:=0:v:=[ [x,y] ]:
>
for k to 100 do xx:=floor(x)+1:yy:=floor(y)+1: if (yy-y)>m*(xx-x) then x:=xx:y:=m*x
else y:=yy:x:=y/m: fi: v:=[op(v),[1-abs(x-2*floor(x/2)-1),1-abs(m*x-2*floor(m*x/2)-1)]] od:

>
plot(v,scaling=constrained);