TITLE: Eigenvalues and Eigenvectors of $2 \times 2$ Matrix
QUESTION [11 upvotes]: Let's say I have a $2 \times 2$ matrix (actually the structure tensor of a discrete image - I):
$$ \begin{bmatrix}
 \frac{\partial I}{\partial x}\frac{\partial I}{\partial x} & \frac{\partial I}{\partial x}\frac{\partial I}{\partial y} \\\ 
    \frac{\partial I}{\partial y}\frac{\partial I}{\partial x} & \frac{\partial I}{\partial y}\frac{\partial I}{\partial y}
\end{bmatrix}$$
It has 2 properties:  

Symmetric.
Positive Semidefinite.  

Given those properties, what would be the easiest method to numerically compute its eigenvectors (orthogonal) and eigenvalues?

REPLY [5 votes]: Despite other answers, I thought it might benefit the impatient to see the explicit answer below.
Let $$M = 
\left(
\begin{array}{cc}
 a & b \\
 b & c
\end{array}
\right),$$
be the input matrix. 
Define the discriminant: $\Delta = \sqrt{a^2+4 b^2-2 a c+c^2}$
Then, the eigenvalues of $M$ are given by:
$\lambda_1 = 0.5(a+c-\Delta)$ and $\lambda_2 = 0.5(a+c+\Delta)$
Now, you can find a matrix $V$ such that 
$$M = V^{-1} \begin{pmatrix}
\lambda_1 & 0\\
0 & \lambda_2
\end{pmatrix}V.$$
Mathematica says that the matrix $V$ is given by
$$
V = \begin{pmatrix}
\frac{a-c-\Delta}{2b} & 1\\
\frac{a-c+\Delta}{2b} & 1
\end{pmatrix}
$$
If you are looking for orthogonal $V$, then the above calculations need some changes.