Maximum and minimum value of $\int_0^1 f(x)dx $ given $|f'(x)|<2$ 
Let $f:\mathbb R\to \mathbb R$ be a differentiable function such that $f(0)=
 0$ and $f(1)= 1$ and $|f'(x)|<2 ~ \forall x \in \mathbb R$, if $a$ and
  $b$ are real numbers such that the set of possible values of $\displaystyle\int_0^1
 f(x)dx $ is the open interval $(a,b)$, then $b-a$ is: ?

Attempt: 
$$I = \int_0^1 1.f(x) dx$$
$$\implies I = 1 - \int_0^1 xf'(x)dx $$ (Integration by parts)
$$-2 < f'(x) < 2$$
$$\implies -2x <xf'(x)< 2x$$  for $x>0$
$$\implies -1 < \int_0^1 xf'(x) dx < 1$$
Therefore $I_{max} = 2$ and $I_{min} = 0$
$\implies b- a = 2$ but answer given is $b-a = \dfrac 3 4$.
Please let me know my mistake, and the correct way to solve it. 
 A: Your estimates are correct, but not sharp. For example, in
$$
I = 1 - \int_0^1 xf'(x)dx > 1 -  \int_0^1 2 x dx = 0
$$
$I$ would be close to the lower bound $0$ only if $f'(x) \approx 2$ on the 
entire interval, which is not possible with $f(0)=0$ and $f(1) =1$.

The solution is actually simpler: Use the mean-value theorem
to obtain upper and lower bounds for the admissible functions $f$.


*

*From $f(0) = 0$ and $f'(x) < 2$ it follows that $f(x) < 2x$ for $0 < x \le 1$.

*From $f(1) = 1$ and $f'(x) > -2$ it follows that $f(x) < 1 - 2(x-1) = 3-2x$
for $0 \le x < 1$.
Together: $f(x) < \max(2x, 3-2x)$ for $0 < x < 1$, which implies
that $\int_0^1 f(x) \, dx < \frac 78$.
Similarly show that $\int_0^1 f(x) \, dx > \frac 18$.
Finally show that the integral can be arbitrarily close to those bounds.

You can also solve it graphically by drawing lines with slopes $-2$ and 
$+2$, starting from the given points $(0, f(0))$ and $(1, f(1))$.
The graph of $f$ must lie between the green and the red curve. $(b-a)$
is the area between those curves, and that is equal to the area of
the blue rectangle.

