How to find the unknown values in this Numerical Integration type? Given the following type of numerical integration:
$$I(f)=\int_0^1 f(x) \, dx  \approx  \frac 12 f(x_{0}) +c_1 f(x_1) $$
a) Find the values ​​of: the coefficient $c_1$ and points $x_0$ and $x_1$ so that the above formula numerical integration to be as accurate as possible.
b)Find the error of the formula of the numerical integration in (a).
c)What is the degree of accuracy of the numerical integration formula in (a)?
 A: We need to interpret "as accurate as possible." One common interpretation is that it is dead on for $f(x)$ identically equal to $1$, for $f(x)=x$, for $f(x)=x^2$, and so on for as long as possible. 
If the formula is to give the right answer for $f(x)=1$ (and hence for $f(x)$ any constant function) we need $c_1=\frac{1}{2}$.
For the formula to give the right answer for $f(x)=x$, we then need 
$\frac{1}{2}(x_0+x_1)=\int_0^1 x\,dx=\frac{1}{2}$. So we need $x_0+x_1=1$. 
For the formula to give the right answer for $f(x)=x^2$, we  need 
$\frac{1}{2}(x_0^2+x_1^2)=\int_0^1 x^2\,dx=\frac{1}{3}$. So we need $x_0^2+x_1^2=\frac{2}{3}$.
Solve the equations $x_0+x_1=1$, $x_0^2+x_1^2=\frac{2}{3}$  for $x_0$ and $x_1$. We get $x_0=\frac{1}{2}\left(1-\frac{\sqrt{3}}{3}\right)$ and $x_1=\frac{1}{2}\left(1+\frac{\sqrt{3}}{3}\right)$.
Remarks: $1.$ This little problem connects with important mathematics. For detail, look for Gaussian quadrature. It turns out that by choosing suitable not uniformly distributed points, and suitable weights, one can produce numerical integration procedures that are extremely efficient. This is particularly important in situations where function evaluation is "expensive."  
$2.$ We did not try to get the right answer for $x^3$, since obviously $x_0$ and $x_1$ were determined when we dealt with $x^2$. However, we get a nice bonus! It turns out the formula is exact for $x^3$. This is not hard to show, all we need to do is to verify that $\frac{1}{2}(x_0^3+x_1^3)=\frac{1}{4}$. That is a short calculation. 
So the formula gives dead on right answers for $1$, $x$, $x^2$, and $x^3$. Thus, by linearity the formula  is dead on for all polynomials of degree $\le 3$.  
