
-- Input for page PolynomialSingleRootPage
)clear all

a := rootOf(a**4+1,a)
definingPolynomial a
b := rootOf(b**2-a-1,b)
a + b
% ** 5
rootOf(c**2+c+1,c)
zeroOf(d**2+d+1,d)
rootOf(e**5-2,e)
zeroOf(f**5-2,f)

-- Input for page PolynomialGCDPage
)clear all

p := 3*x**8 + 2*x**7 + 6*x**2 + 7*x + 2
q := 2*x**13 + 9*x**7 + 2*x**6 + 10*x + 5
gcd(p,q)
resultant(p,q,x)

-- Input for page PolynomialSubstitutionPage
)clear all

p := x**2 + y**2
eval(p,x=5)
eval(p,[x = a + b,y = c + d])
q := x**3 + 5*x - y**4
eval(q,[x=y,y=x])
px := eval(p, y = sin(2.0))
eval(px, x = cos(2.0))

-- Input for page PolynomialFactorizationPage
)clear all

factor(x**3 - 3*x + 2)
factor(x**2/4 + x*y + y**2)
p := x**3 + x*y + 2*x**2*y**2 + 2*y**3 + 3*x**2*z + 6*x*y**2*z
factors := factor p
nthFactor(factors,1)
nthFactor(factors,2)

-- Input for page PolynomialBasicPage
)clear all

p := a*x**2 + b*x*y + c*y**2
q := 13*x**2 + 3*z
p + q
p - 3*q
p**2 + p*q
r := (p + q)**2
setVariableOrder [a,b,c,x,y,z]
p
q
r
resetVariableOrder()
p
coefficient(q,x,2)
coefficient(r,x,3)
c := coefficient(r,z,1)
coefficient(c,x,2)
coefficient(q**2, [x,z], [2,1])
coefficient(r, [x,y], [2,2])

-- Input for page PolynomialRootsPage
)clear all

l := rootsOf(x**4+1,x)
x0**5
definingPolynomial x0
definingPolynomial x1
definingPolynomial x2
x3 := last l
x0 + x1 + x2 + x3
x0 * x1 * x2 * x3
zerosOf(y**4+1,y)
definingPolynomial y1
