BTW :

sage: integrate(sqrt(2-2*cos(x)),x, algorithm="fricas")
-2*(cos(x) + 1)*sqrt(-2*cos(x) + 2)/sin(x)
sage: integrate(sqrt(2-2*cos(x)),x, algorithm="mathematica_free")
-2*sqrt(-2*cos(x) + 2)*cot(1/2*x)

Both are visually (on plot) and numerically correct ; both differentiate to 
expressions very hard to show equal to the original function.

HTH,

Le lundi 3 août 2020 10:50:12 UTC+2, Dima Pasechnik a écrit :

This is a well-known bug in Sage. A workaround is to set the domain to 
> "real":
>
> sage: maxima_calculus.eval('domain: real');
> sage: integrate(sqrt(2-2*cos(x)),x,0,2*pi) # correct answer
> 8
>
> sage: maxima_calculus.eval('domain: complex'); # restore the state back
> sage: integrate(sqrt(2-2*cos(x)),x,0,2*pi) # now here the result is again 
> wrong, of course
> 0
>
>
> On Sun, Aug 2, 2020 at 5:26 PM Nico Guth <[email protected] 
> <javascript:>> wrote:
>
>> Hi,
>>
>> I discovered a bug, where a definite integral is calculated wrong!
>> WolframAlpha result for comparison.
>>
>> Code:
>> integrate(sqrt(2-2*cos(x)),x,0,2*pi)
>>
>> Also if I type show() instead of print() SageMathCell just doesn't show 
>> anything.
>>
>> Also the form in which the indefinite integral is given is not very 
>> pretty.
>> WolframAlpha does a much better job simplifying.
>>
>> [image: sage_wrong_integral.png][image: sage_wrong_integral_wolfram.png]
>> [image: sage_wrong_integral_wolfram_2.png]
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-devel/487d0db8-5711-41a8-a7d4-1548286b5573n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/sage-devel/487d0db8-5711-41a8-a7d4-1548286b5573n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> ​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/ac09202e-e48b-497f-9a5d-d80d73760c0eo%40googlegroups.com.

Reply via email to