# What is the total derivative of a partial derivative of a function, whos total derivative depends on that function?

I have a function $c(t,\lambda)$ with

$$\frac{\text dc}{\text dt}=f(c,\lambda),$$

or

$$\left(\frac{\text dc}{\text dt}\right)(t,\lambda)=f(c(t,\lambda),\lambda),$$

How to compute $$\frac{\text d}{\text dt}\left(\frac{\partial c}{\partial \lambda}\right)\ ?$$

Or more importantly why/how?

-
If $\lambda$ is not a function of $t$, you still should use partial derivative w.r.t. $t$ – Ilya Feb 14 '12 at 13:30
I think I have addressed the how in my post. For the why, one must first remember that this is a weird kind of self-referential (but certainly not artificial) problem...because it's a differential equation. With that in mind, ponder the diagram below, and then look at the forms that the derivatives take, i.e. the subscripts of $c$ and $f$ in the partials used. These are given functions, with fixed properties like their partial derivatives (with respect to their nominal arguments). But total derivatives require the chain rule & account for all formal arguments of the differentiated quantity. – bgins Feb 14 '12 at 23:57
just out of curiosity, where did this problem come from? – bgins Feb 15 '12 at 0:05
If $\lambda$ is a model parameter, then $\lambda'=0$ so that $c'=c_t$, $c'=f(c,\lambda)$ becomes a PDE not an ODE, and the inferred (a posteriori) formula for $c_{\lambda}$ in my post is invalid. In this case, I think the answer would be the first "unused" equation mentioned near the end of my post, i.e. $(c_{\lambda})'=c_{\lambda t}$, bringing us back to @il-y-a's comment. – bgins Feb 15 '12 at 8:32

Let primes denote total derivatives with respect to $t$ and subscripts denote partial derivatives, so that $t_\lambda=\lambda_t=0$ but $\lambda'=\frac{d\lambda}{dt}$ is "irreducible" (and not necessarily zero), and assume that all derivatives below exist. Given the equation $$c'=\frac{d}{dt}c(t,\lambda)=f(c,\lambda)$$ for the total derivative of $c$ with respect to $t$, note that (a priori) $$dc =\frac{\partial c}{\partial t}dt +\frac{\partial c}{\partial \lambda}d\lambda \quad\implies\quad c'=c_t+c_\lambda\lambda'$$ which in our case (a posteriori), i.e. from $f=c'$, implies that $$\frac{\partial c}{\partial \lambda} =c_\lambda=\frac{c'-c_t}{\lambda'} =\frac{f-c_t}{\lambda'}.$$ Although $c_t$ and $c_\lambda$ are, like $c(t,\lambda)$, functions of the independent variables $t$ and $\lambda$, they nevertheless also satisfy a constraint with respect to the the total derivative. This is true a priori. However, in our case, we are given that $c$ satisfies an ordinary differential equation with respect to time, i.e. the total derivative of $c$ with respect to "time" $t$ is itself a function $f$ of $c$ and $\lambda$. This is specific to our problem (a posteriori), and introduces extra paths (from $c'$ to $c$ and $\lambda$), but not cycles, in the directed graph or DAG of variable dependencies depicted below. These extra dependency paths are shown in green, while the original depenencies of $c(t,\lambda)$ are red, and all the rest, which follow from a priori principles (like the total derivative a.k.a. chain rule formula are black).
Now from the (a priori) definition of total derivative, $$\frac{d}{dt}f(c,\lambda) =f_cc'+f_\lambda\lambda' =ff_c+\lambda'f_\lambda$$ and $$(c_t)'=c_{tt}+\lambda'c_{t\lambda}$$ so that (using the quotient rule) $$\frac{d}{dt} \left( \frac{\partial c}{\partial \lambda} \right) = (c_\lambda)' = \left( \frac{f-c_t}{\lambda'} \right)' = \frac{ \left(f'-(c_t)'\right)\lambda' - \left(f-c_t\right)\lambda'' }{(\lambda')^2}$$ $$=\frac{ \left(ff_c+\lambda'f_\lambda\right) -\left(c_{tt}+\lambda'c_{t\lambda}\right) -\lambda''c_\lambda }{\lambda'}$$ $$=f_\lambda-c_{t\lambda} +\frac{ff_c-c_{tt}-\lambda''c_\lambda}{\lambda'}$$ Note that we did not need or use the equations $$(c_\lambda)'=c_{\lambda t}+\lambda'c_{\lambda\lambda}$$ $$(c')_t=c_{tt}+\lambda'c_{\lambda t}$$ but by the latter, we can see that $(c_t)'=(c')_t$ $\iff$ $c_{\lambda t}=c_{t\lambda}$ $\iff$ $c(t,\lambda)\in C^2$.
• the answer would just be $(c_\lambda)'=c_{\lambda t}$, by the former equation above, if $\lambda$ were a model parameter so that $\lambda'=0$;
• the answer would be quite different if $f$ were the partial, rather than the total, derivative of $c$, i.e. if we were given $\frac{\partial}{\partial t}c(t,\lambda)=f(c,\lambda)$ in the original problem.