Differential calculus

Differential calculus is the study of rates-of-change, with the objects of study being the derivatives of functions. The derivative of a function (older names include gradient function and differential coefficient) is a function that yields the instantaneous rate-of-change (the ‘gradient’) of the original function at each input value.

The Leibniz notation for derivatives gives us the derivative operator \frac{d}{dx}, where x is the input value. This is used as in \frac{dy}{dx}, which represents the derivative of the function y with respect to x. The n-th derivative is notated as \frac{d^n}{dx^n}, such as with the notation \frac{d^2y}{dx^2} for the second derivative of the function y.

The Lagrange notation for derivatives is useful for concisely notating functions in abstract, where for the function f(x), the first derivative is notated f’(x), the second derivative is notated f’’(x), etc. For higher derivatives where this notation could become cumbersome, the notation f^{(n)}(x) can be used, such as with the notation f^{(4)}(x) for the fourth derivative of f.

Derivative of an affine function

An affine function is a function which describes a straight line (a line of constant gradient). The derivative of an affine function is a constant function (a function with output the same for every input value) which gives the gradient of the entire line.

The gradient m of a straight line is given by the ratio of the vertical and horizontal delta between any two distinct points on the line:

m = \frac{\Delta y}{\Delta x} = \frac{y_1 - y_0}{x_1 - x_0}

This can be stated with respect to the function y = f(x) that specifies the line and the two distinct input values x_0 and x_1:

m = \frac{f(x_1)-f(x_0)}{x_1-x_0}

It can also be stated in terms of a single input value x and a non-zero horizontal delta \Delta x:

m = \frac{f(x + \Delta x) - f(x)}{\Delta x}

As an example, we can find the gradient m of the line y = 2x + 3, using an input value 0 and a horizontal delta of 1:

m = \frac{(2 \cdot 1 + 3) - (2 \cdot 0 + 3)}{1} = 2

Derivative of a continuous function

A continuous function is a function which describes a single unbroken curve (every point on the curve has a non-vertical tangent). The derivative of a continuous function is a function which gives the gradient of the original function for any input value. More specifically, the gradient at a particular input value is the gradient of the tangent to the graph of the function for that input value.

The gradient at a point of a continuous function can be approximated by the equation for the gradient of a straight line, where the error is proportional to the value of \Delta x:

\frac{df}{dx} \approx \frac{f(x + \Delta x) - f(x)}{\Delta x}

From this, the derivative of a function can be seen to be the limit of the prior equation as \Delta x approaches 0 (we can’t directly substitute \Delta x for 0 here, as this would result in a division by 0, which is undefined):

\frac{df}{dx} = \lim_{\Delta x \to 0} \frac{f(x + \Delta x) - f(x)}{\Delta x}

As an example, we can find the derivative \frac{dy}{dx} of the function y = x^2:

\frac{dy}{dx} = \lim_{\Delta x \to 0} \frac{(x + \Delta x)^2 - x^2}{\Delta x} = \lim_{\Delta x \to 0} \frac{x^2 + 2x \cdot \Delta x + \Delta x^2 - x^2}{\Delta x} = \lim_{\Delta x \to 0} 2x + \Delta x = 2x

The sum rule

To differentiate the sum of two functions, such as with the equation y=(x^2+c)+(ax^4+b) which is the sum of the functions u=x^2+c and v=ax^4+b, the two functions can be differentiated independently and the derivatives summed. For this example, the independent derivatives are \frac{du}{dx} = 2x and \frac{dv}{dx} = 4ax, with the derivative of the whole equation being \frac{dy}{dx} = 2x + 4ax.

This can be proven by seeing that:

\frac{dy}{dx} = \frac{du}{dx} + \frac{dv}{dx} = \frac{du + dv}{dx}

The chain rule

To differentiate an equation that can be represented as a nesting of functions, such as with the equation y=(x^2+a^2)^\frac{3}{2} which is the nesting of the functions u=x^2+a^2 and y=u^\frac{3}{2}, each function can be differentiated independently and the derivatives multiplied together. For this example, the independent derivatives are \frac{du}{dx} = 2x and \frac{dy}{du} = \frac{3}{2}u^\frac{1}{2}, which are then multiplied together:

\frac{dy}{dx} = \frac{3}{2}u^\frac{1}{2} \cdot 2x = \frac{3}{2}(x^2+a^2)^\frac{1}{2} \cdot 2x = 3x\sqrt{x^2+a^2}

This can be proven by seeing that:

\frac{dy}{dx} = \frac{dy}{du} \times \frac{du}{dx}