An Uber ride costs a flat rate to start the ride and then charges an additional amount per mile. By the 3rd mile, the total cost of the trip is $9. By the 7th mile, the total cost is $17. What is the flat rate that Uber charges and how much does it cost per mile?