Let $f(u)=(du/dx)^2$, where $u=u(x)$. Let's write f(u)=(u')^2 in the following.
Let's say we want to calculate $\partial/\partial\epsilon[f(u+\epsilon\delta u)]_{\epsilon=0},$ where $\delta u = \delta u(x)$. As I see it, two approaches are:
1) \frac{\partial}{\partial\epsilon}[f(u+\epsilon\delta u)]|_{\epsilon=0} = \frac{\partial}{\partial\epsilon}[((u+\epsilon\delta u)')^2]|_{\epsilon=0} = \frac{\partial}{\partial\epsilon}[(u'+\epsilon\delta u')^2]|_{\epsilon=0} = 2(u'+\epsilon\delta u')\frac{\partial}{\partial\epsilon}(u'+\epsilon\delta u')|_{\epsilon=0} = 2u'\delta u'
2)
$\frac{\partial}{\partial\epsilon}[f(u+\epsilon\delta u)]|_{\epsilon=0} = \frac{\partial f(u+\epsilon\delta u)}{\partial(u+\epsilon\delta u)}\frac{\partial(u+\epsilon\delta u)}{\partial\epsilon} = \frac{\partial f(u)}{\partial u}\delta u = 0*\delta u?$
I obviously end up wrong with 2), but where is the error? I suppose it has something to do with $f(u)$ being a functional, and with the use of the chain rule to change from a derivative wrt. a variable ($\epsilon$ in this case) to an expression also involving derivatives wrt. functions ($u$ in this case), but can someone please clarify?
Also, if the problem lies in is applying the chain rule in this way, why does the following (found in 1) ), where I'm essentially doing the same thing, work? \frac{\partial}{\partial\epsilon}[(u'+\epsilon\delta u')^2] = 2(u'+\epsilon\delta u')\frac{\partial}{\partial\epsilon}(u'+\epsilon\delta u') = 2u'\delta u'. Why don't I have to write \frac{\partial}{\partial\epsilon}[(u'+\epsilon\delta u')^2] = \frac{\partial}{\partial\epsilon}[(u')^2+2u'\epsilon\delta u'+\epsilon^2(\delta u')^2] = 2u'\delta u'? Does it work just by accident?