<s>[INST] Estimation of integral Suppose the function $f(x)$ has a Taylor series expansion. Then
$$\int_a^bf(x)dx=\int_a^b(f(a)+f'(a)(x-a)+\frac{1}{2}f''(a)(x-a)^2+\cdots)dx=\\ \frac{f(a)}{1!}(b-a)+\frac{f'(a)}{2!}(b-a)^2+\frac{f''(a)}{3!}(b-a)^3+\cdots$$
and
$$\int_a^bf(x)dx=\int_a^b(f(b)+f'(b)(x-b)+\frac{1}{2}f''(b)(x-b)^2+\cdots)dx=\\ \frac{f(b)}{1!}(b-a)-\frac{f'(b)}{2!}(b-a)^2+\frac{f''(b)}{3!}(b-a)^3+\cdots$$
Therefore
$$\int_a^bf(x)dx=\frac{1}{1!}\frac{f(a)+f(b)}{2}(b-a)+\frac{1}{2!}\frac{f'(a)-f'(b)}{2}(b-a)^2+\frac{1}{3!}\frac{f''(a)+f''(b)}{2}(b-a)^3+\cdots$$
However, one can also consider
$$\int_a^bf(x)dx=\int_a^df(x)dx+\int_d^bf(x)dx$$
where $d=\frac{a+b}{2}$
Then
$$\int_a^df(x)dx=\int_a^d(f(a)+f'(a)(x-a)+\frac{1}{2}f''(a)(x-a)^2+\cdots)dx=\\
\frac{1}{1!}\frac{f(a)}{2}(b-a)+\frac{1}{2!}\frac{f'(a)}{2^2}(b-a)^2+\frac{1}{3!}\frac{f''(a)}{2^3}(b-a)^3+\cdots$$
$$\int_d^bf(x)dx=\int_d^b(f(b)+f'(b)(x-b)+\frac{1}{2}f''(b)(x-b)^2+\cdots)dx=\\
\frac{1}{1!}\frac{f(b)}{2}(b-a)-\frac{1}{2!}\frac{f'(b)}{2^2}(b-a)^2+\frac{1}{3!}\frac{f''(b)}{2^3}(b-a)^3+\cdots$$
and so
$$\int_a^bf(x)dx=\frac{1}{1!}\frac{f(a)+f(b)}{2}(b-a)+\frac{1}{2!}\frac{f'(a)-f'(b)}{2^2}(b-a)^2+\frac{1}{3!}\frac{f''(a)+f''(b)}{2^3}(b-a)^3+\cdots$$
My question is, the two estimations are different. Which one is correct?
 [/INST] Remarkably, they appear to both be correct. I have checked the following integrals using both formulas: $$\int_0^{\pi/2}\sin x\,\mathrm{d}x=1,\;\;\int_0^{\pi/2}\cosh x\,\mathrm{d}x\approx 2.301,\;\;\int_a^{b}x^2\,\mathrm{d}x=\frac{b^3-a^3}{3},\;\;\int_a^{b}x^3\,\mathrm{d}x=\frac{b^4-a^4}{4}$$
 See for example 
Here and 
Here 
(scroll down to "Alternate forms") 
The first two were performed by a program in Python.
There does not appear to be any mistake in your argument, so I can only conclude that in fact they are equal to each other. Note that the second series converged much more rapidly in my approximations than did the first. Hopefully someone can provide a proof.
</s>