3
$\begingroup$

I am reading a book (SECOND EDITION) on computational physics by N.J. Giordano and H. Nakanishi. On Appendix E, page 502, the trapezoidal rule is introduced as: $$\int_a ^b f(x)dx \approx \sum_{i=1} ^{N-1} f(x_i) +\frac{1}{2}[f(a)+f(b)]$$

Why is there no $\Delta x$ element on this integration, is it a typo? When reading online about this technique, I often find this formula: $$\int_a ^b f(x)dx \approx \sum_{i=1} ^{N-1}\frac{1}{2}[f(x_i)+f(x_{i+1})]\Delta x_i$$

I am really struggling making sense of these two formulas, especially since the one from the book has no $\Delta x$.

$\endgroup$
0

3 Answers 3

3
$\begingroup$

enter image description here

you approximate the area $~A~$ between a and b unter the curve $~f(x)~$ by n trapezoids

thus

$$ A=\int_a^b f(x)\,dx\approx h\,\left(\frac 12 f(a)+f(a+h)+f(a+2h)+\ldots+f(b-h)+\frac 12 f(b)\right)\\ A=h\left(\frac{f(a)}{2}+\sum_{i=1}^{n-1}\,f(a+i\,h)+\frac{f(b)}{2}\right)$$

where $~h=\frac{b-a}{n}~$

Example:

$$ f(x)=x^2\quad,a=0\quad,b=1$$

$$\int_0^1 f(x)\,dx=\frac 13$$

$$ n=10\quad,A=0.335$$

$\endgroup$
2
  • 1
    $\begingroup$ A trapeze is something quite different than a trapezoid $\endgroup$
    – Kyle Kanos
    Jun 9, 2023 at 1:38
  • $\begingroup$ Sorry for that , thanks $\endgroup$
    – Eli
    Jun 9, 2023 at 6:37
2
$\begingroup$

Whenever I read a book and find a spot where I think there's an error, the very first thing I do is go online and look for any available errata for the book.

In this case, H. Nakanishi has published errata on his website: https://www.physics.purdue.edu/~hisao/book/www/errata.html https://www.physics.purdue.edu/~hisao/book/www/errata.pdf

If you scroll down to "On p.502 [...]" you'll find this exact issue recognized there.

$\endgroup$
1
$\begingroup$

Divide the region bounded by the curve $y=f(x)$ between the lines $x=a$ and $x=b$ using the union of $n$ elementary strips, each with base length $h=x_{i+1}-x_{i}=\triangle x_i$; $i\in\{0,1,2,...,n-1\}$ where $x_0=a, x_n=b$. Now each elementary strip is a trapezium with parallel sides of lengths $f(x_{i})$ and $f(x_{i+1})$ and height $\triangle x_i$ so that the sum of their areas is
$$\sum_{i=1}^{n-1}\frac{1}{2}[f(x_i)+f(x_{i+1}]\times \triangle x_i$$
that estimates the value of the definite integral $\int_a^b f(x)dx$.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .