Both the containers contain liquid up to the same height, and they're connected by a tube. >If the liquid in the container _A_ is heated, which direction should the water flow in? And similarly, if the container _B_ is heated, which direction will the liquid flow then? >We have to assume that the shape of the containers is not affected by the heating of liquid. [![Two containers A, and B][1]][1] [1]: https://i.sstatic.net/26chN2KM.png $$$$ What I've been thinking is this: Consider a cylindrical container containing a liquid. It is easy to see that weight of liquid divided by the area of the base of the container is pressure at the bottom. Since neither the area nor the weight of the liquid changes on heating, the pressure remains constant. And since, $P = \rho g h$, it means that here $\rho h$ remained constant, density decreases, but height increases. But, for containers that aren't shaped like cylinders, I'm facing problems to see how the change in height would react with the change in density. Because this is not free expansion, and is restricted by the container too, I thought, it wouldn't be correct to assume the change in height as a linear relation for both the containers. But, if I can compare the required change in height, to keep the pressure same, against the actual change in height for each container, then I'll get the result to whether the pressure in the container will reduce or increase. But, how can I approach doing that? I also am not sure about the answer to this problem, although, the answer given is this: In both cases, liquid flows from _B_ to _A_.