The length of hike is 5 miles.
Explanation
Suppose, the length of the hike is [tex]x[/tex] miles.
On a hike up hill, Ted climbs at 3 miles an hour and going back down, he runs at 5 miles an hour.
We know that, [tex]Time= \frac{Distance}{Speed}[/tex]
So, the time taken by him to climb up [tex]= \frac{x}{3}[/tex] hours and the time taken by him to run down [tex]= \frac{x}{5}[/tex] hours.
Given that, it takes him 40 minutes longer to climb up than run down. Now, 40 minutes [tex]=\frac{40}{60}hours=\frac{2}{3}[/tex] hours.
So the equation will be......
[tex]\frac{x}{3}-\frac{x}{5}=\frac{2}{3}\\ \\ 15(\frac{x}{3}-\frac{x}{5})=15(\frac{2}{3})\\ \\ 5x-3x=10\\ \\ 2x=10\\ \\ x=5[/tex]
So, the length of hike is 5 miles.