Finding the total derivative of $g(x)=(x,f(x))$ step by step. Suppose that $f:\mathbb R^n\to \mathbb R^k$ is differentiable. Define $g:\mathbb R^n\to \mathbb R^{n+k}$ as $g(x)=(x, f(x))$. Then, the total derivative of $f$  at some $x\in \mathbb R^n$ is to be determined.
I think the question above needs a little explanation. $x\in \mathbb R^n$ is an $n-$ tuple and therefore looks like $(x_1,x_2,...,x_n)$ and similarly for $f(x)$ so $g(x)=((x_1,...,x_n), (f_1(x),...,f_k(x))\in \mathbb R^n\times \mathbb R^k.$ But here in order that the question makes sense, let's identify $\mathbb R^n\times \mathbb R^k$ by $\mathbb R^{n+k}$ (I actually don't understand why it can be done. I do understand that $\mathbb R^{n+k}$ is isomorphic to $\mathbb R^n\times \mathbb R^k$ as vector spaces but that doesn't seem the reason for such replacement. One possible reason could be: norms on a finite dimensional vector spaces are equivalent. But here we have two isomorphic vector spaces so I don't understand how to see the validity of this step. So let me take such replacement for granted for now.).
Let $f(x)=(f_1(x),f_2(x),...,f_k(x))$, where $f_i:\mathbb R^n\to \mathbb R$. $g$ is differentiable as each of its coordinate map is differentiable.
So $g(x)=(x_1,x_2,...,x_n, f_1(x),f_2(x),...f_k(x))$.
Writing Jacobian matrix for $g$ at $x$ (it will be an $(n+k)\times n$ matrix) gives:
$\begin{bmatrix}1 &0&0&\cdots &0\\
0&1&0&\cdots&0\\
\cdots&\cdots&\cdots & &\cdots\\
\cdots&\cdots&\cdots & &\cdots\\
 0&0&0&\cdots &1\\
\frac{\partial f_1(x)}{\partial x_1}&\frac{\partial f_1(x)}{\partial x_2}&\cdots&\cdots& \frac{\partial f_1(x)}{\partial x_n}\\
\frac{\partial f_2(x)}{\partial x_1}&\frac{\partial f_2(x)}{\partial x_2}&\cdots&\cdots& \frac{\partial f_2(x)}{\partial x_n}\\
\cdots&\cdots&\cdots & &\cdots\\
\cdots&\cdots&\cdots & &\cdots\\
\frac{\partial f_k(x)}{\partial x_1}&\frac{\partial f_k(x)}{\partial x_2}&\cdots&\cdots& \frac{\partial f_k(x)}{\partial x_n}\end{bmatrix}$
But this does not look correct as it has $f_i$'s, which I created for convenience and they were not given in the original problem. So how do I get the correct total derivative? I'm having difficulty understanding this subject.
 A: Let $f=(f_1,\ldots,f_k)$. First of all your function $g$ actually looks like this:
$$g=(g_1,\ldots,g_{n+k}):\mathbb{R}^n \to \mathbb{R}^{n+k}, (x_1,\ldots,x_n) \mapsto (x_1,\ldots,x_n,f_1(x_1,\ldots,x_n),\ldots,f_k(x_1,\ldots,x_n)).$$
What the source you have your question from means by "identifiy" $\mathbb{R}^n\times\mathbb{R}^{k}$ with $\mathbb{R}^{n+k}$ is the following. Given the idenitity $id$ on $\mathbb{R}^n$ and $f:\mathbb{R}^n \to \mathbb{R}^k$ we get a canonical map $id\times f:\mathbb{R}^n \to \mathbb{R}^{n}\times \mathbb{R}^k, x\mapsto (x,f(x))$ now we use the identification and hence get our map $g$.
By the definition of the Jacobi matrix we have for $x\in \mathbb{R}^n$:$$Dg(x)=\left(\frac{\partial}{\partial x_j} g_i(x)\right)_{i,j}$$ where $i$ ranges from $1$ to $n+k$ and $j$ ranges from $1$ to $n$. Let $x=(x_1,\ldots,x_n)\in \mathbb{R}^n$. By definition $g_i(x)=x_i, \forall i=1,\ldots,n$ so $\partial_j g_i(x)=\delta_{i,j}$ for all $i,j=1,\ldots,n$ and for $\ell=1,\ldots,k$ and $j=1,\ldots,n$ we have $\partial_j g_{n+\ell}(x)= \partial_j f_{\ell}(x)$. So your formula looks fine.
A: By total derivative definition, we have
\begin{align}
g(x+h ) 
=&
\Big(x+h, f(x+h)\Big)
\\
=&
\Big(x+h,f(x)+Df(x)h+\|h\|\cdot \rho(h)\Big)
\\
=&
\Big( x , f(x) \Big) + \Big(h,Df(x)h \Big) + \|h\|\Big(0,\rho(h)\Big) 
\\
=&
g(x)  + \Big[I \,| \, Df(x)\Big]\cdot h + \|h\|\Big(0,\rho(h)\Big) 
\end{align}
Here $I$ is the identity matrix of order $n\times n$ and $Df(x)$ is the total derivative of $f$.
