I have this code, totally functional
$Assumptions = h > 0;
p4[x_, h_] := x^4/24 + h*x^3/9 + h^2*x^2/12 - h^4/72;
q4[x_, h_] := x^4/24 - h*x^3/9 + h^2*x^2/12 - h^4/72
Flatten@Table[{D[p4[x, 3], {x, n}], D[q4[x, 3], {x, n}]}, {n, 0, 3}]
But when I try to plot all these functions together I try to use the code
Plot[Flatten@Table[{D[p4[x, 3], {x, n}], D[q4[x, 3], {x, n}]}, {n, 0, 3}], {x, -3, 3}, PlotLegends -> "Expressions"]
for some reason it doesnt work. Probably this is a silly mistake but I cant see how to solve it. Some help will be appreciated, thank you.
Evaluateinside the plot.Plot[Evaluate@ Flatten@Table[{D[p4[x, 3], {x, n}], D[q4[x, 3], {x, n}]}, {n, 0, 3}], {x, -3, 3}, PlotLegends -> "Expressions"]– Anjan Kumar Mar 06 '17 at 04:57Plot[#, {x, -3, 3}, PlotLegends -> "Expressions"] & @ Flatten@Table[{D[p4[x, 3], {x, n}], D[q4[x, 3], {x, n}]}, {n, 0, 3}]. Unfortunately my previously preferred formEvaluated -> Truedoesn't work well with legends. – Mr.Wizard Mar 06 '17 at 05:10