# factor x^2 - 30*x + 2817 in sqrt(-2)

Is there a way I can use SAGE to factor my polynomial x^2 - 30*x + 2817 in sqrt(-2).

factor x^2 - 30*x + 2817 in sqrt(-2)

Is there a way I can use SAGE to factor my polynomial x^2 - 30*x + 2817 in sqrt(-2).

3

I think you are looking for the roots of the polynomial:

```
f = x^2 - 30*x + 2817
f.roots()
```

which gives:

```
[(-36*I*sqrt(2) + 15, 1), (36*I*sqrt(2) + 15, 1)]
```

This would mean that your original function is equal to:

$$ x^2-30x+2817 = \left(x-(15-36 \sqrt{-2})\right)\left(x-(15+36\sqrt{-2})\right)$$

1

Note that you can also work over the field QQbar of algebraic numbers.

Here is how you would factor your polynomial there and find its roots.

```
sage: P.<x> = QQbar[]
sage: p = x^2 - 30*x + 2817
sage: p.factor()
(x - 15.00000000000000? - 50.91168824543143?*I) * (x - 15.00000000000000? + 50.91168824543143?*I)
sage: p.roots()
[(15.00000000000000? - 50.91168824543143?*I, 1),
(15.00000000000000? + 50.91168824543143?*I, 1)]
```

If you want a radical expression for the roots:

```
sage: for r in p.roots():
....: print(r[0].radical_expression())
....:
-36*I*sqrt(2) + 15
36*I*sqrt(2) + 15
```

Asked: **
2016-11-02 00:47:32 -0600
**

Seen: **110 times**

Last updated: **Nov 03 '16**

Factoring a polynomial over algebraic numbers?

out of core exact linear algebra

How to get the canonical prime factorization, with zero exponents too

Polynomial: find the common factor

Pretty print factorizations as fractions

Factorization of $f \in \mathbb{Q}[X]$ in field extension $\mathbb{Q}(\alpha)$.

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.

Note that we write Sage rather than SAGE.