Why does $(g\circ f)'(x_0)=g'(f(x_0))\circ f'(x_0)$? I had a Multivariable calculus class this morning and the teacher showed us a proposition that I'm not quite sure I understand. The proposition is the following:

Let:

*

*$D\subset \mathbb R^n $

*$D^* \subset  \mathbb R^m$

*$x_0 \in D$

*$f:D \to D^*$ be a differential function at $x_0$

*$g: D^* \to \mathbb R^p$ be a differential function at $f(x_0)$
Then $g\circ f$ is differential at $x_0$ and: $$(g\circ f)'(x_0)=g'(f(x_0))\circ f'(x_0)$$

My problem with this proposition is that I'm not understanding two things:

*

*I understand derivatives of functions $f: \mathbb R^n \to \mathbb R$ (Things like partial derivatives, directional derivatives, etc...) and I understand that the derivative of such function is a scalar, But what is the definition of the derivative of a function $f: \mathbb R^n \to \mathbb R^m$? I don't recall my teacher showing us the meaning of such derivative.


*My second question is, in the Rhs of the equality, why do we have $g'(f(x_0))\circ f'(x_0) $ instead of $g'(f (x_0)). f'(x_0) $? I don't' understand why we are using composition of functions. Does that mean that $(g\circ f)'(x_0) $ is a function?
 A: Point 1
Regarding the definition of the derivative of a map $f : \mathbb R^n \to \mathbb R^m$, you should look at what the Fréchet derivative is. See Wikipedia entry. The Fréchet derivative at each point $a \in \mathbb R^n$ is a linear map $f^\prime(a) : \mathbb R^n \to \mathbb R^m$. See also what the Jacobian is.
In general, the derivative of a map $f : U \to V$ defined between two linear spaces $U,V$ is a map $f^\prime : U \to \mathcal L(U,V)$ where $\mathcal L(U,V)$ denotes the linear space of the linear maps between $U$ and $V$. The derivative $f^\prime$ of $f$ maps each point of the domain of $f$ to a linear map!
Point 2
When you understand that the derivative is a linear map, then using composition (of linear maps) for the derivative of the composition of maps makes perfect sense.
Comments
Your sentence ...I understand that the derivative of such function is a scalar... is not correct. The derivative of a map $g : \mathbb R^n \to \mathbb R$ at a point $ a \in \mathbb R^n$ is not a scalar. It is a linear form from $\mathbb R^n$ to $\mathbb R$. And the derivative $g^\prime$ itself is a map $ g^\prime : \mathbb R^n \to \left(\mathbb R^n\right)^\prime$ where $\left(\mathbb R^n\right)^\prime$ stands for the dual space of $\mathbb R^n$.
By understanding all this, you'll make a big jump in your comprehension of what the derivative really is!
