Go to the expense (of doing something)

To pay the cost of doing something.

We had to go to the expense of buying a new tent for camping.