To solve for the number of hours \( x \) and \( y \) that the cyclist spends cycling at 12 km/h and 18 km/h, respectively, we can set up a system of equations based on the information provided.
-
We know that the total time spent cycling is 5 hours: \[ x + y = 5 \]
-
We also know that the total distance cycled is 78 km. The distance cycled at each speed can be calculated as:
- Distance at 12 km/h: \( 12x \)
- Distance at 18 km/h: \( 18y \)
Therefore, we can write the second equation for the total distance: \[ 12x + 18y = 78 \]
Now we have the following system of equations:
- \( x + y = 5 \)
- \( 12x + 18y = 78 \)
We can solve this system step by step.
Step 1: Solve the first equation for \( y \): \[ y = 5 - x \]
Step 2: Substitute \( y \) into the second equation: \[ 12x + 18(5 - x) = 78 \]
Step 3: Distribute the 18: \[ 12x + 90 - 18x = 78 \]
Step 4: Combine like terms: \[ -6x + 90 = 78 \]
Step 5: Rearrange to solve for \( x \): \[ -6x = 78 - 90 \] \[ -6x = -12 \] \[ x = \frac{-12}{-6} = 2 \]
Step 6: Substitute \( x \) back to find \( y \): \[ y = 5 - x = 5 - 2 = 3 \]
Thus, the solution is: \[ \boxed{x = 2} \quad \text{and} \quad \boxed{y = 3} \]
Verification:
- Time spent cycling at 12 km/h: \( x = 2 \) hours, so distance \( = 12 \times 2 = 24 \) km.
- Time spent cycling at 18 km/h: \( y = 3 \) hours, so distance \( = 18 \times 3 = 54 \) km.
- Total distance: \( 24 + 54 = 78 \) km.
- Total time: \( 2 + 3 = 5 \) hours.
Both conditions are satisfied, confirming that the solution is correct.