I am stuck with the following strange exercise: Let $a: [0,1] \to [1, 2]$ be a Borelian function, and for any $f \in L^2(0,1)$ and consider the following functional $E_f: L^2(0,1) \to [0, + \infty]$: $$E_f(g)=\int_0^1 a |g'(x)|^2 + |f(x) - g(x)|^2) dx$$ if $g \in W^{1,2}(0,1)$, $+ \infty$ otherwise.
I have to prove that for each $f\in L^2(0,1)$ there exists a unique minumum $T(f)\in L^2(0,1)$ of $E(f)$.
My idea was to consider the weak Euler Lagrange equation for such variational problem, and, since any minimum has to satisfy it, provide, by the standard method of Lax-Milgram Theorem, that such a solution is unique.
The problem here is that I don't have any boundary condition on $g$, and so, I am not sure that I can follow such an approach.
Any hint or help is really appreciated, I thank you in advance.
If you follow the usual procedure to derive the Euler-Lagrange equations, you should find what the boundary condition is.
For a smooth $v:[0,1]\to\mathbb{R}$ work out
$$\frac{d}{dt}\Big\vert_{t=0} E_f(g + tv) = 2\int_0^1 ag'v' - (f-g)v \, dx =0.$$
Integrating by parts:
$$\int_0^1 ( (ag')' + f-g)v \, dx - a(1)g'(1)v(1) + a(0)g'(0)v(0)=0.$$
The three terms above are essential independent. For instance, if you choose $v$ so that $v(0)=v(1)=0$ then
$$\int_0^1 ( (ag')' + f-g)v \, dx.$$
Since this holds for all such $v$, we have
$$(ag')' + f-g = 0.$$
You can also select a sequence of $v_k$ with $v_k(1)=1$ and $v_k(x) \to 0$ elsewhere to get $a(1)g'(1)=0$. Similar for $a(0)g'(0)=0$. Hence, the boundary conditions should be
$$a(1)g'(1) = a(0)g'(0) = 0.$$