Let $m,n\in \mathbb N$. Let $h : \mathbb R^m \times \mathbb R^n \to \mathbb R$, $g:\mathbb R^m \to \mathbb R^n$ be differentiable and $\varphi : \mathbb R^m \to \mathbb R $defined by $\varphi(x):= h(x,g(x))$. For $x= (x_1, ... x_n)$, how can I express $\frac{\partial \varphi}{\partial x_1}(x)$ only in terms of the the partial derivatives of $g$ and $h$?
I tried defining the auxiliary function $f:\mathbb R^m \to \mathbb R^m \times \mathbb R^n, f(x):= (x,g(x))$ and then calculate $$\frac{\partial \varphi}{\partial x_1}(x) = \frac{\partial (h \circ f)}{\partial x_1}(x)$$ but here I am stuck. Can anyone help?
You got the right idea. You just have to compute it. Let us write $J$ for the Jacobian matrix. Then you get $$ J_f(x)=\begin{pmatrix}I_m\\J_g(x)\end{pmatrix}, $$ where $I_m\in\mathbb R^{m\times m}$ is the identity matrix.
Using the chain rule, we get $$ J_\varphi(x)=J_{h\circ f}(x)=J_h(f(x))\cdot J_f(x)=J_h(x,g(x))\cdot\begin{pmatrix}I_m\\J_g(x)\end{pmatrix}\\ =\ldots\\ =\begin{pmatrix}\partial_1 h(x,g(x)) & \dots & \partial_m h(x,g(x))\end{pmatrix}+\begin{pmatrix}\partial_{m+1}h(x,g(x)) & \dots & \partial_{m+n}h(x,g(x))\end{pmatrix}\cdot J_g(x) $$ Hence, $$ \partial_i\varphi(x) = \partial_i h(x,g(x))+\sum_{k=1}^n\partial_{m+k}h(x,g(x))\partial_ig_k(x) $$ for $i=1,\ldots,m$.