In Sage, this can be written wrong.maxima_methods().trigrat().expand().
HTH,
Le jeudi 9 décembre 2021 à 10:37:11 UTC+1, Daniel Volinski a écrit :
> Hi All,
>
> In Maxima (embedded in SageMath) you can use:
>
> expand(trigrat(integrate(integrate(sin(x^2),x,y,1),y,0,1)));
>
> in order to get ex
Hi All,
In Maxima (embedded in SageMath) you can use:
expand(trigrat(integrate(integrate(sin(x^2),x,y,1),y,0,1)));
in order to get exactly the same result in both cases.
Daniel
En miércoles, 8 de diciembre de 2021 23:02:00 GMT+2, Fernando Q. Gouvea
escribió:
I see. So the differenc
I see. So the difference between this and, say, 1+1==2 (which returns
True) is that 1+1 and 2 are numbers, not symbolic things.
Fernando
On 12/8/2021 3:37 PM, William Stein wrote:
On Wed, Dec 8, 2021 at 12:22 PM Fernando Q. Gouvea
wrote:
Thank you, that works. What is strange is that
On Wed, Dec 8, 2021 at 12:22 PM Fernando Q. Gouvea
wrote:
> Thank you, that works. What is strange is that this does not:
>
> sage: right=integrate(integrate(sin(x^2),y,0,x),x,0,1)
> sage: wrong=integrate(integrate(sin(x^2),x,y,1),y,0,1)
> sage: real(wrong)==right
> -1/2*cos(1) + 1/2 == -1/2*cos(
Thank you, that works. What is strange is that this does not:
sage: right=integrate(integrate(sin(x^2),y,0,x),x,0,1) sage:
wrong=integrate(integrate(sin(x^2),x,y,1),y,0,1) sage:
real(wrong)==right -1/2*cos(1) + 1/2 == -1/2*cos(1) + 1/2
Is Sage seeing a difference there that I don't?
I think
You can compare the real and imaginary parts directly.
https://cocalc.com/wstein/support/2021-12-08-gouvea
sage: bool(wrong.real() == right)
True
sage: wrong.imag()
0
On Wed, Dec 8, 2021 at 10:07 AM Fernando Q. Gouvea
wrote:
> I was showing my students a famous calculus example of an integral
I was showing my students a famous calculus example of an integral that
can be computed in one order of the variables but not in the other.
Knowing that SageMath can compute anything, the students suggested
trying the integral the "wrong" way.
The "right" way is
sage: integrate(integrate(sin(