Having trouble understanding the generalized chain rule for multivariable functions 
Determine the derivative of $F\circ G$ where $F:\mathbb{R^3}\rightarrow \mathbb{R^2}$  and $G:\mathbb{R^2}\rightarrow \mathbb{R^3}$ are given by
$$F(x,y,z)=\begin {pmatrix} \cos(x)-z \\xe^{y}\end {pmatrix}, G(u,v)=\begin {pmatrix} v^2\\uv+v^3 \\ u^2+v\end {pmatrix} $$

I'm having trouble applying the generalized chain rule for this question. $F\circ G=F(G(u,v)) = \begin {pmatrix} \cos(v^2)-(u^2+v)\\v^2e^{uv+v^3}\end {pmatrix}.$ Unless I'm mistaken we can treat the composition of the functions as a different function such that $F\circ G =h:\mathbb{R^2}\rightarrow \mathbb{R^2}$ and then differentiating this function would simply be taking the partial derivatives of the two expressions:
$$D=\begin {pmatrix}\frac{\partial}{\partial u} \big(\cos(v^2)-u^2-v \big)& \frac{\partial}{\partial v} (\cos(v^2)-u^2-v) \\ \frac{\partial}{\partial u} (v^2\exp({uv+v^3})) & \frac{\partial}{\partial v}(v^2\exp(uv+v^3))\end {pmatrix}$$
But I honestly don't know if any of this is correct and would appreciate if someone could help.
 A: The general chain rule says that
$$
D(F\circ G) = (DF)(DG)
$$
where on the right-hand side is the matrix multiplication of two Jacobian matrices.
More precisely, you have
$$
D(F\circ G)_{(u,v)} = (DF)|_{(x,y)=G(u,v)}(DG)|_{(u,v)}
$$
Assuming one takes the convention "column vectors", $DF$ is a $2\times3$ and $DG$ a $3\times2$ matrix.
A: You can use differentials to write
$$
dF
=
\begin{pmatrix}
-\sin(x) dx-dz\\
dxe^y + xe^y dy
\end{pmatrix}
=
\frac{\partial F}{\partial \mathbf{x}}
\begin{pmatrix}
dx \\ 
dy \\
dz
\end{pmatrix}
\tag{1}
$$
Because $x=v^2, dx=2v dv$, and so on
Replacing in (1) $dx,dy,dz$ by the terms in $du,dv$, you will end up with an expression of the form
$dF=\mathbf{J} 
\begin{pmatrix}
du \\ 
dv
\end{pmatrix}
$ where $\mathbf{J}
=\frac{\partial F}{\partial \mathbf{u}}
$ is the 2-by-2 Jacobian matrix.
A: Compute $F'{\large\circ}G$, that is $F'$ with $x=v^2,y=uv+v^3,z=u^2+v$:
$$
\begin{align}
F'
&=\frac{\partial}{\partial(x,y,z)}\begin{pmatrix}\cos(x)-z\\xe^{y}\end {pmatrix}\\
&=\begin{pmatrix}-\sin(x)&0&-1\\e^y&xe^y&0\end{pmatrix}\\
&=\begin{pmatrix}-\sin\left(v^2\right)&0&-1\\e^{uv+v^3}&v^2e^{uv+v^3}&0\end{pmatrix}
\end{align}
$$
Compute $G'$:
$$
\begin{align}
G'
&=\frac{\partial}{\partial(u,v)}\begin{pmatrix}v^2\\uv+v^3\\u^2+v\end{pmatrix}\\
&=\begin{pmatrix}0&2v\\v&u+3v^2\\2u&1\end{pmatrix}
\end{align}
$$
Compute $\left(F'{\large\circ}G\right)G'$
$$
\overbrace{\begin{pmatrix}-\sin\left(v^2\right)&0&-1\\e^{uv+v^3}&v^2e^{uv+v^3}&0\end{pmatrix}\vphantom{\begin{pmatrix}0\\0\\0\end{pmatrix}}}^{F'{\large\circ}G}\overbrace{\begin{pmatrix}0&2v\\v&u+3v^2\\2u&1\end{pmatrix}}^{G'}
=\begin{pmatrix}-2u&-2v\sin\left(v^2\right)-1\\v^3e^{uv+v^3}&\left(2v+uv^2+3v^4\right)e^{uv+v^3}\end{pmatrix}
$$
which, I believe, looks like the matrix you computed (once the partial derivatives in $D$ are evaluated).
