Maximizing the area between a function and its linear approximation Let $f: [a, b] \to [0, 1]$ be a monotonously increasing function and $y_f: [a, b] \to \Bbb R,\,\,x \mapsto \alpha x + \beta$ the corresponding linear approximation with constants $\alpha$, $\beta \in \Bbb R$. Hereby, the coefficients $\alpha$ and $\beta$ are determined by minimizing
\begin{align}
\int_a^b (f(x) - y_f(x))^2 dx.
\end{align}
I derived the values of the constants. They are of the form
\begin{align}
\alpha = \alpha_1 \int_a^b f(x) dx + \alpha_2 \int_a^b x f(x)
\end{align}
and
\begin{align}
\beta = \beta_1 \int_a^b f(x) dx + \beta_2 \int_a^b x f(x),
\end{align}
with $\alpha_1$, $\alpha_2$, $\beta_1$ and $\beta_2$ depending only on $a$ and $b$.
The area enclosed by $f$ and $y_f$ is given by
\begin{align}
A(f) = \int_a^b |f(x) - y_f(x)|dx.
\end{align}
My question:
How to prove that it holds for the maximum value of the area
$\max(\{A(f), f: [a, b] \to [0, 1], \,\,f\,\,\text{monotonously increasing}\}) = \frac{1}{4}(b - a)$? 
This is the value of $A(f)$ for the function $f(x) = \theta(x - (\frac{1}{2} (b - a) + a))$ which I assume to give the maximum value of $A(f)$. In other words, I'm looking for the function that has the largest deviation from its linear approximation.
 A: Since modifications of $f$ on sets of measure zero  don't change $A(f)$,
without loss of generality one can restrict to right-continuous $f$.   Such $f$ can be thought of as cumulative distribution functions of non-negative measures of total mass $\le1$ (that is, "sub-probability" measures) on $[a,b]$. Call this set of measures and/or corresponding cdfs $C$.  The set $C$ is compact in the weak topology, the function $C:f\mapsto A(f)$ is continuous in the weak topology on $C$,  so $A$ attains it maximum on $C$.  And $C$ is convex: it is the convex hull of the probability measures on $[a,b]$ and the zero measure on $[a,b]$; its extreme points correspond to the unit point masses in $[a,b]$ and the zero measure, that is, the functions $\mathbb 1_{[h,b]}$ for $h\in[a,b]$ and the zero function $\mathbb 1_\phi$.
But $A$ is also convex on $C$.
This follows because the map $f\mapsto f-y_f$ is linear (because the map $f\mapsto (\int_a^b f(x)dx,\int_a^b xf(x)dx)$ is linear), and because the map $g\mapsto \int_a^b|g(x)|dx=\|g\|_1$ is convex.  Since $A(f)=\|f-y_f\|_1$ is a convex function composed with a linear function of $f$, it is convex, too.
Since  $A$ is  convex and continuous on $C$  it attains its maximum at an extreme point of $C$, that is, at a function $f=\mathbb 1_{[h,b]}$ for some $h\in[a,b]$.  (Or the zero function $\mathbb 1_\phi$, which is an extreme point of  $C$ but has $A(\mathbb 1_\phi)=0$.)
To finish the job  a side argument should show which value(s) of $h$ maximizes this, but I don't have that yet.  Preliminary numerical experiments show that values of $h$ close to $.25$ and $.75$ are better than $h=1/2$.
In particular, when $[a,b]=[0,1]$, these values come up:  $A(\mathbb 1_{[.5,1]})\approx 0.208333332$ and $A(\mathbb 1_{0.7657,1]})\approx0.25149765$.
