The space of test functions $\mathcal{D}(\Omega)$ is the simplest and most fundamental space of "probe" [functions](/page/Function) in analysis. Its elements — smooth functions with compact support — play three distinct roles throughout the theory.
First, test functions define [distributions](/pages/1087) by duality. A distribution on $\Omega$ is a continuous linear functional on $\mathcal{D}(\Omega)$; the topology on $\mathcal{D}(\Omega)$ determines which linear functionals count as "continuous" and hence which generalised functions the theory admits. Second, test functions provide the raw material for *mollification*: convolving a rough function with a rescaled test function produces a smooth approximation, and this is the engine behind most approximation and density arguments in PDE theory. Third, test functions enable *localisation* via partitions of unity: any global problem on $\Omega$ can be decomposed into local problems on small [open sets](/page/Open%20Set), solved locally, and reassembled.
Both defining properties of test functions — smoothness and compact support — serve specific purposes. Smoothness ensures that [integration by parts](/theorems/210) against a test function produces no error terms from non-differentiability; this is what makes the [distributional derivative](/page/Distributional%20Derivative) well-defined. Compact support ensures that all pairings $\int f\varphi\,d\mathcal{L}^n$ are finite (no convergence issues at infinity or at the [boundary](/page/Boundary) of $\Omega$) and that boundary contributions vanish in integration-by-parts formulae.
## Definition
[definition: Test Function]
Let $\Omega \subseteq \mathbb{R}^n$ be a non-empty open set. The **space of test functions** on $\Omega$ is the vector space
\begin{align*}
\mathcal{D}(\Omega) &:= \{ \varphi \in C^\infty(\Omega) \mid \mathrm{supp}(\varphi) \subset \Omega \text{ is compact} \}.
\end{align*}
The notation $C_c^\infty(\Omega)$ is also used.
[/definition]
The requirement that $\mathrm{supp}(\varphi)$ be a compact subset of $\Omega$ (not merely of $\mathbb{R}^n$) ensures that $\varphi$ vanishes identically in a neighbourhood of $\partial\Omega$. This is stronger than just requiring $\varphi = 0$ on $\partial\Omega$: the function must vanish on an entire open strip near the boundary.
### The Standard Bump Function
The space $\mathcal{D}(\Omega)$ is non-empty for every non-empty open $\Omega \subseteq \mathbb{R}^n$. The standard construction produces a radially symmetric bump function on $\mathbb{R}^n$ by setting
\begin{align*}
\rho(x) &:= \begin{cases} c \exp\!\left(\dfrac{-1}{1-|x|^2}\right) & \text{if } |x| < 1, \\[4pt] 0 & \text{if } |x| \ge 1, \end{cases}
\end{align*}
where $c > 0$ is chosen so that $\int_{\mathbb{R}^n} \rho \, d\mathcal{L}^n = 1$. The [Smoothness of the Standard Mollifier](/theorems/462) theorem verifies that this function belongs to $C^\infty(\mathbb{R}^n)$: the key fact is that $e^{-1/t}$ vanishes to infinite order at $t = 0$ (exponential decay beats any polynomial), so all [derivatives](/page/Derivative) of $\rho$ match at the transition $|x| = 1$. One has $\mathrm{supp}(\rho) = \overline{B}(0,1)$. By translating and rescaling — $\rho_{x_0,r}(x) := r^{-n}\rho((x-x_0)/r)$ — one obtains a test function supported in $\overline{B}(x_0, r)$ for any $x_0 \in \Omega$ and $r > 0$ with $\overline{B}(x_0, r) \subset \Omega$.
The function $\rho$ also serves as the standard mollifier; see the Mollification section below.
## The Topology on $\mathcal{D}(\Omega)$
Before one can speak of "continuous" linear functionals on $\mathcal{D}(\Omega)$ — and hence of distributions — the space must be equipped with a topology. The correct topology is an inductive limit, built from the [Fréchet spaces](/page/Fr%C3%A9chet%20Space) of test functions with a fixed support constraint.
### The Fréchet Spaces $\mathcal{D}_K(\Omega)$
For each compact set $K \subset \Omega$, define
\begin{align*}
\mathcal{D}_K(\Omega) &:= \{\varphi \in C^\infty(\Omega) : \mathrm{supp}(\varphi) \subseteq K\},
\end{align*}
equipped with the topology generated by the countable family of seminorms
\begin{align*}
p_{K,N}(\varphi) &:= \sum_{|\alpha| \le N} \sup_{x \in K} |\partial^\alpha \varphi(x)|, \quad N \in \mathbb{N}_0.
\end{align*}
Convergence in $\mathcal{D}_K(\Omega)$ means [uniform convergence](/page/Uniform%20Convergence) of all derivatives on $K$. The space $\mathcal{D}_K(\Omega)$ is a Fréchet space: it is metrizable (the topology is generated by countably many seminorms), Hausdorff (if all seminorms of $\varphi$ vanish then $\varphi = 0$), and complete (a [Cauchy sequence](/page/Cauchy%20Sequence) in $\mathcal{D}_K$ converges uniformly in all derivatives to a smooth function with support in $K$, by the completeness of uniform convergence on compact [sets](/page/Set)).
### The Strict Inductive [Limit](/page/Limit)
[definition: Inductive Limit Topology On Test Function Space]
Let $\Omega \subseteq \mathbb{R}^n$ be a non-empty open set. Choose an exhaustion $K_1 \subset K_2 \subset \cdots$ of $\Omega$ by compact sets with $K_j \subset \mathrm{int}(K_{j+1})$ and $\bigcup_{j=1}^\infty K_j = \Omega$. The **[strict inductive limit topology](/page/Strict%20Inductive%20Limit%20Topology)** on $\mathcal{D}(\Omega) = \bigcup_{j=1}^\infty \mathcal{D}_{K_j}(\Omega)$ is the finest locally convex topology on $\mathcal{D}(\Omega)$ making each inclusion $\iota_j: \mathcal{D}_{K_j}(\Omega) \hookrightarrow \mathcal{D}(\Omega)$ continuous.
[/definition]
The resulting topology is independent of the choice of exhaustion (any two exhaustions are cofinal). It is Hausdorff and complete, but *not* metrizable — in particular, the topology cannot be described by a single countable family of seminorms. The non-metrizability is an unavoidable consequence of writing $\mathcal{D}(\Omega)$ as a union of infinitely many Fréchet spaces with strictly increasing supports: no single metric can simultaneously control convergence in all of them. Despite this, the topology is well-behaved: $\mathcal{D}(\Omega)$ is an LF-space (countable strict inductive limit of Fréchet spaces), and this structure ensures that sequential [continuity](/page/Continuity) of linear functionals is equivalent to full [topological](/page/Topology) continuity — the key property that makes distribution theory workable in practice.
### Sequential Characterisation
The abstract definition of the strict inductive limit topology is difficult to use directly. The following theorem reduces sequential convergence to two concrete, checkable conditions.
[quotetheorem:448]
This is the primary tool for verifying that a given linear functional is a [distribution](/pages/1087): one checks that if $\varphi_k \to 0$ in the sense of the theorem (uniform support, all derivatives converging uniformly), then $T(\varphi_k) \to 0$. The equivalence between sequential continuity and topological continuity — which is guaranteed by the LF-space structure and would fail for general locally convex spaces — is what reduces the abstract inductive limit topology to this concrete sequential criterion. The [characterisation of distributions](/theorems/449) makes this precise.
## Mollifiers and Approximation to the Identity
One of the most powerful uses of test functions is as *mollifiers*: [convolution](/page/Convolution) kernels that smooth rough functions into $C^\infty$ approximations.
[definition: Standard Mollifier]
The **[standard mollifier](/page/Standard%20Mollifier)** is the function $\rho \in \mathcal{D}(\mathbb{R}^n)$ defined in the bump function construction above, normalised so that $\int \rho \, d\mathcal{L}^n = 1$. For $\varepsilon > 0$, the **rescaled mollifier** is $\rho_\varepsilon(x) := \varepsilon^{-n}\rho(x/\varepsilon)$. Then $\rho_\varepsilon \in \mathcal{D}(\mathbb{R}^n)$, $\rho_\varepsilon \ge 0$, $\mathrm{supp}(\rho_\varepsilon) = \overline{B}(0,\varepsilon)$, and $\int \rho_\varepsilon \, d\mathcal{L}^n = 1$. The family $\{\rho_\varepsilon\}_{\varepsilon > 0}$ is called an **approximation to the identity**: as $\varepsilon \to 0$, the mass of $\rho_\varepsilon$ concentrates at the origin.
[/definition]
For any locally [integrable](/page/Integral) function $f$, the **mollification** $f_\varepsilon := f * \rho_\varepsilon$ is defined by
\begin{align*}
f_\varepsilon(x) &:= (f * \rho_\varepsilon)(x) = \int_{\mathbb{R}^n} f(y)\,\rho_\varepsilon(x - y)\,d\mathcal{L}^n(y).
\end{align*}
[quotetheorem:461]
The three properties — smoothness, support control, and $L^p$ convergence — together make mollification the universal approximation tool in analysis. The smoothness assertion says that convolving *any* locally integrable function with a test function produces a $C^\infty$ function; this is the reason that $f * \varphi \in C^\infty$ whenever $\varphi \in \mathcal{D}(\mathbb{R}^n)$, regardless of the regularity of $f$. The support property $\mathrm{supp}(f_\varepsilon) \subseteq \mathrm{supp}(f) + \overline{B}(0,\varepsilon)$ means that mollification does not spread the support by more than $\varepsilon$; in particular, if $f$ has compact support then so does $f_\varepsilon$, and $f_\varepsilon \in \mathcal{D}(\mathbb{R}^n)$.
Mollification also converges pointwise under weaker hypotheses: if $f$ is continuous at $x$, then $f_\varepsilon(x) \to f(x)$ as $\varepsilon \to 0$ (since $f_\varepsilon(x) = \int \rho(z)f(x - \varepsilon z)\,d\mathcal{L}^n(z) \to f(x)$ by continuity and dominated convergence). If $f$ is uniformly continuous on $\mathbb{R}^n$, the convergence is uniform.
## Partitions of Unity
The second major application of test functions is *localisation*: decomposing a global problem into local pieces using smooth cutoff functions whose supports cover $\Omega$ and whose values sum to $1$.
[quotetheorem:57]
The key point is that each $\eta_i$ is smooth (not merely continuous), compactly supported inside $U_i$, and the family is locally finite. This means that for any $\varphi \in \mathcal{D}(\Omega)$, the decomposition $\varphi = \sum_i \eta_i \varphi$ is a *finite* sum (since $\mathrm{supp}(\varphi)$ is compact and meets only finitely many $\mathrm{supp}(\eta_i)$), and each $\eta_i\varphi \in \mathcal{D}(U_i)$.
Partitions of unity are used throughout the wiki:
- In the proof of the [localisation of vanishing](/theorems/453) for [distributions](/page/Distribution): if a distribution vanishes on each member of an open cover, a [partition of unity](/page/Partition%20of%20Unity) decomposes any test function into pieces supported in individual members, on which the distribution is known to vanish.
- In the definition of [distributional derivatives](/pages/1046) on manifolds and in local regularity arguments for elliptic PDE.
- In the proof of the [existence of smooth partitions of unity](/theorems/57) itself, which relies on the bump function construction from §1 to produce the initial smooth bumps.
### Smooth Cutoff Functions
A common special case of the partition-of-unity construction produces a smooth cutoff function adapted to a pair of sets $K \subset U$ with $K$ compact and $U$ open.
[definition: Smooth Cutoff Function]
Given a compact set $K \subset \Omega$ and an open set $U$ with $K \subset U \subseteq \Omega$, a **smooth cutoff function** for $K$ relative to $U$ is a function $\chi \in \mathcal{D}(\Omega)$ satisfying $0 \le \chi \le 1$, $\chi = 1$ on $K$, and $\mathrm{supp}(\chi) \subset U$.
[/definition]
Such a function always exists: apply the [partition of unity](/theorems/57) to the cover $\{U, \Omega \setminus K\}$ of $\Omega$ and take $\chi := \eta_U$. Alternatively, convolve $\mathbb{1}_V$ with $\rho_\varepsilon$ for a suitably chosen open set $V$ with $K \subset V \subset \overline{V} \subset U$ and $\varepsilon < \mathrm{dist}(\overline{V}, \partial U)/2$. Smooth cutoffs are the basic tool for localising distributions: if $T \in \mathcal{D}'(\Omega)$ and one wishes to study $T$ near $K$, the product $\chi T$ (defined by $(\chi T)(\varphi) := T(\chi\varphi)$) isolates the behaviour of $T$ on $K$ while remaining a globally defined distribution.
## Density Results
Test functions are dense in most of the function spaces encountered in PDE theory. This is crucial: it means that any element of these spaces can be approximated by objects that are simultaneously smooth and compactly supported.
[quotetheorem:459]
The proof combines the two tools developed above: truncation (to make the function compactly supported) and mollification (to make it smooth). Neither step alone suffices — truncation can introduce discontinuities at the boundary of the cutoff, while mollification of a non-compactly-supported function need not produce a compactly supported result.
The density result has two important negative counterparts. First, $\mathcal{D}(\Omega)$ is *not* dense in $L^\infty(\Omega)$: the closure of $\mathcal{D}(\Omega)$ in $L^\infty$ is $C_0(\Omega)$ (continuous functions vanishing at the boundary and at infinity), which does not contain, say, the constant function $1$. The failure is that $L^\infty$ convergence is too strong — it cannot tolerate the transition region where a smooth cutoff drops from $1$ to $0$. Second, $\mathcal{D}(\Omega)$ is not dense in $C^k(\overline{\Omega})$ when $\Omega$ is bounded: test functions vanish near $\partial\Omega$, but elements of $C^k(\overline{\Omega})$ need not.
Test functions are also dense in larger function spaces:
- $\mathcal{D}(\mathbb{R}^n)$ is [dense in the Schwartz space $\mathcal{S}(\mathbb{R}^n)$](/theorems/455) with respect to the Schwartz topology. The proof is a truncation argument: multiply a Schwartz function by smooth cutoffs $\chi(x/k) \to 1$ and use the rapid decay of the Schwartz function to control the error in every seminorm.
- $\mathcal{D}(\Omega)$ is dense in the [Sobolev spaces](/pages/1018) $W^{k,p}(\Omega)$ for $1 \le p < \infty$ when $\Omega = \mathbb{R}^n$ (the [Meyers–Serrin theorem](https://en.wikipedia.org/wiki/Meyers%E2%80%93Serrin_theorem) gives density of $C^\infty \cap W^{k,p}$; adding compact support requires $\Omega = \mathbb{R}^n$ or suitable boundary conditions).
## Relationship to Other Test Function Spaces
The space $\mathcal{D}(\Omega)$ is the smallest of three classical test function spaces on $\mathbb{R}^n$, each designed for a different class of generalised functions.
| Space | Elements | Topology | Dual |
|---|---|---|---|
| $\mathcal{D}(\mathbb{R}^n)$ | $C^\infty$, compact support | Strict inductive limit | $\mathcal{D}'(\mathbb{R}^n)$ — all distributions |
| $\mathcal{S}(\mathbb{R}^n)$ | $C^\infty$, rapid decay | Fréchet (countable seminorms) | $\mathcal{S}'(\mathbb{R}^n)$ — [tempered distributions](/pages/1053) |
| $\mathcal{E}(\mathbb{R}^n) = C^\infty(\mathbb{R}^n)$ | $C^\infty$, no decay/support condition | Fréchet (uniform on compacts) | $\mathcal{E}'(\mathbb{R}^n)$ — compactly supported distributions |
The inclusions
\begin{align*}
\mathcal{D}(\mathbb{R}^n) \hookrightarrow \mathcal{S}(\mathbb{R}^n) \hookrightarrow \mathcal{E}(\mathbb{R}^n) = C^\infty(\mathbb{R}^n)
\end{align*}
are continuous and dense. Dualising reverses the inclusions:
\begin{align*}
\mathcal{E}'(\mathbb{R}^n) \hookrightarrow \mathcal{S}'(\mathbb{R}^n) \hookrightarrow \mathcal{D}'(\mathbb{R}^n).
\end{align*}
The pattern is: as the test function space grows (imposing weaker conditions on its elements), the dual space shrinks (requiring more stringent continuity). A functional on $\mathcal{D}$ need only be continuous against compactly supported probes, so $\mathcal{D}'$ is the largest dual — it admits distributions of arbitrary growth and infinite order. A functional on $\mathcal{E} = C^\infty$ must handle test functions that are smooth but have arbitrary growth at infinity; the only way to be continuous against such test functions is to "live on" a compact set, so $\mathcal{E}'$ consists exactly of compactly supported distributions.
The [Schwartz space](/pages/1050) $\mathcal{S}(\mathbb{R}^n)$ occupies the middle position: its test functions decay rapidly but need not have compact support. Its dual $\mathcal{S}'(\mathbb{R}^n)$ admits distributions of polynomial growth but excludes super-polynomial growth (such as $T_{e^{e^x}}$). The defining advantage of $\mathcal{S}'$ is that the [Fourier transform extends to it](/theorems/230) as a topological automorphism — this fails for both $\mathcal{D}'$ (too large) and $\mathcal{E}'$ (too small, though $\mathcal{E}'$ has its own Fourier theory via the Paley–Wiener theorem).
On a general open set $\Omega \subsetneq \mathbb{R}^n$, the [Schwartz space](/page/Schwartz%20Space) is not defined (rapid decay at infinity is meaningful only on all of $\mathbb{R}^n$). The relevant spaces reduce to $\mathcal{D}(\Omega) \hookrightarrow \mathcal{E}(\Omega) = C^\infty(\Omega)$, with duals $\mathcal{E}'(\Omega) \hookrightarrow \mathcal{D}'(\Omega)$.
## References
1. L. Schwartz, *Théorie des Distributions*, 2nd ed. (1966).
2. L. Hörmander, *The Analysis of Linear Partial Differential Operators I* (1983).
3. W. Rudin, *Functional Analysis* (1991).
4. F. Trèves, *[Topological Vector Spaces](/page/Topological%20Vector%20Space), Distributions, and Kernels* (1967).
5. L. C. Evans, *Partial Differential Equations* (1998).