In this section curvilinear coordinate systems will be presented, these are coordinate systems that are based on a set of basis vectors that are neither orthognal nor normalized.
> *Principle*: space can be equipped with a smooth and continuous coordinate net.
## Covariant basis
> *Definition*: consider a coordinate system $(x_1, x_2, x_3)$ that is defined by the function $\mathbf{x}: \mathbb{R}^3 \to \mathbb{R}^3$. Producing a position vector for every combination of coordinate values.
>
> * For two coordinates fixed, a coordinate curve is obtained.
> * For one coordinate fixed, a coordinate surface is obtained.
We will now use this coordinate system described as $\mathbf{x}$ to formulate a set of basis vectors.
> *Definition*: for a valid coordinate system $\mathbf{x}$ a set of linearly independent covariant (local) basis vectors can be described by
> for all $(x_1, x_2, x_3) \in \mathbb{R}^3$ and $i \in \{1, 2, 3\}$.
Obtaining basis vectors that are tangential to the corresponding coordinate curves. Therefore any vector $\mathbf{u} \in \mathbb{3}$ can be written in terms of its components with respect to this basis
$$
\mathbf{u} = \sum_{i=1}^3 u_i \mathbf{a}_i
$$
with $u_{1,2,3} \in \mathbb{R}$ the components.
> *Definition*: the Einstein summation convention omits the summation symbol and is defined by
> with $u^{1,2,3} \in \mathbb{R}$ the contravariant components. The definition states that
>
> 1. When an index appears twice in a product, one as a subscript and once as a superscript, summation over that index is implied.
> 2. A superscript that appears in denominator counts as a subscript.
This convention makes writing summation a lot easier, though one may see it as a little unorthodox.
## The metric tensor
> *Definition*: for two vectors $\mathbf{u}$ and $\mathbf{v}$ in $\mathbb{R}^3$ that are represented in terms of a covariant basis, the scalar product is given by
with $h_i = \sqrt{\langle \mathbf{a}_i, \mathbf{a}_i \rangle} = \|\mathbf{a}_i\|$ the scale factors for $i \in \{1, 2, 3\}$.
> *Theorem*: the determinant of the metric tensor $g := \det(g_{ij})$ can be written as the square of the scalar triple product of the covariant basis vectors
>
> $$
> g = \langle \mathbf{a}_1, \mathbf{a}_2, \mathbf{a}_3 \rangle^2.
> $$
??? note "*Proof*:"
Will be added later.
<br>
> *Corollary*: consider a covariant basis and the infinitesimal coordinate transformations $(dx_1, dx_2, dx_3)$ spanned by the covariant basis then the volume defined by these infinitesimal coordinate transformations is given by
> by definition of the scalar triple product. For a function $f: \mathbb{R}^3 \to \mathbb{R}$ its integral in the domain $D \subseteq \mathbb{R}^3$ with $D = [a_1, b_1] \times [a_2, b_2] \times [a_3, b_3]$ and $a_i, b_i \in \mathbb{R}$ for $i \in \{1, 2, 3\}$ closed may be given by
The covariant basis vectors have been constructed as tangential vectors of the coordinate curves. An alternative basis can be constructed from vectors that are perpendicular to coordinate surfaces.
> *Definition*: for a valid set of covariant basis vectors the contravariant basis vectors may be defined given by
By combining the expressions for the components a relation can be established between $g_{ij}$ and $g^{ij}$.
> *Theorem*: the components of the metric tensor for covariant and contravariant basis vectors are related by
>
> $$
> g_{ij} g^{jk} = \delta_i^k.
> $$
??? note "*Proof*:"
Will be added later.
This is the index notation for $(g_{ij})(g^{ij}) = I$, with $I$ the identity matrix, therefore we have
$$
(g^{ij}) = (g_{ij})^{-1},
$$
concluding that both matrices are nonsingular.
> *Corollary*: let $\mathbf{u} \in \mathbb{R}^3$ be a vector, for orthogonal basis vectors it follows that the covariant and contravariant basis vectors are proportional by
>
> $$
> \mathbf{a}^i = \frac{1}{h_i^2} \mathbf{a}_i,
> $$
>
> and for the components of $\mathbf{u}$ we have
>
> $$
> u^i = \frac{1}{h_i^2} u_i,
> $$
>
> for all $i \in \{1, 2, 3\}$.
??? note "*Proof*:"
Will be added later.
Therefore it also follows that for the special case of orthogonal basis vectors the metric tensor for contrariant basis vectors $(g^{ij})$ is given by
In particular the length of a vector $\mathbf{u} \in \mathbb{R}^3$ can then be determined by
$$
\|\mathbf{u}\| = \sqrt{u^{(i)} u_{(i)}}.
$$
We will discuss as an example the representations of the cartesian, cylindrical and spherical coordinate systems viewed from a cartesian perspective. This means that the coordinate maps are based on the cartesian interpretation of then. Every other interpretation could have been used, but our brains have a preference for cartesian it seems.
Let $\mathbf{x}: \mathbb{R}^3 \to \mathbb{R}^3$ map a cartesian coordinate system given by
$$
\mathbf{x}(x,y,z) = \begin{pmatrix} x \\ y \\ z\end{pmatrix},
It may be observed that this set of basis vectors is orthogonal. Therefore the scaling factors are given by $h_1 = 1, h_2 = 1, h_3 = 1$ as to be expected for the reference.
<br>
Let $\mathbf{x}: \mathbb{R}^3 \to \mathbb{R}^3$ map a cylindrical coordinate system given by
$$
\mathbf{x}(r,\theta,z) = \begin{pmatrix} r \cos \theta \\ r \sin \theta \\ z\end{pmatrix},