Assume the canoe travels at a speed v in still water.

The trip downstream was with the current, so according to an observer on the shore the boat moved with a speed of v + 3 km/h and travelled a distance of x km in 2 hours.

The trip upstream was against the current, so according to an observer on the short the boat moved with a speed of v - 3 km/h and travelled a distance (again) of x km in 6 hours.

We want v, so solve the first equation for x:

Insert this value of x into the second equation:

Now solve for v. I get v = 6 km/h.

-Dan