On Wednesday 09 June 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.
A perhaps naive thought:
Couldn't one disambiguate the whole matter and add a new function say
$realpossqrt : \mathbb{R}_{\ge 0} \rightarrow \mathbb{R}_{\ge 0}$
with $x \mapsto realpossqrt(x)$ such that $(realpossqrt(x))^2 = x$
for all $x \in \mathbb(R)_{\ge 0}$
Andre
P.S.: I must confess, I'm not a CAS developer.