There is a variety of problems where one searches for a vector such that the squared sum of the lengths of projections of points onto that vector is maximized or minimized:
This can be written as a Lagrange function by introducing a Lagrangian multiplier for the constraint:
Optimization of the original problem is equivalent to finding a solution to the following equation system:
The first line of this equation tells us that must be an eigenvector of with eigenvalue . Let’s call those and . Plugging this solution back into our original problem (and remembering that the eigenvector is not necessarily unit length) we obtain:
Depending on whether we want to obtain a minimum or a maximum we can choose the eigenvector with the smallest or largest eigenvalue respectively.