All 65 sample points miss the interval 0.9 to 1: https://www.desmos.com/calculator/06pjqkck2x. If you drag the endpoints of integration, you can see that Desmos gives the correct value (0.1) whenever one sample point x is in the interval.
In fact, we can create a function f that's almost always 1, but Desmos thinks the integral is 0 because we set f to 0 at exactly the sample points: https://www.desmos.com/calculator/maeuemmqzp
Any numeric integration scheme fundamentally can only sample a finite number of points. This means that it misses all other inputs; there's no way to avoid this besides symbolic integration, which is difficult to implement and can be slow.
What if the interval of integration was broken up into the subintervals on which the piecewise-defined integrand was defined? On each one of those subintervals the integrand would be "well-behaved", thus avoiding this issue. At the same time I can see how this could be difficult to implement in general since the integrand could be a complicated function of many separate piecewise-defined functions.
well, it's not really "making them smaller", it's just a piecewise specific optimization ensuring that the samples land in the interval specified by the piecewise
That's expected when the upper bound is smaller than the lower bound. (My bad for making the b slider go up to 10 instead of 100; b < a in that graph, even though the b slider thumb is to the right of the a slider)
58
u/fireflame241 Apr 18 '22
All 65 sample points miss the interval 0.9 to 1: https://www.desmos.com/calculator/06pjqkck2x. If you drag the endpoints of integration, you can see that Desmos gives the correct value (0.1) whenever one sample point x is in the interval.
1
u/[deleted] Apr 19 '22
What is f(t)?
3
u/Lenkense Apr 19 '22
So they are using Gauss integration. Am I wrong?