I am working through the proof of taylor's theorem going from this step:

$\displaystyle f(a)+f'(a)(x-a)+\int_{a}^{x}(x-t)f''(t)dt$

to this step:

$\displaystyle f(a)+f'(a)(x-a)+\frac{1}{2}(x-a)^2f''(a)+\frac{1}{2}\int_{a}^{x}(x-t)^2f'''(t)dt$

for the integral in the first equation I have

$\displaystyle u=f''(t), u'=f'''(t)$

$\displaystyle v=-\frac{1}{2}(x-t)^2+\frac{x^2}{2}, v'=(x-t)dt$

so for uv I get the 0.5*(x-a)^2*f''(a) just fine.

but for integral of u'v I get:

$\displaystyle \frac{1}{2}\int_{a}^{x}(x-t)^2f'''(t) + \frac{x^2}{2} dt$

and if i integrate and evaluate the extra $\displaystyle \frac{x^2}{2}$ term, it does not seem to help.

Which step/s are incorrect?