I have the following problem ,let $f \in L^{2}(0,1),X\in C^{\infty}([0,1]),\mu \in L^{\infty}(0,1)\quad \text{and}\quad X(x)\geq \alpha\geq 0,\mu(x)\geq0 $ , for almost every $x\in ]0,1[$
\begin{cases} -\frac{d}{dx}(X\frac{du}{dx})+\mu u=f ,\text{in} ]0,1[ \\ u(0)=0,\frac{du}{dx}(1)=0 \end{cases}
I have tried to prove that problem admit unique weaker solution using Lax-Milgram theorem , I have multiplied $-\frac{d}{dx}(X\frac{du}{dx})+\mu u=f$ by $v\in H^1([0,1)]$ because the functional space appropriate for this variational formulation is a Sobolov space such that :$\frac{dv}{dx}(1)=0,v(0)=0$ but I didn't succed to get formula for integration by part in order to apply Lax-Milgram theorem , My question is How I can write the variational formualtion of the above problem to prove that there exist a unique weaker solution ?
The right space to use is $$V=\{H_0^1(0,1) \ | \ u(0)=0 \}$$ The Dirichlet condition has to be put in the space definition if one hopes to get rid of the boundary term in the integration by parts. It is not the same for the Neumann condition wich naturally appears in the boundary term.
Multiplying by $v \in V$ and integrating by part on $[0,1]$ , you have $$\int_0^1 d_x( X d_x u) v = -\int_0^1 X d_x u d_x v + X(1)d_x u (1) v(1)- X(0) d_x u(0) v(0) = - \int_0^1 X d_x u d_x v$$
The boundary terms are equals to 0 thanks to the definition of $V$ and thanks to the Neumann condition in the equation. However, be careful to understand that you are using a continuous representant of $u$ and $v$ for the boundary terms thanks to the embedding $H^1(0,1) \rightarrow C^0(0,1)$ (if you don't notice that, nothing alows you to write "$u(0)$" since $u \in L^2$ is defined almost everywhere on $(0,1) )$
Hope this helps.