<s>[INST] Where is the mistake? Finding an equation for the ellipse with foci $(1,2)$, $(3,4)$, and sum of distance to the foci equals to $5$. 
Find an equation for the ellipse with foci $(1,2)$, $(3,4)$, and sum of distance to the foci equals to $5$.

We consider the foci in the coordinate system $XY$ such that $X=x-2$ and $Y=y-1-x$, the coordinates of the foci in this system are $(-1,0)$ and $(1,0)$, furthermore $2a=5$, the equation of the ellipse in $XY$ is
\begin{equation}
\left( \frac{X}{2.5}\right)^2 + \left( \frac{Y}{\sqrt{5.25}} \right)^2 = 1
\end{equation}
and this can be expressed in $xy$ as
$$\left( \frac{x-2}{2.5} \right) + \left( \frac{y-1-x}{\sqrt{5.25}}\right) = 1$$
I have made the graph of the last equation and it is not the case that foci are $(1,2)$ and $(3,4)$, so, can anyone help me to see the mistake please?
 [/INST] Let $r = [x, y]^T, F_1= [1, 2]^T , F_2 = [3, 4]^T $
Define a reference coordinate frame $O'uv$ with origin at $O' = \dfrac{1}{2}(F_1 + F_2) = [2,3]^T $, and let the $u$ axis extend along the vector $F_1 F_2$ while the $v$ vector is perpendicular to it and $+90^\circ$ away from it.  If $r' =[u, v]^T $, then
$ r = O' + A r' $
where $A = \dfrac{1}{\sqrt{2}} \begin{bmatrix} 1 && -1 \\ 1 && 1 \end{bmatrix} $
Now the equation describing the ellipse in the $O'uv$ frame is
$ \dfrac{u^2}{a^2} + \dfrac{v^2}{b^2} = 1 $
To determine $a,b$ we have that the two focii are at $(-c, 0)$ and $(c, 0)$ where $c = \dfrac{1}{2} \sqrt{ (3 - 1)^2 + (4 - 2)^2 } = \sqrt{2} $.  In addition, we know that $2 a = 5$ , hence, $a = \dfrac{5}{2}$.  Now $c^2 = a^2 - b^2$ from which it follows that $b^2 = a^2 - c^2 = \dfrac{25}{4} - 2 = \dfrac{17}{4} $
Therefore, the equation of the ellipse in the $O' uv $ plane is
$ r'^T Q r' = 1 $
where $Q = 4 \begin{bmatrix} \dfrac{1}{25} && 0 \\ 0 && \dfrac{1}{17} \end{bmatrix} $
Now since $ r = O' + A r' $ , then $ r' = A^{-1} (r - O') $
Substituting this in the equation of the ellipse results in
$ (r - O')^T A^{-T} Q A^{-1} (r - O') = 1 $
We now have:  $A^{-1} = A^T = \dfrac{1}{\sqrt{2}} \begin{bmatrix} 1 && 1 \\ -1 && 1 \end{bmatrix} $
And $A^{-T} = A $. Therefore,
$A^{-T} Q A^{-1} = A Q A^T = \dfrac{1}{425} \begin{bmatrix} 84 && -16 \\ -16 && 84 \end{bmatrix}$
The resulting equation in the $xy$ plane is,
$ 84 (x - 2)^2 - 32 (x - 2)(y - 3) + 84 (y - 3)^2 = 425 $
</s>