Let's call John's speed J.
Let's recall that speed is distance/time. Since the current was 1 km per hour, we can consider this as a subtraction when he was swiming against the current, and as an addition when he was swiming with it.
Since speed is distance/time, time is distance/speed.
This gives us, on one hand,
![t=(8)/(J-1),](https://img.qammunity.org/2023/formulas/mathematics/college/cy0v1p64zl4lxn440p9p6u215jqcxvq0ex.png)
and on the other,
![t=(16)/(J+1)\text{.}](https://img.qammunity.org/2023/formulas/mathematics/college/jaashxagq2pfzil5qtaeh7g7odhst3kgop.png)
The problem is telling us that these times are the same, so we get the following equation:
![(8)/(J-1)=(16)/(J+1)\text{.}](https://img.qammunity.org/2023/formulas/mathematics/college/kyl76re0cuehcxfgq0185pxfq1vluj79xq.png)
To solve it, let's multiply both sides by (J-1)(J+1):
![(J+1)8=(J-1)16,](https://img.qammunity.org/2023/formulas/mathematics/college/dzi5c8sld38l7n9sqiiwt4xux18opd6tmj.png)
![8J+8=16J-16.](https://img.qammunity.org/2023/formulas/mathematics/college/n1hl56gvr32u2isjdjgriblzeraym3a5cx.png)
Let's subtract 8 from both sides:
![8J=16J-24.](https://img.qammunity.org/2023/formulas/mathematics/college/m1nnq8kreq89avx0po37wq7763em82ob8u.png)
Now, let's subtract 16J from both sides:
![-8J=-24.](https://img.qammunity.org/2023/formulas/mathematics/college/pxrszixcbve6pr9xbwh74rt77sbr6ijdvi.png)
Dividing both sides by -8:
![J=3.](https://img.qammunity.org/2023/formulas/mathematics/college/o2ang4mla3mnfe4lfnns35a3jqnvnmto3x.png)
So Jhon would swim at a speed of 3 km/h if there were no current.