Differentiating a function of functions If I have the function $ h \equiv h(f(x,t),g(x,t))$, where $x$ and $t$ are independent variables and $f$ and $g$ are functions of $x$ and $t$.
Then is,
$$\frac{\mathrm{d}h }{\mathrm{d} t} = h\left(\frac{\mathrm{d}f }{\mathrm{d} t},g \right) + h\left(f , \frac{\mathrm{d}g }{\mathrm{d} t}\right)$$ 
or
$$\frac{\mathrm{d}h }{\mathrm{d} t} = h\left(\frac{\partial{d}f }{\partial{d} t},g \right) + h\left(f , \frac{\partial{d}g }{\partial{d} t}\right)\ ?$$ 
And can you tell me why? I think the first one might be correct.
 A: This is just chain rule:
$$\frac{\partial h}{\partial t}(f(x,t),g(x,t)) = \frac{\partial h}{\partial f}(f(x,t),g(x,t))\frac{\partial f}{\partial t}(x,t) + \frac{\partial h}{\partial g}(f(x,t),g(x,t))\frac{\partial g}{\partial t}(x,t).$$
A: Since I hate this abuse of notation, I'll introduce new variables


*

*$u = f(x,t)$

*$v = g(x,t)$

*$y = h(u,v)$


Now, back to the question.

Except in degenerate cases, $\frac{\mathrm{d}y}{\mathrm{d}t}$ doesn't exist at all!
The differential of $y$ is given by
$$\begin{align}
 \mathrm{d}y &= h_1(u,v) \mathrm{d}u + h_2(u,v) \mathrm{d}v
\\ &= h_1(u,v) \left( f_1(x,t) \mathrm{d}x + f_2(x,t) \mathrm{d}t \right)
 + h_2(u,v) \left( g_1(x,t) \mathrm{d}x + g_2(x,t) \mathrm{d}t \right)
\\&= \left( h_1(u, v) f_1(x,t) + h_2(u,v) g_1(x,t) \right) \mathrm{d}x
 + \left( h_1(u, v) f_2(x,t) + h_2(u,v) g_2(x,t) \right) \mathrm{d}t
\end{align}$$
where I've used subscript notation on functions to refer to which place to take the derivative of a function.
The premise that $x$ and $t$ are independent implies that $\mathrm{d}x$ and $\mathrm{d}t$ are linearly independent. Thus, $\mathrm{d}y$ can only be a multiple of $\mathrm{d}t$ at those places where
$$  h_1(u, v) f_1(x,t) + h_2(u,v) g_1(x,t) = 0 $$
On any domain where this doesn't hold, the notion of $\frac{\mathrm{d}y}{\mathrm{d}t}$ is simply nonsensical.

For those who prefer the following notation style, the above formula would usually be written as
$$ \mathrm{d}h = \left( \frac{\partial h}{\partial f} \frac{\partial f}{\partial x} + \frac{\partial h}{\partial g} \frac{\partial g}{\partial x}  \right) \mathrm{d}x +  \left( \frac{\partial h}{\partial f} \frac{\partial f}{\partial t} + \frac{\partial h}{\partial g} \frac{\partial g}{\partial t}  \right) \mathrm{d}t $$
and the condition needed for  $\frac{\mathrm{d}h}{\mathrm{d}t}$ to exist is
$$  \frac{\partial h}{\partial f} \frac{\partial f}{\partial x} + \frac{\partial h}{\partial g} \frac{\partial g}{\partial x}  = 0 $$
