Let’s briefly explain what Taylor’s formula is.
Taylor formula, also called Taylor expansion. It is a formula that uses information about a function at a certain point to describe its nearby values. If the function is smooth enough, and the derivative values of each order of the function at a certain point are known, Taylor's formula can use these derivative values as coefficients to construct a polynomial approximation function to find the value in the neighborhood of this point.
So what does Taylor's formula do?
Simply put, it is to use a polynomial function to approximate a given function (that is, try to fit the polynomial function image to the given function image). Note that the approximation must be expanded from a certain point on the function image. If you want to find the value of a certain point of a very complex function, but it cannot be achieved directly, you can use Taylor's formula to approximate the value. This is one of the applications of Taylor's formula. Taylor's formula is mainly used in gradient iteration in machine learning.
***********************************************************************************************************************************
***********************************************************************************************************************************
1. Raising the question
Polynomials are the simplest class of elementary functions. Regarding polynomials, since its own operations are only addition, subtraction and multiplication of finite terms, polynomials are a tool that people are happy to use in terms of numerical calculations. Therefore we often use polynomials to approximate functions. This is why Taylor's formula chooses a polynomial function to approximate a given function.
***********************************************************************************************************************************
***********************************************************************************************************************************
2. Examples of approximate calculations
Elementary mathematics has learned some important properties of some functions such as:, but elementary mathematics has not answered how to calculate them. Take the approximate calculation of f(x) = as an example:
①. First order (linear) approximation
Using the differential approximate calculation formula f(x) f( ) + ( )(x - ) (this formula is converted from the derivative/differential limit expression formula), the linear approximation of f(x) near = 0 is: f( x) f(0) + (0) x , so f(x) = 1, so the linear approximation function ( x) = 1 of f( x) near = 0, as shown below:
Advantages of linear approximation: simple form and convenient calculation; disadvantage: the further away from the origin O, the worse the approximation.
②. Quadratic approximation
Quadratic polynomial approximation f(x) = , we expect:
= = = 1 = (that is, it is expected that the function values of the approximating function and the given function at x = 0 are equal);
= = = 0 = (that is, it is expected that the slope of the approximating function at x = 0 is equal to the slope of the given function);
= = = -1, so = (that is, it is expected that the curvature of the approximating function at x = 0 is equal to the curvature of the given function);
So = 1 - , as shown below:
The quadratic approximation is much better than the linear approximation, but it is limited to [ , ], and outside this range, the images are obviously very different. Why do we expect that the function values, first derivative values, and second derivative values of two functions at a certain point are equal? Because these values express the most basic and main properties of the function (image), the approximation of these properties can make the two functions approximate (it can be seen intuitively from the function image above)
③. Eight times of approximation
Using an octave polynomial approximation f(x) = , we expect:
, find out (that is, it is expected that the function value of the approximating function at x = 0 is equal to the function value of the given function);
, find out (that is, it is expected that the slope of the approximating function at x = 0 is equal to the slope of the given function);
.... .... ....
, find out (that is, it is expected that the curvature of the approximating function at x = 0 is equal to the curvature of the given function);
So , as shown below:
(green image) is closer to the cosine function (red image) over a larger range than (blue image)
It can be seen from the above three different degrees of function approximation: when the accuracy requirements are high and the error needs to be estimated, high-order polynomials must be used to approximate the expression function, and the error formula must be given.
The above is a process of using polynomial functions to approximate a given function.
*****************************************************************************************************************************************
*****************************************************************************************************************************************
3. Derivation of Taylor’s formula
This leads to a question: given a function , find a polynomial function that is close to the specified point near the specified point , which is recorded as:
Make and make both errors estimable. So what conditions should the polynomial you are looking for satisfy, and what is the error?
Geometrically, , represents two curves, as shown below:
Keeping them close together makes it obvious:
1. First, the two curves are required to intersect at a point , that is
2. If you want to get closer, it is also required that the two curves are tangent at a point . (It can be seen intuitively from the image that the intersection [brown and red image] and tangency [green and red image], the two curves are close to each other nearby. Obviously the difference is very large, and the tangency is closer), that is
3. If you want to get closer, you also need the curves to bend in the same direction at points (as shown in the figure above, the bending directions are opposite [green and red images]; the bending directions are the same [blue and red images], obviously at points far away place, the difference between the two functions with the same bending direction is smaller), that is , it can be further inferred: if there is , nearby , the approximation is getting better and better.
To sum up, the polynomial you are looking for should meet the following conditions:
Explain how the above conversion is done, taking the second-order derivative in the third line above as an example:
Transformation of the first arrow: After finding the second derivative function , bring it in to get
Transformation of the second arrow: so , so
The coefficients in the polynomial function can all be expressed by, then we get:
The error is . Because a polynomial function is used to infinitely approximate a given function, there must be a small amount of error between the two.
****************************************************************************************************************************************
****************************************************************************************************************************************
4. Definition of Taylor’s formula
So we get the definition of Taylor's formula:
If a function has derivatives up to order in some open interval containing , then for
The remainder (i.e. error) is between x and x. There are several ways to express the remainder of Taylor's formula. The previous table is called the Lagrangian remainder of the nth-order Taylor expansion. The Lagrangian remainder is the n-order Taylor formula expanded to one more order, and n becomes n+1. Note that the remainder here is the error, because if you use a polynomial function to expand at a certain point and approximate a given function, there will definitely be a small amount of error in the end, which we call the remainder.
****************************************************************************************************************************************
****************************************************************************************************************************************
5. Extension – Maclaurin’s formula
It is a special case of Taylor's formula: the Taylor formula at that time . So putting it into the formula, we get:
Maclaurin's formulas with Peano remainders for several common elementary functions:
The higher order infinitesimal of the Peano remainder is :
Let’s briefly explain what Taylor’s formula is.
Taylor formula, also called Taylor expansion. It is a formula that uses information about a function at a certain point to describe its nearby values. If the function is smooth enough, and the derivative values of each order of the function at a certain point are known, Taylor's formula can use these derivative values as coefficients to construct a polynomial approximation function to find the value in the neighborhood of this point.
So what does Taylor's formula do?
Simply put, it is to use a polynomial function to approximate a given function (that is, try to fit the polynomial function image to the given function image). Note that the approximation must be expanded from a certain point on the function image. If you want to find the value of a certain point of a very complex function, but it cannot be achieved directly, you can use Taylor's formula to approximate the value. This is one of the applications of Taylor's formula. Taylor's formula is mainly used in gradient iteration in machine learning.
***********************************************************************************************************************************
***********************************************************************************************************************************
1. Raising the question
Polynomials are the simplest class of elementary functions. Regarding polynomials, since its own operations are only addition, subtraction and multiplication of finite terms, polynomials are a tool that people are happy to use in terms of numerical calculations. Therefore we often use polynomials to approximate functions. This is why Taylor's formula chooses a polynomial function to approximate a given function.
***********************************************************************************************************************************
***********************************************************************************************************************************
2. Examples of approximate calculations
Elementary mathematics has learned some important properties of some functions such as:, but elementary mathematics has not answered how to calculate them. Take the approximate calculation of f(x) = as an example:
①. First order (linear) approximation
Using the differential approximate calculation formula f(x) f( ) + ( )(x - ) (this formula is converted from the derivative/differential limit expression formula), the linear approximation of f(x) near = 0 is: f( x) f(0) + (0) x , so f(x) = 1, so the linear approximation function ( x) = 1 of f( x) near = 0, as shown below:
Advantages of linear approximation: simple form and convenient calculation; disadvantage: the further away from the origin O, the worse the approximation.
②. Quadratic approximation
Quadratic polynomial approximation f(x) = , we expect:
= = = 1 = (that is, it is expected that the function values of the approximating function and the given function at x = 0 are equal);
= = = 0 = (that is, it is expected that the slope of the approximating function at x = 0 is equal to the slope of the given function);
= = = -1, so = (that is, it is expected that the curvature of the approximating function at x = 0 is equal to the curvature of the given function);
So = 1 - , as shown below:
The quadratic approximation is much better than the linear approximation, but it is limited to [ , ], and outside this range, the images are obviously very different. Why do we expect that the function values, first derivative values, and second derivative values of two functions at a certain point are equal? Because these values express the most basic and main properties of the function (image), the approximation of these properties can make the two functions approximate (it can be seen intuitively from the function image above)
③. Eight times of approximation
Using an octave polynomial approximation f(x) = , we expect:
, find out (that is, it is expected that the function value of the approximating function at x = 0 is equal to the function value of the given function);
, find out (that is, it is expected that the slope of the approximating function at x = 0 is equal to the slope of the given function);
.... .... ....
, find out (that is, it is expected that the curvature of the approximating function at x = 0 is equal to the curvature of the given function);
So , as shown below:
(green image) is closer to the cosine function (red image) over a larger range than (blue image)
It can be seen from the above three different degrees of function approximation: when the accuracy requirements are high and the error needs to be estimated, high-order polynomials must be used to approximate the expression function, and the error formula must be given.
The above is a process of using polynomial functions to approximate a given function.
*****************************************************************************************************************************************
*****************************************************************************************************************************************
3. Derivation of Taylor’s formula
This leads to a question: given a function , find a polynomial function that is close to the specified point near the specified point , which is recorded as:
Make and make both errors estimable. So what conditions should the polynomial you are looking for satisfy, and what is the error?
Geometrically, , represents two curves, as shown below:
Keeping them close together makes it obvious:
1. First, the two curves are required to intersect at a point , that is
2. If you want to get closer, it is also required that the two curves are tangent at a point . (It can be seen intuitively from the image that the intersection [brown and red image] and tangency [green and red image], the two curves are close to each other nearby. Obviously the difference is very large, and the tangency is closer), that is
3. If you want to get closer, you also need the curves to bend in the same direction at points (as shown in the figure above, the bending directions are opposite [green and red images]; the bending directions are the same [blue and red images], obviously at points far away place, the difference between the two functions with the same bending direction is smaller), that is , it can be further inferred: if there is , nearby , the approximation is getting better and better.
To sum up, the polynomial you are looking for should meet the following conditions:
Explain how the above conversion is done, taking the second-order derivative in the third line above as an example:
Transformation of the first arrow: After finding the second derivative function , bring it in to get
Transformation of the second arrow: so , so
The coefficients in the polynomial function can all be expressed by, then we get:
The error is . Because a polynomial function is used to infinitely approximate a given function, there must be a small amount of error between the two.
****************************************************************************************************************************************
****************************************************************************************************************************************
4. Definition of Taylor’s formula
So we get the definition of Taylor's formula:
If a function has derivatives up to order in some open interval containing , then for
The remainder (i.e. error) is between x and x. There are several ways to express the remainder of Taylor's formula. The previous table is called the Lagrangian remainder of the nth-order Taylor expansion. The Lagrangian remainder is the n-order Taylor formula expanded to one more order, and n becomes n+1. Note that the remainder here is the error, because if you use a polynomial function to expand at a certain point and approximate a given function, there will definitely be a small amount of error in the end, which we call the remainder.
****************************************************************************************************************************************
****************************************************************************************************************************************
5. Extension – Maclaurin’s formula
It is a special case of Taylor's formula: the Taylor formula at that time . So putting it into the formula, we get:
Maclaurin's formulas with Peano remainders for several common elementary functions:
The higher order infinitesimal of the Peano remainder is :