import math


def calc_drb_dxi_no_beam(rb, rb_max):
    """
    Calculate the longitudinal slope of the local bubble radius.

    Valid in "strong bubble regime", where rb_max*k_pe >> 1.
    Valid only in back of bubble, where there is no drive beam.
    The slope of rb is calculated wrt xi, where xi=ct-z
    Args:
        rb:     the local bubble radius
        rb_max: maximum value of the bubble radius
    Returns:
        drb_dxi: longitudinal derivative of the bubble radius
    """
    # from Eq. (3) of LBN2017
    # there is ambiguity in the sign, which needs to be resolved
    drb_dxi = math.sqrt((pow(rb_max/rb,4)-1.)/2.)
    return drb_dxi