Lagrange basis function 
Let $x_0,...,x_n$ be distinct real numbers and $l_k(x)$ be the
  Lagrange's basis function. $\delta_n = \prod^n_{k=0}(x-x_k)$. 
Prove that:
a. - $\sum^n_{k=0}(x_k-x)^jl_k(x)\equiv 0$, for $j = 0,1,...,n$
b. - Let $p(x)$ be any polynomial of degree $n+1$ with its highest
  degree coefficient $a_{n+1} =1$. Then, $p(x) -
 \sum^n_{k=0}p(x_k)l_k(x) = \delta_n(x)$

a. - I know that Lagrange functions $l_k(x)$ there are k terms in the product where each term contains an $x$ but then how does multiplying it by $(x_k-x)^j$ make it equivalent to $0$?
b. - I do not know how to do the proof. I tried googling it and found "Lagrange's fundamental interpolating polynomials" which seems similar to it. 
 A: (The Lagrange basis functions are 
$$
l_k(x):=\frac{\prod_{0\le i\le n,\  i\ne k} (x - x_i)}{\prod_{0\le i\le n, \ i\ne k} (x_k - x_i)}, \qquad 
k=0,\dots,n.)
$$
(a)  This is not true for $j=0$, but it works for $j=1$, $\dots$, $n$.
For any polynomial $f(x)$, let $${\overline{f(x)}}:=\sum_{0\le k\le n} f(x_k) l_k(x).$$
Then $\deg {\overline{f(x)}}\le n$ and $f(x)$ and ${\overline{f(x)}}$ agree at $x=x_0$, $\dots$, $x=x_n$.  Since a nonzero polynomial of degree $n$ or less can have at most $n$ zeroes, it follows that, if $\deg f(x)\le n$, ${\overline{f(x)}}=f(x)$.  
Now, in the sum in (a), replace the first $x$ by $y$ to give
\begin{eqnarray*}
\sum_{0\le k\le n} (x_k-y)^j l_k(x).
\end{eqnarray*}
Treat this as a polynomial in $x$ with coefficients which are functions of $y$.  Then, it is ${\overline{(x-y)^j}}$.  But $j\le n$, so by the last paragraph, this equals $(x-y)^j$.  Substituting the $x$ back in gives $(x-x)^j=0$.
(b)  This can be rewritten as
$$
p(x)-{\overline{p(x)}} = \delta_n(x).\ \ \ \ (*)
$$
By the above, since $\deg (p(x)-\delta_n(x))\le n$,
$$
p(x)-\delta_n(x) = {\overline{p(x)- \delta_n(x)}}. \ \ \ \ (**)
$$
But since $\delta_n(x_0)=\dots=\delta_n(x_n)=0$, ${\overline{p(x)-\delta_n(x)}}=\overline{p(x)}$.  Substituting this into (**) gives (*).
