Solution (source code)

= Solution

Use <completing the square> rather than computing the <eigenvalues> of the <symmetric matrix>. Successively removing the mixed terms gives
$$
q=2\left(x+2y-\frac32z\right)^2-7y^2+8yz-\frac52z^2
=2\left(x+2y-\frac32z\right)^2-7\left(y-\frac47z\right)^2-\frac3{14}z^2.
$$
Thus \b[one suitable invertible linear change of coordinates] is
$$
\boxed{X=x+2y-\frac32z,\quad Y=y-\frac47z,\quad Z=z;\qquad q=2X^2-7Y^2-\frac3{14}Z^2.}
$$
The coordinate <matrix> is upper triangular with <determinant> one, so the change is an <invertible linear map>. Its inverse is $z=Z$, $y=Y+4Z/7$, $x=X-2Y+5Z/14$. Hence the diagonal coefficients can be taken as $2,-7,-3/14$. This is a <matrix congruence> of a <quadratic form>; an <orthogonal transformation> was not required.