kill(all);

Input terminator ; or $

a;

a$

b;

Special characters %, %pi, %e, %i
and numer

%;

%pi;

%pi, numer;

%e;

%e,numer;

%i;

Assignment operator (:)
to a single element

a;

a:10;

a;

Assignment operator (:)
to an element of a list

b: [3,pippo,3/5];

b[3];

b[3]: puffo;

b;

Assignment operator (:)
multiple assignement

[c, d, e]:[20,pluto,-3/77];

c;

d;

e;

Expression operator (=)

f;

f=5;

f;

Assignment vs Equation operation

eqn1: _a0*x-5*y=17;

eqn2: _a1*x+3+y=29;

eqn1;

eqn2;

A function definition (:=)

expr: (x^3-1)^2;

f(x):=expr;

f(x);

Declaration

assume (xx>0, yy<-1, zz>=0);

assume (equal (ww,0), notequal (qq,1));

Define() vs :=

expr_theta_zeta: cos(theta) - sin(zeta);

define(F1(theta,zeta), expr_theta_zeta);

F1(_a, _b);

F2(theta, zeta):= expr_theta_zeta;

F2(_a, _b);

Evaluation ev(); and numer

expr;

%, numer, x=3/2;

ev(expr,x=3/2);

ev(expr,x=3/2), numer;

Differential

diff(f(x),x,1);

diff_first:%;

diff(f(x),x,2);

diff_sec:%;

Integral

integrate(f(x), x);

integrate(f(x), x, -2, 1);

Factorization - simplification - expantion

expr;

factor(expr);

fullratsimp(expr);

expr2:(g+h)^5;

expand(expr2);

Solution of algebraic system

eqn_1: x+z=y;

eqn_2:2*t*x-y=2*t^2;

eqn_3:y-2*z=2;

linsolve([eqn_1, eqn_2, eqn_3], [x,y,z]);

x;

linsolve([eqn_1, eqn_2, eqn_3], [x,y,z]), globalsolve=true;

x;

kill(x,y);

linsolve([x+3*y=2, 2*x-y=5],[x, y]);

kill(eqn, x, y);

eqn:[4*x^2-y^2=12,x*y-x=2];

solve(eqn, [x,y]);

%[2];

kill(a, x);

solve(1+a*x+x^3, x);

%[1];

kill(all);

plot2d ([sin(x)], [x, -%pi, %pi]);

plot2d ([sin(x), cos(x)], [x, -%pi, %pi])$

plot2d(%e^(3*s), [s, -2, 2], logy)$