Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having some trouble with this function

Subscript[f, \[Pi]] = {0.0924, 0.00025};
Pade[x_, n_, m_] :=Sum[Subscript[a, i]*(x)^i, {i, 0, n}]/(
1 + Sum[Subscript[a, i]*(x)^(i - n), {i, n + 1, n + m}]) /. 
Subscript[a, n + m] -> Subscript[a, n]/(2 Subscript[f, \[Pi]][[1]])

Then, this function works ok but all x values but 0, which gives back

In[226]:= Pade[0, 0, 1]
During evaluation of In[226]:= Power::indet: Indeterminate expression 0^0  encountered. >>
Out[226]= Indeterminate

However it works ok if I do

In[228]:= Pade[x, 0, 1] /. x -> 0
Out[228]= Subscript[a, 0]

Any idea why is this? Indeed the kind of indetermination, 0^0 it's freaking me out, theres no such a power law in my function definition, so I don't have a clue of why is this happening ...

share|improve this question
Don't you have x=0, i=0 in the numerator ? – b.gatessucks Nov 1 '12 at 11:10
No, the denominator goes as 1 + a_1x + a_2x^2 + ... – pablo Nov 1 '12 at 11:13
Hey…Subscript[a, i]*(x)^i apparently contains 0^0 when x=0, i=0. – xzczd Nov 1 '12 at 11:15
In the numerator the sum on i starts at 0. – b.gatessucks Nov 1 '12 at 11:15
I just found out what's the problem, the problem is that in the numerator I have Subscript[a,0]x^0 This leads to 0^0 ... When you tell Mathematica to take the limit Limit[Pade[x,0,1],x->0] it performs ok ... now I jast took the Subscript[a,0] parameter outsude the sum and works fine, however I wonder whether I could do it other way ... – pablo Nov 1 '12 at 11:16

Since the problem was the evaluation at x=0 - which for the term x^0 gave 0^0 - by taking the term out of the summation the wanted result was obtained:

Subscript[f, \[Pi]] = {0.0924, 0.00025}; 
Pade[x_, n_, m_] := 
 Subscript[a, 0] + 
   Sum[Subscript[a, i]*(x)^i, {i, 1, n}]/(1 + 
      Sum[Subscript[a, i]*(x)^(i - n), {i, n + 1, n + m}]) /. 
  Subscript[a, n + m] -> Subscript[a, n]/(2 Subscript[f, \[Pi]][[1]])


Pade[0, 0, 1]

(*Subscript[a, 0]*)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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