Statistics How To

How to use Taylor Polynomials to Approximate a Function

Calculus >

Taylor polynomials can be used to approximate a function around any value for a differentiable function. Taylor polynomials look a little ugly, but if you break them down into small steps, it’s actually a fast way to approximate a function.

Taylor polynomials can be used to approximate any differentiable function.

Taylor polynomials can be used to approximate any differentiable function.




Sample problem: Use Taylor polynomials to approximate the function cos(x) around the point x=2.
Step 1: Evaluate the function for the first part of the Taylor polynomial:
taylor-approximation-1
p(x) = f(c) o! = cos(2)

Step 2: Evaluate the function for the second part of the Taylor polynomial (adding it to the first part from Step 1):
taylor-approximation-11
p(x) = cos(2) + f'(c) 1!(x-c) = cos(2) – sin(2)(x-2)

Step 3: Evaluate the function for the third part of the Taylor polynomial (adding it to the first and second parts from Step 2):
taylor-approximation-12
p(x) = cos(2) – sin(2)(x-2) + f”(c)2!(x-c)2 = cos(2) – sin(2)(x-2) – cos(2) 2(x-2)2
Step 4: Evaluate the function for the fourth part of the Taylor polynomial (adding it to the first, second and third parts from Step 3):
taylor-approximation-13-1024x122
p(x) = cos(2) – sin(2)(x-2) + f”'(c)3!(x-c)3 = cos(2) – sin(2)(x-2) – cos(2) 2(x-2)2sin(2)6 (x-2)3

Step 5: Continue evaluating more pieces of the Taylor polynomial, graphing the function periodically to see how well it represents your polynomial.

 Graph of the Taylor approximation for cos(x) near x=2 after four iterations.

Graph of the Taylor approximation for cos(x) near x=2 after four iterations.




Tip: Technically, you could go on forever with iterations of the Taylor polynomial, but usually five or six iterations is sufficient for a good approximation

------------------------------------------------------------------------------

If you prefer an online interactive environment to learn R and statistics, this free R Tutorial by Datacamp is a great way to get started. If you're are somewhat comfortable with R and are interested in going deeper into Statistics, try this Statistics with R track.

Comments are now closed for this post. Need help or want to post a correction? Please post a comment on our Facebook page and I'll do my best to help!
How to use Taylor Polynomials to Approximate a Function was last modified: October 12th, 2017 by Stephanie Glen