How Does Simpson's Rule Approximate Areas Under Curves?

  • Context: High School 
  • Thread starter Thread starter brandy
  • Start date Start date
  • Tags Tags
    Work
Click For Summary
SUMMARY

Simpson's Rule is a numerical method for approximating the area under a curve by using parabolas that pass through three points at a time, specifically (x_0, f(x_0)), (x_1, f(x_1)), and (x_2, f(x_2)). This method contrasts with the Trapezoidal Rule, which uses straight lines between two points. The formula derived for Simpson's Rule is (b-a) * (2f(x_0) - 4f(x_1) + 4f(x_2) - 4f(x_3) + 2f(x_4)) / (3n), where n is the number of intervals. It is essential to use an odd number of points to ensure that each interval can be approximated correctly by a parabola.

PREREQUISITES
  • Understanding of basic calculus concepts, particularly integration.
  • Familiarity with numerical methods for approximating integrals.
  • Knowledge of polynomial functions and their properties.
  • Ability to manipulate algebraic expressions and equations.
NEXT STEPS
  • Study the derivation and application of the Trapezoidal Rule for comparison.
  • Explore the error analysis of Simpson's Rule to understand its accuracy.
  • Learn about higher-order numerical integration techniques, such as Romberg integration.
  • Implement Simpson's Rule in programming languages like Python or MATLAB for practical applications.
USEFUL FOR

Students and professionals in mathematics, engineering, and computer science who are interested in numerical analysis and methods for approximating integrals.

brandy
Messages
156
Reaction score
0
can anyone tell me how it works, like visually, what does it do. I am curious.
iv heard its a three point approximation whereas the trapazoidal rule is a two point approximation. But I am not entirely sure i understand.
 
Physics news on Phys.org
The trapezoid method approximates the curve, between successive points, by a straight line while Simpson's rule uses three points at a time and approximates the curve by the parabola passing through the three points.

Suppose your function is f(x) and you take three points, [itex](x_0, f(x_0), (x_1, f(x_1), (x_2, f(x_2)), equally spaced on the x-axis. For simplicity, take the x-values to be [itex]x_0= x_1- h[/itex], [itex]x_1[/itex], and [itex]x_2= x_1+ h[/itex] where h is the distance between succesive x values so the points themselves are [itex](x_1- h, f(x_0)), (x_1, f(x_1)), (x_1+ h,f(x_2))[/itex].<br /> <br /> The equation of a parabola through [itex](x_1, f(x_1))[/itex] can be written [itex]y= a(x- x_1)^2+ b(x- x_1)+ f(x_1)[/itex]. Taking [itex]x= x_0= x_1- h[/itex] we get [itex]y= f(x_0)= ah^2+ bh+ f(x_1)[/itex]. Taking [itex]x= x_2= x_1+ h[/itex] we get [itex]y= f(x_2)= ah^2- bh+ f(x_1)[/itex].<br /> <br /> Adding those two equations, [itex]f(x_2)+ f(x_0)= 2ah^2+ 2f(x_1)[/itex] so that <br /> [tex]ah^2= \frac{f(x_2)+ f(x_0)}{2}- f(x_1}= \frac{f(x_2)- 2f(x_1)+ f(x_0)}{2}[/tex]]<br /> and<br /> [tex]a= \frac{f(x_0)+ 2f(x_1)+ f(x_2)}{2h^2}[/tex][/itex][tex] <br /> Subtracting those two equations, [itex]f(x_2)- f(x_0)= 2bh[/itex] so that <br /> [tex]b= \frac{f(x_2)- f(x_0)}{2h}[/tex]<br /> <br /> Now, [itex]\int_{x_0}^{x_2}a(x-x_1)^2+ b(x-x_1)+ f(x_1) dx= \int_{x_1-h}^{x_1+h} a(x-x_1)^2+ b(x-x_1)+ f(x_1) dx[/itex][itex]= (1/3)ah^3+ (1/2)bh^2+ f(x_1)h- (1/3)a(-h)^3- b(-h)^2- f(x_1)(-h)= (2/3)ah^3+ 2f(x_1)h[itex]so b really isn't important. The integral of the parabola through [itex](x_1-h, f(x_0)), (x_1, f(x_1)), (x_1+h,f(x_2))[/itex] is <br /> [tex](2/3)ah^3+ 2f(x_1)h= (2/3)\frac{f(x_0)- 2f(x_1)+ f(x_2)}{2h^2}h^3+ 2f(x_1)h[/tex]<br /> [tex]= \frac{2(f(x_0)- 2f(x_1)+ f(x_2)}{3}h+ 2f(x_1)h= h\frac{2f(x_0)- 4f(x_1)+ 2f(x_2)}{3}[/tex][/itex][tex] <br /> That is the formula for exactly 3 data points. If we have more, we can separte into groups of three and do that for each such interval. Bacause the overlap at the ends, we must have an <b>odd</b> number of points to do that.<br /> <br /> For example, if we had only an even number of points, [itex]x_0, x_1, x_2, x_3[/itex], our first parabola would be over [itex]x_0, x_1, x_2[/itex] but, even including [itex]x_3[/itex] as our first endpoint in the next interval we would have only [itex]x_2, x_3[/itex], not enough for a parabola. But with 5 points, we could have [itex]x_0, x_1, x_2[/itex], [itex]x_2, x_3, x_4[/itex]. Similarly, with 6 points, an even number, we would have [itex]x_0, x_1, x_2[/itex], [itex]x_2, x_3, x_4[/itex], [itex]x_4, x_4[/itex] and not be able to complete the last parabola but with 7, an odd number, we would have [itex]x_0, x_1, x_2[/itex], [itex]x_2, x_3, x_4[/itex], [itex]x_4, x_5, x_6[/itex].<br /> <br /> Now see what happens when we "attach" parabolas: on [itex]x_0, x_1, x_2[/itex] we have <br /> [tex]h\frac{2f(x_0)- 4f(x_1)+ 2f(x_2)}{3}[/tex][/tex][/itex][tex][tex] while on [itex]x_2, x_3, x_4[/itex]<br /> [tex]h\frac{2f(x_2)- 4f(x_3)+ 2f(x_4)}{3}[/itex]<br /> <br /> Those add to give<br /> [tex]h\frac{2f(x_0)- 4f(x_1)+ 4f(x_2)- 4f(x_3)+ 2f(x_4)}{3}[/itex]<br /> so you see why we have "4" multiplying everything except the first and last terms. Taking the integral to be from a to b and using n intervals, h= (b-a)/n so the formula becomes <br /> [tex](b-a)\frac{2f(x_0)- 4f(x_1)+ 4f(x_2)- 4f(x_3)+ 2f(x_4)}{3n}[/itex]<br /> Simpson's rule.[/tex][/tex][/tex][/tex][/tex][/tex]
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
11K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 53 ·
2
Replies
53
Views
7K