Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
4  
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. –  Mr.Wizard May 31 at 10:38

1 Answer 1

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.

share|improve this answer
    
In fact, using Simplify[eq/.sol] gives the two Trues, leaving first two equations unevaluated. –  Ruslan May 31 at 13:40
    
And, when the first two are solutions at all? They seem to be spurious solutions... –  Ruslan May 31 at 13:44
    
@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. –  Pickett May 31 at 16:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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