Let $$\lambda = \frac{\int_0^a f(x)\mathrm{d}x}{a(1-a)}= -\frac{\int_b^1 f(x)\mathrm{d}x}{b(1-b)}.$$ Set $g(x) = f(x)+2\lambda x - \lambda$. Notice that $$\int_0^a g(x)\mathrm{d}x = \int_0^a f(x)\mathrm{d} x + \lambda a^2 - \lambda a = \lambda a (1-a) + \lambda a ^2 - \lambda a = 0.$$ Similarly, we obtain $$\int_b^1 g(x)\mathrm{d}x = 0.$$

Now the left hand side of inequality becomes $$\left|\int_0^1 \left(g(x) - 2\lambda x + \lambda\right) \mathrm{d}x\right| = \left|\int_0^1 g(x) \mathrm{d}x \right|,$$ whereas the right hand side becomes $$\frac{b-a}{2}\cdot \sup_{0 \le x\le 1}|g'(x)|.$$

Indeed, we have reformulated the problem in terms of $g$. Note that the top answer for Prove an integral inequality $\left|\int_0^1f(x)dx\right|\le\frac{1−a+b}{4}\sup_{0\le x \le 1}|f'(x)|$ actually proves a stronger statement, and it is exactly what we need.


Consider the function $$ g(t) = \int_0^tf(x)dx + \frac{t(1-t)}{b(1-b)}\int_{b}^1f(x)dx.$$ Differentiating twice gives $$g^{\prime\prime}(t) = f^\prime(t) - \frac{2}{b(1-b)}\int_{b}^1f(x)dx = f^\prime(t) + \frac{2}{a(1-a)}\int_{0}^af(x)dx .$$ The required inequality is then equivalent to proving that $$|g(b)| \leq \frac{b-a}{2}\sup_{x\in[0,1]}|g^{\prime\prime}(x)|. $$ However, since $g(a)=g(1)=0$ we can do this. Clearly we have that $$|g(b)| \leq (b-a) \sup_{x\in[a,b]}|g^\prime(x)|$$ from mean value theorem and so all we need to do now is prove that $$\sup_{x\in[a,b]}|g^\prime(x)| \leq \frac{1}{2}\sup_{x\in[a,b]}|g^{\prime\prime}(x)|.$$ Define another function $h(t)=g((1-a)t+a)$, this is twice differentiable with $h(0)=h(1)=0.$ For each point $x\in(0,1)$, using Taylor's theorem twice, there exists $c_x\in(0,x)$ and $d_x\in (x,1)$ such that $$h^\prime(t) = h^{\prime\prime}(c_x)\frac{(c_x-x)^2}{2} -h^{\prime\prime}(d_x)\frac{(d_x-x)^2}{2} $$ Therefore, $$ |h^\prime(t)| \leq \sup_{x\in[0,1]}|h^{\prime\prime}(x)|\left(\frac{t^2}{2} + \frac{(1-t)^2}{2}\right) \leq \frac{1}{4}\sup_{x\in[0,1]}|h^{\prime\prime}(x)|.$$ Hence we have $$ |g^\prime(t)|\leq \frac{1-a}{4}\sup_{x\in[a,1]}|g^{\prime\prime}(x)|.$$ This gives us our required inequality.