Ask Your Question

integral from sin at plus minus infinity seems to be bad

asked 2014-10-07 00:01:53 +0200

kote gravatar image

updated 2023-01-09 23:59:34 +0200

tmonteil gravatar image

This doesn't seem right to me

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

And this looks bad at all

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

Why this happening?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-10-07 01:07:35 +0200

tmonteil gravatar image

updated 2014-10-07 01:24:41 +0200

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

sage: +oo
sage: +2*oo

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")
sage: integrate(sin(x), x, -y, y)
sage: integrate(tan(x), x, -oo, oo)

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')

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


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

This is now reported at trac ticket 17109

edit flag offensive delete link more

answered 2014-10-18 16:24:59 +0200

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-10-07 00:01:53 +0200

Seen: 1,609 times

Last updated: Oct 18 '14