**Reminder: Slope at Max / Min**

**Again, our primary goal is to find maximum / minimum of a certain function $f(x)$ that we meet in our lives.**

**Last time, we have observed that at any $x$-value where $f(x)$ achieves maximum or minimum, the slope is zero! For example, take $f(x) = 1 - x^{2}$. Go to FooPlot and type "1 - x^2" under "Function $y(x)$". You see that at $x = 0$, we achieve maximum and there, we have slope zero. Today, we will study how to find this point where $f(x)$ has slope $0$ without plotting.**

**Slope of a linear function**

**A**

**linear function**in $x$ looks like $x, 2x, (1/2)x + 1, (x - 10) + 1, 100x - \pi, \dots$. In some math class you took in your life, you might remember the form

$y = mx + b$

where $m, b$ are constants. This is a graph of a linear function, which is a non-vertical

__line__in the plane. Take an example where $m = 2$ and $B = 4$. We would have $y = 2x + 4$. Go to FooPlot and type "2x + 4" under "Function $y(x)$".

You are looking at the graph of the linear function $f(x) = 2x + 4$. What is the slope of the line? Slope = Rise/run, so we must have $2$, as the slope of the line. This number $2$ should be what we call the "slope of the linear function" $f(x) = 2x + 4$.

More generally, when $f(x) = mx + b$, the slope of the function $f(x)$ is $m$.

**Slope of a non-linear function: derivative**

**A function $f(x)$ is not a linear function when $y = f(x)$ does not look like a line. For example, we saw $y = 1 - x^{2}$ did not look like a line. Go to FooPlot and type "1 - x^{2}" under "Function $y(x)$". What is the slope of this function $y(x) = 1 - x^{2}$? It's trickier to tell then when $f(x)$ was a linear function. Our "rise/run" trick does not seem to work!**

Or does it? Let $\epsilon$ be a small amount of "run", which means the change in $x$. When we start at $x$, we go as far as $x + \epsilon$ in the horizontal direction. What is "rise", the change in $y$? It must be $y(x + \epsilon) - y(x)$. Can you follow? Otherwise, please ask in the comment section!

Continuing, the "rise/run" is

\begin{align*} \dfrac{y(x + \epsilon) - y(x)}{\epsilon} &= \dfrac{1 - (x + \epsilon)^{2} - (1 - x^{2})}{\epsilon} \\ &= \dfrac{x^{2} - (x + \epsilon)^{2}}{\epsilon} \\ &= \dfrac{(x - (x + \epsilon)(x + (x + \epsilon))}{\epsilon} \\ &= \dfrac{-\epsilon(2x + \epsilon)}{\epsilon} \\ &= 2x + \epsilon.\end{align*}

Since we agreed that $\epsilon$ is a small amount, the slope is slightly more than $2x$. Let's look at the picture of $y(x) = 1 - x^{2}$ you drew on FooPlot, we saw that when $x = 0$, the picture tells you that the slope is $0$. We know that when we change a little bit $\epsilon$ from $x$, our slope is $-2x + \epsilon$. This means that when we change a little bit from $x = 0$, our slope is $-2 \cdot 0 + \epsilon = \epsilon$, which is almost zero!

With a bit of more careful thought, you could say that slope of the function $y(x) = 1 - x^{2}$ at $x$ is equal to $-2x$. We write this $y'(x) = -2x$ and call this the

**derivative**of a function $y(x) = 1 - x^{2}$ at $x$.

**Try.**On the graph of $y(x) = 1 - 2x^{2}$, pick an $x$-value, say $x = -1/2$ and draw the line tangent to the graph. What is the slope of the line? Is it equal to $y'(-1/2) = 1$? Can you see what's going on?

**Generalization for polynomials.**We can similarly go about other

**polynomial**functions such as $f(x) = 2x^{4} + x^{3} + x + 10$. Can you guess what the derivative $f'(x)$ is? You get

$f'(x) = 8x^{3} + 3x^{2} + 1$.

In general, the rule is that when you have $g(x) = x^{n}$ for some $n \geq 1$, you have

$g'(x) = nx^{n-1}$.