Function Repository Resource:

RecognizeSeries

Source Notebook

Recognize functions by their power series expansions

Contributed by: Sam Blake & Michael Sollami

ResourceFunction["RecognizeSeries"][series]

attemps to find a function that generates the given power series.

Details

ResourceFunction["RecognizeSeries"] attempts to match a given series by guessing the center and greedily searching though a library of function templates.

Examples

Basic Examples (5) 

Recognize power series:

In[1]:=
ser = Series[Exp[4 x - \[Pi]], {x, 0, 10}]
Out[1]=
In[2]:=
ResourceFunction["RecognizeSeries"][ser]
Out[2]=

Recognize partial sums of series expansions:

In[3]:=
ResourceFunction["RecognizeSeries"][
SeriesData[x, 0, {1, 0, 
Rational[-1, 2], 0, 
Rational[1, 24], 0, 
Rational[-1, 720], 0, 
Rational[1, 40320], 0, 
Rational[-1, 3628800]}, 0, 11, 1]]
Out[3]=

In[4]:=
s = Series[Sin[2 x]/\[Pi], {x, 0, 5}]
Out[4]=
In[5]:=
ResourceFunction["RecognizeSeries"]@s // AbsoluteTiming
Out[5]=

Recognize products of functions:

In[6]:=
Series[Sin[x] Exp[4 x], {x, 0, 5}]
Out[6]=
In[7]:=
ResourceFunction["RecognizeSeries"][%]
Out[7]=
In[8]:=
Series[2 Sin[Sqrt[3] x] Cos[Sqrt[5] x], {x, 0, 4}]
Out[8]=
In[9]:=
ResourceFunction["RecognizeSeries"][%]
Out[9]=

Recognize sums and differences:

In[10]:=
ResourceFunction["RecognizeSeries"]@
 Series[2 Sin[x] + Cos[x], {x, 0, 7}]
Out[10]=
In[11]:=
Series[Sin[x] - 3 Cosh[x], {x, 0, 7}]
Out[11]=
In[12]:=
ResourceFunction["RecognizeSeries"][%] // Timing
Out[12]=

Possible Issues (2) 

More complicated functions take longer:

In[13]:=
ResourceFunction["RecognizeSeries"][
  Series[3 + Exp[6 x - 2], {x, 0, 5}]] // AbsoluteTiming
Out[13]=

RecognizeSeries may return generators in unsimplified forms:

In[14]:=
ResourceFunction["RecognizeSeries"]@
  Series[3 Sin[x] + Cos[x], {x, 0, 7}] // AbsoluteTiming
Out[14]=
In[15]:=
%[[2]] // ExpToTrig // FullSimplify
Out[15]=

Publisher

Michael Sollami

Version History

  • 1.0.0 – 03 February 2021

Related Resources

License Information