Constraint Minimization - Pen and Paper calculation
Aim:
To Minimize the following function
5-(x-2)^2 -2(y-1)^2
subject to the following constraint
x + 4y = 3
The method of Lagrange multipliers is a method for finding max or min of a function of several variables restricted to a given subset.
Method of Lagrange Multipliers:
Suppose that f(x, y) and g(x, y) is differentiable. To find the local maximum and minimum values of f subjected to the constraint g(x, y) = 0, find the values of x. y and λ that simultaneously satisfies the equations.
`Δf = λ Δg` and `g(x, y)= 0`
Constraint `x + 4*y = 3`
So we have `g(x, y)=x + 4*y -3 = 0`
`L= f(x,y)- λg(x,y)`
Where λ is called the Lagrange multiplier.
Solving for the critical points
`Lx =(∂L)/(∂x) = -2(x-2)-λ = 0`
`x = 2-(λ/2)`
`L_y =(∂L)/(∂y) = -4(y-1)-4λ=0`
`y = 1- λ`
substituting x and y values in g(x, y) constraint equation
`x + 4*y -3 = 0`
`2-( λ/2) + 4(1- λ) - 3 = 0`
`4λ + (λ/2) = 3`
`λ =2/3`
now find the x and y values using λ:
`x = 2 - (λ/2)`
`x = 2 -(1/3)`
`x = 5/3`
`y = 1- λ`
`y = 1-2/3`
`y =1/3`
function f(x, y) minimum value in the constraint g(x, y) is
`f(x,y)=5-(x-2)^2-2(y-1)^2`
`f(5/3,1/3)=5-(5/3-2)^2-2(1/3-1)^2`
`f(5/3,1/3)=4`
The function has a minimum value of 4 in the constraint of g(x, y).