Dear student,
Let the speed of sailor in still water be x km/hr and the speed of stream be y km/hr.
The speed of boat (upstream) = (x - y) km/hr.
The speed of boat (downstream) = (x + y) km/hr.
Now,
A.T.Q.
(1) 8 / x + y = 40 / 60 (Since, Time = Distance / Speed)
⇒ x + y = 12 ----------------- (1)
(2) 8/ x - y = 1 (Since, Time = Distance / Speed)
⇒ x - y = 8 ------------------- (2)
On adding (1) and (2),
⇒ x + y + x - y = 12 + 8
⇒ 2 x = 20
⇒ x = 10
By (1)
10 + y = 12
⇒ y = 12.
Regards!