5a: 4;

\5a: 4;

today is thursday: true;

today\ is\ thursday: true;

symbolp(12);
symbolp(\12);
is(12 = \12);

declare(" ", alphabetic);

today is friday: false;

reset();

today is thursday: false;

a[x]: 1;
a[y]: [2, 4];
a[z]: cos(alpha);

arrayinfo(a);

listarray(a);

a[y];

a[w];

listarray(a);

a[w]: "str";
listarray(a);

p: sum((random(1000)-500)*x^i, i, 0, 4) + x^5;

hipow(p, x);

coeff(p, x, 3);

q: rat(p);

q;

ratdisrep(q);

solve(p, x);

realroots(p);

float(%);

allroots(p);

factor(p);

r: subst(alpha, x, p);

factor(p, r);

s: quotient(%, x-alpha);

t: subst(beta, x, %);

factor(s, t);

tellrat(r, t);

quotient(s, x-beta);

ev(subst(beta, x, p), algebraic);

ev(ratdisrep(rat(subst(beta, x, p))), algebraic);

q: expand((alpha+1)^7);

modulus: 7;
ev(ratdisrep(rat(q)), algebraic);

factor(q, r);

factor(p, r);

reset(); kill(all);

p: x^2-2;

factor(p, alpha^2-2);

p: x^2+4;

gfactor(p);

p: sum(c[i]*x^i, i, 0, 5);

dv: x+1;

[q, rest]: divide(p, dv);

testp: q*dv+rest;

expand(testp);

for i: 0 thru 4 do c[i]: random(1000)-500$

listarray(c);

p;

ev(p);

ev(rest);

solve(ev(rest), c[5]);

q: ev(p, %[1]);

divide(q, dv);

gcd(q, dv);

solve(q, x);

realroots(q);

p : sum(sum(sum(a[i, j, k]*x^i*y^j*z^k, i, 0, 2), j, 0, 2), k, 0, 2);

rat(p);

ratvars(x, y, z);

rat(p);

ratvars(z, y, x);

rat(p);

p;

collectterms(p, x);

q: collectterms(p, x, y);

rat(q);

is(p=q);

is(rat(p)=rat(q));

collectterms(p, x, y, z);

p : -14*x^4*y+83*x^2*y^3-96*z^5-97*x^4+86*y^3-95*x^2;

rat(p);

horner(p);

rp: collectterms(p, y);

horner(p, x);

horner(rp, x);

horner(p, y);

horner(rp, y);

is(p=rp);

is(horner(p, y)=horner(rp, y));

p: (a+b+c)*(x^3 + 9*x + 9);

expand(p);

collectterms(%, a, b, c);

p: x^2-2*y^2;

factor(p);

factor(p, alpha^2-2);

p: x^2+y^2;

gfactor(p);

p: x^3-1;

q: x^2-1;

r: p/q;

rat(r);

num(r);

denom(r);

ratnum(r);

ratdenom(r);

ratsimp(r);

ratexpand(r);

r : (-51*x^8+89*x^6+14*x^4-79*x^3-58*x^2-95)/(-2*x^6+86*x^5+57*x^4-35*x^2+57*x+28);

ratsimp(r);

partfrac(r, x);

p: (sin(y))^2-1;

factor(p);

r: ((sin(y))^2-1)/(sin(y)-1);

ratsimp(r);

p : -14*x^4*y+83*x^2*y^3-96*z^5-97*x^4+86*y^3-95*x^2;

q: sublis([x=sin(u),y=cos(u),z=tan(u)], p);

rat(q);

ratvars(sin(u),cos(u),tan(u));

rat(q);

collectterms(q, cos(u));

r: (x+y)^2 + 1/(x+y)^2;

ratsimp(r);

rz: subst(z, x+y, r);

nrz: ratsimp(rz);

nr: subst(x+y, z, nrz);

part(nr, 2, 1);

substpart(x-y, nr, 2, 1);

s: a^2 + b + c;

sublis([a=b, b=c, c=a], s);

subst(c, a^2+b, s);

ratsubst(c, a^2+b, s);

e1: x*(1+sin(y)); 
e2: x + x*sin(y);

is(e1=e2);

is(rat(e1)=rat(e2));

r: [random(10000), random(10000)];
e1r: float(sublis([x=r[1], y=r[2]], e1));
e2r: float(sublis([x=r[1], y=r[2]], e2));

is(e1r=e2r);