## #884 solve(x^(5/2)+1,x) produces incorrect roots

open
nobody
5
2006-09-08
2006-03-17
Raymond Toy
No

Consider:

(%i16) display2d:false;

(%o16) false
(%i17) solve(x^(5/2)+1,x);

(%o17) [x = %e^(4*%i*%pi/5),x = %e^-(2*%i*%pi/5),x =
%e^(2*%i*%pi/5),
x = %e^-(4*%i*%pi/5),sqrt(x) = -1]
(%i18) map(lambda([u],rhs(u)^(5/2)+1),%);

(%o18) [2,0,0,2,%i+1]

Clearly some of the roots are wrong.

## Discussion

• Raymond Toy
2006-05-15

Logged In: YES
user_id=28849

This fails because solvespec and solvespec1 (src/solve.lisp)
tries to solve y^5+1 = 0 and then x^(1/2) = y, and assumes
all the roots are actually roots.

More care is needed. This is complicated because solvespec1
calls solve to find the roots, which saves them on the
global variable, so we need to examine the global vars to
find our roots.

• Robert Dodier
2006-08-15

• labels: --> 460522

• Robert Dodier
2006-09-08

• labels: 460522 --> Lisp Core - Solving equations

• Dan Gildea
2007-12-03

Logged In: YES
user_id=1797506
Originator: NO

What should the answer be?

The answer returned by maxima doesn't seem so bad if you're
careful about which square root you choose.

(%i2) solve(x^(5/2)+1,x);
(%o2) [x = %e^(4*%i*%pi/5),x = %e^-(2*%i*%pi/5),x = %e^(2*%i*%pi/5),
x = %e^-(4*%i*%pi/5),sqrt(x) = -1]
(%i3) (%e^(4*%i*%pi/5))^(5/2) + 1;
(%o3) 2
(%i4) ((%e^(4*%i*%pi/5))^(1/2))^5 + 1;
(%o4) 2
(%i5) (-(%e^(4*%i*%pi/5))^(1/2))^5 + 1;
(%o5) 0