Let me start defining the following set: $$X = \{u \in C^{2}([a,b],\mathbb{R}^{n}): u(a) = u(b) = 0\}$$ and the functional $I: X \to \mathbb{R}$ given by $$I(u) = \int_{a}^{b}L(t,u(t),\dot{u}(t))dt $$ where $L: [a,b]\times \mathbb{R}^{n}\times \mathbb{R}^{n} \to \mathbb{R}$ is smooth. If $u$ is a critical point of $I$, then the Euler-Lagrange equations are derived from the condition: $$\frac{dI}{d\epsilon}(u+\epsilon \varphi)\bigg{|}_{\epsilon = 0} = 0 \tag{1}\label{1}$$ for every $\varphi \in X$.
Since $X$ is Banach, condition (\ref{1}) is just telling us that the Gateaux derivative of a function $I: X \to \mathbb{R}$ at $\epsilon = 0$ vanishes, and this is because $u$ was assumed to be a critical point of $I$.
Here it comes my problem. Suppose I do not want to consider $u(a) = u(b) = 0$ but, instead, $u(a) = \alpha$ and $u(b) = \beta$ for some fixed $\alpha, \beta \in \mathbb{R}^{n}$. In this case, we have the set: $$X_{\alpha,\beta} = \{u\in C^{2}([a,b],\mathbb{R}^{n}): \mbox{$u(a) = \alpha$ and $u(b) = \beta$}\} $$ and $I$ is now a functional on $X_{\alpha,\beta}$ instead. The latter is no longer a vector space and nor a Banach space, of course! However, I know for a fact that the same analysis hold, and the same Euler-Lagrange equations hold. I do not understand the justification why it does hold. I know $X_{\alpha,\beta}$ is an affine space of the Banach space $C^{2}([a,b],\mathbb{R}^{n})$ so I could, in principle, impose that $u$ is critical then (\ref{1}) holds for every $\varphi \in C^{2}([a,b],\mathbb{R}^{n})$ this time. But in order to $I(u+\epsilon \varphi)$ to be well-defined, one needs $\varphi \in X$, so that $u +\epsilon \varphi \in X_{\alpha,\beta}$. Demanding that (\ref{1}) holds for every $\varphi \in X$ instead of $C^{2}([a,b],\mathbb{R}^{n})$, with $u \in X_{\alpha,\beta}$ seems a weak hypothesis, because I am not considering all directions $\varphi$, only those who make sense of the sum $u + \epsilon \varphi$. So, why the condition: $$\frac{dI}{d\epsilon}(u + \epsilon \varphi)\bigg{|}_{\epsilon = 0} = 0$$ for all $\varphi \in X$ is still enough to obtain the Euler-Lagrange equations? In other words, how the above scenario using Geatéaux derivatives can be modified so to justify the assumption that only the directional derivatives in the directions of vectors of $X$ must be zero?