Ask Your Question
1

Sage give only three of five roots of simple equation

asked 2018-06-18 10:02:55 -0500

frederico firmo gravatar image

updated 2018-06-18 18:03:39 -0500

The equation below

 f=-32/59049*r^6 + 32/2187*r^5 - 32/243*r^4 + 352/729*r^3 - 56/81*r^2 +
8/27*r

solve(f,r)

[r=−3*sqrt(3)/2+9,r=3*sqrt(3)/2+9,r=0]
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2018-06-18 13:39:23 -0500

Emmanuel Charpentier gravatar image

updated 2018-06-18 15:35:42 -0500

WorksForMe(TM) :

sage: var("t")
t
sage: f=-32/59049*t^6 + 32/2187*t^5 - 32/243*t^4 + 352/729*t^3 - 56/81*t^2 + 8/27*t
sage: S=solve(f,t)
sage: len(S)
6
sage: S
[t == -1/2*(27/4*I*sqrt(29) + 135/4)^(1/3)*(I*sqrt(3) + 1) - 27/4*(-I*sqrt(3) + 1)/(27/4*I*sqrt(29) + 135/4)^(1/3) + 6, t == -1/2*(27/4*I*sqrt(29) + 135/4)^(1/3)*(-I*sqrt(3) + 1) - 27/4*(I*sqrt(3) + 1)/(27/4*I*sqrt(29) + 135/4)^(1/3) + 6, t == (27/4*I*sqrt(29) + 135/4)^(1/3) + 27/2/(27/4*I*sqrt(29) + 135/4)^(1/3) + 6, t == -3/2*sqrt(3) + 9/2, t == 3/2*sqrt(3) + 9/2, t == 0]

A lil' check :

sage: [f.subs(t==s.rhs()).expand().simplify_full() for s in S]
[0, 0, 0, 0, 0, 0]

Which Sage version do you use ?

edit flag offensive delete link more

Comments

Thanks a lot. My sage version is 8.0 . But it is quiet strange because I tried once more, using the same lines but now it works. The other roots that "did not appear" in the first time came desguised as complex but are indeed real, as the plot of the function shows, and also a simple command float gives. I really don''t know why

frederico firmo gravatar imagefrederico firmo ( 2018-06-18 18:23:54 -0500 )edit

Maybe you tried to work in the ring of polynomials in s with rational coefficients ? And forgot about it ?

That kind of oversight is extremely easy to commit. This is a good reason to use something allowing you to "forget and start over", such as a Jupyter notebook or emacs' sage-mode...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2018-06-19 00:23:01 -0500 )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

Stats

Asked: 2018-06-18 10:02:55 -0500

Seen: 37 times

Last updated: Jun 18