# On quadratic forms to determine the shape of an ellipsoid

Here is a quick note on how to use the notion of quadratic forms and diagonalization in order to determine the semi-major and semi-minor axes of a three-dimensional ellipsoid.

Let $A$ be an invertible 2×2 symmetric matrix, and $c$ is a constant. The set of all $\mb{x}\in \mathbb{R}^2$ that satisfies $Q(\mb{x}) = \mb{x}^T A \mb{x} = \begin{bmatrix} x_1 & x_2 \end{bmatrix} \begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = c,$

either corresponds to an ellipse (or circle) or hyperbola (or a degenerate configuration of two intersecting lines, a single point, or no points at all). We call $Q(\mb{x})$ a quadratic form.

We focus on the case of an ellipse. We want to know what are the major and minor axes lengths, and their orientation. The key is to orthogonally diagonalize $A$. We write $A = PDP^{-1}$, which is $A = PDP^T$ had we made the eigenvectors orthonormal. Then we perform a coordinate map $\mb{x} = P\mb{y}.$

The quadratic form becomes $(P\mb{y})^T A (P\mb{y}) = \mb{y}^T P^T A P\mb{y} = \mb{y}^T D \mb{y} = \lambda_1 y_1^2 + \lambda_2 y_2^2 = c,$

if the eigenvalues $\lambda_1, \lambda_2$ were used to diagonalize the matrix. In other words, diagonalization allows us to remove the cross terms from the equation of the ellipse, making the semi-major and semi-major axes transparent, $\frac{y_1^2}{(c/\lambda_1)} + \frac{y_2^2}{(c/\lambda_2)} = 1.$

Also, the orientation of the new axes (i.e. the orientation of the ellipse) will be given by the eigenvectors.

### Example

Find the length of the semi major and semi minor axes for the quadratic form $5 x_1^2 - 4 x_1 x_2 + 5 x_2^2 = 48,$

by making a change of variable and removing the cross-product terms.

Spoiler