Let $A$ and $B$ be $n \times n$ matrices with entries in a field F. Suppose $A$ and $B$ are diagonalizable in some extension field E of F and that $\mathrm{Tr}(A^k)=\mathrm{Tr}(B^k)$ for all integers $k>0$. Show that A and $B$ have the same characteristic polynomial.
$A$ and $B$ are diagonalizable over the field E, so there are invertible matrices $R$ and $S$, and diagonal matrices $D_A$ and $D_B$ with entries in E such that $RAR^{-1}=D_A$ and $SBS^{-1}=D_B$
Similar Matrices have the same characteristic polynomial, so if $P_X(\lambda)$ denotes the characteristic polynomial of a matrix X in variable $\lambda$,
$P_A(\lambda)=P_{D_A}(\lambda)$ and $P_B(\lambda)=P_{D_B}(\lambda)$. We also have $\mathrm{Tr}(D_A^k)=\mathrm{Tr}((RAR^{-1})^k)=\mathrm{Tr}(RA^kR^{-1})=\mathrm{Tr}(A^k)=\mathrm{Tr}(B^k)=\mathrm{Tr}(D_B^k)$ for all integers $k>0$.
I tried using the Cayley-Hamilton theorem on $P_{D_A}(\lambda)$ and taking the trace, but couldn't get anything out of it.