On Oct 23, 9:39 pm, andrew ewart <[email protected]> wrote:
> if alpha is a root of x^2+a_1*x+a_0 and beta is a root of x^2+b_1*x
> +b_0 (both polynomials r in QQ), then how do i construct code such
> that it can tell me the minimum polynomials of the following roots
> alpha+beta
> and
> alpha*beta
Hi, I'm not sure if I understood your question, but this might be what
you want:
sage: R.<x> = QQbar[]
sage: p = 1/7*x^2-x+4
sage: q = x^2+x+1/3
sage: p.roots()
[(3.500000000000000? - 3.968626966596886?*I, 1), (3.500000000000000? +
3.968626966596886?*I, 1)]
sage: a = p.roots()[0][0]
sage: b = q.roots()[0][0]
sage: (a+b).minpoly()
x^4 - 12*x^3 + 257/3*x^2 - 298*x + 5503/9
sage: (a*b).minpoly()
x^4 + 7*x^3 + 77/3*x^2 + 196/3*x + 784/9
I hope this helps.
Yann
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org