Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrate(exp(-a*x)*exp(-b*y), (x, 0, oo), (y, 0, oo)) causes an maximum recursion depth error #14235

Open
ghost opened this issue Feb 16, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 16, 2018

>>> integrate(exp(-a*x)*exp(-b*y), (x, 0, oo), (y, 0, oo))
RecursionError: maximum recursion depth exceeded in comparison
>>> integrate(exp(-a*x), (x, 0, oo))
⎧    1                                       π
⎪    ─       for │periodic_argument(a, ∞)│ < ─
⎪    a                                       2
⎪                                             
⎪∞                                            
⎨⌠                                            
⎪⎮  -a⋅x                                      
⎪⎮ ℯ     dx              otherwise            
⎪⌡                                            
⎪0                                            
⎩                                         

In Latex printing, "periodic_argument" makes the word "argument" the subscript of the word "periodic"
I don't know what "periodic_argument(a, ∞)" means, should it be printed
I think that only the 1/a should be returned, together with the condition on a, I don't think the "otherwise" thing should be returned

>>> Sum(a**n*b**m, (m, 0, oo), (n, 0, oo)).doit()
⎛⎧   1                 ⎞ ⎛⎧   1                 ⎞
⎜⎪ ──────   for │a│ < 1⎟ ⎜⎪ ──────   for │b│ < 1⎟
⎜⎪ -a + 1              ⎟ ⎜⎪ -b + 1              ⎟
⎜⎪                     ⎟ ⎜⎪                     ⎟
⎜⎪  ∞                  ⎟ ⎜⎪  ∞                  ⎟
⎜⎪ ___                 ⎟ ⎜⎪ ___                 ⎟
⎜⎨ ╲                   ⎟⋅⎜⎨ ╲                   ⎟
⎜⎪  ╲    n             ⎟ ⎜⎪  ╲    m             ⎟
⎜⎪  ╱   a    otherwise ⎟ ⎜⎪  ╱   b    otherwise ⎟
⎜⎪ ╱                   ⎟ ⎜⎪ ╱                   ⎟
⎜⎪ ‾‾‾                 ⎟ ⎜⎪ ‾‾‾                 ⎟
⎜⎪n = 0                ⎟ ⎜⎪m = 0                ⎟
⎝⎩                     ⎠ ⎝⎩                     ⎠

I think it should return

        1        
─────────────────        for |a| < 1 and |b| < 1
(-a + 1)⋅(-b + 1)

I'm not sure it's worthwhile giving (or attempting to give) information other than this

@cbm755
Copy link
Contributor

cbm755 commented Apr 5, 2018

The single integral result is correct, because a could be a complex value.

Pretty printing looks better with development branch, it looks like the periodic_arg thing was improved by commit f18ce44

⎧    1           π           
⎪    ─       for ─ > │arg(a)│
⎪    a           2           
⎪                            
⎪∞                           
⎨⌠                           
⎪⎮  -a⋅x                     
⎪⎮ ℯ     dx     otherwise    
⎪⌡                           
⎪0                           
⎩  

(maybe that commit could have had a test).

@cbm755 cbm755 changed the title integrate(exp(-a*x)*exp(-b*y), (x, 0, oo), (y, 0, oo)) causes an error integrate(exp(-a*x)*exp(-b*y), (x, 0, oo), (y, 0, oo)) causes an maximum recursion depth error Apr 5, 2018
@cbm755
Copy link
Contributor

cbm755 commented Apr 5, 2018

The case where a is real could be improved: see #14606.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant