Possible Duplicate:
General::ivar is not a valid variable when plotting - what actually causes this and how to avoid it?
I need to define a function using the output of series, i.e.
f[x_,M_]:= Normal[Series[Sin[x],{x,0,M}]];
Now, for reasons explained in Normal[Series[ ]] does not give a normal expression that I can't fully understand (due inexperience and lack of time), the above code does not work as is.
I've managed to use f within other functions, like
InverseLaplaceTransform[#,s,t] & @ f[s,M]
where M is given, but failing when trying to evaluate, i.e.
In[1]:= f[x_,m_]:= Normal[Series[Sin[x],{x,0,m}]];
In[2]:= f[x,3]
Out[2]= x - x^3/6
In[3]:= f[2,3]
General::ivar: 2 is not a valid variable. >>
General::ivar: 2 is not a valid variable. >>
Out[3]= Sin[2]
In a nutshell, is there a way to use f like a "normal" function?
M=4or 5 to say something. I thought it was implied in the context ofSeries, silly me. – Pragabhava Aug 21 '12 at 20:39fand hence do any stuff that needed evaluation. – Pragabhava Aug 21 '12 at 20:44Sin[x]instead ofg[x]then ;) – Pragabhava Aug 21 '12 at 20:53f[3,3]fails with...". this would make it easier to locate (this is a common problem, so others will definitely have the same question) – acl Aug 21 '12 at 21:44