The symmetric bilinear form $b$ on $\mathbb{Q}^{3}$ is represented by the matrix with respect to the standard basis $$A=\left(\begin{array}{ccc} 3 & -2 & 0 \\ -2 & 2 & -2 \\ 0 & -2 & 1\end{array}\right) \in \operatorname {Mat}_{3,3}(\mathbb{Q})$$
(a) Determine a basis of $ \mathbb{Q}^{3}$ with respect to which $b$ is represented by a diagonal matrix.
(b) Now consider $A$ as an element of $ \operatorname{Mat}_{3,3}(\mathbb {R})$and determine a $S \in \mathrm{ GL}_{3}(\mathbb {R})$ such that $S^{t} A S$ is a diagonal matrix with entries in $\{-1,0,1\}$
My approach:
(a) Since $b$ is symmetric it follows that $b(v,w) = v^T\cdot A \cdot w = w^T\cdot A \cdot v = b(w,v)$.
Now the eigenvectors of a symmetric matrix are always orthogonal. We have the eigenvalues as $\lambda_1 = -1, \lambda_2 = 2, \lambda_3 = 5$ with the corresponding eigenvectors:
$ v_1 = \begin{pmatrix} 0.5 \\ 1 \\ 1 \end{pmatrix}, v_2 = \begin{pmatrix} -1 \\ -0.5 \\ 1 \end{pmatrix}, v_3 = \begin{pmatrix} 2 \\ -2 \\ 1 \end{pmatrix}$
and $b(v_1,v_2) = b(v_1,v_3) = b(v_2,v_3) = 0$. However I'm not satisfied with my answer because I'm not sure about the diagonal matrix for $b$.
I thought it might be the jordan form ? $$J=\left(\begin{array}{ccc} -1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 5\end{array}\right) \in \operatorname {Mat}_{3,3}(\mathbb{Q})$$
but $b(\begin{pmatrix} -1 \\ 0 \\ 0 \end{pmatrix},\begin{pmatrix} 0 \\ 2 \\ 0 \end{pmatrix}) ≠ 0$.
So is $v_1,v_2,v_3$ still the basis I'm looking for? I have probably some deeper misconception about this. Let me know where I got wrong.
(b) What is a good approach to start with (b). Is it possible to use (a)?
Thanks for any help!