def dYdx(Ys, h):
    """
    Return the first derivative of Ys w.r.t x
    """
    first = 0.0 * Ys
    # skip the end points
    for i in range(1, len(Ys) - 1):
        first[i] = (Ys[i + 1] - Ys[i - 1]) / (2.0 * h)
    return first