The hikers 3 miles from the trailhead to the waterfall.
d1 = 3 miles
Then, the hikers made a right turn and hiked another 3 miles until they stopped for lunch.
d2=3 miles
We can solve the distance when they returned to the trailhead using Pythagorean theorem:
D ² =d1² + d2²
D² = 3² + 3²
D = 4.24
The distance is 4.24 miles.