function F = df(x,r)
% m-file for general function
F = r*(1-2*x);