Suppose that we have n-th degree polynomial p(x)=a0+a1(x−a)+a2(x−a)2+…+an−1(x−a)n−1+an(x−a)n, where a,a0,a1,a2,…,an are constants.
Now, differentiate this polynomial n times:
p′(x)=a1+2⋅a2(x−a)+3⋅a3(x−a)2+…+(n−1)⋅an−1(x−a)n−2+n⋅an(x−a)n−1,
p′′(x)=1⋅2⋅a2+2⋅3⋅a3(x−a)+…+(n−2)(n−1)an−1(x−a)n−3+(n−1)nan(x−a)n−2,
p′′′(x)=1⋅2⋅3⋅a3+…+(n−3)(n−2)(n−1)an−1(x−a)n−4+(n−2)(n−1)nan(x−a)n−3,
…………………………
p(n)(x)=1⋅2⋅3⋅…⋅n⋅an.
If we now plug a instead of x in polynomial and all its derivatives we will obtain that
p(a)=a0, p′(a)=a1, p′′(a)=1⋅2⋅a2, p′′′(a)=1⋅2⋅3⋅a3, ..., p(n)(a)=1⋅2⋅3⋅…⋅n⋅an.
Since factorial of number is n!=1⋅2⋅3⋅…⋅n then
a0=p(a), a1=1!p′(a), a2=2!p′′(a), ..., an=n!p(n)(a).
If we now substitute expressions for constants into polynomial we will obtain Taylor Fomula.
Taylor Formula for Polynomials. Polynomialp(x)=p(a)+1!p′(a)(x−a)+2!p′′(a)(x−a)2+…+(n−1)!p(n−1)(a)(x−a)n−1+n!p(n)(a)(x−a)n. is called taylor polynomial at x=a.
With the help of Taylor formula we can write any polynomial in terms of (x−a).
Example 1. Write polynomial p(x)=x3+3x2−2x+1 in terms of (x−2).
Here a=2.
We have that p′(x)=3x2+6x−2, p′′(x)=6x+6, p′′′(x)=6. All higher-order derivatives will equal 0.
Now, p(2)=23+3⋅22−2⋅3+1=17, p′(2)=3⋅22+6⋅2−2=22, p′′(2)=6⋅2+6=18, p′′′(2)=6.
So,
p(x)=17+1!22(x−2)+2!18(x−2)2+3!6(x−2)3=17+22(x−2)+9(x−2)2+(x−2)3.
So, equivalently polynomial p(x)=x3+3x2−2x+1 can be written as p(x)=(x−2)3+9(x−2)2+22(x−2)+17.
Thus, Taylor formula for polynomials allows us to rewrite any polynomial in terms of (x−a).
Now, let's see how we can use this idea for any differentiable functions.
Suppose that function y=f(x) has finite derivatives up to n-th order at point a.
Taylor Formula for any Function. For function y=f(x) n-th degree Taylor polynomial at point x=a is Tn(x)=f(a)+1!f′(a)(x−a)+2!f′′(a)(x−a)2+…+(n−1)!f(n−1)(a)(x−a)n−1+n!f(n)(a)(x−a)n.
Of course, Tn(x)=f(x), but as appeared Tn(x) is a very good approximation for f(x) when x→a. And the higher n (order of polynomial) the better approximation.
Fact. Tn(x)≈f(x) as x→a.
This fact allows us to approximate function by polynomial near point x=a with any precision we want, by taking high degree polynomial.
Example 2. Find first, third and fifth degree polynomials for function f(x)=sin(x) near
x=0.
Here a=0.
To find fifth degree polynomial we need derivatives up to fifth order.
We have that f′(x)=cos(x), f′′(x)=−sin(x), f′′′(x)=−cos(x), f(4)(x)=sin(x), f(5)(x)=cos(x).
Now, f(0)=0, f′(0)=1, f′′(0)=0, f′′′(0)=−1, f(4)(0)=0, f(5)(0)=1.
First degree taylor polynomial is T1(x)=f(0)+1!f′(0)(x−0)=0+11x=x.
Third degree taylor polynomial is T3(x)=f(0)+1!f′(0)(x−0)+2!f′′(0)(x−0)2+3!f′′′(0)(x−0)3=0+11x+20x2+6−1x3=x−6x3.
Fifth degree taylor polynomial is T5(x)=f(0)+1!f′(0)(x−0)+2!f′′(0)(x−0)2+3!f′′′(0)(x−0)3+4!f(4)(0)(x−0)4+5!f(5)(0)(x−0)5=
=0+11x+20x2+6−1x3+4!0x4+1201x5=x−6x3+120x5.
So,
T1(x)=x, T3(x)=x−6x3, T5(x)=x−6x3+120x5.
Remember, the higher degree of polynomial, the better precision. Figure illustrates this. Note, that approximation good only near point of expansion, in this case a=0.