* 15 miles to the gallon (distance / fuel used).
* 50 miles (distance).
* $5.80 per gallon (cost / fuel used).
You want to know how much fuel is used and how much that costs. There aren't any units to convert here, so the math is really straight forward.
* Do \[Distance\] / \[Distance / Fuel Used\] to get Fuel Used out.
* Multiply that by \[Cost / Fuel Used\] to get the cost.
Does that help?