Open rtoy opened 3 months ago
Imported from SourceForge on 2024-07-08 11:08:29 Created by rtoy on 2024-06-25 20:52:28 Original: https://sourceforge.net/p/maxima/bugs/4322/#6b40
Traced a few functions. When evaluating the definite integral, antideriv
is called on the integrand which returns:
log(abs(y + %i)) log(abs(y - %i)) log(y + 1)
──────────────── + ──────────────── - ──────────
2 (1 - %i) 2 (%i + 1) 2
But when doing integrate(tot,y)
, Maxima returns:
log(y + %i) log(y - %i) log(y + 1)
─────────── + ─────────── - ──────────
2 (1 - %i) 2 (%i + 1) 2
Note the lack of the abs
function inside the log
functions. This accounts for the difference. When we substitute the limits in the first result above, and call rectform
, we get:
log(2) log(sqrt(3) + 1)
────── - ────────────────
2 2
which is approximately -0.15595.
But when substituting the limits for the second result above, and call rectform
and expand
, we get:
log(sqrt(3) + 1) log(2) %pi
- ──────────────── + ────── + ───
2 2 6
which evaluates to 0.36764, which is the expected result.
For some reason, $logabs
is set to true
in $defint
. But in defint
, one call to antideriv
explicitly sets $logabs
to false
. This path isn't taken in this particular integral though.
I'm not sure why we do this. integrate(1/x,x)
returns just log(x)
instead of log(abs(x))
.
Imported from SourceForge on 2024-07-08 11:08:28 Created by zmth on 2024-06-25 13:29:18 Original: https://sourceforge.net/p/maxima/bugs/4322
the expression
-1/(y+1)/2+1/(1-%i)/(y+%i)/2+1/(1+%i)/(y-%i)/2
andy/(y+1)/(y^2+1)
are equal:gives 0.
gives toti=-0.156 which is incorrect while
ev(integrate(y/(y+1)/(y^2+1),y,0,tan(%pi/3)),numer);
gives the correct 0.3676 which i also get by just filling in the limits of the analytic expression aty=tan(%pi/3)
and subtracting evaluation at y=0 which is%pi/4
orwhich also gives 0.3676 and also numerical It may be more direct to combine and rid the complex expression and use
which also gives 0.3676