Total variation
In mathematics, the total variation of a real-valued function f, defined on an interval  \scriptstyle  \subset \mathbb{R} is the quantity
the supremum running over the set  \scriptstyle  \mathcal{P} =\left\{P=\{ x_0, \dots , x_{n_p}\}|P\text{ is a partition of }  \right\}  of all partitions of the given interval.  The total variation of a continuously differentiable function f is the vertical component of the arc-length of its graph, that is to say,
The total variation of a real-valued integrable function f defined on a bounded domain   \scriptstyle\Omega \subset \mathbb{R}^n\,\!,
where   \scriptstyle C_c^1(\Omega,\mathbb{R}^n) is the set of  continuously differentiable vector functions of compact support contained  in \Omega, and  \scriptstyle \Vert\;\Vert_{L^\infty(\Omega)} is the essential supremum norm.
The function f is said to be of bounded variation precisely if its total variation is finite.

# Total variation distance in probability theory
In probability theory, the total variation distance between two probability measures P and Q on a sigma-algebra F is
Informally, this is the largest possible difference between the probabilities that the two probability distributions can assign to the same event.
For a finite alphabet we can write
Sometimes the statistical distance between two probability distributions is also defined without the division by two.

# Total variation in measure theory
Given a signed measure \mu on a measurable space (X,\Sigma), and its Hahn-Jordan decomposition into the difference of two non-negative measures
its variation is the non-negative measure
and its total variation is defined as
In detail, if E is a measurable subset of X, then
where the supremum is taken over all partitions  of X into a finite number of disjoint measurable subsets.  More generally, if  is a vector measure, then the variation is defined by
where the supremum is as above.
The total variation is a norm defined on the space of measures of bounded variation.  The space of measures on a -algebra of sets is a Banach space, called the ca space, relative to this norm.  It is contained in the larger Banach space, called the ba space, consisting of finitely additive (as opposed to countably additive) measures, also with the same norm.

# Applications
Total variation can be seen as a non-negative real-valued functional defined on the space of real-valued functions (for the case of functions of one variable) or on the space of integrable functions (for the case of functions of several variables). As a functional, total variation finds applications in several branches of mathematics and engineering, like optimal control, numerical analysis, and calculus of variations, where the solution to a certain problem has to minimize its value. As an example, use of the total variation functional is common in the following two kind of problems
- Numerical analysis of differential equations: it is the science of finding approximate solutions to differential equations. Applications of  total variation to this problems is detailed in the voice "total variation diminishing"
- Image denoising: in image processing, denoising is a collection of methods used to reduce the noise in a image reconstructed from data obtained by electronic means, for example data transmission or sensing. A description of the applications of total variation to this kind of problems can be found in the paper Template:Harv.