Computing the Euler Lagrange equations Let $F(u) = \int_0^1(u'')^2+u^2dx $ on $C^2[0,1]$ satisfying $u(0)=a,u(1)=b,u'(0)=c,u'(1)=d$ where $a,b,c,d \in \mathbb{R}$.
If $u_*$ is a minimizer,  for $\phi \in C^2[0,1],\ \frac{d}{ds}| _{s=0} F(u_* +s\phi) = \int_0^1 (2(u'')\phi''+2u\phi) dx$ 
Im having trouble understanding what is the correct choice of "directions" $\phi$ in the derivations of the euler-lagrange eq's. 
Any help would be appreciated, 
Thanks
 A: *

*Step 0: variational approach: statement.


In the given variational problem, the basic assumption is that the Lagrangian 
$$L(u(x),u'(x),u^{''}(x),x)=u^2(x)+(u^{''}(x))^2$$ 
is differentiable at $y:=(u(x),u'(x),u^{''}(x),x)$. This allows us to compute the variational derivative 
$$\frac{dS[u+s\phi]}{ds}|_{s=0},$$
for all $\phi\in C^2([0,1])$ s.t. $\phi(0)=\phi(1)=\phi^{'}(0)=\phi^{'}(1)=0$, where 
$$\frac{dS[u+s\phi]}{ds}|_{s=0}=\lim_{s\rightarrow 0}\frac{
S[u+s\phi]-S[u]}{s}=\\
\lim_{s\rightarrow 0}\frac{\int_0^1 L(u(x)+s\phi(x),u'(x)+s\phi'(x),u^{''}(x),+s\phi^{''}(x),x)
-L(u(x),u'(x),u^{''}(x),x)dx}{s}.$$


*

*Step 1: variational approach: on the increments $\phi(x)$


Let us now better describe the increments $\phi(x)$ appearing in the variational derivative formula. Our functional space ($b$ stands for "boundary conditions") is
$$C^2_b([0,1]):=\{ u\in  C^2([0,1]):~u(0)=a,u(1)=b,u'(0)=c,u'(1)=d \}. $$
We are interested in all "small variations" $\phi\in C^2([0,1])$ of $u=u(x)$: this means that the sum $u+s\phi$ ($s$ is the parameter that controls the "smallness" of the variation around $u$) must be an element of $C^2_b([0,1])$ for all $s$, implying
$$(u+s\phi)(0)\stackrel{!}{=}a\Rightarrow \phi(0)=0, $$
$$(u+s\phi)(1)\stackrel{!}{=}b\Rightarrow \phi(1)=0,$$
$$(u+s\phi)^{'}(0)\stackrel{!}{=}c\Rightarrow \phi^{'}(0)=0,$$
$$(u+s\phi)^{'}(1)\stackrel{!}{=}d\Rightarrow  \phi^{'}(1)=0,$$
i.e. the boundary conditions we already described in "Step 0".


*

*Step 2: variational approach: computations


Let us compute the variational derivative $\frac{dS[u+s\phi]}{ds}|_{s=0}$.
We consider the point $y(x):=(u(x),u'(x),u^{''}(x),x)$ and the increment $h(x):=(s\phi(x),s\phi'(x),s\phi^{''}(x),0)$ for all $x\in [0,1]$. Differentiability at $y(x)$ of the Lagrangian $L(u(x),u'(x),u^{''}(x),x)$ is
$$L(y(x)+h(x))-L(y(x))=\langle \nabla L(y(x)),h(x)\rangle+O(\|h(x)\|);~~(*)$$
the gradient $\nabla L(y(x))$ of $L$ at $y(x)$ is 
$$\nabla L(y)=\left(\frac{\partial L}{\partial u},\frac{\partial L}{\partial u'},\frac{\partial L}{\partial u^{''}}, \frac{\partial L}{\partial x}\right)=
\left(\frac{\partial L}{\partial u},0,\frac{\partial L}{\partial u^{''}}, \frac{\partial L}{\partial x}\right)$$
If we expand $(*)$ using the definition of gradient and scalar product and the definition of $L$, we arrive at
$$\int_0^1 L(u(x)+s\phi(x),u'(x)+s\phi'(x),u^{''}(x),+s\phi^{''}(x),x)
-L(u(x),u'(x),u^{''}(x),x)dx=
\int_0^1 s\left(\frac{\partial L}{\partial u}\phi(x)+\frac{\partial L}{\partial u^{''}}\phi^{''}(x)\right)+O(s^2)=\int_0^1 s\left(2u(x)\phi(x)+ 2u^{''}(x)\phi^{''}(x)\right)dx+O(s^2). $$
Using the above definition for the variational derivative, we arrive at
$$\frac{dS[u+s\phi]}{ds}|_{s=0}=\lim_{s\rightarrow 0}\frac{\int_0^1 s\left(2u(x)\phi(x)+ 2u^{''}(x)\phi^{''}(x)\right)dx+O(s^2)}{s}=\\\int_0^1 2u(x)\phi(x)+ 2u^{''}(x)\phi^{''}(x)dx, $$
as claimed. Note that the above formula holds for all $u\in C^2_b([0,1])$, not only for the minimizing $u^{*}$. This latter are/is obtained by the Euler Lagrange equations
$$\frac{dS[u+s\phi]}{ds}|_{s=0}=0,$$
using the boundary conditions which are contained in the definition of $C^2_b([0,1])$ itself. The uniqueness (if true) has to be discussed/proved as well.
