I have been working on problems related to bilinear and quadratic forms, and I came across an introductory problem that I have been having issues with. Take
$$Q(x) = x_1^2 + 2x_1x_2 - 3x_1x_3 - 9x_2^2 + 6x_2x_3 + 13x_3^2$$
I want to find a matrix $A$ such that $Q(x) = \langle Ax,x \rangle$. My initial guess was to simply establish this via a coefficient matrix, i.e.,
$$A = \begin{bmatrix} 1 & 2 & -3\\ 2 & -9 & 6\\ -3 & 6 & 13\end{bmatrix}$$
However, upon closer inspection, I see that this matrix does not produce our desired outcome. Is there a more reasonable algorithm for generating the matrix $A$ of a quadratic form?
The matrix associated with your quadratic form is $$Q=\begin{pmatrix}1 & 1 & -\frac{3}{2} \\ 1 & -9 & 3 \\ -\frac{3}{2} & 3 & 13 \end{pmatrix}$$ and the characteristic polynomial of $Q$ is $$ q(x) = x^3-5x^2-\frac{501}{4}x+\frac{511}{4}$$ so the eigenvalues are $$\approx -9.5372,\qquad \approx 0.9886,\qquad \approx 13.5486. $$