Show matrix polynomials are equal

Let $A$ be a matrix with no repeated eigenvalues: $\lambda_{1}, \lambda_{2}, \ldots, \lambda_{n}.$ Let $p(x)$ and $r(x)$ be two polynomials satisfying $$p(\lambda_{i})=r(\lambda_{i}) \text{ for } i = 1, 2, \ldots, n.$$ Show that $p(A)=r(A).$

-

Hint: What are some of the roots of $p-r$? The Cayley-Hamilton theorem will also be useful.

-
if I take $p-r$ then i would have $p-r=0$ right? so can I conclude that the charactersitic polynomial of A $c(A)=p(A)-r(A)$? My textbook gives a corollary of cayley hamilton which states for any polynomial $p(x) \in F[x]$ of degree greater than or equal to n, there exists a polynomial r(x) of degree less than n such that $p(A)=r(A)$ I am trying to figure out how to use this. – sarah jamal Jun 19 '12 at 18:43
You would have $(p-r)(\lambda_i)=p(\lambda_i)-r(\lambda_i)=0$ for all $i$. So by the remainder theorem, $\prod_{i=1}^n(x-\lambda_i)$ divides $p(x)-r(x)$. But that product is the characteristic polynomial $\chi_A(x)$ of the matrix $A$, and $A$ satisfies this polynomial. So $p(A)-r(A)=\chi_A(A)h(A)=0$ (where $h$ is some other polynomial). That other result sounds similar, but I don't see immediately how to use it. – Matthew Pressland Jun 20 '12 at 9:36

You need to show that $p(A) = r(A)$ or $$p(A) - r(A) = 0.$$ In other words, the eigenvalues of $A$ are roots of $p(x) - r(x).$ What are the values of $p(x) - r(x)$ at $x = \lambda_i,$ for $i = 1, 2, \ldots, n$?

-
This is (more or less) the same route taken here. – J. M. Jul 23 '12 at 1:25

Note that $p(A)$ and $q(A)$ are two matrices which have the same set of eigenvectors as $A$ (say $\{v_{i}\}$) and eigenvalues ($\{p(\lambda_{i})\}$ and $\{q(\lambda_{i})\}$ respectively). As both of them have $N$ linearly independent eignevectors (follows as $A$ has N distinct eigenvalues), they admit a spectral decomposition as $$p(A) = \sum_{i=0}^{N-1}{p(\lambda_{i})v_{i}v_{i}^{H}} \\ q(A) = \sum_{i=0}^{N-1}{q(\lambda_{i})v_{i}v_{i}^{H}}$$ It is therefore easy to see that they are equal.

-