# 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?

• In the first two integrals, you're Taylor expanding about $a$ first and then expanding about $b$. Then, you're again saying that $\int^b_af(x)dx$ is the average of these two integrals - that part doesn't make sense to me. Could you justify?
– user122283
Apr 16, 2014 at 0:05
• After "Therefore" should it be $f'(a)+f'(b)$ in the numerator of the second term on the right of the equality? And similarly about the minus sign in front of the second term in the last line of the mass following "Then"?
– user142299
Apr 16, 2014 at 0:10
• Check the various methods to compute integrals numerically, there is quite a remarkable body of theory there. Apr 16, 2014 at 0:24
• Disregard my comment I was mistaken... I think I see what happened though I'll post an answer if I figure this out.
– user142299
Apr 16, 2014 at 0:29
• Wow this is undoubtedly the best question I have seen in a long time - wish I could upvote.
– user142299
Apr 16, 2014 at 0:37

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