Coordinate system whose directions vary in space
In geometry, curvilinear coordinates are a coordinate system for Euclidean space in which the coordinate lines may be curved. These coordinates may be derived from a set of Cartesian coordinates by using a transformation that is locally invertible (a one-to-one map) at each point. This means that one can convert a point given in a Cartesian coordinate system to its curvilinear coordinates and back. The name "curvilinear coordinates", coined by the French mathematician Lamé, derives from the fact that the coordinate surfaces of the curvilinear systems are curved.
Well-known examples of curvilinear coordinate systems in three-dimensional Euclidean space (R3) are cylindrical and spherical coordinates. A Cartesian coordinate surface in this space is a coordinate plane; for example "z" = 0 defines the "x"-"y" plane. In the same space, the coordinate surface "r" = 1 in spherical coordinates is the surface of a unit sphere, which is curved. The formalism of curvilinear coordinates provides a unified and general description of the standard coordinate systems.
Curvilinear coordinates are often used to define the location or distribution of physical quantities which may be, for example, scalars, vectors, or tensors. Mathematical expressions involving these quantities in vector calculus and tensor analysis (such as the gradient, divergence, curl, and Laplacian) can be transformed from one coordinate system to another, according to transformation rules for scalars, vectors, and tensors. Such expressions then become valid for any curvilinear coordinate system.
A curvilinear coordinate system may be simpler to use than the Cartesian coordinate system for some applications. The motion of particles under the influence of central forces is usually easier to solve in spherical coordinates than in Cartesian coordinates; this is true of many physical problems with spherical symmetry defined in R3. Equations with boundary conditions that follow coordinate surfaces for a particular curvilinear coordinate system may be easier to solve in that system. While one might describe the motion of a particle in a rectangular box using Cartesian coordinates, it is easier to describe the motion in a sphere with spherical coordinates. Spherical coordinates are the most common curvilinear coordinate systems and are used in Earth sciences, cartography, quantum mechanics, relativity, and engineering.
Orthogonal curvilinear coordinates in 3 dimensions.
Coordinates, basis, and vectors.
For now, consider 3-D space. A point "P" in 3-D space (or its position vector r) can be defined using Cartesian coordinates ("x", "y", "z") [equivalently written ("x"1, "x"2, "x"3)], by formula_1, where e"x", e"y", e"z" are the "standard basis vectors".
It can also be defined by its curvilinear coordinates ("q"1, "q"2, "q"3) if this triplet of numbers defines a single point in an unambiguous way. The relation between the coordinates is then given by the invertible transformation functions:
formula_2
formula_3
The surfaces "q"1 = constant, "q"2 = constant, "q"3 = constant are called the coordinate surfaces; and the space curves formed by their intersection in pairs are called the coordinate curves. The coordinate axes are determined by the tangents to the coordinate curves at the intersection of three surfaces. They are not in general fixed directions in space, which happens to be the case for simple Cartesian coordinates, and thus there is generally no natural global basis for curvilinear coordinates.
In the Cartesian system, the standard basis vectors can be derived from the derivative of the location of point "P" with respect to the local coordinate
formula_4
Applying the same derivatives to the curvilinear system locally at point "P" defines the natural basis vectors:
formula_5
Such a basis, whose vectors change their direction and/or magnitude from point to point is called a local basis. All bases associated with curvilinear coordinates are necessarily local. Basis vectors that are the same at all points are global bases, and can be associated only with linear or affine coordinate systems.
For this article e is reserved for the standard basis (Cartesian) and h or b is for the curvilinear basis.
These may not have unit length, and may also not be orthogonal. In the case that they "are" orthogonal at all points where the derivatives are well-defined, we define the Lamé coefficients (after Gabriel Lamé) by
formula_6
and the curvilinear orthonormal basis vectors by
formula_7
These basis vectors may well depend upon the position of "P"; it is therefore necessary that they are not assumed to be constant over a region. (They technically form a basis for the tangent bundle of formula_8 at "P", and so are local to "P".)
In general, curvilinear coordinates allow the natural basis vectors hi not all mutually perpendicular to each other, and not required to be of unit length: they can be of arbitrary magnitude and direction. The use of an orthogonal basis makes vector manipulations simpler than for non-orthogonal. However, some areas of physics and engineering, particularly fluid mechanics and continuum mechanics, require non-orthogonal bases to describe deformations and fluid transport to account for complicated directional dependences of physical quantities. A discussion of the general case appears later on this page.
Vector calculus.
Differential elements.
In orthogonal curvilinear coordinates, since the total differential change in r is
formula_9
so scale factors are formula_10
In non-orthogonal coordinates the length of formula_11 is the positive square root of formula_12 (with Einstein summation convention). The six independent scalar products "gij"=h"i".h"j" of the natural basis vectors generalize the three scale factors defined above for orthogonal coordinates. The nine "gij" are the components of the metric tensor, which has only three non zero components in orthogonal coordinates: "g"11="h"1"h"1, "g"22="h"2"h"2, "g"33="h"3"h"3.
Covariant and contravariant bases.
Spatial gradients, distances, time derivatives and scale factors are interrelated within a coordinate system by two groups of basis vectors:
Note that, because of Einstein's summation convention, the position of the indices of the vectors is the opposite of that of the coordinates.
Consequently, a general curvilinear coordinate system has two sets of basis vectors for every point: {b1, b2, b3} is the contravariant basis, and {b1, b2, b3} is the covariant (a.k.a. reciprocal) basis. The covariant and contravariant basis vectors types have identical direction for orthogonal curvilinear coordinate systems, but as usual have inverted units with respect to each other.
Note the following important equality:
formula_15
wherein formula_16 denotes the generalized Kronecker delta.
 ;templatestyles src="Math_proof/styles.css" / ;Proof
In the Cartesian coordinate system formula_17, we can write the dot product as:
formula_18
Consider an infinitesimal displacement formula_19. Let dq1, dq2 and dq3 denote the corresponding infinitesimal changes in curvilinear coordinates q1, q2 and q3 respectively.
By the chain rule, dq1 can be expressed as:
formula_20
If the displacement "dr" is such that "dq"2 = "dq"3 = 0, i.e. the position vector r moves by an infinitesimal amount along the coordinate axis "q"2=const and "q"3=const, then:
formula_21
Dividing by "dq"1, and taking the limit "dq"1 → 0:
formula_22
or equivalently:
formula_23
Now if the displacement dr is such that "dq"1="dq"3=0, i.e. the position vector r moves by an infinitesimal amount along the coordinate axis q1=const and q3=const, then:
formula_24
Dividing by dq2, and taking the limit dq2 → 0:
formula_25 
or equivalently:
formula_26
And so forth for the other dot products.
Alternative Proof:
formula_27
and the Einstein summation convention is implied.
A vector v can be specified in terms of either basis, i.e.,
formula_28
Using the Einstein summation convention, the basis vectors relate to the components by
formula_29
formula_30
and
formula_31
formula_32
where "g" is the metric tensor (see below).
A vector can be specified with covariant coordinates (lowered indices, written "vk") or contravariant coordinates (raised indices, written "vk"). From the above vector sums, it can be seen that contravariant coordinates are associated with covariant basis vectors, and covariant coordinates are associated with contravariant basis vectors.
A key feature of the representation of vectors and tensors in terms of indexed components and basis vectors is "invariance" in the sense that vector components which transform in a covariant manner (or contravariant manner) are paired with basis vectors that transform in a contravariant manner (or covariant manner).
Integration.
Constructing a covariant basis in one dimension.
Consider the one-dimensional curve shown in Fig. 3. At point "P", taken as an origin, "x" is one of the Cartesian coordinates, and "q"1 is one of the curvilinear coordinates. The local (non-unit) basis vector is b1 (notated h1 above, with b reserved for unit vectors) and it is built on the "q"1 axis which is a tangent to that coordinate line at the point "P". The axis "q"1 and thus the vector b1 form an angle formula_33 with the Cartesian "x" axis and the Cartesian basis vector e1.
It can be seen from triangle "PAB" that
formula_34
where |e1|, |b1| are the magnitudes of the two basis vectors, i.e., the scalar intercepts "PB" and "PA". "PA" is also the projection of b1 on the "x" axis.
However, this method for basis vector transformations using "directional cosines" is inapplicable to curvilinear coordinates for the following reasons:
The angles that the "q"1 line and that axis form with the "x" axis become closer in value the closer one moves towards point "P" and become exactly equal at "P".
Let point "E" be located very close to "P", so close that the distance "PE" is infinitesimally small. Then "PE" measured on the "q"1 axis almost coincides with "PE" measured on the "q"1 line. At the same time, the ratio "PD/PE" ("PD" being the projection of "PE" on the "x" axis) becomes almost exactly equal to formula_37.
Let the infinitesimally small intercepts "PD" and "PE" be labelled, respectively, as "dx" and d"q"1. Then
formula_38.
Thus, the directional cosines can be substituted in transformations with the more exact ratios between infinitesimally small coordinate intercepts. It follows that the component (projection) of b1 on the "x" axis is
formula_39.
If "qi" = "qi"("x"1, "x"2, "x"3) and "xi" = "xi"("q"1, "q"2, "q"3) are smooth (continuously differentiable) functions the transformation ratios can be written as formula_40 and formula_41. That is, those ratios are partial derivatives of coordinates belonging to one system with respect to coordinates belonging to the other system.
Constructing a covariant basis in three dimensions.
Doing the same for the coordinates in the other 2 dimensions, b1 can be expressed as:
formula_42
Similar equations hold for b2 and b3 so that the standard basis {e1, e2, e3} is transformed to a local (ordered and normalised) basis {b1, b2, b3} by the following system of equations:
formula_43
By analogous reasoning, one can obtain the inverse transformation from local basis to standard basis:
formula_44
Jacobian of the transformation.
The above systems of linear equations can be written in matrix form using the Einstein summation convention as
formula_45.
This coefficient matrix of the linear system is the Jacobian matrix (and its inverse) of the transformation. These are the equations that can be used to transform a Cartesian basis into a curvilinear basis, and vice versa.
In three dimensions, the expanded forms of these matrices are
formula_46
In the inverse transformation (second equation system), the unknowns are the curvilinear basis vectors. For any specific location there can only exist one and only one set of basis vectors (else the basis is not well defined at that point). This condition is satisfied if and only if the equation system has a single solution. In linear algebra, a linear equation system has a single solution (non-trivial) only if the determinant of its system matrix is non-zero:
formula_47
which shows the rationale behind the above requirement concerning the inverse Jacobian determinant.
Generalization to "n" dimensions.
The formalism extends to any finite dimension as follows.
Consider the real Euclidean "n"-dimensional space, that is R"n" = R × R × ... × R ("n" times) where R is the set of real numbers and × denotes the Cartesian product, which is a vector space.
The coordinates of this space can be denoted by: x = ("x"1, "x"2...,"xn"). Since this is a vector (an element of the vector space), it can be written as:
formula_48
where e1 = (1,0,0...,0), e2 = (0,1,0...,0), e3 = (0,0,1...,0)...,e"n" = (0,0,0...,1) is the "standard basis set of vectors" for the space R"n", and "i" = 1, 2..."n" is an index labelling components. Each vector has exactly one component in each dimension (or "axis") and they are mutually orthogonal (perpendicular) and normalized (has unit magnitude).
More generally, we can define basis vectors b"i" so that they depend on q = ("q"1, "q"2...,"qn"), i.e. they change from point to point: b"i" = b"i"(q). In which case to define the same point x in terms of this alternative basis: the "coordinates" with respect to this basis "vi" also necessarily depend on x also, that is "vi" = "vi"(x). Then a vector v in this space, with respect to these alternative coordinates and basis vectors, can be expanded as a linear combination in this basis (which simply means to multiply each basis vector e"i" by a number "v""i" – scalar multiplication):
formula_49
The vector sum that describes v in the new basis is composed of different vectors, although