hilbert icon indicating copy to clipboard operation
hilbert copied to clipboard

Example computation `S(log(x)dx)[0..1]` gets wrong answer

Open roryokane opened this issue 10 years ago • 5 comments

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 avatar Nov 18 '14 10:11 roryokane

@roryokane I've ran it in Hilbert and the result really is -oo.

mrshu avatar Nov 18 '14 11:11 mrshu

@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...

pqnelson avatar Nov 18 '14 16:11 pqnelson

@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 avatar Nov 18 '14 17:11 gogotanaka

@gogotanaka You may be interested in this preprint, which addresses a generalized version of this problem: http://arxiv.org/abs/1303.5101

pqnelson avatar Nov 18 '14 19:11 pqnelson

There is already a test for this computation; the expected answer in that test should be changed too.

roryokane avatar Nov 18 '14 22:11 roryokane