Can we use hotelling's lemma as a rule of thumb when wage rate can vary? Disclaimer: I've been doing some simulation with excel to see how Hotelling's Lemma behaves when allowing another parameter to vary. I did this by producing 150 randomly generated profit functions (based on normal distributions) and allowed them to vary in the parameters of interest. The goal is to learn about how far I can apply use of Hotelling's lemma outside of ideal conditions (like when wage varies as well).



Recall that  what Hotelling's Lemma tells us (essentially) is that the change in profit from a change in price is proportional to the quantity produced,meaning that the profit function increases/decreases linearly when price changes holding all else fixed. This is exactly the  result I got  when simulating it.

.

I then asked If we allow wage rate to vary as well, I found some neat and messier structures of how Hotelling's Lemma changes. In this case the dermination of price and wage are sampled from a normal distribution such that $\mathcal{N}(5,2)$ and inputs and outputs are sampled from a normal distribution such that $\mathcal{N}(50,25)$. These are my results:







Though, this method is (clearly) unscientific and violates the strict definition of the lemma, can we use hotelling's lemma as a rule of thumb when variability in wage rate is small?. 

Display of excel code/setup available upon request.
I don't quite know what it means to apply a mathematical result to a situation in which the assumptions are violated, but the same idea as in the classical version of Hotelling's lemma can be used to understand the marginal effect of wage changes and you can combine the two to understand what happens on the margin if you change both prices and wages.

The underlying logic of Hotelling's lemma was that for a profit-maximizing firm, the marginal effect of adjustment outputs (and therefore inputs) is zero. This tells us that the marginal effect of wage changes on profits should be proportional to inputs used, that is
$$\frac{\partial \pi(p,w)}{\partial w}=-x(p,w),$$
with $x(p,w)$ the optimal input bundle. This is indeed true and the proof is exactly the same as for the marginal effect of $p$, just replace the derivative with respect to $p$ by the derivative with respect to $w$. If $f$ is the production function, the profit function is given by
$$\pi(p,w)=pf\big(x(p,w)\big)-wx(p,w).$$ 
Taking the derivative with respect to $w$ now gives us
$$\frac{\partial \pi(p,w)}{\partial w}=pf'\big(x(p,w)\big)\frac{\partial x(p,w)}{\partial w}- x(p,w)-w\frac{\partial x(p,w)}{\partial w}.$$
The first order condition for $x(p,w)$ being a maximizer of $pf(x)-wx$ implies
$$pf'\big(x(p,w)\big)- x(p,w)-w=0$$ and therefore
$$pf'\big(x(p,w)\big)\frac{\partial x(p,w)}{\partial w}-w\frac{\partial x(p,w)}{\partial w}=0.$$
Substituting this in, we get
$$\frac{\partial \pi(p,w)}{\partial w}=-x(p,w).$$

The envelope theorem generalizes the underlying idea that marginal benefits of adjustments for optimizing agents are zero for more general parameterized optimization problems.