Consider $I\xrightarrow{c}M\times N\xrightarrow{f}\mathbb{R}$ where $M,N$ are smooth manifolds, $f$ is smooth function, $I$ is an open interval say $(-\varepsilon,\varepsilon)$ and $c=(c_1(t),c_2(t))$ be a smooth curve on $M\times N$.
I am trying to understand what exactly is this $$\frac{d}{dt}\bigg|_{t=0}(f\circ c).$$
Let $i_1:M\rightarrow M\times N$ and $i_2:N\rightarrow M\times N$ be some inclusion maps say $m\mapsto (m,q), n\mapsto (p,n)$. We then have composition maps $I\xrightarrow{c_1}M\xrightarrow{i_1}M\times N\xrightarrow{f}\mathbb{R}$ and $I\xrightarrow{c_2}N\xrightarrow{i_2}M\times N\xrightarrow{f}\mathbb{R}$
Do we have any relation between $$\frac{d}{dt}\bigg|_{t=0}(f\circ i_1\circ c_1),\frac{d}{dt}\bigg|_{t=0}(f\circ i_2\circ c_2)$$ and $$\frac{d}{dt}\bigg|_{t=0}(f\circ c).$$
Suppose $M=N=\mathbb{R}$. Then, $$(f\circ c)'(0)=f'(c(0))c'(0)=\frac{\partial f}{\partial x_1}\bigg|_{c(0)}c_1'(0)+\frac{\partial f}{\partial x_2}\bigg|_{c(0)}c_2'(0)$$
$$(f\circ i_1\circ c_1)'(0)=\frac{\partial f}{\partial x_1}\bigg|_{(c_1(0),0)}c_1'(0) $$ $$ (f\circ i_2\circ c_2)'(0)=\frac{\partial f}{\partial x_2}\bigg|_{(0,c_2(0))}c_2'(0)$$
They seem to add up together to give $(f\circ c)'(0)$ except that partial derivatives are evaluated at different points. Am I missing something?
Any reference/suggestion is appreciated.