# Variational Formulation - inhomogeneous Neumann boundary

I am not sure how to handle inhomogeneous Neumann boundary conditions in a week formulation of a pde. The problem is:

Derive the variational formulation of
$$-u''=-e^x \; \;\; in \; \Omega \in (0,1) \\ u(0) = 0 , \; u'(1) = -1$$

First I multiply the equation with a test function v and integrate over the domain, which leads to

$$\int_\Omega -u''v\;dx = \int_\Omega-e^xv\;dx$$

With integration by parts I get $$\int_0^1-u''v\;dx=-[u'v]_0^1 + \int_0^1u'v'\;dx = -u'(1)v(1)+u'(0)v(0)+\int_0^1u'v'\;dx$$ where u'(0)v(0) disappears if the testspace of v yields v(0)=0 but -u'(1)v(1)=v(1) because of the boundary condition. So my week formulation would be $$\int_0^1u'v'dx=\int_0^1-e^xvdx - v(1)$$ However all the basic examples in the lecture have the form $$\int_0^1u'v'dx=\int_0^1fv\;dx \\ a(u,v)=F(v)$$

Am I missing something here?

• what is your testspaces here? – Guy Fsone Jan 16 '18 at 9:44

$$V=\{u\in H^1(0,1): u(0)=0\}$$
V is closed subspace of $H^1(0,1)$ and therein your variational formulation is given by $$a(u,v)= F(v)~~~~~v\in V$$
where $$a(u,v)=\int_0^1u'v'dx+ u'(0)v(0)~~~~~and ~~~~~F(v)=\int_0^1-e^xvdx - v(1)$$
• Is your formulation correct? I am worried about the possiblity that there could be $u \in H^1$ or $u \in V$ such that you cannot force $u'(1)$ to exist or be defined with that formulation. Due to Sobolev-embedding, you can find a continuous representant of $u \in H^1$, but that doesn't say much about its derivative. – mdot Jan 16 '18 at 10:42