Let A and B$∈R^{2×2}$ are symmetric matrices, $x^Tx=1,x∈R^2$, can we prove that the trajectory of ($x^TAx$,$x^TBx$) is an ellipse? Suppose $A,B\in \mathbb{R}^{2×2}$ are symmetric matrices and $x\in \mathbb{R}^2$ is a unit vector. Can we prove that the trajectory of $(x^TAx,x^TBx)$ is an ellipse?If not,what is the trajectory of it?
 A: Indeed we can. Since $A$ and $B$ are symmetric, they are diagonalizable by a rotation and have real eigenvalues. In particular, we can rotate our coordinates in $\mathbb{R}^2$ such that $A$ is a real diagonal matrix. Since rotations preserve any geometric shapes, our problem is unaffected, so let's do this and say $A$ has eigenvalues $\lambda_1, \, \lambda_2$. If $x = (\cos(t),\sin(t))^T$, then, we have
$$x^TAx = \lambda_1 \cos^2(t)+\lambda_2 \sin^2(t).$$
Now $B$ also admits an orthonormal eigenbasis, which in two dimensions can be described by a rotation of the coordinate axes by some fixed angle, say $\phi$. Then if we say $B$ has eigenvalues $\mu_1, \, \mu_2$, we have
$$x^TBx = \mu_1 \cos^2(t+\phi)+\mu_2 \sin^2(t+\phi).$$
$x^T A x$ varies between $\min(\lambda_1, \lambda_2)$ and $\max(\lambda_1, \lambda_2)$ and similarly for $x^T B x$. To normalize position in some manner, let's try to understand the trajectories relative to the "base point" $(\lambda_1, \mu_1)$:
$$(x^T A x, x^T B x) - (\lambda_1, \mu_1) = \left( (\lambda_2-\lambda_1)\sin^2(t),(\mu_2 - \mu_1)\sin^2(t+\phi) \right)$$
When $\phi=0$, the above parameterizes the closed line segment between the origin and $(\lambda_2-\lambda_1,\mu_2-\lambda_1)$, so once we add back the base point, these trajectories include all closed line segments in $\mathbb{R}^2$. A line segment is also produced if $\lambda_1 = \lambda_2$, so let's assume $\lambda_1 \neq \lambda_2 $ and rescale (which preserves ellipses), i.e. let's set $r := \frac{\mu_2 - \mu_1}{\lambda_2 - \lambda_1}$ and understand the trace of
$$\frac{(x^T A x, x^T B x) - (\lambda_1, \mu_1)}{\lambda_2-\lambda_1} = \left( \sin^2(t), r \sin^2(t+\phi) \right). $$
So, up to geometrically trivial rotating, translating, and rescaling, we have a two-parameter family of curves. Are these curves ellipses? Well, we can now notice that ellipses are also preserved by scaling the vertical coordinate to recognize that the question is equivalent to whether the trace of (again $r=0$ recovers a line segment, so we'll neglect that for now)
$$\left( \sin^2(t),\sin^2(t+\phi) \right )$$
is an ellipse. Using the angle-sum identity, one can find that this is the graph
$$y = \sin^2(\phi) + x \cos(2 \phi) \pm \sqrt{x(1-x)} \sin(2 \phi),$$
Let's shift away the $\sin^2(\phi)$, so $y \to y - \sin^2(\phi)$, so the shifted graph solves
$$x(1-x) \sin^2(2 \phi) = ( y - x \cos(2 \phi))^2, $$
or
$$x^2 - 2\cos(2 \phi) xy + y^2 - \sin^2(2 \phi) x = 0.$$
This is of the general quadratic form
$$Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0 $$
with $B^2 - 4AC = 4(\cos^2(2 \phi) -1) < 0$ when $\phi$ is not an integer multiple of $\pi/2$, showing the curve is indeed an ellipse outside of these "small" exceptions.
When $\phi$ is an integer multiple of $\pi/2$, $\sin^2(t+\phi)$ is either $\sin^2(t)$ or $\cos^2(t)$, both of which produce a line segment. So all of our exceptional cases correspond to line segments-- when exactly do these occur? Our exploration indicates this happens when either $\lambda_1 = \lambda_2$, $\mu_1 = \mu_2$, or $\phi$ is an integer multiple of $\pi/2$. Recalling the definitions of $\lambda, \, \mu,$ and $\phi$, these exactly delineate the cases in which $A$ and $B$ are simultaneously diagonalizable, which is the case in $2$ dimensions iff they commute. That is, the trajectory is an ellipse iff $A, \, B$ do not commute, and it is a line segment otherwise.
A: It seems that your conjecture is right. Let me give you some tips in order to see what is the desired trajectory.
First of all, remember that the general form of an arbitrary ellipse is given by the equation
$$\mathbf{A}X^2 + \mathbf{B}XY + \mathbf {C} Y^2+\mathbf{D}X + \mathbf{E}Y +\mathbf{F}=0, \quad (1)$$
where $\mathbf{B}^2-4\mathbf{AC}<0.$
Now, since $x^Tx=1,$ we have that $\Vert x \Vert =1$, that is, $x$ lives in the unit circle $\mathbb{S}^1$, hence we can write $x= \left[ \begin{matrix} \cos(t) \\ \sin(t) \end{matrix} \right]$ for some parameter $t \in [0, 2\pi).$
Write down $$A = \left[ \begin{matrix} a & b \\ b & c \end{matrix} \right], B=\left[ \begin{matrix} d & e \\ e & f \end{matrix} \right].$$
Then we should obtain
$$x^TAx = a\cos^2(t) + 2b \cos(t) \sin (t)+c \sin^2(t),$$ $$x^TBx = d\cos^2(t) + 2e \cos(t) \sin (t)+f \sin^2(t).$$
Plug $X= x^TAx, Y=x^TBx$ in the equation (1). Now, in order to find the coefficients $\mathbf{A,B,C,D,E}$ and $\mathbf{F},$ you should give some specific suitable values for $t,$ such that you obtain a system of six linear equations (that of course, could be solved by some software). For example, if $t=0$, we have the first equation
$$\mathbf{A}a^2+\mathbf{B}ad + \mathbf{C} d^2 + \mathbf{D} a + \mathbf{E} d + \mathbf{F}=0.$$
Could you try to solve the system? It should works.
Now, the only thing you have to do, once you find the desired coefficients, is to verify that $\mathbf{B}^2-4\mathbf{AC}<0.$
Hope it helps.
