Saturday, June 17, 2023

Approximating sinx using Mclaurin polynomials

 

The Mclaurin polynomials allow to approximate a function. Let's use them to find approximations of sinx

Example

From the example in the blogpost "Finding Mclaurin polynomials", the Mclaurin polynomials for sinx are given by:







Solution










Let's estimate the error. The sixth Mclaurin polynomial is equal to the fifth Mclaurin polynomial : p₆(x) = p₅(x). Let's calculate a bound on R₆ (Π/8). Since the Taylor series is unique, the remainder is:






b) The remainder on the sixth Taylor polynomial is given by the formula:

┃Rₙ(x)│≤ M/(n+1)!❘│x│⁷

Substituting the letters by their value:

0.0001 ≤ 1/7! │x│⁷

Solving this inequality we find

│x│≤ 0.907



Wednesday, June 14, 2023

Taylor's theorem with remainder

 Objectives:

1. Use Taylor polynomial to approximate a function and its value

b. Estimate the remainder of a Taylor series approximation of a given function

The interesting thing about representing a function by different Taylor polynomials is that these Taylor polynomials represent an approximation of the given function. The Taylor polynomial representation of a function allows also approximate the values of a function. The Taylor theorem with remainder allows to estimate the remainder of the Taylor series approximation of a given function. 

Taylor theorem with remainder












Example








Solution












The function and the Taylor polynomials are shown here:

























Practice



Saturday, June 10, 2023

Finding Mclaurin polynomials

 Example












Solution



























The graph of the function f and the first three polynomials are shown here:















We also have f⁵(x) = cosx and f⁵(0) =1
Let's find the first 3 Taylor polynomials and the 2 next subsequent ones in order to find a pattern allowing to find a formula for the nth Taylor polynomial.


















We see here a pattern where p₁ = p₂,  p₃ = p₄ and p₅ = p₆. The Taylor polynomial of odd subscript is equal to the subsequent Taylor polynomial with even subscript.. If we call 2m+1 the odd subscript and 2m+2 the even subscript, we have p₂ₘ₊₁(x) = p₂ₘ₊₂(x) and:














The graphs of the function and its Mclaurin polynomials are shown here:





















f⁵(0) = 0
Let's calculate the first 3 polynomials and the 2 subsequent ones in order to find a pattern that allows to write a formula for the nth Taylor polynomial.




























Graph of the function and the Mclaurin polynomials:



Wednesday, June 7, 2023

Taylor and Maclaurin series

 Objective: Describe the procedure for finding a Taylor polynomial of a given order for a function

Introduction

Previously we discussed how to find power series representations for functions related to geometric series. Now we are interested in finding power series related to other types of functions. We address the following questions:

Which functions can be represented by power series and how do we find these representations?

If we can find a power series representation for a function f and that series converges on an interval I, how do we we prove that series actually converges to f.

Overview of Taylor and Mclaurin series 

Let's consider a function f represented by a power series at x = a. The series has the following form:






Let's determine the coefficients: c₀, c₁, c₂. Let's determine the series representation of the function f at x = a. Then the series is equal to f(a) at x = a. Let's substitute the left side by f(a) and x by a in the second side. We have: f(a) = c₀ + c₁(0-0) + c₂(0-0) + .... Then f(a) = c₀.

Let's determine the series representation of the derivative of f' at x = a. Let's first determine the derivative of f:

 


 


The series representation of f' at x = a is equal to f'(a). Let's substitute the left side by f'(a) and x by a in the right side:

f'(a) = c₁ + 2c₂.(0-0) + 3c₃(x-0)²

f'(a) = c₁

Let's determine the series representation of the second derivative of f at x = a.  Let's first determine the second derivative of f;





Let's substitute the left side by f"(a) and x by a in the right side:

f"(a) = 2c₂

c₂ = f"(a)/2

In order to determine c₃, let's determine the third derivative of f at x = a. As we know the third derivative of f has to be determined first.





Substituting the left side by f'''(a) and x by a in the right side, we have:

f'''(a) = 3.2c₃

c₃ = f'''(a)/3.2

More generally we see that if a function f has a power series representation at x = a the coefficients are given by cₙ = fⁿ(a)/n!

By substituting the coefficients in the power series representation of, we have:



This power series for f is known as the Taylor series for f a x = a. If x = 0, the series is called the series of Mclaurin of f at x = 0

Definition





Uniqueness of  the Taylor series

If a function f has a power series at a that converges to f, that series is the Taylor series of the function f at a..

Taylor polynomials

The nth partial sum of a Taylor series of a function f at a is called the nth Taylor polynomial. For example, the 0th, 1st, 2nd, 3rd Taylor polynomial of the Taylor series of the function f at a is given by:





Definition






Example





Solution

The formulas for finding the Taylor polynomials p₀, p₁, p₂, p₃ are given by:



Here a = 1. We need to find f(1), f'(1), f"(1), f"'(1) in order to find the Taylor polynomials. The function f(x) and its first, second and third derivative will allow us to find those values.













The graph of f(x) and its first three polynomials are given by:







Practice