Solution (source code)

= Solution

Use the orthogonal change of coordinates
$$
\boxed{x'=O^Tx,\qquad x=Ox'.}
$$
It preserves distances and angles and gives $x^TMx=x'^TDx'$. Thus the <quadric surface> is expressed along its <principal axes> as
$$
\boxed{\lambda_1x_1'^2+\lambda_2x_2'^2+\lambda_3x_3'^2=k.}
$$
The following three cases are the subparts of (ii) in the original PDF.