Definite integration is broken:
(%i1) integrate(1/(x^2), x, -inf, inf); (%o1) 0 (%i2) build_info(); (%o2) Maxima version: "branch_5_35_base_207_g1cd831f" Maxima build date: "2015-03-12 23:08:56" Host type: "x86_64-unknown-linux-gnu" Lisp implementation type: "SBCL" Lisp implementation version: "1.0.55.0.debian"
Needless to say, the correct answer would be:
defint: integral is divergent.
Git bisect shows that this is due to commit [b0776c24b]. The commit message says:
and the changed code is:
Not sure where to go from here.
Reverting the change fixes this bug.
Also, reverting does not seem to reintroduce the mentioned bug #2776. It seems to have been fixed by something else.
Well, there was another patch to the same code a little bit later (commit [86685c3e]), which reverted b0776c24b and made a similar change in a different place. I'm not sure what's going on at this point. In each commit, new test cases have been introduced, so at least we can tell whether or not the problems that have been fixed come back again.
Robert, can you add test cases for the following, so that we get at least some basic test coverage for this issue:
integrate(1/x, x, 0, 1)
--> Error(expected additional output:
defint: Integral is divergent.
)integrate(1/x, x, -1, 1)
-->0
(expected additional output:
Principal Value
)integrate(1/x, x, 0, inf)
--> Error(expected additional output:
defint: Integral is divergent.
)integrate(1/x, x, 1, inf)
--> Error(expected additional output:
defint: Integral is divergent.
)integrate(1/x, x, -inf, inf)
-->0
(expected additional output:
Principal Value
)integrate(1/x^2, x, 0, 1)
--> Error(expected additional output:
defint: Integral is divergent.
)integrate(1/x^2, x, -1, 1)
--> Error(expected additional output:
defint: Integral is divergent.
)integrate(1/x^2, x, 0, inf)
--> Error(expected additional output:
defint: Integral is divergent.
)integrate(1/x^2, x, 1, inf)
-->1
(no additional output)
integrate(1/x^2, x, -inf, inf)
--> Error(expected additional output:
defint: Integral is divergent.
)I've included these tests in the test suite (commit [f38312f]).
Fixed in commit [d0a8769f5d1ea9a0ce6b2f05ec162d98b48fd91d]
Related
Commit: [d0a876]