Chain rule for a function of two expressions that share a variable?

57 Views Asked by At

My question pertains to a problem I'm confused about in my economics class.

For simplicity, say I have a function like $f(a,b,c) = g(ab, b + c)$ after making some substitutions. If I want to find the total differential of $f$, what do I do with the $\partial f/\partial b$ term? How do you do the chain rule for it if $b$ is present in both expressions in $g$?

2

There are 2 best solutions below

0
On

When taking derivatives in multivariable calculus, it's often a good idea to explicitly write down the mappings for these functions. When $a$ and $c$ are fixed, you have the function composition,

$$f(b) = (g \circ h)(b),$$

where $h(b) = (ab, b+c).$

Assuming we're working over the reals (this is economics after all), and assuming $f$ is real-valued, then the mappings are,

\begin{align} f&:{\bf R}\rightarrow{\bf R}\notag\\ g&:{\bf R}^2\rightarrow{\bf R}\notag\\ h&:{\bf R}\rightarrow{\bf R^2}.\notag \end{align}

You can immediately see from these mappings that the derivatives of $g$ and $h$ will need to be $2\times1$ vectors in some orientation, and you will need to combine/multiply them in such a way to produce the derivative of f, a real-valued function which takes a single variable, which we know from first year calculus will also need to be a real-valued function which takes a single variable.

The only real choice for multiplying $g'$ and $h'$ in such a way so as to obtain the desired outcome is the dot product, which can be written in matrix notation as,

$f'(b)=(\nabla g)(h(b))\cdot h'(b) = (\nabla g)(ab, b+c)\;[a, 1]^T.$

This is your partial derivative with respect to $b$.

0
On

We have the following situation, assuming codomain $\mathbb{R}$ for both functions $f$ and $g$:

\begin{align*} &g:\mathbb{R}^3\to\mathbb{R}&\qquad &f:\mathbb{R}^2\to\mathbb{R}\\ &g(x,y)&\qquad&f(a,b,c)=g(ab,b+c)\tag{1} \end{align*}

We consider $x,y$ as functions from $\mathbb{R}^3\to\mathbb{R}$ \begin{align*} &x=x(a,b,c)=ab\\ &y=y(a,b,c)=b+c \end{align*} and the connection with $g$ is \begin{align*} g=g(x,y)=g(x(a,b,c),y(a,b,c))=g(ab,a+b) \end{align*}

The total differential of $f$ is \begin{align*} df=\frac{\partial f}{\partial a}da+\frac{\partial f}{\partial b}db+\frac{\partial f}{\partial c}dc \end{align*}

From (1) we can express the partial derivative $\frac{\partial f}{\partial b}$ in terms of $g$ as \begin{align*} \color{blue}{\frac{\partial f}{\partial b}=\frac{\partial g}{\partial x}\frac{\partial x}{\partial b}+\frac{\partial g}{\partial y}\frac{\partial y}{\partial b}}\tag{2} \end{align*}

To better see what's going on, let's make an example.

Example: $g(x,y)=3xy^2+\ln y$

We have \begin{align*} f(a,b,c)&=g(ab,b+c)\\ &=3ab(b+c)^2+\ln(b+c)\tag{3}\\ \end{align*}

On the one hand we obtain from (3) \begin{align*} \frac{\partial f}{\partial b}(a,b,c)&=\frac{\partial}{\partial b}\left(3ab(b+c)^2+\ln(b+c)\right)\\ &=3a(b+c)^2+6ab(b+c)+\frac{1}{b+c} \end{align*} On the other hand we obtain from (2) \begin{align*} \frac{\partial f}{\partial b}(a,b,c)&=\frac{\partial g}{\partial x}(x(a,b,c),y(a,b,c))\frac{\partial x}{\partial b}(a,b,c)\\ &\qquad+\frac{\partial g}{\partial y}(x(a,b,c),y(a,b,c))\frac{\partial y}{\partial b}(a,b,c)\\ &=\left.3y^2\right|_{x=ab,y=b+c}\cdot a+\left.\left(6xy+\frac{1}{y}\right)\right|_{x=ab,y=b+c}\\ &=3a(b+c)^2+6ab(b+c)+\frac{1}{b+c} \end{align*}