I would let \(c\) be the speed of the current, and \(v\) be the speed of the boat where there is no current and \(d\) be the distance from \(A\) to \(B\)...then we have:
[MATH]d=(v+c)a[/MATH]
[MATH]d=(v-c)b[/MATH]
Now, we are asked to find the time \(t\) where:
[MATH]t=\frac{d}{v}[/MATH]
From the first two equations above, we find:
[MATH](v+c)a=(v-c)b[/MATH]
[MATH]v=\frac{c(a+b)}{b-a}[/MATH]
Hence:
[MATH]d=\left(\frac{c(a+b)}{b-a}-c\right)b[/MATH]
[MATH]d=\frac{2abc}{b-a}[/MATH]
Can you wrap it up now?