Computational Physics, Linear Algebra, Math, Mathematics, Science.
and why this can be done easily without cross terms. The difficulty is that we want a constrained optimization, that is to find the minimum or the maximum of the function for f(x) being a unit vector. We can note that the minimum of f(x) is the minimum eigenvalue of the corresponding matrix A.