I want to create a table with numerical values of a function derivative by using the following code:
f[x_, a_] := f[x, a] = Tanh[a (1 - Cos[x])];
g[x_, a_] := g[x, a] = D[f[x, a], x];
pderivative = Table[{x, Evaluate[g[x, 5]]}, {x, - π, π, 2 π/500.}]
When I look at the result, it's not what I expect. Any trick to fix this?

g = D[f[x, a], x]; pderivative = Table[{x, g /. a -> 5}, {x, -\[Pi], \[Pi], 2 \[Pi]/500.}]– Alex Trounev Nov 05 '18 at 10:48SetDelayed(:=). Related: https://mathematica.stackexchange.com/a/181586/1871