Sympy integration algorithm towards -infinity

i like this post (click again to cancel)
1
i dont like this post (click again to cancel)

Following achrzesz hint about integral's algorithm option, I tried (Sage 4.7.2):

integral(1/x^2, x, -infinity, -1, algorithm='sympy')

Unfortunately, I got:

Traceback (click to the left of this block for traceback)
...
AttributeError: 'MinusInfinity' object has no attribute '_sympy_'

What's going wrong?

asked Jan 21 '12

Green diod gravatar image Green diod
63 5 12

updated Jan 21 '12

The workarounds are good for now. I've opened the auspicious ticket # 12345 (http://trac.sagemath.org/sage_trac/ticket/12345) for the underlying issue.

kcrisman (Jan 23 '12)

2 Answers:

i like this answer (click again to cancel)
1
i dont like this answer (click again to cancel) Green diod has selected this answer as correct

It seems to be a bug. sympy can recognize infinity but not minus infinity of sage. You can try to directly call sympy integrate instead

import sympy as sp
a=sp.Symbol('a')
b=sp.integrate(1/x^2,(x,a,-1))._sage_()
b.substitute(a=-oo)
link

posted Jan 21 '12

Shashank gravatar image Shashank flag of United States
1570 5 22 55

How do you get this infinity symbol? But most importantly, do you input this code in a simple python interpreter or in Sage? What is this _sage_() method?

Green diod (Jan 23 '12)

How do you get this infinity symbol?

Green diod (Jan 23 '12)

Every element from another program (such as sympy) has a _sage_ method to convert its things back to Sage objects. The infinity symbol is just one of the several ways to represent infinity in Sage (and several other programs of this type); in principle, it should be equivalent to using infinity, but apparently this bug leaves it to not work for Sympy.

kcrisman (Jan 23 '12)

All right, but how do you input the infinity symbol?

Green diod (Jan 23 '12)
1

-oo is just minus oo the alphabets

Shashank (Jan 23 '12)
see 1 more comment
i like this answer (click again to cancel)
1
i dont like this answer (click again to cancel)

sage: from sympy import *

sage: integrate(1/x^2, (x, -oo, -1), algorithm='sympy')

1

link

posted Jan 21 '12

achrzesz gravatar image achrzesz
1661 4 16 36

How do you get this infinity symbol?? Anyway, I still get the same error even at the console using -infinity

Green diod (Jan 23 '12)

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

1 follower

Tags:

Stats:

Asked: Jan 21 '12

Seen: 411 times

Last updated: Jan 21 '12

powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.