Background
----------


I've met this problem when I was trying to convert a elliptic PDE problem
into the corresponding variational problem in order to apply finite element method.


The PDE is an elliptic PDE with non-zero Dirichlet boundary condition:  

Denote
$$
Lu=-\nabla\cdot(a\nabla u)+bu
$$
Then the equation is 
$$
\left\{\!\!
\begin{aligned}
&Lu=f,x\in\Omega\\
&u|\_{\partial \Omega}=g
\end{aligned}
\right.
$$


**When $g\equiv0$**, I know the corresponding variational problem is  

find $u\in H\_0^1(\Omega)$, such that
$$
a(u,v)=(f,v), \forall v\in H\_0^1(\Omega)
$$
where
$$
\begin{aligned}
a(u,v)&:=\int\_\Omega a\nabla u\cdot\nabla v\,dx+\int\_\Omega buv\,dx\qquad \\
(f,v)&:=\int\_\Omega fv\,dx,\qquad \forall u,v\in H\_0^1(\Omega)
\end{aligned}
$$
(This is actually the weak form of the original PDE.)




---


Here comes my problem:  

**For general g**,
if I can find a function $w\in H^1$ such that $w|\_{\partial\Omega}=g$, by letting $\tilde u=u-w$, 
we have
$$
\left\{\!\!
\begin{aligned}
&L\tilde u=\tilde f,x\in\Omega\\
&\tilde u|\_{\partial \Omega}=0
\end{aligned}
\right.
$$
whose solution is already known.


So how to find such a $w$?



Finding an $H^1$ function given its values on $\partial\Omega$
Here is an explicit construction not requiring local straightening of the boundary. 
I think it got to do the trick but I didn't check the details. Let $d(x)$ be the distance function from the point $x$ to the boundary $\partial\Omega$, denote by $K(a,t)=(4\pi t)^{-(n-1)/2}e^{-a^2/4t}$ a kernel corresponding to the fundamental solution of the heat equation with $n-1$ spatial variables. 


For $x\in \Omega$ consider the function
$$
w(x)=e^{1/4}\int\_{\partial\Omega}K(|x-y|,d^2(x))g(y)ds\_y.
$$
The factor $e^{1/4}$ is here to ensure that $w|\_{\partial\Omega}=g$ since near the boundary in the coordinate system with axes for $x\_1,\ldots,x\_{n-1}$ tangent to $\partial\Omega$ at the origin we have $|x-y|^2\approx(x\_1-y\_1)^2+ \ldots(x\_{n-1}-y\_{n-1})^2+d^2(x)$. 


Using the heat kernel allows to obtain several effects. It acts as a mollifier and then $t\to+0$ it tends to the delta function. (The use of fundamental solution of the Laplace equation (or its derivatives) as a potential's kernel would't suit for this aim as it leads to an integral equation).


But there is a problem, the potential with the heat kernel gives an anisotropic solution well described in function spaces in which the elements are to be twice as smooth with respect to spatial variables as with time variable $t$.


The idea is to use rescaling $t\to t^2$ to mend this anisotropic property, giving equal degrees for $x$ and $t$ in the heat kernel.


If $u\in H^1(\Omega)$ then $g\in H^{1/2}(\partial\Omega)$. Consider the Cauchy problem $u\_t=\Delta u$ in the half-space $\mathbb R^n\_+=\mathbb R^{n-1}\times(0,\infty)\ $, $u(\cdot,0)=g\in H^{1/2}(\mathbb R^{n-1})\ $. Then the solution $u$ belongs to anisotropic space $H^{3/2,3/4}(\mathbb R^n\_+)$. So the derivative $u\_x$ is smooth enough. The essential thing here is that is valid the following 


**Lemma** 
Let $g\in H^{1/2}(\mathbb R^{n-1})$ and $v(x,t)=u(x,t^2)\;$. Then $v\_t\in L\_2(\mathbb R^n\_+)\;$.


The rest is technical. The distance function $d$ is uniformly Lipschitz in $\mathbb R^n$ so there should be no problem taking the first derivatives etc. If the boundary is smooth then $d$ is also smooth near it. So multiplying $w$ by a cutoff function of the form $\xi(d(x))$ one can get a more smooth result.


