Show that $\forall p\in \mathbb{R}_3[X]$ we have $p(a) + p(b) + 4p(\frac{a + b}{2}) = \frac{6}{b - a}\int_{a}^{b} p(t)dt$ Let $a, b$ and $c$ three reals distinct.


*

*Let $P(X) = (X-a)(X-b)(X-c)$
determine a necessery and suffecient condition for $$\int_{a}^{b} p(t)dt = 0$$

*Show that $\forall p\in \mathbb{R}_3[X]$ we have $$p(a) + p(b) + 4p(\frac{a + b}{2}) = \frac{6}{b - a}\int_{a}^{b} p(t)dt$$
My work : 
I consedered the following map $\Phi$ from $\mathbb{R}_3[X]$ to $\mathbb{R}$ such that $\Phi (P) = \int_{a}^{b} p(t)dt$ and the necessery and suffecient condition is $P \in Ker(\Phi)$ is that correct?
but for 2. Itried to find the matrix of $\Phi$ in the canonical base of $\mathbb{R}_3[X]$ but I find myself nowhere. please help me?
 A: *

*Using 2. for this particular $p(X)=(X-a)(X-b)(X-c)$, as $p(a)=p(b)=0$, a necessary and sufficient condition for the integral to vanish would be
$$4p\left(\frac{a+b}2\right)=0$$
that is, $\displaystyle\frac{a+b}2$ would be also a root of $p$, but that means exactly $c=\displaystyle\frac{a+b}2$.

*
The matrix of $\Phi$ has only one row as it maps to one dimension, and the $i$th element of the row is $p(X^i)$ (for $i=0..3$), so it is
$$[\Phi]\ =\ \pmatrix{b-a&\frac{b^2-a^2}2& \frac{b^3-a^3}3 &\frac{b^4-a^4}4  } $$
So, for a $p(X)=u_0+u_1X+u_2X^2+u_3X^3$, we have 
$$ \Phi(p)=[\Phi]\cdot\pmatrix{u_0\\u_1\\u_2\\u_3}\ = \quad\quad (1)\\
=\ (b-a)\,\left(
u_0+\frac{b+a}2 u_1+\frac{b^2+ab+a^2}3u_2+\frac{b^3+ab^2+a^2b+a^3}4u_3\right)$$
And, $p(a)+p(b)=2u_0+u_1(a+b)+u_2(a^2+b^2)+u_3(a^3+b^3)$ and
$$4p\left(\frac{a+b}2\right)=4u_0+2u_1(a+b)+u_2(a+b)^2+u_3\frac{(a+b)^3}2\,. $$
Adding these, we get $6u_0+3u_1(a+b)+u_2(2a^2+2ab+2b^2)+\displaystyle\frac{u_3}2\left(
3a^3+3a^2b+3ab^2+3b^3\right)$.
Divide it by $6$ to arrive at (1).

