How is the Chain Rule Applied to Composite Functions of Two Variables?

  • Context: Graduate 
  • Thread starter Thread starter hotvette
  • Start date Start date
  • Tags Tags
    Chain Chain rule
Click For Summary

Discussion Overview

The discussion revolves around the application of the chain rule to composite functions of two variables, particularly in the context of partial derivatives. Participants explore different formulations and notations for expressing the chain rule, as well as the implications of these choices in calculations involving functions defined by constraints.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant presents a formulation of the chain rule for composite functions of two variables and questions its correctness when x is treated as an independent variable.
  • Another participant agrees with the initial formulation but points out a typo in the notation used for the chain rule.
  • A different participant emphasizes the importance of notation and clarifies the distinction between derivatives of functions and real numbers, suggesting that the notation should reflect the function being differentiated.
  • Participants discuss the implications of using different notations for partial derivatives, such as using subscripts to indicate which variable is held constant during differentiation.
  • One participant expresses difficulty in applying the chain rule correctly and seeks clarification on how to properly express the derivatives given the constraints.
  • Another participant suggests that expressing everything explicitly in terms of functions may simplify the calculations and reduce confusion.
  • A later post indicates that the original participant has resolved their issue and found that their function behaves as expected when applying the chain rule.

Areas of Agreement / Disagreement

Participants generally agree on the importance of precise notation and the need to clarify which functions are being differentiated. However, there remains some disagreement on the best approach to express the chain rule and the implications of different notational choices.

Contextual Notes

Participants highlight the complexity of applying the chain rule in the context of composite functions and the potential for confusion arising from notation. There are unresolved aspects regarding the implications of different interpretations of partial derivatives based on the constraints provided.

hotvette
Homework Helper
Messages
1,001
Reaction score
11
Not homework, just having fun. Every reference I find illustrates the chain rule for composite functions of two variables in this way:
<br /> \begin{align*}<br /> B &amp;= f(x,y) \\<br /> x &amp;= g(w,z) \\<br /> y &amp;= h(w,z) \\<br /> \frac{\partial B}{\partial w} &amp;= \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) \\<br /> \frac{\partial B}{\partial z} &amp;= \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)<br /> \end{align*}<br />
But, my situation is:
<br /> \begin{align*}<br /> B &amp;= f(x,y) \\<br /> y &amp;= g(x,z)<br /> \end{align*}<br />
Is the following correct (since x is an independent variable)?
<br /> \begin{align*}<br /> \frac{\partial B}{\partial x} &amp;= \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) \\<br /> &amp;= \left(\frac{\partial B}{\partial x} \cdot 1\right) + \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial x}\right) \\<br /> &amp;= \left(\frac{\partial B}{\partial x}\right) + \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial x}\right) \\ \\<br /> \frac{\partial B}{\partial z} &amp;= \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) \\<br /> &amp;= \left(\frac{\partial B}{\partial x} \cdot 0\right) + \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial z}\right) \\<br /> &amp;= \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial z}\right)<br /> \end{align*}<br />
Looks kind of goofy, but seems to work using the following example:
<br /> \begin{align*}<br /> B &amp;= x^2y + xy \\<br /> y &amp;= x^3z<br /> \end{align*}<br />
 
Last edited:
Physics news on Phys.org
Looks right to me.
 
hotvette said:
Not homework, just having fun. Every reference I find illustrates the chain rule for composite functions of two variables in this way:
B = f(x,y) \\<br /> x = g(w,z) \\<br /> h = h(w,z) \\<br /> \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} \\<br />
You've got a typo in the line above. In the first term to the right of the = sign, you should be taking
\frac{\partial B}{\partial x} \cdot \frac{\partial x}{\partial w} + \frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial w}
 
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:
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 \left(\frac{\partial B}{\partial x} = \frac{\partial B}{\partial x} + \cdots\right),but I don't follow your post at all. Can you perhaps elaborate?
 
Last edited:
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?
 
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.
 
I think I understand, now. In my original post, I had \partial B / \partial x 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 \partial B / \partial x and \partial B / \partial z when B = f(x,y) and y = g(x,z). That still isn't clear to me.
 
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:\begin{align*}<br /> &amp;B = f(x,y) \\<br /> &amp;y = g(x,z) \\<br /> &amp;\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) \\<br /> &amp;\left(\frac{\partial B}{\partial z}\right) = \left(\frac{\partial B}{\partial y} \cdot \frac{\partial y}{\partial z}\right)<br /> \end{align*} 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 B(x,g(x,z)) the result is nearly impossible to evaluate, but using the chain rule makes the problem straightforward. My ultimate goal was to see if \partial B(x,g(x,z)) / \partial x = 0 and I verified today that it does.

The thought just occurred to me that the problem might be better stated as:
<br /> \begin{align*}<br /> \frac{\partial B(x,z)}{\partial x} &amp;= \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) \\<br /> %<br /> &amp;= \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) \\<br /> %<br /> &amp;= \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) \\ \\<br /> %<br /> %<br /> %<br /> \frac{\partial B(x,z)}{\partial z} &amp;= \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) \\<br /> %<br /> &amp;= \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) \\<br /> %<br /> &amp;= \left(\frac{\partial B(x,y)}{\partial y}\right) \cdot \left(\frac{\partial y(x,z)}{\partial z}\right)<br /> \end{align*}<br />
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K