Consider the following NLP
Min $f(x, y, z) = x^2 + (y - 2)^2 + (z - 1)^2$
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, \lambda) = f(x, y, z) - \lambda g(x, y, z)$
Which gives that:
1. The solution is $x = 6.86$, $y = 3.715$, $z = 7.86$ and $\lambda = 3.43$
2. The value of $f$ is $97.06$