Skip to content
Snippets Groups Projects
Commit 59275d31 authored by Isabel Slingerland's avatar Isabel Slingerland
Browse files

changed a sentence

parent 8baa8370
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
# The First Derivative
%% Cell type:markdown id: tags:
```{note}
**Important things to retain from this block:**
* Understand what the derivative represents
* Recognize that the derivative can be approximated in different ways
```
%% Cell type:markdown id: tags:
:::{card} **Definition**:
The derivative of a function $f(x)$ evaluated at the point $x_0$ is
$$
\frac{df}{dx}\bigg\rvert_{x_0}=f'(x_0)=\lim_{x \to x_0}\frac{f(x)-f(x_0)}{x-x_0}.
$$
:::
:::{card} **Numerically**:
$x - x_0$ **cannot tend to 0!** Thus:
$$
f'(x_0) \approx \frac{f(x)-f(x_0)}{\Delta x}, \hspace{3mm} \text{where } \Delta x=x-x_0.
$$
:::
```{figure} figs/derivative_new2.png
:name: derivative_new2
derivatives of a function $f(x)$ at a specific points $x_0$ and $x_1$
```
**What does the derivative represents?** A rate of change! In this case, how fast $f(x)$ changes with respect to $x$ (or in the direction of $x$). The derivative can also be with respect to time or another independent variable (e.g., $y,z,t,etc$). Look at the figure to the right. The first derivative evaluated at $x_0$ is illustrated as a simple slope. You can also see that the rate of change at $x_0$ is larger than at $x_1$.
**What does the derivative represents?** A rate of change! In this case, how fast $f(x)$ changes with respect to $x$ (or in the direction of $x$). The derivative can also be with respect to time or another independent variable (e.g., $y,z,t,etc$). Look at figure 1. The first derivative evaluated at $x_0$ is illustrated as a simple slope. You can also see that the rate of change at $x_0$ is larger than at $x_1$.
%% Cell type:markdown id: tags:
## Numerical Freedom to compute derivatives
In the Figure above, the derivative approximation was illustrated arbitarly using two points: the one at which the derivate was evaluated and another point in front of it. However, there are more possibilities. Instead of using points at $x_{-1,0,1}$ a more general notation is used: $x_{i-1,i,i+1}$. The simplest ways to approximate the derivative evaluated at the pont $x_i$ use two points:
$$
\text{forward: }\hspace{3mm} \frac{df}{dx}\bigg\rvert_{x_i}\approx\frac{f(x_{i+1})-f(x_{i})}{x_{i+1}-x_i} \hspace{5mm} \text{backward: } \hspace{3mm} \frac{df}{dx}\bigg\rvert_{x_i}\approx\frac{f(x_{i})-f(x_{i-1})}{x_{i}-x_{i-1}} \hspace{5mm} \text{central } \hspace{3mm} \frac{df}{dx}\bigg\rvert_{x_i}\approx\frac{f(x_{i+1})-f(x_{i-1})}{x_{i+1}-x_{i-1}}
$$
```{figure} figs/derivative_ways.png
:name: derivative_ways
graphs illustrating three different ways to approximate derivatives.
```
%% Cell type:markdown id: tags:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment