Maximizing the squared distance avoids differentiating a square root. The Lagrange multiplier equations for are
Adding and subtracting the first two gives and . The feasible stationary points therefore lie on or . The first case gives and squared distance . The second gives and , with squared distance .
The ellipse is compact and its constraint gradient does not vanish on the curve, so an extremum exists among these points. A direct global check is , using . Equality occurs when . Consequently
Assume positive corridor widths . Write the line through the two wall-contact endpoints in intercept form. Requiring it to pass through the inner corner gives
Its squared length is . Apply Lagrange multipliers to this function subject to :
Multiplying by and respectively eliminates the multiplier, giving . Substitute and multiply by :
The branch is geometrically inadmissible. Thus and . If and , the two intercepts become and , so
Along in the positive quadrant, as or , and this is its only stationary point. It is therefore the minimum of the longest sticks that fit at each orientation. A stick being turned must pass through every intermediate orientation, so this narrowest clearance is precisely the maximum carryable length, rather than a maximum of . This is the ladder around a right-angled corner problem, with a zero-width stick and wall contact allowed as in the ideal geometry.
Figure 1.
The critical ladder position touching the two outer walls and the inner corridor corner
. Details.
At a regular constrained stationary point, the Lagrange multiplier equations are , . Eliminating the multiplier gives
Thus the required Lagrange multiplier determinant condition in two variables is
If the constraint gradient vanishes, this determinant is zero automatically, although the regular multiplier theorem cannot be applied. The condition is necessary and is not sufficient to classify the constrained point. This addresses the original unnumbered task before part (a).
Differentiate the polynomial and factor:
The stationary points therefore have horizontal coordinates
For a check, is negative at the first and positive at the second, giving a local maximum and a local minimum respectively.
The partial derivatives are and , so all stationary points are for integers . Their Hessian matrix is . At even multiples of it is a positive-definite matrix, whereas at odd multiples it has one positive and one negative eigenvalue. Consequently
There are no local maxima. Since both and are nonnegative, these are also global minima. In the requested open plotting window, the stationary points are and ; the local minima at lie on excluded edges.
For a level set , solving for the vertical coordinate gives
For these level sets are closed ovals around each local minimum. At the level sets shrink to the local minima. The level set through the saddle points is
where the two signed branches together describe the same set as . They cross at and reach . The crossing slopes at a saddle point are , as also follows from the local quadratic form . For , the upper and lower level sets remain separate and extend across the plotting window without meeting the horizontal axis.
Figure 1.
Contours of the cosine-plus-quadratic function, with its saddle level and stationary points labelled
. Details.
At a regular constrained stationary point, the change in along every allowed tangent direction must vanish. Thus its gradient is normal to the constraint curve, giving the Lagrange multiplier equations
provided . Solve these equations for , then classify the candidates using the constraint or a constrained second-derivative test. Points where the constraint gradient vanishes require separate analysis.
For variables and regular independent constraints , use one multiplier per constraint:
There are scalar equations in the unknowns. Independence of the constraint gradients is the regularity condition; boundary points must be treated separately when present.
Introduce a second multiplier and use
The stationary equations become . Writing gives
The two constraints determine the constants through
Equivalently, with , and . This is the maximum entropy distribution with a prescribed finite mean.
For nonconstant , a strictly positive solution exists exactly when . The mean's derivative with respect to is , so is unique in that case. At either extreme mean no strictly positive solution exists. If all , feasibility requires and the extra constraint is redundant: , while are not separately identifiable. The negative entropy Hessian ensures that any feasible interior stationary point is the unique constrained maximum.
The Taylor series of the logarithm gives
The first nonzero term is therefore . It is positive on either side of the origin, so the stationary point is a strict local minimum. In fact , with equality only at zero, making it the global minimum as well.
Within the requested first-quadrant square, the stationary points visible in the contour plot are the corner minimum and the saddle . Near the origin, , so the low positive contours look like quarter-circles. Along either coordinate axis, rises monotonically. Along the diagonal, rises to at , returns to zero at , then becomes negative.
The saddle contour crosses at and separates the central positive contours from the outer diagonal region. Negative contours occur toward , where , while the axis corners and have . These checks determine both the contour ordering and the change of connectivity at the saddle; the figure shows these level sets.
Figure 1.
Contours of the quartic function in the first-quadrant square, with the saddle level highlighted
. Details.
The first partial derivatives factor as
If either coordinate vanishes, the other equation forces the other coordinate to vanish as well. If both are nonzero, subtracting the two bracket equations gives , and then . Thus the complete list of stationary points is and the four points .
The Hessian matrix is
At the origin it is , which is a positive-definite matrix. At the four other points its eigenvalues are and , independently of the signs. The second-derivative test therefore gives
There are no local maxima. The minimum at the origin is not global, since as .
For , the gradient is , and
Away from the origin, both and lie in the one-dimensional subspace perpendicular to , so they are parallel. More precisely,
for some scalar , including . If , this can also be inverted to express as a multiple of . At a stationary point of with , that literal inverse wording is not valid; the geometric assertion is parallelism of the nonzero gradient directions.
Write , , at the stationary point, and let . Under the usual second-order Taylor expansion hypothesis, the second-derivative test gives
Indeed the quadratic term is . For , completing its square gives . The two coefficients have the same positive sign, the same negative sign, or opposite signs in the respective cases. A negative also forces the two Hessian eigenvalues to have opposite signs, including the case .
There is a qualification to the printed assumptions: existence of second partial derivatives only at the point does not ensure the needed quadratic approximation. Continuous second partial derivatives in a neighborhood are sufficient. The existence of second partial derivatives does not justify the Hessian test: for example, the function away from the origin, extended by , has Hessian at the origin but and . Thus the classification above uses the standard additional regularity assumption, which the smooth function in part (b) satisfies.
An interior stationary point has vanishing gradient:
For a differentiable function, this is the necessary first-order condition for an interior local minimum or local maximum.
Put , so . Since and , its stationary points satisfy
The origin occurs for every real . There are two additional points only for , at .
At a stationary point, the Hessian matrix simplifies because :
At the origin this is , so is a strict local minimum for every , with . If it is also the unique global minimum, since with equality only there. For , the two extra points have , so their Hessian has opposite-sign eigenvalues. Thus
There are no local maxima. When , the origin is not a global minimum: as , but never attains zero.
The sign of is the sign of . Therefore
The positive region includes both coordinate axes, the second and fourth quadrants, and the portions of the first and third quadrants on the origin side of the hyperbola. The two negative regions lie beyond its branches. The left-hand panel shows these regions; its markers locate the stationary points calculated next.
Figure 1.
Sign regions, stationary points and completed contour map of the Gaussian-weighted function
. Details.
Set both components of the gradient to zero. After dividing out the nonzero exponential, they are equivalent to
Adding and subtracting gives and . If , the first equation reduces to , giving the origin and the two diagonal points. If , it reduces to , giving the origin and the two opposite-diagonal points. The alternative simultaneous values and are incompatible, so these cases exhaust the possibilities. Thus the five stationary points are
They are marked in both panels of the figure.
Evaluate the Hessian matrix at the five stationary points. At the origin it is
whose eigenvalues are and , so the origin is a saddle point. At the two points with ,
whose eigenvalues are and . Both are positive, so these are strict local minima. At the two points with ,
whose eigenvalues are and . Both are negative, so these are strict local maxima. In summary,
The quadratic changes along the orthogonal directions and also provide a direct justification of these classifications.
The product rule gives . The exponential function never vanishes, so a stationary point requires . In the given interval this means . Substitution gives
The derivative changes from positive to negative there, making it a strict local maximum.
Eliminate using the constraint: . The restricted objective is the quadratic polynomial , with constant Hessian matrix
Its eigenvalues are and . Hence
For , both eigenvalues are negative and the quadratic polynomial is strictly concave, so the maximum is global on the entire constraint surface. For , the opposite signs give increasing and decreasing directions. At there is no stationary point, as already found, rather than a degenerate extremum to classify. No parameter value produces a constrained local minimum.