# Basic functional derivative question

I've just started to learn mathematical physics, and I read Stone and Goldbart's Mathematics for Physics. But I couldn't understand on page 16 right at the beginning, they said this:

1.2.1. The functional derivative:

We restrict ourselves to expressions of the form

$$J[y] = \int_{x_1}^{x_2} f[ \, x, y, y',y'',...y^{(n)} ] \, dx$$

Consider a functional $$J=\int f dx$$ in which f depends only on $$x, y$$ and $$y'$$. Make a change $$y(x) \rightarrow y(x) + \epsilon \eta (x)$$, where $$\epsilon$$ is a (small) $$x$$-indipendent constant. The resultant change in J is: \begin{align} J[y+\epsilon \eta]-J[y] &=\int_{x_1}^{x_2}\{f(x,y+\epsilon \eta,y'+\epsilon \eta')-f(x,y,y')\}dx \\ &= \int_{x_1}^{x_2} \{\epsilon \eta\frac{\partial f}{\partial y}+\epsilon\frac{d\eta}{dx}\frac{\partial f}{\partial y'}+O(\epsilon^2)\}\\ &= ......(this part Iunderstand)\end{align}

I can't really wrap my head around this. What is that $$\eta(x)$$ that suddenly showed up? How did they manage from the first line to the second line in the above expression? And why is there a big-O at the end? (If you don't have the book you can actually find on page 16 right here, the next part is just an integration by part)

It'd be awesome if someone can explain this to me please? Thank you! :D

Quick and formal answer: for a smooth function, $$F(x+\varepsilon) = F(x) + \varepsilon F'(x) + O(\varepsilon^2),$$ as a consequence of a Taylor expansion. Hence $$f(x,y+\varepsilon\eta,y'+\varepsilon \eta') = f(x,y) + \varepsilon \frac{\partial f}{\partial y} \eta + \varepsilon\frac{\partial f}{\partial y'}\eta' + O(\varepsilon^2).$$