I'm reading a book and it says:
Definition: Let $\pmb f: \mathcal D_{\pmb f} \subset \mathbb R^n \to \mathbb R^m$ and $\pmb g:\mathcal D_{\pmb g} \subset\mathbb R^m \to \mathbb R^p$ be two maps and $\pmb x_0\ \in \mathcal D_{\pmb f}$ a point such that $\pmb y_0=\pmb f(\pmb x_0)\in \mathcal D_{\pmb g}$, so that the composite $$ \pmb h=\pmb g \circ \pmb f : \mathcal D_{\pmb h} \subset \mathbb R^n \to\mathbb R^p \tag 1 $$ for $\pmb x_0\in \mathcal D_h$, is well defined.
So far so good! And then:
Theorem: Let $\pmb f$ be differentiable at $\pmb x_0 \in \mathcal D_{\pmb h}$ and $\pmb g$ differentiable at $\pmb y_0 = \pmb f(\pmb x_0)$. Then $\pmb h = \pmb g\circ \pmb f$ is differentiable at $\pmb x_0$ and its Jacobian matrix is $$ \pmb J(\pmb g\circ \pmb f) (\pmb x_0) = \pmb J\pmb g(\pmb y_0)\pmb J\pmb f(\pmb x_0) \tag 2 $$
So far so good! But then this example is given:
Let $\phi: I\subset \mathbb R\to \mathbb R$ be a differentiable map and $f:\mathbb R^2\to \mathbb R$ a scalar differentiable function. The composite $h(x)= f(x,\phi(x))$ is differentiable on $I$, and $$ h'(x) = \frac{dh}{dx}(x)= \frac{\partial f}{\partial x}(x,\phi(x))+\frac{\partial f}{\partial y}(x,\phi(x))\phi'(x) \tag 3 $$ as follows from the theorem above, since $h=f \circ \Phi$, with $\Phi:I\to \mathbb R^2$, $\Phi(x)=(x,\phi(x))$
Note: The book used $\Phi$ and not $\phi$ in the last line, is it a typo?
Here is my problem: I don't follow why $h$ is a composition of $f$ and $\phi$. Because, according to $(1)$ the co-domain of the "inner function", $\pmb f$, should be equal to the domain of the "outer function", $\pmb g$. But, in this example, the "inner function" is $\phi$ with the co-domain $I\subset \mathbb R$ and this is not equal to the domain of the "outer function", $f$, which is $\mathbb R^2$. So why is $h$ a composition?
Can somebody shed some light here?