recall your d = rt, distance = rate * time.
bearing in mind that, when she's going downstream, she's not going 40 mph, she's going 40 + 4 mph, because the stream is adding its speed to it.
likewise, when she's going upstream, she's going 40 - 4 mph, because the stream is eroding speed from it, thus

so, "u" is 16 minutes and 40 seconds.
and "d" is 13 minutes and about 38 seconds.