# Determining a function from its series

If I have the function $e^x$, I know that Mathematica can expand it using

Series[Exp[x],{x,0,3}]


However, let's say that I have the function, $1+x+x^2/2+x^3/6$. Is there a way for me to input this function into Mathematica and have it tell me that it corresponds to the series of $e^x$?

If there is, can Mathematica do the same thing for more complicated series and tell me that it is, for example, a product of two different functions?

• Have you seen Sum[]? Aug 11, 2016 at 18:08
• It would have to recognise the pattern. This short sequence really isn't enough to say with certainty that it refers specifically to $\frac{x^n}{n!}$ Aug 11, 2016 at 18:14
• @J.M. Sum would work, but wouldn't I need to recognize the pattern first? For simple functions, this wouldn't be too bad, but when I work with more complicated functions in multiple variables, it could get tricky. Aug 11, 2016 at 18:19
• @Feyre If I had a longer sequence (maybe 100 or a 1000 terms), would Mathematica then recognize the pattern? Aug 11, 2016 at 18:20
• As Feyre notes, you should also realize that just because you know the first few terms of a (Taylor, Fourier, Laurent, Puiseux, etc.) series does not mean you can easily recover the original function that produced them. You have to have determined some pattern… in any event, FindSequenceFunction[] may be of interest. Aug 11, 2016 at 18:22

You need at least one more term for this specific example

expr = 1 + x + x^2/2 + x^3/6 + x^4/24;

seq = List @@ expr

(*  {1, x, x^2/2, x^3/6, x^4/24}  *)

t[n_] = FindSequenceFunction[seq, n]

(*  x^(-1 + n)/Pochhammer[1, -1 + n]  *)

Sum[t[n], {n, 1, Infinity}]

(*  E^x  *)