Lagrange multipliers

At the highest or lowest value of $f$ on a constraint curve $g = c$, a level curve of $f$ just touches the constraint, so the two gradients are parallel, $\nabla f = \lambda \nabla g$.

From Multivariable Calculus.