2

I have a function that I'm trying to find an explicit form for the coefficients in its power series expansion. On paper, it is a long calculation so I decided to write up the formula in mathematica. One of the issues that I'm having is below. In the expression I have $$\sum_{k=0}^{n}e^{kx}$$ Since I'm trying to extract the coefficients (using Normal Series commands), I rewrite the exponential as a series: $$\sum_{k=0}^{n}\sum_{j=0}^\infty{k^j}\frac{x^j}{j!}$$ The codes are below (using n=10)

   Sum[E^(k*x), {k, 0, 10}]

 1 + E^x + E^(2 x) + E^(3 x) + E^(4 x) + E^(5 x) + E^(6 x) + E^(7 x) + E^(8 x) + E^(9 x) + E^(10 x)

Now if I rewrite it using the power series representation

 Sum[Sum[(k^j) (x^j)/j!, {j, 0, \[Infinity]}], {k, 0, 10}]

 Power::indet: Indeterminate expression 0^0 encountered. >>

 E^x + E^(2 x) + E^(3 x) + E^(4 x) + E^(5 x) + E^(6 x) + E^(7 x) + E^(8 x) + E^(9 x) + E^(10 x) + \!\(\*UnderoverscriptBox[\(\[Sum]\),\(j = 0),\(\[Infinity]\)]\*FractionBox[\(\*SuperscriptBox[\(0\), \(j\)]\SuperscriptBox[\(x\), \(j\)]\), \(j!\)]\)

You can see that the calculation is suppressed because it is identifying $k^j$ as $0^0$. But this is not a problem when I leave the exponential as is. How can I fix this?

Iceman
  • 167
  • 5
  • Does SeriesCoefficient[] not work for your function? – J. M.'s missing motivation Jun 06 '15 at 04:10
  • I don't want to pull out the coefficient. I already know the coefficients for all powers of $x$. I'm trying to write an explicit formula. I know how to extract coefficients using mathematica. but I want to see if my explicit formula works. Does that make sense? – Iceman Jun 06 '15 at 04:14
  • Then, to avoid $0^0$, why not explicitly pull out the offending terms? Something like 11 + Sum[(k x)^j/j!, {k, 0, 10}, {j, 1, ∞}] – J. M.'s missing motivation Jun 06 '15 at 04:20

1 Answers1

3

One quite hacky way... introduce a dummy variable q which gets set to zero later (effectively like using a Limit)

Sum[Sum[((k + q)^j) (x^j)/j!, {j, 0, \[Infinity]}], {k, 0, 10}] /. q -> 0

(* Result 1 + E^x + E^(2 x) + E^(3 x) + E^(4 x) + E^(5 x) + E^(6 x) + E^(7 x) + E^(8 x) + E^(9 x) + E^(10 x) *)

A less hacky but, IMO more dangerous way... unprotect Power and redefine to ensure 0^0 is whatever value it should be. There's a good answer here

Histograms
  • 2,276
  • 12
  • 21