hilbert
hilbert copied to clipboard
Example computation `S(log(x)dx)[0..1]` gets wrong answer
In the README and on the website is this example:
S(log(x)dx)[0..1] => - oo
However, assuming that that code means “the integral of log(x) dx
from 0 to 1”, this answer is wrong. As Wolfram Alpha confirms, the correct answer is -1.
I haven’t tried running that example in Hilbert to confirm that it returns -∞ – I’m just going off the example from the documentation.
@roryokane I've ran it in Hilbert and the result really is -oo
.
@mrshu The integral symbolically S(log(x)dx) = x*log(x) - x + C
, which then evaluated at x=1
is -1
; and evaluated taking the limit x->0
gives x*log(x)->0
and hence Alpha produces S(log(x)dx)=-1
.
I suspect this is because Wolfram Alpha is purely formal (in the sense of "formal series"), whereas Hilbert implements integrals via quadrature...
Performing Lebesgue integration by hand, the result agrees with Alpha. I strongly suspect this needs to be tweaked by Hilbert developers...
@roryokane @mrshu @pqnelson Your speculation is totally right. It's my mistake... ; (
I suspect this is because Wolfram Alpha is purely formal (in the sense of "formal series"), whereas Hilbert implements integrals via quadrature...
It's also right. I calculate integrals via quadrature.. this should be fixed as soon as possible, but I have a difficult time with purely formal. I continue to work.
@gogotanaka You may be interested in this preprint, which addresses a generalized version of this problem: http://arxiv.org/abs/1303.5101
There is already a test for this computation; the expected answer in that test should be changed too.