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.