Steaming on a streaming river 
A steamer goes downstream on some stretch of a river in 4 hours, and upstream in 5 hours. If the river flows at 2 kilometres an hour, what is the length of the stretch?

I have tried:
Downstream. Let the answer be $X$. The steamer's speed relative to ground is then $X/4$.
Upstream. The steamer's speed (again, relative to ground) is $X/5$ here.
Now let the actual downstream steamer speed be $y_d$ and the corresponding upstream speed be $y_s$. Dividing the two equations I got
$y_d/y_s=5/4$. Now $y_d=5$ km/h; substituting into the first equation I got 20 km.
But this is wrong. Can anyone solve this?
 A: Let the ground speed of the steamer be $x$ kilometres an hour.
When travelling downstream, the steamer has an effective speed of $x+2$ km/h. Similarly, it has an upstream effective speed of $x-2$ km/h. Multiply these numbers by the respective times taken in each direction to get the distances covered, which must be the same:
$$4(x+2)=5(x-2)=\text{stream length}$$
Solve for $x$:
$$4x+8=5x-10$$
$$18=x$$
So the steamer is travelling at 18 km/h. The length of the stream is then
$$5(x-2)=5(18-2)=5×16=80\text{ km}$$
A: As the involved velocities are small compared to the speed of light :-), simple addition of velocities applies:
Downstream: 
$$
L = (v_s + v_r) t_d
$$
Upstream:
$$
L = (v_s - v_r) t_u
$$
Known are $v_r = 2 \text{km}/\text{h}$, $t_d = 4\text{h}$, $t_u = 5 \text{h}$, unknown are the stretch lenght $L$ and  the (assumed to be constant) steamer speed $v_s$.
Simply subtracting the equations gives
$$
0 = (t_d - t_u) v_s + (t_d + t_u) v_r
$$
as $t_d \ne t_u$ we can solve for $v_s$ and get
$$
v_s 
= \frac{t_u + t_d}{t_u - t_d} v_r 
= \frac{9}{1} \cdot 2 \frac{\text{km}}{\text{h}} 
= 18 \frac{\text{km}}{\text{h}}
$$
inserting in either one of the original equations gives
$$
L 
= 20 \frac{\text{km}}{\text{h}} \cdot 4 \text{h} 
= 16 \frac{\text{km}}{\text{h}} \cdot 5 \text{h}
= 80 \text{km}
$$
