Two commonly used Poincare/Wirtinger inequality states for Sobolev functions with and without compact support states for open bounded subset $D \subset \mathbb{R}^n$
\begin{cases}
\lVert u \rVert_{L^p(D)} < C_1 \lVert \nabla u \rVert_{L^p(D)} & \forall u \in W^{1,p}_{0}(D) \\
\lVert u - \bar{u} \rVert_{L^p(D)} < C_2 \lVert \nabla u \rVert_{L^p(D)} & \forall u \in W^{1,p}(D) \quad D \text{ connected Lipschitz domain} \end{cases}
Where as expected $\bar{u} = \frac{1}{|D|} \int_D{u(x)dx}$ is the average of the domain and $C_i$ are the relevant constants.
My question concerns the "in-between" case where we know that the function vanish only on a subset of the boundary: take for ease/example the 1-dimensional case and take the domain $D = (a,b) $ and the Sobolev space
$$W = \{u \in W^{1,p}(D)| u(b) = 0 \} $$ Without necessarily requiring $u(a)=0$ which, of course, if it did equates to having compact support. In this set up, can one still conclude Poincare inequality? i.e. does the following hold?
$$ \lVert u \rVert_{L^p(D)} < C \lVert \nabla u \rVert_{L^p(D)} \quad \forall u \in W$$
Having reviewed Evan's book amongst others, I did not seem to find a result concerning this case, any suggestion would be most helpful. Can one, perhaps, as in Evan's proof, extend the function to zero outside of $D$ and conclude the same?
Yes it holds, provided the $n-1$ dimensional Hausdorff measure of the portion of the boundary where $u=0$ is positive. This has been answered on math stack exchange before:
Poincaré inequality for a subspace of $H^1(\Omega)$
Basically, yes, the proof in Evans can be adapted.