On Wed, 9 Jun 2010, Richard Fateman wrote:
< Raymond Toy wrote:
< <snip>
<
< This is because Maxima simplifies:
<
< (%i7) sqrt(%i);
< (%o7) (-1)^(1/4)
<
<
<
< Is there any reason why this shouldn't simplify to 1/sqrt(2)+%i/sqrt(2)?
<
<
< Yes, there is at least one reason.
<
< It can be argued that sqrt(2) is a shorthand for the? positive number s such that s^2 is 2.
< From which it might seem that sqrt(E) is a shorthand for the positive number s such that s^2 = E.
< However the number offered here is not positive. So we can't use that rule.
<
< In fact, the generalization of simplifying? sqrt(x ^2) to x? causes all kinds of problems, even if you know
< that x is assumed positive, because there are, of course, two square roots.
<
< 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.
<
< 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.
This issue comes up fairly frequently, and it seems that the fact
that this is a Sisyphean task is being ignored. Moreover,
this is one area where almost all CAS that I know of are
detrimental to learning mathematics.
(Sample transcript:
student: Maxima says sqrt(1) is 1.
teacher: Maxima is wrong.
student: So does Mma and Maple.
teacher: They are also wrong.
student: But these programmes were developed by lots of people with phds...
teacher: And they are still wrong.
)
The general problem is that Maxima has no machinery to deal with
multi-valued functions, and that is what these functions are.
Heuristics to choose a single branch must fail. I think that it
would be better if
sqrt(1);
returned
[1,-1] (i.e. essentially the output of solve(x^2-1,x) ).
Even a noun form or a number field would be better.
Similarly for all the other multi-valued functions like
the root functions.
Sometimes I sniff at Maple's implicit rule 'Rootof', but this
is a better approach in many cases, if it can be made to work
with numeric root-finding.
Leo
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.