Several rules exist for finding the derivatives of functions with several components such as $x \space sin \space x$. With these rules and the chain rule, which will be explored later, any derivative of a function can be found (assuming they exist). There are five rules that help simplify the computation of derivatives, of which each will be explored in turn.

## Sum Rule¶

The most straightforward of the derivation rules is the sum rule, which is stated as:

## Rule of Linearity¶

The sum rule can be considered a case of a larger concept called linearity. For example, linearity can be seen in the derivative of the function: $\frac{d}{dx}5x - cos x = 5 + sin \space x$ and all other similar functions. This rule is known as the Rule of Linearity and follows from linear combinations. Where $a$ and $b$ are real numbers, the rule is stated as the following:

## Product Rule¶

The product rule helps deal with the frequently occurring situation of the product of two functions, such as $sin \space x + cos \space x$ and is stated as:

.

The product rule can be extended to more than the product of two functions. For example, the derivative of the product of three functions would be:

## Reciprocal Rule¶

The reciprocal rule is more or less a case of the powerful quotient rule. The case of the reciprocal rule helps us find the derivative of $\frac{1}{v(x)}$ much easier. We can state the rule as the following:

## Quotient Rule¶

The quotient rule is an important derivation technique that allows us to more efficiently find the deriative of $\frac{u(x)}{v(x)}$. We can state the quotient rule as follows:

Last but certainly not least is the power rule.

## Power Rule¶

The power rule gives us the ability to find the deriative of a function of the form $(u(x))^n$ and can be stated as:

Okay! With those rules stated and out of the way, we are now able to solve the vast majority of derivatives we will ever encounter! We test our hand at using the rules to calculate the derivative of several functions with the following examples.

## Examples¶

We import the functions from the SymPy library that we will require.

```
from sympy import symbols, diff, sin, cos, simplify, init_printing
```

The `init_printing()`

function is used to output the results of SymPy in LaTeX.

```
init_printing()
```

First, initialize a symbol variable for $x$ to be used with SymPy's computation engine.

```
x = symbols('x')
```

Example 1: Find the derivative of $(x + 1)(x - 1)$

We could factor and take the derivative of the resulting polynomial without having to use the product rule:

We can also find the deriative of the function with the product rule:

Example 2: Find the derivative of $\frac{1}{1 + x} + \frac{1}{1 + sin \space x}$

Here we take advantage of the reciprocal rule, $\frac{d}{dx} \space \frac{1}{v(x)} = \frac{\frac{-dv}{dx}}{v^2}$. Starting with $\frac{1}{1 + x}$:

Then the second piece of the function, $\frac{1}{1 + sin \space x}$

Then putting the two pieces together gives us the derivative of the function:

We can verify this result using SymPy:

```
diff(1 / (1 + x) + 1 / (1 + sin(x)))
```

Example 3: Find the derivative of $(x - 1)(x - 2)(x - 3)$

We can find the derivative using the product rule, $\frac{d}{dx} \space (uvw) = uv \frac{dw}{dx} + uw \frac{dv}{dx} + vw \frac{du}{dx}$

Though not necessary, finish by factoring and simplifying the derivative.

Verifying with SymPy:

```
diff((x - 1) * (x - 2) * (x - 3))
```

We can also check to see if our simplifying of the function was accurate using SymPy's `simplify`

function.

```
simplify(diff((x - 1) * (x - 2) * (x - 3)))
```

Example 4: Find the derivative of $\frac{x^3 + 1}{x + 1} + \frac{cos \space x}{sin \space x}$

Using the sum rule, we can find the derivatives of each piece and then add the derivatives together. Starting with $\frac{x^3 + 1}{x + 1}$, we apply the quotient rule:

We'll take the easy way out on factoring the above derivative and use SymPy:

```
simplify(((x + 1) * (3 * x ** 2) - (x ** 3 + 1)) / (x + 1) ** 2)
```

Then we find the derivative of the second piece of the equation, $\frac{\cos{x}}{\sin{x}}$. Again, we take advantage of the quotient rule:

With the Pythagorean identity, $\sin^2{x} + \cos^2{x} = 1$, we can simplify the derivative to:

Adding the two pieces of the equation together using the sum rule gives us the deriative:

## References¶

Strang, G. (2010). Calculus. Wellesley, MA: Wellesley-Cambridge.

Pythagorean trigonometric identity. (2017, October 4). In Wikipedia, The Free Encyclopedia. From https://en.wikipedia.org/w/index.php?title=Pythagorean_trigonometric_identity&oldid=803778637