Friday, October 16, 2015

Whats' the difference between the Trapezoidal Rule and Simpon's Rule for approximating integrals? What're the advantages/disadvantages of each...

Trapezoidal Rule and Simpson's rule are both numerical method in approximating values of a definite integrals. They both use a tabulated data of the function values for each subinterval. The primary difference is the formula for each rule.


Trapezoidal rule follows the formula for average of the left-hand Riemann Sum  and the right-hand Riemann sum .  It uses trapezoids or similar to a rectangle that has straight line segments with slanted top to approximate the area under the graph of the function.  The integral will be evaluated as:


`int_a^b f(x)dx = Deltax/2 [f(x_0)+f(x_1)]+Deltax/2 [f(x_1)+f(x_2)]+...


`+Deltax/2 [f(x_(n-1))+f(x_n)].`


Factoring out the `Deltax/2` and adding duplicated functions, we may simplify it as:


`int_a^b f(x)dx = Deltax/2 * [f(x_0)+2f(x_1)+2f(x_2)+2f(x_3)+...


`+2f(x_(n-1))+f(x_n)]` 


Note that all the function values has a coefficient of 2 except` f(x_0)` and `f(x_n)` .


While Simpson's rule differs since it has "parabola" across a pair of subintervals. The integral will be evaluated as:


`int_a^b f(x)dx = Deltax/3* [f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+...


`+2f(x_(n-2))+4f(x_(n-1))+f(x_n)]` 


Note that all the function values  at `x_(odd)` has a coefficient of 4. Function values at `x_(even)` , except with` f(x_0)` and `f(x_n)` , has coefficient of 2.



For the advantages of Trapezoidal rule, it is more accurate integral approximation than a single Riemann sum. It can be used regardless if we have even or odd number of subintervals. Its concept and derivation of formula is easier than the Simpson's rule using average for two consecutive function values . As for its disadvantage, it is less accurate than the Simpson's rule. This method is preferred when you have odd numbers of subintervals



For the advantages of Simpson's rule, it is more accurate due to the use of "parabolic top". It also achieves higher level of accuracy faster using less number of subintervals. For its disadvantage, it is restricted to even subintervals since it has to consider a "pair" of subintervals for each parabolic top. Thus, we prefer this method when we have quadratic polynomial or even number of subintervals.

No comments:

Post a Comment

How does the choice of details set the tone of the sermon?

Edwards is remembered for his choice of details, particularly in this classic sermon. His goal was not to tell people about his beliefs; he ...