Derive the Newton-Cotes formula

262 Views Asked by At

I'm trying to understand how to set up the system of equations to solve for the Newton-Cotes formula coefficients.

The problem is: $x \in [0, 1]$, and let's say we want to integrate and find $I = \int_{0}^1 f(x)dx$.

I think the goal is to find $w_1$, $w_2$, $w_3$ such that:

$w_1 f(0) + w_2 f(1/2) + w_3 f(1) \approx \int_{0}^1 f(x)dx$

The way it's solved in the textbook is:

$$ \begin{bmatrix} 1 & 1 & 1 \\ 0 & 1/2 & 1 \\ 0 & 1/4 & 1 \\ \end{bmatrix} \begin{bmatrix} w_1 \\ w_2 \\ w_3 \end{bmatrix} = \begin{bmatrix} 1 \\ 1/2 \\ 1/3 \end{bmatrix} $$

I think this is where I got confused. I read the solution to 10.1 of https://www2.bc.edu/patrick-quillen/math4414/hw/a08s.pdf, and this says the $\begin{bmatrix} 1 \\ 1/2 \\ 1/3 \end{bmatrix}$ comes from $\int_0^1 x^k dx = 1/(k+1)$ for $k=0,1,2$.

Can someone maybe explain a bit to me why this linear equation is set up this way? How did we get these entries [1, 1, 1], [0, 1/2, 1], and [0, 1/4, 1], as well as why does the left equal the right [1, 1/2, 1/3]?


The example is from Art Owen's Monte Carlo book, 7.2 the derivation of Simpson's Rule (which is a bit different from Wikipedia and how it's shown else where): http://statweb.stanford.edu/~owen/mc/Ch-quadrature.pdf


I also tried to watch MIT's YouTube video on Simpson's rule which seems much easier to understand: YouTube, but the problem is: the range of x is [-h, h], they did not use system of equations, and they tried to do $\int_{-h}^h \tilde f(x) dx$ where $\tilde f(x) = Ax^2 + Bx + C$.

Maybe my foundation is a bit too weak to understand the connection between these things...so any explanation is super welcome!

1

There are 1 best solutions below

2
On BEST ANSWER

We have \begin{eqnarray*} w_1 f(0) + w_2 f(1/2) + w_3 f(1) \approx \int_{0}^1 f(x)dx. \end{eqnarray*} Now let $f(x)=1$, then $f(x)=x$ and then $f(x)=x^2$, this gives the $3$ equations \begin{eqnarray*} w_1 + & w_2 +& w_3 =& 1 \\ & \frac{1}{2} w_2 +& w_3 =& \frac{1}{2} \\ & \frac{1}{4} w_2 +& w_3 =& \frac{1}{3} \\ \end{eqnarray*} And these $3$ equations can be summarised in the matrix form given.