Find the symmetric matrix that represents the quadratic form $Q(X)=trace(X^2)$, $X\in mat_n\mathbb (R)$ as the title says, find the symmetric matrix (or signature) of $Q(X)=trace(X^2)$ where $X$ is an $n$ by $n$ matrix with real entries.
the diagonal of $X^2$ is $$\sum_{k=1}^n x_{ik}x_{ki}$$
So $$Q(X)=\sum_{i=1}^n \sum_{k=1}^n x_{ik}x_{ki}$$
How does this help us find the signature?
 A: It's simple to show that the quadratic form
$$\Phi(X)=\operatorname{tr}(X^TX)$$
is definite positive.
Now if $X$ is symmetric then $Q(X)=\Phi(X)$ then $Q$ is definite positive on the space of symmetric matrices and if $X$ is antisymmetric then $Q(X)=-\Phi(X)$ hence $Q$ is definite negative on the space of antisymmetric matrices and we have
$$\mathcal{M}_n(\Bbb R)=\mathcal S_n(\Bbb R)\oplus \mathcal{AS}(\Bbb R)$$
Can you deduce the signature of $Q$?
A: Let me elaborate on my comment above by looking at the case of $2 \times 2$ matrices. The coordinates of the matrix $M = \begin{bmatrix} a & c \\ b & d \end{bmatrix}$ in the standard basis are the vector
$$
v = \begin{bmatrix}
a\\c\\b\\d
\end{bmatrix}.
$$
(If we reordered the basis, the order would look better.)
What's $Q(M)$? It's
$$
Q(M) = aa + cb + bc + dd
$$
Now is $A$ is the matrix for the quadratic form $Q$, then $a_{11}$ tells you how many times $a^2$ appears in this formula, and $a_{12}$ tells you how many times $ac$ appears, and $a_{21}$ tells you how many times $ca$ appears, and so on. Of course, the matrix is symmetric, and $ac = ca$, so in an expression like the one above, where we have both $cb$ and $bc$, you attribute the $cb$ to entry $23$ and the $bc$ to entry $32$. The end result is the matrix
$$
A = \begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}.
$$
Check that...confirm that $v^t A v$ really does give you $a^2 + bc + cb + d^2$. 
What about the $n \times n$ case? Well,


*

*if the $j$th entry of $v$ corresponds to a diagonal entry of $M$ (like $j = 1, 4$ for $a$ and $d$ in the $2 \times 2$ case), you get a $1$ in the matrix $A$ at location $jj$, i.e., $a_{jj} = 1$. Those entries as $j = 1, n+2, 2n+3, \ldots, n^2$.  And

*for every other entry of $M$, you'll get a diagonal pair of $1$s like those corresponding to $b$ and $c$. Entry $(ij)$ of $M$ corresponds to coordinate $n(i-1) + j$ of $v$, so for each $i$ and $j$ from $1$ to $n$ where $i \ne j$, we have a $1$ in matrix $a$ at locations $a_{pq}$ and $a_{qp}$, where $p = n(i-1) + j$ and $q = n(j-1) + i$. 
