Analyzing quadratic forms $x^2-3xy+y^2$, $2xy+yz-3xz$ and $x^2+y^2+2xy-xt+2yt$. Positive, negative or indefinite? 
By means of successive coordinate changes, write each one of the
  quadratic forms below as a sum of terms of the type $\pm u^2$ and
  decide wich ones are positive, negative or indefinite:
$$A(x,y) = x^2-3xy+y^2$$
$$B(x,y,z) = 2xy+yz-3xz$$
$$C(x,y,z,t) = x^2+y^2+2xy-xt+2yt$$

For $A$ I did $A(x,y) = x^2-3xy+y^2 = x^2-2xy+y^2-xy = (x-y)^2-xy$ which is indefinite.
For $B(x,y) = 2xy+yz-3xz$ I remembered that $(x+y+z)^2 = x^2 + 2 x y + y^2 + 2 x z + 2 y z + z^2$ so $2xy+yz-3xz = (x+y+z)^2 -x^2-y^2-z^2-yz+xz$ which won't help anything.
For $C(x,y,z,t)$ there's too much terms, how should I do it?
 A: Just use Sylvester's criterion. For example: $$A(x,y) = \begin{pmatrix} x & y \end{pmatrix} \begin{pmatrix} 1 & -3/2 \\ -3/2 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix}.$$The minors of that middle matrix are $1$ and $1 - 9/4 <0 $, so $A$ is indefinite. Writing the expression as the sum of square terms amount to diagonalizing that matrix, but you don't need this to classify the quadratic form. You'll also have $$B = \begin{pmatrix} 0 & 1 & -3/2 \\ 1 & 0 & 1/2 \\ -3/2 & 1 & 0
\end{pmatrix}, \quad C = \begin{pmatrix}1 & 1 & 0 & -1/2 \\ 1 & 1 & 0 & 1 \\ 0 & 0 & 0 & 0 \\ -1/2 & 1 & 0 & 0 \end{pmatrix}.$$
A: All you need to do is to plug random numbers in. If an expression yields both positive and negative numbers, it is indefinite. 
For example, for $B(x,y,z)$, when $x=1$, $y=3$, $z=2$, the expression becomes $2(1)(3) + (3)(2) - 3(1)(3) = 3$, which is positive. When $x=10$, $y=1$, $z=100$, the expression becomes $2(10)(1) + (1)(100) - 3(10)(100) = -2880$ which is negative. Therefore, $2xy + yz - 3xz$ is indefinite.
Try using this method to evaluate question c). Although this method is outside the rules, you can use this method to check any mistakes in $u^2$.
A: If you want to work directly with the quadratic expressions, you should just "complete" the square. For $C$, we have
$$ C(x,y,z,t) = x^2 + y^2 + 2xy - xt + 2yt = \left( x + y - \frac{1}{2}t \right)^2 - \frac{1}{4}t^2 + 3yt = \\ \left( x + y - \frac{1}{2}t \right)^2 - \left(\frac{1}{2}t - 3y \right)^2 - 9y^2.$$
I've manipulated the expression to get the terms $x^2,y^2,2xy, -xt$ as part of the expansion of the first square term which resulted in an "error" of the form $-\frac{1}{4}t^2 - yt$. Then I tried to get the terms $-\frac{1}{4}t^2, 3yt$ as part of the expansion of the second square, etc.
A: There is an algorithm for solving $P^T A P = D,$ where $A$ is some given symmetric matrix, $D$ is diagonal, while $\det P = 1.$ See reference for linear algebra books that teach reverse Hermite method for symmetric matrices
In this case we get
$$
P =
\left(
\begin{array}{rr}
1 & \frac{3}{2} \\
0 & 1
\end{array}
\right)
$$
 and
$$
\left(
\begin{array}{rr}
1 & 0 \\
\frac{3}{2} & 1
\end{array}
\right)
\left(
\begin{array}{rr}
1 & -\frac{3}{2} \\
-\frac{3}{2} & 1
\end{array}
\right)
\left(
\begin{array}{rr}
1 & \frac{3}{2} \\
0 & 1
\end{array}
\right) =
\left(
\begin{array}{rr}
1 & 0 \\
0 & -\frac{5}{4}
\end{array}
\right)
$$
Since the determinant is $1,$ it is fairly quick to find the inverse of $P.$ Let us call it
$$
Q =
\left(
\begin{array}{rr}
1 & -\frac{3}{2} \\
0 & 1
\end{array}
\right)
$$
The outcome is
$$ Q^T D Q = A.  $$ The diagonal entries of $D$ and the rows of $Q$ give
$$ \left(x - \frac{3}{2} y \right)^2 -\frac{5}{4} y^2 \; \; \; = \; \; \; x^2 - 3xy + y^2 $$
