integrate(log(1-x^2)/x, x); used to give no terms with log(x) and log(-x), but now, while formally correct, numerically this makes no sense:
(%i4) integrate(log(1-x^2)/x, x);
(%o4) log(-x)*log(x+1)+li[2](x+1)+log(1-x)*log(x)+li[2](1-x)
Edited by David Scherfgen: Fixed formatting.
I think the answer should be
-li[2](x^2)/2.For the record, I get the same result as %o4 above with a current (post-5.47) build.
It appears to me that %o4 is the same as
-li[2](x^2)/2plus a constant (which appears to be complex, but that's OK) to judge by some plots.I will try to work out the details, but it seems like it's worth a try to apply some identities (as shown e.g. by https://en.wikipedia.org/wiki/Dilogarithm) to show that the observed result is equal to
-li[2](x^2)/2plus a constant.If that works out, then I would say the result is correct, although ideally of course it would be great if the identities were applied automatically and the simpler result returned.
OK, I've verified that I can get the desired result via the identities in https://en.wikipedia.org/wiki/Dilogarithm , namely
and
What I get is that the expression returned by
integrateis equivalent to(%pi^2)/3 - li[2](x^2)/2, which is OK since it differs from the expected result by a constant.At this point I think that shows the result is not a bug, so I'll close this ticket. I agree that it would be great if Maxima could apply the identities automatically -- if someone is interested, maybe they could create a feature request to implement dilogarithm identities and maybe another one to apply them to the result of integrate automatically.
It occurs to me that applying identities automatically is a delicate process since it might make an expression more complex instead of less. I won't try to sort out how that could be handled automatically.