Exploring the Chain Rule for a Composite Function of Two Variables

In summary, the chain rule for composite functions of two variables can be stated as follows:B = f(x,y)x = g(w,z)y = h(w,z)\frac{\partial B}{\partial w} = \frac{\partial B}{\partial x} \cdot \frac{\partial x}{\partial x} + \frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial w}\frac{\partial B}{\partial z} = \frac{\partial B}{\partial x} \cdot \frac{\partial x}{\partial z} + \frac{\partial B}{\
  • #1
hotvette
Homework Helper
996
5
Not homework, just having fun. Every reference I find illustrates the chain rule for composite functions of two variables in this way:
[tex]
\begin{align*}
B &= f(x,y) \\
x &= g(w,z) \\
y &= h(w,z) \\
\frac{\partial B}{\partial w} &= \left( \frac{\partial B}{\partial x} \cdot \frac{\partial x}{\partial w} \right ) + \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial w}\right) \\
\frac{\partial B}{\partial z} &= \left(\frac{\partial B}{\partial x} \cdot \frac{\partial x}{\partial z}\right) + \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial z}\right)
\end{align*}
[/tex]
But, my situation is:
[tex]
\begin{align*}
B &= f(x,y) \\
y &= g(x,z)
\end{align*}
[/tex]
Is the following correct (since x is an independent variable)?
[tex]
\begin{align*}
\frac{\partial B}{\partial x} &= \left(\frac{\partial B}{\partial x} \cdot \frac{\partial x}{\partial x}\right) + \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial x}\right) \\
&= \left(\frac{\partial B}{\partial x} \cdot 1\right) + \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial x}\right) \\
&= \left(\frac{\partial B}{\partial x}\right) + \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial x}\right) \\ \\
\frac{\partial B}{\partial z} &= \left(\frac{\partial B}{\partial x} \cdot \frac{\partial x}{\partial z}\right) + \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial z}\right) \\
&= \left(\frac{\partial B}{\partial x} \cdot 0\right) + \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial z}\right) \\
&= \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial z}\right)
\end{align*}
[/tex]
Looks kind of goofy, but seems to work using the following example:
[tex]
\begin{align*}
B &= x^2y + xy \\
y &= x^3z
\end{align*}
[/tex]
 
Last edited:
Physics news on Phys.org
  • #2
Looks right to me.
 
  • #3
hotvette said:
Not homework, just having fun. Every reference I find illustrates the chain rule for composite functions of two variables in this way:
[tex] B = f(x,y) \\
x = g(w,z) \\
h = h(w,z) \\
\frac{\partial B}{\partial w} = \frac{\partial B}{\partial x} \cdot \frac{\partial x}{\partial x} + \frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial w} \\
[/tex]
You've got a typo in the line above. In the first term to the right of the = sign, you should be taking
[itex]\frac{\partial B}{\partial x} \cdot \frac{\partial x}{\partial w} + \frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial w}[/itex]
 
  • #4
Be careful with the notation.
\begin{align}
&\frac{d}{dx}f(x,g(x,z)) =\lim_{h\to 0}\frac{f(x+h,g(x+h,z))-f(x,g(x,z))}{h}\\
&\frac{\partial}{\partial x}f(x,g(x,z)) =\lim_{h\to 0}\frac{f(x+h,g(x,z))-f(x,g(x,z))}{h}
\end{align} The former is the derivative of the function ##t\mapsto f(t,g(t,z))## at x. The latter is the derivative of the function ##t\mapsto f(t,g(x,z))## at x. The chain rule doesn't enter the picture when you evaluate the latter.

With this in mind, do you see what ##\frac{d}{dz}f(x,g(x,z))##, ##\frac{\partial}{\partial y}f(x,g(x,z)) ## and ##\frac{\partial}{\partial z}f(x,g(x,z))## are? Answers below:

\begin{align}
&\frac{d}{dz}f(x,g(x,z)) =\lim_{h\to 0}\frac{f(x,g(x,z+h))-f(x,g(x,z))}{h}\\
&\frac{\partial}{\partial y}f(x,g(x,z)) =\lim_{h\to 0}\frac{f(x,g(x,z)+h)-f(x,g(x,z))}{h}\\
&\frac{\partial}{\partial z}f(x,g(x,z)) =\text{not defined}.
\end{align}
 
Last edited:
  • #5
SteamKing said:
You've got a typo in the line above
Thanks, I fixed the typo and cleaned things up a bit.

Fredrik said:
Be careful with the notation.
Yep, I noticed something didn't quite look right about the notation [itex]\left(\frac{\partial B}{\partial x} = \frac{\partial B}{\partial x} + \cdots\right)[/itex],but I don't follow your post at all. Can you perhaps elaborate?
 
Last edited:
  • #6
hotvette said:
...I don't follow your post at all. Can you perhaps elaborate?
Yes, but it would help if you first elaborate on what you find difficult to follow. Do you understand the definition of "derivative" for example?
 
  • #7
My main point is that we take derivatives of functions, not of real numbers, and the notation we use at the start of the calculation should inform us what function we're differentiating.

The equations ##B=x^2y+xy## and ##y=x^3z## are constraints that tell us that the variables x,y,z,B (which all represent real numbers, not functions) must be assigned values that are consistent with the constraints. The constraints define a bunch of differentiable functions, and a notation like ##\partial B/\partial x## should refer to a partial derivative of one those functions. But what function, and what partial derivative?

Suppose that you define g by ##g(r,s)=r^3s## for all ##r,s\in\mathbb R##, and f by ##f(r,s)=r^2s+rs## for all ##r,s\in\mathbb R##. Then we have ##B=f(x,g(x,z))##, and it's natural to interpret ##\frac{\partial B}{\partial x}## as ##\frac{\partial f(x,g(x,z))}{\partial x}##. But the latter is equal to
$$\lim_{h\to 0}\frac{f(x+h,g(x,z))-f(x,g(x,z))}{h},$$ not
$$\lim_{h\to 0}\frac{f(x+h,g(x+h,z))-f(x,g(x,z))}{h},$$ which is what you calculated.
 
  • #8
I think I understand, now. In my original post, I had [itex]\partial B / \partial x[/itex] twice in the same equation and they each represented different partials (as clarified in the limits you posted).

The question remains as to how to properly apply the chain rule (from the standpoint of notation) to find [itex]\partial B / \partial x[/itex] and [itex]\partial B / \partial z[/itex] when [itex]B = f(x,y)[/itex] and [itex]y = g(x,z)[/itex]. That still isn't clear to me.
 
  • #9
The constraints tell us that B=f(x,g(x,z)). We can introduce a new function h such that h(r,s)=f(r,g(r,s)) for all ##r,s\in\mathbb R##. Then we have ##B=f(x,g(x,z))=h(x,z)##. I would avoid the notation ##\frac{\partial B}{\partial x}##, because it's not clear if it means
$$\frac{\partial}{\partial x}f(x,g(x,z)) =D_1f(x,g(x,z)),$$ or
$$\frac{\partial}{\partial x}h(x,z)=D_1h(x,z)=D_1f(x,g(x,z))+D_2f(x,g(x,z)) D_1g(x,z).$$ One trick I've seen is to use the notation ##\left(\frac{\partial B}{\partial x}\right)_y## for the former, and ##\left(\frac{\partial B}{\partial x}\right)_z## for the latter. The idea is that the subscript tells us which variable is "held constant" when we take the limit that defines the derivative, and that this indirectly tells us what function we're differentiating.
 
  • #10
OK. Using that notation, we have:[tex]\begin{align*}
&B = f(x,y) \\
&y = g(x,z) \\
&\left(\frac{\partial B}{\partial x}\right)_z = \left(\frac{\partial B}{\partial x}\right)_y + \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial x}\right) \\
&\left(\frac{\partial B}{\partial z}\right) = \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial z}\right)
\end{align*}[/tex] Correct??
 
  • #11
I think you should probably write the left-hand side in the last one as ##\left(\frac{\partial B}{\partial z}\right)_x##, to eliminate interpretations like this: We have ##B=f(x,y)=f(x,g(x,z))=h(x,z)## and ##y=g(x,z)=x^3z##. If we solve the last one for x, we can write ##B=h\big(\left(\frac{y}{z}\right)^{\frac 1 3},z\big)=p(y,z)##, and interpret ##\frac{\partial B}{\partial z}## as ##D_2p(y,z)## instead of as ##D_2h(x,z)##.

Similarly, you may need to write ##\left(\frac{\partial B}{\partial y}\right)_x## instead of ##\frac{\partial B}{\partial y}##, but I didn't think that one through.

I think it's a real pain to keep track of all these things in a calculation, so I usually try to express everything explicitly in terms of functions as early as possible, instead of in terms of variables with constraints that implicitly define functions.
 
  • #12
Thanks. Issue resolved. My function B is a rather complicated function of sums of exponentials involving x,y and y is an exponential involving x, z. If I try to explicitly form [itex]B(x,g(x,z))[/itex] the result is nearly impossible to evaluate, but using the chain rule makes the problem straightforward. My ultimate goal was to see if [itex]\partial B(x,g(x,z)) / \partial x = 0[/itex] and I verified today that it does.

The thought just occurred to me that the problem might be better stated as:
[tex]
\begin{align*}
\frac{\partial B(x,z)}{\partial x} &= \left(\frac{\partial B(x,y)}{\partial x}\right) \cdot \left(\frac{\partial x}{\partial x}\right) + \left(\frac{\partial B(x,y)}{\partial y}\right) \cdot \left(\frac{\partial y(x,z)}{\partial x}\right) \\
%
&= \left(\frac{\partial B(x,y)}{\partial x}\right) \cdot \left( 1 \right) + \left(\frac{\partial B(x,y)}{\partial y}\right) \cdot \left(\frac{\partial y(x,z)}{\partial x}\right) \\
%
&= \left(\frac{\partial B(x,y)}{\partial x}\right) + \left(\frac{\partial B(x,y)}{\partial y}\right) \cdot \left(\frac{\partial y(x,z)}{\partial x}\right) \\ \\
%
%
%
\frac{\partial B(x,z)}{\partial z} &= \left(\frac{\partial B(x,y)}{\partial z}\right) \cdot \left(\frac{\partial z}{\partial x}\right) + \left(\frac{\partial B(x,y)}{\partial y}\right) \cdot \left(\frac{\partial y(x,z)}{\partial z}\right) \\
%
&= \left(0\right) \cdot \left(\frac{\partial z}{\partial x}\right) + \left(\frac{\partial B(x,y)}{\partial y}\right) \cdot \left(\frac{\partial y(x,z)}{\partial z}\right) \\
%
&= \left(\frac{\partial B(x,y)}{\partial y}\right) \cdot \left(\frac{\partial y(x,z)}{\partial z}\right)
\end{align*}
[/tex]
 
Last edited:

Related to Exploring the Chain Rule for a Composite Function of Two Variables

1. What is the chain rule for a composite function of two variables?

The chain rule for a composite function of two variables is a method used to find the derivative of a function that is composed of two or more functions. It states that the derivative of a composite function is equal to the derivative of the outer function multiplied by the derivative of the inner function.

2. How do you apply the chain rule to a composite function of two variables?

To apply the chain rule to a composite function of two variables, you first need to identify the outer function and the inner function. Then, take the derivative of the outer function and multiply it by the derivative of the inner function. Finally, plug in the original function to get the final result.

3. Can the chain rule be used for more than two variables?

Yes, the chain rule can be used for more than two variables. It can be extended to functions with any number of variables by taking the partial derivatives of each variable and multiplying them together.

4. What are some real-life applications of the chain rule for composite functions of two variables?

The chain rule for composite functions of two variables has many real-life applications, such as in physics, economics, and engineering. For example, it can be used to calculate the rate of change of a system with multiple variables, or to optimize a function with multiple inputs.

5. Are there any common mistakes when applying the chain rule for composite functions of two variables?

Yes, there are some common mistakes that can occur when applying the chain rule for composite functions of two variables. These include forgetting to take the derivative of the outer function, mixing up the order of the functions, or not applying the chain rule correctly for functions with more than two variables. It is important to carefully identify the functions and follow the steps of the chain rule to avoid these mistakes.

Similar threads

Replies
3
Views
2K
Replies
1
Views
1K
Replies
1
Views
2K
Replies
5
Views
760
Replies
6
Views
2K
Replies
3
Views
2K
Replies
3
Views
1K
  • Calculus
Replies
5
Views
1K
  • Calculus
Replies
5
Views
1K
Back
Top