# Differentiable function

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Differentiable_function
> Markdown URL: https://mediated.wiki/source/Differentiable_function.md
> Source: https://en.wikipedia.org/wiki/Differentiable_function
> Source revision: 1354134197
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Mathematical function whose derivative exists

A differentiable function

In [mathematical analysis](/source/Mathematical_analysis), a [real](/source/Real_number) or [complex](/source/Complex_number) [function](/source/Function_(mathematics)) of a single variable is **differentiable** if its [derivative](/source/Derivative) exists at each point in its [domain](/source/Domain_of_a_function). For real-valued functions of a real variable, the [graph](/source/Graph_of_a_function) of a differentiable function has a non-[vertical](/source/Vertical_tangent) [tangent line](/source/Tangent_line) at each interior point in its domain. A differentiable function is [locally](/source/Neighbourhood_(mathematics)) approximable by a [linear function](/source/Linear_function) at each interior point, and does not contain any [break](/source/Classification_of_discontinuities), angle, or [cusp](/source/Cusp_(singularity)).

If x 0 {\displaystyle x_{0}} is an interior point in the domain of a real function f {\displaystyle f} , then f {\displaystyle f} is said to be *differentiable at* x 0 {\displaystyle x_{0}} if there exists an L ∈ R {\displaystyle L\in \mathbb {R} } such that for all ϵ > 0 {\displaystyle \epsilon >0} , there exists a δ > 0 {\displaystyle \delta >0} such that for all x ∈ ( x 0 − δ , x 0 ) ∪ ( x 0 , x 0 + δ ) {\displaystyle x\in (x_{0}-\delta ,x_{0})\cup (x_{0},x_{0}+\delta )} , f ( x ) − f ( x 0 ) x − x 0 ∈ ( L − ϵ , L + ϵ ) {\displaystyle {\frac {f(x)-f(x_{0})}{x-x_{0}}}\in (L-\epsilon ,L+\epsilon )} . In other words, the graph of f {\displaystyle f} has a non-vertical tangent line at the point ( x 0 , f ( x 0 ) ) {\displaystyle (x_{0},f(x_{0}))} . f {\displaystyle f} is said to be differentiable on a subset U ⊆ R {\displaystyle U\subseteq \mathbb {R} } if it is differentiable at every point in U {\displaystyle U} . f {\displaystyle f} is said to be *[continuously differentiable](/source/Continuously_differentiable_function)* if its derivative is also a continuous function over the domain of f {\textstyle f} .

Continuous functions may be nowhere differentiable in their domain, such as the [Weierstrass function](/source/Weierstrass_function). Taking successive antiderivatives of such a function allows one to obtain a function that is differentiable only a finite number of times, the finite number being any positive integer. Given a positive integer k {\displaystyle k} , f {\displaystyle f} is said to be of class C k {\displaystyle C^{k}} if its first k {\displaystyle k} derivatives f ′ , f ′ ′ , … , f ( k ) {\textstyle f^{\prime },f^{\prime \prime },\ldots ,f^{(k)}} exist and are continuous over the domain of f {\displaystyle f} .

For a multivariable function, as shown [here](#Differentiability_in_higher_dimensions), the differentiability of it is something more complex than the existence of the partial derivatives of it.

## Differentiability of real functions of one variable

A function f : U → R {\displaystyle f:U\to \mathbb {R} } , defined on an open set U ⊂ R {\textstyle U\subset \mathbb {R} } , is said to be *differentiable* at a ∈ U {\displaystyle a\in U} if the derivative

- f ′ ( a ) = lim h → 0 f ( a + h ) − f ( a ) h = lim x → a f ( x ) − f ( a ) x − a {\displaystyle f'(a)=\lim _{h\to 0}{\frac {f(a+h)-f(a)}{h}}=\lim _{x\to a}{\frac {f(x)-f(a)}{x-a}}}

exists. This implies that the function is [continuous](/source/Continuous_function) at a.

This function f is said to be *differentiable* on U if it is differentiable at every point of U. In this case, the derivative of f is thus a function from U into R . {\displaystyle \mathbb {R} .}

A continuous function is not necessarily differentiable, but a differentiable function is necessarily [continuous](/source/Continuous_function) (at every point where it is differentiable) as is shown below (in the section [Differentiability and continuity](#Differentiability_and_continuity)). A function is said to be *continuously differentiable* if its derivative is also a continuous function; there exist functions that are differentiable but not continuously differentiable (an example is given in the section [Differentiability classes](#Differentiability_classes)).

### Semi-differentiability

Main article: [Semi-differentiability](/source/Semi-differentiability)

The above definition can be extended to define the derivative at [boundary points](/source/Boundary_(topology)) of the domain that also belong to the domain. The derivative of a function f : A → R {\textstyle f:A\to \mathbb {R} } defined on a closed subset A ⊊ R {\textstyle A\subsetneq \mathbb {R} } of the real numbers, evaluated at a boundary point c {\textstyle c} , can be defined as the following one-sided limit, where the argument x {\textstyle x} approaches c {\textstyle c} such that it is always within A {\textstyle A} :

- f ′ ( c ) = lim x → c x ∈ A f ( x ) − f ( c ) x − c . {\displaystyle f'(c)=\lim _{\scriptstyle x\to c \atop \scriptstyle x\in A}{\frac {f(x)-f(c)}{x-c}}.}

For x {\textstyle x} to remain within A {\textstyle A} , which is a subset of the reals, it follows that this limit will be defined as either

- f ′ ( c ) = lim x → c + f ( x ) − f ( c ) x − c or f ′ ( c ) = lim x → c − f ( x ) − f ( c ) x − c . {\displaystyle f'(c)=\lim _{x\to c^{+}}{\frac {f(x)-f(c)}{x-c}}\quad {\text{or}}\quad f'(c)=\lim _{x\to c^{-}}{\frac {f(x)-f(c)}{x-c}}.}

## Differentiability and continuity

See also: [Continuous function](/source/Continuous_function)

The [absolute value](/source/Absolute_value) function is continuous (i.e. it has no gaps). It is differentiable everywhere *except* at the point *x* = 0, where it makes a sharp turn as it crosses the *y*-axis.

A [cusp](/source/Cusp_(singularity)) on the graph of a continuous function. At zero, the function is continuous but not differentiable.

If *f* is differentiable at a point *x*0, then *f* must also be [continuous](/source/Continuous_function) at *x*0. In particular, any differentiable function must be continuous at every point in its domain. *The converse does not hold*: a continuous function need not be differentiable. For example, a function with a bend, [cusp](/source/Cusp_(singularity)), or [vertical tangent](/source/Vertical_tangent) may be continuous, but fails to be differentiable at the location of the anomaly.

Most functions that occur in practice have derivatives at all points or at [almost every](/source/Almost_everywhere) point. However, a result of [Stefan Banach](/source/Stefan_Banach) states that the set of functions that have a derivative at some point is a [meagre set](/source/Meagre_set) in the space of all continuous functions.[1] Informally, this means that differentiable functions are very atypical among continuous functions. The first known example of a function that is continuous everywhere but differentiable nowhere is the [Weierstrass function](/source/Weierstrass_function).

## Differentiability classes

Differentiable functions can be locally approximated by linear functions.

The function

        f
        :

          R

        →

          R

    {\displaystyle f:\mathbb {R} \to \mathbb {R} }

 with

        f
        (
        x
        )
        =

          x

            2

        sin
        ⁡

          (

                1
                x

          )

    {\displaystyle f(x)=x^{2}\sin \left({\tfrac {1}{x}}\right)}

 for

        x
        ≠
        0

    {\displaystyle x\neq 0}

 and

        f
        (
        0
        )
        =
        0

    {\displaystyle f(0)=0}

 is differentiable. However, this function is not continuously differentiable.

Main article: [Smoothness](/source/Smoothness)

A function f {\textstyle f} is said to be [continuously differentiable](/source/Continuously_differentiable_function) if the derivative f ′ ( x ) {\textstyle f^{\prime }(x)} exists and is itself a continuous function. Although the derivative of a differentiable function never has a [jump discontinuity](/source/Jump_discontinuity), it is possible for the derivative to have an [essential discontinuity](/source/Classification_of_discontinuities#Essential_discontinuity). For example, the function f ( x ) = { x 2 sin ⁡ ( 1 / x ) if x ≠ 0 0 if x = 0 {\displaystyle f(x)\;=\;{\begin{cases}x^{2}\sin(1/x)&{\text{ if }}x\neq 0\\0&{\text{ if }}x=0\end{cases}}} is differentiable at 0, since f ′ ( 0 ) = lim ε → 0 ( ε 2 sin ⁡ ( 1 / ε ) − 0 ε ) = 0 {\displaystyle f'(0)=\lim _{\varepsilon \to 0}\left({\frac {\varepsilon ^{2}\sin(1/\varepsilon )-0}{\varepsilon }}\right)=0} exists. However, for x ≠ 0 , {\displaystyle x\neq 0,} [differentiation rules](/source/Differentiation_rules) imply f ′ ( x ) = 2 x sin ⁡ ( 1 / x ) − cos ⁡ ( 1 / x ) , {\displaystyle f'(x)=2x\sin(1/x)-\cos(1/x)\;,} which has no limit as x → 0. {\displaystyle x\to 0.} Thus, this example shows the existence of a function that is differentiable but not continuously differentiable (i.e., the derivative is not a continuous function). Nevertheless, [Darboux's theorem](/source/Darboux's_theorem_(analysis)) implies that the derivative of any function satisfies the conclusion of the [intermediate value theorem](/source/Intermediate_value_theorem).

Similarly to how [continuous functions](/source/Continuous_function) are said to be of *class C 0 , {\displaystyle C^{0},}* continuously differentiable functions are sometimes said to be of *class C 1 {\displaystyle C^{1}}*. A function is of *class C 2 {\displaystyle C^{2}}* if the first and [second derivative](/source/Second_derivative) of the function both exist and are continuous. More generally, a function is said to be of *class C k {\displaystyle C^{k}}* if the first k {\displaystyle k} derivatives f ′ ( x ) , f ′ ′ ( x ) , … , f ( k ) ( x ) {\textstyle f^{\prime }(x),f^{\prime \prime }(x),\ldots ,f^{(k)}(x)} all exist and are continuous. If derivatives f ( n ) {\displaystyle f^{(n)}} exist for all positive integers n , {\textstyle n,} the function is [smooth](/source/Smooth_function) or equivalently, of *class C ∞ . {\displaystyle C^{\infty }.}*

## Differentiability in higher dimensions

See also: [Multivariable calculus](/source/Multivariable_calculus) and [Smoothness § Multivariate differentiability classes](/source/Smoothness#Multivariate_differentiability_classes)

A [function of several real variables](/source/Function_of_several_real_variables) **f**: **R***m* → **R***n* is said to be differentiable at a point **x**0 if there exists a [linear map](/source/Linear_map) **J**: **R***m* → **R***n* such that

- lim h → 0 ‖ f ( x 0 + h ) − f ( x 0 ) − J ( h ) ‖ R n ‖ h ‖ R m = 0. {\displaystyle \lim _{\mathbf {h} \to \mathbf {0} }{\frac {\|\mathbf {f} (\mathbf {x_{0}} +\mathbf {h} )-\mathbf {f} (\mathbf {x_{0}} )-\mathbf {J} \mathbf {(h)} \|_{\mathbf {R} ^{n}}}{\|\mathbf {h} \|_{\mathbf {R} ^{m}}}}=0.}

If a function is differentiable at **x**0, then all of the [partial derivatives](/source/Partial_derivative) exist at **x**0, and the linear map **J** is given by the [Jacobian matrix](/source/Jacobian_matrix), an *n* × *m* matrix in this case. A similar formulation of the higher-dimensional derivative is provided by the [fundamental increment lemma](/source/Fundamental_increment_lemma) found in single-variable calculus.

If all the partial derivatives of a function exist in a [neighborhood](/source/Neighbourhood_(mathematics)) of a point **x**0 and are continuous at the point **x**0, then the function is differentiable at that point **x**0.

However, the existence of the partial derivatives (or even of all the [directional derivatives](/source/Directional_derivative)) does not guarantee that a function is differentiable at a point. For example, the function *f*: **R**2 → **R** defined by

- f ( x , y ) = { x if y ≠ x 2 0 if y = x 2 {\displaystyle f(x,y)={\begin{cases}x&{\text{if }}y\neq x^{2}\\0&{\text{if }}y=x^{2}\end{cases}}}

is not differentiable at (0, 0), but all of the partial derivatives and directional derivatives exist at this point. For a continuous example, the function

- f ( x , y ) = { y 3 / ( x 2 + y 2 ) if ( x , y ) ≠ ( 0 , 0 ) 0 if ( x , y ) = ( 0 , 0 ) {\displaystyle f(x,y)={\begin{cases}y^{3}/(x^{2}+y^{2})&{\text{if }}(x,y)\neq (0,0)\\0&{\text{if }}(x,y)=(0,0)\end{cases}}}

is not differentiable at (0, 0), but again all of the partial derivatives and directional derivatives exist.

## Differentiability in complex analysis

Main article: [Holomorphic function](/source/Holomorphic_function)

In [complex analysis](/source/Complex_analysis), complex-differentiability is defined using the same definition as single-variable real functions. This is allowed by the possibility of dividing [complex numbers](/source/Complex_number). So, a function f : C → C {\textstyle f:\mathbb {C} \to \mathbb {C} } is said to be differentiable at x = a {\textstyle x=a} when

- f ′ ( a ) = lim h → 0 h ∈ C f ( a + h ) − f ( a ) h . {\displaystyle f'(a)=\lim _{\underset {h\in \mathbb {C} }{h\to 0}}{\frac {f(a+h)-f(a)}{h}}.}

Although this definition looks similar to the differentiability of single-variable real functions, it is however a more restrictive condition. A function f : C → C {\textstyle f:\mathbb {C} \to \mathbb {C} } , that is complex-differentiable at a point x = a {\textstyle x=a} is automatically differentiable at that point, when viewed as a function f : R 2 → R 2 {\displaystyle f:\mathbb {R} ^{2}\to \mathbb {R} ^{2}} . This is because the complex-differentiability implies that

- lim h → 0 h ∈ C | f ( a + h ) − f ( a ) − f ′ ( a ) h | | h | = 0. {\displaystyle \lim _{\underset {h\in \mathbb {C} }{h\to 0}}{\frac {|f(a+h)-f(a)-f'(a)h|}{|h|}}=0.}

However, a function f : C → C {\textstyle f:\mathbb {C} \to \mathbb {C} } can be differentiable as a multi-variable function, while not being complex-differentiable. For example, f ( z ) = z + z ¯ 2 {\displaystyle f(z)={\frac {z+{\overline {z}}}{2}}} is differentiable at every point, viewed as the 2-variable [real function](/source/Real-valued_function) f ( x , y ) = x {\displaystyle f(x,y)=x} , but it is not complex-differentiable at any point because the limit lim h → 0 h + h ¯ 2 h {\textstyle \lim _{h\to 0}{\frac {h+{\bar {h}}}{2h}}} gives different values for different approaches to 0.

Any function that is complex-differentiable in a neighborhood of a point is called [holomorphic](/source/Holomorphic_function) at that point. Such a function is necessarily infinitely differentiable, and in fact [analytic](/source/Analytic_function).

## Differentiable functions on manifolds

See also: [Differentiable manifold § Differentiable functions](/source/Differentiable_manifold#Differentiable_functions)

If *M* is a [differentiable manifold](/source/Differentiable_manifold), a real or complex-valued function *f* on *M* is said to be differentiable at a point *p* if it is differentiable with respect to some (or any) coordinate chart defined around *p*. If *M* and *N* are differentiable manifolds, a function *f*: *M* → *N* is said to be differentiable at a point *p* if it is differentiable with respect to some (or any) coordinate charts defined around *p* and *f*(*p*).

## See also

- [Generalizations of the derivative](/source/Generalizations_of_the_derivative)

- [Semi-differentiability](/source/Semi-differentiability)

- [Differentiable programming](/source/Differentiable_programming)

## References

1. **[^](#cite_ref-1)** Banach, S. (1931). ["Über die Baire'sche Kategorie gewisser Funktionenmengen"](https://doi.org/10.4064%2Fsm-3-1-174-179). *[Studia Math.](/source/Studia_Mathematica)* **3** (1): 174–179. [doi](/source/Doi_(identifier)):[10.4064/sm-3-1-174-179](https://doi.org/10.4064%2Fsm-3-1-174-179).. Cited by Hewitt, E; Stromberg, K (1963). *Real and abstract analysis*. Springer-Verlag. Theorem 17.8.

v t e Differentiable computing General Differentiable programming Information geometry Statistical manifold Automatic differentiation Neuromorphic computing Pattern recognition Ricci calculus Computational learning theory Inductive bias Hardware IPU TPU VPU Memristor SpiNNaker Software libraries TensorFlow PyTorch Keras scikit-learn Theano JAX Flux.jl MindSpore Portals Computer programming Technology

---
Adapted from the Wikipedia article [Differentiable function](https://en.wikipedia.org/wiki/Differentiable_function) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Differentiable_function?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
