Revenge of Analysis: Using Lagrange Multipliers to Destroy Olympiad Inequalities
Goal: learn how to use Lagrange multipliers in olympiads.
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.
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 Rn (e.g. compactness is something different, but the Heine-Borel theorem says that in Rn 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 M together with a function d:M×M→R.
(M,d) is a metric space if:
d(x,y)≥0, equality if and only if ("iff") x=y ("positive semi-definite")
d(x,y)=d(y,x) ("symmetric")
d(x,y)+d(y,z)≥d(x,z) ("triangle inequality")
Example.
(Rn,d) is a metric space, where:
Rn={(x1,⋯,xn)∣xi∈R}d(x,y)=i=1∑n(xi−yi)2
Defn.(balls)
The open ball in Rn with centre p∈Rn and radius r is
Any finite open interval in R is an open ball (n=1), because for any open interval (a,b)⊂R, it is equal to B(2a+b,2b−a).
B[0,1] in R2 is
Defn.
U⊆Rn is open iff for every p∈U, ∃r>0 s.t. B(p,r)⊂U.
Informally: an 'open set' is a set such that for any point x in the set, we can fit a ball ball around x, while staying inside the set.
Defn.(limits)
Let (xk)k=1∞ be a sequence in Rn.
The sequence converges to the point x∞ iff ∀ϵ>0,∃n0∈N such that:
n≥n0⟹d(xn,x∞)<ϵ
Then x∞ is denoted limn→∞(xn).
Examples.
Let xn=(n1,n1), then limn→∞xn=(0,0).
limn→∞(1−n1,n21)=(1,0)
Defn.
Let S⊆Rn. S is closed iff for every sequence of points (xk)k=1∞ that satisfies xk∈S∀k, we have (limk→∞xk)∈S.
Examples.
B(0,1) is not closed because we can take xk=(1−k1,0,⋯,0).
Any open ball together with one point on the boundary, is neither closed nor open.
Defn.
Let A∈Rn. The closure of A, denoted Aˉ, is the smallest closed set containing A.
Fact.
A⊆Rn is closed if and only if Rn∖A is open.
Fact.
Let U,V be open sets. Then U∩V and U∪V are also open sets. This extends to finite intersections2 and infinite unions.
Fact.
Let S,T be closed sets. Then S∩T and S∪T are also closed sets. This extends to infinite intersections and finite unions.
Defn.
A⊆Rn is bounded iff ∃R∈R,R>0 such that A⊆B(0,R).
Defn.
A subset K⊆Rn is compact if it is closed and bounded.
Defn.
Let D⊆Rn and let f:D→R.
f is continuous at the pointp∈D iff ∀ϵ>0, ∃δ>0 such that ∀x∈D we have:
d(p,x)<δ⟹∣f(x)−f(p)∣<ϵ
f is continuous iff it is continuous at every point.
Informally, no matter how small ϵ you pick, I can always find a region around p where the change in f is smaller than ϵ. So, a small change in input causes a small change in ouput.
Example.
f:Rn→R, f(x1,⋯,xn)=x1+⋯+xn
Theorem.(extreme value thm)
Let f:K→R be a continuous function, where K⊆Rn is a nonempty compact set.
Then f has both a global maximum value and a global minimum value3:
∃x∈K s.t. f(x)≥f(y)∀y∈K∃x′∈K s.t. f(x′)≤f(y)∀y∈K
Example.
Let K be a closed ball in R2, then K is compact. Let f:K→R,f(x)=d(x,(0,0)) which is continuous.
Then the theorem says that there is a point(s) on K which is closest to (0,0), and a point(s) which is furthest.
Note: We need to assume K is closed for this theorem, else we can construct a counterexample where f increases to infinity the closer you get to the edge.
Fact.
Let g:Rn→R be continuous. Then for a fixed c∈R, the set
Let x,y,z≥0 such that x+y+z=1. Find the min and max of xyz.
Solution.
Let f(x,y,z)=xyz and g(x,y,z)=x+y+z; these are polynomial functions and so are continuous. We are maximizing and minimizing f, subject to a condition on g.
0≤x,y,z≤1 so we're only interested in the cube [0,1]×[0,1]×[0,1].
x+y+z=1 is a plane (coloured green)
Let U=(0,1)3, then Uˉ=[0,1]3.
Let S={x∈U∣g(x)=1}, then Sˉ is bounded hence compact.
Hence f has a global max and min in Sˉ.
The global extrema might be on the boundary of Sˉ. If so then we cannot apply LM, because the extrema will not be in S.
If we are on the boundary, then one of x,y,z is 0, so f(x,y,z)=xyz=0. Thus f is zero everywhere on the boundary, so 0 would be an extremum.
If we are not on the boundary, then we are in S, so we can apply LM.
δxδg=1,δyδg=1,δzδg=1
So we are in the second case of the theorem, because (1,1,1)=(0,0,0).
δxδf=yz,δyδf=xz,δzδf=xy
So yz=λ⋅1, xz=λ⋅1, xy=λ⋅1. This implies xy=yz=zx so x=y=z, and finally x+y+z=1⟹x=y=z=31, so an extremal value of f is 271.
Overall, all extreme values of f on Sˉ are 0 or 271.
Let x,y,z≥0 such that x+y+z=1. Show that0≤yz+zx+xy−2xyz≤277
Solution.
Note 0≤x,y,z≤1.
Let U=(0,1)3 and S={x∈U∣g(x)=1}.
Let f(x,y,z)=yz+zx+xy−2xyz and g(x,y,z)=x+y+z, where f,g:U→R. Then f,g are continuous and have continous partial derivatives (because polynomial on open set).
Now, Uˉ=[0,1]3 and Sˉ=Uˉ∩{x∈R3∣g(x)=1} which is closed and bounded hence compact.
Hence f has a global max and min on Sˉ.
Let x0=(x,y,z) be a global extremum.
If x0 is on the boundary: Then one of x,y,z is 0, WLOG z=0. Then x+y=1 and we wish to show that 0≤xy≤277.
x≥0,y≥0⟹xy≥0xy≤(2x+y)2=41<277✓
Else, x0 is not on the boundary.
Then S has a global extremum in f, namely x0. So I can apply LM.
g(x,y,z)=x+y+z∇g=(δxδg,δyδg,δzδg)=(1,1,1)
Since ∇g=(0,0,0), the only possibility is ∇f=λ⋅∇g.
Given that x,y∈R with x2+y2=1, Find the max and min values of 8x2−2y.
Note: the "normal" way to do this would be to write it as 8(1−y2)−2y and bound this quadratic. But we can do it with LM too. I'll let you decide which way is easier.
Solution.
Let f,g:R2→R with:
f(x,y)=8x2−2yg(x,y)=x2+y2
Then f,g are continuous and have continuous partial derivatives.
U:=R2S:={x∈U∣g(x)=1}
S is closed and bounded, hence S is compact.
Hence f attains a global max and min on S.
We can apply LM, because there is no boundary case to check5.
∇g=(2x,2y)
So ∇g=(0,0) since x2+y2=1.
Hence we are in the second case:
∇f=λ∇g⟹[16x−2]=λ[2x2y]
Thus we need to solve the following 3 simultaneous equations:
16x=2xλ−2=2yλx2+y2=1
If x=0, then y2=1, so (x,y)=(0,1) or (0,−1).
If x=0, then λ=8, so −2=16y. Hence y=−81 and so x2=1−641, so x=±863.
Hence we need to check (0,1),(0,−1), (863,−81), (−863,−81).
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. a+b+c=1 or abc=1 or a2+b2+c2=1, because we can scale each variable to make the condition true.
Example.
Prove that ∀a,b,c∈R,
a2+b2+c2≥ab+bc+ca
Solution.
If a=b=c=0, the result is obvious.
Otherwise, let k=a2+b2+c2>0. The inequality is equivalent to:
(ka)2+(kb)2+(kc)2≥ka⋅kb+kb⋅kc+kc⋅ka
And so, letting x=ka, y=kb, z=kc, we have that x2+y2+z2=1.
So it is enough to prove that xy+yz+zx≤1 when x2+y2+z2=1 (we chose this condition because of compactness).
We can now solve this as in the examples above, using Lagrange multipliers.
For x,y∈R,(x,y)=(0,0), prove that:x2−xy+y2x+y≤x2+y222
(Note: much easier to fix y and use normal derivatives, but we want to solve with LM)
Solution.
The inequality is homogenous, so we can impose the condition x2+y2=1 by scaling the variables. Thus it is sufficient to show that x2−xy+y2x+y≤22 when x2+y2=1.
Let a,b,c>0 such that a+b+c=3. Find the minimum value of:f(a,b,c)=a2−a3+b2−b3+c2−c3
If we attempt to use LM:
The problem is that f is not defined on the boundary, so we cannot say f has a global max and min in the area we're looking at (indeed f can be arbitrarily large if we let a 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 "f is at least this large", and get it to be larger than a value we already know.
If Un=(−n1,n1), then ⋃n=1∞Un={0} which is not open. ↩
This is not true in the reverse direction, for example consider B(0,1) and f(x)=d(x,0), then there is a global min at 0. ↩
This is so that partial derivatives are defined. ↩
Note that we could have also let U be something like {(x,y)∈R2∣x2+y2<1000}, so that U actually has a boundary, and when we check that case, we would conclude impossibility by "if on the boundary, then x2+y2 would have to be 1 and 1000 at the same time". But it is nicer to let U=R2, because then Sˉ=S so we get that the global extrema are in S straight away. ↩