Answer
$6$ km/h
Work Step by Step
Let's note by $x$ the rowing speed in still water.
The rowing speed upstream is diminished by the rate of the flow, while the rowing speed downstream is increased by the rate of the flow.
We write the equation for the total time and solve it for $x$:
$$\begin{align*}
\dfrac{6}{x-3}+\dfrac{6}{x+3}&=2\dfrac{40}{60}\\
\dfrac{6}{x-3}+\dfrac{6}{x+3}&=\dfrac{8}{3}\\
18(x+3)+18(x-3)&=8(x+3)(x-3)\\
18x+54+18x-54&=8(x^2-9)\\
36x&=8x^2-72\\
8x^2-36x-72&=0\\
4(2x^2-9x-18)&=0\\
2x^2-9x-18&=0\\
x&=\dfrac{-(-9)\pm\sqrt{(-9)^2-4(2)(-18)}}{2(2)}\\
&=\dfrac{9\pm 15}{4}\\
x_1&=\dfrac{9-15}{4}=-\dfrac{3}{2}\\
x_2&=\dfrac{9+15}{4}=6.
\end{align*}$$
Because $x>0$, the only solution that fits is $x=6$ km/h.