> with(CurveFitting): > f:=(x-1)*(x+2)^2*(x-1/2); 2 / 1\ f := (x - 1) (x + 2) |x - -| \ 2/ > f:=expand(f); 4 5 3 3 2 f := x + - x - - x - 4 x + 2 2 2 > factor(f); 1 2 - (2 x - 1) (x - 1) (x + 2) 2 > solve(f,x); 1 1, -, -2, -2 2 > g:=x^3-1; 3 g := x - 1 > factor(g); / 2 \ (x - 1) \x + x + 1/ > factors(g); [ [[ 2 ] ]] [1, [[x + x + 1, 1], [x - 1, 1]]] > g1:=factors(g)[2][1][1]; 2 g1 := x + x + 1 > alias(a=RootOf(g1)); a > factor(g1,a); (x - a) (x + 1 + a) > h:=x^5+x^4+x^3+x^2+x+1; 5 4 3 2 h := x + x + x + x + x + 1 > solve(h); 1 1 (1/2) 1 1 (1/2) 1 1 (1/2) 1 1 (1/2) -1, - - + - I 3 , - - - - I 3 , - + - I 3 , - + - I 3 2 2 2 2 2 2 2 2 > factor(h); / 2 \ / 2 \ (x + 1) \x - x + 1/ \x + x + 1/ > factor(h,a); (x - a) (x + 1 + a) (x - 1 - a) (x + a) (x + 1) > > #### Parembolh #### > > f:=PolynomialInterpolation([[0,1],[1,3],[2,2]],x); 3 2 7 f := - - x + - x + 1 2 2 > #### Sxhma tou Shamir #### > > secret:=7; secret := 7 > f:=2*x^2+3*x+secret; 2 f := 2 x + 3 x + 7 > share[1]:=[1,subs(x=1,f)]; share[1] := [1, 12] > share[2]:=[2,subs(x=2,f)]; share[2] := [2, 21] > share[3]:=[3,subs(x=3,f)]; share[3] := [3, 34] > share[4]:=[4,subs(x=4,f)]; share[4] := [4, 51] > PolynomialInterpolation([share[1],share[2],share[3]],x) mod 11; 2 2 x + 3 x + 7