function slope = dfdx(f)

    dx = 1e-9;
    slope = @(x) (f(x + dx) - f(x)) / dx;

end