# Smoothness

In mathematical analysis, the smoothness of a function is a property measured by the number of continuous derivatives (differentiability class) it has over its domain.
A function of class $C^{k}$ is a function of smoothness at least k; that is, a function of class $C^{k}$ is a function that has a kth derivative that is continuous in its domain.
A function of class $C^{\infty }$ or $C^{\infty }$-function (pronounced C-infinity function) is an infinitely differentiable function, that is, a function that has derivatives of all orders (this implies that all these derivatives are continuous).
Generally, the term smooth function refers to a $C^{\infty }$-function. However, it may also mean "sufficiently differentiable" for the problem under consideration.

## Differentiability classes

Differentiability class is a classification of functions according to the properties of their derivatives. It is a measure of the highest order of derivative that exists and is continuous for a function.
Consider an open set $U$ on the real line and a function $f$ defined on $U$ with real values. Let k be a non-negative integer. The function $f$ is said to be of differentiability class $C^{k}$ if the derivatives $f',f'',\dots ,f^{(k)}$ exist and are continuous on $U.$ If $f$ is $k$-differentiable on $U,$ then it is at least in the class $C^{k-1}$ since $f',f'',\dots ,f^{(k-1)}$ are continuous on $U.$ The function $f$ is said to be infinitely differentiable, smooth, or of class $C^{\infty },$ if it has derivatives of all orders on $U.$ (So all these derivatives are continuous functions over $U.$) The function $f$ is said to be of class $C^{\omega },$ or analytic, if $f$ is smooth (i.e., $f$ is in the class $C^{\infty }$) and its Taylor series expansion around any point in its domain converges to the function in some neighborhood of the point. There exist functions that are smooth but not analytic; $C^{\omega }$ is thus strictly contained in $C^{\infty }.$ Bump functions are examples of functions with this property.
To put it differently, the class $C^{0}$ consists of all continuous functions. The class $C^{1}$ consists of all differentiable functions whose derivative is continuous; such functions are called continuously differentiable. Thus, a $C^{1}$ function is exactly a function whose derivative exists and is of class $C^{0}.$ In general, the classes $C^{k}$ can be defined recursively by declaring $C^{0}$ to be the set of all continuous functions, and declaring $C^{k}$ for any positive integer $k$ to be the set of all differentiable functions whose derivative is in $C^{k-1}.$ In particular, $C^{k}$ is contained in $C^{k-1}$ for every $k>0,$ and there are examples to show that this containment is strict ($C^{k}\subsetneq C^{k-1}$). The class $C^{\infty }$ of infinitely differentiable functions, is the intersection of the classes $C^{k}$ as $k$ varies over the non-negative integers.

### Examples
#### Example: continuous (C$^0$) but not differentiable

The function $f(x)={\begin{cases}x&{\mbox{if }}x\geq 0,\\0&{\text{if }}x<0\end{cases}}$ is continuous, but not differentiable at x = 0, so it is of class C$^0$, but not of class C$^1$.

#### Example: finitely-times differentiable (C$^k$)

For each even integer k, the function $f(x)=|x|^{k+1}$ is continuous and k times differentiable at all x. At x = 0, however, $f$ is not (k + 1) times differentiable, so $f$ is of class C$^k$, but not of class C$^j$ where j > k.

#### Example: differentiable but not continuously differentiable (not C$^1$)

The function $g(x)={\begin{cases}x^{2}\sin {\left({\tfrac {1}{x}}\right)}&{\text{if }}x\neq 0,\\0&{\text{if }}x=0\end{cases}}$ is differentiable, with derivative $g'(x)={\begin{cases}-{\mathord {\cos \left({\tfrac {1}{x}}\right)}}+2x\sin \left({\tfrac {1}{x}}\right)&{\text{if }}x\neq 0,\\0&{\text{if }}x=0.\end{cases}}$
Because $\cos(1/x)$ oscillates as x → 0, $g'(x)$ is not continuous at zero. Therefore, $g(x)$ is differentiable but not of class C$^1$.

#### Example: differentiable but not Lipschitz continuous

The function $h(x)={\begin{cases}x^{4/3}\sin {\left({\tfrac {1}{x}}\right)}&{\text{if }}x\neq 0,\\0&{\text{if }}x=0\end{cases}}$ is differentiable but its derivative is unbounded on a compact set. Therefore, $h$ is an example of a function that is differentiable but not locally Lipschitz continuous.

#### Example: analytic (C$^ω$)

The exponential function $e^{x}$ is analytic, and hence falls into the class C$^ω$ (where ω is the smallest transfinite ordinal). The trigonometric functions are also analytic wherever they are defined, because they are linear combinations of complex exponential functions $e^{ix}$ and $e^{-ix}$.

#### Example: smooth (C$^∞$) but not analytic (C$^ω$)

The bump function $f(x)={\begin{cases}e^{-{\frac {1}{1-x^{2}}}}&{\text{ if }}|x|<1,\\0&{\text{ otherwise }}\end{cases}}$ is smooth, so of class C$^∞$, but it is not analytic at x = ±1, and hence is not of class C$^ω$. The function f is an example of a smooth function with compact support.

### Multivariate differentiability classes

A function $f:U\subset \mathbb {R} ^{n}\to \mathbb {R}$ defined on an open set $U$ of $\mathbb {R} ^{n}$ is said to be of class $C^{k}$ on $U$, for a positive integer $k$, if all partial derivatives ${\frac {\partial ^{\alpha }f}{\partial x_{1}^{\alpha _{1}}\,\partial x_{2}^{\alpha _{2}}\,\cdots \,\partial x_{n}^{\alpha _{n}}}}(y_{1},y_{2},\ldots ,y_{n})$ exist and are continuous, for every $\alpha _{1},\alpha _{2},\ldots ,\alpha _{n}$ non-negative integers, such that $\alpha =\alpha _{1}+\alpha _{2}+\cdots +\alpha _{n}\leq k$, and every $(y_{1},y_{2},\ldots ,y_{n})\in U$. Equivalently, $f$ is of class $C^{k}$ on $U$ if the $k$-th order Fréchet derivative of $f$ exists and is continuous at every point of $U$. The function $f$ is said to be of class $C$ or $C^{0}$ if it is continuous on $U$. Functions of class $C^{1}$ are also said to be continuously differentiable.
A function $f:U\subset \mathbb {R} ^{n}\to \mathbb {R} ^{m}$, defined on an open set $U$ of $\mathbb {R} ^{n}$, is said to be of class $C^{k}$ on $U$, for a positive integer $k$, if all of its components $f_{i}(x_{1},x_{2},\ldots ,x_{n})=(\pi _{i}\circ f)(x_{1},x_{2},\ldots ,x_{n})=\pi _{i}(f(x_{1},x_{2},\ldots ,x_{n})){\text{ for }}i=1,2,3,\ldots ,m$ are of class $C^{k}$, where $\pi _{i}$ are the natural projections $\pi _{i}:\mathbb {R} ^{m}\to \mathbb {R}$ defined by $\pi _{i}(x_{1},x_{2},\ldots ,x_{m})=x_{i}$. It is said to be of class $C$ or $C^{0}$ if it is continuous, or equivalently, if all components $f_{i}$ are continuous, on $U$.

### The space of C$^k$ functions

Let $D$ be an open subset of the real line. The set of all $C^{k}$ real-valued functions defined on $D$ is a Fréchet vector space, with the countable family of seminorms $p_{K,m}=\sup _{x\in K}\left|f^{(m)}(x)\right|$ where $K$ varies over an increasing sequence of compact sets whose union is $D$, and $m=0,1,\dots ,k$.
The set of $C^{\infty }$ functions over $D$ also forms a Fréchet space. One uses the same seminorms as above, except that $m$ is allowed to range over all non-negative integer values.
The above spaces occur naturally in applications where functions having derivatives of certain orders are necessary; however, particularly in the study of partial differential equations, it can sometimes be more fruitful to work instead with the Sobolev spaces.

## Continuity

The terms parametric continuity (C$^k$) and geometric continuity (G$^n$) were introduced by Brian Barsky, to show that the smoothness of a curve could be measured by removing restrictions on the speed, with which the parameter traces out the curve.

### Parametric continuity

Parametric continuity (C$^k$) is a concept applied to parametric curves, which describes the smoothness of the parameter's value with distance along the curve. A (parametric) curve $s:[0,1]\to \mathbb {R} ^{n}$ is said to be of class C$^k$, if $\textstyle {\frac {d^{k}s}{dt^{k}}}$ exists and is continuous on $[0,1]$, where derivatives at the end-points $0$ and $1$ are taken to be one sided derivatives (from the right at $0$ and from the left at $1$).
As a practical application of this concept, a curve describing the motion of an object with a parameter of time must have C$^1$ continuity and its first derivative is differentiable—for the object to have finite acceleration. For smoother motion, such as that of a camera's path while making a film, higher orders of parametric continuity are required.

#### Order of parametric continuity

The various order of parametric continuity can be described as follows:
* $C^{0}$: zeroth derivative is continuous (curves are continuous)
* $C^{1}$: zeroth and first derivatives are continuous
* $C^{2}$: zeroth, first and second derivatives are continuous
* $C^{n}$: 0-th through $n$-th derivatives are continuous

### Geometric continuity

A curve or surface can be described as having $G^{n}$ continuity, with $n$ being the increasing measure of smoothness. Consider the segments either side of a point on a curve:
* $G^{0}$: The curves touch at the join point.
* $G^{1}$: The curves also share a common tangent direction at the join point.
* $G^{2}$: The curves also share a common center of curvature at the join point.
In general, $G^{n}$ continuity exists if the curves can be reparameterized to have $C^{n}$ (parametric) continuity. A reparametrization of the curve is geometrically identical to the original; only the parameter is affected.
Equivalently, two vector functions $f(t)$ and $g(t)$ such that $f(1)=g(0)$ have $G^{n}$ continuity at the point where they meet if they satisfy equations known as Beta-constraints. For example, the Beta-constraints for $G^{4}$ continuity are:
    ${\begin{aligned}g^{(1)}(0)&=\beta _{1}f^{(1)}(1)\\g^{(2)}(0)&=\beta _{1}^{2}f^{(2)}(1)+\beta _{2}f^{(1)}(1)\\g^{(3)}(0)&=\beta _{1}^{3}f^{(3)}(1)+3\beta _{1}\beta _{2}f^{(2)}(1)+\beta _{3}f^{(1)}(1)\\g^{(4)}(0)&=\beta _{1}^{4}f^{(4)}(1)+6\beta _{1}^{2}\beta _{2}f^{(3)}(1)+(4\beta _{1}\beta _{3}+3\beta _{2}^{2})f^{(2)}(1)+\beta _{4}f^{(1)}(1)\\\end{aligned}}$
where $\beta _{2}$, $\beta _{3}$, and $\beta _{4}$ are arbitrary, but $\beta _{1}$ is constrained to be positive.$^{:65}$ In the case $n=1$, this reduces to $f'(1)\neq 0$ and $f'(1)=kg'(0)$, for a scalar $k>0$ (i.e., the direction, but not necessarily the magnitude, of the two vectors is equal).
While it may be obvious that a curve would require $G^{1}$ continuity to appear smooth, for good aesthetics, such as those aspired to in architecture and sports car design, higher levels of geometric continuity are required. For example, reflections in a car body will not appear smooth unless the body has $G^{2}$ continuity.
A rounded rectangle (with ninety degree circular arcs at the four corners) has $G^{1}$ continuity, but does not have $G^{2}$ continuity. The same is true for a rounded cube, with octants of a sphere at its corners and quarter-cylinders along its edges. If an editable curve with $G^{2}$ continuity is required, then cubic splines are typically chosen; these curves are frequently used in industrial design.

## Other concepts
### Relation to analyticity

While all analytic functions are "smooth" (i.e. have all derivatives continuous) on the set on which they are analytic, examples such as bump functions (mentioned above) show that the converse is not true for functions on the reals: there exist smooth real functions that are not analytic. Simple examples of functions that are smooth but not analytic at any point can be made by means of Fourier series; another example is the Fabius function. Although it might seem that such functions are the exception rather than the rule, it turns out that the analytic functions are scattered very thinly among the smooth ones; more rigorously, the analytic functions form a meagre subset of the smooth functions. Furthermore, for every open subset A of the real line, there exist smooth functions that are analytic on A and nowhere else.
It is useful to compare the situation to that of the ubiquity of transcendental numbers on the real line. Both on the real line and the set of smooth functions, the examples we come up with at first thought (algebraic/rational numbers and analytic functions) are far better behaved than the majority of cases: the transcendental numbers and nowhere analytic functions have full measure (their complements are meagre).
The situation thus described is in marked contrast to complex differentiable functions. If a complex function is differentiable just once on an open set, it is both infinitely differentiable and analytic on that set.

### Smooth partitions of unity

Smooth functions with given closed support are used in the construction of smooth partitions of unity (see partition of unity and topology glossary); these are essential in the study of smooth manifolds, for example to show that Riemannian metrics can be defined globally starting from their local existence. A simple case is that of a bump function on the real line, that is, a smooth function f that takes the value 0 outside an interval [a,b] and such that $f(x)>0\quad {\text{ for }}\quad a<x<b.\,$
Given a number of overlapping intervals on the line, bump functions can be constructed on each of them, and on semi-infinite intervals $(-\infty ,c]$ and $[d,+\infty )$ to cover the whole line, such that the sum of the functions is always 1.
From what has just been said, partitions of unity do not apply to holomorphic functions; their different behavior relative to existence and analytic continuation is one of the roots of sheaf theory. In contrast, sheaves of smooth functions tend not to carry much topological information.

### Smooth functions on and between manifolds

Given a smooth manifold $M$, of dimension $m,$ and an atlas ${\mathfrak {U}}=\{(U_{\alpha },\phi _{\alpha })\}_{\alpha },$ then a map $f:M\to \mathbb {R}$ is smooth on $M$ if for all $p\in M$ there exists a chart $(U,\phi )\in {\mathfrak {U}},$ such that $p\in U,$ and $f\circ \phi ^{-1}:\phi (U)\to \mathbb {R}$ is a smooth function from a neighborhood of $\phi (p)$ in $\mathbb {R} ^{m}$ to $\mathbb {R}$ (all partial derivatives up to a given order are continuous). Smoothness can be checked with respect to any chart of the atlas that contains $p,$ since the smoothness requirements on the transition functions between charts ensure that if $f$ is smooth near $p$ in one chart it will be smooth near $p$ in any other chart.
If $F:M\to N$ is a map from $M$ to an $n$-dimensional manifold $N$, then $F$ is smooth if, for every $p\in M,$ there is a chart $(U,\phi )$ containing $p,$ and a chart $(V,\psi )$ containing $F(p)$ such that $F(U)\subset V,$ and $\psi \circ F\circ \phi ^{-1}:\phi (U)\to \psi (V)$ is a smooth function from $\mathbb {R} ^{n}.$
Smooth maps between manifolds induce linear maps between tangent spaces: for $F:M\to N$, at each point the pushforward (or differential) maps tangent vectors at $p$ to tangent vectors at $F(p)$: $F_{*,p}:T_{p}M\to T_{F(p)}N,$ and on the level of the tangent bundle, the pushforward is a vector bundle homomorphism: $F_{*}:TM\to TN.$ The dual to the pushforward is the pullback, which "pulls" covectors on $N$ back to covectors on $M,$ and $k$-forms to $k$-forms: $F^{*}:\Omega ^{k}(N)\to \Omega ^{k}(M).$ In this way smooth functions between manifolds can transport local data, like vector fields and differential forms, from one manifold to another, or down to Euclidean space where computations like integration are well understood.
Preimages and pushforwards along smooth functions are, in general, not manifolds without additional assumptions. Preimages of regular points (that is, if the differential does not vanish on the preimage) are manifolds; this is the preimage theorem. Similarly, pushforwards along embeddings are manifolds.

### Smooth functions between subsets of manifolds

There is a corresponding notion of smooth map for arbitrary subsets of manifolds. If $f:X\to Y$ is a function whose domain and range are subsets of manifolds $X\subseteq M$ and $Y\subseteq N$ respectively. $f$ is said to be smooth if for all $x\in X$ there is an open set $U\subseteq M$ with $x\in U$ and a smooth function $F:U\to N$ such that $F(p)=f(p)$ for all $p\in U\cap X.$