Constraint minimization problem -pen and paper calculation - using Python
problem statement:
Let us consider the given function
to minimize the function
5-(x-2)2-2(y-1)2">5−(x−2)2−2(y−1)25-(x-2)2-2(y-1)2 subjected to the condition x+4y=3">x+4y=3x+4y=3
from the given equestion
f=5-(x-2)2-2(y-1)2">f=5−(x−2)2−2(y−1)2f=5-(x-2)2-2(y-1)2and
g=x+4y-3">g=x+4y−3g=x+4y-3
L=5-(x-2)2-2(y-1)2=λ(x+4y-3)1">L=5−(x−2)2−2(y−1)2=λ(x+4y−3)1L=5-(x-2)2-2(y-1)2=λ(x+4y-3)1
δlδx=0-2x+4+λ=0..............(1)">δlδx=0−2x+4+λ=0..............(1)δlδx=0-2x+4+λ=0..............(1)
δlδy=0-4y+4+4y=0.............(2)">δlδy=0−4y+4+4y=0.............(2)δlδy=0-4y+4+4y=0.............(2)
δlδλ=0x+4y-3=0...............(3)">δlδλ=0x+4y−3=0...............(3)δlδλ=0x+4y-3=0...............(3)
solving equation 1 and 2 we get y=2x-3">y=2x−3y=2x-3
substituting the value of y in eq(3) we get x+8x-12-3=0">x+8x−12−3=0x+8x-12-3=0
9x=15x=53">9x=15x=539x=15x=53
y=2(53)-3=13">y=2(53)−3=13y=2(53)-3=13
λ=2(52)-4=-23">λ=2(52)−4=−23λ=2(52)-4=-23
so the minimum value of the function wil be obtained when
x=53">x=53x=53
y=13">y=13y=13
λ=-23">λ=−23λ=-23