Constrained Optimization
Imagine students you are designing a phone case, a water bottle, or a mini drone 🚀. You want the best design, but there is a catch: you only have a certain amount of material, a fixed budget, or a limited surface area. That “catch” is what makes constrained optimization different from regular optimization. In multivariable calculus, constrained optimization asks us to maximize or minimize a function while staying on a rule, such as a curve, a surface, or an equation.
What Constrained Optimization Means
In ordinary optimization, we look for the highest or lowest value of a function $f(x,y)$ over a region. In constrained optimization, the variables cannot move freely. Instead, they must satisfy a condition like $g(x,y)=c$ or $g(x,y,z)=c$. This condition is called a constraint.
For example, suppose a company wants to make the largest possible box volume $V(x,y,z)=xyz$ but the total amount of cardboard is fixed. The cardboard limit creates a constraint, often written as an equation involving $x$, $y$, and $z$. The goal is not just to optimize $V$ on its own, but to optimize it only among the shapes that satisfy the rule.
This idea shows up all over the real world 🌍:
- designing containers with fixed material
- choosing dimensions of a garden with a fixed fence length
- finding the best route under a fuel limit
- maximizing profit while meeting production limits
The key point is simple: the best answer must also obey the restriction.
The Geometry Behind a Constraint
A constraint usually describes a curve, a surface, or some other set of allowable points. If $g(x,y)=c$, then the allowed points lie on a level curve in the plane. If $g(x,y,z)=c$, the allowed points lie on a surface in space.
Think of walking on a hiking trail. The trail itself is the constraint. You may want to reach the highest point of a nearby hill, but you cannot leave the trail. Your best point is not necessarily the hill’s highest point overall. Instead, it is the highest point along the trail.
That is the central geometry of constrained optimization: the optimal point is found only among the points satisfying the constraint.
A helpful fact is that at the best point, the contour lines of the objective function often touch the constraint without crossing it. This “just touching” behavior leads to the method of Lagrange multipliers.
Main Idea of Lagrange Multipliers
The most important procedure for constrained optimization in multivariable calculus is the method of Lagrange multipliers. It works when we want to optimize a function $f(x,y)$ subject to a constraint $g(x,y)=c$.
The method says that at an optimal point, the gradients are parallel:
$$
$\nabla f(x,y)=\lambda \nabla g(x,y)$
$$
Here, $\nabla f$ is the gradient of the objective function, $\nabla g$ is the gradient of the constraint, and $\lambda$ is called the Lagrange multiplier.
Why does this make sense? The gradient of a function points in the direction of greatest increase. If the best point on the constraint is reached without leaving the constraint, then the directions of change for $f$ and the constraint align in a special way. At the optimum, the gradient of $f$ is a scalar multiple of the gradient of $g$.
To solve a problem using Lagrange multipliers, we usually follow these steps:
- Write the objective function $f$.
- Write the constraint as $g(x,y)=c$ or move everything to one side as $g(x,y)-c=0$.
- Set up the system $\nabla f=\lambda \nabla g$.
- Solve the equations together with the constraint.
- Compare the candidate points to find the maximum or minimum.
This method is powerful because it reduces a difficult constrained problem to a system of equations.
A Simple Example in Two Variables
Suppose we want to maximize $f(x,y)=xy$ subject to the constraint $x+y=10$.
This could model splitting 10 units of material between two sides of a design and asking when the product is largest. The constraint says the two numbers must always add to 10.
Let the constraint be $g(x,y)=x+y$. Since $x+y=10$, we use
$$
$\nabla f=\lambda \nabla g$
$$
Compute the gradients:
$$
$\nabla f=\langle y,x\rangle$
$$
$$
$\nabla g=\langle 1,1\rangle$
$$
So we set
$$
$\langle y,x\rangle=\lambda \langle 1,1\rangle$
$$
This gives the equations $y=\lambda$ and $x=\lambda$, so $x=y$. Using the constraint $x+y=10$, we get $2x=10$, so $x=5$ and $y=5$. Therefore, the maximum occurs at $(5,5)$, and the largest value is $f(5,5)=25$.
This result is believable: if one number is too small and the other too large, the product drops. The best balance happens when they are equal 🤝.
What About Minimum Values?
Constrained optimization can also find minimum values. For example, suppose we want the point on the circle $x^2+y^2=1$ where $f(x,y)=x+y$ is smallest.
Using Lagrange multipliers, we compare the linear function $f(x,y)=x+y$ with the constraint $g(x,y)=x^2+y^2=1$. The gradients are
$$
$\nabla f=\langle 1,1\rangle$
$$
$$
$\nabla g=\langle 2x,2y\rangle$
$$
Set
$$
$\langle 1,1\rangle=\lambda \langle 2x,2y\rangle$
$$
This gives $1=2\lambda x$ and $1=2\lambda y$, so $x=y$. Using $x^2+y^2=1$, we get $2x^2=1$, so $x=\pm \frac{1}{\sqrt{2}}$ and $y=\pm \frac{1}{\sqrt{2}}$ with matching signs.
The maximum of $x+y$ is at $\left(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}\right)$, and the minimum is at $\left(-\frac{1}{\sqrt{2}},-\frac{1}{\sqrt{2}}\right)$.
This shows an important fact: once we find the candidate points, we must evaluate $f$ at each one to decide which gives the max or min.
How Constrained Optimization Fits into the Bigger Topic
Constrained optimization is a major part of the broader study of optimization. In optimization, we try to find best values of functions. Earlier ideas include critical points, where the gradient is zero or undefined, and the second derivative test, which helps classify those critical points for unconstrained functions.
Constrained optimization is different because the point of interest may not be a critical point of $f$ in the usual unconstrained sense. In fact, $\nabla f$ often does not equal $\mathbf{0}$ at the optimal constrained point. Instead, the condition changes to the Lagrange multiplier rule.
So the bigger picture is:
- Critical points help for unconstrained optimization.
- Second derivative test helps classify unconstrained critical points.
- Lagrange multipliers help for constrained optimization.
These tools work together. They all aim to answer the same question: where is the function highest or lowest? The difference is whether the variables are free or restricted.
Common Mistakes and Good Habits
students, when solving constrained optimization problems, there are a few habits that make a big difference ✅:
- Always write the constraint clearly.
- Make sure the objective function and constraint use the same variables.
- Do not forget to check all candidate points.
- If there are endpoints or special boundary points, include them.
- Compare actual function values instead of guessing.
A common mistake is stopping after finding one solution to the Lagrange system. But optimization requires checking every valid candidate. Another mistake is forgetting that the constraint may include more than one curve or may have boundaries. In such cases, each relevant piece must be examined.
Conclusion
Constrained optimization is about finding the best possible value of a function while obeying a rule. In multivariable calculus, the main method is Lagrange multipliers, which uses the equation $\nabla f=\lambda \nabla g$ to find candidate points. This idea is useful in real design problems, economics, engineering, and science because many choices come with limits.
Within the broader topic of optimization, constrained optimization extends the ideas of critical points and function behavior to situations where not every point is allowed. The method gives a systematic way to solve these problems and understand how the best answer depends on the constraint.
Study Notes
- Constrained optimization finds the maximum or minimum of a function while satisfying an equation or restriction.
- The restriction is called a constraint.
- A common constraint is written as $g(x,y)=c$ or $g(x,y,z)=c$.
- The main tool is the method of Lagrange multipliers.
- The key equation is $\nabla f=\lambda \nabla g$.
- At an optimal constrained point, the gradient of the objective function is parallel to the gradient of the constraint.
- After solving the Lagrange system, always evaluate the objective function at every candidate point.
- Constrained optimization is part of the larger optimization topic in multivariable calculus.
- Unconstrained methods like critical points and the second derivative test are different from constrained methods.
- Real-world problems often involve constraints such as limited budget, material, time, or space.
