Artificial Intelligence 🤖
Differentiation
Definition of the derivative

Definition of the derivative

For our purposes, we use the definition of the derivative as a slope of a curve at a point or, simply, the slope of the tangent line.

graph of a function y=f(x)

This figure is of the graph of a function y=f(x)y=f(x) showing two points P=(x,f(x))\mathrm{P}=(x, f(x)) and Q=(x+Δx,f(x+Δx))\mathrm{Q}=(x+\Delta x, f(x+\Delta x)). The line in green is the tangent line at point P\mathrm{P}. The line in blue is a secant line between the points P\mathrm{P} and Q. As Δx\Delta x tends to 0 , the following equation represents the slope of the tangent line at P\mathrm{P}.

limΔx0f(x+Δx)f(x)Δx\lim _{\Delta x \rightarrow 0} \frac{f(x+\Delta x)-f(x)}{\Delta x}

where, if this limit exists then we say that ff is differentiable at xx (note that xx is treated as a constant when taking the limit). We call the above limit a derivative and is defined formally as:

f(x)=limΔx0f(x+Δx)f(x)Δx.f^{\prime}(x)=\lim _{\Delta x \rightarrow 0} \frac{f(x+\Delta x)-f(x)}{\Delta x} .
💡

In terms of differentiability, A function f(x)f(x) is differentiable at x=ax=a if f(a)f^{\prime}(a) exists and f(x)f(x) is differentiable on an interval if the derivative exists for each point in that interval.

We have the following theorem stating the relationship between continuous and differentiable functions: if f(x)f(x) is differentiable at a point x=ax=a, then it is continuous at x=ax=a. As an example, consider the Heaviside function given by:

H(x)={0 if x<01 if x0H(x)= \begin{cases}0 & \text { if } x<0 \\ 1 & \text { if } x \geq 0\end{cases}

With its graph shown for x[4,4]x \in[-4,4] (A solid marker indicates that the endpoint x=0x=0 is included while a hollow marker indicates that it is not included):

Heaviside Graph

This function is a piecewise-defined function called the Heaviside function or step function often denoted by H0(x)H_{0}(x). The function has a jump at x=0x=0 and is said to be discontinuous at x=0x=0. We conclude that the function is discontinuous at x=0x=0; it follows that H(0)H^{\prime}(0) does not exist and H(x)H(x) is not differentiable at x=0x=0. We say that the function is singular at x=0x=0.

💡

While the Heaviside function does not have a derivative in the classical sense, it does have a distributional derivative given by the Dirac Delta distribution (opens in a new tab).

Further, any differentiable function f(x)f(x) must be continuous for all xx in its domain. Note that the converse is not true: continuity does not ensure differentiability. For instance, the function y=xy=|x| is continuous at x=0x=0 (we can easily show that the two, one-sided limits as x0+x \rightarrow 0^{+}and x0x \rightarrow 0^{-}are both 0 ). However, the function is not differentiable at x=0x=0 (it is differentiable everywhere else in its domain). To see this, we examine the two, one-sided limits of the difference quotient

f(x+Δx)f(x)Δx=x+ΔxxΔx\frac{f(x+\Delta x)-f(x)}{\Delta x}=\frac{|x+\Delta x|-|x|}{\Delta x}

recall that in the limit Δx0\Delta x \rightarrow 0, the above quotient represents the derivative of the function ff. Now if the one-sided limits disagree (i.e. as Δx0+\Delta x \rightarrow 0^{+}and Δx0)\left.\Delta x \rightarrow 0^{-}\right)then we conclude that the two-sided limit of the difference quotient does not exist. Indeed, if Δx>0,Δx/Δx=1\Delta x>0,|\Delta x| / \Delta x=1 hence at x=0x=0,

limΔx0+0+Δx0Δx=1\lim _{\Delta x \rightarrow 0^{+}} \frac{|0+\Delta x|-|0|}{\Delta x}=1

while if Δx<0,Δx/Δx=1\Delta x<0,|\Delta x| / \Delta x=-1,

limΔx00+Δx0Δx=1.\lim _{\Delta x \rightarrow 0^{-}} \frac{|0+\Delta x|-|0|}{\Delta x}=-1 .

Since the two limits disagree, the two-sided limit does not exist and thus we find that the absolute function is not differentiable at x=0x=0.

The existence of breaks (like the jump in the Heaviside function) or cusps (like in y=xy=|x| at x=0x=0 ) are examples of non-differentiable behaviour. Another common form of nondifferentiability is the case where the limit of the difference quotient as Δx0\Delta x \rightarrow 0 is infinite (i.e. it does not exist); an example is y=x1/3y=x^{1 / 3} at x=0x=0. Finally we consider the oscillatory function:

f(x)={xsin(1x),x00,x=0f(x)=\left\{\begin{array}{c} x \sin \left(\frac{1}{x}\right), \quad x \neq 0 \\ 0, \quad x=0 \end{array}\right.

This function is continuous for all real xx. However, the function is not differentiable at x=0x=0; again, by looking at the difference quotient

limΔx0f(0+Δx)f(0)Δx=limΔx0sin(1Δx)\lim _{\Delta x \rightarrow 0} \frac{f(0+\Delta x)-f(0)}{\Delta x}=\lim _{\Delta x \rightarrow 0} \sin \left(\frac{1}{\Delta x}\right)

we conclude that the limit does not exist since it oscillates between -1 and 1 (i.e. it does not settle to a single, finite value).

Alternate notation

The derivative, f(x)f^{\prime}(x) can also be denoted by df/dxd f / d x or, since y=f(x)y=f(x), it is often denoted by

dydx or y(x)\frac{d y}{d x} \text { or } y^{\prime}(x)

Derivatives of ff are also expressed with the superscript notation

f(1),f(2),f(3), etc.; f^{(1)}, f^{(2)}, f^{(3)}, \text { etc.; }

note that f(1)f^{(1)} is f(x)f^{\prime}(x) and the zeroth derivative, f(0)f^{(0)} is simply the function ff. The following notation

f(a)=dfdxx=af^{\prime}(a)=\left.\frac{d f}{d x}\right|_{x=a}

is used to show that the derivative is evaluated at the point x=ax=a.

Differentiating from first principles

Before showing formulae and properties of derivatives that allow us to obtain derivatives easily, we first show a few examples of computing derivatives from first principles

The derivative of the following function using the definition of the derivative:

f(x)=x3f(x)=x^{3} f(x)=limΔx0(x+Δx)3x3Δx=limΔx0[x3+3x2Δx+3x(Δx)2+(Δx)3]x3Δx=limΔx03x2+3xΔx+(Δx)2=3x2.\begin{aligned} f^{\prime}(x)=\lim _{\Delta x \rightarrow 0} \frac{(x+\Delta x)^{3}-x^{3}}{\Delta x} & =\lim _{\Delta x \rightarrow 0} \frac{\left[x^{3}+3 x^{2} \Delta x+3 x(\Delta x)^{2}+(\Delta x)^{3}\right]-x^{3}}{\Delta x} \\ & =\lim _{\Delta x \rightarrow 0} 3 x^{2}+3 x \Delta x+(\Delta x)^{2} \\ & =3 x^{2} . \end{aligned}

Consider

f(x)=cosx,f(x)=\cos x,

Again, starting from first principles

limΔx0cos(x+Δx)cosxΔx=limΔx02sin(x+Δx2)sin(Δx2)Δx;\lim _{\Delta x \rightarrow 0} \frac{\cos (x+\Delta x)-\cos x}{\Delta x}=\lim _{\Delta x \rightarrow 0} \frac{-2 \sin \left(x+\frac{\Delta x}{2}\right) \sin \left(\frac{\Delta x}{2}\right)}{\Delta x} ;

here we have used the identity

cosαcosβ=2sin(α+β2)sin(αβ2).\cos \alpha-\cos \beta=-2 \sin \left(\frac{\alpha+\beta}{2}\right) \sin \left(\frac{\alpha-\beta}{2}\right) .

Then:

limΔx02sin(x+Δx2)sin(Δx2)Δx=limΔx0sin(x+Δx2)sin(Δx2)Δx2=sinx1\begin{aligned} \lim _{\Delta x \rightarrow 0} \frac{-2 \sin \left(x+\frac{\Delta x}{2}\right) \sin \left(\frac{\Delta x}{2}\right)}{\Delta x} & =\lim _{\Delta x \rightarrow 0}-\sin \left(x+\frac{\Delta x}{2}\right) \frac{\sin \left(\frac{\Delta x}{2}\right)}{\frac{\Delta x}{2}} \\ & =-\sin x \cdot 1 \end{aligned}

where we have used limθ0(sinθ/θ)=1\lim _{\theta \rightarrow 0}(\sin \theta / \theta)=1. Hence, f(x)=sinxf^{\prime}(x)=-\sin x. Similarly, we can show that the derivative of f(x)=sinxf(x)=\sin x is f(x)=cosxf^{\prime}(x)=\cos x

Differential operator

The differential operator used for taking the derivative is d/dxd / d x, sometimes also denoted as DD. Applied to a function, it gives

ddx[f(x)]=dfdx=D[x]=f(x).\frac{d}{d x}[f(x)]=\frac{d f}{d x}=D[x]=f^{\prime}(x) .

Anything to the right of the operator is differentiated. The operator for higher, nth n^{\text {th }} order derivatives is dn/dxnd^{n} / d x^{n} or DnD^{n}. We can also use these definitions to define other operators like, for example, a linear second order differential operator, LL may be given as

L=a2(x)d2dx2+a1(x)ddx+a0L=a_{2}(x) \frac{d^{2}}{d x^{2}}+a_{1}(x) \frac{d}{d x}+a_{0}

with ai(x)(i=0,1,2)a_{i}(x)(i=0,1,2) denoting coefficients which are continuous functions of the independent variable, xx. Applying the operator to a function y(x)y(x), it gives

L[y]=a2(x)d2ydx2+a1(x)dydx+a0L[y]=a_{2}(x) \frac{d^{2} y}{d x^{2}}+a_{1}(x) \frac{d y}{d x}+a_{0}