Context
There are numerous posts on mathstackexchange and physicsstack exchange that seek clarity regarding conversion from a Cartesian coordinate system to curvilinear coordinate system, or viceversa [1,2]. Yet, none of them seem complete to me. So, I want to ask a question here that I think illuminates the matter. One of the thorny issues for me is that a coordinates triple might be given in spherical coordinates (or cylindrical coordinates), but the basis vectors appear to to Cartesian. For example the distance, $d$ between $P$ given by $\mathbf{r}$ and $Q$ given by $\mathbf{r}'$ is \begin{align} d &= \left\|\mathbf{r} - \mathbf{r}'\right\| \\ d &= \left\| \left(x- x'\right)\,\hat{\mathbf{x}} + \left(y- y'\right)\,\hat{\mathbf{y}} + \left(z- z'\right)\,\hat{\mathbf{z}} \right\| \\ &= \qquad \qquad \qquad \qquad \vdots \\ &= \sqrt{\left(x- x'\right)^2+ \left(y- y'\right)^2+ \left(z- z'\right)^2 } \end{align} This computation is done in Cartesian coordiantes with Cartesian basis vectors. Often, I see [3] \begin{align} d &= \left\|\mathbf{r} - \mathbf{r}'\right\| \\ d &= \left\| \left(r\,\sin\theta\,\cos\varphi- r'\,\sin\theta'\,\cos\varphi'\right)\,\hat{\mathbf{x}} + \left(r\,\sin\theta\,\sin\varphi- r'\,\sin\theta'\,\sin\varphi'\right)\,\hat{\mathbf{y}} + \left(r\,\cos\theta- r'\,\cos\theta'\right)\,\hat{\mathbf{z}} \right\| \\ &= \qquad \qquad \qquad \qquad \vdots \\ &= \sqrt{r^2+r'^2-2rr'(\sin{\theta}\sin{\theta'}\cos{(\varphi-\varphi')} + \cos{\theta}\cos{\theta'})} \end{align} Notice that the basis vectors were always Cartesian, even though the coordinates were spherical.
Question
In electrodynamics, the practitioner is often concerned with integrals with two sets of coordinates. For example, with an integral similar to
$$
X(\mathbf{r}) = \int_{V} f(\mathbf{r}') \times (\mathbf{r}- \mathbf{r}')\, dV'.
$$
Here, I use a cross product $\times$ but similar forms exist with dot products or standard products. Let, say that the function $f$ has very clear spherical symmetry, how can we write
$$f(\mathbf{r}^\prime )\times
\left( \mathbf{r} - \mathbf{r}^\prime\right)$$
in the spherical system. Please, rather than give a triple in parenthesis, please explicitly include basis vectors in your answer.
Let, say that the function $g$ has very clear cylindrical symmetry, how can we write
$$g(\mathbf{r}^\prime )\times
\left( \mathbf{r} - \mathbf{r}^\prime\right)$$
in the cylindrical system. Please, rather than give a triple in parenthesis, please explicitly include basis vectors in your answer.
Bibliography
[2] Vector sum in spherical coordinates
[3] https://en.wikipedia.org/wiki/Spherical_coordinate_system