This post is a quick recap on some fundamentals of calculating derivatives, useful for image processing and deep learning.

## Derivatives

### Calculating the derivative

Given x to the power of n, where n ≠ 0.

$$
f(x) = x^n
$$
$$
f'(x) = nx^{n-1}
$$

This is known as the power rule. For example:

$$
\frac{d}{dx}(3x^7+4x^2-x+100) = 21x^6+8x-1
$$

### Derivative of a sum of functions

The derivative of a sum of functions is the sum of the derivatives:

$$
f(x) = u(x) + v(x)
$$
$$
f'(x) = u'(x) + v'(x)
$$

So simply compute the derivatives one at a time then sum them individually.

### Derivative of a product of functions

The derivative of a product of functions is defined:

$$
f(x) = u(x) \cdot v(x)
$$
$$
f'(x)=u'(x)\cdot v(x)+u(x)\cdot v'(x)
$$

This is known as the product rule.

### Derivative of composed functions

For function composition the derivative is:

$$
f(x) = u(v(x))
$$
$$
f'(x) = u'(v(x)) \cdot v'(x).
$$

This is known as the chain rule.

If stuck, play with this calculator.