I have the equation $$15x^2 + 15y^2 -16x + 16y -2xy -48 = 0$$ I want to represent it in the plane, for that goal I want to find its general formula $$\frac{(x-x_0)^2}{a^2} + \frac{(y-y_0)^2}{b^2} = 1$$ I would have no problems completing squares if it wasn't for this $2xy$.
For the sake of clearness, this problem is from the book "Complex variable analysis" that asks the representation of $$|z-1| + |z+i| = 4$$ and after some trivial counts you end up in the first equation given.
The equation
$ | z - 1 | + | z + i | = 4 $
means that the distance of $z = x + i y = (x, y)$ (in the complex plane) from the point A(1, 0) plus the distance between $z$ and B(0, -1) is equal to $4$. By definition, this means that $z$ lies on an ellipse whose foci are $A$ and $B$, and whose major axis length is 4. Hence if you set up a second coordinate frame $C x' y' $ with its origin at the midpoint of $AB$, i.e. at $C = (0.5, -0.5)$ and whose $x'$ axis extends along $AB$, i.e. along (1, 1), then the equation of the ellipse becomes
$ \dfrac{x'^2}{a^2} + \dfrac{y'^2}{b^2} = 1 $
where $a = \dfrac{4}{2} = 2 $, and $ a^2 - b^2 = c^2 $
$c$ is the distance between the center $C$ and one of the foci, i.e.
$ c = AC = \dfrac{\sqrt{2}}{2} $
Therefore, $b^2 = 4 - \dfrac{1}{2} = \dfrac{7}{2} $
Now the equation of the ellipse is completely specified.
Alternatively, from the equation
$ 15 x^2 + 15 y^2 -16 x + 16 y -2xy - 48 = 0 $
Define $ r = [x, y ]^T $, and
$ Q = \begin{bmatrix} 15 && -1 \\ -1 && 15 \end{bmatrix} $
$ b = [-16, 16 ]^T $
$ c = -48 $
Then the given equation can be written in matrix-vector form as
$ r^T Q r + b^T r + c = 0 $
First, find the center of the ellipse, which is given by
$ C = - \dfrac{1}{2} Q^{-1} b = [ 0.5 , -0.5 ] $
Now, we can re-write the above equation as,
$ (r - C)^T Q (r - C) + c - C^T Q C = 0 $
The constant $c - C^T Q C = -48 - 8 = -56 $
Finally diagonalize $Q$. i.e. write it as follows
$ Q = R D R^T $ where $R$ is a suitable rotation matrix, and $D$ is a diagonal matrix of $Q$'s eigenvalues.
If we define $ \theta = \dfrac{1}{2} \tan^{-1} \bigg( \dfrac{ 2(-1) }{15 - 15 } \bigg) = \dfrac{\pi}{4} $
Then the rotation matrix $R$ is
$R = \begin{bmatrix} \cos \theta && - \sin \theta \\ \sin \theta && \cos \theta \end{bmatrix} = \dfrac{1}{\sqrt{2}} \begin{bmatrix} 1 && -1 \\ 1 && 1 \end{bmatrix} $
And $ D = \begin{bmatrix} D_{11} && 0 \\ 0 && D_{22} \end{bmatrix} $
where
$D_{11} = 15 \cos^2 \theta + 15 \sin^2 \theta + 2 (-1) \cos \theta \sin \theta = 14$
$ D_{22} = 15 \sin^2 \theta + 15 \cos^2 \theta - 2 (-1) \cos \theta \sin \theta = 16 $
i.e.
$ D = \begin{bmatrix} 14 && 0 \\ 0 && 16 \end{bmatrix} $
Thus far, we have the following equation,
$ (r - C) R D R^T (r - C) = 56 $
One final step, is to normalize the right hand side,
$ (r - C) R (D / 56) R^T (r - C) = 1 $
where
$ E = D / 56 = \begin{bmatrix} \dfrac{1}{4} && 0 \\ 0 && \dfrac{ 2 }{7 } \end{bmatrix} $
Therefore, if we define the vector variable $ u = R^T (r - C) $, then
we will have
$ u^T E u = 1 $
i.e.
$ \dfrac{ u_1^2 } {4 } + \dfrac{ u_2^2 } { (7/2) } = 1 $
Thus $ a^2 = 4 , b^2 = \dfrac{7}{2} $
The coordinates $u = (u_1, u_2)$ are centered at $C= [0.5, -0.5] $ and related to the $[x, y]$ coordinate axes by a rotation about $C$ by an angle of $\theta = \dfrac{\pi}{4} $.