Consider the following NLP
Min f(x, y, z) = x² + (y - 2)² + (z - 1)²
s.t. g(x, y, z) = 4x + y + 4z - 39
To solve the above NLP we first construct the Lagrangian function:
L(x, y, z, λ) = f(x, y, z) - λg(x, y, z).
Which gives that:
1. The solution is x = 6.86, y = 3.715, z = 7.86 and λ = 3.43
2. The value of f is 97.06