Write a function that calculates the fare of a taxi ride. Its input is \(x\) (distance in km) and the fare is calculated as follows:

For example, the fare for a ride of 5.2km is \[\$5 + 5\times \$2 = \$15.\]