Skip to main content

Envelope Theorem, Implications of Optimality, Lagrange Multiplier, and Shephard’s Lemma

Author
Affiliation

Department of Economics, University of Houston

Published

November 29, 2026

Part of Production, Preferences, and Equilibrium: Theory and Applications.
Main Micro4Econ site | View this section in the book | Author: Fan Wang
Date: 2026-11-29 | HTML | PDF | QMD

1 Envelope Theorem, Implications of Optimality, Lagrange Multiplier, and Shephard’s Lemma

1.1 Envelope Theorem and Lagrange Multiplier from Cost Minimization, total derivative

Assume a differentiable, regular optimum with positive chosen inputs and a binding output constraint. Under these assumptions, the first-order equalities below apply; corner solutions require complementary-slackness conditions. We can use the total derivative approach to express the Lagrangian as a function of the input choices, the Lagrange multiplier, and quantity. Quantity has direct impacts and indirect impacts through input choices and the multiplier:

\[ \begin{aligned} \mathcal{L^{\ast}}(\left\{x_i^{\ast}(q, \mathbf{w})\right\}_{i=1}^{N}, \lambda^{\ast}\left(q, \mathbf{w}\right), q) \end{aligned} \]

So the derivative of the Lagrangian evaluated at the optimal choices with respect to quantity is:

\[ \begin{aligned} &\frac{d\mathcal{L^{\ast}}(\left\{x_i^{\ast}\left(q, \mathbf{w}\right)\right\}_{i=1}^{N}, \lambda^{\ast}\left(q, \mathbf{w}\right), q) }{ d q}\\ =& \sum_{i=1}^N \frac{\partial \mathcal{L^{\ast}} }{\partial x_i} \cdot \frac{\partial x_i^{\ast}\left(q, \mathbf{w}\right)}{\partial q} + \frac{\partial \mathcal{L^{\ast}} }{\partial \lambda} \cdot \frac{\partial \lambda^{\ast}\left(q, \mathbf{w}\right)}{\partial q} + \frac{\partial \mathcal{L^{\ast}} }{\partial q}\\ =& \sum_{i=1}^N 0 \cdot \frac{\partial x_i^{\ast}\left(q, \mathbf{w}\right)}{\partial q} + 0 \cdot \frac{\partial \lambda^{\ast}\left(q, \mathbf{w}\right)}{\partial q} + \frac{\partial \mathcal{L^{\ast}} }{\partial q}\\ =& \lambda^{\ast} \end{aligned} \]

The terms are equal to zero, because of the first order optimality conditions for the constrained minimization problem, which says that at optimal choices the derivative of the lagrangian with respect to the choice variables and the lagrange multiplier must be equal to zero. Specfically:

\[ \begin{aligned} \frac{\partial \mathcal{L^{\ast}}}{\partial x_i} &= w_i - \lambda^{\ast}\cdot \frac{\partial f\left(\left\{x^{\ast}_j\right\}_{j=1}^N\right) }{\partial x_i } = 0 , \forall i\\ \frac{\partial \mathcal{L^{\ast}}}{\partial \lambda} &= q - f\left(\left\{x^{\ast}_i\right\}_{i=1}^N\right) = 0\\ \end{aligned} \]

1.1.1 Marginal cost and lagrange multiplier

At the optimal cost minimizing choices, the Lagrangian is equal to the cost function. The derivative of the lagrangian—evaluated at optimal choices—with respect to quantity is equal to the Lagrange multiplier. The derivative of the cost function with respect to quantity is the marginal cost of making one more unit of output. Hence, the Lagrange multiplier is equal to the marginal cost at the optimum.

\[ \begin{aligned} MC(q) &= \lambda^{\ast}(q) \end{aligned} \]

Interesting, from the optimality condition that we wrote above, we have that the derivative of the lagrangian with respect to input \(x_i\), evaluated at the optimal choices, is:

\[ \frac{\partial \mathcal{L^{\ast}}}{\partial x_i} = w_i - \lambda^{\ast} \frac{\partial f\left(\left\{x^{\ast}_j\right\}_{j=1}^N\right)}{\partial x_i} = 0, \quad \forall i \]

This can be rewritten to express the Lagrange multiplier in terms of the input prices and the marginal products of the inputs, all evaluated at the optimal choices:

\[ \lambda^{\ast} = \frac{w_i}{\frac{\partial f\left(\left\{x^{\ast}_j\right\}_{j=1}^N\right)}{\partial x_i}}, \quad \forall i \]

This provides another interesting perspective on the relationship between input prices, marginal products, and the marginal cost of production. At the optimal choices: the marginal cost of making one more unit of output is equal to the price per unit of each input divided by the marginal product of the corresponding input, for all input. Suppose we have two inputs, labor and capital, with prices \(w_L\) and \(w_K\), and marginal products \(MP_L\) and \(MP_K\), then at the optimum: \[ MC(q) = \frac{w_L}{MP_L} = \frac{w_K}{MP_K} \]

This is saying that given we have made our optimal choices, the marginal cost of producing an additional unit of output is the same when measured in terms of any input, reflecting the optimal allocation of resources.

1.1.2 Directly take derivatives cumbersome approach

Now we will not directly invoke the envelope theorem in the simple fashion as above, but will explicitly take derivative of every term that includes \(q\) with respect to \(q\), and show that we will have the same result as above, by also invoking the first-order optimality conditions.

Given price vector \(\left\{w_i\right\}_{i=1}^{N}\) and quantity \(q\), the lagrangian for the cost minimization problem, evaluated at the optimal choices \(\left\{x^{\ast}_i\left(\left\{w_j\right\}_{j=1}^{N}, q\right)\right\}_{i=1}^N\), is:

\[ \begin{aligned} \mathcal{L^{\ast}}(\left\{w_i\right\}_{i=1}^{N}, q) &= \sum_{i=1}^N w_i \cdot x^{\ast}_i - \lambda^{\ast}\left(f(\left\{x^{\ast}_i\right\}_{i=1}^N) - q\right) \end{aligned} \]

We now take the derivative of the Lagrangian evaluated at the optimal choices with respect to quantity, note that this is the same as taking the derivative of the cost function with respect to quantity, because at optimal choices, output equals to \(q\). Specifically:

\[ \begin{aligned} \frac{d \sum_{i=1}^N w_i \cdot x^{\ast}_i }{ d q} = \frac{d \mathcal{L^{\ast}}(\left\{w_i\right\}_{i=1}^{N}, q)}{ d q} &= \frac{ d \left( \sum_{i=1}^N w_i \cdot x^{\ast}_i - \lambda^{\ast}\left(f(\left\{x^{\ast}_i\right\}_{i=1}^N) - q\right) \right)}{d q}\\ &= \frac{d \sum_{i=1}^N w_i \cdot x^{\ast}_i }{d q} - \frac{d \lambda^{\ast}\cdot f(\left\{x^{\ast}_i\right\}_{i=1}^N) }{d q} + \frac{d \lambda^{\ast}\cdot q }{d q} \end{aligned} \]

For the three components above, first (the optimal choices are a function of \(q\) along with the wage vector \(\mathbf{w}\), we abbreviate the wage vector for space considerations):

\[ \begin{aligned} \frac{d \sum_{i=1}^N w_i \cdot x^{\ast}_i \left(q\right) }{d q} &= \sum_{i=1}^N w_i \cdot \frac{\partial x^{\ast}_i\left(q\right)}{\partial q} \end{aligned} \]

Second:

\[ \begin{aligned} \frac{d \lambda^{\ast}\left(q\right)\cdot f(\left\{x^{\ast}_i\left(q\right)\right\}_{i=1}^N) }{d q} &= \frac{\partial \lambda^{\ast}\left(q\right) }{\partial q}\cdot f\left(\left\{x^{\ast}_i\left(q\right)\right\}_{i=1}^N\right) + \lambda^{\ast}\left(q\right)\cdot \sum_{i=1}^N \frac{ \partial f\left(\left\{x^{\ast}_j\left(q\right)\right\}_{j=1}^N\right) }{ \partial x_i } \cdot \frac{\partial x_i^{\ast}\left(q\right)}{\partial q} \end{aligned} \]

Third:

\[ \begin{aligned} \frac{d \lambda^{\ast}\left(q\right)\cdot q }{d q} &= \frac{\partial \lambda^{\ast}\left(q\right)}{\partial q} \cdot q + \lambda^{\ast}\left(q\right) \end{aligned} \]

Note that, from the first order conditions of the cost minimization problem, we have

\[ \frac{w_i}{\lambda^{\ast}\left(q, \mathbf{w}\right)} = \frac{ \partial f\left(\left\{x^{\ast}_j\left(q\right)\right\}_{j=1}^N\right) }{\partial x_i} \]

Additionally, from the derivative of the objective function with respect to the Lagrange multiplier, at the optimum we also have \(f\left(\left\{x^{\ast}_i\left(q\right)\right\}_{i=1}^N\right)=q\). Therefore:

\[ \begin{aligned} \frac{d \mathcal{L^{\ast}}(\left\{w_i\right\}_{i=1}^{N}, q)}{ d q} &= \frac{d \sum_{i=1}^N w_i \cdot x^{\ast}_i }{d q} - \frac{d \lambda^{\ast}\cdot f(\left\{x^{\ast}_i\right\}_{i=1}^N) }{d q} + \frac{d \lambda^{\ast}\cdot q }{d q}\\ &= \sum_{i=1}^N w_i \cdot \frac{\partial x^{\ast}_i}{\partial q} - \frac{\partial \lambda^{\ast} }{\partial q}\cdot f\left(\left\{x^{\ast}_i\right\}_{i=1}^N\right) - \lambda^{\ast}\cdot \sum_{i=1}^N \frac{ \partial f\left(\left\{x^{\ast}_j\right\}_{j=1}^N\right) }{ \partial x_i } \cdot \frac{\partial x_i^{\ast}}{\partial q} + \frac{\partial \lambda^{\ast}}{\partial q} \cdot q + \lambda^{\ast}\\ &= \sum_{i=1}^N \left( w_i - \lambda^{\ast}\cdot \frac{ \partial f\left(\left\{x^{\ast}_j\right\}_{j=1}^N\right) }{ \partial x_i } \right) \cdot \frac{\partial x^{\ast}_i}{\partial q} + \left( q-f\left(\left\{x^{\ast}_i\right\}_{i=1}^N\right) \right)\cdot \frac{\partial \lambda^{\ast} }{\partial q} + \lambda^{\ast}\\ &= \sum_{i=1}^N \left(0\right) \cdot \frac{\partial x^{\ast}_i}{\partial q} + \left(0\right)\cdot \frac{\partial \lambda^{\ast} }{\partial q} + \lambda^{\ast}\\ &= \lambda^{\ast} \end{aligned} \]

In the example above. We invoked the optimality conditions for this constrained minimization problem to simplify terms. But this is also exactly what the envelope theorem does. Knowing the envelope theorem, we avoid having to work through all the cumbersome derivatives explicitly as we did above.

1.2 Envelope Theorem and the effect of a shift in price on the cost function, Shephard’s Lemma

We can also use the envelope theorem to derive the effect of a shift in price on the Lagrangian evaluated at the optimal choices, or equivalently the cost function evaluated at the optimal choices.

We can express the lagrangian as a function of the input choices, the lagrange multiplier, and \(w_j\). \(w_j\) has direct impacts, and indirect impacts through input choices and the lagrange multiplier:

\[ \begin{aligned} \mathcal{L^{\ast}}(\left\{x_i^{\ast}\left(q, \mathbf{w}\right)\right\}_{i=1}^{N}, \lambda^{\ast}\left(q, \mathbf{w}\right), w_j) \end{aligned} \]

We are highlighting here that the optimal choice are a function of \(w_j\), they are also a function of all other prices along with \(q\). So the derivative of the Lagrangian evaluated at the optimal choices with respect to quantity is:

\[ \begin{aligned} \frac{d \sum_{i=1}^N w_i \cdot x^{\ast}_i}{dw_j} &= \frac{d \mathcal{L^{\ast}}(\left\{x_i^{\ast}\left(q, \mathbf{w}\right)\right\}_{i=1}^{N}, \lambda^{\ast}\left(q, \mathbf{w}\right), w_j) }{ d w_j}\\ &= \sum_{i=1}^N \frac{\partial \mathcal{L^{\ast}} }{\partial x_i} \cdot \frac{\partial x_i^{\ast}\left(q, \mathbf{w}\right)}{\partial w_j} + \frac{\partial \mathcal{L^{\ast}} }{\partial \lambda} \cdot \frac{\partial \lambda^{\ast}\left(q, \mathbf{w}\right)}{\partial w_j} + \frac{\partial \mathcal{L^{\ast}} }{\partial w_j}\\ &= \sum_{i=1}^N 0 \cdot \frac{\partial x_i^{\ast}\left(q, \mathbf{w}\right)}{\partial w_j} + 0 \cdot \frac{\partial \lambda^{\ast}\left(q, \mathbf{w}\right)}{\partial w_j} + \frac{\partial \mathcal{L^{\ast}} }{\partial w_j}\\ &= x_j^{\ast}(\left\{w_i\right\}_{i=1}^{N}, q) \end{aligned} \]

This is Shephard’s Lemma, which says that the derivative of the cost function with respect to price is equal to the optimal choice of the input associated with that price. This result is very useful in empirical work, as it allows us to back out optimal input choices from the cost function. We do this by taking the derivative of the cost function with respect to price, and evaluating the derivative at the observed prices. Shephard’s Lemma applies when the cost function is continuously differentiable.

1.2.1 Derivative of the cost function with respect to input prices

One interesting thing to note here is that, why did we have to use the Lagrangian? why not directly take the derivative of the cost function with respect to price? Will we get the same result. Yes, we will. But it is only feasible if we have the solutions for the optimal conditional factor demand functions. Specifically, the derivative of the cost function with respect to price is:

\[ \begin{aligned} \frac{d \sum_{i=1}^N w_i \cdot x^{\ast}_i\left(q, \mathbf{w}\right)}{dw_j} &= \sum_{i=1}^N \frac{\partial (w_i \cdot x^{\ast}_i\left(q, \mathbf{w}\right))}{\partial w_j}\\ &= \sum_{i=1}^N \left( \frac{\partial w_i}{\partial w_j} \cdot x^{\ast}_i\left(q, \mathbf{w}\right) + w_i \cdot \frac{\partial x^{\ast}_i\left(q, \mathbf{w}\right)}{\partial w_j} \right) \\ &= x^{\ast}_j\left(q, \mathbf{w}\right) + \sum_{i=1}^N w_i \cdot \frac{\partial x^{\ast}_i\left(q, \mathbf{w}\right)}{\partial w_j}\\ \end{aligned} \]

The first order condition of the Lagrangian-based cost minimization problem does not directly tell us what the marginal effect of a change in the price of \(w_j\) on the optimal choice of \(x^{\ast}_i\) is. So we can not directly apply the envelope theorem.

However, it must be the case that \(\sum_{i=1}^N w_i \cdot \frac{\partial x^{\ast}_i\left(q, \mathbf{w}\right)}{\partial w_j} = 0\). Why is that the case? this is because as we discussed earlier at optimal choices \(w_i = \lambda^{\ast} \frac{\partial f(\mathbf{x}^{\ast})}{\partial x_i}\). So we can divide both sides by \(\lambda^{\ast}\) (still zero on the RHS), and end up with \[ \sum_{i=1}^N \frac{\partial f(\mathbf{x}^{\ast})}{\partial x_i} \cdot \frac{\partial x^{\ast}_i\left(q, \mathbf{w}\right)}{\partial w_j} = 0 \] It turns out the above is true when we are moving along an isoquant of the production function, where the output level \(q\) remains constant. Consider the quantity constrasnt \(q = f(\mathbf{x}^{\ast})\). Taking the total derivative with respect to \(w_j\), we get: \[ 0 = \frac{d q}{d w_j} = \sum_{i=1}^N \frac{\partial f(\mathbf{x}^{\ast})}{\partial x_i} \cdot \frac{\partial x^{\ast}_i\left(q, \mathbf{w}\right)}{\partial w_j} \]

The intuition here is that when one of the input prices change, all inputs will shift, and the shifts in all inputs will shift the output. But from a marginal/infinitesimal perspective, they must all shift in such a way that the output remains constant, which means all the shifts must cancel each other out exactly.