# Elementary function

In mathematics, an elementary function is a function of a single variable (typically real or complex) that is defined as taking sums, products, roots and compositions of finitely many polynomial, rational, trigonometric, hyperbolic, and exponential functions, and their inverses (e.g., arcsin, log, or x$^{1/n}$).
All elementary functions are continuous on their domains.
Elementary functions were introduced by Joseph Liouville in a series of papers from 1833 to 1841. An algebraic treatment of elementary functions was started by Joseph Fels Ritt in the 1930s. Many textbooks and dictionaries do not give a precise definition of the elementary functions, and mathematicians differ on it.

## Examples
### Basic examples

Elementary functions of a single variable x include:
* Constant functions: $2,\ \pi ,\ e,$ etc.
* Rational powers of x: $x,\ x^{2},\ {\sqrt {x}}\ (x^{\frac {1}{2}}),\ x^{\frac {2}{3}},$ etc.
* Exponential functions: $e^{x},\ a^{x}$
* Logarithms: $\log x,\ \log _{a}x$
* Trigonometric functions: $\sin x,\ \cos x,\ \tan x,$ etc.
* Inverse trigonometric functions: $\arcsin x,\ \arccos x,$ etc.
* Hyperbolic functions: $\sinh x,\ \cosh x,$ etc.
* Inverse hyperbolic functions: $\operatorname {arsinh} x,\ \operatorname {arcosh} x,$ etc.
* All functions obtained by adding, subtracting, multiplying or dividing a finite number of any of the previous functions
* All functions obtained by root extraction of a polynomial with coefficients in elementary functions
* All functions obtained by composing a finite number of any of the previously listed functions
Certain elementary functions of a single complex variable z, such as ${\sqrt {z}}$ and $\log z$, may be multivalued. Additionally, certain classes of functions may be obtained by others using the final two rules. For example, the exponential function $e^{z}$ composed with addition, subtraction, and division provides the hyperbolic functions, while initial composition with $iz$ instead provides the trigonometric functions.

### Composite examples

Examples of elementary functions include:
* Addition, e.g. (x+1)
* Multiplication, e.g. (2x)
* Polynomial functions
* ${\frac {e^{\tan x}}{1+x^{2}}}\sin \left({\sqrt {1+(\log x)^{2}}}\right)$
* $-i\log \left(x+i{\sqrt {1-x^{2}}}\right)$
The last function is equal to $\arccos x$, the inverse cosine, in the entire complex plane.
All monomials, polynomials, rational functions and algebraic functions are elementary.
The absolute value function, for real $x$, is also elementary as it can be expressed as the composition of a power and root of $x$: |x|=√(x$^2$){\textstyle |x|={\sqrt {x^{2}}}}.

### Non-elementary functions

Many mathematicians exclude non-analytic functions such as the absolute value function or discontinuous functions such as the step function, but others allow them. Some have proposed extending the set to include, for example, the Lambert W function.
Some examples of functions that are not elementary:
* tetration
* the gamma function
* non-elementary Liouvillian functions, including
** the exponential integral (Ei), logarithmic integral (Li or li) and Fresnel integrals (S and C).
** the error function, $\mathrm {erf} (x)={\frac {2}{\sqrt {\pi }}}\int _{0}^{x}e^{-t^{2}}\,dt,$ a fact that may not be immediately obvious, but can be proven using the Risch algorithm.
* other nonelementary integrals, including the Dirichlet integral and elliptic integral.

## Closure

It follows directly from the definition that the set of elementary functions is closed under arithmetic operations, root extraction and composition. The elementary functions are closed under differentiation. They are not closed under limits and infinite sums. Importantly, the elementary functions are not closed under integration, as shown by Liouville's theorem, see nonelementary integral. The Liouvillian functions are defined as the elementary functions and, recursively, the integrals of the Liouvillian functions.

## Differential algebra

The mathematical definition of an elementary function, or a function in elementary form, is considered in the context of differential algebra. A differential algebra is an algebra with the extra operation of derivation (algebraic version of differentiation). Using the derivation operation new equations can be written and their solutions used in extensions of the algebra. By starting with the field of rational functions, two special types of transcendental extensions (the logarithm and the exponential) can be added to the field building a tower containing elementary functions.
A differential field F is a field F$_0$ (rational functions over the rationals Q for example) together with a derivation map u → ∂u. (Here ∂u is a new function. Sometimes the notation u′ is used.) The derivation captures the properties of differentiation, so that for any two elements of the base field, the derivation is linear
    $\partial (u+v)=\partial u+\partial v$
and satisfies the Leibniz product rule
    $\partial (u\cdot v)=\partial u\cdot v+u\cdot \partial v\,.$
An element h is a constant if ∂h = 0. If the base field is over the rationals, care must be taken when extending the field to add the needed transcendental constants.
A function u of a differential extension F[u] of a differential field F is an elementary function over F if the function u
* is algebraic over F, or
* is an exponential, that is, ∂u = u ∂a for a ∈ F, or
* is a logarithm, that is, ∂u = ∂a / a for a ∈ F.
(see also Liouville's theorem)