# Remainder term in Taylor's theorem

I'm trying to understand the remainder in Taylor's theorem from this source: https://proofwiki.org/wiki/Taylor%27s_Theorem/One_Variable/Integral_Version

I don't understand the very last parts of the proof (the parts where the remainder $R_n$ is solved). Can someone explain why does it follow from:

$$\frac{f^{(n+1)}(a)}{(n+1)!}(x-a)^{n+1}+\int_a^x \frac{f^{(n+2)}(t)}{(n+1)!}(x-t)^{n+1} \;dt$$

that $$R_N = \frac{f^{(n+1)}(\xi)}{(n+1)!}(x-a)^{n+1}?$$

I think the changing between letters $a$ and $\xi$ confuses me...?

We use this result: there's $c\in(a,b)$ such that
$$\int_a^b f(x)g(x)dx=f(c)\int_a^b g(x)dx$$ so in our case we have
$$\int_a^x\frac{f^{(n+1)}(t)}{n!}(x-t)^ndt=f^{(n+1)}(\xi)\int_a^x\frac{(x-t)^n}{n!}dt=f^{(n+1)}(\xi)\frac{(x-a)^{n+1}}{(n+1)!}=:R_n$$