A Lagrangian problem with a countable family of local extrema ? Dear MO contributors,
let $r > 0, L > 0$. I am interested in maximizing the integral:
$$
\int_0^{2\pi} \frac{f(\alpha)^2 f'(\alpha)^2}{\sqrt{f(\alpha)^2 + f'(\alpha)^2}} \ \mathrm{d} \alpha
$$
over continuous and piecewise smooth functions $f : [0,2\pi] \to \mathbf{R}$, subject to three the constraints:
$$
f(0) = f(2\pi), \quad f \ge r,  \quad \int_0^{2\pi} \sqrt{f(\alpha)^2 + f'(\alpha)^2} \ \mathrm{d} \alpha = L.
$$
Although not directly relevant to the question, let me mention that the function $f$ represents a curve in the plane, where $f(\alpha)$ is the distance from the origin at angle $\alpha$ from one axis, and the aim is to maximize a certain torque for a given length of curve.
When I try to write down the Euler-Lagrange equation, I end up with a not-so-inspiring differential equation that is a polynomial of degree 7 in $f$, $f'$ and $f''$. 
Heuristically, I expect an extremal function to develop a number of peaks, and I conjecture that the family of extremal functions can be indexed by the number of peaks (by peaks, I mean local maxima, probably with a discontinuous derivative). More precisely, is it true that there exists at most one extremal function with a given number of peaks ? How does the set
$$
\{n \in \mathbf{N} : \text{there exists an extremal function with } n \text{ peaks} \}
$$
look like ? How many peaks does the global maximizer have ? What is its rough shape ? How much do all this depend on $r$ and $L$ ? (of course, if $L < 2\pi r$, then there are no solutions, and there is a unique solution for $L = 2 \pi r$). Are there good ways to investigate these questions numerically ? Any suggestion about the relevant litterature would also be very welcome.
 A: Your problem does not have a maximizing solution.  Here is why:  
Assuming that $f$ is piecewise smooth and not identically constant, we can solve the Euler-Lagrange equations in an interval where $f$ is smooth and $f'$ is nonvanishing as follows (taking advantage of the fact that $\alpha$ does not explicitly appear in the Lagrangian or the constraint):  Suppose that $I=[\alpha_0,\alpha_1]$ is an interval in which $f$ is smooth and such that $f'(\alpha)\not=0$ for $\alpha\in I$.  For simplicity, I'll assume that $f'>0$ on $I$, but the argument is essentially the same for $f'<0$.  Then we have $\mathrm{d}\alpha = \mathrm{d}f/f'$ so that the integral to be maximized over this interval becomes 
(after setting $f_i = f(\alpha_i)$)
$$
I = \int_{f_0}^{f_1} \frac{f^2(f')^2}{\sqrt{f^2+(f')^2}}\,\frac{\mathrm{d}f}{f'}
= \int_{f_0}^{f_1} \frac{f^2\,\mathrm{d}f}{g}\,,
$$
where I have set $g = \sqrt{(f/f')^2+1}$.  Using the same notation, the constraint integral becomes
$$
C = \int_{f_0}^{f_1} g\,\mathrm{d}f\,.
$$
Thus, we are trying to choose $g$ as a function of $f$ so as to maximize $I$ subject to the condition that $C$ is to be held constant.  Once we do this, we can recover $\alpha$ as a function of $f$ by using the fact that
$$
\mathrm{d}\alpha = \frac{\mathrm{d}f}{f'} = \frac{\sqrt{g^2{-}1}}{f}\,\mathrm{d}f\,.
$$
By the method of Lagrange multipliers, we need to choose $g = g(f)>1$ on the interval $[f_0,f_1]$ so as to render the integral $I_\lambda$ stationary, where $\lambda$ is a constant and
$$
I_\lambda = \int_{f_0}^{f_1} \left(\frac{f^2}{g}+\lambda g\right)\,\mathrm{d}f.
$$
Since $g'$ does not appear in the integrand, the Euler-Lagrange equation is particularly simple:  We must have $(f/g)^2 = \lambda$.  Setting $\lambda = c^2>0$, this gives $g = f/c$, so $c < f_0$ (since $g>1$) and we have 
$$
\mathrm{d}\alpha = \frac{\sqrt{f^2{-}c^2}}{cf}\,\mathrm{d}f\,
$$
Setting $f = c\cosh\tau$ where $\tau\in[\tau_0,\tau_1]$ with $0<\tau_0<\tau_1$,
we see that 
$$
\mathrm{d}\alpha = c \frac{\sinh^2\tau}{\cosh\tau}\,\mathrm{d}\tau
= c\,\mathrm{d}\left(\sinh\tau - 2\arctan(e^\tau)\right).
$$
Thus, the parametric curves (for $a$ and $c$ constants)
$$
\bigl(\alpha,f(\alpha)\bigr) = \bigl(a {+} c\sinh\tau {-} 2c\arctan(e^\tau),\ c\cosh\tau\bigr) 
$$
are the solutions to the Euler-Lagrange equations on the intervals where $f'>0$
(with a similar formula when $f'<0$).
Unfortunately, it turns out that these extrema are always local minima, not local maxima, as is easily verified:  Let $g = f/c + \epsilon h(f)$ where the integral of $h(f)$ over $[f_0,f_1]$ is zero and $h(f_0)=h(f_1)=0$.  This is the general perturbation that does not change the constraint integral $C$.  However, the integral $I$ then has the expansion 
$$
I = \tfrac12 c(f_1{-}f_0)^2 + \epsilon^2 c^3\int_{f_0}^{f_1} \frac{h(f)^2}{f}\,\mathrm{d}f + O(\epsilon^3).
$$
Thus, $\epsilon=0$ is always a strict local minimum.
Thus, one concludes that your original maximization problem has no solution.  (Meanwhile, the minimum, namely $I=0$, is clearly achieved by taking $f$ to be an appropriate constant.) 
A: (I couldn't find how to post this as a comment instead of an answer, anyone willing to move my text accordingly is very welcome).
The function $f$ represents the boundary of a domain, as explained above. Now, take two such copies of this domain in the plane, and lift one of them in a direction orthogonal to the plane. You have a sandwich with some empty space between the two. Fill the empty space with some liquid (and imagine that the dimensions of the objects are small, so that capillary forces fill the empty space nicely without the liquid going away). You would like the capillary forces to maintain the two copies nicely aligned, instead of the top one rotating around the vertical axis. The aligned configuration is an equilibrium position, but you want to make it as stable as possible. Making some approximations, you arrive at the problem mentionned above (forcing $f \ge r$ prevents the solution from being just a "star" with empty interior ; fixing the length prevents solutions from becoming infinitely long). 
