# Expressing contravariant basis vectors in terms of position vector

I am learning about general curvilinear bases for my research, and I have a question about notation for contravariant basis vectors.

Suppose we have a point in space defined by the position vector $\mathbf{r}=x_k\mathbf{e}_k$, where $x_k$ are the components with respect to a Cartesian basis $\mathbf{e}_k$. If we want to define a natural covariant basis in terms of general curvilinear coordinates $\theta_i$ at the point of interest, then we write $$\mathbf{g}_i = \frac{\partial \mathbf{r}}{\partial \theta^i}.$$ This way to define and calculate a covariant basis makes sense to me, and I have seen this definition in many different resources. We can then formulate a contravariant basis using $$\mathbf{g}^i \cdot \mathbf{g}_j = \delta^i_j.$$ Again, this definition makes sense to me and I have seen this in many different resources.

In the interest of notation, I am curious as to whether or not the contravariant basis can be defined as $$\mathbf{g}^i = \frac{\partial \theta^i}{\partial \mathbf{r}},$$ or if this is incorrect. I have only seen one other source write this expression and claim that it is indeed a proper way to express the contravariant basis. As far as actually calculating the basis vectors in a simple example problem, I have no idea how I would go about using the second definition of a contravariant basis vector to do the calculations.

Has anyone else seen this definition before?

Suppose you introduce a set of coordinates on your space $S$: that is, a set of numbers $\theta^i$ that label each point uniquely, $\mathbf{r}=\mathbf{r} (\theta^i)$, so $\mathbf{r}$ is a function from the coordinate space to $S$. But we can equally well go the other way, and introduce coordinate functions $\theta^i$ that take a point in $S$ and return a number, that we think of as the $i$th coordinate of the point $\mathbf{r}$ (one has to be sensible in choosing these functions so that they are "good coordinates", and there is a well-defined way to get back to $\mathbf{r}$ if given all of its coordinates).
Suppose $\mathbf{r}=\mathbf{r} (\theta^i)$. Then $$\mathbf{e}_i = \frac{\partial \mathbf{r}}{\partial \theta^i}$$ are an obvious thing to write down; if we think $(\mathbf{g}_i)$ as the Jacobian of the map from the space of coordinates to $S$, the uniqueness of the representation implies that the $\mathbf{e}_i$ should all be linearly independent, and hence at each point of $S$ they are a basis of the vector space they span, which is called the tangent space of $S$. Since you seem to already be familiar with this basis, I'll say no more about it here, except that we can think of $\mathbf{e}_i$ as "going in the direction of increasing $\theta^i$ when all the other $\theta^j$ are held constant". (In more advanced work, it is more normal to think of vectors as differential operators, so the basis vectors are instead $\partial/\partial \theta^i$, and are objects that act on functions on the space $S$; by the chain rule, this is equivalent to the present formulation in a sense we do not need to make precise at this point.)
On the other hand, suppose we instead think of the coordinate functions $\theta^i(\mathbf{r})$. These are functions of the variable $\mathbf{r}$, and we know how to differentiate with respect to $\mathbf{r}$, which is to take the gradient. We define vectors $$\mathbf{f}^i = \nabla \theta^i,$$ where $\nabla$ is the usual gradient on $S$. (It is generally preferable to write this rather than $\partial/\partial \mathbf{r}$, which suggests dividing by a vector. One also sees this written as "$d\theta^i$".). We can think of these as "vectors that are perpendicular to the set $\theta^i(\mathbf{r}) = \text{constant}$, and point in the direction of increasing $\theta^i$", which is one interpretation of the gradient. One advantage of this idea we can see immediately: we don't have to talk about what is constant, as we do in the covariant case, and this makes some objects behave better when considered in this basis. On the other hand, it is rather less familiar to talk about coordinates as functions on a space than as numbers.
In fact, as you mention, the $\mathbf{f}^i$ form a dual basis of the dual space of the tangent space, the cotangent space. How do we know these are dual? The answer, as you've probably noticed, is that going from $\mathbf{r}$ to $\theta^i$ is inverse to going from $\theta^i$ to $\mathbf{r}$, so the chain rule/inverse function theorem gives $$\delta_i^j = \frac{\partial \theta^j}{\partial \theta^i} = \frac{\partial \mathbf{r}}{\partial \theta^i} \cdot \nabla\theta^j = \mathbf{e}_i \cdot \mathbf{f}^j,$$ where some elision has taken place to avoid introducing components of $\mathbf{r}$ and further complication.