# Taking the dot product in polar coordinates using the metric tensor

In elementary vectors class, we learn a nice formula for the dot product of two vectors,

$$\mathbf{a}\cdot\mathbf{b}=|\mathbf{a}||\mathbf{b}|\cos\theta,\tag{1}$$ where $$\theta$$ is the angle between the two vectors. Let's work in 2D to keep things simple.

In general relativity (and presumably in differential geometry), we learn that the scalar product of two vectors is given by

$$\mathbf{a}\cdot\mathbf{b}=a_\mu b^\mu=g_{\mu\nu}a^\nu b^\mu=g_{11}a^1b^1+g_{12}a^1b^2+g_{21}a^2b^1+g_{22}a^2b^2,\tag{2}$$

where $$g_{\mu\nu}$$ is the metric tensor. Both formulas agree when we use Cartesian coordinates. What about polar coordinates? For flat space in polar coordinates, the metric is

$$g_{\mu\nu}=\begin{bmatrix}1 & 0\\0 & r^2\end{bmatrix}.$$

(Right?) Writing our vectors component-wise in polar coordinates, $$\mathbf{a}=\left(r_a,\theta_a\right),\,\mathbf{b}=(r_b,\theta_b),$$ and naively applying the metric-based formula,

$$\mathbf{a}\cdot\mathbf{b}=r_ar_b+r^2\theta_a\theta_b.$$

Clearly this is incorrect, and inconsistent with $$(1)$$. As discussed in the following posts, 1, 2, the issue stems from confusing a point $$(r,\theta),$$ with a vector from the origin pointing to $$(r,\theta).$$ Writing our vectors as tuples $$\mathbf{a}=\left(r_a,\theta_a\right)$$ is incorrect.

Clearly, if we have two arbitrary vectors in 2D euclidean space, we can talk about the angle between them, and so the $$(1)$$ should still hold even if we are working in a different coordinate system.

How can $$(2)$$ be applied to vectors in a polar coordinate system, such that it reduces to $$(1)$$? How must we write our vector-components for $$\mathbf{a}$$ such that $$(2)$$ can be applied?

• The inner product depends on the metric $g$. With other metrics, we use different notation such as $\langle a,b\rangle_g$ or $g_p(a,b)$ rather than $a\cdot b$ to emphasise this. Commented Dec 30, 2019 at 20:54
• The formulas $(1)$ and $(2)$ are both right (if interpreted properly), and the formula $\vec{a} \cdot \vec{b} = r_ar_b + r^2 \theta_a \theta_b$ is also correct, provided you interpret it correctly. The main issue you're having is not distinguishing a point in a manifold, and tangent vectors in the tangent space at that point. Also, your notation of $(r_a, \theta_a)$ is very misleading, because $r_a$ is NOT the length of the vector $\vec{a}$, and $\theta_a$ is NOT the "angle $\vec{a}$ makes with the positive $x$-axis". Commented Dec 30, 2019 at 21:05
• @peek-a-boo Apologies for the misleading notation. What should $r_a$ and $\theta_a$ be if $(2)$ is to hold? Perhaps I could work backwards from $(1).$ Commented Dec 30, 2019 at 21:07
• Your formula for $g_{\mu \nu}$ is also correct by the way. But the thing is, you're using a lot of shorthand notation, so unless you know PRECISELY what you mean, you're bound to make mistakes and get confused. Commented Dec 30, 2019 at 21:07
• In other words, we DEFINE the angle $\alpha$ by the equation $\alpha := \arccos \left( \dfrac{g(\xi, \eta)}{\sqrt{g(\xi, \xi)} \sqrt{g(\eta, \eta)} }\right)$. So, in this sense, the answer to your question is that pretty much everything is equivalent by definition, and there is nothing to prove. This may not be very satisfying, so I'll write up an answer which highlights some things. But at the moment I'm not sure how better to phrase my answer, so it may seem slightly circular... perhaps someone else might have a better way of framing the argument/ though process Commented Dec 30, 2019 at 22:52

A "warning": there are a lot of subtle issues here, but in order to not write a textbook, I tried to limit myself to emphasize only some of the issues. Also, the organization definitely isn't perfect, but hopefully this clarifies some issues.

My first remark is more of a "sanity check". The notion of a metric tensor field $$g$$ is meant to generalize the familiar concept of dot product in Euclidean spaces to arbitrary smooth manifolds. So, obviously, if this generalization is to be useful in any reasonable sense, it better reproduce the old results. Second, changing coordinates is a completely "artificial" idea in the following sense: the naive definition of a vector is "an arrow with a certain magnitude and direction, emanating from a certain point".

Well, this "definition" can certainly be made more precise, but here's the key point: an arrow is an arrow! The arrow doesn't know anything about coordinates or components with respect to a basis, so it doesn't care whether you use cartesian/polar/elliptical/parabolic/hyperbolic or any other coordinate system. If you do the math properly, you should be describing the vector equally well in any coordinate system.

(I'll not write boldface simply for ease of typing). First, we recall the following definition:

Definition: A (Riemannian) metric tensor field on a smooth manifold $$M$$ is a map which assigns, in a "smooth" way, to each point $$p \in M$$ an inner product $$g_p$$ on the tangent space $$T_pM$$.

In your case, we shall specialize to the case $$M = \Bbb{R}^2$$, and when $$g$$ is the "standard metric". Now a point in $$M$$ is simply a tuple of numbers. In polar coordinates, we can specify a point using a radius $$r$$ and an angle $$\theta$$ as follows: $$p = (r \cos \theta, r \sin \theta)$$ (don't think of this as the cartesian components or "cartesian representation of polar coordinates" or anything else...this is simply a tuple of real numbers, and hence it is a point in $$\Bbb{R}^2$$. That's it.)

Now, let $$a,b \in T_pM$$ (i.e arrows which start at $$p$$). Now, note that $$T_pM$$ is a $$2$$-dimensional vector space, and hence it is spanned by two linearly independent vectors. There are several bases we can choose, but here are two of them: $$\left\{\dfrac{\partial}{\partial x}\bigg|_p, \dfrac{\partial}{\partial y} \bigg|_p\right\}$$ and $$\left\{\dfrac{\partial}{\partial r}\bigg|_p, \dfrac{\partial}{\partial \theta}\bigg|_p\right\}$$. What this means is that the vector $$a$$ can be written as \begin{align} a &= x_a \dfrac{\partial}{\partial x}\bigg|_p + y_a \dfrac{\partial}{\partial y}\bigg|_p \end{align} for some $$x_a, y_a \in \Bbb{R}$$. But there is nothing special with this basis, so we could just as well write \begin{align} a &= r_a \dfrac{\partial}{\partial r}\bigg|_p + \theta_a \dfrac{\partial}{\partial \theta}\bigg|_p \tag{*} \end{align} for some $$r_a, \theta_a \in \Bbb{R}$$. Note that the numbers $$x_a, y_a, r_a, \theta_a$$ are simply expansion coefficients when writing a vector relative to a basis! They by themselves do not have any physical/geometrical meaning it is the actual vectors $$a,b, \dfrac{\partial}{\partial x}\bigg|_p...$$ which have physical meaning, and it is the metric $$g$$ which contains all the geometric information about the space $$M$$ (if this point is unclear, you should revisit some linear algebra).

Now, let's figure out what $$x_a$$ and $$y_a$$ are. Use the fact that \begin{align} \dfrac{\partial}{\partial r}\bigg|_p &= \dfrac{\partial x}{\partial r}\bigg|_p \dfrac{\partial}{\partial x}\bigg|_p + \dfrac{\partial y}{\partial r}\bigg|_p\dfrac{\partial}{\partial y}\bigg|_p \\ &= \cos \theta \dfrac{\partial}{\partial x}\bigg|_p + \sin \theta \dfrac{\partial}{\partial y}\bigg|_p \end{align} and

\begin{align} \dfrac{\partial}{\partial \theta}\bigg|_p &= \dfrac{\partial x}{\partial \theta}\bigg|_p \dfrac{\partial}{\partial x}\bigg|_p + \dfrac{\partial y}{\partial \theta}\bigg|_p\dfrac{\partial}{\partial y}\bigg|_p \\ &= -r \sin \theta \dfrac{\partial}{\partial x}\bigg|_p + r\cos \theta \dfrac{\partial}{\partial y}\bigg|_p \end{align}

Plugging these equations into $$(*)$$ shows that \begin{align} a &= \left(r_a \cos \theta - r \theta_a \sin \theta \right) \dfrac{\partial}{\partial x} \bigg|_p + \left(r_a \sin \theta + r \theta_a \cos \theta \right) \dfrac{\partial}{\partial y} \bigg|_p \tag{\ddot \smile} \end{align} A similar equation holds for $$b$$ (just replace all $$a$$'s with $$b$$). Once again for emphasis: $$r, \theta$$ describe the point $$p = (r \cos \theta, r \sin \theta) \in \Bbb{R}^2$$ which is a distance $$r$$ from the origin, and an angle $$\theta$$ in the usual sense, whereas $$r_a, \theta_a$$ are simply the expansion coefficients of the vector $$a \in T_pM$$ relative to a specific basis. So, $$r_a$$ is NOT the length of the vector $$a \in T_pM$$, and $$\theta_a$$ is NOT the angle the vector $$a$$ makes!

So, what is the length of vector $$a$$? By definition, it is $$\sqrt{g_p(a,a)}$$ (the square root of the inner product of $$a$$ with itself). Now, \begin{align} \lVert a\rVert &= \sqrt{g_p(a,a)} \\ &= \sqrt{r_a^2 + r^2 \theta_a^2} \end{align} Similarly for $$b$$ (by the way, as a sanity check, verify for yourself that taking the sum of the squares of the expansion in $$\ddot{\smile}$$ is what is under the square root above).

What is the angle $$\alpha_a$$ which the vector $$a$$ makes with the positive $$x$$-axis? Well, as I mentioned in the comments, the notion of angle may seem slightly circular (but it isn't). But for the sake of routine computation, let's go with the flow. To avoid taking inverse trig functions, note that from the basis expansion $$(\ddot{\smile})$$, we have \begin{align} \cos(\alpha_a) &= \dfrac{r_a \cos \theta - r \theta_a \sin \theta}{\sqrt{r_a^2 + r^2 \theta_a^2}} \quad \text{and} \quad \sin(\alpha_a) = \dfrac{r_a \sin \theta + r \theta_a \cos \theta}{ \sqrt{r_a^2 + r^2 \theta_a^2}} \end{align} (what I'm actually doing here is using the fact that $$T_pM = T_p \Bbb{R}^2$$ has a canonical isomorphism with $$\Bbb{R}^2$$ as an inner product space, where the isomorphism is given by $$\xi\dfrac{\partial}{\partial x} \bigg|_p + \eta\dfrac{\partial}{\partial y} \bigg|_p \mapsto (\xi,\eta)$$.) A similar thing holds for the vector $$b$$.

So, finally, we can compute. Let $$\alpha = \alpha_a - \alpha_b$$; THIS is the angle between the vectors $$a$$ and $$b$$: \begin{align} \lVert a \rVert \lVert b \rVert \cos(\alpha_a - \alpha_b) &= \lVert a \rVert \lVert b \rVert \left( \cos \alpha_a \cos\alpha_b + \sin \alpha_a \sin \alpha_b \right) \\ & \dots \\ &= r_ar_b + r^2 \theta_a \theta_b \end{align} I have already given all the relevant formulas, so I leave it to you to plug in everything and verify the algebra in the steps $$\dots$$ I omitted.

So, to summarize, my claim is that really, there is actually nothing to be proven here, because the very notion of "angle between two vectors" is defined such that the inner product formula holds. But hopefully my answer above highlights some of the subtleties, most important of which is that $$r_a, \theta_a$$ (and $$x_a, y_a$$) are merely expansion coefficients with respect to a chosen basis, which means they tell you very roughly speaking "how much the vector $$a$$ points in the radial direction, and the angular direction", and that they are NOT the length of the vector and the angle it makes.

Also, it is very crucial to realize that these basis expansion coefficients $$x_a, \dots, \theta_a$$ by themselves do not have any meaning, it is only the vectors $$a,b, \dfrac{\partial}{\partial x}\bigg|_p \dots, \dfrac{\partial}{\partial \theta}\bigg|_p$$ which have meaning, and that it is the metric $$g$$ which encodes all the geometry of the manifold $$M$$ in question.

• @aRockStr Thinking of derivations as elements of the tangent space is definitely one of the first few topics in differential geometry. For references, I suggest reading John Lee's book Introduction to Smooth Manifolds. Another equivalent definition of tangent space is as equivalence classes of smooth curves in the manifold. I think it's the most geometric and intuitive definition of a tangent vector, and an explanation of this can be found in Loomis and Sternberg's Advanced Calculus book (freely and legally available online) in Section 9.4. (But for a first introduction I suggest Lee's book) Commented Dec 31, 2019 at 17:11
• One word of caution though... the vector $\dfrac{\partial}{\partial r} \bigg|_p$ does indeed correspond to the $\hat{r}|_p$ vector which we're all familiar with. However, $\dfrac{\partial}{\partial \theta} \bigg|_p$ does not correspond to the usual $\hat{\theta}|_p$ vector, because $\hat{\theta}|_p$ is normalized, while $\dfrac{\partial}{\partial \theta} \bigg|_p$ is not. But the relationship between them is easy to establish. From your formula for the components of the metric in polar coordinates, we have $g_{22} = r^2$. Commented Dec 31, 2019 at 17:16
• (I'm being lazy in typing so I use $\partial_r$ to mean $\dfrac{\partial}{\partial r} \bigg|_p$ etc) ... (cont) of $T_pM$ is $\begin{pmatrix} 1 & 0 \\ 0 & r^2 \end{pmatrix}$. i.e what we're saying is that $g_p(\partial_r, \partial_r) = 1$ and $g_p(\partial_r, \partial_{\theta}) = g_p(\partial_{\theta}, \partial_r) = 0$ and $g_p(\partial_{\theta}, \partial_{\theta}) = r^2$. Now, I refer you to my second paragraph where I put in bold that an arrow is an arrow, and that vectors do not care what coordinates/ basis you use. As long as you carry the computations carefully, you'll always get (cont) Commented Dec 31, 2019 at 17:33
• @aRockStr By the way, since you tagged general relativity, I HIGHLY recommend going to youtube and watching Frederic Schuller's lectures on general relativity, especially the first few lectures, which carefully builds up all the mathematical machinery needed (Lecture $5$ in particular is about tangent spaces). (I've watched the lectures many times but I still learn new things everytime I watch his lectures). And be sure to pay very close attention to lecture $3$ on multilinear algebra! That is very very very very crucial Commented Dec 31, 2019 at 17:50
• @DilithiumMatrix The term vector is often oversued. But, what I meant is the follwing: asking the question "is $\dots$ a vector?" is completely meaningless. What is a meaningful question is: "is $\dots$ an ELEMENT of a vector space?". If the answer to this question is yes, then we can call that object a vector in that vector space. But recall that a vector space is more than just a set! There is also the operation of addition and scalar multiplication defined. So, often when we say $(x,y)$ is a 2d vector or somehting to that effect, the more precise statement is that Commented Jan 5, 2020 at 14:48