I have taken buses all over Ireland -- at least a half dozen trips -- though not one from Dublin to Derry. Here are the bus timetables: https://www.buseireann.ie/
You have two options: You could go directly from Dublin to Derry via bus or air. (I'm not sure if there is a Dublin to Derry train.)
The other is to go from Dublin to Belfast and then Belfast to Derry. If this interests you, you could take the train from Dublin to Belfast; last time I was in Ireland, there was a train practically every hour from Dublin to Belfast: https://www.irishrail.ie/en-ie/rail-fares-and-tickets/fares-info/dublin-belfast. That way, you will be able to see the most populous city (Dublin), second most (Belfast) and sixth most (Derry) in Ireland.
From Belfast, you'd have to check if there is a train or just a bus from Belfast to Derry.
I've been to Dublin and Derry each. They're beautiful cities. I missed seeing Belfast because of time issues and regret it. Friends who have visited Belfast rave about how beautiful it is, too.