Real numbers [tex]a\gt 0[/tex] and [tex]b[/tex] with [tex]|b|\le a[/tex] are given. Let [tex]F[/tex] be the set of all functions [tex]f[/tex] that are differentiable on [tex][0, 1][/tex] and satisfy [tex]f(0)=0[/tex], [tex]f(1)=b[/tex] and [tex]\max_{x\in[0, 1]}|f'(x)|=a[/tex]. Find [tex]\sup_{f\in F}\int_0^1 f(x)\,dx[/tex].
Solution:
Upper bound. Let [tex]f\in F[/tex] and [tex]x\in(0, 1)[/tex]. By Lagrange's mean value theorem on [tex][0, x][/tex] and on [tex][x, 1][/tex] there are points [tex]\xi[/tex] and [tex]\eta[/tex] such that
[tex]f(x)=f'(\xi)\,x\le ax,\qquad b-f(x)=f'(\eta)(1-x)\ge -a(1-x)[/tex]
Hence [tex]f(x)\le h(x)[/tex] on [tex][0, 1][/tex], where
[tex]h(x)=\min\{ax, a+b-ax\}[/tex]
The two lines meet at [tex]x_0=\frac{a+b}{2a}\in[0, 1][/tex] (because [tex]|b|\le a[/tex]), at height [tex]y_0=ax_0=\frac{a+b}{2}[/tex]. Therefore
[tex]\int_0^1 f(x)\,dx\le\int_0^{x_0}ax\,dx+\int_{x_0}^{1}(a+b-ax)\,dx=\frac{a^2+2ab-b^2}{4a}[/tex]
Sharpness. If [tex]|b|=a[/tex], then [tex]h(x)=bx[/tex], and this function itself belongs to [tex]F[/tex]. If [tex]|b|\lt a[/tex], then [tex]0\lt x_0\lt 1[/tex] and [tex]h[/tex] has a corner at [tex]x_0[/tex], which we round off. For [tex]0\lt\delta\lt\min\{x_0, 1-x_0\}[/tex] let [tex]f_\delta=h[/tex] for [tex]|x-x_0|\ge\delta[/tex] and
[tex]f_\delta(x)=y_0-\frac{a\delta}{2}-\frac{a(x-x_0)^2}{2\delta},\qquad |x-x_0|\lt\delta[/tex]
At [tex]x_0-\delta[/tex] and [tex]x_0+\delta[/tex] the pieces have equal values ([tex]y_0-a\delta[/tex]) and equal derivatives ([tex]a[/tex] and [tex]-a[/tex], respectively), so [tex]f_\delta[/tex] is differentiable, [tex]|f_\delta'|\le a[/tex] with equality outside [tex](x_0-\delta, x_0+\delta)[/tex], [tex]f_\delta(0)=0[/tex] and [tex]f_\delta(1)=b[/tex]; thus [tex]f_\delta\in F[/tex]. With [tex]t=x-x_0[/tex] we have [tex]h-f_\delta=\frac{a(|t|-\delta)^2}{2\delta}[/tex] for [tex]|t|\lt\delta[/tex], so
[tex]\int_0^1 h(x)\,dx-\int_0^1 f_\delta(x)\,dx=2\int_0^{\delta}\frac{a(\delta-t)^2}{2\delta}\,dt=\frac{a\delta^2}{3}\to 0\quad(\delta\to 0)[/tex]
Hence the supremum equals [tex]\frac{a^2+2ab-b^2}{4a}[/tex]. (For [tex]|b|\lt a[/tex] it is not attained: equality would force [tex]f=h[/tex], which is not differentiable at [tex]x_0[/tex].)