I'm doing my own research on the Euler-Lagrange equation and came across a proof in van Brunt's textbook "The Calculus of Variations". However, there is something I don't quite understand.
Here is an excerpt from the second chapter (with a little bit of paraphrasing):
Let $J : C^2[x_0, x_1] \to \mathbb{R}$ be a functional of the form $\displaystyle J(y) = \int_{x_0}^{x_1} \! f(x, y, y') \, \mathrm{d}x$, where $f$ is assumed to have at least second order partial derivatives with respect to $x, y, y'$. Assume $y$ has fixed endpoints, i.e. $y(x_0) = y_0$ and $y(x_1) = y_1$.
Now assume that $J$ has a local maximum at $y$. Then there is an $\epsilon > 0$ such that $J(\hat{y}) - J(y) \le 0$ for all $\hat{y} \in \{y \in C^2[x_0, x_1]: y(x_0) = y_0 \text{ and } y(x_1) = y_1\}$ such that $\|\hat{y} - y\| < \epsilon$.
For any $\hat{y}$ there is an $\eta$ such that $\hat{y} = y + \epsilon \eta$, and for $\epsilon$ small Taylor's theorem implies that
$\begin{align} f(x, \hat{y}, \hat{y}') &= f(x, y + \epsilon \eta, y' + \epsilon \eta')\\ &= f(x, y, y') + \epsilon \left( \eta \frac{\partial f}{\partial y} + \eta' \frac{\partial f}{\partial y'} \right) + O(\epsilon^2) \end{align}$.
I'd like to ask: Why is the Taylor series valid? I've seen Taylor series for functions of several variables, but never for a function $f$ of functions $\hat{y}(x), \hat{y}(x)'$.
The textbook states
Here, we regard $f$ as a function of three independent variables $x, y,$ and $y'$ and the partial derivatives in the above expression are all evaluated at the point $(x, y, y')$.
But is it okay to just regard functions as independent variables like this?