I'm sorry there isn't a much better answer, but you start by thinking about it.
You studied dependent and independent variables. Which one can you control? That's probably the independent variable. What is the resulting consequence fo your choice? That is probably the dependent variable.
Each cost is made up of a fixed cose and some variable cost (which may be zero). Set them all up and graph them.
It's a 2-day trip, so there are your fixed costs:
"Speedy Cars" charges $25 per day -- $50
"Compact Comfort" charges $50 per day -- $100
"Getaway Cars" charges only $15 per day -- $30
The variable costs are in the miles driven. Let's see what you get for your three equations.