def finite_difference(fn, x_val, dx=1e-10):
    """
    Computes the finite difference numerical approximation to the derivative of fn(x) with respect to x at x_val: (fn(x_val + dx) - fn(x_val))/dx
    """
    return (fn(x_val + dx) - fn(x_val)) / dx