I have a polynomial:
f[x_] := x^3 + 2*x^2 + 4
and I create a function that implements the Taylor expansion:
ft[x_, x0, n] := Normal[Series[f[x], {x, x0, n}]]
If I implement the expansion, the output is as expected:
ft[x, 5, 2]
(179 + 95 (-5 + x) + 17 (-5 + x)^2)
If I then plot the output, it works as expected:
Plot[179 + 95 (-5 + x) + 17 (-5 + x)^2, {x, -10, 10}]
But if I do it in one step, I obtain an error:
Plot[{f[x], ft[x, 5, 2]}, {x, 0, 10}]
(General::stop: Further output of General::ivar will be suppressed during this calculation.)
- Why causes this error?
- How I can solve it keeping the one step approach? I know there are examples such as this one, but they use multiple steps.