Let v the rate of the boat in still water; therefore, according to the question
[tex]\begin{gathered} (v-2)t=40\rightarrow\text{ against currect} \\ and \\ (v+2)t=120\rightarrow\text{ with the current} \end{gathered}[/tex]Therefore, solving for v,
[tex]\begin{gathered} \Rightarrow3(v-2)t=(v+2)t \\ \Rightarrow3(v-2)=v+2 \\ \Rightarrow3v-6=v+2 \\ \Rightarrow2v=8 \\ \Rightarrow v=4 \end{gathered}[/tex]Thus, the answer is 4mph.