This problem is from Exercise 13.35 of A First Course in Sobolev Spaces (2nd edition) written by Giovanni Leoni: Let $m\in \mathbb{N}$, $1\leqslant p<\infty$, $R=(0,a_1)\times\cdots\times (0,a_N)\subset \mathbb{R}^N$ an rectangle and let $u\in \dot{W}^{m,p}(R)$, where $$\dot{W}^{m,p}(R)=\{u\in L^1_{\mathrm{loc}}(R): D^\alpha u\in L^p(R), |\alpha|=m\}$$ is called the homogeneous Sobolev space (this book call $\dot{W}^{m,p}$ is homogeneous Sobolev space, see Definition 11.17 Pict:Definition 11.17), then $u\in W^{m,p}(R)$. Hint: Prove first that $p_R(u)$ can be replaced by $p_{R_1}(u)$, where $R_1$ is rectangle compactly contained in $R$.
This exercise is below of Proposition 13.34 (Poincare's inequality for rectangles). I don't know if there is any relationship between this exercise and Proposition 13.34, i.e. whether we should use Proposition 13.34 to prove this exercise. I also don't know how to use $R_1$ to prove this exercise.
Here is Proposition 13:34: Let $m\in \mathbb{N}$, $1\leqslant p<\infty$, $R=(0,a_1)\times\cdots\times (0,a_N)\subset \mathbb{R}^N$ an rectangle. Then there exists a constant $C=C(m,N,p)>0$ such that for all $u\in W^{m,p}(R)$, and every $0\leqslant k\leqslant m-1$, $$\|\nabla^k(u-p_R(u))\|_{L^p(R)}\leqslant C(\max\{a_1,\cdots,a_N\})^{(m-k)}\|\nabla^m u\|_{L^p(R)},$$
where $$\nabla^m u=\{D^\alpha u: |\alpha|=m\},$$ and $p_R(u)$ is a polynomial of degree $m-1$. Pict:Proposition 13.34 and Exercise 13.35