def yddot_d_z(mu, state, r_15_inv, r_25_inv):
    """ Partial of x acceleration with respect to z

    Args:
        mu (float): three body constant
        state (np.array): 6 dimensional state vector of
            (x, y, z, dx, dy, dz)
        r_15_inv (float):  1 / norm(r_1)^(5) where r_1 is the vector from the
            primary (i.e. Earth) to the satellite
        r_25_inv (float):  1 / norm(r_2)^(5) where r_2 is the vector from the
            secondary (i.e. Moon) to the satellite

    Returns:
        float
    """
    x, y, z = state[:3]

    ans = 3 * mu * y * z * r_25_inv \
            + 3 * (1 - mu) * y * z * r_15_inv

    return ans