Function Repository Resource:

# TaylorPolynomial

Compute the Taylor polynomial of a given order of a function of one or several variables

Contributed by: Dennis M Schneider
 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.

## Details and Options

With some functions it is necessary to use limits to compute the terms of the series. For these functions, set the option "UseLimit" to True.

## Examples

### Basic Examples (4)

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]=

### Scope (3)

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]=

## Publisher

Dennis M Schneider

## Version History

• 1.0.0 – 15 August 2022