I already ask the question on Math Stack Exchange (here) but without any answer. I hope I'll have more chance here.

Let $$\frac{1}{\tau}=a\left(\frac{1}{p}-\frac{1}{d}\right)+\frac{1-a}{q},$$ $\tau>0, p\geq 1, a\in [0,1]$, $q\geq 1$ and $d\geq 1$. I know that $$\|u\|_{L^\tau(\mathbb R^d)}\leq C\|\nabla u\|_{L^p(\mathbb R^d)}^a\|u\|_{L^q(\mathbb R^d)}^{1-a}.\tag{E}$$

I want to prove that

$$\|u-\bar u\|_{L^\tau(\mathcal D)}\leq C\|\nabla u\|_{L^p(\mathcal D)}^a\|u-\bar u\|_{L^q(\mathcal D)}^{1-a},$$ where $$\mathcal D=\{x\in\mathbb R^d\mid r<|x|<R\},$$ and $$\bar u=\frac{1}{|\mathcal D|}\int_{\mathcal D}u.$$

**Q1)** If $\frac{1}{p}-\frac{1}{d}>0$ it's a consequence of Sobolev inequality. But how can I conclude when $\frac{1}{p}-\frac{1}{d}\leq 0$ ? It's probably using a prolongement extension of $u-\bar u$ on $\mathbb R^d$ and using (E) but I don't see how to make it.

**Q2)** Why do we need $u-\bar u$ instead of $u$ in $$\|u-\bar u\|_{L^\tau(\mathcal D)}\leq C\|\nabla u\|_{L^p(\mathcal D)}^a\|u-\bar u\|_{L^q(\mathcal D)}^{1-a} \ \ ?$$
If $u$ doesn't work, I don't really see why.

I'm sure the answer is in the paper *"ulteriori proprietà di alcune classi di funzioni in più variabili"* of Gagliardo, but I try to find it on the web without any success.

**Added**

Can we do as following ? Let $P:W^{1,p}(\mathcal D)\longrightarrow W^{1,p}(\mathbb R^d)$ a prolongement of $u-\bar u$. Then, by (E) $$\|P(u-\bar u)\|_{L^\tau(\mathbb R^d)}\leq \|\nabla Pu\|_{L^p(\mathbb R^d}^a\|P(u-\bar u)\|_{L^q(\mathbb R^d)}^{1-a}.$$ We know that $$\|\nabla Pu\|_{L^p(\mathbb R^d)}\leq C\|\nabla u\|_{L^p(\mathcal D)},$$ and thus $$\|u-\bar u\|_{L^\tau(\mathcal D)}\leq C\|\nabla u\|_{L^p(\mathcal D)}^a\|P(u-\bar u)\|_{L^q(\mathbb R^d)}^{1-a}.$$ Now, can I say that $$\|P(u-\bar u)\|_{L^q(\mathbb R^d)}^{1-a}\leq C\|u-\bar u\|_{L^q(\mathcal D)}^{1-a},$$ or not really ?

Q2: If $u$ is a constant function then $\nabla u = 0$ and the inquality will be false. In infinite-measure domains that is not required since constans are not in $L^p$. $\endgroup$