116. Taylor Series

Taylor Series (Expansion)

Taylor polynomial

Approximate a complicated function near a point 𝑎 by a polynomial made from the function’s derivatives at that point

𝑓(𝑥)=∑𝑛=0∞𝑓(𝑛)(𝑎)𝑛!(𝑥−𝑎)𝑛𝑓(𝑥)=𝑓(𝑥0)⏟∗+𝑓′(𝑥0)(𝑥−𝑥0)⏟∗∗+12!𝑓″(𝑎)(𝑥−𝑎)⏟∗∗∗+…+1𝑛!𝑓(𝑛)(𝑥0)(𝑥−𝑎),

Where:

Where:

Example

Setup

𝑓(𝑥)=𝑥2

Expand it around the point 𝑎=1

Step 1: Compute Derivatives

  • 𝑓(𝑥)=𝑥2

  • 𝑓′(𝑥)=2𝑥

  • 𝑓″(𝑥)=2

Step 2: Evaluate at 𝑥=1

  • 𝑓(1)=12=1

  • 𝑓′(1)=2⋅1=2

  • 𝑓″(1)=2

Step 3: Write the Taylor expansion

𝑓(𝑥)=𝑓(1)+𝑓′(1)(𝑥−1)+𝑓″(1)2!(𝑥−1)2=1+2(𝑥−1)+22(𝑥−1)2=1+2(𝑥−1)+(𝑥−1)2

Step 3: Expand

1+2(𝑥−1)+(𝑥−1)2=1+2𝑥−2+𝑥2+1=𝑥2

It gives back the original function exactly

Example