TITLE: What is the intuition behind $x^T A x$?
QUESTION [6 upvotes]: Consider an $N$-dimensional vector $x$, and a $N \times N$ matrix $A$. Throughout linear algebra, I find the expression $x^T A x$ to be extremely common.
Is there some fundamental intuition or geometric meaning behind it?

REPLY [10 votes]: I like to think about ${\bf x}^t {\bf A} {\bf x}$ geometrically.
Consider ${\bf x} = \{x,y,z\} \in \mathbb{R}^3$, and the special case ${\bf A}$ is the $3 \times 3$ identity matrix.  Consider ${\bf x}^t {\bf A} {\bf x} = 1$ which, written out, is:
$x^2 + y^2 + z^2 = 1$, which is of course a sphere:

In short, you can think of ${\bf x}^t{\bf A}{\bf x}$ as leading to a scalar value throughout the space.  When you solve for positions that give a particular value, you get a surface whose shape depends upon ${\bf A}$.  Since the equation is a quadratic, you get spheres, ellipsoids and other quadratic surfaces.
If ${\bf x}^t {\bf A} {\bf x} = 4$, the sphere's radius is $2$.
If ${\bf A} = \{ \{ 3,0,0 \}, \{ 0,1,0 \}, \{0,0,1 \} \}$
then the equation is 
$3 x^2 + y^2 + z^2 = 1$, or an ellipsoid:

For other positive-definite matrices the surface will be tipped and elongated appropriately due to cross terms.
If ${\bf A}$ isn't positive definite we get other quadratics, e.g., if ${\bf A} = \{ \{1,0,0 \}, \{0,-2,0 \}, \{0,0,1 \} \}$ and we solve for ${\bf x}^t {\bf A} {\bf x} = 1$:

Here are the surfaces for different values of the constant: