mindstalk: (Default)
So there are the left and right Riemann sums, and the much better midpoint Riemann sum. Recently I wondered about integrals that took the average of the endpoint of each strip: (f(x)+f(x+step))/2. The thing is that most of the halves combine, so you can just add up f(x) for each whole step, plus f(start)/2 and f(end)/2. How's that compare?

Much better than the left and right sums, but not quite as good as the standard midpoint one. E.g. the integrals of sin(x) over 0 to pi/2 are

left_: 0.9992143962198378
right: 1.0007851925466327
mid__: 1.0000001028083885
mine_: 0.9999997943832352

All the other integrals I tried show a similar pattern: x, x^2, x^3, 1/x, e(x)... the two are close, but midpoint is just a bit closer to the correct answer. Or looked at another way, has close to 1/2 the error... hmm, that factor is consistent too. I should look into that.

Or: if I just recalled my terminology correctly, midpoint Riemann sums have half the error of trapezoidal Riemann sums. Which is not what I would have expected.

Date: 2016-07-11 14:23 (UTC)From: [personal profile] mtbc
mtbc: photograph of me (Default)
I don't have an answer but it can certainly be illuminating to investigate surprises!

Profile

mindstalk: (Default)
mindstalk

January 2026

S M T W T F S
    1 2 3
45 6 7 8 910
11 12131415 1617
18 19 2021 222324
25262728293031

Page Summary

Most Popular Tags

Expand Cut Tags

No cut tags

Style Credit

Page generated 2026-01-26 20:59
Powered by Dreamwidth Studios