This page is temporarily under construction
Suppose, however, that instead of going to the top, your path veers away from the summit, as in the contour map below. In his map, the dotted green curve is the path and the solid red curves are the contours of constant elevation.
Suppose that the green curve is described by Then the highest point reached while hiking along the path is the maximum of subject to the constraintThere are many ways to find this maximum height. One direct way is to assume that the path may be described by one variable as an explicit function of the other,
so that a function of a single variable. Then, differentiating and setting equal to zero, using the chain rule gives Similarly, if then the condition for an extreme isImagine again that you are hiking along the path as described above. At the maximum of your elevation, the steepest direction of the hillside would be to your sides, perpendicular to your path. That is, your path is perpendicular to the gradient of the function that describes the elevation, and tangent to the level sets (or contours) of the function. This is suggested in the figure above.
The path is a level set of the function G, and so the gradient of G must also be perpendicular to the path. That is, the gradients of f and G must be perpendicular,
in the figure below, the arrow represents the common direction of the gradients. But, if two vectors are parallel, their cross product must be zero, which in this case would mean that the condition for an extreme subject to the constraint isA generalization of the above method is shown in the next section, Lagrange Multipliers.
In this case,
so that may be found explicitly. Differentiating and setting equal to zero gives where the second coordinate is found from the constraint G=5.The situtation is illustrated below; it can be seen that at the closest point, the line is tangent to a circle centered at the origin. (In this rigged problem, the tangent circle is the unit circle.)
In this case,
and (Note that finding one variable as an explicit function of the other is already done.) Differentiating and setting equal to zero givesIn solving this, you must be careful: How many roots do you obtain, and why does the number of roots depend on the value of a? Are the solutions maxima or minima of the distance from the point? A figure (which you can draw yourself) might help.