(there is a cryptic error message saying that something is not a valid variable). The online help does not explain anything.
I would also be happy to know what to change in order to get the plot without splitting the process into two stages: first obtaining the truncated series, and next re-copying the formula obtained to form a definition of a function to be plotted. Leslaw.
and this seems to work correctly in all three cases, that is one can show a formula, compute a value, and create a plot without using Evaluate[]. Is this an acceptable approach? Can anybody explain to me what is going on here? I cannot understand the mechanism, and the information contained in manuals is very limited. Leslaw
The problem is the order of evaluation. If you insist on using delayed assignment
F[x_]:=Normal[Series[Exp[x],{x,0,2}]]
then f[1] will become Series[E, {1, 0, 2}]. The number 1 will be replaced into Normal[Series[Exp[x],{x,0,2}]] before the expansion starts. You must force the symbolic calculation before any number is replaced. I suggested immediate evaluation:
works. The only problem is that it works damned slow during plotting (not really for the Exp function but for a more complicated one that I have); I presume the expansion is performed every time a new point is to be plotted. Leslaw