Difference between revisions of "Simpson's rule"
m (→Composite Simpson's Rule: added link) |
(→Simpson's Rule: added a second example) |
||
| Line 9: | Line 9: | ||
=== Example 1 === | === Example 1 === | ||
Given: | Given: | ||
| − | :<math>\int_1^4 -x^3 + 4x^2-x+1 dx</math> | + | :<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. | We can use Simpson's Rule to get a quick ''approximation'' of the actual value of the definite integral. | ||
:<math>a = 1</math> | :<math>a = 1</math> | ||
| Line 19: | Line 19: | ||
<br />Now we can evaluate the integral: | <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> | :<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.'' | + | 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'', as shown in the next example. |
| + | |||
| + | === Example 2 === | ||
| + | Given: | ||
| + | : <math>\int_4^{12}\frac{3x+11}{x^2-x-6}dx </math> | ||
| + | Directly solving this integral would require an understanding of [[Partial fractions in integration|partial fractions]]. If we want to quickly attain an approximation of the integral, we can use Simpson's Rule. | ||
| + | :<math>a = 4</math> | ||
| + | :<math>b = 12</math> | ||
| + | :<math>f(x)=\frac{3x+11}{x^2-x-6}</math> | ||
| + | :<math>f(4) = \frac{3(4)+11}{4^2-4-6} = {23 \over 6}</math> | ||
| + | :<math>f(12) = {47 \over 126}</math> | ||
| + | :<math>f\left ({{4+12}\over{2}}\right ) = f(8) = \frac{3(8)+11}{8^2-8-6} = {35\over50} = {7\over10} </math> | ||
| + | <br />Now we can solve: | ||
| + | :<math>\left ({12-4 \over 6}\right ) \left ( {23 \over 6} + 4 \left( {7\over10} \right)+ {47 \over 126} \right ) = \left ( {4\over3} \right ) ({2207\over315}) \approx 9.34179... </math> | ||
| + | <br />As the function given does not resemble a parabola, the answer we get is completely off of the real answer, which is: | ||
| + | : <math>\approx 6.02941...</math> | ||
| + | This is why we will sometimes split the interval of integration into multiple pieces, causing the approximation to approach the actual value. When we do this, we use the '''Composite Simpson's Rule'''. | ||
==Composite Simpson's Rule== | ==Composite Simpson's Rule== | ||
Revision as of 02:40, 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:
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 a = 1}
Now we can evaluate the integral:
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, as shown in the next example.
Example 2
Given:
Directly solving this integral would require an understanding of partial fractions. If we want to quickly attain an approximation of the integral, we can use Simpson's Rule.
Now we can solve:
As the function given does not resemble a parabola, the answer we get is completely off of the real answer, which is:
This is why we will sometimes split the interval of integration into multiple pieces, causing the approximation to approach the actual value. When we do this, we use the Composite Simpson's Rule.
Composite Simpson's Rule
Simpson's Rule can be applied to segments of an integral, effectively making it a Riemann Integral.
If the interval is split into segments, with 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 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.