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.
 A: Consider the family of rhombuses that are tangent to the unit circle at 4 edges. Then a linear transformation brings the rhombuses to the rectangle and the unit circle to the family of ellipses inside the rectangle at 4 edges. 
Explicitly, draw a rhombus such that it's tangent to the unit circle at 4 edges, and two edges are parallel to x-axis, and the other two edges make an angle $2\theta$ with the x-axis. Then by a shearing along the x-axis, then a scaling along the x-axis and y-axis, you can transform the rhombus to the rectangle you gave.
Using this method, we get the family of ellipses 
$$\frac{x^2}{a^2\sin^2{(2\theta)}}+\frac{y^2}{b^2\sin^2{(2\theta)}}+\frac{2\cos{(2\theta)}xy}{ab\sin^2{(2\theta)}}=1$$
with $0<\theta<\pi/2$
It's easy to see why this would give ALL such ellipses inside the rectangle.
BTW you can check that when $\theta = \pi/4$, the ellipse is just $x^2/a^2+y^2/b^2=1$, the most obvious one. When $\theta = 0$, it degenerates to a diagonal, and when $\theta = \pi/2$, it degenerates to the other diagonal.
A: By exploiting the affine map $(x,y)\mapsto\left(\frac{x}{a},\frac{y}{b}\right)$ the question boils down to finding the family of ellipses inscribed in a square with vertices at $(\pm 1,\pm 1)$. In a ellipse the line joining the midpoints of parallel chords always go through the center. Additionally, the orthoptic curve of an ellipse is the director circle. It follows that all the ellipses that are tangent to the sides of the previous square fulfill $a^2+b^2=2$, are centered at the origin and are symmetric with respect to the diagonals of the square.

Here it is a straightedge-and-compass construction.


*

*Take some point $P$ on the perimeter of the square and by reflecting it with respect to the center and the diagonals of the square construct the rectangle $PQRS$;

*Consider the tangents at $P,Q,R,S$ at the circumcircle of $PQRS$;

*Two intersections of such tangents are the vertices of the inscribed ellipse through $P$, that is simple to draw.

A: 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}}$$
A: Here's a purely algebraic approach without any use of trigonometric functions.
By symmetry, the center of the ellipse is at the origin, so its
equation is just
$$
Ax^2 + Bxy + Cy^2 = 1
$$
with $A>0,$ $C>0,$ and $B^2 < 4AC.$
The tangents at $y = \pm b$ will occur at values of $y$ for which the
quadratic equation in $x,$ $Ax^2 + Bxy + Cy^2 - 1 = 0,$
has a double root.
This occurs when 
$$(By)^2 - 4A(Cy^2 - 1) = 0,$$
that is, at
$$
y^2 = \frac{4A}{4AC - B^2}.
$$
For similar reasons, the tangents at $x=\pm a$ occur when
$$
x^2 = \frac{4C}{4AC - B^2}.
$$
(Note that the conditions on $A,$ $B,$ and $C$ guarantee that 
$\frac{4A}{4AC - B^2} > 0$ and $\frac{4C}{4AC - B^2} > 0.$)
Set
$$
\frac{4C}{4AC - B^2} = a^2, \quad
\frac{4A}{4AC - B^2} = b^2.
$$
It follows that $C=A a^2/b^2.$ Using this to substitute for $C$
in one of the equations above and solving for $B,$ we get
$$B = \pm\sqrt{ \frac{ 4A(a^2A - 1)}{b^2}}.$$
It follows that $a^2A - 1\geq 0,$ that is, $A \geq \frac1{a^2}.$
If $A = \frac1{a^2}$ then $B = 0$ and $C = \frac1{b^2},$
that is, we get the equation of the inscribed ellipse whose axes are aligned with the coordinate axes.
For any other value of $A$ we get an ellipse whose axes are inclined;
the direction of inclination depends on whether we choose the positive
or negative.
For very large values of $A$ the major axis of the ellipse is very
nearly the diagonal of the rectangle.
