For second order elliptic PDE, we usually consider the weak solution, which is the solution for variational form. When facing inhomogeneous Dirichlet boundary conditions, we usually modify it into homogeneous Dirichlet boundary condition so that we can take the test function space as $H^1_0(\Omega)$.
I am wondering if there is a method such that we can switch the test function space to $H^1(\Omega)$, so that we don't need to do the homogeneous step. In this way, when we do the stability analysis, we can take $v=u$ rather than $v=u_0$, which is the solution for the homogeneous problem.
So far, I have three ideas. The first idea is the Lagrange multiplier method. However, in this case, we cannot give a proper estimate on the Lagrange variable. The second idea is that we can first do in $H^1_0(\Omega)$, then recover to $H^1(\Omega)$, and finally prove that this hold for test function $v\in H^1(\Omega)$. The third idea is that we can go to the mixed form, so that the Dirichlet boundary condition can be applied naturally. However, since $C^\infty_0(\Omega)$ is not dense in $H(\textrm{div};\Omega)$, this has problem proving that the boundary condition still holds.