finding work required to pump water out of a tank

The tank has the shape of a horizontal cylinder with radius $$r$$ and length $$l$$. The water exists through a small opening on the top right side of the cylinder. It seems that there are two ways to solve this problem:

• integrate horizontally
• integrate vertically

My first attempt was done by integrating vertically. Slicing the cylinder horizontally produces a rectangle of length $$l$$ and width $$2x$$. Using Pythagorean theorem we obtain $$x=\sqrt{r^2-y^2}$$.

The volume can be found by adding up small rectangular prims, i.e., $$V = 2xl\Delta y = \int_{-r}^{r}2l(\sqrt{r^2-y^2})dy$$.

To make sure this is correct let $$l=5$$ and $$r=2$$. The volume of this cylinder is $$V=\pi r^2h = 62.83$$. The volume obtained using the integral is also $$62.83$$.

I encounter problems when I try to find the work required to pump the water.

The mass of the water is the volume times the density $$m = 2000l\sqrt{r^2-y^2}\Delta y$$

The force due to gravity is $$F = (9.8)\left(2000l\sqrt{r^2-y^2}\Delta y\right)=19600l\sqrt{r^2-y^2} \Delta y$$

The water must travel a distance of $$-y+r$$ to exit through the small hole, thus the work required to pump the water is $$W = 19600l\sqrt{r^2-y^2}(r-y) \Delta y$$

Which is $$19600l\int_{-r}^{r}\sqrt{r^2-y^2}(r-y)dy$$

After taking this (nasty) integral we get $$W = 9800\pi lr^3$$.

For some reason I seem unable to understand the horizontal integration.

I know the volume can be expressed as $$V = \pi r^2 \Delta l$$. Thus, the mass is $$1000\pi r^2 \Delta l$$, force is $$9800 \pi r^2 \Delta l$$ and the work is $$9800 \pi r^2 \int_0^l dl = 9800\pi r^2 l$$

Where does the other $$r$$ come from?

That said, in this case, it's simple enough to see that the center of gravity of the water in a filled tank lies $$r$$ below the level of the opening. This vertical displacement from the center of gravity to the opening is where you find the missing $$r$$.