Ask Your Question

Revision history [back]

The second example is the same as the first, since:

sage: +oo
+Infinity
sage: +2*oo
+Infinity

The problem seems that Sage (more precisely Maxima) knows that the sin function is odd, and learned how to use this to integrate fast if the endpoints are opposite to eachother:

sage: var("y")
y
sage: integrate(sin(x), x, -y, y)
0

Indeed, it is not able to compute half of it:

sage: integrate(sin(x), x, 0, y)
ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(y>0)', see `assume?` for more details)
Is y positive, negative or zero?

While Maxima seems faulty:

sage: integrate(sin(x), x, -oo, oo, algorithm='maxima')
0

Sympy seems to know that there is a problem here:

sage: integrate(sin(x), x, -oo, oo, algorithm='sympy')
RuntimeError: cos_eval(): cos(infinity) encountered

Moreover:

sage: integrate(sin(x), x, 0, y, algorithm='sympy')
-cos(y) + 1

The second example is the same as the first, since:

sage: +oo
+Infinity
sage: +2*oo
+Infinity

The problem seems that Sage (more precisely Maxima) knows that the sin function is odd, and learned how to use this to integrate fast if the endpoints are opposite to eachother:

sage: var("y")
y
sage: integrate(sin(x), x, -y, y)
0
sage: integrate(tan(x), x, -oo, oo)
0

Indeed, it is not able to compute half of it:

sage: integrate(sin(x), x, 0, y)
ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(y>0)', see `assume?` for more details)
Is y positive, negative or zero?

While Maxima seems faulty:

sage: integrate(sin(x), x, -oo, oo, algorithm='maxima')
0

Sympy seems to know that there is a problem here:

sage: integrate(sin(x), x, -oo, oo, algorithm='sympy')
RuntimeError: cos_eval(): cos(infinity) encountered

Moreover:

sage: integrate(sin(x), x, 0, y, algorithm='sympy')
-cos(y) + 1

The second example is the same as the first, since:

sage: +oo
+Infinity
sage: +2*oo
+Infinity

The problem seems that Sage (more precisely Maxima) knows that the sin function is odd, and learned how to use this to integrate fast if the endpoints are opposite to eachother:

sage: var("y")
y
sage: integrate(sin(x), x, -y, y)
0
sage: integrate(tan(x), x, -oo, oo)
0

Indeed, it is not able to compute half of it:

sage: integrate(sin(x), x, 0, y)
ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(y>0)', see `assume?` for more details)
Is y positive, negative or zero?

While Maxima seems faulty:

sage: integrate(sin(x), x, -oo, oo, algorithm='maxima')
0

Sympy seems to know that there is a problem here:

sage: integrate(sin(x), x, -oo, oo, algorithm='sympy')
RuntimeError: cos_eval(): cos(infinity) encountered

Moreover:

sage: integrate(sin(x), x, 0, y, algorithm='sympy')
-cos(y) + 1

This is now reported at trac ticket 17109