Simplify[D[x^n Sin[n x], {x, 3}]]

f[x_, n_] := x^n Sin[n x];

Plot[{f[x, 2], f[x, 3]}, {x, 0, 2 Pi}, AxesLabel->{"x", "f(x)"}, PlotRange->{{0, 2Pi},{-200, 125}}, PlotLegends->{"f(x) = (x^2) sin(2x)", "f(x) = (x^3) sin(3x)"}]