I am studying numerical approximation and verifying $S_{2n} = \frac{1}{3}\left(T_n +2 M_n\right)$. ($S_n$ refers to Simpson's Rule approximation, $T_n$ refers to Trapezoid Rule approximation and $M_n$ refers to Midpoint Rule approximation) I listed all the formulas and manipulated the equations, but I have no idea how $2n$ numbers come out at the left side while only $n$ numbers at the right side.
Calculus – Relation Between Simpson’s Rule, Trapezoid Rule, and Midpoint Rule
approximationcalculus
Related Solutions
But I'm not convinced we should always apply this rule any time we cut into $2n$ intervals. Why not just throw out the uneven weighting and use a few more sample points? If the weighting is so helpful, why not use a more complicated weighting (like the various n-point rules (Newton-Cotes formulas) ... )?
The problem with Newton-Cotes methods of high order is that it inherits the same sort of problems you see with using high-order interpolating polynomials. Remember that the Newton-Cotes quadrature rules are based on integrating interpolating polynomial approximations to your function over equally spaced points.
In particular, there is the Runge phenomenon: high-order interpolating functions are in general quite oscillatory. This oscillation manifests itself in the weights of the Newton-Cotes rules: in particular, the weights of Newton-Cotes quadrature rules for 2 to 8 points and and 10 points (Simpson's is the three-point rule) are all positive, but in all the other cases, there are negative weights present. The reason for insisting on weights of the same sign for a quadrature rule is the phenomenon of subtractive cancellation, where two nearly equal quantities are subtracted, giving a result that has less significant digits. By ensuring that the all weights have the same sign, any cancellation that may occur in the computation is due to the function itself being integrated (e.g. the function has a simple zero within the integration interval) and not due to the quadrature rule.
The approach of breaking up a function into smaller intervals and applying a low-order quadrature rule like Simpson's is effectively the integration of a piecewise polynomial approximation. Since piecewise polynomials are known to have better approximation properties than interpolating polynomials, this good behavior is inherited by the quadrature method.
On the other hand, one can still salvage the interpolating polynomial approach if one no longer insists on having equally-spaced sample points. This gives rise to e.g. Gaussian and Clenshaw-Curtis quadrature rules, where the sample points are taken to be the roots of Legendre polynomials in the former, and roots (or extrema in some implementations) of Chebyshev polynomials in the latter. (Discussing these would make this answer too long, so I shall say no more about them, except that these quadrature rules tend to be more accurate than the corresponding Newton-Cotes rule for the same number of function evaluations.)
...is Simpson's rule so useful that calculus students should always use it for approximations?
As with any tool, blind use can lead you to a heap of trouble. In particular, we know that a polynomial can never have horizontal asymptotes or vertical tangents. It stands to reason that a polynomial will be a poor approximation to a function with these features, and thus a quadrature rule based on interpolating polynomials will also behave poorly. The piecewise approach helps a bit, but not much. One should always consider a (clever?) change of variables to eliminate such features before applying a quadrature rule.
Since $h=\dfrac {b-a}n$ and $a=0, b=3$:
$$\int_a^b{f(x)dx}\approx S_n = \frac{1}{3}h[f(a)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+...+4f(x_{n-1})+f(b)]\\=\frac 16 ( 3+ 11.8321+ 5.6568+10.3923+4.4721+6.6332+0)\\=6.9977$$
Best Answer
For the Trapezoidal Rule, you actually use $n+1$ points. For example, in the simple case where you are integrating $f(x)$ from $0$ to $1$, and you want $T_4$, you evaluate $f$ at the points $0/4$, $1/4$, $2/4$, $3/4$, and $4/4$. It is $n+1$ points because we use the endpoints.
For the Midpoint Rule, you use $n$ points, but these are not the same points as for the Trapezoidal Rule. They are the midpoints of our intervals. So in the example discussed above, for $M_4$ you would be evaluating $f$ at $1/8$, $3/8$, $5/8$, and $7/8$.
The Simpson Rule $S_{2n}$ uses evaluation of $f$ at $2n+1$ points. If for example $n=4$, then you are dividing the interval into $8$ subintervals. With $n=4$ and the interval $[0,1]$, you would be using the points $0/8$, $1/8$, $2/8$, $3/8$, $4/8$, $5/8$, $6/8$, $7/8$, and $8/8$.
Note that $1/8$, $3/8$, $5/8$ and $7/8$ are the points that were used for $M_4$. The points $0/8$, $2/8$, $4/8$, $6/8$, and $8/8$ are just $0/4$, $1/4$, $2/4$, $3/4$, and $4/4$, exactly the points that were used for $T_4$.
A more abstract summary: $T_n$ uses $n+1$ points, and $M_n$ uses $n$ points. But the $n$ points used by $M_n$ are completely different from the points used for $T_n$. So altogether, $T_n$ and $M_n$ carry information about function evaluation at $2n+1$ points, which is exactly what $S_{2n}$ does.
I have not written out a proof of the formula, only tried to deal with your discomfort with the $2n$ on one side and $n$'s on the other. The formula is not hard to verify. Let's do it explicitly for $n=4$. Write down, say for the interval $[0,1]$, what $T_4$ is. We have $$T_4=\frac{1}{8}(f(0)+2f(1/4)+2f(1/2)+2f(3/4)+f(1)).$$ Now write down $M_4$: $$M_4=\frac{1}{4}(f(1/8)+f(3/8)+f(5/8)+f(7/8)).$$ Now calculate $T_4+2M_4$. It is convenient for the addition to make sure that $M_4$ has denominator $8$, so write $2M_4$ as $\frac{1}{8}(4f(1/8)+4f(3/8)+4f(5/8)+4f(7/8))$, and add. Divide by $3$ and you will get the expression you would get in $S_{8}$. The same method works in general.