The person walks during $t_1$ hours and makes $4t_1$ km
The person runs during $t_2$ hours and makes $9t_2$ km
The resulting distance is $4t_1+9t_2 = 40$ km
The total time is $t_1+t_2=8$ hours
Can you solve the system ?
Here is an alternating way of thinking about the problem.
First let's have a look at this one:
We need 56 biscuits to feed 10 animals (cats and dogs). Dogs each 6 biscuits and cats eat 5 biscuits. How many cats and dogs are there?
We can solve with the system $\begin{cases} 5c+6d = 56\\c+d=10\end{cases}$
See the analogy with your problem ? Replace $(c,d)$ by $(t_1,t_2)$ and this is very similar.
We can solve it this way:
- let each animal eat $5$ biscuits
- then $50$ biscuits are eaten and $6$ are left over
- cats' belly are full but dogs miss $6-5=1$ biscuit
- since there are $6$ biscuits left, there should be $\frac 61$ dogs
We conclude for $6$ dogs and $4$ cats.
Now coming back to our problem:
There are $40$ km to be travelled by me (walking me and running me). Walking me travel at $4$ km/h while running me travel at $9$ km/h. How much of walking and running is there?
- let walk all the way at $4$ km/h
- then $32$ km are travelled and $8$ km are left over
- walking me is satisfied but running me wants more
- since there are $8$ km missing, I should have increased my allure by $9-4=5$ km/h to cover this distance in $\frac 85$ hours.
So I ran for 1h 36 min and walked the rest.