Mixed Dirichlet Neumann BVP- Existence Consider the mixed Dirichlet-Neumann BVP
\begin{equation*}
     \left\{
         \begin{alignedat}{2} 
             {} (-\Delta) u 
             & {}= f 
             && \quad\mbox{ in } \, \Omega;
             \\
             u & {}= \phi
             && \quad\mbox{ in }\,D;\\
             \partial_\nu u & {}= \psi
             && \quad\mbox{ in }\,N,
          \end{alignedat}
     \right.
\end{equation*}
where D and N are Dirichlet and Neumann subsets of $\Omega.$ For this problem, I have some questions:
1) What are the different approaches to solve mixed Dirichlet Neumann problem?
2) How do we approach it by Variational formulation specially with Non homogeneous Dirichlet-Neumann BVP?
3) What are the appropriate Sobolev space to deal with?
 A: Let us define the trace operators $\gamma_D u=u|_D$ and $\gamma_N u = \partial_\nu u|_N$, note that we take a domain $\Omega$ with $C^1$-boundary. Further, let's define the spaces $H=L^2(\Omega)$ and
$$\begin{aligned}  V &= \{ u \in H^1(\Omega): \gamma_Du=\phi\}, \\ V_0 &= \{ u \in H^1(\Omega): \gamma_D u=0\}. \end{aligned}$$
Then we have for all test functions $\varphi \in V_0$ the following weak form:
$$\underbrace{\int_\Omega \nabla u \cdot \nabla \varphi }_{a(u,\varphi)} = \underbrace{\int_\Omega f \varphi+ \int_N \psi \varphi.}_{l(\varphi)}$$
Now you proceed as you would do with any inhomogeneous Dirichlet problem. Define $u_0=u-E\phi$ where $E$ is the extension operator. This corresponds to the PDE $-\Delta u_0 = f + \Delta E\phi$ with the boundary conditions $\gamma_D u_0=0$ and $\gamma_N u_0 = \psi - \gamma_N E\phi$ and the weak form ($\forall \varphi \in V_0$)
$$\underbrace{\int_\Omega \nabla u_0 \cdot \nabla \varphi}_{\tilde a(u_0,\varphi)} = \underbrace{\int_\Omega f\varphi - \int_\Omega \nabla E\phi \nabla \varphi + \int_N \psi \varphi }_{\tilde l(u_0,\varphi)}.$$
Check that the right hand side is linear and continuous on $V_0$, i.e. you should be able to take $f\in H^{-1}(\Omega)$, $g \in H^{1/2}(D)$, $\psi \in L^2(N)$. Further, note that the Poincare inequality holds on $V_0$. Then Lax-Milgram gives you a unique weak solution $\tilde u \in V_0$. From here you also get your solution $u=u_0+E\phi \in V$.
