Created 14 Jul 2023. Last updated 22 Aug 2025
Revenge of Analysis: Using Lagrange Multipliers to Destroy Olympiad Inequalities
Goal: learn how to use Lagrange multipliers in olympiads. This article is aimed at the level of ambitious teenagers looking to get a taste of higer-level analysis concepts.
Lagrange multipliers are a nice tool to solve inequalities, but they are rarely seen in olympiad solutions. Once you are comfortable with it, it can be an overpowered way smash open inequalities without much insight. (So economists love them!) For this reason, we need to approach it rigorously, to ensure we can justify earning marks.
I really recommend watching this video to get some intuition first.
Background Theory
All of this is covered in my course notes for IB Analysis and Topology, in the relevant sections. The results and definitions in this article are correct only for (e.g. compactness is something different, but the Heine-Borel theorem says that in it's equivalent to being closed and bounded). For the more general definitions and a deeper understanding, check out the course notes.
Defn.Consider a set together with a function .
is a metric space (and we call a metric / "distance function") if:
- , equality if and only if ("iff") ("positive semi-definite")
- ("symmetric")
- ("triangle inequality")
is a metric space, where:
This is the most common metric you are probably familiar with, and we'll be working in this standard metric space for the rest of the article.
Defn. (balls)The open ball in with centre and radius is
- Any finite open interval in is an open ball (), because for any open interval , it is equal to .
in is
Now let's define open sets, not just open balls. An 'open set' is a set such that for any point in the set, we can fit an open ball around , while staying inside the set. More formally:
Defn.is open if for every , s.t. .
Open sets capture the idea of sets which have an "empty boundary".
We will also need the idea of limits.
Defn. (limits)Let be a sequence in .
The sequence converges to the point if such that:
Then is denoted .
- Let , then .
Which of the following are open sets in ?
Defn.Let . is closed if for every sequence of points that satisfies , we have .
- is not closed because we can take
- Any open ball together with one point on the boundary, is neither closed nor open.
Defn.Let . The closure of , denoted , is the smallest closed set containing .
Fact.is closed if and only if is open.
Fact.Let be open sets. Then and are also open sets. This extends to finite intersections2 and infinite unions.
Fact.Let be closed sets. Then and are also closed sets. This extends to infinite intersections and finite unions.
I remember the arrangement of "finite/infinite" in these statements by remembering "open sets work well with unions".
Defn.is bounded if such that .
Defn.A subset is compact if it is closed and bounded.
Defn.Let and let .
is continuous at the point if , such that we have:
is continuous if it is continuous at every point.
Informally, no matter how small you pick, I can always find a region around where the change in is smaller than . So, a small change in input causes a small change in ouput.
,
Theorem. (extreme value thm)Let be a continuous function, where is a nonempty compact set.
Then has both a global maximum value and a global minimum value3:
Let be a closed ball in , then is compact. Let which is continuous.
Then the theorem says that there is a point(s) on which is closest to , and a point(s) which is furthest.
Note: We need to assume is closed for this theorem, else we can construct a counterexample where increases to infinity the closer you get to the edge.
Fact.Let be continuous. Then for a fixed , the set
is closed in .
Partial Derivatives
I'm assuming you've already met these, so I'll recap.
- .
The Big Theorem
Finally!
Theorem. (Lagrange Multipliers, "LM")Let be an open set4 and let be continuous functions with continuous partial derivatives of the first order.
Let and . (Note: doesn't have to be open or closed, that's !)
Then, if is a local max or min, then either:
Or such that:
Example Problem 1
Let such that . Find the min and max of .
Let and ; these are polynomial functions and so are continuous. We are maximizing and minimizing , subject to a condition on .
so we're only interested in the cube .
is a plane
Let , then .
Let , then is bounded hence compact.
Hence has a global max and min in .
The global extrema might be on the boundary of . If so then we cannot apply LM, because the extrema will not be in .
If we are on the boundary, then one of is , so . Thus is zero everywhere on the boundary, so would be an extremum.
If we are not on the boundary, then we are in , so we can apply LM.
So we are in the second case of the theorem, because .
So , , .
This implies so , and finally , so an extremal value of is .
Overall, all extreme values of on are or .
Example Problem 2
Let such that . Show that
Note .
Let and .
Let and , where . Then are continuous and have continous partial derivatives (because polynomial on open set).
Now, and which is closed and bounded hence compact.
Hence has a global max and min on .
Let be a global extremum.
- If is on the boundary:
Then one of is , WLOG . Then and we wish to show that .
Else, is not on the boundary.
Then has a global extremum in , namely . So I can apply LM.
Since , the only possibility is .
So, ,
,
Solving for :
First case :
- Similarly,
- So , and similarly .
Second case : one of is
- WLOG , then
- , but this cannot happen in the interior.
Thus overall, The extremum must equal .
Example problem 3
Given that with , Find the max and min values of .
Note: the "normal" way to do this would be to write it as and bound this quadratic. But we can do it with LM too. I'll let you decide which way is easier.
Let with:
Then are continuous and have continuous partial derivatives.
is closed and bounded, hence is compact.
Hence attains a global max and min on .
We can apply LM, because there is no boundary case to check5.
So since .
Hence we are in the second case:
Thus we need to solve the following 3 simultaneous equations:
If , then , so or .
If , then , so . Hence and so , so .
Hence we need to check ,, , .
Homogenous Trick
Suppose we want to prove some inequality, but there are no constraints.
If the inequality is homogenous, then we can impose a condition e.g. or or , because we can scale each variable to make the condition true.
Prove that ,
If , the result is obvious.
Otherwise, let . The inequality is equivalent to:
And so, letting , , , we have that .
So it is enough to prove that when (we chose this condition because of compactness).
We can now solve this as in the examples above, using Lagrange multipliers.
Practice problem (JBMO)
For , prove that:
(Note: much easier to fix and use normal derivatives, but we want to solve with LM)
;Solution.The inequality is homogenous, so we can impose the condition by scaling the variables. Thus it is sufficient to show that when .
Note that we didn't have to clear the term, but it makes the computation easier - always look for tricks!
Now as usual, define:
Then is closed. Since is also bounded, we have that is compact.
Also are continuous with continuous partial derivatives, since they are polynomials.
Hence has a global max and min on .
since .
Hence,
Solving these to find :
Thus either or .
- If :
Then, since , we have that . In this case:
- If :
Then .So in this case:
Overall, the possible extremal values of are .
In particular, as required.
;
When It Fails
Let such that . Find the minimum value of:
If we attempt to use LM:
The problem is that is not defined on the boundary, so we cannot say has a global max and min in the area we're looking at (indeed can be arbitrarily large if we let approach zero for example). Boo, we can't use LM.
Actually, in this specific case we can fix it with the following approach:
Make the triangle a bit smaller on all sides, then it is compact and we can use LM. For the region of that we didn't consider, we can assume that "one of the variables is at least this small", so " is at least this large", and get it to be larger than a value we already know.
;
;
Conclusion
As you've seen, it takes careful consideration and background knowledge to use Lagrange multipliers in olympiads correctly. Best of luck!
is a closed set.↩
If , then which is not open.↩
This is not true in the reverse direction, for example consider and , then there is a global min at 0.↩
This is so that partial derivatives are defined.↩
Note that we could have also let be something like , so that actually has a boundary, and when we check that case, we would conclude impossibility by "if on the boundary, then would have to be and at the same time". But it is nicer to let , because then so we get that the global extrema are in straight away.↩