Ask Your Question
2

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

asked 2016-11-02 06:47:32 +0100

Sha gravatar image

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

edit retag flag offensive close merge delete

Comments

Note that we write Sage rather than SAGE.

slelievre gravatar imageslelievre ( 2016-11-02 16:56:35 +0100 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2016-11-02 07:22:36 +0100

rtc gravatar image

updated 2016-11-02 07:46:04 +0100

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)$$

edit flag offensive delete link more

Comments

yes this is what I am looking for.. thank you..

Sha gravatar imageSha ( 2016-11-02 09:07:24 +0100 )edit
1

answered 2016-11-03 11:32:30 +0100

slelievre gravatar image

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
edit flag offensive delete link more

Comments

Thank you for explaining this to me. It is so useful in my calculation.

Sha gravatar imageSha ( 2016-11-03 11:50:38 +0100 )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

1 follower

Stats

Asked: 2016-11-02 06:47:32 +0100

Seen: 459 times

Last updated: Nov 03 '16