You can
put this solution on YOUR website!I they are traveling in opposite directions
you can add their speeds and consider one
to be stationary and the other moving
Let

= speed of the slower one

km

The slower boat's speed is 40 km/hr
check:
slower boat:

km
faster boat:

OK