# Can Mathematica be wrong about the solution of a non-linear system?

I am trying to solve analytically a non-linear system of equations:

Ec1 = A + 2*pvz*Ezmiss - 2*El*Sqrt[Etmiss^2 + Ezmiss^2 + mmiss^2];
Ec2 = B - mmiss^2 + 2*pvz*Ezmiss - 2*Evis*Sqrt[Etmiss^2 + Ezmiss^2 + mmiss^2];
sol = FullSimplify[Solve[Ec1 == 0 && Ec2 == 0, {Ezmiss, mmiss}]]


Mathematica returns four solutions, but I think they are not correct. I have solved the system with SymPy python package and I have also obtained numerical solutions for the system, and both do not coincide with the solution that Mathematica gives me. Am I doing something wrong? Can I simplify things so that Mathematica works better with the system?

• Do you have any assumptions on the free parameters? Are they real numbers? Positive? Often you get better results if you specify constraints like these. Oct 5 '20 at 8:13
• The problem comes from the fact, that MMA does not simplify x-Sqrt[x^2]. First in MMA all variables, unless told otherwise, are assumed to be complex. Second, Sqrt is a double valued function. If you specify x to be real, MMA only simplifies to: x - Abs[x] what may not always be what you want. You may use PowerExpand, it assumes that all variables are real numbers. Oct 5 '20 at 8:27
• For specific sets of parameter values, one or more solutions may work with others being parasites. But which ones work will, typically, depend on the parameter values. Oct 5 '20 at 12:43
• What are the numerical solutions and SymPy solutions you want to obtain in mathematica? Oct 5 '20 at 14:45

First to facilitate things, make mmiss2 = mmiss^2 and then

Ec1 = A + 2*pvz*Ezmiss - 2*El*Sqrt[Etmiss^2 + Ezmiss^2 + mmiss2];
Ec2 = B - mmiss2 + 2*pvz*Ezmiss - 2*Evis*Sqrt[Etmiss^2 + Ezmiss^2 + mmiss2];
sol = Solve[{Ec1 == 0, Ec2 == 0}, {Ezmiss, mmiss2}, Reals]


The solution is conditional because depending on the values for

{A, B, El, Etmiss, Evis, pvz}


the result could not be real ...