Find a formula of the type
1)$$\int_0^1 f(x)dx=af(0)+bf(1)$$ that gives correct values for $f(x)=1$ and $f(x)=x^2$ Does such formula give $f(x)=x$?
2) $$\int_{-1}^1 f(x)dx=af(-1)+bf(0)+cf(1)$$ that gives correct values for $f(x)=x, x^2, x^3$. Does it integrate the functions $1, x^4, x^5$?
Is this related to trapezoid/rectangle rule? My idea is to do a Lagrange/newton polynomial letting $f(x)$ be a second degree polynomial such that $p1=1$, $p_2=1+(x-1)c$ -> $x^2=1+(x-1)c$ -> $c=(x^2-1)/(x-1)$ -> $p_2(x)=1+(x^2-1)=x^2$ and do i integrate form that?
As regards (1), after plugging $f=1$, and $f=x^2$ into the given formula, we have that $$\int_0^1 1dx=a\cdot 1+b\cdot 1\implies a+b=1\;\text{and}\; \int_0^1 x^2dx=a\cdot 0^2+ b\cdot 1^2\implies b=1/3.$$ Find $a$ and $b$ and check if $\int_0^1 xdx=a\cdot 0+ b\cdot 1$ holds (actually here you don't need $a$).
Now, are you able to answer to question (2)?