# integral from sin at plus minus infinity seems to be bad

This doesn't seem right to me

integrate(sin(x), x, -oo, +oo)
0


And this looks bad at all

integrate(sin(x), x, -oo, +2*oo)
0


Why this happening?

edit retag close merge delete

Sort by » oldest newest most voted

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

more

Your problem is in your input. These various systems are guessing differently about what you mean by integration from minf to inf. either it means limit (integrate(f(x),x,-a,a) as a->inf)

or limit(limit (integrate(f(x),x,a b) as a->-minf, b-> minf) in some unspecified order.

What you mean is ???

The idea that this is a bug to be patched in the computer system is fundamentally incorrect. What has to be fixed is you (or in general, the user's) expectation that something he/she sees in mathematical discourse that is essentially an abuse of notation, can be interpreted either by literally computing with it, or by guessing it means something else.

It is apparent that neither Sage nor Maxima addresses this adequately, which might be to quiz the user as to what is meant

more