A metric tensor is called positive definite if it assigns a positive value g(v, v) > 0 to every nonzero vector v. A manifold equipped with a positive definite metric tensor is known as a Riemannian manifold. On a Riemannian manifold, the curve connecting two points that (locally) has the smallest length is called a geodesic, and its length is the distance that a passenger in the manifold needs to traverse to go from one point to the other. Equipped with this notion of length, a Riemannian manifold is a metric space, meaning that it has a distance functiond(p, q) whose value at a pair of points p and q is the distance from p to q. Conversely, the metric tensor itself is the derivative of the distance function (taken in a suitable manner). Thus the metric tensor gives the infinitesimal distance on the manifold.

While the notion of a metric tensor was known in some sense to mathematicians such as Carl Gauss from the early 19th century, it was not until the early 20th century that its properties as a tensor were understood by, in particular, Gregorio Ricci-Curbastro and Tullio Levi-Civita, who first codified the notion of a tensor. The metric tensor is an example of a tensor field.

depending on an ordered pair of real variables (u,v), and defined in an open setD in the uv-plane. One of the chief aims of Gauss' investigations was to deduce those features of the surface which could be described by a function which would remain unchanged if the surface underwent a transformation in space (such as bending the surface without stretching it), or a change in the particular parametric form of the same geometrical surface.

One natural such invariant quantity is the length of a curve drawn along the surface. Another is the angle between a pair of curves drawn along the surface and meeting at a common point. A third such quantity is the area of a piece of the surface. The study of these invariants of a surface led Gauss to introduce the predecessor of the modern notion of the metric tensor.

If the variables u and v are taken to depend on a third variable, t, taking values in an interval[a, b], then r→(u(t),v(t)){\displaystyle \scriptstyle {{\vec {r}}(u(t),v(t))}} will trace out a parametric curve in parametric surface M. The arclength of that curve is given by the integral

The quantity ds in (1) is called the line element, while ds2 is called the first fundamental form of M. Intuitively, it represents the principal part of the square of the displacement undergone by r→(u,v){\displaystyle \scriptstyle {{\vec {r}}(u,v)}} when u is increased by du units, and v is increased by dv units.

Ricci-Curbastro & Levi-Civita (1900) first observed the significance of a system of coefficients E, F, and G, that transformed in this way on passing from one system of coordinates to another. The upshot is that the first fundamental form (1) is invariant under changes in the coordinate system, and that this follows exclusively from the transformation properties of E, F, and G. Indeed, by the chain rule,

Another interpretation of the metric tensor, also considered by Gauss, is that it provides a way in which to compute the length of tangent vectors to the surface, as well as the angle between two tangent vectors. In contemporary terms, the metric tensor allows one to compute the dot product of tangent vectors in a manner independent of the parametric description of the surface. Any tangent vector at a point of the parametric surface M can be written in the form

This is plainly a function of the four variables a1, b1, a2, and b2. It is more profitably viewed, however, as a function that takes a pair of arguments a = [a1a2] and b = [b1b2] which are vectors in the uv-plane. That is, put

The surface area is another numerical quantity which should depend only on the surface itself, and not on how it is parameterized. If the surface M is parameterized by the function r→(u,v){\displaystyle {\vec {r}}(u,v)} over the domain D in the uv-plane, then the surface area of M is given by the integral

Let M be a smooth manifold of dimension n; for instance a surface (in the case n = 2) or hypersurface in the Cartesian spaceRn+1. At each point p ∈ M there is a vector space TpM, called the tangent space, consisting of all tangent vectors to the manifold at the point p. A metric at p is a function gp(Xp,Yp) which takes as inputs a pair of tangent vectors Xp and Yp at p, and produces as an output a real number (scalar), so that the following conditions are satisfied:

gp is bilinear. A function of two vector arguments is bilinear if it is linear separately in each argument. Thus if Up, Vp, Yp are three tangent vectors at p and a and b are real numbers, then

gp is nondegenerate. A bilinear function is nondegenerate provided that, for every tangent vector Xp ≠ 0, the function

Yp↦gp(Xp,Yp){\displaystyle Y_{p}\mapsto g_{p}(X_{p},Y_{p})}

obtained by holding Xp constant and allowing Yp to vary is not identically zero. That is, for every Xp ≠ 0 there exists a Yp such that gp(Xp,Yp) ≠ 0.

A metric tensor g on M assigns to each point p of M a metric gp in the tangent space at p in a way that varies smoothly with p. More precisely, given any open subsetU of manifold M and any (smooth) vector fieldsX and Y on U, the real function

If qm is positive for all non-zero Xm, then the metric is positive definite at m. If the metric is positive definite at every m ∈ M, then g is called a Riemannian metric. More generally, if the quadratic forms qm have constant signature independent of m, then the signature of g is this signature, and g is called a pseudo-Riemannian metric.[4] If M is connected, then the signature of qm does not depend on m.[5]

By Sylvester's law of inertia, a basis of tangent vectors Xi can be chosen locally so that the quadratic form diagonalizes in the following manner

for some p between 1 and n. Any two such expressions of q (at the same point m of M) will have the same number p of positive signs. The signature of g is the pair of integers (p, n − p), signifying that there are p positive signs and n − p negative signs in any such expression. Equivalently, the metric has signature (p, n − p) if the matrix gij of the metric has p positive and n − p negative eigenvalues.

Certain metric signatures which arise frequently in applications are:

If g has signature (n, 0), then g is a Riemannian metric, and M is called a Riemannian manifold. Otherwise, g is a pseudo-Riemannian metric, and M is called a pseudo-Riemannian manifold (the term semi-Riemannian is also used).

If M is four-dimensional with signature (1, 3) or (3, 1), then the metric is called Lorentzian. More generally, a metric tensor in dimension n other than 4 of signature (1, n − 1) or (n − 1, 1) is sometimes also called Lorentzian.

If M is 2n-dimensional and g has signature (n, n), then the metric is called ultrahyperbolic.

Let f = (X1, ..., Xn) be a basis of vector fields, and as above let G[f] be the matrix of coefficients

gij[f]=g(Xi,Xj).{\displaystyle g_{ij}[\mathbf {f} ]=g(X_{i},X_{j}).}

One can consider the inverse matrixG[f]−1, which is identified with the inverse metric (or conjugate or dual metric). The inverse metric satisfies a transformation law when the frame f is changed by a matrix A via

The inverse metric transforms contravariantly, or with respect to the inverse of the change of basis matrix A. Whereas the metric itself provides a way to measure the length of (or angle between) vector fields, the inverse metric supplies a means of measuring the length of (or angle between) covector fields; that is, fields of linear functionals.

To see this, suppose that α is a covector field. To wit, for each point p, α determines a function αp defined on tangent vectors at p so that the following linearity condition holds for all tangent vectors Xp and Yp, and all real numbers a and b:

So that the right-hand side of equation (6) is unaffected by changing the basis f to any other basis fA whatsoever. Consequently, the equation may be assigned a meaning independently of the choice of basis. The entries of the matrix G[f] are denoted by gij, where the indices i and j have been raised to indicate the transformation law (5).

Consequently, v[fA] = A−1v[f]. In other words, the components of a vector transform contravariantly (with respect to the inverse) under a change of basis by the nonsingular matrix A. The contravariance of the components of v[f] is notationally designated by placing the indices of vi[f] in the upper position.

A frame also allows covectors to be expressed in terms of their components. For the basis of vector fields f = (X1, ..., Xn) define the dual basis to be the linear functionals(θ1[f], ..., θn[f]) such that

whence, because θ[fA] = A−1θ[f], it follows that a[fA] = a[f]A. That is, the components a transform covariantly (by the matrix A rather than its inverse). The covariance of the components of a[f] is notationally designated by placing the indices of ai[f] in the lower position.

Now, the metric tensor gives a means to identify vectors and covectors as follows. Holding Xp fixed, the function

of tangent vector Yp defines a linear functional on the tangent space at p. This operation takes a vector Xp at a point p and produces a covector gp(Xp, −). In a basis of vector fields f, if a vector field X has components v[f], then the components of the covector field g(X, −) in the dual basis are given by the entries of the row vector

so that a[fA] = a[f]A: a transforms covariantly. The operation of associating to the (contravariant) components of a vector field v[f] = [ v1[f] v2[f] ... vn[f] ]T the (covariant) components of the covector field a[f] = [ a1[f] a2[f] ... an[f] ], where

To raise the index, one applies the same construction but with the inverse metric instead of the metric. If a[f] = [ a1[f] a2[f] ... an[f] ] are the components of a covector in the dual basis θ[f], then the column vector

Consequently, the quantity X = fv[f] does not depend on the choice of basis f in an essential way, and thus defines a vector field on M. The operation (9) associating to the (covariant) components of a covector a[f] the (contravariant) components of a vector v[f] given is called raising the index. In components, (9) is

Suppose that φ is an immersion onto the submanifold M ⊂ Rm. The usual Euclidean dot product in Rm is a metric which, when restricted to vectors tangent to M, gives a means for taking the dot product of these tangent vectors. This is called the induced metric.

This bilinear form is symmetric if and only if S is symmetric. There is thus a natural one-to-one correspondence between symmetric bilinear forms on TpM and symmetric linear isomorphisms of TpM to the dual Tp*M.

As p varies over M, Sg defines a section of the bundle Hom(TM,T*M) of vector bundle isomorphisms of the tangent bundle to the cotangent bundle. This section has the same smoothness as g: it is continuous, differentiable, smooth, or real-analytic according as g. The mapping Sg, which associates to every vector field on M a covector field on M gives an abstract formulation of "lowering the index" on a vector field. The inverse of Sg is a mapping T*M → TM which, analogously, gives an abstract formulation of "raising the index" on a covector field.

Suppose that g is a Riemannian metric on M. In a local coordinate system xi, i = 1,2,...,n, the metric tensor appears as a matrix, denoted here by G, whose entries are the components gij of the metric tensor relative to the coordinate vector fields.

Let γ(t){\displaystyle \gamma (t)} be a piecewise differentiable parametric curve in M, for a ≤t ≤ b. The arclength of the curve is defined by

For a pseudo-Riemannian metric, the length formula above is not always defined, because the term under the square root may become negative. We generally only define the length of a curve when the quantity under the square root is always of one sign or the other. In this case, define

This usage comes from physics, specifically, classical mechanics, where the integral E can be seen to directly correspond to the kinetic energy of a point particle moving on the surface of a manifold. Thus, for example, in Jacobi's formulation of Maupertuis principle, the metric tensor can be seen to correspond to the mass tensor of a moving particle.

In many cases, whenever a calculation calls for the length to be used, a similar calculation using the energy may be done as well. This often leads to simpler formulas by avoiding the need for the square-root. Thus, for example, the geodesic equations may be obtained by applying variational principles to either the length or the energy. In the latter case, the geodesic equations are seen to arise from the principle of least action: they describe the motion of a "free particle" (a particle feeling no forces) that is confined to move on the manifold, but otherwise moves freely, with constant momentum, within the manifold.[7]

In analogy with the case of surfaces, a metric tensor on an n-dimensional paracompact manifold M gives rise to a natural way to measure the n-dimensional volume of subsets of the manifold. The resulting natural positive Borel measure allows one to develop a theory of integrating functions on the manifold by means of the associated Lebesgue integral.

for all ƒ supported in U. Here det g is the determinant of the matrix formed by the components of the metric tensor in the coordinate chart. That Λ is well-defined on functions supported in coordinate neighborhoods is justified by Jacobian change of variables. It extends to a unique positive linear functional on C0(M) by means of a partition of unity.

where the dxi are the coordinate differentials and the wedge ∧ denotes the exterior product in the algebra of differential forms. The volume form also gives a way to integrate functions on the manifold, and this geometric integral agrees with the integral obtained by the canonical Borel measure.

In general, in a Cartesian coordinate systemxi on a Euclidean space, the partial derivatives ∂/∂xi{\displaystyle \partial /\partial x^{i}} are orthonormal with respect to the Euclidean metric. Thus the metric tensor is the Kronecker delta δij in this coordinate system. The metric tensor with respect to arbitrary (possibly curvilinear) coordinates qi{\displaystyle q^{i}} is given by:

The unit sphere in R3 comes equipped with a natural metric induced from the ambient Euclidean metric. In standard spherical coordinates (θ,φ){\displaystyle (\theta ,\varphi )}, with θ{\displaystyle \theta } the colatitude, the angle measured from the z axis, and φ{\displaystyle \varphi } the angle from the x axis in the xy plane, the metric takes the form

For a curve with—for example—constant time coordinate, the length formula with this metric reduces to the usual length formula. For a timelike curve, the length formula gives the proper time along the curve.

The Schwarzschild metric describes the spacetime around a spherically symmetric body, such as a planet, or a black hole. With coordinates (x0,x1,x2,x3)=(ct,r,θ,φ){\displaystyle (x^{0},x^{1},x^{2},x^{3})=(ct,r,\theta ,\varphi )}, we can write the metric as

^More precisely, the integrand is the pullback of this differential to the curve.

^In several formulations of classical unified field theories, the metric tensor was allowed to be non-symmetric; however, the antisymmetric part of such a tensor plays no role in the contexts described here, so it will not be further considered.

^The notation of using square brackets to denote the basis in terms of which the components are calculated is not universal. The notation employed here is modeled on that of Wells (1980). Typically, such explicit dependence on the basis is entirely suppressed.