Ask Your Question
3

Real Solution of x^3+8 == 0?

asked 2011-10-18 15:07:48 +0100

amalea gravatar image

updated 2011-10-18 16:40:33 +0100

Jason Grout gravatar image

I do not understand the following:

sage: assume(x,'real')
sage: solve(x^3+8==0,x)
[]

Why does this equation have no solution? But -2 is a solution!

Thanks for help!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2011-10-18 16:45:12 +0100

kcrisman gravatar image

I think this is because (-1)^(1/3) is not considered to be real.

sage: solve(x^3+1==0,x)
[x == 1/2*I*(-1)^(1/3)*sqrt(3) - 1/2*(-1)^(1/3), x == -1/2*I*(-1)^(1/3)*sqrt(3) - 1/2*(-1)^(1/3), x == (-1)^(1/3)]
sage: assume(x,'real')
sage: solve(x^3+1==0,x)
[]

Note that Maxima (which does our solving) doesn't actually care about x being real, since it's a dummy variable.

(%i1) declare(x,real);
(%o1)                                done
(%i2) solve(x^3+1=0,x);
                     sqrt(3) %i - 1      sqrt(3) %i + 1
(%o2)         [x = - --------------, x = --------------, x = - 1]
                           2                   2

But when it's returned to Sage, somehow it doesn't keeps the x=-1 syntax and gets the cube root again, and it falls prey to

sage: (-1)^(1/3).n()
0.500000000000000 + 0.866025403784439*I
edit flag offensive delete link more

Comments

kcrisman gravatar imagekcrisman ( 2011-10-18 16:47:48 +0100 )edit
1

answered 2013-12-11 10:09:44 +0100

John Cremona gravatar image

An alternative approach is not to use the symbolic ring but a polynomial ring:

sage: x = polygen(RR)
sage: (x^3+8).roots()
[(-2.00000000000000, 1)]

This returns a list of roots in RR with multiplcities.

edit flag offensive delete link more

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: 2011-10-18 15:07:48 +0100

Seen: 2,857 times

Last updated: Dec 11 '13