1) Why does not sqrt(a^2) return abs(a)?

IIUC:

When operating on a symbolic expression x in Expression R,
the operator sqrt "represents an arbitrary (but always the same through the code) 
solution y of the algebraic equation y^2=x".
Even when R = Integer, there are still 2 real roots y that satisfy the equation.

Similar semantics for the n-th root nthRoot:
"an arbitrary (but always the same through the code) solution of the algebraic 
equation y^n=x".

Note that sqrt(x) may not be imagined to be a set with two elements
because the (pointwise) product of two sets would be a set including also
non-diagonal products of the elements.
(IE sqrt(4)={+2,-2} ==> sqrt(4)*sqrt(4) = {(+2)*(+2),...} = {+4, -4}).

So, FriCAS deliberately tries not to make a choice of roots
and consequently sqrt has a different semantics (on expressions)
as compared to all other CAS in my knowledge.

As for the (sometimes) weird behavior of abs in FriCAS
this should be related to the fact that using a smart abs one might construct 
zero divisors,
(nonzero  x1,x2 such that x1 * x2 = 0). This would violate the fact that 
Expression Integer
is meant to be a differential field, which is essential for the indefinite 
integration algorithms.
To recover more information I advice you to track the above keywords in the 
past messages:
many of your (present and future) questions have been already asked many times 
in the last 10 years.

riccardo

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to