The equation of the sphere is [MATH]x^2 + y^2 + z^2 = r^2[/MATH]
In our case the equation will be [MATH]x^2 + y^2 + z^2 = 5^2[/MATH]
We will take the bottom part of the sphere
[MATH]z = -\sqrt{25 - x^2 - y^2}[/MATH] (equation of the hemisphere)
work [MATH]=[/MATH] change in potential energy [MATH]= \Delta mgz = mgz_f - mgz_i[/MATH]
where [MATH]z_i[/math] and [math]z_f[/MATH] are initial and final heights respectively.
[MATH]m[/MATH] is the mass of the water inside the hemisphere, and [MATH]dm[/MATH] is a very small mass of that water.
then
[MATH]gz_f \ dm - gz_i \ dm[/MATH] is a very small work
Now, we just have to set the integral
work [MATH]= \int gz_f \ dm - \int gz_i \ dm[/MATH]
[MATH]dm = \rho \ dV[/MATH]
work [MATH]= \rho g\int z_f \ dV - \rho g\int z_i \ dV[/MATH]
[MATH]= \rho g\int \int \int z_f \ dz \ dy \ dx - \rho g\int \int \int z_i \ dz \ dy \ dx[/MATH]
setting up the limits
Remember that the first work will be done from the lowest point of the pool till the surface, and the second work will be done from the lowest point till [MATH]z = -2[/MATH]. By subtracting them from each other, we get the work done from [MATH]z = -2[/MATH] to [MATH]z = 0[/MATH] which is 2 meters at the top of the pool. And at [MATH]z = -2[/MATH], the radius of the circle on [MATH]x-y[/MATH] plane is [MATH]\sqrt{21}[/MATH].
so, the integral will be (without subscripts)
[MATH]= \rho g \ 2\int_{0}^{5} 2\int_{0}^{\sqrt{25 - x^2}} \int_{-\sqrt{25 - x^2 - y^2}}^{0} z \ dz \ dy \ dx - \rho g \ 2\int_{0}^{\sqrt{21}}2\int_{0}^{\sqrt{21 - x^2}} \int_{-\sqrt{25 - x^2 - y^2}}^{-2} z \ dz \ dy \ dx[/MATH]
[MATH]= 4\rho g \ \int_{0}^{5} \int_{0}^{\sqrt{25 - x^2}} \int_{-\sqrt{25 - x^2 - y^2}}^{0} z \ dz \ dy \ dx - 4\rho g \ \int_{0}^{\sqrt{21}}\int_{0}^{\sqrt{21 - x^2}} \int_{-\sqrt{25 - x^2 - y^2}}^{-2} z \ dz \ dy \ dx[/MATH]
Evaluating this integral with an online calculator will save you a lot of time, and also remember that the answer will be negative because we are calculating the bottom part of the sphere. Therefore, use the absolute value in the final result.