§ Lagrange multipliers by algebra
§ Constrained optimisataion: the first stab
We want to maximize z=f(x,y) given the constraint that g(x,y)=0.
Let us arbitrarily say that x is independent and y is dependent on x, so there
is some function t such that y=t(x). This lets us compute dy/dx using:
g(x,y)=0dxdg(x,y)=d0=0∂x∂g+∂y∂gdxdy=0dxdy=−∂g/∂y∂g/∂x
Next, since z is a function of x alone (as y is dependent on x via t), the condition
dz/dx=0 guarantees a maxima for z:
dxdz=0∂x∂f+∂y∂fdxdy=0∂x∂f+∂y∂f∂g/∂y∂g/∂x=0
Solving the above condition along with g(x,y)=0 to recover the value of y gives us the optima.
§ Constrained optimisataion: equal footing
F(x,y,λ)=f(x,y)+λg(x,y)
If we consider the stationary value of F, we get:
∂x∂F=∂x∂f+λ∂x∂g=0∂y∂F=∂y∂f+λ∂y∂g=0∂λ∂F=∂x∂f+λ∂x∂g
to eliminate λ from the above equations, we rearrange:
∂x∂f/∂x∂g=λ∂y∂f/∂y∂g=λ
This λ can be eliminated to recover the previous equation:
∂x∂f/∂x∂g=∂x∂f=∂x∂g∂y∂f/∂y∂g∂x∂f−∂x∂g∂y∂f)/∂y∂g=0∂y∂f/∂y∂g
The langrange multipler procedure is nice since it does not break the symmetry between the two variables.