There are a number of different ways to write a matrix representing a quadratic form- the standard way is to use asymmetricmatrix.

You want for all , , and .

Multiply the left side and set it equal to the right. it should be easy to determine a, b, c, d, e, and f (most of them will be 0).