Answer:
 t_{out} = [tex]\frac{v_s - v_r}{v_s+v_r}[/tex] t_{in},    t_{out} = [tex]\frac{D}{v_s +v_r}[/tex]
Explanation:
This in a relative velocity exercise in one dimension,
let's start with the swimmer going downstream
its speed is
     [tex]v_{sg 1} = v_{sr} + v_{rg}[/tex]
The subscripts are s for the swimmer, r for the river and g for the Earth
with the velocity constant we can use the relations of uniform motion
      [tex]v_{sg1}[/tex] = D / [tex]t_{out}[/tex]
      D = v_{sg1}  t_{out}
now let's analyze when the swimmer turns around and returns to the starting point
    [tex]v_{sg 2} = v_{sr} - v_{rg}[/tex]
     [tex]v_{sg 2}[/tex] = D / [tex]t_{in}[/tex]
     D = v_{sg 2}  t_{in}
with the distance is the same we can equalize
      [tex]v_{sg1} t_{out} = v_{sg2} t_{in}[/tex]
     t_{out} =  t_{in}
      t_{out} = [tex]\frac{v_s - v_r}{v_s+v_r}[/tex] t_{in}
This must be the answer since the return time is known. If you want to delete this time
      t_{in}= D / [tex]v_{sg2}[/tex]
we substitute
      t_{out} = \frac{v_s - v_r}{v_s+v_r} ()
      t_{out} = [tex]\frac{D}{v_s +v_r}[/tex]