Suppose I have a quadratic form such that:
$$ q(x,y,z)= 5x^2 + 5y^2 + 2z^2 - 2xy + 4xz + 4yz$$
Its matrix in the standard basis is: $$ \begin{bmatrix} 5 & -1& 2\\ -1 & 5& 2\\ 2&2 &2 \end{bmatrix} $$
Is there a fast way to find it? Doing it the slow way is the only way I know. I.e the slow way is to pick all the elements $e_i$ and $e_j$ from the standard basis and see what the bilinear form $\phi$ such that $\phi(x,x) = q(x)$ gives for all $\phi (e_i, e_j)$.
So any suggestions?
For the quadratic form $ax^2+by^2+cz^2+2fyz+2gzx+2hxy$ the corresponding matrix is $$\left(\begin{matrix}a&h&g\\h&b&f\\g&f&c\end{matrix}\right)$$