# Volume inside a sphere and cone

Find the volume laying inside x^2 + y^2 + z^2 =2z and inside z^2 = x^2 + y^2.

This is a problem my professor made, so I have no way of checking my answer.
What I did first was completed the square for the sphere and got x^2 + y^2 + (z-1)^2 = 1, which is a sphere of radius one shifted above the z axis by one. and z^2 = x^2 + y^2 is two cones, but I am only worried about the one above the z axis.
I changed x^2 + y^2 + (z-1)^2 = 1 into spherical coordinates: (ρ^2)sin^2(Φ) + (ρ^2)cos^2(Φ) - 2ρcosΦ = 0 and got ρ = 2cosΦ.
So the limits for θ are from 0 to 2pi, ρ is from 0 to 2cosΦ, and since I am going from the top of the sphere to the bottom of the cone above the z axis I think my limits for Φ are from 0 to pi/2.
So my integral is ∫(0,2pi)∫(0,pi/2)∫(0,2cosΦ) (ρ^2)sinΦ dρdΦdθ which is a pretty simple integral. Does this look right? I'm not 100% sure on my ρ and Φ limits.

You can see that for z=1 both equations become x2+y2=1 and for z>0 sphere lays below the "cone". Two surfaces makes two volumes the sum of them is the total sphere volume. Changing z by z-1 both equations the sphere have the circle x2+y2=1 on the x-y plane. Now is easy to separate integral limits with azimuth but you need not this.
Calculate the cone volume (must be negative), convert to positive and add or remove from the half sphere volume.

Last edited:
BvU