Second derivative, higher order derivative and chain rule 
(a)$f:A \subset \mathbb{R}^n \rightarrow \mathbb{R}^m, g:\subset \mathbb{R}^m \rightarrow \mathbb{R}^p$ are twice differentiable and $f(A)  \subset B$. Then for $x_0  \in A, x,y \in \mathbb{R}^n$show that
  $$D^2(g\circ f(x_0))(x,y)=D^2g(f(x_0))(Df(x_0)\cdot x, Df(x_0)\cdot y)+Dg(f(x_0)) \cdot D^2f(x_0)(x,y)$$

My proof:
I am trying to give more  details to this question: Chain rule for second derivative
Since $$D(g\circ f)(x_0)=Dg(f(x_0)) \circ Df(x_0)$$
then use  the chain rule  again,
$$
D^2(g\circ f (x_0))(x,y) =D[Dg(f(x_0)) \circ Df(x_0)](x,y)
$$
I am stuck here.
I think should get 
$$D[Dg(f(x_0)) \circ Df(x_0)](x,y)=D^2g(f(x_0))Df(x_0)(x,y)+Dg(f(x_0))D^2f(x_0)(x,y)$$
But I'm not sure why there is a plus in the middle. Can someone explain please?

(b)If $p:\mathbb{R}^n \rightarrow \mathbb{R}^m$ is a linear map plus some constant and $f:A \subset \mathbb{R}^m \rightarrow \mathbb{R}^s $is $k$ times differentiable. prove that$$
D^k(f \circ p)(x_0)(x_1,...,x_k)=D^k(f(p(x_0)))(Dp(x_0)(x_1),...,(Dp(x_0)(x_k))$$

Since p is a linear map plus a constant, $Dp,D^2p,...,D^kp$ is this linear map, denote as $g \in L(\mathbb{R}^n , \mathbb{R}^m)$. According to (a),
$$D^2(f\circ p(x_0))(x_1,x_2)=D^2f(p(x_0))(Dp(x_0)\cdot x_1, Dp(x_0)\cdot x_2)+Df(p(x_0)) \cdot D^2p(x_0)(x_1,x_2)$$
It seems that  $D^2p(x_0)(x_1,x_2)$  should be zero?  How to explain this and how to do the following steps? 
 A: Use $X,Y$ and $Z$ for the corresponding Euclidean spaces, because in fact the result is true for Banach spaces in general; $x,y$ for $x_0,y_0$ and $u,v$ for $x,y$ just for clarity. 
Define
$\beta:L(Y,Z)\times L(X,Y) \to L(X,Z)\  \text{to be  composition}.\ \beta\ \text{is bilinear}.$
Define
$\alpha:X\times X \to L(X,Z)\times L(X,Y):(x,y) \mapsto((Dg\circ f)(x),Df(y)).$
Note that 
$D[Dg\circ f](x)u=(DDg(f(x))\circ Df(x))u=D^2g(f(x))(Df(x))u$ 
and 
$DDf(y)v=D^2f(y)v$ 
so
$(1)\ D\alpha(x,y)(u,v)=(D^{2}g(f(x))(Df(x)(u)),D^{2}f(y)(v))$
Now define $\gamma:X  \to X\times X$ to be the insertion. $\gamma$ is linear so 
$(2)\ D\gamma(x)=\gamma$ 
and clearly 
$(3)\ D(g\circ f)=\beta\circ \alpha\circ \gamma.$ We will differentiate this, using $(1),(2),(3)$ and the bilinearity of $\beta$: 
we find that 
$D^{2}(g\circ f)(x) =D\beta((\alpha\circ \gamma)(x))\circ D\alpha(\gamma(x))\circ D\gamma(x)=$
$D\beta(Dg(f(x)),Df(x))\circ D\alpha(x,x)\circ \gamma,$ from which we get
$D^{2}(g\circ f)(x)(u) =D\beta(Dg(f(x)),Df(x))(D\alpha(x,x)(u,u))=$
$D\beta(Dg(f(x)),Df(x))(D^{2}g(f(x))(Df(x)(u)),D^{2}f(x)(u)) 
 =$
$D^{2}g(f(x))(Df(x)(u))\circ Df(x)+Dg(f(x))\circ D^{2}f(x)(u).$
Finally, we obtain
$D^{2}(g\circ f)(x)(u)(v) =D^{2}g(f(x))(Df(x)(u))(Df(x)(v))
+Dg(f(x))(D^{2}f(x)(u)(v))$ 
which, on invoking the isomorphism $L(X,L(Y,Z))\cong L(X\times Y,Z)$, is equivalent to 
$D^{2}(g\circ f)(x)(u,v) =D^{2}g(f(x))(Df(x)(u),Df(x)(v))
+Dg(f(x))(D^{2}f(x)(u,v))$, 
and we are done. 
