Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Rusty on Chain Rule

  1. Sep 25, 2014 #1

    hotvette

    User Avatar
    Homework Helper

    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: Sep 25, 2014
  2. jcsd
  3. Sep 25, 2014 #2

    Char. Limit

    User Avatar
    Gold Member

    Looks right to me.
     
  4. Sep 25, 2014 #3

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    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]
     
  5. Sep 25, 2014 #4

    Fredrik

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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: Sep 25, 2014
  6. Sep 25, 2014 #5

    hotvette

    User Avatar
    Homework Helper

    Thanks, I fixed the typo and cleaned things up a bit.

    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: Sep 25, 2014
  7. Sep 26, 2014 #6

    Fredrik

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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?
     
  8. Sep 26, 2014 #7

    Fredrik

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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.
     
  9. Sep 28, 2014 #8

    hotvette

    User Avatar
    Homework Helper

    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.
     
  10. Sep 28, 2014 #9

    Fredrik

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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.
     
  11. Sep 28, 2014 #10

    hotvette

    User Avatar
    Homework Helper

    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??
     
  12. Sep 28, 2014 #11

    Fredrik

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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.
     
  13. Sep 29, 2014 #12

    hotvette

    User Avatar
    Homework Helper

    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: Sep 30, 2014
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Rusty on Chain Rule
  1. Chain Rule (Replies: 9)

  2. Chain Rule (Replies: 30)

  3. Chain Rule (Replies: 25)

  4. Chain rule. (Replies: 6)

  5. The Chain Rule (Replies: 3)

Loading...