Difference between revisions of "Simpson's rule"
m (template added) |
(→Simpson's Rule: added examples showing how to use the Simpson's rule approximation. Will add more examples later) |
||
| Line 5: | Line 5: | ||
==Simpson's Rule== | ==Simpson's Rule== | ||
<br />Specifically, Simpson's Rule states: | <br />Specifically, Simpson's Rule states: | ||
| − | :<math>\int_a^b f(x)dx \approx {{b - a} \over 6}\left [ f(a) + 4f({{a+b} \over 2}) + f(b) \right ]</math> | + | :<math>\int_a^b f(x)dx \approx {{b - a} \over 6}\left [ f(a) + 4f \left ({{a+b} \over 2} \right ) + f(b) \right ]</math> |
| + | |||
| + | === Example 1 === | ||
| + | Given: | ||
| + | :<math>\int_1^4 -x^3 + 4x^2-x+1 dx</math> | ||
| + | We can use Simpson's Rule to get a quick ''approximation'' of the actual value of the definite integral. | ||
| + | :<math>a = 1</math> | ||
| + | :<math>b = 4</math> | ||
| + | :<math>f(x)=-x^3 + 4x^2-x+1</math> | ||
| + | :<math>f(1)=-1^3 + 4(1)^2 - 1 + 1 = 3</math> | ||
| + | :<math>f(4)=-4^3 + 4(4)^2 - 4 + 1 = -3</math> | ||
| + | :<math>f \left ({4+1 \over 2} \right ) = f(2.5) = -2.5^3 + 4(2.5)^2 - 2.5 + 1 = 7.875</math> | ||
| + | <br />Now we can evaluate the integral: | ||
| + | :<math>{{4-1} \over 6} \left [ 3 + 4(7.875) - 3 \right ] = \left ({1 \over 2} \right)(31.5) = 15.75</math> | ||
| + | If we solve this using [[integration]], we find that Simpson's Rule gave the '''exact''' value for the definite integral. ''However, this is rarely the case.'' | ||
==Composite Simpson's Rule== | ==Composite Simpson's Rule== | ||
Revision as of 01:36, December 31, 2008
| Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \frac{d}{dx} \sin x=?\,} | This article/section deals with mathematical concepts appropriate for late high school or early college. |
In Calculus, Simpson's Rule is a method of approximating integrals by using parabolas or other higher order polynomial expressions. It is named after its discoverer, Thomas Simpson[1].
Simpson's Rule
Specifically, Simpson's Rule states:
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \int_a^b f(x)dx \approx {{b - a} \over 6}\left [ f(a) + 4f \left ({{a+b} \over 2} \right ) + f(b) \right ]}
Example 1
Given:
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \int_1^4 -x^3 + 4x^2-x+1 dx}
We can use Simpson's Rule to get a quick approximation of the actual value of the definite integral.
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle b = 4}
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle f(4)=-4^3 + 4(4)^2 - 4 + 1 = -3}
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle f \left ({4+1 \over 2} \right ) = f(2.5) = -2.5^3 + 4(2.5)^2 - 2.5 + 1 = 7.875}
Now we can evaluate the integral:
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {{4-1} \over 6} \left [ 3 + 4(7.875) - 3 \right ] = \left ({1 \over 2} \right)(31.5) = 15.75}
If we solve this using integration, we find that Simpson's Rule gave the exact value for the definite integral. However, this is rarely the case.
Composite Simpson's Rule
Simpson's Rule can be applied to segments of an integral, effectively making it a Riemann Integral.
If the interval Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle [a,b]}
is split into Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle N}
segments, with Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle N}
as an even number, there is a formula that can be used to solve for the integral.
Note that:
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x_n = x + nh}
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle h = {{b - a} \over N}}
As an extension of Simpson's Rule, we can find that:
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \int_a^b f(x) \, dx\approx \frac{h}{3}\bigg[f(x_0)+2\sum_{j=1}^{n/2-1}f(x_{2j})+ 4\sum_{j=1}^{n/2}f(x_{2j-1})+f(x_n) \bigg]}
The above formula can be rewritten as:
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \int_a^b f(x) \, dx\approx \frac{h}{3}\bigg[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+\cdots+4f(x_{n-1})+f(x_n)\bigg]}
- The formulas above do not work unless Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle N} is even.
Other Versions of Simpson's Rule
There are a few other rules that Simpson proved. For example, Simpson's 3/8 Rule[2] shows that cubic functions can be used to approximate integrals.