Clear questions and runnable code get the best and fastest answer 

PerlMonks 
Re^2: Help with Matrix math!by pc88mxer (Vicar) 
on Dec 17, 2007 at 05:04 UTC ( #657368=note: print w/ replies, xml )  Need Help?? 
In this case you have to take into account the constraint on the vector x. The quadratic form x_{i}D_{ij}x_{j} is unbounded on R^{n}, so a derivative test (even with an Hessian test) is only going to find local extreme points, and there is no guarantee that those points will lie on the surface of interest (i.e. x'x = 1.) The difference is that for a point to be a local maximum when x is constrained, the derivative only needs to be zero when evaluated in the tangent space of the constraining surface at that point, not zero in every direction. The standard way to include the surface constraint is to use Lagrangian multipliers.
In Section
Seekers of Perl Wisdom

