[Maxima] multivalued square roots: was Re: another bug in integrate (5.27.0)
fateman at eecs.berkeley.edu
Tue Jun 26 16:42:56 CDT 2012
On 6/26/2012 2:27 PM, Jérome Laurens wrote:
> Hi list,
> consider the following code
> the result is
> whereas it should be
> +√3 instead of -√3 in the lower bound.
> One can imagine that to find the new integral bounds changevar is using
> which gives exactly the two solutions -√3 and +√3
> unfortunately, changevar picks up the wrong one.
> One would expect changevar to choose the solution that fulfills the requirements in facts(),
> or at least inform the user that some solution may be lost.
Computer algebra systems do "algebra" mostly. Trying to get them to do
"analysis" is tricky and
sometimes unsuccessful. The "assume" data base is often unused by
those that were written before assume was written. When the assume data
base is used, it
is sometimes used inadequately because "doing the right thing" is not
and (more likely) even if it is computable, it is sometimes not computed
by the algorithms in the system.
The idea that the sqrt has TWO values has been fought more or less
continuously by some programmers
of computer algebra systems, who, for example, think that sqrt(x^2) is a
definition of |x|.
This may, in part, explain the discrepancy regarding changevar.
On the other hand, you can be accused of mis-using the system yourself,
in that you did not
specify adequately which sqrt you meant when you typed sqrt(t^2-1).
Assume(t>0) has actually
no bearing on this whatsoever, since sqrt(3) has two values, one
positive and one negative.
If you had specified in your integration problem both roots, e.g. by
f (Root(y^2 - (t^2-1), y))
which would be an encoding of BOTH square roots, then maybe the computer
would have had a chance.
> More friendly: in case of an untractable choice, maxima should give both answers and let the client make its own decision.
The system in some sense thought you had already made a choice, and it
was just following along.
A proper solution to this whole issue can be envisioned in terms of
multi-valued expressions, and
that presents implementation difficulties.
More information about the Maxima