## Sum Rule
For $f(x)=g(x)+h(x)$, the derivative is:
$ f^\prime(x)=g'(x)+h^\prime(x)$
**Example:** We have a function $f(x)=3x+2$ and want to find its derivative. Since $f(x)$ consists of two parts, where $g(x)=3x$ and $h(x)= 2$, we are summing the derivative of each part to get $f'(x)$.
$ f^\prime(x)=3+0 $
Verification using the [[Rise Over Run Method]]:
$ f'(x) =\lim_{\delta x \to 0}\left(\frac{3(x+\delta x)+2 - 3x+2}{\delta x} \right) = \frac{3\delta x}{\delta x}=3$
## Power Rule
For $f(x)=ax^b$, the derivative is:
$f^\prime(x)=a bx^{b-1} $
**Example:** We have a function $f(x)=x^{-1}$ and want to find its derivative. We move the copy the exponent term into its base, and also deduct the exponent itself by $1$.
$ f^\prime(x)=-x^{-2}$
Verification using the rise-over-run method:
$
\begin{align}
f'(x)&=\lim_{\delta x \to 0}\Big(\frac{\frac{1}{x+\delta x}-\frac{1}{x}}{\delta x}\Big) \\[4pt]
&=\lim_{\delta x \to 0}\Big(\frac{\frac{x}{x(x+\delta x)}-\frac{x+\delta x}{x(x+\delta x)}}{\delta x}\Big) \\[4pt]
&=\lim_{\delta x \to 0}\Big(\frac{\frac{-\delta x}{x(x+\delta x)}}{\delta x}\Big) \\[4pt]
&=\lim_{\delta x \to 0}\Big(\frac{-\delta x}{x(x+\delta x)*\delta x}\Big) \\[4pt]
&=\lim_{\delta x \to 0}\Big(\frac{-1}{x(x+\delta x)}\Big) \quad \implies \delta x\to 0 \\[4pt] &=-\frac{1}{x^2}
\end{align}
$
## Product Rule
**Formula:**
$ \begin{aligned}
\text{if: } A(x)&=f(x)*g(x) \\ \text{then: } A'(x)&=f(x)g'(x)+f'(x)g(x)
\end{aligned} $
**Derivation:** We have an area $A(x)$, with length $f(x)=3x+1$ and width $g(x)=2x$. We want to know how much the change in area $A'(x)$, when I change $x$ at some specific point.
![[product-rule.png|center|500]]
We can see from the plot above, that the change is the sum of 3 areas.
$
\begin{align}
\delta A(x)
&= f(x)*\big(g(x+\delta x)- g(x)\big) \\
&+ g(x)*\big(f(x+\delta x)-f(x) \\
&+ f\big(x+ \delta x) -f(x)\big) *\big(g(x+\delta x)- g(x)\big)
\end{align}
$
- By solving this equation numerically, we see that the last term results in a $\delta^2$ term. Since we look for the local gradient we let $\delta x \to 0$. Therefore $\delta^2$ will be even smaller, and thus can be neglected!
- We divide by $\delta x$ to get the change in $A(x)$ per unit of $\delta$. If we now compare the equation to the rise-over-run method, we can see that it is actually the product rule in action!
$
\begin{align}
\frac{\delta A(x)}{\delta x} &= f(x)*
\underbrace{\frac{g(x+\delta x)- g(x)}{\delta x}}*{g'(x)} +g(x)* \underbrace{\frac{f(x+\delta x)-f(x)}{\delta x}}_{f'(x)}
\end{align}
$
## Quotient Rule
For $f(x)=\frac{u(x)}{v(x)}$, the derivative is:
$f^\prime(x)= \frac{u^\prime(x)v(x) - u(x)v^\prime(x)}{[v(x)]^2}$
Example: We have a function $\frac{x^2+1}{x+1}$ and want to find its derivative. Therefore we need to identify the components.
- $u(x)=x^2+1$ which has the derivative $u^\prime(x)=2x$.
- $v(x)=x+1$ which has the derivative $v^\prime(x)=1$.
Applying the quotient rule:
$ f^\prime(x)=\frac{2x*(x+1)-(x^2+1)*1}{(x+1)^2} = \frac{x^2+2x-1}{(x+1)^2}$
## Chain Rule
For a composite function $f\big(g(x)\big)$, the derivative is:
$ f'(x)=\frac{df}{dg}*\frac{dg}{dx}$
**Example:** We are given the following two functions, and we want to find $\frac{df}{dx}$. This means, we want to know how much $f$ changes when we change $x$.
$ \begin{aligned}
f(g)&=-\frac{1}{3}g^2+g+\frac{1}{5}\\[8pt] g(x)&=e^x-1
\end{aligned} $
We apply the Chain rule by differentiating each function separately to obtain $\frac{df}{dg}$ and $\frac{dg}{dx}$. Then we multiply the resulting derivatives.
$
\begin{align}
f'(g)&=1-\frac{2}{3}g \\[4pt]
g'(x)&=e^x \\[4pt]
\frac{df}{dx}&=\left(1-\frac{2}{3} g\right) * e^x \\[4pt]
\frac{df}{dx}&=\left(1-\frac{2}{3}(e^x-1)\right) * e^x
\end{align}
$
## Exponential Functions
The derivative of an exponential is just a special case of the Chain Rule, with the property:
$ f(x) = e^x \implies f^\prime(x)=e^x$
This should not be confused with the power rule:
| Rule | Base | Exponent | Example |
| ---------------- | -------- | -------- | -------------------------- |
| Power rule | variable | number | $x^{5} \to 5x^4$ |
| Exponential rule | number | variable | $e^{5x^2} \to 10xe^{5x^2}$ |
## Trigonometric Functions
Functions $\sin, \cos$ are exponentials with base $e$, and thus variations of $e^x$. Although their derivatives $f’(x)$ are different from the originals $f(x)$, they show a recurrent pattern.
**Relationship:**
$ \sin(x)=\frac{e^{ix}-e^{-ix}}{2i}, \quad \cos(x)=\frac{e^{ix}+e^{-ix}}{2} $
**Derivatives:**
$ \begin{align}
f(x) &=\sin (x) \\
f'(x) &= \cos(x) \\
f''(x) &= -\sin(x) \\
f^{(3)}(x)&=-\cos(x) \\
f^{(4)}(x)&=\sin(x)
\end{align} $
This cyclic behavior means that higher-order derivatives of trigonometric functions repeat every four derivatives.
![[trigonometric-functions.png|center|400]]