I'm currently studying calculus of variations. I couldn't find a rigorous definition of a functional on this site.
- What is the general definition of a functional?
- Why for calculus of variations in physics, I must to use for a functional a convex function for the space of the admissible functions?
Let $\mathscr F$ be a functional of the form $$\mathscr F(y) = \int_a^b f(x, y(x), y'(x)) \, dx.$$
We want to find a function $y_0$ that gives a local minimum of $\mathscr F,$ i.e. if we take a "close" function $y_0+\delta y$ then $\mathscr F(y_0+\delta y)$ will not be as small.
The idea is to let $\delta y = \lambda\eta,$ where $\eta$ is some function that is non-zero only in a small region and $\lambda$ is a real parameter. For a fixed $\eta$, then $\mathscr F(y_0+\lambda\eta)$ is a function of $\lambda$ which should have minimum for $\lambda=0.$
Therefore we take the derivative of $\mathscr F(y_0+\lambda\eta)$: $$ \frac{d}{d\lambda} \mathscr F(y_0+\lambda\eta) = \frac{d}{d\lambda} \int_a^b f(x, y_0(x)+\lambda\eta(x), y_0'(x)+\lambda\eta'(x)) \, dx \\ = \int_a^b \frac{\partial}{\partial\lambda} f(x, y_0(x)+\lambda\eta(x), y_0'(x)+\lambda\eta'(x)) \, dx \\ = \int_a^b \left( \frac{\partial f}{\partial y}(\cdots) \, \eta(x) + \frac{\partial f}{\partial y'}(\cdots) \, \eta'(x) \right) \, dx \\ $$ where $\frac{\partial f}{\partial y}$ is the partial derivative of $f$ with respect to its second argument (which is $y(x)$ in the defining equation for $\mathscr F$) and $\frac{\partial f}{\partial y'}$ is the partial derivative of $f$ with respect to its third argument (which is $y'(x)$ in the defining equation for $\mathscr F$). Also, $(\cdots)$ stands for $(x, y_0(x)+\lambda\eta(x), y_0'(x)+\lambda\eta'(x)).$
Now we use partial integration to remove the derivative from $\eta'(x)$: $$ \int_a^b \left( \frac{\partial f}{\partial y}(\cdots) \, \eta(x) + \frac{\partial f}{\partial y'}(\cdots) \, \eta'(x) \right) \, dx \\ = \int_a^b \left( \frac{\partial f}{\partial y}(\cdots) \, \eta(x) - \frac{d}{dx}\left(\frac{\partial f}{\partial y'}(\cdots)\right) \, \eta(x) \right) \, dx \\ = \int_a^b \left( \frac{\partial f}{\partial y}(\cdots) - \frac{d}{dx}\left(\frac{\partial f}{\partial y'}(\cdots)\right) \right) \, \eta(x) \, dx $$ if $\eta(a) = \eta(b) = 0$ (remember that we said that $\eta$ should be non-zero only in a small region).
We shall have a minimum for $\lambda=0$ so $$ 0 = \frac{d}{d\lambda} \mathscr F(y_0+\lambda\eta) = \int_a^b \left( \frac{\partial f}{\partial y}(x, y_0(x), y_0'(x)) - \frac{d}{dx}\left(\frac{\partial f}{\partial y'}(x, y_0(x), y_0'(x))\right) \right) \, \eta(x) \, dx $$
This shall be valid for any choice of $\eta$ which requires $$0 = \frac{\partial f}{\partial y}(x, y_0(x), y_0'(x)) - \frac{d}{dx}\left(\frac{\partial f}{\partial y'}(x, y_0(x), y_0'(x))\right)$$
Why so? Because if the above expression isn't $0$ everywhere then there exists some interval where it is non-zero (say positive), and then we can take $\eta$ to be positive inside that interval and zero outside of it. Such an $\eta$ would make the integral non-zero, and we get a contradiction.