Let $V := \left\{ X \in \mathfrak{gl}(2,\mathbb{R}) \mid \mbox{tr}(X) = 0 \right\}$ be a vector space over $\mathbb{R}$. Prove that function $$V\ni X \mapsto q(X) := \mbox{tr}(XDX^{T}),$$ where $$D=\begin{pmatrix} 1 & 1\\ 0 & -1\end{pmatrix}$$ is a quadratic form. Then reduce $q$ to a canonical form and calculate its signature.
Edited: I do not know if my procedure it's correct. I wrote $q(X)$ in the following way $$q(X)= tr(XDX^T)=tr \begin{pmatrix} x_1 & x_2\\ x_3 & -x_1 \end{pmatrix} \begin{pmatrix} 1 & 1 \\ 0 & -1 \end{pmatrix}\begin{pmatrix} x_1 & x_3\\ x_2 & -x_1 \end{pmatrix}=x_1x_2+x_3^2-x_2^2-x_1x_3.$$ Now we form a symmetric matrix $$q(X)= \begin{pmatrix} x_1 & x_2 & x_3 \end{pmatrix} \begin{pmatrix} 0 & 1/2 & -1/2 \\ 1/2 & -1 & 0\\ -1/2 & 0 & 1 \end{pmatrix}\begin{pmatrix} x_1\\ x_2\\ x_3 \end{pmatrix}.$$ The eigenvalues of this matrix are $$\lambda_1=0 \ \ \ \lambda_2=-\sqrt{\frac{3}{2}} \ \ \ \lambda_3=\sqrt{\frac{3}{2}},$$ then, the signature is $$\sigma(q)=(1,1,1).$$ Is this right?
Do the following:
For an arbitrary matrix $\left[\begin{array}{cc}x&y\\v&w\end{array}\right]$ the quadratic form is $${\rm tr}\left(\left[\begin{array}{cc}x&y\\v&w\end{array}\right]^{\top} \left[\begin{array}{cc}1&1\\0&-1\end{array}\right] \left[\begin{array}{cc}x&y\\v&w\end{array}\right]\right)= x^2+y^2+xv+yw-v^2-w^2,$$ that can be translated to $$ \left( \begin{array}{cccc} x&y&v&w \end{array} \right) \left( \begin{array}{cccc} 1 & 0 & \frac{1}{2} & 0 \\ 0 & 1 & 0 & \frac{1}{2} \\ \frac{1}{2} & 0 & -1 & 0 \\ 0 & \frac{1}{2} & 0 & -1 \\ \end{array} \right) \left( \begin{array}{c} x\\y\\v\\w \end{array} \right) = x^2+y^2+xv+yw-v^2-w^2.$$
Such quadratic form has signature $(+,+,-,-)$.