[Math] Finding the matrix of this particular quadratic form

linear algebramatricesquadratic-forms

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?

Best Answer

There are infinitely many matrices $A$ such that $x^T A x = Q (x)$. The diagonal entries of $A$ are the coefficients of the $x_i^2$ monomials

$$A = \begin{bmatrix} 1 & a_{12} & a_{13}\\ a_{21} & -9 & a_{23}\\ a_{31} & a_{32} & 13\end{bmatrix}$$

The coefficients of the $x_i x_j$ monomials give us $3$ linear equality constraints on the entries of $A$ off the main diagonal

$$a_{12} + a_{21} = 2 \qquad \qquad a_{13} + a_{31} = -3 \qquad \qquad a_{23} + a_{32} = 6$$

Hence, both the upper triangular matrix

$$A = \begin{bmatrix} 1 & 2 & -3\\ 0 & -9 & 6\\ 0 & 0 & 13\end{bmatrix}$$

and the lower triangular matrix

$$A = \begin{bmatrix} 1 & 0 & 0\\ 2 & -9 & 0\\ -3 & 6 & 13\end{bmatrix}$$

are admissible. However, we usually choose to make $A$ a symmetric matrix so that $A$ is diagonalizable, has real eigenvalues and orthogonal eigenvectors. Hence,

$$a_{12} = a_{21} = 1 \qquad \qquad a_{13} = a_{31} = -\frac{3}{2} \qquad \qquad a_{23} = a_{32} = 3$$

Related Question