# Lecture 3

## Continue on Differentiation

### Mean Value Theorem

#### Theorem 5.9 Generalized Mean Value Theorem

If $f,g:[a,b]\to \mathbb{R}$ are continuous on $[a,b]$ and differentiable in $(a,b)$, then there exists a point $x\in (a,b)$ such that

$$
[f(b)-f(a)]g'(x)=[g(b)-g(a)]f'(x)
$$

Proof:

Define $h(x)=[f(b)-f(a)]g(x)-[g(b)-g(a)]f(x)$, $t\in [a,b]$.

We need to show that there exists a point $x\in (a,b)$ such that $h'(x)=0$.

By previous theorem, it's enough to show that $h$ has a local minimum or maximum in $(a,b)$. By [Extreme Value Theorem](https://notenextra.trance-0.com/Math4111/Math4111_L24#theorem-416-extreme-value-theorem)

$$
\begin{aligned}
h(a)&=[f(b)-f(a)]g(a)-[g(b)-g(a)]f(a)\\
&=f(b)g(a)-f(a)g(b)\\
h(b)&=[f(b)-f(a)]g(b)-[g(b)-g(a)]f(b)\\
&=g(a)f(b)-g(b)f(a)
\end{aligned}
$$

So $h(a)=h(b)$.

Consider three cases:

1. $h$ is constant on $[a,b]$. Then $h'(x)=0$ for all $x\in (a,b)$.
2. $\exists t\in (a,b)$ such that $h(t)>h(a)=h(b)$. Since every continuous function on a compact interval attains its supremum, and $h(t)>h(a)=h(b)$, the supremum of $h$ on $[a,b]$ is attained at some point $x\in (a,b)$. (Apply [Extreme Value Theorem](https://notenextra.trance-0.com/Math4111/Math4111_L24#theorem-416-extreme-value-theorem) to $h$ on $[a,b]$.)
3. $\exists t\in (a,b)$ such that $h(t)<h(a)=h(b)$. Since every continuous function on a compact interval attains its infimum, and $h(t)<h(a)=h(b)$, the infimum of $h$ on $[a,b]$ is attained at some point $x\in (a,b)$. (Apply [Extreme Value Theorem](https://notenextra.trance-0.com/Math4111/Math4111_L24#theorem-416-extreme-value-theorem) to $h$ on $[a,b]$.)

In all cases, $h$ has a local minimum or maximum in $(a,b)$.

EOP

#### Theorem 5.10 Mean Value Theorem

The mean value theorem is a special case of the generalized mean value theorem when $g(x)=x$ (the identity function).

If $f:[a,b]\to \mathbb{R}$ is continuous on $[a,b]$ and differentiable on $(a,b)$, then there exists a point $x\in (a,b)$ such that

$$
f(b)-f(a)=f'(x)(b-a)
$$

### Intermediate Value Theorem

#### Definition 5.12.1 Intermediate Value

We say that $f:[a,b]\to \mathbb{R}$ attains the intermediate values if for each $\lambda\in (f(a),f(b))$ there exists a point $x\in (a,b)$ such that $f(x)=\lambda$.

#### Theorem 5.12.2 Continuous Function attains Intermediate Values

If $f:[a,b]\to \mathbb{R}$ is continuous on $[a,b]$, then $f$ attains every value between $f(a)$ and $f(b)$.

#### Theorem 5.12 Intermediate Value Theorem

If $f:[a,b]\to \mathbb{R}$ is differentiable on $[a,b]$. Then $f'$ attains intermediate values.

Proof:

Let $\lambda\in (f'(a),f'(b))$.

Let our auxiliary function be $g(t)=f(t)-\lambda t$.

Since $g'(t)=f'(t)-\lambda$, it suffices to find $x\in (a,b)$ such that $g'(x)=0$.

$g'(a)<0$ and $g'(b)>0$.

We claim that $\exists t_1\in (a,b)$ such that $g(t_1)<g(a)$.

If this were false, then for all $t\in (a,b)$ we would have $g(t)\geq g(a)$.

$$
\frac{g(t)-g(a)}{t-a}\geq 0\\
$$

Continue on Monday.
