The solution depends on only one thing, which I will call r. This is the ratio of the mass of the can to the mass of the liquid. In UncleBill’s notation, it’s a/b, but I called it m/M. For a light liquid in a lead bucket, r is large. For a heavy liquid in a paper bucket, r is small.
We need one variable - call it x. This is the fraction that the cup is full. For an empty cup, x = 0. For a full cup, x = 1. If the can is symmetrical and the height of the liquid in a full cup is H, then the mass of the liquid at any given level of fullness is xM, and its height is xH. Thus the liquid’s center of mass is half of this, or xH/2. The center of mass of the cup itself is always H/2. The center of mass of the system is then:
(m × H/2 + xM × xH/2) / (m + xM)
= H/2 × f(x), where
f(x) = (x[sup]2[/sup] + r) / (x + r)
(Notice that f(0) = 1 and f(1) = 1 no matter what r is.) This now becomes a straightforward calculus problem. For what x is f(x) minimized, and what is its minimum value? Sparing you the details, the answer is:
x[sub]MIN[/sub] = sqrt(r[sup]2[/sup] + r) - r
f(x[sub]MIN[/sub]) = 2x[sub]MIN[/sub]
For instance, for a light fluid in a lead container (I know I keep switching words for the “can”. Sorry.), we might have r = 10, and then x[sub]MIN[/sub] = 0.488. That is, the center of mass will be minimized when the can is 48.8% full. For extremely large r’s, x[sub]MIN[/sub] will get close to 50%. So, for a very heavy container, the center of mass will be lowest when it’s almost half full.
For a heavy fluid in a light container, like mercury in paper, you might have r = 0.01. Then x[sub]MIN[/sub] = 0.0904. That is, the center of mass will be lowest when the container is only 9.04% full. As r gets smaller and smaller, this value also drops more and more. For very small r’s, it goes roughly like sqrt®.