Student Support Forum: 'Function evaluated at 0' topicStudent Support Forum > General > "Function evaluated at 0"

 < Previous Comment Help | Reply To Comment | Reply To Topic
 Author Comment/Response jf 12/20/12 6:44pm You are making assumptions about k that need to be explicit. In[1]:= f[t_, k_, a_] := a*t^k In[2]:= f[0, k, a] k Out[2]= 0 a In[3]:= Simplify[%, k > 0] Out[3]= 0 What would happen if k were negative? In[4]:= 0^(-3) -3 Power::infy: Infinite expression 0 encountered. Out[4]= ComplexInfinity If you really, really want f[0,..,..] to be zero regardless of the other arguments, you can make a second, more specific, definition. In[8]:= f[0, k_, a_] := 0 In[9]:= f[0, -2, 137] Out[9]= 0 Since this definition of f is more specific than the earlier definition, it will be tried first. URL: ,

 Subject (listing for 'Function evaluated at 0') Author Date Posted Function evaluated at 0 Morten Valberg 12/20/12 10:08am Re: Function evaluated at 0 jf 12/20/12 6:44pm
 < Previous Comment Help | Reply To Comment | Reply To Topic