This problem requires us to find the distance a train traveled, given changes in its speed and the resulting time differences. Let \(v\) represent the train's original speed in km/h, and \(d\) represent the distance traveled in km.
The time taken to cover the distance at the original speed is \(\frac{d}{v}\) hours.
Condition 1: If the speed increases by 6 km/h, the journey is completed 4 hours sooner.
\(\frac{d}{v+6} = \frac{d}{v} - 4\)
Condition 2: If the speed decreases by 6 km/h, the journey takes 6 hours longer.
\(\frac{d}{v-6} = \frac{d}{v} + 6\)
We now have a system of two equations:
(1) \(\frac{d}{v+6} = \frac{d}{v} - 4\)
(2) \(\frac{d}{v-6} = \frac{d}{v} + 6\)
Let's rearrange equation (1):
\(\Rightarrow d\left(\frac{1}{v+6} - \frac{1}{v}\right) = -4\)
\(\Rightarrow d\frac{v - (v+6)}{v(v+6)} = -4\)
\(\Rightarrow d\left(\frac{-6}{v(v+6)}\right) = -4\)
\(\Rightarrow \frac{d}{v(v+6)} = \frac{2}{3}\)
Now, let's rearrange equation (2):
\(\Rightarrow d\left(\frac{1}{v-6} - \frac{1}{v}\right) = 6\)
\(\Rightarrow d\frac{v - (v-6)}{v(v-6)} = 6\)
\(\Rightarrow d\left(\frac{6}{v(v-6)}\right) = 6\)
\(\Rightarrow \frac{d}{v(v-6)} = 1\)
We now have these two simplified relationships:
\[\frac{d}{v(v+6)} = \frac{2}{3}\]
\[\frac{d}{v(v-6)} = 1\]
From these, we can isolate terms involving \(d\):
\[\frac{1}{v(v+6)} = \frac{2}{3d}\]
\[\frac{1}{v(v-6)} = \frac{1}{d}\]
Dividing these two equations will help us eliminate \(d\):
\[\frac{2}{3d} \div \frac{1}{d} = \frac{1 \cdot d}{v(v+6) \cdot 3d} \cdot \frac{v(v-6)}{d} = \frac{2}{3}\]
\[\Rightarrow \frac{v(v-6)}{v(v+6)} = \frac{2}{3}\]
Simplifying this expression:
\[\left(\frac{v-6}{v+6}\right) = \frac{2}{3}\]
Cross-multiplying to solve for \(v\):
\[3(v-6) = 2(v+6)\]
\[3v - 18 = 2v + 12\]
\[v = 30\]
Now, substitute the value of \(v\) back into the equation \(\frac{d}{v(v-6)} = 1\):
\[\frac{d}{30(24)} = 1\]
\[d = 720\]
Therefore, the train traveled a distance of 720 km.