Solution (source code)

= Solution

For fixed $b$, put $\mathcal L_b(x)=f(x)+\lambda(b)^T(b-g(x))$. Feasibility gives $\mathcal L_b(\bar x(b))=f(\bar x(b))=\phi(b)$. The assumed <Lagrangian duality> representation says this value is the unrestricted supremum of $\mathcal L_b$, so $\bar x(b)$ is also an unconstrained global maximizer of this continuously differentiable function. Its first derivative vanishes:
$$
\nabla f(\bar x)=Dg(\bar x)^T\lambda(b).
$$
Differentiate the identity $g(\bar x(b))=b$ using the assumed smooth dependence of the optimizer:
$$
Dg(\bar x)D_b\bar x=I_m.
$$
The <chain rule> now gives the <envelope theorem>
$$
D_b\phi=\nabla f(\bar x)^TD_b\bar x=\lambda(b)^TDg(\bar x)D_b\bar x=\lambda(b)^T.
$$
Thus
$$
\boxed{\frac{\partial\phi}{\partial b_i}(b)=\lambda_i(b),\qquad i=1,\ldots,m.}
$$
Each <Lagrange multiplier> is the marginal change in optimal value per unit relaxation of its constraint. The proof only uses the resulting stationarity and smooth feasibility identities; it does not require differentiating the maximizer explicitly or differentiating the multiplier.