Were Charlemagne and Muḥammad ibn Musa al-Khwarizmi alive at the same time?
Yes. Charlemagne and Muḥammad ibn Musa al-Khwarizmi were alive at the same time, from c. AD 780 to AD 814.
Charlemagne
King of Franks, regarded as the first Holy Roman Emperor (747–814)
Born AD 740–748 · died 28 January AD 814
Muḥammad ibn Musa al-Khwarizmi
9th-century Persian mathematician and astronomer
Born c. AD 780 · died c. AD 850