3.25.2008

Taylor Approximations


Taylor approximations are an amazing thing--they allow you to approximate the value of a transcendental function by creating a polynomial function similar enough to gain a value. This comes in handy when left without a scientific or graphing calculator. These approximations can be done with a simple calculator. In this example, you will see how to approximate values of ƒ(x)=ln x using a Taylor approximation, although the method shown can be used with any function.

*Note: A basic understanding of calculus is required (finding derivatives), as well as logarithms and factorials.

Step 1:
Choose a center (c) for and decide the degree (n) of the polynomial function you wish to create. Note that the farther you travel from your center, the less accurate the approximation. Also, the higher the degree, the higher the accuracy will be. The center for this example is x=1, and the degree will be 5.

Step 2:
Use Taylor's formula to create the basic equation for the polynomial. The following is Taylor's formula:
Pn(x) = ƒ(c) + ƒ'(c)·(x-c) + ƒ''(c)/2!·(x-c)² + ƒ'''(c)/3!·(x-c)³ + … + ƒn(c)/n!·(x-c)n + …

So, the fifth-degree formula would be:
P5(x) = ƒ(c) + ƒ'(c)·(x-c) + ƒ''(c)/2!·(x-c)² + ƒ'''(c)/3!·(x-c)³ + ƒ''''(c)/4!·(x-c)4 + ƒ'''''(c)/5!·(x-c)5

Step 3:
Begin defining the terms to place back into the basic equation. First, you must find ƒ(c):
ƒ(c) = ƒ(1) = ln 1 = 0

Step 4:
Find ƒ'(c). Taking the derivative of ƒ(x)=ln x yields
ƒ'(x) = 1/x, therefore ƒ'(c) = ƒ'(1) = 1/1, or 1

Step 5:
Find ƒ''(c). Taking the derivative of ƒ'(x) = 1/x yields
ƒ''(x) = -1/x², therefore ƒ''(c) = ƒ''(1) = -1/1², or -1

Step 6:
Find ƒ'''(c). Taking the derivative of ƒ''(x) = -1/x² yields
ƒ'''(x) = 2/x³, therefore ƒ'''(c) = ƒ'''(1) = 2/1³, or 2

Step 7:
Find ƒ''''(c). Taking the derivative of ƒ'''(x) = 2/x³ yields
ƒ''''(x) = -6/x4, therefore ƒ''''(c) = ƒ''''(1) = -6/14, or -6

Step 8:
Find ƒ'''''(c). Taking the derivative of ƒ''''(x) = -6/x4 yields
ƒ'''''(x) = 24/x5, therefore ƒ'''''(c) = ƒ'''''(1) = 24/15, or 24

Step 9:
Substitute the values gained in Steps 3-8 into the fifth-degree polynomial equation attained in Step 2:
P5(x) = 0 + 1(x-1) + -1/2!·(x-1)² + 2/3!·(x-1)³ + -6/4!(x-1)4 + 24/5!·(x-1)5

Step 10:
Simplify the equation:
P5(x) = -1 + x - 1/2·(x-1)² + 1/3·(x-1)³ - 1/4·(x-1)4 + 1/5·(x-1)5

Step 11:
Choose the value(s) of x that you wish to approximate. Again, the closer to the center (c), the more accurate the approximation will be. For this example we will choose 2, because ƒ(2) = ln x is not easily done without the aid of a scientific or higher calculator.

Step 12:
Insert the chosen value into the equation from Step 10:
P5(2) = -1 + 2 - 1/2·(2-1)² + 1/3·(2-1)³ - 1/4·(2-1)4 + 1/5·(2-1)5

Step 13:
Simplify.
P5(2) = -1 + 2 - 1/2 + 1/3 - 1/4 + 1/5

Step 14:
Using a simple calculator, you can obtain approximate decimal values for the fractions, getting the following:
P5(2) = -1 + 2 - 0.5 + 0.6667 - 0.25 + 0.2



Step 15:
Simplify:
P5(2) = -1 + 2 - 0.5 + 0.6667 - .25 + 0.2 ≈ 1.1167


Step 16:
Verify your answer with a properly equipped calculator or by a logarithm chart. The true value of ƒ(2)= ln x ≈ 0.6931471806


Step 17:
To demonstrate the higher degree of accuracy with a higher degree function, we will now create a polynomial of degree 10, using the same center (c), and testing again at P(2). The basic equation, based on Taylor's model, looks like this:
P10(x) = ƒ(c) + ƒ'(c)·(x-c) + ƒ''(c)/2!·(x-c)² + ƒ'''(c)/3!·(x-c)³ + ƒ''''(c)/4!·(x-c)4 + ƒ'''''(c)/5!·(x-c)5 + ƒ6(c)/6!·(x-c)6 + ƒ7(c)/7!·(x-c)7 + ƒ8(c)/8!·(x-c)8 + ƒ9(c)/9!·(x-c)9 + ƒ10(c)/10!·(x-c)10

Step 18:
Find the values necessary to complete this equation. The fifth-degree polynomial established a pattern, shown by the following:
For ƒ(x) = ln x, Pn(x) = (x-1)¹ - 1/2·(x-1)² + … + 1/n·(-1)n+1(x-1)n + …
Using this, the tenth-degree polynomial equation will be:
P10(x) = -1 + x - 1/2·(x-1)² + 1/3·(x-1)³ - 1/4·(x-1)4 + 1/5·(x-1)5 - 1/6·(x-1)6 + 1/7·(x-1)7 - 1/8·(x-1)8 + 1/9·(x-1)9 - 1/10·(x-1)10

Step 19:
Find P10(2).
P10(2) = -1 + 2 - 1/2·(2-1)² + 1/3·(2-1)³ - 1/4·(2-1)4 + 1/5·(2-1)5 - 1/6·(2-1)6 + 1/7·(2-1)7 - 1/8·(2-1)8 + 1/9·(2-1)9 - 1/10·(2-1)10

Step 20:
Simplify.
P10(2) = -1 + 2 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + 1/7 - 1/8 + 1/9 - 1/10

Step 21:
Again using only a simple calculator, you can obtain values for the fractions and generate a value.
P10(2) = -1 + 2 - 0.5 + 0.6667 - 0.25 + 0.2 - 0.16667 + 0.142857 - 0.125 - 0.1111 + 0.1 ≈ 0.957646
Note that the new value using P10(x) is much closer to the true value of ln 2 than P5.

Step 22:
To demonstrate the higher degree of accuracy when using numbers closer to the center (c), we will evaluate P5(1.1) and P10(1.1). Beginning with p5(1.1), you get:
P5(1.1) = -1 + 1.1 - 1/2·(1.1-1)² + 1/3·(1.1-1)³ - 1/4·(1.1-1)4 + 1/5·(1.1-1)5

Step 23:
Simplify:
P5(1.1) = -1 + 1.1 - (0.5)(0.01) + (0.6667)(0.01) - (0.25)(0.01) + (0.2)(0.01) ≈ 0.0978333

Step 24:
Using a scientific of higher calculator, you can discover that ln (1.1) ≈ 0.0953101798

Step 25:
Evaluate P10(1.1):
P10(2) = -1 + 1.1 - 1/2·(1.1-1)² + 1/3·(1.1-1)³ - 1/4·(1.1-1)4 + 1/5·(1.1-1)5 - 1/6·(1.1-1)6 + 1/7·(1.1-1)7 - 1/8·(1.1-1)8 + 1/9·(1.1-1)9 - 1/10·(1.1-1)10

Step 26:
Simplify.
P10(1.1) = -1 + 1.1 - (0.5)(0.01) + (0.6667)(0.01) - (0.25)(0.01) + (0.2)(0.01) - (0.16667)(0.01) + (0.142857)(0.01) - (0.125)(0.01) + (0.1111)(0.01) - (0.1)(0.01) ≈ 0.09896
This value is slightly closer than the value obtained using P5(x).

Step 27:
Creating a chart using all the values gained can show the correlation between the variables of accuracy:
x21.1
ln x0.69314718060.0951310798
P5(x)1.11670.0978333
P10(x)0.9576460.09896