1. Two boats start from places $A$ and $B$ heading towards each other. Each of them, when they reach one place, turns back to the other place. The first time the boats met was $5 \mathrm{~km}$ from $A$, and the second time was $3 \mathrm{~km}$ from $B$. Determine the distance from $A$ to $B$.
Solution. Let the distance from $A$ to $B$ be denoted by $x$, the speeds of the boats by $v^{\prime}$ and $v^{\prime \prime}$, the time to the first meeting by $t^{\prime}$, and the time from the first to the second meeting by $t^{\prime \prime}$. From the condition of the problem, we get

$$
v^{\prime} t^{\prime}=5, v^{\prime \prime} t^{\prime}=x-5, v^{\prime} t^{\prime \prime}=3+(x-5), v^{\prime \prime} t^{\prime \prime}=5+(x-3)
$$

If we multiply the first and fourth equations and the second and third equations, we get

$$
5(x+2)=v^{\prime} v^{\prime \prime} t^{\prime} t^{\prime \prime}=(x-5)(x-2), \text { i.e. } x^{2}-12 x=0 \text {. }
$$

However, $x>0$, so from the last equation it follows that $x=12$.