1
$\begingroup$

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?

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

4 Answers 4

1
$\begingroup$

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

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

enter image description here

If you insist on summing to 10, replace the :

Asymptotic[Exp[x], {x, 0, ∞}] /. ∞ -> 10
$\endgroup$
4
$\begingroup$
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

enter image description here

Verifying,

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

(* True *)

f[x_] = Sin[x];

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

enter image description here

Verifying,

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

(* True *)
$\endgroup$
1
  • $\begingroup$ As always, that's very impressive. $\endgroup$
    – user49048
    Jan 17, 2022 at 5:56
3
$\begingroup$

Is this what you were looking for?

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

And more generally

SeriesCoefficient[Exp[x], {x, n, n}]
$\endgroup$
2
$\begingroup$

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  *) 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.