We can calculate the gradient between 2 points on the function $f(x)$ with the rise-over-run method.
- *Run:* The change in $x$ by $\delta x$ units.
- *Rise:* The increase or decrease in $f(x)$ because of that change in the input $x$.
![[rise-over-run.png|center|400]]
$ \text{Gradient} \implies \frac{\text{rise}}{\text{run}} = \frac{f(x+\delta x)-f(x)}{( x+\delta x)- x} = \frac{f(x+\delta x)-f(x)}{\delta x} $
As $\delta x \to 0$, the gradient converges to the local slope at point $x$, expressed as the derivative $f^\prime(x)$.
$ \text{Gradient at } x \implies f^\prime(x)=\lim_{\delta x \to 0} \Big(\frac{f(x+\delta x)-f(x)}{\delta x}\Big) $
> [!note:]
> Building a derivative, just means coming up with a new function $f'(x)$ that gives this gradient at any point $x$. The notation for derivatives can also be written as $\frac{df}{dx}$, which represents the change in $f$ because of the change in $x$.