issue on infinite series

145 views
Skip to first unread message

sinan...@gmail.com

unread,
Oct 10, 2024, 12:02:58 PM10/10/24
to sage-devel
Hi,

I would like to report the following:

I tried to integrate 1/x^2 from -oo to oo, and here is what I got:

--
In cocalc, the series is calculated wrongly:
'SageMath version 10.4, Release Date: 2024-07-19'
in: integral(1/x^2, (x,-oo,oo))
out: 0
--

In sagecell.sagemath.org, everything seems to be fine:

'SageMath version 10.2, Release Date: 2023-12-03'

integral(1/x^2, (x,-oo,oo))
ValueError: Integral is divergent.

Thanks,

Vincent Delecroix

unread,
Oct 10, 2024, 12:59:29 PM10/10/24
to sage-...@googlegroups.com
Hi,

What did you expect? The function 1/x^2 is not integrable at 0. The
following (convergent) integrals does work

sage: integral(1/x^2, (x, 1, +oo))
1
sage: integral(1/x^2, (x, -oo, -1))
1

The following (divergent) integral produces the same result

sage: integral(1/x^2, (x, -1, 1))
Traceback (most recent call last):
...
ValueError: Integral is divergent.

Note that this kind of questions is better directed to either
https://ask.sagemath.org or https://groups.google.com/g/sage-support.

Best
Vincent
> --
> 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/728a2f53-d3b2-48a4-99ff-47f15e025a41n%40googlegroups.com.

Nils Bruin

unread,
Oct 10, 2024, 2:48:16 PM10/10/24
to sage-devel
On Thursday 10 October 2024 at 09:02:58 UTC-7 sinan...@gmail.com wrote:
Hi,

I would like to report the following:

I tried to integrate 1/x^2 from -oo to oo, and here is what I got:

--
In cocalc, the series is calculated wrongly:
'SageMath version 10.4, Release Date: 2024-07-19'
in: integral(1/x^2, (x,-oo,oo))
out: 0
--
 
I've not been able to reproduce this behaviour or SageMath 10.5.beta6. I get the expected "Integral is divergent" error there. You may be observing a regression whatever maxima version cocalc is using for its SageMath 10.4 (most likely whatever sagemath ships with) that is either not present on other systems or has been resolved by a maxima version upgrade in 10.5.beta.

Dima Pasechnik

unread,
Oct 10, 2024, 2:48:44 PM10/10/24
to sage-...@googlegroups.com, William Stein
Hi,
how do you run cocalc? At least, on cocalc.com with Sage 10.4, it works OK.

Best,
Dima

Sinan Kapçak

unread,
Oct 10, 2024, 2:48:49 PM10/10/24
to sage-...@googlegroups.com
Hi, 

You might have missed the first part of my message. I know that the integral is divergent but Sage says it is zero. Thanks.

Best,
Sinan

You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/-pDExtT6H4M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAGEwAA%3DC0H%3Di3aM99ouE3_5UaMnpaCSNVosLi%2B%2BROR3pKooJeg%40mail.gmail.com.

Sinan Kapçak

unread,
Oct 10, 2024, 2:49:23 PM10/10/24
to sage-...@googlegroups.com
Here below, the first line Out [57] says zero. Now, I have just tried again, Out [1] at the bottom, and it gave the correct result. Something strange happened.
 
Screenshot from 2024-10-10 19-22-44.png

Sorry if this is posted in the wrong group. Next time, I'll make sure to post in the groups Vincent mentioned.

Thanks,
Sinan

Dima Pasechnik

unread,
Oct 10, 2024, 4:56:41 PM10/10/24
to sage-...@googlegroups.com
It could be that in one of the 1st 56 commands you broke "integral". Python allows you to redefine things.
e.g.

def intergral(a,b):
      return 0

is one way to achieve this.

HTH
Dima

Sinan Kapçak

unread,
Oct 11, 2024, 9:41:16 AM10/11/24
to sage-...@googlegroups.com
I don't think that was the case. I didn't define anything. Also, as shown in the image, Out[55] and Out[61] are functioning correctly for the integral command. 

After reloading the page on another PC, everything, strangely, worked fine.

Best,
Sinan

Reply all
Reply to author
Forward
0 new messages