Let $a\in (0,1)$. Prove $$\|u\|_{L^r(\mathbb R^d)}\leq C\|\nabla u\|_{L^p(\mathbb R^d)}^a\|u\|_{L^q(\mathbb R^d)}^{1-a},\quad u\in \mathcal C_c^1(\mathbb R^d)$$ if $\frac{1}{r}=\frac{1-a}{q}$ and $\frac{1}{p}-\frac{1}{d}=0$ with $C$ independent of $u$.
Context
I had to prove this inequality when $$\frac{1}{r}=a\left(\frac{1}{p}-\frac{1}{d}\right)+\frac{1-a}{q}.$$ I proved it when $\frac{1}{p}-\frac{1}{d}>0$ and $\frac{1}{p}-\frac{1}{d}<0$. I want now to prove it when $\frac{1}{p}-\frac{1}{d}=0$, but I don't know how to proceed. Notice that for $\frac{1}{p}-\frac{1}{d}>0$ we used Sobolev inequality and for $\frac{1}{p}-\frac{1}{d}<0$ we use the fact that $W^{1,p}(\mathbb R^d)\hookrightarrow L^\infty (\mathbb R^d)$ continuously. But when $\frac{1}{p}-\frac{1}{d}=0$ is there such a trick ?