Rubi icon indicating copy to clipboard operation
Rubi copied to clipboard

Incorrect evaluation of definite integral

Open DaineDanielson opened this issue 4 years ago • 2 comments

The following definite integral evaluates to zero: Int[1/(a + Cos[x]), {x, 0, 2 Pi}]

However, the correct evaluation is, in general, nonzero. If a is replaced with an explicit number, the evaluation proceeds correctly. For instance,

Int[1/(2 + Cos[x]), {x, 0, 2 Pi}]

gives the correct value: 2 Pi/Sqrt[3].

DaineDanielson avatar Feb 04 '21 02:02 DaineDanielson

I suggest we remove definite integral capability. Albert has implemented Newton-Leibniz without checking for continuity

Int[u_, {x_Symbol, a_, b_}] := With[{result = Int[u, x]}, Limit[result, x -> b] - Limit[result, x -> a]]

It's kind of hard to believe Albert did this...

stblake avatar Feb 13 '24 00:02 stblake

Added a (hopefully temporary) patch for definite integration:

Int::definite = "Rubi does not check that the domain of integration is continuous."; Int[u_, {x_Symbol, a_, b_}] := With[{result = Int[u, x]}, Message[Int::definite]; Limit[result, x -> b] - Limit[result, x -> a]];

stblake avatar Feb 14 '24 00:02 stblake