<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] To keep it understandable albeit inelegant I'll do the passage in two steps
First the translation
$x^2 - xy + y^2 - 3y -1 = 0$
we look for a new centre $(h;\;k)$ so we substitute $x=x'+h;\;y=y'+k$
$-(h+x) (k+y)+(h+x)^2+(k+y)^2-3 (k+y)-1=0$
$x'^2-x' y'+y^2+x' (2 h-k)+y' (-h+2 k-3) +h^2-h k+k^2-3 k-1=0$ 
To have no first degree terms we put $2h-k=0;\;-h+2 k-3=0$ which gives
$h=1;\;k=2$ and we plug these values in the previous equation
$x'^2 - x' y' + y'^2=4$
Now we want to get rid of the $x'y'$ term. To do so we have to rotate the axis using these equations
$\begin{aligned}x'&=X\cos \theta -Y\sin \theta \\y'&=X\sin \theta +Y\cos \theta \end{aligned}$
$(X \sin \theta+Y \cos \theta)^2-(X \cos \theta-Y \sin \theta) (X \sin \theta+Y \cos \theta)+(X \cos \theta-Y \sin \theta)^2=4$
collecting terms
$X^2 \left(\sin ^2\theta+\cos ^2\theta-\sin \theta \cos \theta\right)+X Y \left(\sin ^2\theta-\cos ^2\theta\right)+Y^2 \left(\sin ^2\theta+\cos ^2\theta+\sin \theta \cos \theta\right)=4$
as we want the term $XY$ off we set $\sin ^2\theta-\cos ^2\theta=0$
$\tan^2\theta=1\to \theta=\pm \dfrac{\pi}{4}$
if we want the major axis of the ellipse to be horizontal we choose $\theta=\dfrac{\pi}{4}$ and substitute this value in the last equation
$\dfrac{X^2}{8}+\dfrac{3 Y^2}{8}=1$
the equations of the roto-translation altogether are 
$\begin{aligned}x&=X\cos \frac{\pi}{4}-Y\sin \frac{\pi}{4} +1\\y&=X\sin \frac{\pi}{4}+Y\cos \frac{\pi}{4} +2\end{aligned}$
or
$\begin{aligned}x&=\frac{\sqrt 2}{2}(X-Y) +1\\y&=\frac{\sqrt 2}{2}(X+Y) +2\end{aligned}$
hope this helps
</s>