I have the following problem:
Determine constant $c_1$ and $c_2$ in the formula $$\int_0^1 f(x)dx \approx c_1f(0)+c_2f(1),$$ so that it is exact for all polynomials of as large degree as possible. What is the degree of precision of the formula?
This is my approach. Since we have two unknowns, namely $c_1, c_2$, we use: $f(x) =1 $ and $f(x) = x$. This implies $$\int_0^1 dx = 1 = c_1+c_2$$ $$\int_0^1 x dx = \frac{1}{2} = c_1x_1 + c_2x_2$$ We are given in the formula that $x_1 = 0$ and $x_2 = 1$. We thus find that $c_1 = \frac{1}{2}$ and $c_2 = \frac{1}{2}$, so that $$\int_0^1 f(x)dx \approx \frac{1}{2}[f(0)+f(1)]$$ We claim that the degree of precision is $1$, since for $f(x)=x^2$, we have: $$\int_0^1 x^2dx - \frac{1}{2}[f(0)+f(1)]= -\frac{1}{6} \neq 0$$