In this problem we can made an equation that represent the cost of the taxi, so y will be the final cost, and x the number of miles that he rides so the equation will be:

So if he paid 34 dollars, we replace y=34 and solve for x:

that means that he drives 15 miles