Can anyone plot the degree-8 Maclaurin polynomial for the function $(x+1)/((x^2)-9)$ and function $(x+1)/((x^2)-9)$ on the same plot.
Please help, I've tried everything I could think of.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityCan anyone plot the degree-8 Maclaurin polynomial for the function $(x+1)/((x^2)-9)$ and function $(x+1)/((x^2)-9)$ on the same plot.
Please help, I've tried everything I could think of.
The problem is probably that Series
returns a SeriesData
object. It must be converted to a polynomial with Normal
before it can be plotted.
f = (x + 1)/((x^2) - 9);
p = Normal[Series[f, {x, 0, 8}]]
Plot[{f, p}, {x, -2, 2}]
Plot[{f, p}, {x, -4, 4}, PlotRange -> {-3, 3}, PlotLegends -> Placed[{"function", "polynomial"}, {.7, .7}]]
$\endgroup$
Apr 22, 2019 at 3:04