# Deriving Variational Formulation

Determine the variational formulation of

$$\begin{cases} -\Delta u+u=xy \quad& \text{in } \Omega\\ \nabla u\cdot \vec{n}+2u=3 \quad& \text{in } \partial\Omega \end{cases}$$

What I have tried:

\begin{align} \int_{\Omega}(-\Delta u+u)v &= \int_{\Omega}xyv \\ \int_{\Omega}uv-\int_{\Omega}\Delta uv &= \int_{\Omega}xyv \\ \int_{\Omega}uv-\int_{\Omega}\nabla u\cdot\nabla dv-\int_{\partial\Omega}\frac{\partial u}{\partial n}vds &= \int_{\Omega}vydx+vxdy \end{align}

How should I continue this? Is this correct?

• Your mathjax is a bit messed up. You also might want to learn about "\begin{cases}" for handling piecewise functions. – Spencer May 6 at 0:35
• I was going to edit the post but the only thing that has to be edited is adding a "}" next to the \right command. – bjcolby15 May 6 at 0:52
• I've been trying and trying to edit it. The "\begin{array}" works in LaTeX but why not here? – Andre Jackson May 6 at 1:11
• \begin{array} does work but it's a little different. Here's a quick summary of the formatting – Dylan May 6 at 8:21

• In the source term, you cannot write $$\int xy v dxdy$$ as $$\int vydx+vxdy$$, as the second does not make sense.
• In the integration by part there is a sign error $$-\int_\Omega \Delta u v = {\color{red} +} \int_\Omega \nabla u \cdot \nabla v - \int_{\partial \Omega} \frac{\partial u}{\partial n} v ds.$$
In order to continue you must use the boundary condition $$\partial_n u + 2u=3$$ to write $$\int_{\partial \Omega} \frac{\partial u}{\partial n} v ds = -\int_{\partial \Omega}2 u v ds +\int_{\partial \Omega} 3v ds.$$
The variational formulation is then $$\forall v \in H^1$$ $$\underbrace{\int_\Omega \nabla u \cdot \nabla v + \int_\Omega u v +\int_{\partial \Omega} 2 u v ds}_{A(u,v)}= \underbrace{ \int_\Omega xy v + \int_{\partial \Omega} 3 v ds.}_{L(v)}$$