Solution (source code)

= Solution

Use the <optimization Lagrangian> $L(x,y)=f(x)-y^Tc(x)$ and let $A=Dc$ be the $m\times n$ constraint <Jacobian matrix>. Under the standard regularity hypothesis $\operatorname{rank}A(x_*)=m$, a local constrained minimizer satisfies, for some multiplier $y_*$,
$$
\boxed{c(x_*)=0,\qquad\nabla f(x_*)-A(x_*)^Ty_*=0.}
$$
The second-order necessary condition is
$$
\boxed{d^T\nabla_{xx}^2L(x_*,y_*)d\geq0\quad\text{whenever }A(x_*)d=0.}
$$
Regularity makes each such tangent vector the velocity of a feasible smooth curve. Twice differentiating the objective along that curve and using stationarity and the differentiated constraints gives the displayed nonnegative second derivative.

The regularity hypothesis is needed for these multiplier conditions to be necessary in this form. For example minimizing $f(x)=x$ subject to $c(x)=x^2=0$ has the unique feasible minimizer zero, but $f'(0)-yc'(0)=1$ for every $y$. The question does not explicitly state the qualification, so it must be supplied when using the usual <KKT conditions>.