Answer: the ship unloaded 1455 tons of cargo at the bahamas.
Explanation:
Let x represent number of tons of cargo that the ship unloaded at the bahamas.
The initial number of tons of cargo in the ship is 5678 tons. If it unloads x tons of cargo, the number of tons of cargo left would be
5678 - x
The crew also loads three times the quantity of cargo that was unloaded. This means that the number of tons of cargo that it loaded is 3x. The total number of tons of cargo in the ship would be
5678 - x + 3x
= 5678 + 2x
If the ship holds 8588 tons now, it means that
5678 + 2x = 8588
2x = 8588 - 5678
2x = 2910
x = 2910/2
x = 1455 tons of cargo