# finding variational equivalent of a BVP

Find the variational equivalent of the BVP $$-au''(x)+xu'(x)+u(x)=f(x)$$ subject to $$u(0)=u'(L)=0$$ .

We start with $$\delta\int_0^Lfudx=\int_0^Lf\delta udx=\int_0^L(-au''+xu'+u)\delta udx$$ By parts and $$u'(L)=u(0)=0$$ gives $$u'\delta u\bigg|_{x=0}^{x=L}=u'(L)\delta u(L)-u'(0)\delta u(0)=0$$ . Hence $$\delta\int_0^Lfudx=\delta\int_0^L\frac{a}{2}\bigg(\frac{du}{dx}\bigg)^2dx+\int_0^Lxu'\delta udx+\delta\int_0^L\frac{u^2}{2}dx$$ Now I can't get the $$\delta$$ factor out of the second integral to complete the variation . By parts isn't helping since chain rule of $$x\delta u$$ leaves one $$u$$ factor out of the $$\delta$$ . Any help is appreciated .