Assume that Rihanna's apartment, the park, and the coffee shop lie on a straight line.
The distance from the apartment to the park is 5x² miles, and the distance from the park to the coffee shop is (25x - 8) miles.
Because the total distance is 9 miles, therefore
5x² + 25x - 8 = 9
5x² + 25x - 17 = 0
Solve with the quadratic formula.
x = (1/10) [-25 +/- (25²+340)] = 0.6064 or -5.6064
Reject the negative solution because we should not haave negative distance.
Therefore,
The distance from the apartment to the park = 5(0.6064²) = 1.839 miles
The distance from the park to the coffee shop = 25*06064 - 8 = 7.16 miles.
Answer: x = 0.6064 miles