From this bundle Dell sold it looks like they are compatible, but it is not currently available so I'm worried it may have changed.
The AX510 list of compatible products doesn't list monitors, just a bunch of PC's. It says: "The Dell™ AX510 SoundBar is only powered from a Dell UltraSharp or Professional series monitor." The U2412M's specs say it has a "DC power connector for Dell Soundbar."
This post: Dell Monitor Soundbars from this forum's Monitor FAQ lists the U2412M as one of the monitors that the AY511PA can be installed on, but the AY511PA had an external power adapter and the post is more than 5 years old.