This is Reynolds transport theorem. I asked a question a few days ago about rigorous hypothesis, but no answer yet. Provided your $g$ and $D$ fullfill the required hypothesis, you have
$$
\frac{df}{dx}(x) = \int_{D(x)}\frac{\partial g}{\partial x}({\bf t},x)d{\bf t}
+ \int_{\partial D(x)}g({\bf t},x)\frac{\partial \bf t}{\partial x}.{\bf n}_b d{\bf t},
$$
where ${\bf n}_b$ is the normal of the boudary $\partial D(x)$ of $D(x)$ at $\bf t$ and $\frac{\partial \bf t}{\partial x}$ depends on the parameterization you choose for this boundary.
Edit :
For instance, in your case, you can decompose the boundary $\partial D(x)$ into a set of hyperplanes $\mathcal{P}_k = \{{\bf t}=(t_1,\ldots,t_n)\in \mathbb{R}^n, t_k = x, t_i \leq x, i = 1,\ldots,n\}$, for $k = 1,\ldots,n$. Therefore, the boundary term in the formula becomes a sum over each of these hyperplanes. A parameterization of $\mathcal{P}_k$ is for instance the map
$$
{\bf t} : \begin{array}{ccc}
{\mathbb{R}^-}^{n-1}
&\rightarrow& \mathcal{P}_k \\
(u_1,\ldots,u_{n-1})
&\mapsto& (x+u_1,\ldots,x+u_{k-1},x,x+u_{k},\ldots,x+u_{n-1})
\end{array}
$$
The determinant of the Jacobian of this parameterization is $(-1)^k$. In addition, the normal of $\mathcal{P}_k$ consistent with the orientation of the parameterization we use is the vector $(-1)^ke_k$, where $e_k$ has coordinates $0$ except at the $k^{th}$ coordinate which is $1$. You also have $\frac{\mathrm{d} {\bf t}}{\mathrm{d} x} = (1,\ldots,1)$ and $\frac{\mathrm{d} {\bf t}}{\mathrm{d} x}.{\bf n}_b = (-1)^k$. Therefore you have
$$
\int_{\mathcal{P}_k(x)}
g({\bf t},x)\frac{\partial {\bf t}}{\partial x}.{\bf n}_b
\mathrm{d}{\bf t} =
\int_{-\infty}^0 \ldots \int_{-\infty}^0
g({\bf t}(u_1,\ldots,u_k),x)
\mathrm{d}u_1\ldots\mathrm{d}u_{n-1}
$$