Reference articles on history, science, culture and more
Encyclopedia

Bump function

Smooth and compactly supported function

Image credit is listed at the end of this article.

In mathematical analysis, a bump function is a localized auxiliary function, usually chosen to be smooth and to have compact support. Bump functions are commonly used as cutoff functions, for example functions that are equal to 1 on a prescribed set and vanish outside a larger set, and as standard examples of kernels used to construct mollifiers.

Some authors use the term more broadly for any compactly supported smooth function. Such functions are important examples of test functions, especially in distribution theory, but the terms "bump function" and "test function" are not synonymous in all contexts.

01Examples

The function \Psi :\mathbb {R} \to \mathbb {R} given by \Psi (x)={\begin{cases}\exp \left({\frac {1}{x^{2}-1}}\right),&{\text{ if }}|x|<1,\\0,&{\text{ if }}|x|\geq 1,\end{cases}}

is an example of a bump function in one dimension. Note that the support of this function is the closed interval [-1,1]. In fact, by definition of support, we have that \operatorname {supp} (\Psi ):={\overline {\{x\in \mathbb {R} :\Psi (x)\neq 0\}}}={\overline {(-1,1)}}, where the closure is taken with respect the Euclidean topology of the real line. The proof of smoothness follows along the same lines as for the related function discussed in the Non-analytic smooth function article. This function can be interpreted as the Gaussian function \exp \left(-y^{2}\right) scaled to fit into the unit disc: the substitution y^{2}={1}/{\left(1-x^{2}\right)} corresponds to sending x=\pm 1 to y=\infty .

A simple example of a (square) bump function in n variables is obtained by taking the product of n copies of the above bump function in one variable, so \Phi (x_{1},x_{2},\dots ,x_{n})=\Psi (x_{1})\Psi (x_{2})\cdots \Psi (x_{n}).

A radially symmetric bump function in n variables can be formed by taking the function \Psi _{n}:\mathbb {R} ^{n}\to \mathbb {R} defined by \Psi _{n}(\mathbf {x} )=\Psi (|\mathbf {x} |). This function is supported on the unit ball centered at the origin.

For another example, take an h that is positive on (c,d) and zero elsewhere, for example

h(x)={\begin{cases}\exp \left(-{\frac {1}{(x-c)(d-x)}}\right),&c<x<d\\0,&\mathrm {otherwise} \end{cases}}.


Smooth transition functions

A standard starting point is the function

f(x)={\begin{cases}e^{-{\frac {1}{x}}}&{\text{if }}x>0,\\0&{\text{if }}x\leq 0,\end{cases}}

defined for every real number x.

From this, define

g(x)={\frac {f(x)}{f(x)+f(1-x)}},\qquad x\in \mathbb {R} .

The denominator is strictly positive everywhere on the real line, so g is smooth. Moreover, g(x) = 0 for x  0 and g(x) = 1 for x  1, so g gives a smooth transition from 0 to 1 on the unit interval [0, 1]. Rescaling gives a smooth transition on any interval [a, b] with a < b:

\mathbb {R} \ni x\mapsto g{\Bigl (}{\frac {x-a}{b-a}}{\Bigr )}.

A compactly supported bump function can be obtained by multiplying a rising transition by a falling transition. For real numbers a < bc < d, the function

\mathbb {R} \ni x\mapsto g{\Bigl (}{\frac {x-a}{b-a}}{\Bigr )}\,g{\Bigl (}{\frac {d-x}{d-c}}{\Bigr )}

is smooth, equals 1 on the closed interval [b, c], and vanishes outside the open interval (a, d). Thus it can serve as a bump function. When b < c the plateau has positive length; when b = c it degenerates to a single point, but the function is still smooth.

For example, taking a=-1, b=c=0, and d=1 gives the smooth bump function

u(x)={\begin{cases}1,&{\text{if }}x=0,\\0,&{\text{if }}|x|\geq 1,\\{\frac {1}{1+e^{\frac {1-2|x|}{x^{2}-|x|}}}},&{\text{otherwise}}.\end{cases}}

The formula

q(x)={\frac {1}{1+e^{\frac {1-2|x|}{x^{2}-|x|}}}}

is the expression for this function only on 0<|x|<1; by itself it does not specify the endpoint values at x=-1,0,1.

A related parameterized interior expression is

q(x,a)={\frac {1}{1+e^{\frac {a(1-2|x|)}{x^{2}-|x|}}}}.

For example, q\left(x,{\frac {\sqrt {3}}{2}}\right), with suitable endpoint values supplied, gives smooth transition curves with "almost" constant slope edges. A bump function with true straight slopes is portrayed by this example.

The transition function g above can also be written explicitly as

w(x)={\begin{cases}{\frac {1}{1+e^{\frac {2x-1}{x^{2}-x}}}}&{\text{if }}0<x<1,\\0&{\text{if }}x\leq 0,\\1&{\text{if }}x\geq 1,\end{cases}}

and, on 0<x<1, its nonconstant branch can be represented using Hyperbolic functions:

{\frac {1}{1+e^{\frac {2x-1}{x^{2}-x}}}}={\frac {1}{2}}\left(1-\tanh \left({\frac {2x-1}{2(x^{2}-x)}}\right)\right)
The 1d bump function
The 1d bump function
The non-analytic smooth function f(x) considered in the article.
The non-analytic smooth function f(x) considered in the article.

02Existence of bump functions

It is possible to construct bump functions "to specifications". Stated formally, if K\subset \mathbb {R} ^{n} is compact and U\subset \mathbb {R} ^{n} is an open set containing K, there exists a bump function \phi which is 1 on K and 0 outside of U. Since U can be taken to be a very small neighborhood of K, this amounts to being able to construct a function that is 1 on K and falls off rapidly to 0 outside of K, while still being smooth.

Bump functions defined in terms of convolution

The construction proceeds as follows. One considers a compact neighborhood V of K contained in U, so K\subseteq V^{\circ }\subseteq V\subseteq U. The characteristic function \chi _{V} of V will be equal to 1 on V and 0 outside of V, so in particular, it will be 1 on K and 0 outside of U. This function is not smooth however. The key idea is to smooth \chi _{V} a bit, by taking the convolution of \chi _{V} with a mollifier. The latter is just a bump function with a very small support and whose integral is 1. Such a mollifier can be obtained, for example, by taking the bump function \Phi from the previous section and performing appropriate scalings.

Bump functions defined in terms of a function c:\mathbb {R} \to [0,\infty ) with support (-\infty ,0]

An alternative construction that does not involve convolution is now detailed. It begins by constructing a smooth function f:\mathbb {R} ^{n}\to \mathbb {R} that is positive on a given open subset U\subseteq \mathbb {R} ^{n} and vanishes off of U. This function's support is equal to the closure {\overline {U}} of U in \mathbb {R} ^{n}, so if {\overline {U}} is compact, then f is a bump function.

Start with any smooth function c:\mathbb {R} \to \mathbb {R} that vanishes on the negative reals and is positive on the positive reals (that is, c=0 on (-\infty ,0) and c>0 on (0,\infty ), where continuity from the left necessitates c(0)=0); an example of such a function is c(x):=e^{-1/x} for x>0 and c(x):=0 otherwise. Fix an open subset U of \mathbb {R} ^{n} and denote the usual Euclidean norm by \|\cdot \| (so \mathbb {R} ^{n} is endowed with the usual Euclidean metric). The following construction defines a smooth function f:\mathbb {R} ^{n}\to \mathbb {R} that is positive on U and vanishes outside of U. So in particular, if U is relatively compact then this function f will be a bump function.

If U=\mathbb {R} ^{n} then let f=1 while if U=\varnothing then let f=0; so assume U is neither of these. Let \left(U_{k}\right)_{k=1}^{\infty } be an open cover of U by open balls where the open ball U_{k} has radius r_{k}>0 and center a_{k}\in U. Then the map f_{k}:\mathbb {R} ^{n}\to \mathbb {R} defined by f_{k}(x)=c\left(r_{k}^{2}-\left\|x-a_{k}\right\|^{2}\right) is a smooth function that is positive on U_{k} and vanishes off of U_{k}. For every k\in \mathbb {N} , let M_{k}=\sup \left\{\left|{\frac {\partial ^{p}f_{k}}{\partial ^{p_{1}}x_{1}\cdots \partial ^{p_{n}}x_{n}}}(x)\right|~:~x\in \mathbb {R} ^{n}{\text{ and }}p_{1},\ldots ,p_{n}\in \mathbb {Z} {\text{ satisfy }}0\leq p_{i}\leq k{\text{ and }}p=\sum _{i}p_{i}\right\}, where this supremum is not equal to +\infty (so M_{k} is a non-negative real number) because \left(\mathbb {R} ^{n}\setminus U_{k}\right)\cup {\overline {U_{k}}}=\mathbb {R} ^{n}, the partial derivatives all vanish (equal 0) at any x outside of U_{k}, while on the compact set {\overline {U_{k}}}, the values of each of the (finitely many) partial derivatives are (uniformly) bounded above by some non-negative real number. The series f~:=~\sum _{k=1}^{\infty }{\frac {f_{k}}{2^{k}M_{k}}} converges uniformly on \mathbb {R} ^{n} to a smooth function f:\mathbb {R} ^{n}\to \mathbb {R} that is positive on U and vanishes off of U. Moreover, for any non-negative integers p_{1},\ldots ,p_{n}\in \mathbb {Z} , {\frac {\partial ^{p_{1}+\cdots +p_{n}}}{\partial ^{p_{1}}x_{1}\cdots \partial ^{p_{n}}x_{n}}}f~=~\sum _{k=1}^{\infty }{\frac {1}{2^{k}M_{k}}}{\frac {\partial ^{p_{1}+\cdots +p_{n}}f_{k}}{\partial ^{p_{1}}x_{1}\cdots \partial ^{p_{n}}x_{n}}} where this series also converges uniformly on \mathbb {R} ^{n} (because whenever k\geq p_{1}+\cdots +p_{n} then the kth term's absolute value is \leq {\tfrac {M_{k}}{2^{k}M_{k}}}={\tfrac {1}{2^{k}}}). This completes the construction.

As a corollary, given two disjoint closed subsets A,B of \mathbb {R} ^{n}, the above construction guarantees the existence of smooth non-negative functions f_{A},f_{B}:\mathbb {R} ^{n}\to [0,\infty ) such that for any x\in \mathbb {R} ^{n}, f_{A}(x)=0 if and only if x\in A, and similarly, f_{B}(x)=0 if and only if x\in B, then the function h~:=~{\frac {f_{A}}{f_{A}+f_{B}}}:\mathbb {R} ^{n}\to [0,1] is smooth and for any x\in \mathbb {R} ^{n}, h(x)=0 if and only if x\in A, h(x)=1 if and only if x\in B, and 0<h(x)<1 if and only if x\not \in A\cup B. In particular, h(x)\neq 0 if and only if x\in \mathbb {R} ^{n}\smallsetminus A, so if in addition U:=\mathbb {R} ^{n}\smallsetminus A is relatively compact in \mathbb {R} ^{n} (where A\cap B=\varnothing implies B\subseteq U) then h will be a smooth bump function with support in {\overline {U}}.

The smooth transition g from 0 to 1 defined here.
The smooth transition g from 0 to 1 defined here.

03Properties and uses

While bump functions are smooth, the identity theorem prohibits them from being analytic unless they vanish identically. Bump functions are often used as mollifiers, as smooth cutoff functions, and to form smooth partitions of unity. They are the most common class of test functions used in analysis. The space of bump functions is closed under many operations. For instance, the sum, product, or convolution of two bump functions is again a bump function, and any differential operator with smooth coefficients, when applied to a bump function, will produce another bump function.

If the boundaries of the Bump function domain is \partial x, to fulfill the requirement of "smoothness", it has to preserve the continuity of all its derivatives, which leads to the following requirement at the boundaries of its domain: \lim _{x\to \partial x^{\pm }}{\frac {d^{n}}{dx^{n}}}f(x)=0,\,{\text{ for all }}n\geq 0,\,n\in \mathbb {Z}

The Fourier transform of a bump function is a (real) analytic function, and it can be extended to the whole complex plane: hence it cannot be compactly supported unless it is zero, since the only entire analytic bump function is the zero function (see Paley-Wiener theorem and Liouville's theorem). Because the bump function is infinitely differentiable, its Fourier transform must decay faster than any finite power of 1/k for a large angular frequency |k|. The Fourier transform of the particular bump function \Psi (x)=e^{-1/(1-x^{2})}\mathbf {1} _{\{|x|<1\}} from above can be analyzed by a saddle-point method, and decays asymptotically as |k|^{-3/4}e^{-{\sqrt {|k|}}} for large |k|.

The integral of the bump function \Psi (x) is given by \int _{-\infty }^{\infty }\Psi (x)dx=e^{-1/2}\left(K_{1}\left({\frac {1}{2}}\right)-K_{0}\left({\frac {1}{2}}\right)\right) where K_{1}(x) and K_{0}(x) are the Modified Bessel functions of the second kind.

An illustration of the sets in the construction.
An illustration of the sets in the construction.
Watch videos about Bump functionExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Bump function, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Images, from Wikimedia Commons:

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.