### The Optimization problem

Consider a collection of points in the plane, or more generally in $R^n$. In many cases, we want to find the line that is closest to this collection of points - or more generally the plane, or affine space of a fixed dimension. Two common reasons for this are:

#### Best line in space

Next, suppose we want to find the line that minimizes distance. We can again wirte this as minimizing a function - though it is a nice bit of linear algebra to figure out which function. We then apply the first derivative test - which tells us that we should compute an eigenvalue. But the solution is not unique. In this case, we typically just compare the values at solutions, but this illustrates why we may need second derivative tests.