Ask Your Question

Factoring a polynomial over algebraic numbers?

asked 2016-01-21 04:12:09 -0600

Alasdair gravatar image

Actually, what I want is to be able to factor a polynomial over the quadratic closure of the rationals, so that I could factor x^2-3 say, as (x+sqrt(3)*(x-sqrt(3)). I don't know enough about factoring algorithms to know whether this is easy or not, but is this at all possible in Sage?

I know I can build an extension field of the rationals by the use of an irreducible quadratic, but that just gives me access to one square root. So if I added sqrt(3) then I could factorize the example above, but not x^2-5. Is it possible to include all square roots - in other words, can Sage work with the the field of constructible numbers?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-01-21 08:33:21 -0600

B r u n o gravatar image

updated 2016-01-22 04:41:37 -0600

Though it is not exactly what you are looking for, an approach may be to work in the so-called Algebraic Real Field which contains the constructible numbers:

sage: AA
Algebraic Real Field
sage: R.<x> = AA[]
sage: p = x^2-3
sage: p.factor()
(x - 1.732050807568878?) * (x + 1.732050807568878?)
sage: q = x^2-5
sage: q.factor()
(x - 2.236067977499790?) * (x + 2.236067977499790?)

Note that even though the printed values contain a limited number of digits, they are internally exactly represented (the ? indicates this fact), and you can for instance compute radical expressions for them like this:

sage: f0 = p.factor()[0][0].constant_coefficient()
sage: f0
sage: f0.radical_expression()

I do not know if it is possible to obtain directly the factorization of p with coefficients expressed as a list of radicals, but you can construct such a representation quite easily (by hand).

edit flag offensive delete link more


As it is explicitely mentioned, the OP wants to work with the set of constructible numbers which is much smaller than the set of algebraic numbers.

vdelecroix gravatar imagevdelecroix ( 2016-01-21 13:22:48 -0600 )edit

Right, I edited my answer. Hope it helps the OP anyway ;-)

B r u n o gravatar imageB r u n o ( 2016-01-22 04:42:12 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2016-01-21 04:12:09 -0600

Seen: 81 times

Last updated: Jan 22 '16