Let $f: \mathbb R^n \to \mathbb R^m$, $g: \mathbb R^m \to \mathbb R^k$.
The chain rule states that if $h =g \circ f$ then $D_h(x) = D_g(f(x))D_f(x)$
My question is how can we apply this in the following scenario for example:
$h(t) = f(tx, ty)$, I want to find $D_h(t)$
According to several solved examples, the answer should be $D_h(t) = \frac{\partial f(tx. ty)}{\partial (tx)}\frac{\partial (tx)}{\partial t} + \frac{\partial f(tx,ty)}{\partial (ty)}\frac{\partial (ty)}{\partial t}$
But I don't really understand where the "$+$" comes from. It seems like the chain rule was applied twice, but I fail to see exactly how it was applied and how to explain the plus sign.
Your function $h \colon \mathbb{R} \to \mathbb{R}$ is $h(t) = f(tx, ty) = (f \circ g)(t)$, we set $g(t) = (tx, ty)$. The Chain Rule is $$Dh(t) = Df(g(t))\, Dg(t) = Df(tx, ty) \,Dg(t).$$ Notice that $g \colon \mathbb{R} \to \mathbb{R}^2$, so its derivative $Dg(t)$ is a $2 \times 1$ matrix: $$Dg(t) = \begin{pmatrix} \frac{\partial}{\partial t}(tx) \\ \frac{\partial}{\partial t}(ty) \end{pmatrix}.$$ I'll let $(u,v)$ denote the independent variables for $f$ if that's okay. Notice that $f \colon \mathbb{R}^2 \to \mathbb{R}$, so its derivative $Df(u,v)$ is a $2 \times 1$ matrix: $$Df(x,y) = \begin{pmatrix} \frac{\partial f}{\partial u}(x,y) & \frac{\partial f}{\partial v}(x,y) \end{pmatrix}.$$ Therefore, the Chain Rule gives: \begin{align*} Dh(t) = Df(tx, ty)\, Dg(t) & = \begin{pmatrix} \frac{\partial f}{\partial u}(tx,ty) & \frac{\partial f}{\partial v}(tx,ty) \end{pmatrix}\begin{pmatrix} \frac{\partial}{\partial t}(tx) \\ \frac{\partial}{\partial t}(ty) \end{pmatrix} \\ & = \frac{\partial f}{\partial u}(tx, ty) \frac{\partial (tx)}{\partial t} + \frac{\partial f}{\partial v}(tx, ty) \frac{\partial (tx)}{\partial y}. \end{align*}