Complex sentence: In 1004-5 Al-Maʿarri learned that his father had died and, in reaction, wrote an elegy where he praised his father.
Split into simpler sentences: In 1004-5 Al-Maʿarri learned that his father had died. In reaction to the death of his father, Al-Maʿarri wrote an elegy where he praised his father.