# Relationship between short-run marginal cost(SRMC) and long-run marginal cost(LRMC)

While reading Intermediate Microeconomics from Hal Varian, I fell short in understanding the relationship between SRMC and LRMC. I can see how in SR, when fixed factor is chosen at LR optimizing condition, then

                         c(y) = cs (y,k(y))


where, k is the fixed factor.

But at pg. 394 of 8th edition, in Appendix to Ch. 21 (Cost Curves), author writes, "...the long-run marginal cost will consist of two pieces: how costs change holding plant size fixed plus how costs change when plant size adjusts. But if the plant size is chosen optimally, this last term has to be zero!". This is what I am unable to understand, how the 'second' term is zero!

Please, help me understand both intuitively and through calculus.

First, fix an output level $y^*$. Now you solve the (long run) cost-minimization problem conditional to this output level. We obtain the cost function $c(y)$ and the conditional demand function $k(y)$.
Suppose we are at a cost-minimizing size of plant, $k(y^*)=:k^*$, for this output level. If costs decreased when you increase plant size, then it would pay to increase plant size. This contradicts our choice of plant size. Likewise, if cost increases when you increase plant size, then it would pay to decrease plant size. Again, this contradicts our choice of plant size. So, $$\left(\frac{\partial c(y)}{\partial k}\right)_{y=y^*,k=k^*}=0.$$