Use of Scilab in secondary school mathematics [Number] Define numbers a=1 b=2;c=3;d=4;e=5; Simple calculation a+b*c-d/e Elementary functions log(100) sin(%pi/6) 4^2 sqrt(4) 27^(1/3) 3D-4 [Polynomial] Define a polynomial x+1 (1) Direct input x=poly(0,'x') p=x+1 q=2+3*x-4*x^2 x=poly(2,・s・);2*x+1 (2) By coefficients f=poly([1,3,5,-7],'x','coeff') (3) By roots g=poly([1,2,3],'x') Simple computations - Value of polynomial horner(g,4) - Addition - Subtraction - Multiplication f+g f-2*g f*g x=poly(0,・x・);(1+x)^5 Division f/g - Quotient - Reminder [r,q]=pdiv(f,g) checking: q*g+r Solving polynomial equations roots(x^2-5*x-6) p=x^3-4*x^2+5*x-7; roots(p) Factorization polfact(2*x^2-50) G.C.D. and Euclidean Algorithm f=4*x^4-2*x^3-16*x^2+5*x+9; g=2*x^3-x^2-5*x+4; gcd([f,g]) Find polynomials u, v such that u*f + v*g = d d=gcd([f,g]); [w,a]=diophant([f,g],d) checking: w(1,1)*f+w(2,1)*g Find g.c.d. (H.C.F.) among integers v=int32([12,15]); gcd(v) Find l.c.m. (L.C.M.) among integers lcm(v) Partial fraction s=poly(0,・s・); pfss((23*s-11*s^2)/(-2*s^3+s^2+18*s-9)) [Matrix] Define a matrix M=[1 2;3 4] N=[1,2,3;4,5,6] C=[];C(3,2)=1 D=diag([1,2,3]) Simple computations M=[1 2;3 4];N=[5 6;7 8]; M+N M*N M^3 Matrix of polynomials M=[x,2-x;3*x+1,x-3] M^2 Self operations M=[1 2;3 4]; M' det(M) inv(M) checking: inv(M)*M spec(M) Calculus Differentiation x=poly(0,'x'); derivat(x^2/(x-1)) Integration - Define a function first function y=f(x),y=sin(x),endfunction intg(0,%pi,f) Plotting 2D t=linspace(0,2*%pi);y=sin(t);plot(y) 3D clear A=[1 2 2 1 0;2 3 4 6 3;3 2 1 2 2;1 1 2 3 2]; t1=1:4; t2=1:5; plot3d1(t1,t2,A);