The t=x endpoint vanishes because (x−x)k=0 and the penultimate line
uses the induction hypothesis Rk(x)=f(x)−Pk−1(x). Each induction step
removes one Taylor term, which proves the integral form for every n.
To obtain the Lagrange form, apply the mean value theorem for integrals to the continuous
function f(n+1) with the non-negative weight ∣x−t∣n between a and x.
Accounting for the orientation when x<a gives
∫axf(n+1)(t)(x−t)ndt=f(n+1)(c)(x−a)n+1/(n+1) for some intermediate c.
because the lower-order terms vanish. Since f(k+1) is continuous near a, it is
bounded on a smaller neighbourhood, so the remainder estimate gives
Rk+1(x)=O(∣x−a∣k+1) and hence
Rk+1(x)=o(∣x−a∣k). Therefore the first nonzero term determines
the sign of f(x)−f(a) sufficiently close to a.
When k is even, (x−a)k is positive on both sides of a, so the sign of
f(k)(a) determines a minimum or maximum. When k is odd, then k≥3 and the
same expansion applied to f′′ gives
f′′(x)=(k−2)!f(k)(a)(x−a)k−2+o(∣x−a∣k−2).
Since k−2 is odd, f′′ changes sign across a; together with f′(a)=0, this gives
a horizontal point of inflection.