# Positive Definite Symmetric Matrices Proof

Let K and L be symmetric n x n matrices. Prove that $x^TKx = x^TLx$ for all x $\in\mathbb{R}^n$ if and only if K = L.

It seems very obvious but how can I prove this. Will it be easier to prove it using contradiction?

-

$x^TKx = x^TLx$ is the same as $x^T(K-L)x = 0$ for all $x$. This means all the eigenvalues of the symmetric matrix $K-L$ are zero. This happen iff $K-L$ is a zero matrix.
First consider $x = e_j$ where $e_j$ is a vector with $j^{th}$ component as $1$ and rest as zeros. This will help you conclude that the diagonal elements of $K$ and $L$ are the same.
Now consider $x = e_{ij}$ where $e_j$ is a vector with $i^{th}$ and $j^{th}$ component as $1$ and rest as $0$. This with the previous fact will help you conclude that the off-diagonal entries of $K$ and $L$ are also equal.