Let and . The unit sphere is compact, so the continuous function has a global maximum and global minimum. Since on the unit sphere, all such points satisfy the Lagrange multiplier equationsThus and either or .
Write for row of the data matrix. The k-means clustering objective is the within-cluster sum of squared Euclidean distances:The nonempty form a partition of a set of observation indices. For fixed clusters, part (a) shows that the best is their centroid.
Initialize distinct centres, for example by choosing distinct observations. Then repeat the following steps:
- Assign each observation to a nearest centre in Euclidean distance. Keep its current assignment on an exact tie; for a previously unassigned observation use a fixed ordering to resolve ties.
- If a cluster is empty, choose an observation from a cluster with at least two members and make it the empty cluster's sole member, placing its centre at that observation. A definite rule is to choose an eligible observation farthest from its currently assigned centre, breaking ties by observation index. Repeat until all clusters are nonempty.
- Replace each centre by the arithmetic mean of its assigned observations.
- After updating, check whether every observation is still assigned to a nearest updated centre, retaining its assignment on ties. If so, stop; otherwise repeat.
The empty-cluster repair is possible for and cannot increase : the transferred observation now has squared distance zero, while all other squared distances stay unchanged before the centre update.
Assignment cannot increase , and any changed assignment strictly decreases it under the tie rule. Updating centres cannot increase by the centroid sum-of-squares identity. After an update, the centres are determined by the partition of a set. There are only finitely many possible assignments. Unless this is the initial round, any nonterminal round starts with an assignment that strictly reduces ; repairing empty clusters and updating cannot undo that decrease. Thus a partition cannot recur, proving finite termination of K-means clustering. The final result need not be a global minimum; different initial centres can lead to different final clusterings.
Expanding and taking partial derivatives gives the gradient and Hessian matrixAt , these are andThus the Newton step solvesThe second equation gives ; substituting into the first gives . HenceAt , however,The eigenvalues of this Hessian matrix are in direction and in direction . It is invertible but indefinite. Thus the Newton step is zero, andThis illustrates that stationary points are fixed points of Newton's method. Here the fixed point is a saddle point of a scalar function, not a local minimum. Indeed, direct substitution along the two eigenvector directions givesFor sufficiently small nonzero , one direction decreases and the other increases it. The global minimum is instead zero: the sum of squares vanishes at and . These are the only real zeros, since and imply . Thus a zero gradient is an insufficient stopping certificate for minimization problem without classifying the stationary point.
The gradient and constant Hessian matrix areAt , and . Hence one multivariable Newton iteration givesAt this point the gradient vanishes, so every subsequent iterate is . The one-step result follows because the gradient of a quadratic polynomial is affine and its linearization is exact. Since the leading principal minors of are and , it is a positive-definite matrix. Alternatively,directly proves that is the unique global minimum, with value .
Differentiate the ordinary least squares objective in a. Its normal equations for linear least squares areUsing and givesThe Hessian matrix of the objective in is , which is positive-definite, so this is its unique global minimum. For the observed estimates, replace by .
The base costs , the glass front costs , the wooden rear costs , and the other two walls cost . Thus minimize subject to . With the Lagrange multiplier convention , the equations areMultiply these by , respectively. Comparing their equal right sides gives . Since all dimensions are positive, and . The volume condition then yieldsThis stationary shape is the unique global minimum, not merely a candidate: the arithmetic-geometric mean inequality applied to the three cost terms giveswith equality exactly at those ratios. Therefore the least cost, in pounds in the specified units, isThis is a weighted open-box minimization, with each pair of opposite walls combined into its appropriate positive face weight.
Set . The gradient of never vanishes, so the Lagrange multiplier equations apply at a constrained stationary point. They are , , and . Eliminating givesWith , this becomes . The quadratic factor is , so the only real possibility is . ThereforeThe level curve through this point is the ellipse , meeting the coordinate axes at and . Its tangent line at has slope , equal to the derivative of the constraint parabola there. The two curves are tangent.
The smallest elliptical contour meeting the constraint is tangent at the minimum
. The highlighted contour is and the constraint is . Its four axis intercepts and the unique contact point are marked. Details.The parabola touches this ellipse from outside; every other point on the constraint lies on a larger contour. An exact check of this geometric argument iswith equality only at . Thus the point is the unique constrained global minimum.
As printed, the function is undefined at the origin. For , its gradient isThe scalar prefactor is positive, and , so this gradient never vanishes. Thus there are no stationary points on the stated domain. Its infimum is three, approached as , but that value is not attained there.
If the intended definition includes the natural extension , that extension has a unique strict global minimum at the origin, with value three. Indeed, off zero, and proves differentiability at zero with zero gradient. More strongly, subtracting three gives the radial Gaussian flat function: every derivative of that difference vanishes at the origin. The vanishing Hessian matrix does not turn this minimum into an inflection point. These are two different domain interpretations; the extension must be stated rather than silently inserted.
Differentiating the hyperbolic cosine with the chain rule gives . For real , , so the only zero of the derivative is , namely . ThusSince , this stationary point is the global minimum.
The squared Euclidean distance along the line isIts minimum occurs at exactly when its derivative there vanishes, so . Since are independent, their linear span is the two-dimensional orthogonal complement of . Consequentlyfor unique real . This is the closest point on the intersection of two planes; the positive quadratic coefficient proves that the stationary distance is a strict global minimum.
The flat function is an even function, has its unique zero and global minimum at the origin, and approaches the horizontal asymptote as . It decreases for negative and increases for positive , meeting the origin with a horizontal tangent line.
Its derivative is an odd function: off zero, with . It is negative to the left and positive to the right, tends to zero both at the origin and at infinity, and has one negative trough and one positive crest. Indeed away from zero, so the change in slope of occurs once on each side. The exact crest and trough coordinates are not needed for the sketch.
Use completing the square after taking out the leading coefficient:Thus , and . Since a real square is nonnegative, the global minimum is , attained at .
Minimize the squared distance , which has the same minimizers as the distance. The Lagrange multiplier equations for the constraint areThe constraint gradient cannot vanish on this branch, since its second component is . Eliminate to obtain . Put ; then , so . But the constraint says , requiring and selecting . It follows thatTo prove a global minimum on the whole branch, substitute into :The arithmetic-geometric mean inequality proves this bound, with equality only when , namely . Thus the stationary point is the unique closest point on the required branch. Numerically it is approximately and its distance is in coordinate units.
For , differentiate the two explicit branches:The plus branch is strictly increasing and strictly convex for . Its only zero is , also its one-sided global minimum; it has no interior extremum or inflection point.
The minus branch rises initially, then has at , changing from positive to negative. Its second derivative changes sign at . Its zeros follow from . ConsequentlyThe origin is a one-sided local minimum of both graph branches, because their domain ends there; it is not an interior critical point. The minus branch has no global minimum since it tends to as . Its maximum and inflection heights, useful for the sketch, are and , respectively.
The Taylor series of the logarithm givesThe 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.
Let the fixed positive volume be . For an interior constrained extremum, Lagrange multipliers applied to the energy giveMultiplying these equations by shows that . Since the lengths are positive, .
The arithmetic-geometric mean inequality proves this is the global minimum:with equality exactly for equal sides. Thus the optimal shape is a cube, and .
Put and let the fixed constraint value be . For , the Lagrange multiplier equations giveDividing removes and yieldsTo establish a minimum, rather than merely a stationary ratio, set and . Then and . The denominator squared is ; its derivative is , giving a unique maximum at , . The volume tends to infinity at either endpoint. This proves the stated ratio is the unique global minimum, as in the optimal cylinder for a reciprocal-square constraint.
Differentiate the two powers to locate the stationary point:For , this is negative before and positive afterwards, so the global minimum isThe curve crosses the horizontal axis at . Its limits are as and from below as , giving the vertical asymptote and horizontal asymptote . These features determine the required sketch.
The Hessian matrix is diagonal:Its eigenvalues are and . Hence the second-derivative test gives a strict local minimum if , a strict local maximum if , and a saddle point of a scalar function if . No degenerate case occurs because both are nonzero.
The local minimum is the unique global minimum, since both separated summands are strictly convex functions and tend to at either end of the real line. Similarly, when both signs are negative there is a unique global maximum.
The downward drop from the starting rim to angle is . With no dissipative forces, conservation of energy gives , so . Dividing the line element by this speed yieldsThe endpoint singularities are integrable for the minimizing path. The integrand is independent of ; its Euler-Lagrange equation gives a constant , after absorbing the overall prefactor:Solving for and taking the positive branch required by givesThe constant is fixed implicitly byThis integral is strictly increasing from zero to infinity as increases from zero to one, so every finite positive separation selects a unique . The time integrand has second derivative with respect to . Its supporting-line inequality, integrated between fixed endpoints with constant first derivative with respect to , proves this stationary path is the unique global minimum within the stated single-valued class.
As , . Therefore the skater should initially head directly down the curved ramp, perpendicular to the cylinder axis, and gain axial motion later. The path differs from the constant-pitch shortest route because extra distance is cheaper in time near the faster, lower part of the ramp. This is the brachistochrone on a horizontal half-cylinder.



