What to do with copyright when composing music using ancient poems?

You and your classmates both have copyrights. What you own is the copyright of the musical works, and what your classmates own is the copyright of the lyric works (adapted performance works). You can use the lyrics and music copyright together, or you can use it separately. Since your music works and your classmates' lyrics works are all created now, according to current works, they are protected by copyright law and have little to do with Bai Juyi.