# Function of several real variables

*"Real multivariate function", "real multivariable function", and "several real variables", all redirect to here*.

In mathematical analysis, and applications in geometry, applied mathematics, engineering, and natural sciences, a **function of several real variables** extends the idea of a function of a real variable to several variables, that is, the "input" variables may take real values. The "output", also called the "value of the function", may be real or complex. However, the study of the complex valued functions may be easily reduced the study of the real valued functions, by considering the real and imaginary parts of the complex function; therefore, unless explicitly specified, only real valued functions will be considered in this article.

The domain of a function of several variables is the subset of ℝ^{n} for which the function is defined. As usual, the domain of a function of several real variables is supposed to contain a open subset of ℝ^{n}.

## General definition

{{#invoke:Multiple image|render}}

A **real-valued function of n real variables** is a function that takes as input

*n*real numbers, commonly represented by the variables

*x*

_{1},

*x*

_{2}, ...,

*x*, for producing another real number, the

_{n}*value*of the function, commonly denoted

*f*(

*x*

_{1},

*x*

_{2}, ...,

*x*). For simplicity, in this article a real-valued function of several real variables will be simply called a

_{n}**function**. To avoid any ambiguity, the other types of functions that may occur will be explicitly specified.

Some functions are defined for all real values of the variables (one says that they are everywhere defined), but some other functions are defined only if the value of the variable are taken in a subset *X* of ℝ^{n}, the domain of the function, which is always supposed to contain an open subset of ℝ^{n}. In other words, a real-valued function of *n* real variables is a function

such that its domain *X* is a subset of ℝ^{n} that contains an open set.

An element of *X* being an *n*-tuple (*x*_{1}, *x*_{2},..., *x _{n}*) (usually delimited by parentheses), the general notation for denoting functions would be

*f*((

*x*

_{1},

*x*

_{2},...,

*x*

_{n})). The common usage, much older than the general definition of functions between sets, it to not use double parentheses and to simply write

*f*(

*x*

_{1},

*x*

_{2},...,

*x*

_{n}).

It is also common to abbreviate the *n*-tuple (*x*_{1}, *x*_{2},..., *x _{n}*) by using a notation similar to that for vectors, like boldface

*, underline Template:Underline, or overarrow Template:Overset. This article will use bold.*

**x**A simple example of a function in two variables could be:

which is the volume *V* of a cone with base area *A* and height *h* measured perpendicularly from the base. The domain restricts all variables to be positive since lengths and areas must be positive.

For an example of a function in two variables:

where *a* and *b* are real non-zero constants. Using the three-dimensional Cartesian coordinate system, where the xy plane is the domain ℝ^{2} and the z axis is the codomain ℝ, one can visualize the image to be a two-dimensional plane, with a slope of *a* in the positive x direction and a slope of *b* in the positive y direction. The function is well-defined at all points (*x*, *y*) in ℝ^{2}. The previous example can be extended easily to higher dimensions:

for *p* non-zero real constants *a*_{1}, *a*_{2},..., *a _{p}*, which describes a

*p*-dimensional hyperplane.

The Euclidean norm:

is also a function of *n* variables which is everywhere defined, while

is defined only for * x* ≠ (0, 0, ..., 0).

For a non-linear example function in two variables:

which takes in all points in *X*, a disk of radius Template:Sqrt "punctured" at the origin (*x*, *y*) = (0, 0) in the plane ℝ^{2}, and returns a point in ℝ. The function does not include the origin (*x*, *y*) = (0, 0), if it did then *f* would be ill-defined at that point. Using a 3d Cartesian coordinate system with the xy plane as the domain ℝ^{2}, and the z axis the codomain ℝ, the image can be visualized as a curved surface.

The function can be evaluated at the point (*x*, *y*) = (2, Template:Sqrt) in *X*:

However, the function couldn't be evaluated at, say

since these values of *x* and *y* do not satisfy the domain's rule.

### Image

The **image** of a function *f*(*x*_{1}, *x*_{2}, ..., *x _{n}*) is the set of all values of Template:Mvar when the

*n*-tuple (

*x*

_{1},

*x*

_{2}, ...,

*x*) runs in the whole domain of Template:Mvar. For a continuous (see below for a definition) real-valued function which has a connected domain, the image is either an interval or a single value. In the latter case, the function is a constant function.

_{n}The preimage of a given real number *y* is called a level set. It is the set of the solutions of the equation *y* = *f*(*x*_{1}, *x*_{2}, ..., *x*_{n}).

### Domain

The domain of a function of several real variables is a subset of ℝ^{n} that is sometimes, but not always, explicitly defined. In fact, if one restricts the domain *X* of a function *f* to a subset *Y* ⊂ *X*, one gets formally a different function, the *restriction* of *f* to *Y*, which is denoted *f*_{|Y}. In practice, it is often (but not always) not harmful to identify *f* and *f*_{|Y}, and to omit the subscript _{|Y}.

Conversely, it is sometimes possible to enlarge naturally the domain of a given function, for example by continuity or by analytic continuation. This means that it is not worthy to explicitly define the domain of a function of several real variables.

Moreover, many functions are defined in such a way that it is difficult to specify explicitly their domain, or even an open subset of their domain. For example, let us consider a function *f* such that *f*(**0**) = 0. which is defined and continuous (see below for a definition) in a ball *B* centered at **0** = (0, ..., 0). Then the functions

and

are defined and continuous in a ball *C* centered at **0**. Although the existence of *C* follows easily from the definition of the continuity of *f*, it is impossible to compute its radius, or even a lower bound of its radius, without further information on *f*. Even if *f* is explicitly given, for example as a multivariate polynomial, the computation of the radius of *C* may be very difficult.

### Algebraic structure

The arithmetic operations may be applied to the functions in the following way:

- For every real number
*r*, the constant function

- For every real number
*r*and every function*f*, the function:

- If
*f*and*g*are two functions of respective domains*X*and*Y*such that*X*∩*Y*contains an open subset of ℝ^{n}, then

It follows that the functions of *n*} variables that are everywhere defined and the functions of *n* variables that are defined in some neighbourhood of a given point both form commutative algebras over the reals (ℝ-algebras).

One may similarly define

which is a function only if the set of the points (*x*_{1}, ...,*x*_{n}) in the domain of *f* such that *f*(*x*_{1}, ...,*x*_{n}) ≠ 0 contains an open subset of ℝ^{n}. This constraint implies that the above two algebras are not fields.

### Univariable functions associated to a multivariable function

One can easily obtain a function in one real variable by giving a constant value to all but one variables. For example, if (*a*_{1}, ..., *a _{n}*) is a point of the interior of the domain of the function

*f*, we can fix the values of

*x*

_{2}, ...,

*x*to

_{n}*a*

_{2}, ...,

*a*respectively, to get a univariable function

_{n}whose domain contains an interval centered at *a*_{1}. This function may also be viewed as the restriction of the function *f* to the line defined by the equations *x*_{i} = *a*_{i}, for *i* = 2, ...,*n*.

Other univariable functions may be defined by restricting *f* to any line passing through (*a*_{1}, ..., *a _{n}*). These are the functions

where the *c*_{i} are real numbers that are not all zero.

In next section, we will show that, if the multivariable function is continuous, so are all these univariable functions, but the converse is not necessarily true.

### Continuity and limit

Until the second part of 19th century, only continuous functions were considered by mathematicians. At that time, the notion of continuity was elaborated for the functions of one or several real variables a rather long time before the formal definition of a topological space and a continuous map between topological spaces. As continuous functions of several real variables are ubiquitous in mathematics, it is worth to define this notion without reference to the general notion of continuous maps between topological space.

For defining the continuity, it is useful to consider the distance function of ℝ^{n}, which is an everywhere defined function of 2*n* real variables:

A function *f* is **continuous** at a point * a* = (

*a*

_{1}, ...,

*a*) which is interior to its domain, if, for every positive real number

_{n}*ε*, there is a positive real number

*φ*such that |

*f*(

*) −*

**x***f*(

*)| <*

**a***ε*for all

*x*such that

*d*(

**x***) <*

**a***φ*. In other words,

*φ*may be chosen small enough for having the image by

*f*of the ball of radius

*φ*centered at

*contained in the interval of length 2*

**a***ε*centered at

*f*(

*). A function is continuous if it is continuous at every point of its domain.*

**a**If a function is continuous at *f*(* a*), then all the univariate functions, that are obtained by fixing all the variables

*x*but one at the value

_{i}*a*, are continuous at

_{i}*f*(

*). The converse is false; this means that all these univariate functions may be continuous for a function that is not continuous at*

**a***f*(

*). For an example, let us consider the function*

**a***f*such that

*f*(0, 0) = 0, and is otherwise defined by

The functions *x* ↦ *f*(*x*, 0) and *y* ↦ *f*(0, *y*) are both constant and equal to zero, and are therefore continuous. The function *f* is not continuous at (0, 0), because, if *ε* < 1/2 and *y* = *x*^{2} ≠ 0, we have *f*(*x*, *y*) = 1/2, even if |*x*| is very small. Although not continuous, this function has the further property that all the univariate functions obtained by restricting it to a line passing through (0, 0) are also continuous. In fact, we have

for *λ* ≠ 0. The limit of a real-valued function of several real variables is as follows.^{[1]} Let * a* = (

*a*

_{1},

*a*

_{2}, ...,

*a*

_{n}) be a point in topological closure of the domain

*X*of the function

*f*. The function,

*f*has a limit

*L*when

*tends toward*

**x***, denoted*

**a**if the following condition is satisfied:
For every positive real number *ε* > 0, there is a positive real number *δ* > 0 such that

for all * x* in the domain such that

If the limit exists, it is unique. If * a* is in the interior of the domain, the limit exists if and only if the function is continuous at

*. In this case, we have*

**a**When * a* is in the boundary of the domain of

*f*, and if

*f*has a limit at

*, the latter formula allows to "extend by continuity" the domain of*

**a***f*to

*.*

**a**## Symmetry

A symmetric function is a function *f* is unchanged when two variables *x _{i}* and

*x*are interchanged:

_{j}where *i* and *j* are each one of 1, 2, ..., *n*. For example:

is symmetric in *x*, *y*, *z* since interchanging any pair of *x*, *y*, *z* leaves *f* unchanged, but is not symmetric in all of *x*, *y*, *z*, *t*, since interchanging *t* with *x* or *y* or *z* is a different function.

## Function composition

Suppose the functions:

or more compactly * ξ* =

*(*

**ξ***), are all defined on a domain*

**x***X*. As the

*n*-tuple

*= (*

**x***x*

_{1},

*x*

_{2}, ...,

*x*

_{n}) varies in

*X*, a subset of ℝ

^{n}, the

*m*-tuple

*= (*

**ξ***ξ*

_{1},

*ξ*

_{2}, ...,

*ξ*

_{m}) varies in another region Ξ a subset of ℝ

^{m}. To restate this:

Then, a function *ζ* of the functions * ξ*(

*) defined on Ξ:*

**x**is a **function composition** defined on *X*,^{[2]} in other terms the mapping

Note the numbers *m* and *n* do not need to be equal.

For example, the function:

defined everywhere on ℝ^{2} can be rewritten by introducing:

which is also everywhere defined in ℝ^{3} to obtain:

Function composition can be used to simplify functions, which is useful for carrying out multiple integrals and solving partial differential equations.

## Calculus

Elementary calculus is the calculus of real-valued functions of one real variable, and the principal ideas of differentiation and integration of such functions can be extended to functions of more than one real variable - multivariable calculus of several real variables.

### Partial derivatives

{{#invoke:main|main}}

Also, partial derivatives can be defined with respect to each variable:

Partial derivatives themselves are functions, which represent the rates of change of *f* along the *x*_{1}, *x*_{2}, ..., *x _{n}* axes at all points in the domain (if the derivatives exist and are continuous - see also below); positive if the function increases along the direction of an axis, negative for decrease, and zero for no increase or decrease. Evaluating a partial derivative at a particular point in the domain gives the rate of change of the function at that point, a real number.

For real-valued functions of a real variable, *y* = *f*(*x*), its ordinary derivative *dy*/*dx* is geometrically the gradient of the tangent line to the curve *y* = *f*(*x*) at all points in the domain. Partial derivatives extend this idea to tangent hyperplanes to a curve.

The second order partial derivatives can be calculated for every pair of variables:

Geometrically - they are related to the local curvature of the function's image at all points in the domain. At any point where the function is well-defined, the function could be increasing along some axes, and/or decreasing along other axes, and/or not increasing or decreasing at all along other axes.

This leads to a variety of possible stationary points: global or local maxima, global or local minima, and saddle points - the multidimensional analogue of inflection points for real functions of one real variable. The Hessian matrix is a matrix of all the second order partial derivatives, which are used to investigate the stationary points of the function, important for mathematical optimization.

In general, partial derivatives of higher order *p* have the form:

where *p*_{1}, *p*_{2}, ..., *p _{n}* are each integers between 0 and

*p*such that

*p*

_{1}+

*p*

_{2}+ ... +

*p*

_{n}=

*p*, using the definitions of zeroth partial derivatives as identity operators:

The number of possible partial derivatives increases with *p*, although some mixed partial derivatives (those with respect to more than one variable) are superfluous, because of the symmetry of second order partial derivatives. This reduces the number of partial derivatives to calculate for some *p*.

### Multivariable differentiability

{{#invoke:main|main}}

A function *f*(* x*) is

**differentiable**in a neighborhood of a point

*if there is an*

**a***n*-tuple of numbers dependent on

*in general,*

**a***(*

**A***) = (*

**a***A*

_{1}(

*),*

**a***A*

_{2}(

*), ...,*

**a***A*

_{n}(

*)), so that:*

**a**^{[3]}

where *α* → 0 as |* x* −

*| → 0. This means that if*

**a***f*is differentiable at a point

*, then*

**a***f*is continuous at

*=*

**x***, although the converse is not true - continuity in the domain does not imply differentiability in the domain. If*

**a***f*is differentiable at

*then the first order partial derivatives exist at*

**a***and:*

**a**for *i* = 1, 2, ..., *n*, which can be found from the definitions of the individual partial derivatives, so the partial derivatives of *f* exist.

Assuming an *n*-dimensional analogue of a rectangular Cartesian coordinate system, these partial derivatives can be used to form a vectorial linear differential operator, called the gradient (also known as "nabla" or "del") in this coordinate system:

used extensively in vector calculus, because it is useful for constructing other differential operators and compactly formulating theorems in vector calculus.

Then substituting the gradient ∇*f* (evaluated at * x* =

*) with a slight rearrangement gives:*

**a**where · denotes the dot product. This equation represents the best linear approximation of the function *f* at all points * x* within a neighborhood of

*. For infinitesimal changes in*

**a***f*and

*as*

**x***→*

**x***:*

**a**which is defined as the **total differential**, or simply **differential**, of *f*, at * a*. This expression corresponds to the total infinitesimal change of

*f*, by adding all the infinitesimal changes of

*f*in all the

*x*directions. Also,

_{i}*df*can be construed as a covector with basis vectors as the infinitesimals

*dx*in each direction and partial derivatives of

_{i}*f*as the components.

Geometrically ∇*f* is perpendicular to the level sets of *f*, given by *f*(* x*) =

*c*which for some constant

*c*describes an (

*n*− 1)-dimensional hypersurface. The differential of a constant is zero:

in which *d x* is an infinitesimal change in

*in the hypersurface*

**x***f*(

*) =*

**x***c*, and since the dot product of ∇

*f*and

*d*is zero, this means ∇

**x***f*is perpendicular to

*d*.

**x**In arbitrary curvilinear coordinate systems in *n* dimensions, the explicit expression for the gradient would not be so simple - there would be scale factors in terms of the metric tensor for that coordinate system. For the above case used throughout this article, the metric is just the Kronecker delta and the scale factors are all 1.

### Differentiability classes

If all first order partial derivatives evaluated at a point * a* in the domain:

exist and are continuous for all * a* in the domain,

*f*has differentiability class

*C*

^{1}. In general, if all order

*p*partial derivatives evaluated at a point

*:*

**a**exist and are continuous, where *p*_{1}, *p*_{2}, ..., *p _{n}*, and

*p*are as above, for all

*in the domain, then*

**a***f*is differentiable to order

*p*throughout the domain and has differentiability class

*C*

^{p}.

If *f* is of differentiability class *C ^{∞}*,

*f*has continuous partial derivatives of all order and is called

*smooth*. If

*f*is an

*analytic function*and equals its Taylor series about any point in the domain, the notation

*C*denotes this differentiability class.

^{ω}### Multiple integration

{{#invoke:main|main}}

Definite integration can be extended to multiple integration over the several real variables with the notation;

where each region *R*_{1}, *R*_{2}, ..., *R _{n}* is a subset of or all of the real line:

and their Cartesian product gives the region to integrate over as a single set:

an *n*-dimensional hypervolume. When evaluated, an indefinite integral is a real number if the integral converges in the region *R* of integration (the result of a definite integral may diverge to infinity for a given region, in such cases the integral remains ill-defined). The variables are treated as "dummy" or "bound" variables which are substituted for numbers in the process of integration.

The integral of a real-valued function of a real variable *y* = *f*(*x*) with respect to *x* has geometric interpretation as the area bounded by the curve *y* = *f*(*x*) and the *x*-axis. Multiple integrals extend the dimensionality of this concept: assuming an *n*-dimensional analogue of a rectangular Cartesian coordinate system, the above definite integral has the geometric interpretation as the *n*-dimensional hypervolume bounded by *f*(* x*) and the

*x*

_{1},

*x*

_{2}, ...,

*x*axes, which may be positive, negative, or zero, depending on the function being integrated (if the integral is convergent).

_{n}While bounded hypervolume is a useful insight, the more important idea of definite integrals is that they represent total quantities within space. This has significance in applied mathematics and physics: if *f* is some scalar density field and * x* are the position vector coordinates, i.e. some scalar quantity per unit

*n*-dimensional hypervolume, then integrating over the region

*R*gives the total amount of quantity in

*R*. The more formal notions of hypervolume is the subject of measure theory. Above we used the Lebesgue measure, see Lebesgue integration for more on this topic.

### Theorems

With the definitions of multiple integration and partial derivatives, key theorems can be formulated, including the fundamental theorem of calculus in several real variables (namely Stoke's theorem), integration by parts in several real variables, and Taylor's theorem for multivariable functions. Evaluating a mixture of integrals and partial derivatives can be done by using theorem differentiation under the integral sign.

### Vector calculus

One can collect a number of functions each of several real variables, say

into an *m*-tuple, or sometimes as a column vector or row vector, respectively:

all treated on the same footing as an *m*-component vector field, and use whichever form is convenient. All the above notations have a common compact notation * y* =

*(*

**f***). The calculus of such vector fields is vector calculus. For more on the treatment of row vectors and column vectors of multivariable functions, see matrix calculus.*

**x**## Implicit functions

A **real-valued implicit function of several real variables** is not written in the form "*y* = *f*(...)". Instead, the mapping is from the space ℝ^{n + 1} to the zero element in ℝ (just the ordinary zero 0):

and

is an equation in all the variables. Implicit functions are a more general way to represent functions, since if:

then we can always define:

but the converse is not always possible, i.e. not all implicit functions have the above form.

For example, using interval notation:

and again, choosing a 3d Cartesian coordinate system, this function describes the surface of a 3d ellipsoid centered at the origin (*x*, *y*, *z*) = (0, 0, 0) with constant semi-major axes *a*, *b*, *c*, along the positive *x*, *y* and *z* axes respectively. In the case *a* = *b* = *c* = *r*, we have a sphere of radius *r* centered at the origin. Other conic section examples which can be described similarly include the hyperboloid and paraboloid, more generally so can any 2d surface in 3d Euclidean space. The above example can be solved for *x*, *y* or *z*, however it is much tidier to write it in an implicit form.

For a more sophisticated example:

for non-zero real constants *A*, *B*, *C*, *ω*, this function is well-defined for all (*t*, *x*, *y*, *z*), but it cannot be solved for these variables, and so written as "*t* = ", "*x* = ", etc.

The **implicit function theorem** of more than two real variables is on the continuity and differentiability of the function, as follows.^{[4]} If *ϕ*(*x*_{1}, *x*_{2}, ..., *x*_{n}) is a continuous function with continuous first order partial derivatives, and let *ϕ* evaluated at a point (* a*,

*b*) = (

*a*

_{1},

*a*

_{2}, ...,

*a*

_{n},

*b*) be zero:

and the first partial derivative of *ϕ* with respect to *y* evaluated at (* a*,

*b*) be non-zero:

Then, there is an interval [*y*_{1}, *y*_{2}] containing *b*, and a region *R* containing (* a*,

*b*), such that for every

*in*

**x***R*there is exactly one value of

*y*in [

*y*

_{1},

*y*

_{2}] satisfying

*ϕ*(

*,*

**x***y*) = 0, and

*y*is a continuous function of

*so that*

**x***ϕ*(

*,*

**x***y*(

*)) = 0. The total differentials of the functions are:*

**x**Substituting *dy* into the latter differential and equating coefficients of the differentials gives the first order partial derivatives of *y* with respect to *x _{i}*:

for *i* = 1, 2, ..., *n*.

## Complex-valued function of several real variables

A **complex-valued function of several real variables** may be defined by relaxing, in the definition of the real-valued functions, the restriction of the codomain to the real numbers, and allowing complex values.

If *f*(*x*_{1}, ..., *x _{n}*) is such a complex valued function, it may be decomposed as

where *g* and *h* are real-valued functions. In other words, the study of the complex valued functions reduces easily to the study of the pairs of real valued functions.

This reduction works for the general properties. However, for an explicitly given function, such as:

the computation of the real and the imaginary part may be difficult.

## Applications

Multivariable functions of real variables arise inevitably in engineering and physics, because observable physical quantities are real numbers (with associated units and dimensions), and any one physical quantity will generally depend on a number of other quantities.

When creating a mathematical model of a physical system; definitions of quantities, scientific principles, and mathematical theorems are applied to set up equations in terms of the physical quantities characterizing the system. At the simplest level for problems in a restricted application, they would be algebraic equations or implicit functions, for more general and complicated problems with a broad scope of application, partial differential equations occur - many non-linear partial differential equations have been formulated for a variety of situations. The solutions to the equations are real or complex valued functions of many real variables.

### Examples of real-valued functions of several real variables

Examples in continuum mechanics include the local mass density *ρ* of a mass distribution, a scalar field which depends on the spatial position coordinates (here Cartesian to exemplify), **r** = (*x*, *y*, *z*), and time *t*:

Similarly for electric charge density for electrically charged objects, and numerous other scalar potential fields.

Another example is the velocity field, a vector field, which has components of velocity **v** = (*v _{x}*,

*v*,

_{y}*v*) that are each multivariable functions of spatial coordinates and time similarly:

_{z}Similarly for other physical vector fields such as electric fields and magnetic fields, and vector potential fields.

Another important example is the equation of state in thermodynamics, an equation relating pressure *P*, temperature *T*, and volume *V* of a fluid, in general it has an implicit form:

The simplest example is the ideal gas law:

where *n* is the number of moles, constant for a fixed amount of substance, and *R* the gas constant. Much more complicated equations of state have been empirically derived, but they all have the above implicit form.

### Examples of complex-valued functions of several real variables

Some "physical quantities" may be actually complex valued - such as complex impedance, complex permittivity, complex permeability, and complex refractive index. These are also functions of real variables, such as frequency or time, as well as temperature.

In two-dimensional fluid mechanics, specifically in the theory of the potential flows used to describe fluid motion in 2d, the complex potential

is a complex valued function of the two spatial coordinates *x* and *y*, and other *real* variables associated with the system. The real part is the velocity potential and the imaginary part is the stream function.

The spherical harmonics occur in physics and engineering as the solution to Laplace's equation, as well as the eigenfunctions of the z-component angular momentum operator, which are complex-valued functions of real-valued spherical polar angles:

In quantum mechanics, the wavefunction is necessarily complex-valued, but is a function of *real* spatial coordinates (or momentum components), as well as time *t*:

where each is related by a Fourier transform.

## See also

## References

- {{#invoke:citation/CS1|citation

|CitationClass=book }}

- {{#invoke:citation/CS1|citation

|CitationClass=book }}

- {{#invoke:citation/CS1|citation

|CitationClass=book }}

- {{#invoke:citation/CS1|citation

|CitationClass=book }}

- {{#invoke:citation/CS1|citation

|CitationClass=book }}

- {{#invoke:citation/CS1|citation

|CitationClass=book }}

- {{#invoke:citation/CS1|citation

|CitationClass=book }}

- {{#invoke:citation/CS1|citation

|CitationClass=book }}