3
$\begingroup$

Consider the equation

(-Sqrt[1 + KE la + KE s + KE la s - Sqrt[4 KE la + (1 + KE s - KE la (1 + s))^2]]*
(1 - KE la + KE s - KE la s + Sqrt[4 KE la + (1 + KE s - KE la (1 + s))^2])- 
(-1 + KE la - KE s + KE la s + Sqrt[4 KE la + (1 + KE s - KE la (1 + s))^2])*
Sqrt[1 + KE la + KE s + KE la s + Sqrt[4 KE la + (1 + KE s - KE la (1 + s))^2]]) == 0

KE and la are real constants. When I use Solve on the above, it gives four symbolic roots. But when I give KE and la numerical values, it only returns two numerical roots. How can this be explained?

$\endgroup$
1
  • 4
    $\begingroup$ Some of the branches may produce complex values for certain real inputs; these do not represent valid solutions for those inputs and therefore they are not returned. $\endgroup$
    – Mr.Wizard
    May 31 '14 at 10:38
2
$\begingroup$

Like Mr.Wizard says those four symbolic roots are not valid solutions for every input. Verify it like this:

eq = (
   (-Sqrt[
         1 + KE la + KE s + KE la s - 
          Sqrt[4 KE la + (1 + KE s - KE la (1 + s))^2]]*(1 - KE la + 
         KE s - KE la s + 
         Sqrt[4 KE la + (1 + KE s - KE la (1 + s))^2]) - (-1 + KE la -
          KE s + KE la s + 
         Sqrt[4 KE la + (1 + KE s - KE la (1 + s))^2])*
       Sqrt[1 + KE la + KE s + KE la s + 
         Sqrt[4 KE la + (1 + KE s - KE la (1 + s))^2]]) == 0
   );
sol = Solve[eq, s];

Now sol contains the four roots. If we substitute these roots for s in the original equation then you will notice that the equation does not simplify to True for two of them:

Simplify[eq /. sol]

This shows that these roots are not always solutions. Now try this:

eq /. sol /. {KE -> 5, la -> 5}

{False, False, True, True}

With numeric input Mathematica can determine if the expression is true or not, but as it turns out only two of the roots represent valid solutions for these constants. I assumed Solve returned the two other roots because under some conditions they are valid solutions, but apparently not for all.

$\endgroup$
3
  • $\begingroup$ In fact, using Simplify[eq/.sol] gives the two Trues, leaving first two equations unevaluated. $\endgroup$
    – Ruslan
    May 31 '14 at 13:40
  • $\begingroup$ And, when the first two are solutions at all? They seem to be spurious solutions... $\endgroup$
    – Ruslan
    May 31 '14 at 13:44
  • $\begingroup$ @Ruslan Thank you, I have updated the answer accordingly. I'm not sure about when exactly they are solutions, but I think it's reasonable to assume that there are such circumstances since Solve returned them. Mostly I wanted to show how we could verify that the two missing roots are in fact not valid. $\endgroup$
    – C. E.
    May 31 '14 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.