On 3/11/2014 6:04 PM, Nasser M. Abbasi wrote:> May be this is an API design preference, or may be> there can be a deep mathematical to prefer one over> the other.There are other reasons for an integral to diverge.For example, integrate(cos(x),x=0..infinity).

Interestingly, Mathematica's NIntegrate on that onegives 1.3102 x 10^244, after some warning messages.

Maybe it should normalize it to -1/12 :)

>> Which you think is the better response in the case> when one asks cas to integrate something that does not> converge over the limit of integration? return infinity,> or issue an error message?>> What does your CAS return?>> ----------------------> Maple, return infinity:>> int(1/sqrt(x),x=0..infinity);> (* infinity *)> ---------------------->> Mathematica: issues a red message with a beep and> return the original integral unevaluated:>> Integrate[1/Sqrt[x], {x, 0, Infinity}]> Integrate::idiv: Integral of 1/Sqrt[x] does> not converge on {0,\[Infinity]}. >>> Integrate[1/Sqrt[x], {x, 0, Infinity}]>> ---------------------> Matlab mupad, same as Maple:>> int( 1/sqrt(x),x,0,inf)> ans =>> Inf>> ----------------------> maxima 12.04: Similar to Mathematica. Gives an error:>> integrate(1/sqrt(x),x,0,inf);> defint: integral is divergent.> an error. To debug this try: debugmode(true);>> ---------------------->>> --Nasser