<s>[INST] How to turn the ellipse $x^2 - xy + y^2 - 3y - 1 = 0$ to the canonical form using an isometric transformation? There is an exam problem I'm having trouble with, it is as follows:

Turn the equation $x^2 - xy + y^2 - 3y -1 = 0$ into the canonical form using an isometric transformation and write down the transformation.

Comparing to the general equation for conic sections I see that this is a rotated ellipse. I assume that the solution would be to multiply a rotation matrix (to align the ellipse's axes to the $x$ and $y$ axes) and a translation matrix (to bring the ellipse's center to the origin), and then somehow apply the result to the ellipse.
How would I go about doing this? How do I get the coordinates of the ellipse's center and the angle of its rotation to construct the matrices, and then how would I apply the transformation to the ellipse itself?
 [/INST] First center the equation by definting the function $f(x,y) = x^2 - xy + y^2 - 3y - 1 = 0$ and solving the following system of equations for $(x,y)$
$$\left. \begin{aligned}
  \frac{\partial f(x,y)}{\partial x} & = 2x-y = 0 \\
  \frac{\partial f(x,y)}{\partial y} & = -x+2y-3 = 0 \\
\end{aligned} \right\} \pmatrix{x & y} = \pmatrix{1 & 2} $$
So now we reset the coordinates to $\pmatrix{x&y} \rightarrow \pmatrix{x+1&y+2}$
The new equation is $g(x,y) = x^2-x y + y^2 -4 = 0$
Now to re-orient the conic. Use $\pmatrix{x&y} \rightarrow \pmatrix{x \cos \theta - y \sin \theta & x \sin\theta + y \cos \theta}$ and set the coefficient of $x y$ equal to zero. 
$$ g = \left( 1- \frac{\sin 2 \theta}{2} \right) x^2 + \left( 1 + \frac{\sin 2 \theta}{2} \right) y^2 +2 \left( -\frac{\cos 2\theta}{2} \right) x y -4 =0 $$
$$ \left. -\frac{1}{2}\cos(2 \theta)=0 \right\} \theta =\pm \frac{\pi}{4} $$
$$\boxed{ d(x,y) = \frac{1}{2} x^2 + \frac{3}{2} y^2  -4 =0 }$$
</s>