2
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ Does SeriesCoefficient[] not work for your function? $\endgroup$ – J. M.'s technical difficulties Jun 6 '15 at 4:10
  • $\begingroup$ 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? $\endgroup$ – Iceman Jun 6 '15 at 4:14
  • $\begingroup$ 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, ∞}] $\endgroup$ – J. M.'s technical difficulties Jun 6 '15 at 4:20
3
$\begingroup$

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

|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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