The distance from Rihanna's apartment to the park is (5x+2) miles and the trip from the park to the coffee shop is (25x-8) miles long. It is given that Rihanna always stops halfway through to meet her best friend at a park, this means that the distance from Rihanna's apartment to the park is equal to the distance from the park to the coffee shop. Then
5x+2=25x-8.
Solve this equation, separating variables x in left side and numbers in right side:
5x-25x=-8-2,
-20x=-10,
20x=10,
x=10/20,
x=1/2=0.5.
Answer: x=0.5