NSolve missing solutions in Mathematica 10

Running Mathematica 8.0.4 and 10.0.0 on a Windows 8.1 machine. Processed the same code with both kernels:

k = .2; NSolve[Rationalize[2 r^2 - .2 r^(k + 2) - 1 == 0], r, Reals]

The version 8 kernel returns two values as expected:

{{r -> 0.742979}, {r -> 100000.}}

The version 10 kernel returns only the first value by default. The second value doesn't appear as a solution until setting WorkingPrecision to at least 28.

The same behavior occurs for other values of k: the version 10 kernel needs massaging to return values the version 8 kernel finds by default. What would cause this?

• Win7,10.0.0,give two solutions,0.742979 and 100000. Jul 20 '14 at 6:01
• 100000 is not a solution. You are experiencing numerical issues. Jul 20 '14 at 12:20
• This is closely related: Issue with NSolve Jul 20 '14 at 15:44
• When using VerifySolutions -> False, it gives three, one wrong. Jul 20 '14 at 16:56
• @Chenminqi did you get this result with a default installation or have you made configuration changes that would affect precision? Jul 21 '14 at 19:10

The equation is numerically unstable. The second root is not valid at machine precision so is rejected. Higher precision is required to arrive at a valid second root. Use Solve to see exact solutions as root objects. Then use higher precision when converting root objects to numbers.

k = .2;
eqn = Rationalize[2 r^2 - .2 r^(k + 2) - 1 == 0];
sol = Solve[eqn, r, Reals]


{{r -> Root[5 - 10 #1^10 + #1^11 &, 2]^5}, {r -> Root[5 - 10 #1^10 + #1^11 &, 3]^5}}

eqn /. sol // FullSimplify


{True, True}

soln = sol // N[#, 30] &


{{r -> 0.742978680869997548585535979527}, {r -> 99999.9999749999999899999999927}}

eqn /. soln


{True, True}

eqn[[1]] /. soln


{0.*10^-30, 0.*10^-20}

• \$MachinePrecision has the same default value for both versions. If it is a matter of rejecting a solution at machine precision, then why doesn't that occur in version 8? I've also verified that the current version 9 CDF Player does not reject the second solution at default machine precision. The question remains as to why version 10 is behaving differently. Jul 21 '14 at 19:14
• I don't know but in both V8 and V10 the VerifySolutuons option for Solve default is Automatic (presumably neither always True nor always False). Perhaps the "automatic" setting for V10 checked whereas V8 didn't. Jul 21 '14 at 20:06
• Correction to above since you used NSolve. In V8 NSolve does not have a VerifySolutions option whereas in V10 it does. In V10 VerifySolutuons option for NSolve default is Automatic. Presumably it decided to check. Jul 21 '14 at 20:17

Wolfram support has confirmed to me that there is a known problem with NSolve in version 10. Hopefully it will be fixed soon.