# Proof of multivariable chain rule for $f(t,x(t))$

I'm trying to prove the multivariable chain rule for this base case:

$$f(t,x(t))$$

Here's what I tried:

$$\lim_{h\to 0} \frac{f(t+h, x(t+h)) - f(t,x(t))}{h} = \lim_{h\to 0} \frac{f(t+h, x(t+h)) - f(t,x(t))}{x(t+h)-x(t)}\frac{x(t+h)-x(t)}{h} =$$ $$\lim_{h\to 0} \frac{f(t+h, x(t+h)) - f(t, x(t+h))+f(t, x(t+h))- f(t,x(t))}{x(t+h)-x(t)}\frac{x(t+h)-x(t)}{h} =$$

$$\lim_{h\to 0}\frac{f(t+h, x(t+h)) - f(t,x(t+h))}{x(t+h)-x(t)}\frac{x(t+h)-x(t)}{h} +$$ $$\lim_{h\to 0}\frac{f(t,x(t+h))-f(t,x(t))}{x(t+h)-x(t)}\frac{x(t+h)-x(t)}{h} =$$

I can't view these things as partial derivatives of $f$. Can somebody help me?

You can use $f(t+h,x(t+h))-f(t,x(t+h))=hf_x(t+\theta_1 h,x(t+h))$ for some $\theta_1\in(0,1)$ and $f(t,x(t+h))-f(t,x(t))=f(t,x(t)+hx'(t+\theta_2h))-f(t,x(t))=hx'(\theta_2h)f_y(t,x(t)+\theta_3h\theta_2x'(t+\theta_2h)$.

I'm gonna give you a different perspective. It might help you, as long as you're familiar with "little-o" notation.

First, let's rewrite a derivative as a local linear (affine to be pedantic) approximation. More on this here. $$x(t+h) = x(t)+h\,x'(t)+o(h) \tag1$$

As you can easily see, if you isolate $x'(t)$, you go back to the usual definition: $$x'(t)=\frac{x(t+h)-x(t)}{h}+o(1)$$

Notice that we're assuming $h$ arbitrarily small, as you do when you take the limit for $h\to0.$

You can do the same for partial derivatives: \begin{align} f(t+h,x)&=f(t,x)+h\,f_t(t,x)+o(h) \tag2\\ f(t,x+k)&=f(t,x)+k\,f_x(t,x)+o(k) \tag3 \end{align}

Now let's see what we can do for the total derivative: \begin{align} f\left(t+h,\,x(t+h)\right) &= f\left(t+h,\,x(t)+h\,x'(t)+o(h)\right) & &\text{(1)}\\ &=f(t+h,x)+k\,f_x(t+h,x)+o(k) & &\text{(3) with }k=h\,x'(t)+o(h)\\ &=f(t+h,x)+\left[h\,x'(t)+o(h)\right]f_x(t+h,x)+o(h) & &\text{in this case }o(k)=o(h)\\ &=f(t,x)+h\,f_t(t,x)+\left[h\,x'(t)+o(h)\right]f_x(t+h,x)+o(h) & &\text{(2)} \end{align}

Notice that for ease of notation I wrote $x$ meaning $x(t)$. Since we're dealing only with first order derivative we can safely ignore higher order ones: $$f_x(t+h,x)=f_x(t,x)+h\frac{\partial}{\partial t}f_x(t,x)+o(h)=f_x(t,x)+o(1)$$

Thus \begin{align} f\left(t+h,\,x(t+h)\right) &=f(t,x)+h\,f_t(t,x)+h\,x'(t)\,f_x(t,x)+o(h)\\ &=f(t,x)+h\underbrace{\left[f_t(t,x)+x'(t)\,f_x(t,x)\right]}_{\frac{d}{dt}\,f\left(t,x(t)\right)}+o(h) \end{align}

Hence $$\frac{d}{dt}\,f\left(t,x(t)\right) = f_t(t,x)+x'(t)\,f_x(t,x)$$

I know this isn't exactly what you asked for, but I prefer this notation rather than using the standard definition. I think this is more clear on what becomes a partial derivative and what vanishes because is infinitesimal of higher order.

You don't have to "prove the chain rule", but to find out what it has to say in the particular case described in the question.

We are given a function $(u_1,u_2)\mapsto f(u_1,u_2)$ of two variables $u_1$, $u_2$, and a function $t\mapsto x(t)$. These givens are then combined to the function $$\phi(t):=f\bigl(t,x(t)\bigr)\ ,$$ and you are required to compute $\phi'(t)$. The chain rule says that $$\phi'(t)=f_{.1}\bigl(t,x(t)\bigr)u_1'(t)+f_{.2}\bigl(t,x(t)\bigr)u_2'(t)=f_{.1}\bigl(t,x(t)\bigr)\cdot1+f_{.2}\bigl(t,x(t)\bigr)x'(t)\ .$$