ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 09 Sep 2014 02:46:24 +0200How would I Factor Polynomials over complex numbers?https://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?Sun, 31 Aug 2014 05:20:48 +0200https://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>
https://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 07:56:47 +0200https://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>
https://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...)Tue, 09 Sep 2014 02:46:24 +0200https://ask.sagemath.org/question/24010/how-would-i-factor-polynomials-over-complex-numbers/?comment=24065#post-id-24065