Representation of a sphere as $\left\{\theta \in [0,2\pi], \phi \in [0,\pi], R\in [0, r]\right\}$ In spherical coordinates, a sphere can be described as $S = \left\{\theta \in [0,2\pi], \phi \in [0,\pi], r\in [0, R]\right\}$
by letting  $x = r\sin \pi \cos \theta, ~ y= r \sin \phi \sin \theta,$ and $z= r\cos \phi$ in the equation $x^2+y^2+z^2 = R$. 
This apparently comes from the parametrisation after considering the top surface and bottom surface by drawing a picture. I've tried, but I'm honestly incapable of thinking geometrically. 
Question 1: Could someone explain how one can come to this representation algebraically? 
Question 2: If we consider the region between the sphere $x^2+y^2+z^2 = R$ and the cone $z = \sqrt{x^2+y^2}$, the upper bound for $\phi$ changes and everything else stays the same:  we have
$$S'=\left\{\theta \in [0,2\pi], \phi \in [0,\pi/4], r\in [0, R]\right\}$$
Why is that? I'm thinking because we're only considering a quarter of the sphere, but I'm not sure. 
 A: Let's first describe the outer surface of the sphere: pick a point $P$ on the surface and consider the radius connecting the origin to $P$. Now let $\phi$ be the angle between the radius and the positive $z$ semi-axis: it is evident that the height of $P$ can be written as $r\cos\phi$, where $r$ is the radius of the sphere.
Now consider the circumference obtained by cutting the sphere orthogonally to the $z$ axis and containing $P$. The radius connecting $P$ to the center of the circumference (that is, the distance between $P$ and the $z$ axis) has length $R_C=r\sin\phi$: you can then describe the circumference on coordinates $x$ and $y$ in the usual way: $y=R_C\sin\theta=r\sin\phi\sin\theta$ and $x=R_C\cos\theta=r\sin\phi\cos\theta$, with $\theta \in [0, 2\pi]$. Since we need to sweep these circumferences only from top to bottom and not all the way around, we take $\phi \in [0, \pi]$.
In this way we have described the outer surface of the sphere, but by varying $r$ we can again sweep all possible spherical surfaces with radius between $0$ and $R$, touching all the internal points of the sphere. Hence, $r\in[0, R]$.
I think that now, reasoning on the function of $\phi$, you can better understand the problem in Question 2.
P.S. Sometimes a Google image search is your friend.

