Find maximum value of $\int_{0}^{1}\left(f(x)\right)^3dx$

Let $f\colon [0,1]\to [-1,1]$ be a measurable function satisfying $\int_0^1 f = 0$, let $$ E := \{x\in [0,1]:\ f(x) < 0\}, $$ and denote by $\sigma\in [0,1]$ the Lebesgue measure of $E$. It is not restrictive to assume $\sigma > 0$, since if $\sigma = 0$ we have $f=0$ a.e., which is not a maximizer.

Moreover, let $$ f^+ := (|f|+f)/2, \qquad f^- := (|f| - f)/2, $$ so that $f^+, f^-\geq 0$, $f=f^+ - f^-$, $|f| = f^++f^-$. Moreover the conditions $\int_0^1 (f^+-f^-) = 0$, $0\leq \int_0^1(f^++f^-) \leq 2$ give $$ A := \int_0^1 f^+ = \int_0^1 f^- \in [0, 1/2], \qquad A = \int_0^1 f^+ \leq 1-\sigma. $$

Since $\int_0^1 f = 0$ and $|f|\leq 1$, we have that $$ \begin{split} \int_0^1 f^3 & = \int_0^1 (f^3+f) = \int_0^1 f(1+f^2) = \int_0^1 (f^+ - f^-)(1+f^2) \\ & = \int_0^1 f^+(1+f^2) - \int_0^1 f^-(1+f^2) \leq 2 \int_0^1 f^+ -\int_0^1 f^- - \int_0^1 (f^-)^3. \end{split} $$ Since $0 = \int_0^1 f = \int_0^1 f^+ - \int_0^1 f^-$, and, by Jensen's inequality, $$ \int_0^1 (f^-)^3 = \int_E (f^-)^3 \geq \frac{1}{\sigma^2} \left(\int_E f^-\right)^3 = \frac{1}{\sigma^2}\left(\int_0^1 f^+\right)^3, $$ we get $$ \int_0^1 f^3 \leq A - \frac{A^3}{\sigma^2} =: g(\sigma, A). $$ We are led to maximize the function $g$ in the region $$ B := \{(\sigma, A):\ \sigma \in (0, 1],\ 0\leq A\leq 1-\sigma\}. $$ The function $g$ is continuous in $B$ and $g \to -\infty$ as $\sigma\to 0^+$, hence $g$ admits a maximizer in $B$.

Since $\frac{\partial g}{\partial \sigma} = 2A^3 / \sigma^3 > 0$, the maximizer must lie on the boundary of $B$ (excluding the segment with $\sigma = 0$). A quick check shows that the maximizer is obtained for on the side $A = 1-\sigma$ for $\sigma = 2/3$, hence $$ \max_B g = \frac{1}{4} $$ and, finally, $$ \int_0^1 f^3 \leq \frac{1}{4}. $$

On the other hand, every function $f$ with $f=-1/2$ on a set $E\subset[0,1]$ of measure $2/3$ and $f=1$ on $[0,1]\setminus E$ gives $\int_0^1 f^3 = 1/4$, and so is a maximizer for the original problem.


Consider: $$f(x)=\begin{cases} 1, a\le x\le 1 \\ -c, 0\le x<a \end{cases}$$ The constraint: $$1-a=-ac \Rightarrow c=\frac{a-1}{a}.$$ The objective function: $$S(a,c)=1-a+ac^3 \to max$$ Solution: $$S(a)=1-a+a\left(\frac{a-1}{a}\right)^3=-2+\frac{3}{a}-\frac{1}{a^2}.$$ $$S'=-\frac{3}{a^2}+\frac{2}{a^3}=0 \Rightarrow a=\frac{2}{3}.$$ $$S''(2/3)<0.$$ Hence: $$S(2/3)=\frac{1}{4} (max).$$


A somewhat more conceptual approach is the following.

The set of points $S=\{(\int_0^1f(x)\,dx,\int_0^1(f(x))^3\,dx): |f(x)|\le 1 \text{ on } [0,1]\}\subset\mathbb R^2$, is exactly the set of points representable as $(E[X],E[X^3])$ for a random variable $X$ for which $P(|X|\le1)=1$. This, in turn, is the convex hull of the set $C=\{(x,x^3):|x|\le 1\}$, and the desired answer is the $y$-coordinate of the intersection of the $y$ axis with the upper envelope of $S$.

A sketch should make it obvious that the upper envelope of $S$ is the union of a piece of $C$ stretching from $(-1,-1)$ to $p$, and of the line segment connecting $p$ to $(1,1)$, where $p$ is the unique point of tangency to $C$ of a line passing through $(1,1)$. Simple calculus verifies that $p=(-1/2,-1/8)$. The line segment from $p$ to $(1,1)$ intersects the $y$ axis at $(0,1/4)$, from which the answer $1/4$ is read off.