# In the weak formulation of the Poisson equation, why is the boundary condition included in the integration of the weighted residual?

In the weak formulation of the Poisson equation $\nabla^2u = g$ with boundary conditions $u = \bar{u}$ on $\Gamma_e$ and $\frac{\partial{u}}{\partial{n}} = \bar{q}$ on $\Gamma_n$, why is the integration of the weighted residual expressed as $$I = \int_\Omega w(\nabla^2u-g) d\Omega - \int_{\Gamma_e} w\frac{\partial{u}}{\partial{n}}d\Gamma$$ and not just $$I = \int_\Omega w(\nabla^2u-g) d\Omega$$

• Ignore weights for now. If you do that, you multiply by a test function and "formally" integrate the DE itself by parts. You get $\int_\Omega -\nabla u \cdot \nabla v dx + \int_{\Gamma_e} v \nabla u \cdot n d \Gamma + \int_{\Gamma_n} v \nabla u \cdot n d \Gamma$. in the last term. You enforce the Neumann condition on the weak form by just replacing $\nabla u \cdot n$ with $\overline{q}$. You enforce the Dirichlet condition on the weak form by restricting to those $u \in H^1$ with $u=\overline{u}$ on $\Gamma_e$. – Ian Nov 14 '15 at 16:33
• To avoid making the problem inconsistent, you then additionally require that the test functions $v$ will vanish on $\Gamma_e$. Now we say that $u \in H^1$ is a solution if $u=\overline{u}$ on $\Gamma_e$ and $\int_\Omega -\nabla u \cdot \nabla v dx + \int_{\Gamma_n} v \overline{q} d \Gamma = \int_\Omega g v dx$ for all $v \in H^1$ which vanish on $\Gamma_e$. You can check that a strong solution is a weak solution and a smooth weak solution is a strong solution, basically by undoing the integration by parts. – Ian Nov 14 '15 at 16:34
• @Ian Why not post an answer? – user147263 Nov 25 '15 at 6:42

Ignoring weights, multiply both sides of the original DE by a test function and "formally" integrate by parts. You get

$$\int_\Omega -\nabla u \cdot \nabla v dx + \int_{\Gamma_e} v \nabla u \cdot n d \Gamma + \int_{\Gamma_n} v \nabla u \cdot n d \Gamma = \int_\Omega g v dx.$$

Now we apply the boundary conditions in the weak form. On the Neumann part of the boundary $\Gamma_n$, we just replace $\nabla u \cdot n$ by what it should be. It turns out that you're stuck with this seemingly weird approach. That's because in the appropriate space of candidate solutions, restricting solution functions to the boundary makes sense but restricting their derivatives to the boundary does not.

By contrast, the approach on the Dirichlet part of the boundary is what you would expect. We restrict our solution space to functions which satisfy our Dirichlet condition. To do this without making the problem inconsistent, we must also restrict our test functions to those which vanish on $\Gamma_e$. A nice way of thinking about this is that in the associated variational problem, test functions are the directions in which we can move in the space of possible solutions. If we go in a direction which doesn't vanish on $\Gamma_e$, then our new function doesn't vanish on $\Gamma_e$, so it should not be a candidate for the minimizer in the variational problem.

Thus the weak formulation of the problem says: $u$ is a solution if $u \in H^1$, $u=\overline{u}$ on $\Gamma_e$, and

$$\int_\Omega -\nabla u \cdot \nabla v dx + \int_{\Gamma_n} v \overline{q} d \Gamma = \int_\Omega g v dx$$

for all $v \in H^1$ which vanish on $\Gamma_e$. The manipulations we did in the first place imply that a strong solution is a weak solution. Undoing the manipulations that we did shows that a smooth weak solution is a strong solution. Thus the weak formulation correctly corresponds to the strong formulation.

If you need weights, you can do it again analogously (provided the integration by parts still makes sense with the weights).

• There we go with that "formally" business again. I think you are the same person a few weeks ago that answered something about the dirac delta function and said "formally". Can you explain again what "formally" means? It doesn't mean actually formally. Does it mean intuitively? Does it mean the opposite of formally? Is that why there are quotations? – layman Nov 25 '15 at 14:06
• I'm thinking that the "formally" stuff is probably some mathematical standard that I haven't been exposed to. That's why I'm asking you about it again. – layman Nov 25 '15 at 14:07
• Nice comment. But what do we mean when we write "formally" while writing math. Can you express "formally" in other words. How should it be thought of/read? – layman Nov 25 '15 at 14:47
• @user46944 For PDE purposes, if $u$ were a strong solution, then the DE would make sense and we could just integrate by parts. But we now want to define what a weak solution is. The most basic two properties that it should have are that a strong solution is a weak solution, and a smooth weak solution should be a strong solution. – Ian Nov 25 '15 at 14:47
• @user46944 In distribution theory in general, certain definitions get motivated by a density argument. For instance, if $f$ is a distribution and $\phi_n$ are smooth functions which converge in the distributional topology to $f$, then it is natural to define $f'=\lim \phi_n'$. Most of these "formal" definitions in distribution theory work this way. – Ian Nov 25 '15 at 14:50