Please compare the results of
expr: -1/17*sqrt(-52/17*I + 47/17)/(2*x - sqrt(4*I + 1) - 1);
q : integrate(expr, x);
subst(x=1,q) - subst(x=0,q);
and
integrate(expr, x, 0, 1);
They are
(sqrt(47/17-(52*I)/17)*log((-sqrt(4*I+1))-1))/34 -(sqrt(47/17-(52*I)/17)*log(1-sqrt(4*I+1)))/34
-(sqrt(47/17-(52*I)/17)*(log(abs(sqrt(4*I+1)-1))/2 -log(sqrt(4*I+1)+1)/2))/17
Apparently, the first is correct, while the second is not. Please see comparison with how other CAS handle this integral at https://ask.sagemath.org/question/78955/
Here is a putative fix:
The only real change is to set the option variable
logabstonil, but I also inserted a docstring and reformatted the code.This change causes five testsuite failures--I'm working through these changes now.
With this proposed fix, one of the five regressions is rtest15, test 210. This test is
The correct numerical value of
integrate(1/(x^8-1),x,0,1/2)is about-0.500217463872434252. With my fix, I getSo I might claim success. But sans the call to
logcontract, I getAnd this is wrong. With Maxima 5.47, with or without the "extra" call to
logcontract, the answer is correct.Generally, I think it's best when tests have a no or minimal amount of calls to simplification functions on result.
Another testsuite failure is
rtestinttest 86. This test isWith my proposed fix, the result is
So the result is correct, but not manifestly real.
Another failure is
rtest_sqrttest 299. This test isWith the proposed fix, the result is
This is correct, and better than the result from Maxima 5.47.
Fixed by Commit [6f1fe7]. Thanks for this bug report. Closing this ticket.
Related
Commit: [6f1fe7]