Constraint Minimization
Problem Statement:
Minimize the following function
`5-(x-2)^2 -2(y-1)^2`
subject to the following constraint
`x + 4y = 3`
Solution:
Given:
`f(x,y) = 5-(x-2)^2 -2(y-1)^2`
So we create a new function by adding the existing function to the lagrange multipliers.
`g(x,y) = f(x,y) + lambda(x+4y-3)`
then substitute the value of f(x,y)
`g(x,y) = 5 – (x-2)^2 -2(y-1)^2 + lambda(x+4y-3)`
differentiate the function w.r.t x to get,
`frac{dg}{dx} = -2(x-2) + lambda = 0 rarr Equation 1`
differentiate the function w.r.t y to get,
`frac{dg}{dy} = -4(y-1) + 4lambda = 0 rarr Equation 2`
differentiate the function w.r.t `lambda` to get,
`frac{dg}{dlambda} = x+4y-3 = 0rarr Equation 3`
Solving the equations 1 and 2 we get
`2x -y -3 =0 rarr Equation 4`
Then solve the equation 3 and 4 to get,
`x = 5y`
substitute the value of x from above equation in the constraint equation to get the value of value of y
`5y + 4y=3`
`9y=3`
`y=1/3`
to obtain x substitute the value of equation `x = 5y`
so the value of `x=5/3`
when we substitute the values of `x=5/3` and `y=1/3` in the constraint equation LHS = RHS so the solution is correct.