On Wednesday, January 4, 2017 at 6:25:02 PM UTC+2, [email protected] wrote:
>
> 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))
>

The resultant is used to eliminate one variable which has to be given as an 
argument. So this is what you want:

       resultant(p, q.subs(x, z - x), 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!
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/9ec4e9a4-829e-47cb-aaf2-29f990ca87c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to