I want to use two point gaussian quadrature to approximate $$\int_0^1(1-x)f(x)\text{ dx}$$
Because $(1−x)$ is a linear polynomial, polynomials $f$ of degree at most $2n−2=2$ (because we use two point gaussian quadrature $n=2$) can be accurately integrated. So, I would deal with a polynomial $p(x)=a_0+a_1x+a_2x^2$.
Integration yields $$\int_{-1}^1p(x)(1−x) dx=a_0(2)+a_1\left(−\frac{2}{3}\right)+a_2\left(\frac{2}{3}\right)$$ However, the quadrature is of the form $$\int_{-1}^1p(x)(1−x)\text{ dx}≈c_1p(x_1)+c_2p(x_2)$$ So, we have four variables but only three equations. What am I doing wrong here?