Why are Du Fu's poems in his later years so sad and melancholy?

This should be related to his environment. Du Fu lived in the historical period from prosperity to decline in the Tang Dynasty. Du Fu was born in a family of "serving Confucianism and guarding officials" for generations, with profound family knowledge. The early works mainly show the ideal, ambition and expected life path. On the other hand, it shows his political ideal of "respecting the monarch and following it, and then making the vulgar pure". Many works in this period reflected the sufferings of people's livelihood and political turmoil at that time, and exposed the ugly behavior of the rulers. Since then, he has embarked on a life and creative road of worrying about the country and the people. With the increasingly corrupt politics in the later period of Tang Xuanzong, his life became increasingly impoverished and disappointed. In a wandering life.