[Solved] Apply a List of Functions to Plot[..]

How do I make (2) Work?

f[x_] := 3 + (2 - x)^2

diff[f_, n_] := D[f[x], {x, #}] & /@ Range[0, n]

diff[f, 3]

{3 + (2 - x)^2, -2 (2 - x), 2, 0}

**(1)** Plot[{3 + (2 - x)^2, -2 (2 - x), 2, 0}, {x, 0, 4}, PlotLegends -> "Expressions"] -- works

**(2)** Plot[abl[f, 3], {x, 0, 4}, PlotLegends -> "Expressions"] -- doesn't work

Hi Romeo,

I assume you mean Plot[diff[f, 3], ... not Plot[abl[f, 3], ....

Plot has the HoldAll attribute

Attributes@Plot
(* {HoldAll, Protected, ReadProtected} *)

so none of it’s arguments are evaluated. Try

Plot[Evaluate@diff[f, 3], {x, 0, 4}, PlotLegends -> "Expressions"]

Many Thanks, Roshit