How to find the matrix of a quadratic form?

I was wondering. If I have a bilinear symmetric form, it is easy to find its matrix. But, when I have a quadratic form, which is the procedure to do that?

I heard that one possibility is: If $q$ is my quadratic form, then $$f(x,y) = \frac{1}{4}q(x+y) - \frac{1}{4}q(x-y)$$ is the bilinear symmetric form associated, so the method reduces to find the matrix of $f(x,y).$

The point is that seems a little noising... How to find, in practice, the matrix of quadratic form?

Thanks in advance.


It suffices to note that if $A$ is the matrix of your quadratic form, then it is also the matrix of your bilinear form $f(x,y) = \frac 14[q(x+y) - q(x - y))]$, so that $$ a_{ij} = f(e_i,e_j) = \frac 14(q(e_i+e_j) - q(e_i - e_j)) $$ where $\{e_1,e_2,\dots,e_n\}$ is the standard basis of $\Bbb R^n$.

I think that's the most direct way to get the matrix of your quadratic form.