rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

integrate(x^n,x,a,b) wrong for a<0<b #3196

Open rtoy opened 2 months ago

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 17:38:08 Created by macrakis on 2004-07-15 14:45:18 Original: https://sourceforge.net/p/maxima/bugs/586


integrate(x^n,x,a,b); Is n positive, negative, or zero? neg; Is n + 1 zero or nonzero? n; Is b - a positive, negative, or zero? pos; => b^(n+1)/(n+1)-a^(n+1)/(n+1) (NO!)

This is incorrect for (e.g.) n=-2, a<0<b:

integrate(x^-2,x,a,1); Is a - 1 positive, negative, or zero? neg; => Integral is divergent (OK)

Same thing, but a more dramatic demo:

assume(equal(a,-1),equal(b,1),equal(n,-2)); integrate(x^n,x,a,b) => b^(n+1)/(n+1)-a^(n+1)/(n+1) (NO!)

vs.

integrate(x^-2,x,-1,1) => Divergent (OK)

Also

assume(equal(n,-2)); integrate(x^n,x,-1,1); => (-1)^n/(n+1)+1/(n+1) (NO!)

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 17:38:09 Created by robert_dodier on 2006-04-10 04:09:09 Original: https://sourceforge.net/p/maxima/bugs/586/#b8b1


rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 17:38:12 Created by rtoy on 2006-04-10 17:33:05 Original: https://sourceforge.net/p/maxima/bugs/586/#3961


Logged In: YES user_id=28849

These errors occur because maxima is trying to see if there are any poles on the real axis. It does so by calling poles-in-interval, which calls real-roots on the denominator of the integrand, which is x^(-n), since n is negative. But solve thinks this equation has no real roots.

This is why x^(-2) works. solve wants the roots of x^2, which it can figure out, and thus poles-in-interval finds poles in the interval.