Posted by Karl Haxell on .
A perfectly cylindrical container standing upright with a top and bottom (an oil drum
or coke can for example) has an empty mass of M and a height of H. It is filled with
a liquid of uniform density of variable mass m up to height h. When the container is
full the centre of gravity is in the centre (H/2). As the container is emptied and m
reduces the centre of gravity moves down. Once the container is empty the centre
of gravity is again at the centre (height H/2). Using calculus calculate the value of h
in terms of H, m and M when the centre of gravity is at its lowest position.

Engineering Maths 
MathMate,
m is a function of height h, namely
m(h) = ρAh
The centre of gravity is at a distance x from the bottom of the cylinder, given by:
x(h)=(M*H/2+m*h/2)/(M+m)
substitute m=m(h)
x(h)=(MH/2+ρAh²/2)/(M+ρAh)
1. Differentiate with respect to h,
2. equate derivative to zero for maximum
3. Solve for h when dx/dh=0 to get
hmax=(sqrt(M^2+ρAHM)M)/(ρA)
the negative root is rejected.
Check the calculations.