An integral inequality related to Taylor expansion Problem. Let $f:[a,b]\to\mathbb{R}$ be a function such that $ f\in C^3([a,b])$ and $f(a)=f(b)$. Prove that $$ \left|\int\limits_{a}^{\frac{a+b}{2}}f(x)dx-\int\limits_{\frac{a+b}{2}}^{b}f(x)dx\right|\leq\frac{(b-a)^4}{192}\max_{x\in [a,b]}|f'''(x)|.$$
Any idea are welcome.
 A: Let $f(x)=g(t)+h(t)$, where $g$ is odd, $h$ is even, and $x=\frac{b-a}{2}t+\frac{b+a}{2}$; that is $t=\frac{2x-b-a}{b-a}$.
Then, since $g$ is odd and $h$ is even,
$$
\max_{t\in[-1,1]}|g'''(t)|\le\left|\frac{b-a}{2}\right|^3\max_{x\in[a,b]}|f'''(x)|\tag{1}
$$
and
$$
\begin{align}
\int_{\frac{b+a}{2}}^bf(x)\,\mathrm{d}x-\int_a^{\frac{b+a}{2}}f(x)\,\mathrm{d}x
&=\frac{b-a}{2}\left(\int_0^1g(t)\,\mathrm{d}t-\int_{-1}^0g(t)\,\mathrm{d}t\right)\\
&=(b-a)\int_0^1g(t)\,\mathrm{d}t\tag{2}
\end{align}
$$
Since $f(a)=f(b)$, we must have $g(-1)+h(-1)=g(1)+h(1)$.
Since $h(-1)=h(1)$, we must have $g(-1)=g(0)=g(1)=0$.
Since $g$ is odd, $g''(0)=0$.
Suppose that $\max\limits_{t\in[0,1]}|g'''(t)|=M$, and on $[0,1]$, define
$$
p(t)=g(t)-\frac M6(t-t^3)\tag{3}
$$
then $p(0)=p(1)=p''(0)=0$ and $p'''(t)=g'''(t)+6\ge0$. Thus, $p''(t)\ge0$, and therefore, $p'$ is non-decreasing.
Suppose $p(t_0)\gt0$. The Mean Value Theorem says that for some $t_1\in(0,t_0)$, we have that $p'(t_1)=\frac{p(t_0)-p(0)}{t_0-0}\gt0$. Since $p'$ is non-decreasing, $p(t_0)\gt0$ and for all $t\ge t_0$, $p'(t)\gt0$. This would imply that $p(1)\gt0$.
Thus, $p(t)\le0$; that is,
$$
g(t)\le\frac M6(t-t^3)\tag{4}
$$
By a similar argument, using $q(t)=g(t)+\frac M6(t-t^3)$, we get $g(t)\ge-\frac M6(t-t^3)$. Therefore, since $g$ is odd, for all $t\in[-1,1]$,
$$
|g(t)|\le\frac M6\left|\,t-t^3\right|\tag{5}
$$
Integrating yields
$$
\left|\int_0^1g(t)\,\mathrm{d}t\right|\le\frac M{24}\tag{6}
$$
Thus, combining $(1)$, $(2)$, and $(6)$ tells us that
$$
\left|\int_{\frac{b+a}{2}}^bf(x)\,\mathrm{d}x-\int_a^{\frac{b+a}{2}}f(x)\,\mathrm{d}x\right|\le\frac{(b-a)^4}{192}\max_{x\in[a,b]}|f'''(x)|\tag{7}
$$
A: Idea : Making use of successive Integration by parts ,
$\int P(x)f^{(3)}(x)\,dx = P(x)f^{(2)}(x)-P^{(1)}(x)f^{(1)}(x)+P^{(2)}(x)f(x)-\int P^{(3)}(x)f(x)\,dx$
Consider the two third degree monic polynomials, $P_1(x)$ and $P_2(x)$.
Now, we compute the difference of the definite integrals: 
$\int\limits_{\frac{a+b}{2}}^b P_2(x)f^{(3)}(x)\,dx-\int\limits_a^{\frac{a+b}{2}} P_1(x)f^{(3)}(x)\,dx$ 
$=[P_2(b)f^{(2)}(b)+P_1(a)f^{(2)}(a)-P_2(\frac{a+b}{2})f^{(2)}(\frac{a+b}{2})-P_1(\frac{a+b}{2})f^{(2)}(\frac{a+b}{2})]  -  [P_2'(b)f^{(1)}(b)+P_1'(a)f^{(1)}(a)-P_2'(\frac{a+b}{2})f^{(1)}(\frac{a+b}{2})-P_1'(\frac{a+b}{2})f^{(1)}(\frac{a+b}{2})]  +  [P_2''(b)f(b)+P_1''(a)f(a)-P_2''(\frac{a+b}{2})f(\frac{a+b}{2})-P_1''(\frac{a+b}{2})f(\frac{a+b}{2})]  -  [\int\limits_{\frac{a+b}{2}}^b P_2'''(x)f(x)\,dx - \int\limits_a^{\frac{a+b}{2}} P_1'''(x)f(x)\,dx]$
We want our polynomials to satisfy the relations:
$P_2(b)=0,P_1(a)=0,P_2(\frac{a+b}{2})+P_1(\frac{a+b}{2})=0$ ... (i)
$P_2'(b)=0,P_1'(a)=0,P_2'(\frac{a+b}{2})+P_1'(\frac{a+b}{2})=0$ ... (ii)
$P_2''(b)+P_1''(a)=0,P_2''(\frac{a+b}{2})+P_1''(\frac{a+b}{2})=0$ ... (iii)
(In (iii) we made use of $f(a)=f(b)$)
From, (ii) and (iii), it follows that $P_1(x)=(x-a)^2(x-c_1)$ and $P_2(x)=(x-b)^2(x-c_2)$, plugging in the other conditions we get $c_1=\frac{a+3b}{4}$ and $c_2=\frac{b+3a}{4}$
Therefore,
$\int\limits_a^{\frac{a+b}{2}} P_1(x)f^{(3)}(x)\,dx-\int\limits_{\frac{a+b}{2}}^b P_2(x)f^{(3)}(x)\,dx$
$=6\int\limits_{\frac{a+b}{2}}^b f(x)\,dx-6\int\limits_a^{\frac{a+b}{2}}f(x)\,dx$
Making use of the fact $P_1(x)\le0$ in the interval $[a,\frac{a+b}{2}]$ (Since, $\frac{a+3b}{4} \ge \frac{a+b}{2}$) 
and $P_2(x)\ge 0$ in the interval $[\frac{a+b}{2},b]$ (Since, $\frac{b+3a}{4} \le \frac{a+b}{2}$)
and, $\int\limits_a^{\frac{a+b}{2}}(x-a)^2(x-\frac{a+3b}{4})=-\frac{1}{64}(b-a)^4$
$\int\limits_{\frac{a+b}{2}}^b (x-b)^2(x-\frac{b+3a}{4})=\frac{1}{64}(b-a)^4$
Therefore, $\left|\int\limits_{\frac{a+b}{2}}^b f(x)\,dx-\int\limits_a^{\frac{a+b}{2}}f(x)\,dx\right| \le \frac{2}{64\times 6}(b-a)^4\max_{x\in [a,b]}|f'''(x)|=\frac{1}{192}(b-a)^4\max_{x\in [a,b]}|f'''(x)|$
