Raymond Toy wrote:
> On 6/9/10 10:02 AM, Richard Fateman wrote:
>
>> Raymond Toy wrote:
>>
>> Going back to the original question, if we cannot choose the "positive"
>> s, can we choose a "principal" root? Sometimes, but you
>> do not have any assurance that this is the one of interest.
>>
>
> I think principal root is nice. If it's not the root of interest, you
> should do something else, like solve(x^2=%i,x).
>
Sometimes you cannot identify the principal root, if there are symbols
involved.
sqrt((x-y)^2) has principal root x-y if x>y.
>
>> Here is another reason, or at least food for thought.
>> Mathematica 7.0 returns (-1)^(1/4).
>>
>> evaluating it numerically however gives 0.707107 + 0.707107 I.
>>
>
> What exactly does this mean? If (-1)^(1/4) is meant to be any (or all)
> of the 4 roots of -1,
Maybe.
> then it seems that 0.7+0.7I is the wrong answer.
> But if it is the right answer, then (-1)^(1/4) really means the
> principal root.
>
> Unless numerical evaluation is meant to produce the principal root if
> there is ambiguity.
>
If you leave expressions unevaluated until every symbol has a numeric
value, I think you are OK.
Any intermediate "simplification" can be problematical.
> How is this meant to interact with say, solve(x^2+3*x+1,x) which returns
>
> [x = -(sqrt(5)-3)/2, x = (sqrt(5)+3)/2].
>
> Does that mean sqrt(5) is +/- 2.23 so there are 4 possible roots to this
> quadratic? (I didn't actually check that this produces 4 values).
>
Actually, it only produces 2. a different choice interchanges the roots.
That is partly why the solution to a quadratic should be a pair of
equations, and separating them is risky.
( unless they are numbers, when you are probably OK.)
rjf