Wirtinger's inequality for one-dimensional functions states that if $f(x)$, $f'(x) = \frac{df(x)}{dx}$ $\in$ $\mathcal{L}^2(a,b)$ and either $f(a) = 0$ or $f(b) = 0$ then \begin{equation} \int_{a}^{b} |f(x)|^2dx \leq \frac{4}{\pi^2}(b-a)^2\int_{a}^{b}|f'(x)|^2dx, \end{equation} where $\mathcal{L}^2(a,b)$ is the space of square integrable functions defined on the closed interval $[a,b]$.
I am wondering if there is an equivalent theorem for multivariate functions, i.e., if we have a square integrable function $f(\mathbf{x})$ in some compact domain $Q$, can we say that \begin{equation} \int_{Q} |f(\mathbf{x})|^2d\mathbf{x} \leq C\int_{Q}\|\nabla{f(\mathbf{x})}\|^2d\mathbf{x}, \end{equation} where $\|.\|$ indicates $\ell_2$ norm of a vector. For this to hold true may be the function $f(\mathbf{x})$ has to be equal to zero on the boundary of Q? Can we also obtain C?
This generalization is called the Poincare inequality, and is a fundamental result in PDE. There is a more general result called Sobolev inequality (Theorem 7.10 in Gilbarg and Trudinger), which states that if $f$ is $C^1$ of compact support, then
$$(*) \bigg( \int_Q |f(x)|^{p^*} dx \bigg)^{1/p^*} \leq C \bigg( \int_Q |\nabla f(x)|^p dx\bigg)^{1/p}$$
for all $p<n$ and $p^* = pn/(n-p)$. The proof is not difficult, just by applying fundamental theorem of Calculus and some manipulation of the integral. Using this, if $n\geq 3$, set $p=2$, then $2^*>2$ and by Holder inequality, write $q$ such that $1/p + 1/q = 1$,
$$\sqrt{\int_Q |f(x)|^2 dx} \leq \bigg( \int_Q |f(x)|^{2^*} dx\bigg)^{1/2^*} \bigg(\int 1 dx\bigg)^{1/q} \leq Vol(Q)^{1/q} C \sqrt{\int_Q |\nabla f(x)|^2 dx}$$
Squaring both sides would obtain Poincare inequality. The constant $C$ in (*) is called the Sobolev constant and are closely related to $Q$. You might search the term "Isoperimetric inequality" to get more information.
On the other hand, the $C$ in Poincare inequality can be viewed as the first eigenvalue of the problem
$$ -\Delta f = \lambda f,\ \ f|_{\partial Q} = 0\ .$$