Formulas for composite/multiple-segment trapezoidal rule (for approximating the value of an integral) don't seem to agree?

2017-07-24 8:00 am
Hello, everyone. :)

I'm looking at several different sources for the composite/multiple-segment trapezoidal rule (for approximating the value of an integral), but the formulas don't seem to agree. One place says I ≈ Δx/2 [f(a) + f(b)] + Δx Σ_(i=2)^(N-1) f(x_i). Another place says I ≈ Δx/2 [f(a) + f(b)] + Δx Σ_(i=2)^(N) f(x_i). Yet another place says I ≈ Δx/2 [f(a) + f(b) + 2 Σ_(i=1)^(N-1) f(a + iΔx)]. Only the first one seems correct to me. Basically, the second one seems to me like it should end at N-1, not N, and the third one seems to me like it should end at N-2, not N-1.

Am I right, or not?

For reference, the first formula can be found toward the beginning of the solution for part c.: https://www.docdroid.net/uNEKLNh/i.pdf#page=2

The second formula is equation (9.13) from here.: https://www.docdroid.net/9gQvLmE/ii.pdf

The third formula is in the frame of this video at 6:30. (The link already points to 6:30, for your convenience.): https://www.youtube.com/watch?v=Br9SWhhgRyg&feature=youtu.be&t=6m30s

Any input would be greatly appreciated!

回答 (1)

2017-07-24 8:20 am
✔ 最佳答案
It could be a difference in how N is defined. Let's look at them. First of all, let's derive the actual trapezoidal rule.
If we have points from x_0, x_1, ..., x_N dividing the region up into N intervals (x_0 = a and x_N = b), then the area of the corresponding trapezoids is
(h/2) (f(x_0) + f(x_1)) + (h/2)[f(x_1) + f(x_2)] + ... + (h/2) [f(x_N-1) + f(x_N)] where h = the spacing between x values. All of the interior values x_1, x_2, ..., x_N-1 appear twice, so that gives
(h/2) [ f(x_0) + f(x_N) ] + h sum(i = 1 to N-1) f(x_i). The first term uses the endpoints, the second term is a sum over all the interior points between those endpoints.

The first one has x values from x_2 to x_(N-1), plus a and b. So that looks like the x values are numbered from 1 to N, with x_1 = a and x_N = b, and there are only N-1 intervals. That seems inconsistent with the text as written. If there are four intervals then according to this numbering scheme N = 5. If there are two intervals then N = 3.

The second one numbers the interior points from 2 to N, so the endpoints are a = x_1 and b = x_(N+1). There are N+1 points dividing it up into N intervals.

The third one numbers the interior points from 1 to (N-1), so there are (N-1) interior points defining N intervals, with x_0 = a and x_N = b.

Summary: First formula uses N for the number of points, and numbers those points from 1 to N.
Second formula uses N for the number of intervals, and numbers the points from 1 to N+1.
Third formula uses N for the number of intervals and numbers the points from 0 to N (that's the notation I chose, but I could have used either of the other two).

They're equivalent, just have different definitions for the variables.


收錄日期: 2021-04-24 00:35:34
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20170724000012AAAThiv

檢視 Wayback Machine 備份