Undergraduate Mathematics ← Intermediate value theorem Differentiable function Mean value theorem →
A differentiable function
The absolute value function is not differentiable at ${\displaystyle x=0}$ .
Differentiable functions can be locally approximated by linear functions.

In calculus (a branch of mathematics), a differentiable function of one real variable is a function whose derivative exists at each point in its domain. As a result, the graph of a differentiable function must have a non-vertical tangent line at each point in its domain, be relatively smooth, and cannot contain any breaks, bends, or cusps.

More generally, if ${\displaystyle x_{0}}$ is a point in the domain of a function ${\displaystyle f}$ , then ${\displaystyle f}$ is said to be differentiable at ${\displaystyle x_{0}}$ if the derivative ${\displaystyle f'(x_{0})}$ exists. This means that the graph of ${\displaystyle f}$ has a non-vertical tangent line at the point ${\displaystyle (x_{0},f(x_{0}))}$ . The function ${\displaystyle f}$ may also be called locally linear at ${\displaystyle x_{0}}$ , as it can be well approximated by a linear function near this point.

## Differentiability and continuity

The Weierstrass function is continuous, but is not differentiable at any point.

If ${\displaystyle f}$ is differentiable at a point ${\displaystyle x_{0}}$ , then ${\displaystyle f}$ must also be continuous at ${\displaystyle 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, or 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 point. However, a result of Stefan Banach states that the set of functions that have a derivative at some point is a meager 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.

## Differentiability classes

A function ${\displaystyle f}$ is said to be continuously differentiable if the derivative ${\displaystyle f'(x)}$ exists and is itself a continuous function. Though the derivative of a differentiable function never has a jump discontinuity, it is possible for the derivative to have an essential discontinuity. For example, the function

${\displaystyle f(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 at 0, since

${\displaystyle f'(0)=\lim _{\epsilon \to 0}\left[{\frac {\epsilon ^{2}\sin \left({\tfrac {1}{\epsilon }}\right)-0}{\epsilon }}\right]=0}$

exists. However, for ${\displaystyle x\neq 0}$ ,

${\displaystyle f'(x)=2x\sin \left({\tfrac {1}{x}}\right)-\cos \left({\tfrac {1}{x}}\right)}$

which has no limit as ${\displaystyle x\to 0}$ . Nevertheless, Darboux's theorem implies that the derivative of any function satisfies the conclusion of the intermediate value theorem.

Sometimes continuously differentiable functions are said to be of class ${\displaystyle C^{1}}$. A function is of class ${\displaystyle C^{2}}$ if the first and second derivative of the function both exist and are continuous. More generally, a function is said to be of class ${\displaystyle C^{k}}$ if the first ${\displaystyle k}$ derivatives ${\displaystyle f'(x),f''(x),\dots ,f^{(k)}(x)}$ all exist and are continuous. If derivatives ${\displaystyle f^{(n)}}$ exist for all positive integers ${\displaystyle n}$ , the function is smooth or equivalently, of class ${\displaystyle C^{\infty }}$.

## Differentiability in higher dimensions

A function of several real variables ${\displaystyle f:\mathbb {R} ^{m}\to \mathbb {R} ^{n}}$ is said to be differentiable at a point ${\displaystyle x_{0}}$ if there exists a linear map ${\displaystyle J:\mathbb {R} ^{m}\to \mathbb {R} ^{n}}$ such that

${\displaystyle \lim _{h\to 0}{\frac {f(x_{0}+h)-f(x_{0})-J(h)}{\|h\|}}=0}$

If a function is differentiable at ${\displaystyle x_{0}}$ , then all of the partial derivatives must exist at ${\displaystyle x_{0}}$ , in which case the linear map ${\displaystyle J}$ is given by the Jacobian matrix. A similar formulation of the higher-dimensional derivative is provided by the fundamental increment lemma found in single-variable calculus.

Note that existence of the partial derivatives (or even all of the directional derivatives) does not guarantee that a function is differentiable at a point. For example, the function ${\displaystyle f:\mathbb {R} ^{2}\to \mathbb {R} }$ defined by

${\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 ${\displaystyle (0,0)}$ , but all of the partial derivatives and directional derivatives exist at this point. For a continuous example, the function

${\displaystyle f(x,y)={\begin{cases}{\dfrac {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 ${\displaystyle (0,0)}$ , but again all of the partial derivatives and directional derivatives exist.

It is known that if the partial derivatives of a function all exist and are continuous in a neighborhood of a point, then the function must be differentiable at that point, and it is in fact of class ${\displaystyle C^{1}}$ .

## Differentiability in complex analysis

In complex analysis, any function that is complex-differentiable in a neighborhood of a point is called holomorphic. Such a function is necessarily infinitely differentiable, and in fact analytic.

## Differentiable functions on manifolds

If ${\displaystyle M}$ is a differentiable manifold, a real or complex-valued function ${\displaystyle f}$ on ${\displaystyle M}$ is said to be differentiable at a point ${\displaystyle p}$ if it is differentiable with respect to some (or any) coordinate chart defined around ${\displaystyle p}$ . More generally, if ${\displaystyle M}$ and ${\displaystyle N}$ are differentiable manifolds, a function ${\displaystyle f:M\to N}$ is said to be differentiable at a point ${\displaystyle p}$ if it is differentiable with respect to some (or any) coordinate charts defined around ${\displaystyle p}$ and ${\displaystyle f(p)}$ .