Deriving Chain Rule I was trying to derive the following result:

$\frac{df}{ds} = \frac{\partial f}{\partial x}\frac{dx}{ds}+\frac{\partial f}{\partial y}\frac{dy}{ds}$

For function $f(x(s),y(s))$. My derivation went like this:

$\frac{df}{ds}\\
=\lim_{h\rightarrow0} \frac{f(x(s+h),y(s+h))-f(x(s),y(s))}{h}\\
=\lim_{h\rightarrow0} \frac{f(x(s+h),y(s+h))-f(x(s),y(s+h))+f(x(s),y(s+h))-f(x(s),y(s))}{h}\\
=\lim_{h\rightarrow0}\frac{f(x(s+h),y(s+h))-f(x(s),y(s+h))}{h}+\lim_{h\rightarrow0}\frac{f(x(s),y(s+h))-f(x(s),y(s))}{h}\\
\approx\lim_{h\rightarrow0}\frac{f(x(s)+\delta x,y(s+h))-f(x(s),y(s+h))}{h}+\lim_{h\rightarrow0}\frac{f(x(s),y(s)+\delta y)-f(x(s),y(s))}{h}\\
=\lim_{h\rightarrow0}\frac{f(x(s)+\delta x,y(s+h))-f(x(s),y(s+h))}{\delta x}\lim_{h\rightarrow0}\frac{\delta x}{h}+\lim_{h\rightarrow0}\frac{f(x(s),y(s)+\delta y)-f(x(s),y(s))}{\delta y}\lim_{h\rightarrow0}\frac{\delta y}{h}$

So I'm not sure exactly how to proceed here. I understand that $\lim_{h\rightarrow0}\frac{f(x(s)+\delta x,y(s+h))-f(x(s),y(s+h))}{\delta x}$ will become $\frac{\partial f}{\partial x}$, but how exactly does that argument go? Something like:

$\lim_{h\rightarrow0}\frac{f(x(s)+\delta x,y(s+h))-f(x(s),y(s+h))}{\delta x}\\
\approx \lim_{\delta x\rightarrow0} \frac{f(x(s)+\delta x,y(s+h))-f(x(s),y(s+h))}{\delta x}\\
\approx \lim_{\delta x\rightarrow0} \frac{f(x(s)+\delta x,y(s))-f(x(s),y(s))}{\delta x}\\
=\frac{\partial f}{\partial x}$

Is the third line immediately above even correct? I know that the definition of $\frac{\partial f}{\partial x}$ is $\lim_{\delta x\rightarrow0} \frac{f(x(s)+\delta x,y(s))-f(x(s),y(s))}{\delta x}$ so I wouldn't think I can go straight from the second line to the fourth line, but I'm not sure and would appreciate some advice on how to correctly complete this derivation.
 A: We will prove the following theorem, which will give you the desired result as a special case.
Theorem: Let $f$ be a scalar field defined on an open set $S$ in $\Bbb{R}^n$, and let $\mathbf{r}$ be a vector-valued function which maps an interval $J$ from $\Bbb{R}^1$ into $S$. Define the composite function $g=f\circ\mathbf{r}$ on $J$ by the equation
$$g(s)=f[\mathbf{r}(s)], \quad s\in J.$$
Let $s$ be a point in $J$ at which $\mathbf{r}'(s)$ exists and assume that $f$ is differentiable at $\mathbf{r}(s)$. Then $g'(s)$ exists and is equal to the dot product
$$
g'(s) = \nabla f(\mathbf{a})\cdot \mathbf{r}'(s), \quad \text{where}\quad \mathbf{a} = \mathbf{r}(s).
$$
Proof: Let $\mathbf{a} = \mathbf{r}(s)$, where $s$ is a point in $J$ at which $\mathbf{r}'(s)$ exists. Since $S$ is open there is an $n$-ball $B(\mathbf{a})$ lying in $S$. We take $h \neq 0$ but small enough so that $\mathbf{r}(s+h)$ lies in $B(\mathbf{a})$, and we let $\mathbf{y} = \mathbf{r}(s+h)-\mathbf{r}(s)$. Note that $\mathbf{y}\to\mathbf{0}$ as $h \to 0$. Now we have
$$g(s+h)-g(s)=f[\mathbf{r}(s+h)]-f[\mathbf{r}(s)]=f(\mathbf{a}+\mathbf{y})-f(\mathbf{a}).$$
Applying the first order Taylor formula for $f$ we have
$$f(\mathbf{a}+\mathbf{y})-f(\mathbf{a})=\nabla f(\mathbf{a})\cdot\mathbf{y}+||\mathbf{y}||E(\mathbf{a},\mathbf{y}),$$
where $E(\mathbf{a},\mathbf{y})\to 0$ as $||\mathbf{y}||\to 0.$ Since $\mathbf{y}=\mathbf{r}(s+h)-\mathbf{r}(s)$ this gives us
$$\frac{g(s+h)-g(s)}{h}=\nabla f(\mathbf{a})\cdot\frac{\mathbf{r}(s+h)-\mathbf{r}(s)}{h}+\frac{||\mathbf{r}(s+h)-\mathbf{r}(s)||}{h}E(\mathbf{a},\mathbf{y}).$$
Letting $h \to 0$ we obtain the required result.$\square$
Now coming to your special case we are working in $\Bbb{R}^2$, so we let $\mathbf{r}(s) = x(s)\mathbf{e_1}+y(s)\mathbf{e_2}$ where $\{\mathbf{e_1},\mathbf{e_2}\}$ are the standard basis vectors in $\Bbb{R}^2$. Applying the result of the theorem and writing in component form will give you the desired result.
