---
# System prepended metadata

title: Derivatives

---

# Derivatives
## Rates of Change
To understand the derivative, we must first review a familiar topic - rates of change. What is rate of change? Simply, it is how quickly $y$ changes with respect to change $x$: $\frac{\Delta y}{\Delta x}$.

### Average rate of change

To find the average rate of change over interval $(x_1,x_2)$, calculate $\frac{\Delta y}{\Delta x}$.

> Average rate of change = $\frac{\Delta y}{\Delta x}$ = $\frac{y_2-y_1}{x_2-x_1}$ = $\frac{f(x_2)-f(x_1)}{x_2-x_1}$

Why does this make sense intuitively? Simply, you're dividing the total change in $y$ by the change in $x$, which is equivalent to *on average* how much $y$ is changing per unit change in $x$.

If you join the two points $(x_1,f(x_1))$ and $(x_2,f(x_2))$ using a line, you get the secant line. The secant line between these two points will have the same slope as the average rate of change over this interval (can you see why?).
![](https://i.imgur.com/8LpiHDL.png)

### Instantaneous rate of change
Perhaps you've already learned about this in advanced functions, or perhaps you haven't. It doesn't matter. What's important is that now that we understand the idea of a limit, we can properly define instantaneous rate of change. 

The idea of the rate of change at one instance in time may be confusing, even paradoxical. How can something change if zero time passes? Before that, lets talk about Zeno's Paradoxes, specifically the third one about an arrow...

> The third [paradox] is … that the flying arrow is at rest, which result follows from the assumption that time is composed of moments …. he says that if everything when it occupies an equal space is at rest, and if that which is in locomotion is always in a now, the flying arrow is therefore motionless. (Aristotle Physics, 239b30)
 
tl;dr If you observe a flying arrow in any point in time, it is always frozen in place. If so, how does it move at all?

This is pretty similar to our case with instantaneous rate of change. 

To actually gain an intuitive understanding of instantaneous rate of change, let us instead imagine the change in $x$ to be infinitesimal, instead of 0. Take a look at the following gif (not mine):

![](https://i.stack.imgur.com/H9qsY.gif)

What happens? As $x_2$ moves closer and closer to $x_1$, the average rate of change more and more resembles the instantaneous rate of change. In the same sense, the secant line more and more resembles the tangent line. 

Now that we more intuitively understand this idea of instantaneous rate of change, lets define it mathematically. Again, we start with $\frac{\Delta y}{\Delta x}$. The question we wish to ask is what happens when $\Delta x \to 0$. Let's try working this out using our knowledge of limits. 

$\lim \limits_{\Delta x\to0}\frac{\Delta y}{\Delta x}=\lim \limits_{x_2\to x_1}\frac{y_2-y_1}{x_2-x_1}=\lim \limits_{x_2\to x_1}\frac{f(x_2)-f(x_1)}{x_2-x_1}$

Or alternatively, if we call $h$ the difference between $x_2$ and $x_1$, we get

$\lim \limits_{h\to0}\frac{f(x+h)-f(x)}{h}$.

In conclusion, the instantaneous rate of change is equal to $\lim \limits_{h\to0}\frac{f(x+h)-f(x)}{h}$, and is the slope of the tangent line to the function at that point.

## What is a derivative?
The concept of a derivative is simple to understand now that we understand instantaneous change. Put simply, the derivative is a function. The $y$ value of the derivative of $f(x)$ at $x$ is just the instantaneous rate of change of $f(x)$ at the same $x$. 

For example, if $f'(x)$ (more on this notation later) is derivative the function of $f(x)$, $f'(3)$ is just equal to the instantaneous rate of change of $f(x)$ at $x=3$. 

### Derivative notation
The two most common notations to express the derivative of a function are Lagrange's notation and Leibnez's notation.

Lagrange's notation:

> The derivative of $f(x)$ is represented as $f'(x)$

Leibnez's notation:

> The derivative of $f(x)$ is represented as $\frac{d}{dx}f(x)$
> If we have $y=f(x)$, the derivative could also be represented as $\frac{dy}{dx}$


(For the most part I will be using Leibnez's notation in the notes because it's just easier to write out in latex and I'm lazy)

## Calculating derivatives
Sounds simple enough, but how do we actually calculate the equation of the derivative of a function? Keeping in mind that the instantaneous rate of change of any function at $x$ is equal to $\lim \limits_{h\to0}\frac{f(x+h)-f(x)}{h}$, this is simply the value of our derivative. Hence, we get 
$f'(x) = \lim \limits_{h\to0}\frac{f(x+h)-f(x)}{h}$
(This is actually the definition of the derivative)
To get the equation of $f'(x)$, we simply substitute $f(x)$ in the limit with our function. 

Example:
>Find the derivative of $f(x)=x^2$

Using the definition of a derivative, we find that 

$f'(x) = \lim \limits_{h\to0}\frac{f(x+h)-f(x)}{h}=\lim \limits_{h\to0}\frac{(x+h)^2-x^2}{h}=\lim \limits_{h\to0}\frac{x^2+2xh+h^2-x^2}{h}=\lim \limits_{h\to0}\frac{2xh+h^2}{h}=\lim \limits_{h\to0}2x+h=2x$

$\therefore$ the derivative of $x^2$ is $2x$

What does this mean? If you want to find the instantaneous rate of change of $x^2$ at $x=c$, simply calculate $f'(c)$, or $2(c)$

Does this mean I need to evaluate a limit every time I want to find a derivative? What about a difficult function such as $e^{sin(x)}$?

In fact, most (if not all) derivatives can be derived without calculating any limits at all (it is usually done without the use of limits) using some neat tricks derived from some clever manipulation (you don't need to know the proof for any of these).

First of all, 

> The derivative for any constant is $0$.

For example, I need to find $f'(x)$ for $f(x)=3$. If I were to graph $f(x)$, I would see that the instantaneous rate of change at any point is simply 0. 
$\therefore f'(x)=0$

Next,

> The derivative of a the sum of functions is equal to the sums of the derivatives.

For example, we want to find $f'(x)$ of $f(x)=a_{n}x^{n}+a_{n-1}x^{n-1}+\dotsb +a_{2}x^{2}+a_{1}x+a_{0}$
The derivative is simply $f'(x)=\frac{d}{dx}a_{n}x^{n}+\frac{d}{dx}a_{n-1}x^{n-1}+\dotsb +\frac{d}{dx}a_{2}x^{2}+\frac{d}{dx}a_{1}x+\frac{d}{dx}a_{0}$

Also,

> The derivative of a function multiplied by a function is equal to the constant multiplied by the derivative of the function
> 
For example, we wish to find $f'(x)$ where $f(x)=3x^2$.

Since we know that the derivative of a function multiplied by a function is equal to the constant multiplied by the derivative of the function, we find that 

$\frac{d}{dx}3x^2=3\frac{d}{dx}x^2$
Since $\frac{d}{dx}x^2=2x$, we find that $f'(x)$ is $(2x)(3)=6x$

$\therefore \frac{d}{dx}3x^2=6x$

Next, we will introduce the power rule, product rule, quotient rule, and chain rule.

### Power Rule
The power rule states that

> $\frac{d}{dx}x^n=(n)(x^{n-1})$

Pretty simple... Here's an example

Differentiate $f(x)=x^{\frac{1}{2}}$

By the power rule, $\frac{d}{dx}{x^{\frac{1}{2}}}=\frac{1}{2}x^{-\frac{1}{2}}=\frac{1}{2\sqrt{x}}$, and we're done

### Product rule
The product rule states that

> $\frac{d}{dx}f(x)g(x)=f'(x)g(x)+f(x)g'(x)$

Again, pretty simple... Here's another example

Differentiate $f(x)=x^8sin(x)$ (Since we didn't yet learn the derivative $sin(x)$, i'll just say it's $cos(x)$)

Just use the product rule:
$\frac{d}{dx}x^8sin(x)=(\frac{d}{dx}x^8)(sin(x))+(\frac{d}{dx}sin(x))(x^8)=8x^7sin(x)+x^8cos(x)$
and we're done.

### Quotient rule
The quotient rule states that

>$\frac{d}{dx}\frac{f(x)}{g(x)}=\frac{f'(x)g(x)-g'(x)f(x)}{(g(x))^2}$
>
Yet again, pretty simple...

### Chain rule

The chain rule states that

> $\frac{d}{dx}f(g(x))=f'(g(x))g'(x)$

Wait... $f'(g(x))$? What does that mean?

This simply means that we are taking the derivative of $f(x)$ with respect to $g(x)$, instead of $x$. If it makes it easier, you could temporarily set $u$ to $g(x)$ and differentiate from there.

An example:

> Differentiate $h(x)=sin(x^2)$

We can set $f(x)$ to $sin(x)$ and $g(x)$ to $x^2$.

Using the chain rule, we find that
$\frac{d}{dx}h(x)=f'(g(x))g'(x)=cos(g(x))(2x)=cos(x^2)2x$
and we are done.


A mathematician once said

> Taking derivatives is kind of like peeling an onion, you go layer by layer and if you go too quickly you will start crying.
> 

Using these rules, a [derivative chart](http://www.math.com/tables/derivatives/tableof.htm) for functions that we have not yet learnt the derivatives of (such as $e^x$, $ln$, inverse and hyperbolic trig, and others), and a bit of patience, we can now differentiate almost every function! 


## Applications of Derivatives

*Coming soon*