Constraint Minimization.
To minimize a simple non-linear function by using Lagrange Multipliers
Q. Minimize the following function 5 - (x - 2)² – 2( y - 1)² , subject to the following constraint x+4y=3.
Soln.
Here consider,
f (x, y) = 5-(x-2)² – 2(y-1)²
From the above equation it is observed that (x-2)² & (y-1)² are in form of
(a - b)²=a² - 2ab + b².
f (x, y) = 5 - (x-2)² – 2(y-1)²
= 5 - ( (x)² - 2*x*2 + (2)² ) - 2*((y)² - 2*y*1 + (1)² ) = 0
= 5 - (x² - 4x + 4) - 2(y² - 2y + 1) = 0
= 5 - x² + 4x - 4 - 2y² + 4y - 2 = 0
= -x² - 2y² + 4x + 4y - 1 = 0
When we have a constraint in function it is called Constraint Minimisation. If we want to minimize the above equation, consider another variable or constraint i.e. x + 4y = 3 .
Now create a new function, by lagrangian method:
g (x, y) = f (x, y) + λ(x + 4y - 3)
where f (x, y) = 5 - (x - 2)² – 2(y - 1)²
g (x, y) = 5 - (x-2)² - 2(y-1)² + λ(x + 4y - 3) ------------------ (a)
where λ is Lagrange Multiplier.
Therefore, equation-(a) is the new function to be minimized.
Now take,
g (x, y) = 5 - (x - 2)² - 2(y - 1)² + λ(x + 4y - 3)
Here we have 3 equations i.e.
∂g/∂x = 0 -2x + 4 + λ = 0 ------------------(1)
∂g/∂y = 0 -4y + 4 + 4λ = 0 -----------------(2)
∂g/∂λ = 0 x + 4y - 3 = 0 --------------------(3)
Now consider,
equation(2) - 4(equation(1))
--> -4y + 4 + 4λ - 4[-2x + 4 + λ] = 0
--> -4y + 4 + 4λ - (-8x + 16 + 4λ) = 0
--> -4y + 4 + 4λ + 8x - 16 -4λ = 0
--> 8x - 4y - 16 - 12 = 0
--> 4(2x - y - 3) = 0
--> 2x - y - 3 = 0 -----------------------(4)
By solving equation-(4), we get
--> 2x -y - 3 = 0
--> 2x = y + 3
--> x = (y+3)/2 -----------------------(5)
Now, substitute value of x i.e. equation-(5) in equation-(3)
--> x + 4y - 3 = 0
--> (y + 3)/2 + 4y - 3 = 0
--> y/2 + 3/2 + 4y = 3
--> y + 3 + 8y = 6
--> 9y + 3 = 6
--> 9y = 3
--> y = 1/3 -------------------------(6)
Now, substitute equation-(6) in x + 4y - 3 = 0
--> x + 4(1/3) - 3 = 0
--> x + 4/3 = 3
--> 3x + 4 = 9
--> x=5/3 --------------------------(7)
For finding the value of λ:
--> -2x + 4 + λ = 0
Substitute equation-(7) in the above equation:
--> -2(5/3) + 4 + λ = 0
--> λ = -2/3
Therefore,
x=5/3 , y=1/3 , λ=-2/3
Here the value of function is minimized, i.e. adding both x & y we get 2/3 which is equal to the value of λ.
Hence constraint is satisfied.