What are the similarities and differences between Li Longji in history and Bai Juyi’s works?

Li Longji, Emperor Xuanzong of the Tang Dynasty, written by Bai Juyi, appears in "Song of Everlasting Sorrow". Li Longji is described in the poem like this: "The emperor of the Han Dynasty was obsessed with beauty and thought of the country, and he couldn't get the imperial palace for many years. The spring night is short and the day is high. , From now on the king will not go to court early." It shows that Li Longji was lazy in political affairs for the sake of his concubine Yang Yuhuan. The poem also writes, "The Yuyang Gong is stirring up the earth, shocking the colorful clothes and feathers." This poem describes the Anshi Rebellion. The Anshi Rebellion was a turning point in the Tang Dynasty's transition from prosperity to decline. It occurred during the Tianbao period of the late Emperor Xuanzong of the Tang Dynasty.

Looking at Li Longji from the perspective of a historical figure, we have to say that he was an accomplished emperor. In the early period of his reign, that is, during the Kaiyuan period, famous figures such as Yao Chong and Song Jing appeared, as well as famous poets such as Zhang Jiuling, Li Bai, and Du Fu. During the reign of Emperor Xuanzong of the Tang Dynasty, martial arts were outstanding, politics was clear, literature was active, and the people lived and worked in peace and contentment. The "Kaiyuan Age", the most prosperous age of Chinese feudal society, appeared. However, in the later period of Tang Xuanzong, during the Tianbao period, he began to slack off in political affairs, the Anshi Rebellion occurred, and the Tang Dynasty also began to decline.

To sum up, Li Longji was still a very accomplished emperor in history, while Bai Juyi's works mainly showed Xuanzong who was slack in government affairs in the later period.