What is the general formula for calculating dot and cross products in spherical coordinates?

Here are two ways to derive the formula for the dot product. I assume that $v_1$ and $v_2$ are vectors with spherical coordinates $(r_1, \varphi_1, \theta_1)$ and $(r_2, \varphi_2, \theta_2)$.

First way: Let us convert these spherical coordinates to Cartesian ones. For the first point we get Cartesian coordinates $(x_1, y_1, z_1)$ like this: $$ \begin{array}{rcl} x_1 & = & r_1 \sin \varphi_1 \cos \theta_1, \\ y_1 & = & r_1 \sin \varphi_1 \sin \theta_1, \\ z_1 & = & r_1 \cos \varphi_1. \end{array} $$ Similar formulas hold for $(x_2, y_2, z_2)$. Now, the dot product is simply equal to $$ (v_1, v_2) = x_1 x_2 + y_1 y_2 + z_1 z_2 = \\ = r_1 r_2 ( \sin \varphi_1 \sin \varphi_2 ( \cos \theta_1 \cos \theta_2 + \sin \theta_1 \sin \theta_2) + \cos \varphi_1 \cos \varphi_2) = \\ = r_1 r_2 ( \sin \varphi_1 \sin \varphi_2 \cos (\theta_1 - \theta_2) + \cos \varphi_1 \cos \varphi_2) $$

Second way: Actually, we could have done it without coordinate conversions at all. Indeed, we know that $(v_1, v_2) = r_1 r_2 \cos \alpha$, where $\alpha$ is the angle between $v_1$ and $v_2$. But $\cos \alpha$ can be immediately found by the Spherical law of cosines, which yields exactly the same formula that we just proved. Basically, our first way is itself a proof for the spherical law of cosines.

PS: I'm not saying anything about cross products, but my guess is that the correct formula will look terrible. Not only will it contain sines and cosines, it is likely that it will also contain arc functions (they will appear when we try to convert the result back to spherical coordinates). Unless those arc functions magically cancel out with all the sines and cosines. But it is highly unlikely, and I don't feel like going through the trouble of checking.

PPS: One more thing. Cross products are not the only scary thing about spherical coordinates. If you think about it, even addition of two vectors is extremely unpleasant in spherical coordinates. Multiplication by a number is alright though, because it only changes $r$ and doesn't affect $\varphi$ and $\theta$ (at least when we multiply by a positive number).


Since $u_r,u_{\phi},u_{\theta}$ forms a right handed orthonormal frame of unit vectors the rules for computing vectors at a point $p$ expressed in the frame at $p$ is precisely the same as that for the globally constant Cartesian frame. For example,

$$ \vec{V}_1 \cdot \vec{V}_2 = 2(3)+\frac{\pi}{3}\frac{\pi}{6}+\frac{\pi}{4}\frac{\pi}{2} $$

More generally, if we count $u_1,u_2,u_3$ as $u_r,u_{\phi},u_{\theta}$ then I can define dot and cross products by the usual formulas:

$$ u_i \cdot u_j = \delta_{ij} \qquad u_i \times u_j = \sum_k \epsilon_{ijk} u_k $$

The vectors $u_i$ are not fixed vectors like $e_1,e_2,e_3$ or perhaps you prefer $\hat{i},\hat{j},\hat{k}$, the $u_r,u_{\phi},u_{\theta}$ are vector fields. You can construct them by normalizing the gradient vector fields of the spherical coordinate functions if you wish to know what their formulas are explicitly in terms of the Cartesian frame.

$$ r = \sqrt{x^2+y^2+z^2} \ \ \implies \ \ \nabla r = \frac{1}{r}\langle x,y,z\rangle \ \ \implies \ \ u_r = \frac{1}{r}\langle x,y,z\rangle $$

In view of $x = r\cos \theta \sin \phi, y = r\sin \theta \sin \phi, z = r\cos \phi$ the spherical unit vector field is given by:

$$ u_r = \langle \cos \theta \sin \phi, \sin \theta \sin \phi, \cos \phi \rangle $$

a formula which is totally unsurprising if you think about the unit-sphere and the geometric relation between a normal to the sphere and the radial direction to any point further away (or closer) the origin.

I have much more posted here (see my section 1.6).


I refer you (and new readers) to Introduction to Electrodynamics by D.J. Griffiths, third edition, page 39.