Cube in Spherical Coordinates not centred at the origin I`ve seen that there are already a couple of questions about how to describe a cube in Spherical Coordinates. However they are all centred at the origin.
I would like to describe a cube in Spherical Coordinates which has vertices in $(0; 0; 0), (0; 1; 0), (1; 0; 0), (1; 1; 0), (0; 0; 1),
(0; 1; 1), (1; 0; 1)$ and $(1; 1; 1)$. So basically is a cube in the first quadrant with four vertices on the three axes.
My idea was first of all starting by describing a square in spherical coordinates, so that I can use what I find to describe the cube more easily. The square that I take is the base of this cube, i.e. $(0; 0; 0), (0; 1; 0), (1; 0; 0), (1; 1; 0)$. This is what I got, by simple geometry: (Where $\theta$ is the angle with the $x$ axis and $r$ is the length of the radius.)
$\{(r,\theta) : 0\leq\theta\leq\frac{\pi}{4} , 0\leq r\leq sec(\theta)\}\cup\{(r,\theta) :\frac{\pi}{4}<\theta\leq\frac{\pi}{2}, 0\leq r\leq cosec(\theta)\}$
Now I was trying to develop this into the $xyz$ plane, using $\rho$ as $\rho^2=x^2+y^2+z^2$ and $\phi$ as the angle between the $z$ axis and $\rho$. However it gets very complicated and even if I literally built a huge paper cube to be able to visualize better the situation, I don`t understand how to describe it.
I was thinking of dividing the whole thing mainly in two big cases:


*

*When $0\leq \theta\leq \frac{\pi}{4}$

*When $\frac{\pi}{4}< \theta\leq \frac{\pi}{2}$


So in the first one we have some subcases:


*

*When $\theta=0$ then we basically have the situation of the square, just in the $zx$ plane instead on the $xy$ plane

*When $\theta=\frac{\pi}{4}$ then is similar to the situation of the square, however now we have a rectangle, where one side is $1$ and the other is $\sqrt{2}$. However using similar arguments that those used for the square, I found out that we basically get almost the same by a factor of $\sqrt{2}$, i.e. $\{(\rho,\phi) : 0\leq\phi\leq\frac{\pi}{4} , 0\leq \rho\leq \sqrt{2}sec(\theta)\}\cup\{(\rho,\phi) :\frac{\pi}{4}<\phi\leq\frac{\pi}{2}, 0\leq \rho\leq \sqrt{2}cosec(\theta)\}$.


*When $0<\theta<\frac{\pi}{4}$.



I have no idea on how to go ahead. How should I describe this part?
And after doing this huge part $0\leq\theta\leq\frac{\pi}{4}$ how should I work to get the other part, i.e. $\frac{\pi}{4}<\theta\leq\frac{\pi}{2}$?
Please help me, I know it is very laborious but I tried to do this all afternoon. There must be a way.
Thanks
 A: If you're working in spherical coordinates only because you're integrating a spherically-symmetric function, you might reconsider whether Cartesian coordinates are simpler. Or, if you're (say) trying to calculate the flux of a radially-symmetric field through the faces of the cube, Gauss's theorem may obviate the need to describe a cube in spherical coordinates.
That said: There are several conventions for spherical coordinates, but based on your user name I'll assume you're using $\phi$ to denote longitude and $\theta$ to denote colatitude, so that
$$
(x, y, z) = (\rho\cos\phi \sin\theta, \rho\sin\phi \sin\theta, \rho\cos\theta),\qquad 0 \leq \phi \leq 2\pi,\quad 0 \leq \theta \leq \pi.
$$
The planes $x = 1$, $y = 1$, and $z = 1$ have respective equations
$$
\rho = \sec\phi \csc\theta,\qquad
\rho = \csc\phi \csc\theta,\qquad
\rho = \sec\theta.
$$
One way to integrate over your cube is $0 \leq \phi \leq \pi/2$, $0 \leq \theta \leq \pi/2$, and
$$
0 \leq \rho \leq \min(\sec\phi \csc\theta, \csc\phi \csc\theta, \sec\theta).
$$
The remaining problem is to split up the square in the $(\phi, \theta)$-plane so that the minimum on the right can be replaced, in each of three regions, by one of the formulas inside the minimum. This is mildly vexing geometrically, because the edges of the cube in the plane $z = 1$ do not correspond to lines in the $(\phi, \theta)$-plane.
An algebraic argument may work best: The plane $x = z$, for example, has equation $\sec\phi \csc\theta = \sec\theta$, or $\sec\phi = \tan\theta$, or $\theta = \arctan(\sec\phi)$. The integral over the corresponding third of the cube (the pyramid with vertex at the origin and the face $x = 1$ as base) has limits
$$
0 \leq \phi \leq \pi/4,\qquad
\arctan(\sec\phi) \leq \theta \leq \pi/2,\qquad
0 \leq \rho \leq \sec\phi \csc\theta.
$$
The other two pyramids are similar; I leave the pleasure of working out the details to you.
