No - because sqrt is multivalued, the answer can be, and in this case is, 
multivalued: sometimes true and sometimes false. This isn't desperately 
helpful, or course, and can be cast in other ways in terms of the defect
Bradford,R.J.,
Algebraic Simplification of Multiple-Valued Functions.
Proc. DISCO '92 (Springer Lecture Notes in Computer Science 721, ed. J.P. 
Fitch), Springer, 1993, pp. 13-21.
or the unwinding number
Corless,R.M. & Jeffrey,D.J.,
The Unwinding Number.
SIGSAM Bulletin 30(1996) 2, pp. 28-35.

On Tuesday, 30 July 2013 18:45:07 UTC+1, rickhg12hs wrote:
>
>
>
> On Tuesday, July 30, 2013 1:40:29 PM UTC-4, JamesHDavenport wrote:
>>
>>
>>
>> On Tuesday, 30 July 2013 15:29:43 UTC+1, rickhg12hs wrote:
>>>
>>> sage: var('a b')
>>> (a, b)
>>> sage: assume(a, 'real')
>>> sage: assume(b, 'real')
>>> sage: bool( sqrt((a+b)^2) == sqrt(a^2) + sqrt(b^2) )
>>> True
>>> sage:bool( (sqrt((a+b)^2) == sqrt(a^2) + sqrt(b^2)).subs(a=1,b=-1) )
>>> False
>>> sage:
>>>
>>> Why the strange equality?
>>>
>>>  Because square root is multivalued. Consider 
>> sqrt(1-z)*sqrt(1+z)=sqrt(1-z^2) and sqrt(z-1)*sqrt(z+1)=sqrt(z^2-1).
>> More academically, consider
>> Bradford,R.J. & Davenport,J.H.,
>> Towards Better Simplification of Elementary Functions.
>> Proc. ISSAC 2002 (ed. T. Mora), ACM Press, New York, 2002, pp. 15-22.
>>  
>>
>
> So you are saying the `True` Bool is the desired behavior? 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" 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 http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to