# Multivariable Chain Rule for Single Variable Function

Suppose we have a function $$C(P, S(P))$$ that depends on $$P$$ and $$S(P)$$, where $$S$$ is another function.

I understand that from chain rule, we have \begin{align*} \frac{dC}{dP} &= \frac{\partial C}{\partial P} + \frac{\partial C}{\partial S}\frac{\partial S}{\partial P}. \end{align*}

However, what is the right way to interpret the difference between $$\frac{dC}{dP}$$ and $$\frac{\partial C}{\partial P}$$?

• You mean $\dfrac{dC}{dP}=\dfrac{\partial C}{\partial P}+\dfrac{\partial C}{\partial {\color{red} S}}\dfrac{\partial S}{\partial P}$, right? Apr 12, 2020 at 21:08
• Yes, I’ve corrected it now Apr 12, 2020 at 21:15

The difference here is that in $$\dfrac{dC}{dP}$$, $$S$$ is treated as a function of $$P$$, while in $$\dfrac{\partial C}{\partial P}$$, $$S$$ is treated as a constant.

Let us take an example to illustrate that these two ways really do give the same answer. Consider: $$C(P,S(P))=P\cdot S(P).$$ The single-variable product- and chain rules then give: $$\frac{dC}{dP}=S(P)+P\cdot S'(P).$$ But if we take partial derivatives as in the multivariable chain rule, we treat $$S$$ as a constant when differentiating with respect to $$P$$ and $$P$$ as a constant when differentiating with respect to $$S$$. We may write the function as just $$C=PS$$ to aid our thinking. We then get: $$\frac{dC}{dP}=\dfrac{\partial C}{\partial P}+\frac{\partial C}{\partial S}\frac{\partial S}{\partial P}=S+S\frac{dS}{dP}=S+P\cdot S'(P),$$ the same answer we got with the regular chain rule and product rule.

The difference is depending on how you express the function $$C(P,S(P))$$. If you expressed this in terms of both variables $$P$$ and $$S$$, you would be writing this in the format:

$$C(P,S(P)) = \text{"expressions in S and P"}.$$

Here the partial derivative $$\frac{\partial C}{\partial P}$$ just represents the partial derivative of expressions in $$P$$, holding variable $$S$$ constant, while the total derivative also differentiates $$S$$ to find the derivative with respect to the dependence of $$S$$ on $$P$$.

On the other hand, if substituted whatever expressions we have for $$S = S(P)$$ and simply write:

$$C(P) \;\; =\;\; \text{"expressions solely in terms of P"}$$

then we can take the total derivative $$\frac{dC}{dP}$$ and this would agree with the total derivative that we found up above. So to summarize, if we express $$C$$ as a function in terms of $$P$$ and $$S$$, then $$\frac{\partial C}{\partial P}$$ just represents the derivative of $$C$$ with respect to $$P$$ but only for those terms that are not dependent on $$S$$. The total derivative $$\frac{dC}{dP}$$ is the total derivative, and this can be found by using the chain rule, or substituting the expression for $$S$$ with terms written in the variable $$P$$.