# How can I represent a series with a summary?

As the title suggests, I'm trying to represent a series through a simple summation. For example, the function

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

obviously gives me the series expansion of the exponential function. I would now like to obtain from this representation in the form of a summation. Is it possible to do this with mathematica?

• Please give an example of what output you expect in this case. It is not clear what output you want to get. Jan 17, 2022 at 20:24

In v13.2, This can be easily achiveved with Asymptotic:

Asymptotic[Exp[x], {x, 0, ∞}]


If you insist on summing to 10, replace the ∞:

Asymptotic[Exp[x], {x, 0, ∞}] /. ∞ -> 10

Clear["Global*"]

sumRule =
Inactive[Series][f_, {x_, x0_, n_}] :>
Inactive[Sum][Assuming[{Element[k, Integers], k >= 0},
SeriesCoefficient[f, {x, x0, k}] (x-x0)^k //
FullSimplify],
{k, 0, n}];

n = 10;

f[x_] = Exp[x];

Inactive[Series][f[x], {x, 0, n}] /. sumRule


Verifying,

(% // Activate) == Normal[Series[f[x], {x, 0, n}]]

(* True *)

f[x_] = Sin[x];

Inactive[Series][f[x], {x, 0, n}] /. sumRule


Verifying,

(% // Activate) == Normal[Series[f[x], {x, 0, n}]]

(* True *)

• As always, that's very impressive.
– user49048
Jan 17, 2022 at 5:56

Is this what you were looking for?

SeriesCoefficient[Exp[x], {x, 10, n}]


And more generally

SeriesCoefficient[Exp[x], {x, n, n}]


This is one of those times when FindSequenceFunction works.

Make a list of the terms. Then let Mathematica find a function, $$f$$, that generates the coefficients. That is, $$f(k) = a_k$$, the Taylor series coefficients. We know that $$f(k)$$ should be $$1/k!$$, but we want Mathematica to figure that out.

terms = List @@ Normal[Series[Exp[x], {x, 0, 10}]];
f = FindSequenceFunction[terms /. x -> 1]

(*  1/Pochhammer[1, -1 + #1] &  *)


Well, that was a surprise. We can get a simpler expression for the coefficients in our summation like this

a[k] = FullSimplify[f[k], k ∈ PositiveIntegers]  (* 1/Gamma[k] *)

s[n_] = Inactive[Sum][a[k] x^(k - 1), {k, 1, n}]


$$\underset{k=1}{\overset{n}{\sum }}\frac{x^{k-1}}{\Gamma (k)}$$

We accept the gamma function in lieu of the factorial. We recover the exponential in the limit as $$n\rightarrow\infty$$

Limit[s[n], n -> ∞] // Activate   (*  E^x  *)
`