We now use integration by parts to determine just how good of an approximation is given by the Taylor polynomial of degree n, pn(x). By the fundamental theorem of calculus,

f (b) - f (a) = f'(t)dt    

Integrating by parts, choosing - (b - t) as the antiderivative of 1, we have

f'(t)dt=- f'(t)(b - t)|ab + f(2)(t)(b - t)dt  
 =f'(a)(b - a) + f(2)(t)(b - t)dt  

Again, integrating by parts yields

f(2)(t)(b - t)dt= - f(2)(t) + f(3)(t)dt  
 =f(2)(a) + f(3)(t)dt  

Putting these equations together, we have

f (b) = f (a) + f'(a)(b - a) + f(2)(a) + f(3)(t)dt    

Continuing the process, we arrive at

f (b) = f (a) + f'(a)(b - a) + ... + f(n-1)(a) + f(n)(t)dt    

Substituting x for b, we have an expression for f (x), called Taylor's formula at x = a, involving the familiar Taylor polynomial of degree n - 1 for f and an integral called the remainder term and denoted by rn(x):

f (x)=f (a) + f'(a)(x - a) + ... + f(n-1)(a) + f(n)(t)dt  
 =pn-1(x) + rn(x)  

Therefore, in order to compute how close pn(x) is to f (x), we need to find the magnitude of the remainder term. Fortunately, there is a simpler way to express rn(x).

Letting x be fixed for a moment, choose numbers m and M in the interval [a, x] so that f (m) is the minimum value of f on the interval and f (M) the maximum value. Then for any t in [a, x],


The corresponding integrals must satisfy similar inequalities:




By the intermediate value theorem,


takes on all values between its minimum and maximum in the interval [a, x], so there exists some c in [a, x] such that

rn(x) = (x - a)n    

The expression on the right looks very much like the nth term of the Taylor polynomial--the only difference is that the derivative is evaluated at some number c in the interval [a, x] rather than at a.

Now that the remainder term is in a more manageable form, we can try to bound it. Suppose we have a bound, Bn, for the absolute value of the nth derivative of f on the interval [a, x]. That is,

| f(n)(c)|≤Bn    

for all c in [a, b]. Then we have the bound

| rn(x)|≤| x - a|n    

To conclude, we restate the results of this section in the case a = 0. The Taylor formula in this case reads

f (x) = f (0) + f'(0)x + ... + f(n-1)(0) + f(n)(t)dt    

with remainder term bounded by

| rn(x)|≤| x|n