ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 08 Sep 2014 19:46:24 -0500How would I Factor Polynomials over complex numbers?http://ask.sagemath.org/question/24010/how-would-i-factor-polynomials-over-complex-numbers/ Ok, I was in sage attempting some factoring of polynomials:
x^2-4
gave: (x-2)(x+2)
x^2-2
gave: x^2-2
how would i get this in (x-a)(x+a) for x^2 -a^2 when x,a are complex?Sat, 30 Aug 2014 22:20:48 -0500http://ask.sagemath.org/question/24010/how-would-i-factor-polynomials-over-complex-numbers/Answer by rws for <p>Ok, I was in sage attempting some factoring of polynomials:</p>
<p>x^2-4
gave: (x-2)(x+2)</p>
<p>x^2-2
gave: x^2-2</p>
<p>how would i get this in (x-a)(x+a) for x^2 -a^2 when x,a are complex?</p>
http://ask.sagemath.org/question/24010/how-would-i-factor-polynomials-over-complex-numbers/?answer=24011#post-id-24011Use polynomials over the complex ring CC:
sage: R.<x> = CC[]
sage: p=x^2+2
sage: p.factor()
(x - 1.41421356237310*I) * (x + 1.41421356237310*I)
Sun, 31 Aug 2014 00:56:47 -0500http://ask.sagemath.org/question/24010/how-would-i-factor-polynomials-over-complex-numbers/?answer=24011#post-id-24011Comment by Chernoxyl for <p>Use polynomials over the complex ring CC:</p>
<pre><code>sage: R.<x> = CC[]
sage: p=x^2+2
sage: p.factor()
(x - 1.41421356237310*I) * (x + 1.41421356237310*I)
</code></pre>
http://ask.sagemath.org/question/24010/how-would-i-factor-polynomials-over-complex-numbers/?comment=24065#post-id-24065okay i got what i wanted now how would i get it as symbolic (like sqrt(-2) instead of 1.4142135...)Mon, 08 Sep 2014 19:46:24 -0500http://ask.sagemath.org/question/24010/how-would-i-factor-polynomials-over-complex-numbers/?comment=24065#post-id-24065