The answer should come out to -3akx^2
What happend to exp() function in the answer? This is what Mathematica gives
Clear[x, a, k]
f = Sum[ k Exp[-a x^3], {k, 1, 7} ];
D[f, x]
(* (-84*a*x^2)/E^(a*x^3) *)
There is no need to define a function f[x]
in here. it is just an expression. But this also works
Clear[x, a, k]
f[x_] := Sum[ k Exp[-a x^3], {k, 1, 7} ];
D[f[x], x]