# Regularity of test functions in weak formulation

In weak formulation of a solution to a PDE, does a test function need to have the same regularity as the function $u$? For example, consider the Poisson equation $$-\Delta u = f \quad \text{in } \Omega, \qquad u = 0 \quad \text{on } \partial\Omega,$$ where $\Omega$ is a smooth domain. We say $u \in H^1_0(\Omega)$ is a weak solution of the above boundary value problem if we have $$\int_\Omega Du \cdot Dv \,dx = \int_\Omega fv \,dx$$ for all $v \in H^1_0(\Omega)$. Can we say $v \in C^\infty_c(\Omega)$?

Thank you.

• I think you may be missing the forest for the trees a bit. The problem is not really how regular your test functions are, because those can generally be taken to be very nice (since usually "nice" sets of functions are dense in the "nasty" sets of functions that we care about). The problem is what space your equation makes sense on. For this, you need completeness (at least for the solution space, so that existence is guaranteed in the end), relative strength of the norm (for some estimates), and relative weakness of the norm (for other estimates). – Ian Mar 31 '17 at 19:02
• (Cont.) For illustration, think about the proof of existence/uniqueness for the Dirichlet Poisson equation (your example). Why is it posed on $H^1 \times H^1$? #1: $H^1$ is complete. #2: $A(u,v) = \int Du \cdot Dv - fv dx$ is continuous on $H^1 \times H^1$ (which means that $H^1$ is "strong enough" to see when $Du$ and $Dv$ are large even when $u$ and $v$ are small). #3: $B(u,v)=\int Du \cdot Dv$ is coercive on $H^1 \times H^1$. – Ian Mar 31 '17 at 19:02
• (Cont.) This coercivity means that $H^1$ is "weak enough" that the $H^1$ norm of $u$ can't be too big if $B(u,u)$ is small. It is here that the situation would break down if you formulated the problem a priori on, say, $H^2$, because there are functions which are themselves small, and have small first derivatives, but have large second derivatives. (This is also why even if $f$ is extremely nice, we still prove existence/uniqueness through Lax-Milgram and then prove higher regularity after the fact.) – Ian Mar 31 '17 at 19:02
• The restriction has only $H^{1/2}$ regularity, that's true, but in fact the restriction usually does not appear in the weak formulation at all. For instance in the Neumann Poisson equation, if you have $\frac{\partial u}{\partial n}=g$, you just do your integration by parts, obtain a boundary integral of $v \frac{\partial u}{\partial n}$, and then replace $\frac{\partial u}{\partial n}$ with $g$. If your BC is not actually Neumann but you can still solve for $\frac{\partial u}{\partial n}$ (for example, if your BC is Robin) then you can still make this replacement (it just may involve $u$). – Ian Apr 1 '17 at 1:45
• (I should correct myself: the boundary restriction only has $H^{1/2}$ regularity a priori. Again one can prove after the fact that the restriction has plenty of regularity if $f$ and the boundary function are both nice.) – Ian Apr 1 '17 at 1:54