A school party walked from their camp to Glastonbury Tor at an average speed of \(\quantity{4}{km/h}\), and returned by bus at an average speed of \(\quantity{30}{km/h}\). The return journey was \(\quantity{5}{km}\) longer than the outward journey, but took two hours less. How far did they walk?

Let us say that the distance that the school party walked is \(\quantity{x}{km}\). We will express the information given to us by the question algebraically.

Firstly, we know that the school party took \[ \frac{\quantity{x}{km}}{\quantity{4}{km/h}} = \quantity{\frac{x}{4}}{hours} \] to walk to Glastonbury Tor.

Secondly, we know that the return journey by bus was \(\quantity{(x + 5)}{km}\) in length.

Thirdly, we know that the time on the bus journey, therefore: \[ \frac{\quantity{(x + 5)}{km}}{\quantity{30}{km/h}} = \quantity{\frac{x+5}{30}}{hours}, \] was \(2\) hours less than the outward journey on foot. That is, we know that \[ \frac{x+5}{30} = \frac{x}{4} - 2. \]

We can rearrange this final equation to find the value of \(x\): \[\begin{align*} \frac{x+5}{30} = \frac{x}{4} - 2 &\implies \frac{x}{4} - \frac{x}{30} = \frac{5}{30} + 2 \\ &\implies \frac{15x - 2x}{60} = \frac{1 + 12}{6} \\ &\implies \frac{13x}{60} = \frac{13}{6} \\ &\implies 13x = 130 \\ &\implies x = 10. \end{align*}\]

That is, the school party walked \(\quantity{10}{km}\).