A question based on quadratic forms in linear algebra ( rank, representation) This particular question was asked in masters of mathematics exam of a university and I am unable to solve it. So I am asking it here.
Consider the quadratic form $Q(v)=v^{t} A v$, where
$$A=\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0
\end{bmatrix},\quad v=(x, y, z, w)$$
Then

*

*$Q$ has rank 3 .

*$x y+z^{2}=Q(P v)$ for some invertible $4 \times 4$ real matrix $P$

*$x y+y^{2}+z^{2}=Q(P v)$ for some invertible $4 \times 4$ real matrix $P$.

*$x^{2}+y^{2}-z w=Q(P v)$ for some invertible $4 \times 4$ real matrix $P$.



Attempt: Determinant of $D_{1} $ =1 , $D_{2}$ = 1 , $D_{3}$ =-1 for some matrix and $D_{4}$ = -1 . So matrix is neither positive definite nor negative definite.

Also, I have read everything about quadratic forms from wikipedia as quadratic forms were not covered in my linear algebra class.
So, can anyone please tell how to solve this question.

Can anyone please tell any textbook of linear algebra which covers quadratic forms in detail?

I shall be really thankful.
 A: The key to solving these questions (i.e. the classification of quadratic forms up to a change of basis) amounts to using Sylvester's law of intertia.
In particular, we find that $A$ has $3$ positive eigenvalues and $1$ negative eigenvalue, so its indices of innertia are $n_+ = 3, n_- = 1, n_0 = 0$.
With that, we can eliminate both choices $2,3$ bescause the symmetric matrix corresponding to these bilinear forms fails to be invertible, which means that they have zero-inex $n_0 > 0$. Choice $4$ is correct because the corresponding symmetric matrix
$$
\pmatrix{1&0&0&0\\0&1&0&0\\0&0&0&-1\\0&0&-1&0}
$$
also has $3$ positive eigenvalues and $1$ negative eigenvalue. In fact, in this case it is possible to find a simple (diagonal!) change of basis matrix $P$.

The key to finding the matrix associated with a quadratic form is to note that for a $4 \times 4$ symmetric matrix $A$, we have
$$
\begin{array}{ccccccccc} v^TAv= &&  a_{1,1}x^2& + & a_{1,2}xy & + & a_{1,3}xz & + & a_{1,4}xw\\ 
&+&a_{2,1}xy& + & a_{2,2}y^2 & + & a_{2,3}yz & + & a_{2,4}yw\\ 
&+&a_{3,1}xz& + & a_{3,2}yz & + & a_{3,3}z^2 & + & a_{3,4}zw\\ 
&+&a_{4,1}xw& + & a_{4,2}yw & + & a_{4,3}zw & + & a_{4,4}w^2
\end{array}
\\
\begin{array}{ccccccccc} \phantom{v^TAv}= &&  a_{1,1}x^2& + & 2a_{1,2}xy & + & 2a_{1,3}xz & + & 2a_{1,4}xw\\ 
&&& + & a_{2,2}y^2 & + & 2a_{2,3}yz & + & 2a_{2,4}yw\\ 
&&&&& + & a_{3,3}z^2 & + & 2a_{3,4}zw\\ 
&&&&&&&+& a_{4,4}w^2.
\end{array}
$$
Now, the quadratic form from option $2$ can be written as
$$
\begin{array}{cccccccc}  v^TAv = &  0 x^2& + & 1\,xy & + & 0xz & + & 0xw\\ 
&& + & 0y^2 & + & 0yz & + & 0yw\\ 
&&&& + & 1\,z^2 & + & 0zw\\ 
&&&&&&+& 0w^2.
\end{array}
$$
