{%hackmd 5xqeIJ7VRCGBfLtfMi0_IQ %}
# Quadratic curve
## Problem
Consider the equation $5x^2 - 2xy + 5y^2 = 1$. Observe the equation by the basis $\beta = \{\bu_1, \bu_2\}$ such that every point can be written as $p\bu_1 + q\bu_2$, where
$$
\bu_1 = \frac{1}{\sqrt{2}}\begin{bmatrix} 1 \\ 1 \end{bmatrix}
\text{ and }
\bu_2 = \frac{1}{\sqrt{2}}\begin{bmatrix} -1 \\ 1 \end{bmatrix}.
$$
What is the equation in terms of $p$ and $q$?
## Thought
We will convert the equation into a matrix form, called the quadratic form, and then observe the matrix by $\beta$.
By direct computation, we have
$$
ax^2 + bxy + cy^2 = 1
$$
is equivalent to
$$
\begin{bmatrix} x & y \end{bmatrix}
\begin{bmatrix}
a & \frac{b}{2} \\
\frac{b}{2} & c
\end{bmatrix}
\begin{bmatrix} x \\ y \end{bmatrix} = 1.
$$
Thus, the given equation can be written as
$$
\begin{bmatrix} x & y \end{bmatrix}
\begin{bmatrix}
5 & -1 \\
-1 & 5
\end{bmatrix}
\begin{bmatrix} x \\ y \end{bmatrix} = 1,
$$
where the matrix at the center is denoted by $A$.
Naively, the answer is the equation given by
$$
\begin{bmatrix} p & q \end{bmatrix}
[f_A]_\beta^\beta
\begin{bmatrix} p \\ q \end{bmatrix} = 1.
$$
Here we provide a bit more details. For any point in $\mathbb{R}^2$, it can be represented by
$$
x\be_1 + y\be_2 = p\bu_1 + q\bu_2,
$$
where $\mathcal{E}_2 = \{\be_1, \be_2\}$ is the standard basis. Naturally, we have the relations
$$
[\idmap]_{\mathcal{E}_2}^\beta
\begin{bmatrix} x \\ y \end{bmatrix} =
\begin{bmatrix} p \\ q \end{bmatrix}
\text{ and }
[\idmap]_\beta^{\mathcal{E}_2}
\begin{bmatrix} p \\ q \end{bmatrix} =
\begin{bmatrix} x \\ y \end{bmatrix}.
$$
Note that the given basis is orthonormal, so $[\idmap]_\beta^{\mathcal{E}_2}$ is an orthogonal matrix, which means $[\idmap]_{\mathcal{E}_2}^\beta = ([\idmap]_\beta^{\mathcal{E}_2})^{-1} = ([\idmap]_\beta^{\mathcal{E}_2})\trans$.
By replacing $x$ and $y$ by $p$ and $q$, we have
$$
\begin{bmatrix} x & y \end{bmatrix}
A
\begin{bmatrix} x \\ y \end{bmatrix} =
\begin{bmatrix} p & q \end{bmatrix}
([\idmap]_\beta^{\mathcal{E}_2})\trans
A
[\idmap]_\beta^{\mathcal{E}_2}
\begin{bmatrix} p \\ q \end{bmatrix} =
\begin{bmatrix} p & q \end{bmatrix}
[f_A]_\beta^\beta
\begin{bmatrix} p \\ q \end{bmatrix},
$$
leading to the desired result.
## Sample answer
We may write the equation $5x^2 - 2xy + 5y^2 = 1$ as
$$
\begin{bmatrix} x & y \end{bmatrix}
\begin{bmatrix}
5 & -1 \\
-1 & 5
\end{bmatrix}
\begin{bmatrix} x \\ y \end{bmatrix} = 1,
$$
and denote the central matrix as $A$. By direct computation, we have
$$
\begin{aligned}
f_A(\bu_1) &= \begin{bmatrix} 5 & -1 \\ -1 & 5 \end{bmatrix}
\begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} =
\begin{bmatrix} \frac{4}{\sqrt{2}} \\ \frac{4}{\sqrt{2}} \end{bmatrix} =
4\bu_1 + 0\bu_2, \\
f_A(\bu_2) &= \begin{bmatrix} 5 & -1 \\ -1 & 5 \end{bmatrix}
\begin{bmatrix} -\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} =
\begin{bmatrix} -\frac{6}{\sqrt{2}} \\ \frac{6}{\sqrt{2}} \end{bmatrix} =
0\bu_1 + 6\bu_2. \\
\end{aligned}
$$
Consequently,
$$
[f_A]_\beta^\beta =
\begin{bmatrix} 4 & 0 \\ 0 & 6 \end{bmatrix}
$$
and the corresponding equation is $4p^2 + 6q^2 = 1$, which is an equation for an ellipse with semi-major axis of length $\frac{1}{\sqrt{6}}$ and semi-minor axis of length $\frac{1}{2}$.
## Note
You may use [desmos](https://www.desmos.com/calculator) to plot the to equations to observe their relation.
*This note can be found at Course website > Learning resources.*