--
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 sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/487d0db8-5711-41a8-a7d4-1548286b5573n%40googlegroups.com.
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
8sage: 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 <nico.j...@gmail.com> 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.--
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 sage-...@googlegroups.com.
@rjf Isn't the square root defined to be positive?
Sure: x^2=y <=> x=+/-sqrt(y)
But I think you would never consider f(x):=sqrt(x) to have the codomain of all negative numbers.
At least I would expect a CAS to interpret a square root to be positive.
Even if there are two possible choices, the result of the definite integral should be ±8, not 0. It is rather strange to pick the positive square root for half the integral and then (discontinuously) the negative one for the other half.There is a ticket for exactly this integral, by the way: https://trac.sagemath.org/ticket/17183.