Let X⊆R be a subset of real numbers, x0∈X be a limit point of X and f:X→R be a function that maps elements of X to real numbers. The function f is differentiable at x0 if the limit of x−x0f(x)−f(x0) as x→x0 converges to a real number dxdf(x0) which is the derivative at x0.
dxdf(x0):=x→x0limx−x0f(x)−f(x0)
If f is differentiable ∀x0∈X then f is differentiable on X. If the limit does not exist then dxdf(x0) is undefined and f is not differentiable at x0.
Let X⊆R be a subset of real numbers and f:X→R be differentiable on X. The derivative of the function f is the function that maps each x∈X to the derivative of f at x. Renaming the point x0 to x and writing the nearby point as x+h, where the step size h→0, gives the equivalent form
dxdf(x):=h→0limhf(x+h)−f(x).
The derivative is also written f′(x) or dxdf(x).
If f is differentiable at x0 then f is continuous at x0, so a function that is differentiable on X is continuous on X. The converse is false: f(x)=∣x∣ is continuous at 0 but not differentiable there, since x∣x∣ is 1 for x>0 and −1 for x<0 and so has no limit as x→0.
If the derivative f′ is itself differentiable at x then its derivative is the second derivativef′′(x)=dx2d2f(x). Recursively, the k-th derivativef(k)(x)=dxkdkf(x) is the derivative of f(k−1) with f(0)=f. The function f is k times continuously differentiable on X, written f∈Ck(X), if f(k) exists and is continuous on X.C0(X) is the set of continuous functions on X and f is smooth, written f∈C∞(X), if f(k) exists for every k∈N.
Let f,g:X→R be differentiable at x∈X and c∈R. Derivatives of constants, sums and scalar multiples satisfy
and the same formula holds for any real exponent n when x>0. Together with the rules for sums and scalar multiples, every polynomial is differentiable on R.
The product rule states that fg is differentiable at x with
dxd(f(x)g(x))=f′(x)g(x)+f(x)g′(x).
The quotient rule states that if g(x)=0 then gf is differentiable at x with
dxd(g(x)f(x))=g(x)2f′(x)g(x)−f(x)g′(x).
Let Y⊆R,f:X→Y be differentiable at x and g:Y→R be differentiable at f(x). The chain rule states that the composition g∘f is differentiable at x with
dxdg(f(x))=g′(f(x))f′(x).
Let X be an interval and f:X→R be continuous and strictly monotonic. If f is differentiable at x with f′(x)=0 then the inverse function f−1 is differentiable at y=f(x) with
dydf−1(y)=f′(f−1(y))1.
Let f:X→R be a function and x0∈X.x0 is a local maximum of f if and only if there exists δ>0 such that f(x)≤f(x0) for all x∈X with ∣x−x0∣<δ, and a local minimum if and only if f(x)≥f(x0) for all such x.x0 is a global maximum if and only if f(x)≤f(x0)∀x∈X and a global minimum if and only if f(x)≥f(x0)∀x∈X. A local or global maximum or minimum is an extremum.
A point x0∈X is an interior point of X if some open interval (x0−δ,x0+δ) with δ>0 is contained in X.Fermat’s theorem states that if x0 is an interior point of X, a local extremum of f and f is differentiable at x0 then
f′(x0)=0.
A point at which f′(x0)=0 is a stationary point of f. A stationary point need not be an extremum: f(x)=x3 has f′(0)=0 but 0 is neither a local maximum nor a local minimum. An extremum that is not an interior point, or at which f is not differentiable, need not be a stationary point either, so extrema of f on [a,b] are found among the stationary points, the endpoints and the points of non-differentiability.
Rolle’s theorem states that if f:[a,b]→R is continuous on [a,b], differentiable on (a,b) and f(a)=f(b) then there exists c∈(a,b) with f′(c)=0.
The mean value theorem states that if f:[a,b]→R is continuous on [a,b] and differentiable on (a,b) then there exists c∈(a,b) at which the derivative equals the average rate of change of f over [a,b].
f′(c)=b−af(b)−f(a)
Let X be an interval and f:X→R be differentiable. The mean value theorem gives the following consequences:
if f′(x)=0∀x∈X then f is constant on X;
if f′(x)≥0∀x∈X then f is monotonically increasing, and if f′(x)>0∀x∈X then f is strictly increasing;
if ∣f′(x)∣≤L∀x∈X then f is Lipschitz continuous on X with Lipschitz constant L.
The second derivative test states that if x0 is an interior stationary point of f and f′′(x0) exists then x0 is a local minimum if f′′(x0)>0 and a local maximum if f′′(x0)<0. If f′′(x0)=0 the test is inconclusive.
Let f,g be differentiable on an open interval containing x0, except possibly at x0 itself, with g′(x)=0 on that interval away from x0.L’Hôpital’s rule states that if either limx→x0f(x)=limx→x0g(x)=0, or ∣g(x)∣ grows without bound as x→x0 (for every M>0 there exists δ>0 with ∣g(x)∣>M whenever 0<∣x−x0∣<δ), and the limit of the ratio of derivatives exists, then
x→x0limg(x)f(x)=x→x0limg′(x)f′(x).
Let X be an interval, x0∈X and f:X→R be k times differentiable at x0. The Taylor polynomial of degree k of f at x0 is
Tk(x):=i=0∑ki!f(i)(x0)(x−x0)i
and the remainder is Rk(x):=f(x)−Tk(x).Taylor’s theorem states that the remainder vanishes faster than (x−x0)k as x→x0,
x→x0lim(x−x0)kRk(x)=0,
and that if f is k+1 times differentiable on the open interval between x0 and x then there exists c strictly between x0 and x with
Rk(x)=(k+1)!f(k+1)(c)(x−x0)k+1.
The case k=0 is the mean value theorem. If f is smooth at x0 then its Taylor series at x0 is the power series
i=0∑∞i!f(i)(x0)(x−x0)i
and f is analytic at x0 if the Taylor series converges to f(x) for all x in some open interval containing x0. A smooth function need not be analytic, since its Taylor series may converge to a different function.
A power series ∑n=0∞an(x−c)n with radius of convergence R>0 is differentiable on (c−R,c+R) and its derivative is the term-by-term derivative, a power series with the same radius of convergence.
dxdn=0∑∞an(x−c)n=n=1∑∞nan(x−c)n−1
Repeating this, a power series is smooth on its open interval of convergence, ak=k!f(k)(c) and so the series is its own Taylor series at c and is analytic there. Differentiating the exponential, cosine and sine series term by term gives
exp′=exp,cos′=−sin,sin′=cos,
and the derivative of the natural logarithm, the inverse function of exp on R, is dxdlogex=x1 for x>0. Since exp′=exp>0 on R, the exponential function is strictly increasing and the real power ax=exp(xlogea) has derivative axlogea for a>0.
Let x=(x1,…,xn)∈Rn and y∈Rn. The Euclidean distance between x and y is
∥x−y∥:=i=1∑n(xi−yi)2
and ∥x∥ is the Euclidean distance from x to 0. A set X⊆Rn is open if every point x∈X has a δ>0 such that every y with ∥y−x∥<δ lies in X. Let X⊆Rn be open, f:X→R be a function and ei∈Rn be the standard basis vector with 1 in position i and 0 elsewhere. The partial derivative of f with respect to xi at x is the derivative of f along the i-th coordinate with the other coordinates held fixed.
∂xi∂f(x):=h→0limhf(x+hei)−f(x)
The gradient of f at x is the vector of partial derivatives.
∇f(x):=(∂x1∂f(x),…,∂xn∂f(x))
Let v∈Rn. The directional derivative of f at x in the direction v is
Dvf(x):=h→0limhf(x+hv)−f(x)
so that the partial derivatives are the directional derivatives along the standard basis vectors.
The function f is differentiable at x if and only if there exists g∈Rn such that the error of the linear approximation f(x)+∑i=1ngihi vanishes faster than ∥h∥.
h→0lim∥h∥∣f(x+h)−f(x)−∑i=1ngihi∣=0
If f is differentiable at x then g=∇f(x),f is continuous at x and every directional derivative exists with
Dvf(x)=i=1∑n∂xi∂f(x)vi.
The existence of all partial derivatives at x does not imply differentiability or even continuity at x. However, if all partial derivatives exist and are continuous on X, in which case f is continuously differentiable and written f∈C1(X), then f is differentiable on X.
Let f=(f1,…,fm):X→Rm be a function whose components fj:X→R are differentiable at x. The Jacobian matrix of f at x is the m×n matrix Jf(x) whose entry in row j and column i is the partial derivative of the j-th component with respect to the i-th coordinate, so that its rows are the gradients of the components.
[Jf(x)]ji:=∂xi∂fj(x)
Let Y⊆Rm be open, f:X→Y be differentiable at x and g=(g1,…,gp):Y→Rp be differentiable at f(x). The multivariate chain rule states that g∘f is differentiable at x with
Entry by entry this is the product of the Jacobian matrices, Jg∘f(x)=Jg(f(x))Jf(x). In particular, if x(t)=(x1(t),…,xn(t)) is differentiable at t and f is differentiable at x(t) then
dtdf(x(t))=i=1∑n∂xi∂f(x(t))dtdxi(t).
The second-order partial derivative of f with respect to xi and then xj is the partial derivative of ∂xi∂f with respect to xj.
∂xj∂xi∂2f(x):=∂xj∂(∂xi∂f(x))
The Hessian matrix of f at x is the n×n matrix Hf(x) of second-order partial derivatives.
[Hf(x)]ij:=∂xi∂xj∂2f(x)
f is twice continuously differentiable, written f∈C2(X), if all second-order partial derivatives exist and are continuous on X.Schwarz’s theorem states that if f∈C2(X) then the order of differentiation does not matter, so the Hessian matrix is symmetric.
∂xi∂xj∂2f(x)=∂xj∂xi∂2f(x)∀i,j
The second-order Taylor expansion of f∈C2(X) at x states that for h∈Rn with x+h∈X
where the remainder satisfies limh→0∥h∥2R2(h)=0. The first-order terms are the directional derivative Dhf(x) and the second-order terms weight the entries of the Hessian matrix by products of the components of h.