Derive a formula of the form $$\int_a^b f(x)dx ≈ w0 f(a)+w1 f(b)+w2 f′(a)+w3 f′(b)$$ that is exact for polynomials of the highest degree possible.
For a simpler version like $$\int_0^1 f(x) dx ≈ w1f(0) + w2f(x1)$$ i know how to solve: i would need to solve a system of equations
$$f(x) = x0 \int_0^1 1 dx = w1 · 1 + w2 · 1$$ $$f(x) = x1 \int_0^1 x dx = w1 · 0 + w2 · x1$$ $$f(x) = x2 \int_0^1 x^2 dx=w1 · 0 + w2 · x1^2$$
would anyone please explain briefly (or hint at) what i wouold do for this problem. thanks.
Assume for the moment $a=-c$, $\>b=c>0$, and consider the polynomial $$f(x):=a_0+a_1x+a_2x^2+a_3 x^3\ .$$ Then $$w:=\int_{-c}^c f(x)\>dx=2c a_0 +{2c^3\over3}a_2\ .\tag{1}$$On the other hand we want a representation of $w$ of the form $$z:=p\bigl(f(c)+f(-c)\bigr)+q\bigl(f'(c)-f'(-c)\bigr)=2p a_0+(2c^2p+4cq)a_2\tag{2}$$ for suitable $p$ and $q$, that should not depend on the $a_i$. Comparing $(2)$ and $(1)$ we obtain the conditions $$2p=2c,\quad 2c^2 p+4cq={2c^3\over3}\ ,$$ that are uniquely solved by $p=c$, $\>q=-{c^2\over3}$. It follows that for our third degree polynomial $f$ we have $$\int_{-c}^c f(x)\>dx=c\bigl(f(c)+f(-c)\bigr)-{c^2\over3}\bigl(f'(c)-f'(-c)\bigr)\ .$$ As $c={b-a\over2}$ this immediately translates into $$\int_a^b f(x)\>dx={b-a\over2}\bigl(f(c)+f(-c)\bigr)-{(b-a)^2\over12}\bigl(f'(c)-f'(-c)\bigr)\ .$$ This formula is exact for arbitrary polynomials of degree $\leq3$ and arbitrary $a<b$.