**Step 1: The Inequality for Smooth Functions**
We first establish the inequality for functions with compact support. Let $\phi \in C_c^\infty(U)$. We extend $\phi$ to be zero on $\mathbb{R}^n \setminus U$.
Since $U$ is contained in the slab $a < x_n < a+d$, for any point $x = (x', x_n) \in U$, we can express $\phi(x)$ using the Fundamental Theorem of Calculus along the $x_n$ direction, starting from the boundary $x_n = a$ (where $\phi = 0$):
\begin{align*}
\phi(x', x_n) = \int_a^{x_n} \partial_{x_n} \phi(x', t) \, dt.
\end{align*}
We estimate the absolute value:
\begin{align*}
|\phi(x', x_n)| \le \int_a^{x_n} |\partial_{x_n} \phi(x', t)| \, dt \le \int_a^{a+d} |\partial_{x_n} \phi(x', t)| \, dt.
\end{align*}
If $p=1$, the inequality follows immediately. Assume $p > 1$ and let $q$ be the conjugate exponent ($1/p + 1/q = 1$). We apply Hölder's inequality to the integral on the right:
\begin{align*}
\int_a^{a+d} 1 \cdot |\partial_{x_n} \phi(x', t)| \, dt &\le \left( \int_a^{a+d} 1^q \, dt \right)^{1/q} \left( \int_a^{a+d} |\partial_{x_n} \phi(x', t)|^p \, dt \right)^{1/p} \\
&= d^{1/q} \left( \int_a^{a+d} |\partial_{x_n} \phi(x', t)|^p \, dt \right)^{1/p}.
\end{align*}
Substituting this back into the estimate for $|\phi|$ and raising both sides to the power $p$:
\begin{align*}
|\phi(x', x_n)|^p \le d^{p/q} \int_a^{a+d} |\partial_{x_n} \phi(x', t)|^p \, dt.
\end{align*}
We now integrate this inequality over the full domain $U$. We perform the $x_n$ integration first. Notice that the right-hand side does not depend on $x_n$:
\begin{align*}
\int_a^{a+d} |\phi(x', x_n)|^p \, dx_n &\le \int_a^{a+d} \left( d^{p/q} \int_a^{a+d} |\partial_{x_n} \phi(x', t)|^p \, dt \right) \, dx_n \\
&= d \cdot d^{p/q} \int_a^{a+d} |\partial_{x_n} \phi(x', t)|^p \, dt \\
&= d^p \int_a^{a+d} |\partial_{x_n} \phi(x', t)|^p \, dt.
\end{align*}
(Note: We used $1 + p/q = p$). Finally, integrating over the remaining variables $x'$:
\begin{align*}
\int_{\mathbb{R}^{n-1}} \int_a^{a+d} |\phi|^p \, dx_n \, dx' &\le d^p \int_{\mathbb{R}^{n-1}} \int_a^{a+d} |\partial_{x_n} \phi|^p \, dt \, dx'.
\end{align*}
This simplifies to $\|\phi\|_{L^p(U)}^p \le d^p \|\partial_{x_n} \phi\|_{L^p(U)}^p$. Taking the $p$-th root and noting $|\partial_{x_n} \phi| \le |\nabla \phi|$:
\begin{align*}
\|\phi\|_{L^p(U)} \le d \|\nabla \phi\|_{L^p(U)}.
\end{align*}