1

Let there be a function $f$ of two variables $x$ and $y$ who are dependent on a single variable $t$. I tried to derive the second order total derivative of f, $\frac{df}{dt}$

Before asking this, I have checked the topic Intuition behind second total derivative Here the poster is not asking how to derive it, they want to get the intuition behind it. Here, I have a problem deriving that six-term expression.

So, the first total derivative is $\frac { \mathrm d f } { \mathrm d t } = \frac { \partial f } { \partial x } \frac { \mathrm d x } { \mathrm d t } + \frac { \partial f } { \partial y } \frac { \mathrm d y } { \mathrm d t } $

and the second total derivative is

$\frac{\mathrm d}{\mathrm d t }(\frac { \mathrm d f } { \mathrm d t }) =\frac{\mathrm d}{\mathrm d t }( \frac { \partial f } { \partial x } \frac { \mathrm d x } { \mathrm d t }) + \frac{\mathrm d}{\mathrm d t }(\frac { \partial f } { \partial y } \frac { \mathrm d y } { \mathrm d t } )$

Applying the product rule to two terms to the right of equal sign:

$\frac { \mathrm d ^ 2 f } { \mathrm d t ^ 2 }$=$(\frac{\mathrm d}{\mathrm d t } \frac { \partial f } { \partial x })\frac { \mathrm d x } { \mathrm d t }+\frac { \partial f } { \partial x }\frac{\mathrm d}{\mathrm d t }\frac { \mathrm d x } { \mathrm d t }+(\frac{\mathrm d}{\mathrm d t } \frac { \partial f } { \partial y })\frac { \mathrm d y } { \mathrm d t }+\frac { \partial f } { \partial y }\frac{\mathrm d}{\mathrm d t }\frac { \mathrm d y } { \mathrm d t }$

and then:

$\frac { \ d ^ 2 f } { \mathrm d t ^ 2 }=\frac { \partial ^2f } { \partial x ^ 2 }\frac { \mathrm d x } { \mathrm d t }\frac { \mathrm d x } { \mathrm d t }+\frac { \partial f } { \partial x }\frac { \mathrm d^2 x } { \mathrm d t^2 }+\frac { \partial ^ 2 f } { \partial y ^ 2 }\frac { \mathrm d y } { \mathrm d t }\frac { \mathrm d y } { \mathrm d t }+\frac { \partial f } { \partial y }\frac { \mathrm d^2 y } { \mathrm d t^2 }$

Finally:

$\frac { \mathrm d ^ 2 f } { \mathrm d t ^ 2 }=\frac { \partial ^ 2 f } { \partial x ^ 2 } ( \frac { \mathrm d x } { \mathrm d t } ) ^ 2 +\frac { \partial f } { \partial x }\frac { \mathrm d^2 x } { \mathrm d t^2 }+\frac { \partial ^ 2 f } { \partial y ^ 2 } ( \frac { \mathrm d y } { \mathrm d t } ) ^ 2+\frac { \partial f } { \partial y }\frac { \mathrm d^2 y } { \mathrm d t^2 }$

However, the correct expression is

$\frac { \mathrm d ^ 2 f } { \mathrm d t ^ 2 } = \frac { \partial ^ 2 f } { \partial x ^ 2 } ( \frac { \mathrm d x } { \mathrm d t } ) ^ 2 + \frac { \partial ^ 2 f } { \partial y \, \partial x } \frac { \mathrm d y } { \mathrm d t } \frac { \mathrm d x } { \mathrm d t } + \frac { \partial f } { \partial x } \frac { \mathrm d ^ 2 x } { \mathrm d t ^ 2 } + \frac { \partial ^ 2 f } { \partial x \, \partial y } \frac { \mathrm d x } { \mathrm d t } \frac { \mathrm d y } { \mathrm d t } + \frac { \partial ^ 2 f } { \partial y ^ 2 } ( \frac { \mathrm d y } { \mathrm d t } ) ^ 2 + \frac { \partial f } { \partial y } \frac { \mathrm d ^ 2 y } { \mathrm d t ^ 2 } $

I am missing $\frac { \partial ^ 2 f } { \partial y \, \partial x } \frac { \mathrm d y } { \mathrm d t } \frac { \mathrm d x } { \mathrm d t }$ and $\frac { \partial ^ 2 f } { \partial x \, \partial y } \frac { \mathrm d y } { \mathrm d t } \frac { \mathrm d x } { \mathrm d t }$

Where do these two terms come from?

  • 1
    It is unclear why you say the "first and third terms need the product rule" as there is no derivative of a product. What you should do instead is use the chainrule to expand $\frac{d}{dt}=\frac{\partial }{\partial x}\frac{dx}{dt}+\frac{\partial }{\partial y}\frac{dy}{dt}$. When you then apply this to $\frac{\partial f}{\partial x}$ and multiply it out you get the terms you were lacking. – Lourenco Entrudo Feb 11 '22 at 13:40
  • @LourencoEntrudo You're right, I've edited that part. – Ali Kıral Feb 11 '22 at 15:43

2 Answers2

1

I'm confused about your comment ‘the first and third terms again need the product rule’; if you used the product rule on them, then they would again split into two terms each, and you'd have your six terms total. They're not products, so they don't really need the product rule; however, they do need another rule that splits things into two terms each, which is the rule for the total derivative.

Specifically, just as $$ \frac { \mathrm d } { \mathrm d t } f = \frac { \partial } { \partial x } f \cdot \frac { \mathrm d x } { \mathrm d t } + \frac { \partial } { \partial x } f \cdot \frac { \mathrm d y } { \mathrm d t } $$ in the first total derivative, so $$ \frac { \mathrm d } { \mathrm d t } \biggl ( \frac { \partial f } { \partial x } \biggr ) = \frac { \partial } { \partial x } \biggl ( \frac { \partial f } { \partial x } \biggr ) \cdot \frac { \mathrm d x } { \mathrm d t } + \frac { \partial } { \partial y } \biggl ( \frac { \partial f } { \partial x } \biggr ) \cdot \frac { \mathrm d y } { \mathrm d t } $$ in the first of your four terms for the second total derivative, and similarly in your third term. This is where you get the additional terms with the mixed second partial derivatives.

It's also worth noticing that (as long as $ f $ is twice differentiable as a function of $ x $ and $ y $) these two terms are equal, so they can now be combined into a single term.

Toby Bartels
  • 4,679
  • 1
    I realized my mistake. Partial derivative of f wrt x is not only dependent on x, but also is dependent on y. Thanks! By the way, shouldn't the second terms start with partial derivative with respect to y rather than x in your expressions and the second parantheses starting from the equal sign include partial derivative of f wrt x rather than y? Probably just a typo though – Ali Kıral Feb 11 '22 at 15:52
  • 1
    @AliKıral : Yes, I made the second term by copy-pasting the first term and changing $x$ to $y$, but I changed the wrong one. But since you caught the mistake, it's clear that you understand! (And I fixed it now.) – Toby Bartels Feb 11 '22 at 20:19
1

I am surprised that on this and other similar threads noone's put things in subscript notation for partials and Lagrange notation for derivatives of x and y, I find it cleans things up and makes the sequence of operations easier to follow (so many fractions with dels and d's makes my eyes bleed): $$ f(x(t), y(t)) $$ $$ \frac {df}{dt} = \frac{\partial f}{\partial x} \frac{d x}{d t} + \frac{\partial f}{\partial y} \frac{d y}{d t} = f_x x' + f_y y' $$ Before going any further, the key bit to bear in mind here is that any time we see $f$, $f_x$, $f_{xx}$, etc., we're omitting these functions' arguments for legibility, but rightly, $f_x = f_x(x,y)$. That's the important fact that ends up resolving the omission you'd originally made. Meanwhile any time we see $x$, $x'$, these functions' arguments are only $t$; written in full, we have $x'' = x''(t)$, and so on. Continuing: $$ \therefore \frac{d}{dt} \frac {df}{dt} = \frac{d}{dt} \Big[ f_x x' \Big] + \frac{d}{dt} \Big[ f_y y' \Big] $$ $$ = x' \Big[ \frac{d}{dt} f_x \Big] + x'' f_x + y' \Big[ \frac{d}{dt} f_y \Big] + y'' f_y $$ As mentioned in @TobyBartels answer above, the next step is where you have to be careful to treat $f_x$ and $f_y$ just like any other function -- there's no guaranteeing that $f_x$ won't have $y$ terms in it or vice versa. The first time I did this whole derivation, I kept every function's arguments just to not get confused on this point: $f_x$ is rightly $f_x(x,y)$, and so its derivative with respect to $t$ will have 'contributions' both 'through' $x$ and through $y$ (not sure if that wording makes things clearer or more confusing, it's how I think of it). Alternatively, you could substitute $g(x,y) = f_x(x,y)$ and do the following step, if that makes things clearer. But you get the idea. Continuing: $$ = x' \Big[ \frac{\partial f_x}{\partial x} \frac{d x}{d t} + \frac{\partial f_x}{\partial y} \frac{d y}{d t} \Big] + x'' f_x + y' \Big[ \frac{\partial f_y}{\partial x} \frac{d x}{d t} + \frac{\partial f_y}{\partial y} \frac{d y}{d t} \Big] + y'' f_y $$ $$ = x' \Big[ f_{xx} x' + f_{xy} y' \Big] + x'' f_x + y' \Big[ f_{xy} x' + f_{yy} y' \Big] + y'' f_y $$ $$ = f_{xx} (x')^2 + f_{xy} x' y' + x'' f_x + f_{xy} x' y' + f_{yy} (y')^2 + y'' f_y $$ $$ \therefore \frac{d^2f}{dt^2} = f_{xx} (x')^2 + x'' f_x + 2f_{xy} x' y' + y'' f_y + f_{yy} (y')^2 $$