How to relate second variation to quadratic terms? I am working on a physics problem, but my issue is math-related. My professor skips some steps based on 'intuition' that I lack:
In a conservative system, to find out the nature of equilibrium points, we are looking at the potential energy functional, in general form given by $P[f(s)] = \int F(f(s)) ds$. (The problem is about deflection of beams, $s$ being the coordinate of the deflected elastic line.)
To me, it makes sense to perturb the function $f(s)$ to $f(s)+\epsilon g(s)$, $\epsilon$ being a small number. Then, $P[f + \epsilon g]$ is an ordinary function of $\epsilon$, so Taylor expansion works:
$$
\Delta P = P[f+\epsilon g] - P[f] = \epsilon \frac{dP[f+\epsilon g]}{d\epsilon}\big|_{\epsilon=0} + 
\frac{1}{2}\epsilon^2 \frac{d^2P[f+\epsilon g]}{d\epsilon^2}\big|_{\epsilon=0}
+O(\epsilon^3).
$$
Equilibrium requires that the first term on the RHS is zero, and for a stable equilibrium, the potential energy should be minimal, so it is necessary that
$$
\frac{1}{2}\epsilon^2 \frac{d^2P[f+\epsilon g]}{d\epsilon^2}\big|_{\epsilon=0} \geq 0 \qquad (1)
$$
for all $g$.
My problem arises when my professor says the above is more formal and involved, and that it would suffice to just collect powers of $f(s)$ and write the functional as
$$
P[f(s)] = P_0 + P_1 + P_2 + \cdots,
$$
where $P_i$ has $i$th-order terms in $f$. Then, apparently, equilibrium dictates that $P_1=0$ and a minimum requires that 
$$
P_2 \geq 0. \qquad (2)
$$
Could anyone please show me how to go from (1) to (2)? I have tried a second Taylor expansion, now in $F$, but it confuses me, especially since it is not a variable but a function.
 A: I will try to provide some insight.
Stationarity of the energy functional (in your case, beams, elastic energy plus work potential I suppose) is equivalent to equilibrium: in your case this can be verified quickly by observing how stationarity (nullity of the first variation) leads to the Euler beam equatuion (I am assuming you are not dealing with more elaborated beam models, but the essence would still be unaffected).
Stability (against infinitesimal perturbations, global stability is left aside at this stage) is a more stringent requirement: on top of equilibrium you want all your nearby accessible configurations to have a higher energy than the equilibrium (the physical picture of a ball in a well or on a saddle is as valid as ever...at least for me).
That is the intuition behind requiring that the quadratic term in the Taylor expansion be positive (hinting at some "convexity" property related to stability): if it were not so an infinitesimal perturbation at the second order would find nearby states of lower energy (as the ball on top of a half-sphere).
This verbose prologue of mine might well be obvious, for which I apologise.
Now to your direct question, how to go from (1) to (2).
(1) contains a derivative of a function (with respect to $\epsilon$).
Expand $\hat{P}(\epsilon;f; g)=P(f+\epsilon$f; g) as your professor suggested:
$$\hat{P}(\epsilon;f;g)=\hat{P}_0 +\epsilon\hat{P}_1 (0;f;g) +\epsilon^2\hat{P}_2 (0;f;g) +⋯$$
plug this expression into (1), perform derivatives term by term and you (almost) get your result. One would have to define what is meant by Taylor expansion of a functional to be fully rigorous, but at the intuitive level I hope the above is of some help (one can always "imagine" a functional as a function of infinite variables...)
