Probing Molecular Gas Properties in Starbursts and AGNs