Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute the Taylor polynomial of a given order of a function of one or several variables
ResourceFunction["TaylorPolynomial"][f,{x,x0,n}] computes the Taylor polynomial of the function f of a single variable about the point x0 of degree n. | |
ResourceFunction["TaylorPolynomial"][f,{x,y,…},{x0,y0,…},n] computes the Taylor polynomial of the function f of several variables about the point (x0,y0,…) of degree n. |
A simple example:
In[1]:= |
Out[1]= |
It returns the same result as:
In[2]:= |
Out[2]= |
An example of a Taylor polynomial of a function of three variables:
In[3]:= |
Out[3]= |
Compare with Mathematica's Series command. The two commands treat the expansion differently; TaylorPolynomial expands to a total degree of each term, while Series expands in each variable separately:
In[4]:= |
Out[4]= |
Here is the difference between the two commands:
In[5]:= |
Out[5]= |
The Taylor polynomial of a function of two variables:
In[6]:= |
Out[6]= |
Plot the function together with its fifth degree Taylor polynomial:
In[7]:= |
Out[7]= |
The Taylor polynomial of a function with a removable singularity at the origin:
In[8]:= |
Out[10]= |
This can be obtained by making a simple substitution in a univariate function:
In[11]:= |
Out[11]= |
The Taylor polynomial of degree 2 for a symbolic function centered at (a,b):
In[12]:= |
Out[13]= |
An infinitely differentiable function of one variable that is not the zero function but all of whose Taylor polynomials are 0:
In[14]:= |
Out[16]= |
Without using limits:
In[17]:= |
Out[19]= |
An infinitely differentiable function of two variables that is not the zero function but all of whose Taylor polynomials are 0:
In[20]:= |
Out[22]= |
Without using limits:
In[23]:= |
Out[24]= |
This work is licensed under a Creative Commons Attribution 4.0 International License