0% found this document useful (0 votes)
27 views2 pages

Basics of Trapezoidal and Simpson Rules

The document summarizes the Trapezoidal Rule and Simpson's Rule for approximating integrals. The Trapezoidal Rule takes a weighted average of function values at subdivision points to approximate the integral. Simpson's Rule also takes a weighted average but with weights of 1, 2, and 4 to improve accuracy. An example calculates the integral of x^4 from 0 to 1 using both rules to demonstrate Simpson's Rule requires fewer subdivision points to achieve the same accuracy.

Uploaded by

mantascita
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views2 pages

Basics of Trapezoidal and Simpson Rules

The document summarizes the Trapezoidal Rule and Simpson's Rule for approximating integrals. The Trapezoidal Rule takes a weighted average of function values at subdivision points to approximate the integral. Simpson's Rule also takes a weighted average but with weights of 1, 2, and 4 to improve accuracy. An example calculates the integral of x^4 from 0 to 1 using both rules to demonstrate Simpson's Rule requires fewer subdivision points to achieve the same accuracy.

Uploaded by

mantascita
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Basics of Trapezoidal and Simpson Rules

Let f be a continuous function on [a, b]. We subdivide the interval into n pieces and let x0 = a, x1 = a + (b a)/n, x2 = a + 2(b a)/n, . . . , xn = a + n(b a)/n = b. The Trapezoidal Rule approximation to
b

f (x) dx
a

ba f (x0 ) + 2f (x1 ) + + 2f (xn1 ) + f (xn ) . 2n Note that we are taking a kind of weighted average of values of f at n + 1 points, n 1 of them weighted by 2 and 2 of them weighted by 1. The sum of the weights is thus 2(n 1) + 2 = 2n, which is precisely the denominator. The error bound for this approximation is |error| max[a,b] |f (x)| (b a)3 . 12n2

is

The Simpsons Rule approximation to the integral (assuming n even) is ba f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + + 2f (xn2 ) + 4f (xn1 ) + f (xn ) . 3n Again, the sum of the weights (all 1, 2, or 4) in the numerator is the denominator, 3n. The error bound for this approximation is |error| max[a,b] |f (x)| (b a)5 . 180n4
1

Example. Say we want to approximate 0 x4 dx = 1/5. Take a = 0, b = 1, xj = j/n, f (x) = x4 . Here f (x) = 12x2 , with maximum value of 12. So the error bound in the Trapezoidal Rule is 1/n2 . Since f (x) = 24, the error bound in Simpsons Rule is 24 2 = . 4 180n 15n4

So suppose we want accuracy to 4 decimal places, that is, an error no bigger than 104 . To guarantee this with the Trapezoidal Rule, we could take n big enough so that 1/n2 104 , or n2 104 . So n = 100 would work. But to guarantee this with Simpsons Rule, it would suce to choose n so that 15n4 20000, or n4 1334. For this, n = 6 almost suces, and we certainly could get the desired accuracy with n = 8. Indeed, we nd that the trapezoidal rule with n = 100 gives the approximation 0.200033333 to the integral, good to 4 but not to 5 decimal places, while Simpsons rule with n = 6 gives 0.200102881 and Simpsons rule with n = 8 gives 0.200032552 (very slightly better than the trapezoidal rule with n = 100). So certainly with smooth integrands like x4 , Simpsons rule is much more ecient.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy