Boat's speed is 20mph.
Current's speed is x mph.
So with the current the boat goes (20+x)mph.
Against the current the boat goes (20-x)mph.
R x T = D
Boat goes 45 miles with the current:
(20+x)*t = 45
Boat goes 27 miles against the current:
(20-x)*t = 27
So we have a system of equations:
20t + xt = 45
20t - xt = 27
Add the two:
40t + 0 = 72
t = 9/5 = 1.8
So plug that into one of the above equations:
(20+x)(9/5) = 45
20+x = 45(5/9) = 25
20+x = 25
x = 5
Current is 5 mph.
Plug in this answer to confirm.