If I have a quadratic form, is there a fast way to find its matrix?

148 Views Asked by At

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?

3

There are 3 best solutions below

0
On BEST ANSWER

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)$$

0
On

If $A=[a_{ij}]$ is the matrix of $q$, then we have $$ q(x_1,\dots,x_n)=\sum_{i,j=1}^na_{ij}x_ix_j $$

This means that $a_{ii}$ is equal to the coefficient of $x_i^2$ in $q$, while if $i\neq j$ then $a_{ij}$ and $a_{ij}$ are each equal to half the coefficient of $x_ix_j$ in $q$.

Note that this works with your example if we replace $x,y,z$ with $x_1,x_2,x_3$.

0
On

It is correct, if the mixed coefficients $yz,zx,xy$ are all even, then the form $$ A x^2 + B y^2 + C z^2 + R yz + S zx + T xy $$ gives Gram matrix (half Hessian) $$ \left( \begin{array}{rrr} A & \frac{T}{2} & \frac{S}{2} \\ \frac{T}{2} & B & \frac{R}{2} \\ \frac{S}{2} & \frac{R}{2} & C \end{array} \right) $$

If $R,S,T$ are not even, usually this is doubled, just use the Hessian matrix of second partial derivatives

For the doubled version see page 401 in Lehman or page 104 of Watson

$$\begin{array}{l}\text{If I had a quadratic form,}\cr \text{I'd form in the morning}\cr \text{I'd form in the evening}\cr \text{All over this land}\cr \text{I'd form out danger}\cr \text{I'd form out a warning}\cr \text{I'd form out the love between}\cr \text{My brothers and my sisters}\cr \text{All over this land.}\end{array}$$

Pete Seeger (1956)

Peter, Paul, and Mary (1963)