I am reading a mathematical physics book, and I am trying to follow along. In the section about functionals ( $J[y] = \int_{x_1}^{x_2} f(x,y,y',\ldots,y^n)$ ), they let $y(x) \rightarrow y(x) + \epsilon \eta(x)$, and are looking at the difference in the functionals from this variation, $J[y+\epsilon \eta] - J[y]$. In one part of a derivation I cannot understand how they did the following:
$$\int_{x_1}^{x_2} \{f(x,y+\epsilon \eta ,y'+\epsilon \eta')-f(x,y,y')\} \, dx = \int_{x_1}^{x_2} \left\{\epsilon \eta \frac{\partial f}{\partial y}+ \epsilon \frac{d \eta}{d x} \frac{\partial f}{\partial y'} + O(\epsilon^2)\right\} \, dx $$
Thanks for any help you can offer.
Supposing $f=f(x,y,y')$, by Taylor's theorem, we have that
$$f(x,y+\epsilon \eta,y' + \epsilon \eta') = f(x,y,y') + \epsilon \eta \frac{\partial f}{\partial y}+ \epsilon \eta' \frac{\partial f}{\partial y'} + O(\epsilon^2)$$
so the result is simply a rearrangement of that; if you want a justification for Taylor's theorem, if you consider the multivariable chain rule it should become fairly apparent why this is the case. (This extends onto the higher derivative cases also).