A unit square is placed with the bottom left corner at the origin and the top right corner at $(1,1)$. The base vertices then slide on the $x$ and $y$ axes as shown in the animation below. The top right vertex traces a curve. Show that this curve is an ellipse, and find its semi-major and semi-minor axes.
My attempt:
So, obviously, we want to parametrize the coordinates of the top right corner in terms of the rotation angle of the square. Turning the square by an angle $\theta$, the coordinates of the base are $(\cos \theta, 0)$ and $(0, \sin \theta)$, so the coordinates of the top right corner are consequently,
$ P = (\cos \theta, 0) + (\sin \theta, \cos \theta ) = ( \cos \theta + \sin \theta, \cos \theta) $
This can be written as
$P = \cos \theta (1, 1) + \sin \theta (1, 0) $
or more compactly as
$ P = \begin{bmatrix} 1 && 1 \\ 1 && 0 \end{bmatrix} u $
where $u = [\cos \theta, \sin \theta ]^T $
From this last equation, and solving for $u$, we get
$u = \begin{bmatrix} 1 && 1 \\ 1 && 0 \end{bmatrix}^{-1} P = \begin{bmatrix} 0 && 1 \\ 1 && -1 \end{bmatrix} P $
Now $u$ is a unit vector, i.e. $u^T u = 1$. Using the expression for $u$ in terms of $P$ we can write
$u^T u = 1 = P^T \begin{bmatrix} 0 && 1 \\ 1 && -1 \end{bmatrix}^T \begin{bmatrix} 0 && 1 \\ 1 && -1 \end{bmatrix} P = P^T \begin{bmatrix} 0 && 1 \\ 1 && -1 \end{bmatrix} \begin{bmatrix} 0 && 1 \\ 1 && -1 \end{bmatrix} P = P^T \begin{bmatrix} 1 && -1 \\ -1 && 2 \end{bmatrix} P $
Thus, we now have
$P^T Q P = 1 $
where $Q =\begin{bmatrix} 1 && -1 \\ -1 && 2 \end{bmatrix} $
Diagonalize $Q$ (i.e. put it in the form $Q = R D R^T$ as follows:
Define $\phi = \frac{1}{2} \tan^{-1}\left( \dfrac{2(-1)}{1 - 2} \right) = \frac{1}{2} \tan^{-1}(2) $
It follows that $ \cos(2 \phi) = \dfrac{1}{\sqrt{5}} \Rightarrow \cos(\phi) = \sqrt{ \dfrac{ 1 + \sqrt{5}}{2 \sqrt{5}}} \Rightarrow \sin(\phi) = \sqrt{\dfrac{\sqrt{5} - 1}{2 \sqrt{5}}} $
Step 2. above gives us the rotation matrix $R$, namely,
$ R = \begin{bmatrix} \cos(\phi) && - \sin(\phi) \\ \sin(\phi) && \cos(\phi) \end{bmatrix} $
- Diagonal elements of $D$ are
$D_{11} = Q_{11} \cos^2(\phi) + Q_{22} \sin^2(\phi) + 2 Q_{12} \sin \phi \cos \phi = \dfrac{3 \sqrt{5} - 5}{2 \sqrt{5}} $
$D_{22} = Q_{11} \sin^2(\phi) + Q_{22} \cos^2(\phi) - 2 Q_{12} \sin \phi \cos \phi = \dfrac{5 + 3 \sqrt{5}}{2 \sqrt{5}} $
Hence, finally, we have the semi-major axis length
$a = \dfrac{1}{\sqrt{D_{11}}} = \sqrt{ \dfrac{ 2 \sqrt{5} }{3 \sqrt{5} - 5}} = \sqrt{ \dfrac{ 2 \sqrt{5} ( 3 \sqrt{5} + 5 ) }{20}}\\ = \sqrt{\dfrac{3 + \sqrt{5}}{2}} = \sqrt{ 1 + \Phi } = \Phi \approx 1.618$
and the semi-minor axis length
$b = \dfrac{1}{\sqrt{D_{22}}} = \sqrt{ \dfrac{ 2 \sqrt{5}}{ 5 + 3\sqrt{5}} } = \sqrt{ \dfrac{ 2 \sqrt{5}( 3 \sqrt{5} - 5 ) }{20} } = \\ \sqrt{ \dfrac{3 - \sqrt{5}}{2} } = \sqrt{ 2 - \Phi } = \sqrt{1 + 1 - \Phi} =\sqrt{1 + \Phi^2 - 2 \Phi } = \Phi - 1 \approx 0.618 $
Where $\Phi$ is the golden ratio, $\Phi = \dfrac{ 1 + \sqrt{5} }{2} $