ギリシア文字の使い方

eq:=cos(`α`+`β`);
print(expand(eq));

cos(`α` + `β`)
cos(`α`)*cos(`β`) - sin(`α`)*sin(`β`)

Symbolを使うと楽です

ga:=Symbol::alpha;
gb:=Symbol::beta;
eq:=cos(ga+gb);
expand(eq);

`α`
`β`
cos(`α` + `β`)
cos(`α`)*cos(`β`) - sin(`α`)*sin(`β`)

πは大文字で定義済みです

cos(pi);
cos(PI);
print(hold(cos(PI)));
DIGITS:=20;
float(PI);

cos(pi)
-1
cos(PI)
20
3.1415926535897932385

球座標の微分を試みます。

まずは定義とlinalgライブラリの読み込みから

gph:=Symbol::phi;
gth:=Symbol::theta;
use(linalg);
F:=f(r,gph,gth);
A:=matrix([a[r](r,gph,gth),a[gph](r,gph,gth),a[gth](r,gph,gth)]);

`φ`
`θ`
Warning: Identifier 'laplacian' already has a value. It is not exported. [use]
Warning: Identifier 'hessian' already has a value. It is not exported. [use]
Warning: Identifier 'htranspose' already has a value. It is not exported. [use]
Warning: Identifier 'potential' already has a value. It is not exported. [use]
Warning: Identifier 'jacobian' already has a value. It is not exported. [use]
Warning: Identifier 'vectorPotential' already has a value. It is not exported. [use]
Warning: Identifier 'curl' already has a value. It is not exported. [use]
Warning: Identifier 'gradient' already has a value. It is not exported. [use]
Warning: Identifier 'transpose' already has a value. It is not exported. [use]
Warning: Identifier 'det' already has a value. It is not exported. [use]
Warning: Identifier 'divergence' already has a value. It is not exported. [use]
f(r, `φ`, `θ`)
matrix([[a[r](r, `φ`, `θ`)], [a[`φ`](r, `φ`, `θ`)], [a[`θ`](r, `φ`, `θ`)]])

勾配・発散・回転・ラプラシアンの計算

rule1:=[f(r,ghi,gth)=f,a[r](r,gph,gth)=a[r]]:
rule2:=[a[gph](r,gph,gth)=a[gph],a[gth](r,gph,gth)=a[gth]]:
rule:=[op(rule1),op(rule2)]:
E1:=grad(F,[r,gph,gth],Spherical):subs(E1,rule);
E2:=divergence(A,[r,gph,gth],Spherical):subs(E2,rule);
E3:=curl(A,[r,gph,gth],Spherical):subs(E3,rule);
E4:=laplacian(F,[r,gph,gth],Spherical):subs(E4,rule);

matrix([[diff(f(r, `φ`, `θ`), r)], [diff(f(r, `φ`, `θ`), `φ`)/(r*sin(`θ`))], [diff(f(r, `φ`, `θ`), `θ`)/r]])
diff(a[r], r) + (2*a[r])/r + diff(a[`θ`], `θ`)/r + diff(a[`φ`], `φ`)/(r*sin(`θ`)) + (cos(`θ`)*a[`θ`])/(r*sin(`θ`))
matrix([[-(- r*diff(a[`θ`], `φ`) + r*sin(`θ`)*diff(a[`φ`], `θ`) + r*cos(`θ`)*a[`φ`])/(r^2*sin(`θ`))], [-(- diff(a[r], `θ`) + r*diff(a[`θ`], r) + a[`θ`])/r], [(- diff(a[r], `φ`) + r*sin(`θ`)*diff(a[`φ`], r) + sin(`θ`)*a[`φ`])/(r*sin(`θ`))]])
(diff(f(r, `φ`, `θ`), `φ`, `φ`) + sin(`θ`)^2*diff(f(r, `φ`, `θ`), `θ`, `θ`) + cos(`θ`)*sin(`θ`)*diff(f(r, `φ`, `θ`), `θ`) + r^2*sin(`θ`)^2*diff(f(r, `φ`, `θ`), r, r) + 2*r*sin(`θ`)^2*diff(f(r, `φ`, `θ`), r))/(r^2*sin(`θ`)^2)