# Solve gives an incorrect answer

Cond11[B_, A_, En_] := 4 + 2 Sqrt[1 + 4 B] - A^2/(2 (-En)^(3/2))

Cond22[B_, A_, En_] := 2 - (A^2 (3 + 2 Sqrt[1 + 4 B]))/(2 (-En)^(3/2))

Solve[{Cond11[B, A, En] == 0, Cond22[B, A, En] == 0}, {B, En}]


Putting the result back into Cond11 or Cond22 does not yield zero.

What is the problem?

From the documentation:

• Solve uses non-equivalent transformations to find solutions of transcendental equations and hence it may not find some solutions and may not establish exact conditions on the validity of the solutions found.

• With Method->Reduce, Solve uses only equivalent transformations and finds all solutions.

So, the non-equivalent transformations used by Solve are introducing spurious solutions. To avoid this:

Solve[{Cond11[B, A, En] == 0, Cond22[B, A, En] == 0}, {B, En}, Method->Reduce]


{}

showing that your equations have no solutions.

• How about the result of NSolve in my answer? Aug 16, 2018 at 18:55
• @ user64494 NSolve is basically just invoking Solve in this case. Aug 17, 2018 at 0:49
• @Daniel Lichtblau: If you execute the codes of OP and me, you will see quite different results. Can you base your claim? Aug 17, 2018 at 5:05
• @user64494 I checked by tracking it in a debugging kernel. The difference in results is probably due to an intermediate result factoring in the exact case, at the Roots step. Aug 17, 2018 at 15:04

Making use of NSolve instead of Solve, one obtains

Cond11[B_, A_, En_] := 4 + 2 Sqrt[1 + 4 B] - A^2/(2 (-En)^(3/2));
Cond22[B_, A_, En_] := 2 - (A^2 (3 + 2 Sqrt[1 + 4 B]))/(2 (-En)^(3/2));
NSolve[{Cond11[B, A, En] == 0, Cond22[B, A, En] == 0}, {B, En}]


{{B -> 0.875 - ( 0.21875 A^2 Sqrt[-1. Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 1]])/Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 1]^2, En -> Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 1]}, {B -> 0.875 - ( 0.21875 A^2 Sqrt[-1. Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 2]])/Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 2]^2, En -> Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 2]}, {B -> 0.875 - ( 0.21875 A^2 Sqrt[-1. Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 3]])/Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 3]^2, En -> Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 3]}, {B -> 0.875 - ( 0.21875 A^2 Sqrt[-1. Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 4]])/Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 4]^2, En -> Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 4]}, {B -> 0.875 - ( 0.21875 A^2 Sqrt[-1. Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 5]])/Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 5]^2, En -> Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 5]}, {B -> 0.875 - ( 0.21875 A^2 Sqrt[-1. Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 6]])/Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 6]^2, En -> Root[1. A^8 + 20. A^4 #1^3 + 64. #1^6 &, 6]}}

FindRoot[{Cond11[B, A, En] == 0, Cond22[B, A, En] == 0} /. A -> 1, {{B, 1}, {En, 1}}]

• It doesn't appear that the result of NSolve or FindRoot is close to a zero of the conditions, for any value of A. (Plug into the functions.) Aug 16, 2018 at 20:48
• FindRoot gives an error/warning, so I wouldn't call that a bug. But I expect more from NSolve, which gives no error; I agree that's a bug. Aug 16, 2018 at 23:36
• Obviously not for all values of A, just a few thousand, like this {Cond11[B, A, En], Cond22[B, A, En]} /. A -> # /. FindRoot[{Cond11[B, A, En] == 0, Cond22[B, A, En] == 0} /. A -> #, {{B, 1 + 0. I}, {En, 1}}] & /@ RandomComplex[1/10 {-5 - 5 I, 5 + 5 I}, 1000] // Chop[#, 1*^-3] & // Unitize // Flatten // DeleteDuplicates // Quiet, with different domains for RandomComplex. It seems to me that the result of Reduce[{Cond11[B, A, En] == 0, Cond22[B, A, En] == 0}] indicates one should consider why there is no solution. Aug 17, 2018 at 11:25