Ellipse in a Rectangle What is the equation for an ellipse (or rather, family of ellipses) which has as its tangents the lines forming the rectangle $$x=\pm a, y=\pm b\;\; (a,b>0)$$?
This question is a modification/extension of this other question here posted recently.

This solution is inspired by the Lissajous diagram. 
Consider two signal inputs $x, y$ which are out of phase, with magnitudes $a,b$ respectively, fed into an oscilloscope.
The resulting Lissajous diagram will be a tilted ellipse with tangents $x=\pm a, y=\pm b$ and parametric equations
$$\begin{cases}
x=a\sin(t+u)\\
y=b\cos(t+v)\end{cases}$$
with $t$ being the parameter.
Eliminating* $t$ gives the Cartesian form as follows:
$$\color{red}{\frac {x^2}{a^2}+\frac{y^2}{b^2}-\frac {2xy}{ab}\sin(u-v)=\cos^2(u-v)}$$
which is the equation of the family of ellipses with tangents $x=\pm a, y=\pm b$. 
Alternatively, this can be stated using a variable $m$ in place of $\sin(u-v)$ where $|m|\le 1$, i.e. 
$$\color{red} 
{ \frac {x^2}{a^2}+\frac {y^2}{b^2}-\frac {2mxy}{ab}=1-m^2\qquad (|m|\le 1)}\\
$$
The tangent points are $\pm(am,b), \pm(a,bm)$.
See desmos implementation here.


$\color{lightgrey}{\text{*Detailed derivation below:}}$
$$\color{lightgrey}{
\begin{align}
t=\overbrace{\sin^{-1}\left(\frac xa\right)}^\alpha-u&=
\overbrace{\cos^{-1}\left(\frac yb\right)}^\beta-v\\
\alpha-\beta&=u-v\\
\sin(\alpha-\beta)&=\sin(u-v)\\
\sin\alpha\cos\beta-\cos\alpha\sin\beta&=\sin(u-v)\\
\frac xa\cdot \frac yb-\sqrt{\left(1-\frac {x^2}{a^2}\right)}
\cdot \sqrt{\left(1-\frac {y^2}{b^2}\right)}&=\sin(u-v)\\
xy-ab\sin(u-v)&=\sqrt{(a^2-x^2)(b^2-y^2)}\\
x^2y^2-2abxy\sin(u-v)+a^2b^2\sin^2(u-v)&=(a^2-x^2)(b^2-y^2)\\
&=a^2b^2-b^2x^2-a^2y^2+x^2y^2\\
b^2x^2+a^2y^2-2abxy\sin(u-v)-a^2b^2(1-\sin^2(u-v))&=0\\
b^2x^2+a^2y^2-2abxy\sin(u-v)-a^2b^2\cos^2(u-v)&=0\\
\frac {x^2}{a^2}+\frac{y^2}{b^2}-\frac {2xy}{ab}\sin(u-v)&=\cos^2(u-v)
\end{align}}$$
