Consider the simplest equation: \begin{align} -\Delta u &= f\ \ \text{in} \ \ \Omega\\ u&=0 \ \ \text{on} \ \ \partial\Omega \end{align}
I think the natural way to derive the weak-solution is to treat the equation in the distributive sense: \begin{equation} -\Delta u = f \ \ \text{in}\ {L^2(\Omega)}' \end{equation}
Therefore we know: \begin{equation} \int_{\Omega} -\Delta u v = \int_{\Omega} f v, \ \ \forall v\in L^2(\Omega) \end{equation}
In all books, I see the next step is to do the integration by parts. This is just what I am wondering, because I don't can't figure out the motivation. If we choose to do the integration by parts, we can get
$$ \int_{\Omega} \nabla u \cdot \nabla v = <f,v>. $$
we have to restrict $u$ and $v$ to the $H^{1}$(all first-order weak derivatives $\in L^2$ ). Besides, it has no boundary, which means need a trace operator.
Q$1$: Why do we choose to do the integration by parts?
After the integration by parts, I can understand the weak formulation: Find u $\in H^1(\Omega)$ with the trace $\gamma u = 0$ (or equivalently $u\in H^1_0(\Omega)$), st $$ a(u,v) = <f,v> \forall v\in H^1(\Omega ) $$ where $a(u,v) = \int_{\Omega} \nabla u \cdot \nabla v$
Then...I feel frustrated about the form in the book: $$ a(u,v) = <f,v> \forall v\in H^1_0(\Omega ) $$
Q$2$:Why the test space is $H^1_0$ instead of $H^1$?
Maybe it's because these two test function spaces $H^1_0$ and $H^1$ have the same weak solution???
Hope for the illustration. THANKS A LOT!
We look for weak solutions in $H^1(\Omega)$ only. If you consider the form before, you have to justify that the terms are well-defined. Hence, you actually say that $u$ has to be in $H^2(\Omega)$ which is a smaller space.
The case of $a:H \times H \to \mathbb{R}$ is in the setting of the famous Lax-Milgram lemma and you can immediately conclude whether your PDE is well-posed in a weak sense. There are also other theorem such as the Lions-Lax-Milgram theorem, which generalizes this and the solution function space can be different than the test function space. But this theorem is not as feasible to state, you have to check for inf-sup conditions now because coercivity in Lax-Milgram is formulated for such symmetric bilinear forms.