Wednesday, July 12, 2023

Convergence of a Taylor series

 If a Taylor series for a function f converges on some interval, how can we determine if that series converges to the function f?Let's remind that a series converges to a particular value if the sequence of its partial sums converges to that value. In order words, the limit of the general term of the partial sum is equal to that value. For a Taylor series of a function f at a, the nth partial sum is given by pn. To determine if the Taylor series converges to f, we need to demonstrate whether




Since the remainder Rn(x) = f(x)-pn(x), the Taylor series converges to f if and only if




Convergence of a Taylor series





To prove that a Taylor series for a function f at a converges to f, we need to prove Rn(x)→0. To do this we use the bound:








Example













Solution

a. The Mclaurin series for e^x is given by 





Let's use the ratio test to determine its convergence:





Let's take the limit:




Therefore the series converges absolutely for all x, and thus, the interval of convergence is (-∞, +∞). 
Let's use the formula for the remainder of a Taylor series:





Since a =0 (Mclaurin series), we have:

❘Rₙ❘≤(M/(n + 1)!❘)x❘ⁿ⁺¹

The exponential function is an increasing function. For any I = [-d.d], the maximum value for M is e^d or M = e^d. 

Substituting M, we have:

Rₙ❘≤ e^d/(n + 1)!❘)x❘ⁿ⁺¹

Taking the limit of both sides we have:










b. Let's prove that the Mclaurin series for sinx converges to sinx. 
The Mclaurin series for sinx is given by:







Let's prove that this series is convergent and determine its convergence.








Let's take the limit of both sides, we have:



 




Let's use the formula for the  Taylor series with remainder:






Since a = 0, we have:  ❘Rₙ❘≤(M/(n + 1)!❘)x❘ⁿ⁺¹. Let's find the maximum value for M. It represents the maximum value of the absolute value des n+1 derivatives of sinx. We have:







For any x or in any interval I = [-d, d], the maximum value for M is 1. Therefore we have:





Practice      


                                                                                                                                            

 








Thursday, July 6, 2023

Representing functions with Taylor and Mclaurin series

 In this post, I show how to find a Taylor series for a function and how to find its convergence.

Example





Solution

Instead of applying the general formula of Taylor series, let's say that the Taylor series is of the form 





We already know a =1. All we have to do is to determine fⁿ(a). In order to do that we determine first f'(1), f"(1). f'''(1) then f⁴(n):









The order number derivative is equal to the factorial of the number with the derivative changing sign alternatively. We can generalize by saying fⁿ(1) = (-1)ⁿ n!.

The Taylor series of f at x = 1 then is by substituting fⁿ(1):

 with n as exponent of x-1

To determine the interval convergence of the series, let's determine its convergence. Let's use the ratio test by starting to determine the ratio:



The limit of this ratio when n approaches infinity is equal to the limit of ❘x-1❘. This limit is equal to ❘x-1❘
The series is convergent if ❘x-1❘< 0 i.e to 0 <x<2.  Let's check the convergence of the series at the     endpoints i.e at x = 0 and x = 2.                                                                                                                    
 At x= 0 we have                                                                                                                                                                                        
                                                                                                                             


 Let's use the divergence test by calculating the limit of 1 when n approaches infinity. This limit is equal to 1. The series diverges since the limit is different of 0.                                                                          

At x = 2, we have:                                                                                                                              



The limit of (-1)ⁿ is probably unknown, therefore different of 0.                                         
The series         diverges when x = 2.  The interval of convergence is (0,2).

               Practice                                                                                                                                                                       


                                                                                                                                                     
                                                                                                                                  














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