def incremental_search(f, a, b, dx):
    """
    Searches the interval (a,b) in increments dx for
    the bounds (x1,x2) of the smallest root of f(x)

    Parameters
    ----------
        f  - function
        a  - left bound of the interval, (a, b)
        b  - right bound of the interval, (a, b)
        dx - value by which to increment

    Returns
    -------
    x1 = x2 = None if no roots were detected
    """
    x1 = a
    x2 = x1 + dx

    f1 = f(x1)
    f2 = f(x2)

    while (f1*f2) > 0:
        if x1 >= b:
            return None, None

        x1 = x2
        x2 = x1 + dx

        f1 = f2
        f2 = f(x2)

    return x1, x2