Lagrange multipliers provide a systematic way to find the local maxima and minima of a function subject to one or more equality constraints. Suppose we seek extrema of given the constraint . By introducing an auxiliary variable , we form the Lagrangian
The method rests on the insight that at an extremum subject to the constraint, gradients of and are parallel. Setting the partial derivatives of to zero yields the system
combined with the original constraint . Solving these equations simultaneously pinpoints stationary points that may correspond to constrained maxima or minima.
In practice, we differentiate with respect to , , and . Setting , , and yields three equations in the three unknowns. Solving this system gives candidate points. We then evaluate at each candidate to determine which provide maxima or minima along the constraint curve.
Consider finding the extrema of subject to . The Lagrangian is . Taking partial derivatives gives
Setting these to zero yields a system solvable for , , and . Substituting back into reveals whether each solution is a maximum or minimum on the line . This procedure generalizes easily to more variables and multiple constraints by adding one multiplier per constraint.
Geometrically, the gradient of points in the direction of greatest increase, while the gradient of is normal to the constraint curve. At a constrained extremum, movement along the constraint cannot increase or decrease , meaning its gradient must be parallel to the gradient of . The multiplier quantifies how strongly the constraint influences the optimum. This geometric viewpoint helps explain why the Lagrange multiplier technique is so widely used across calculus, physics, and economics.
To apply the method with this calculator, enter any differentiable function of two variables and a single constraint . The tool relies on the symbolic differentiation capabilities of math.js to compute partial derivatives. After solving the resulting system numerically, the calculator displays the candidate points. You can then evaluate at these points to determine maxima or minima.
Lagrange multipliers appear in diverse settings: optimizing production subject to resource limits, maximizing entropy with fixed energy, or finding shortest paths constrained to surfaces. The method links optimization to geometry, revealing how constraints shape feasible solutions. By experimenting with different functions and constraints, you will see how the multiplier value reflects the trade-off between satisfying the constraint and optimizing the objective.
This calculator aims to demystify the process by automating the tedious algebra. Understanding the underlying theory, however, remains essential for interpreting the results. With practice, you will recognize patternsβfor example, that equality constraints often represent level curves or surfaces along which we seek tangency with . By mastering Lagrange multipliers, you gain a versatile tool for tackling constrained optimization problems in calculus, economics, and engineering.
Find the shortest path between two nodes in a small graph using Dijkstra's algorithm.
Use Cramer's rule to solve small linear systems with determinants.
Compute the derivative of a polynomial at any point to see how fast the function changes there.