I have two algebraic numbers defined by minimal polynomials:
x, z = symbols('x, z')
p = Poly((x-1)*(x-2)*(x-3)*(x-4))
q = Poly((x-5)*(x-6)*(x-7)*(x-8))
and I would like to compute the sum of these numbers. I [found](
http://math.stackexchange.com/a/155132/327863) that I need to "`z=x+y` is a root of the resultant of `P(x)` and `Q(z−x)` (where we take this resultant by regarding `Q` as a polynomial in only `x`)".
I'm totally new to all this algebraic numbers thing so I don't quite understand the advice but I tried:
resultant(p, q.subs(x, z-x))
but then I got stuck. Please, could someone explain to me:
- I would like to see the steps that lead to the computation of desired minimal polynomial with the help of resultant. I think I defined the two numbers properly but I don't know how to express that `Q(z−x)`.
- As it stands now, the `resultant` function returns bivariate polynomial but I would've assumed that the resulting minimal polynomial should be univariate. How do I get rid of the second variable?
- The above link also says "`P(x) = Q(y) = 0`". Does it mean that `p` and `q` can't be both `Poly((x-1)*(x-2)*(x-3)*(x-4))`? What if I would like to add the same two numbers?
Thank you very much in advance!