4. Points $A, B, C$ are located sequentially, with the distance $A B$ being $a$ km and the distance $B C$ being $b$ km. A cyclist left point $A$ and headed for point $C$. At the same time, a pedestrian left point $B$ and headed for point $A$. It is known that the pedestrian and the cyclist arrived at points $A$ and $C$ simultaneously. Find the distance from point $A$ where they met ( $a$ and $b$ are known).
Answer: $\frac{a(a+b)}{2 a+b}$ km.

Solution: Let $D$ be the meeting point. Since the speeds of the cyclist and the pedestrian are in the ratio $(a+b): a$, point $D$ divides the segment $A B$ in the same ratio. Therefore, $A D=k(a+b), B D=k a$ and $k(a+b)+k a=a$, from which $k=\frac{a}{2 a+b}$. In the end, we get $A D=\frac{a(a+b)}{2 a+b}$.