# Lecture 1

## Chapter 5: Differentiation

### The derivative of a real function

#### Definition 5.1

Let $f$ be a real-valued function on an interval $[a,b]$ ($f: [a,b] \to \mathbb{R}$). 

We say that $f$ is _differentiable_ at a point $x\in [a,b]$ if the limit

$$
\lim_{t\to x} \frac{f(t)-f(x)}{t-x}
$$

exists.

Then we defined the derivative of $f$, $f'$, a function whose domain is the set of all $x\in [a,b]$ at which $f$ is differentiable, by

$$
f'(x) = \lim_{t\to x} \frac{f(t)-f(x)}{t-x}
$$

#### Theorem 5.2

Let $f:[a,b]\to \mathbb{R}$. If $f$ is differentiable at $x\in [a,b]$, then $f$ is continuous at $x$.

Proof:

> Recall [Definition 4.5](https://notenextra.trance-0.com/Math4111/Math4111_L22#definition-45)
>
> $f$ is continuous at $x$ if $\forall \epsilon > 0, \exists \delta > 0$ such that if $|t-x| < \delta$, then $|f(t)-f(x)| < \epsilon$.
>
> Whenever you see a limit, you should think of this definition.

We need to show that $\lim_{t\to x} f(t) = f(x)$.

Equivalently, we need to show that

$$
\lim_{t\to x} (f(t)-f(x)) = 0
$$

So for $t\ne x$, since $f$ is differentiable at $x$, we have

$$
\begin{aligned}
\lim_{t\to x} (f(t)-f(x)) &= \lim_{t\to x} \left(\frac{f(t)-f(x)}{t-x}\right)(t-x) \\
&= \lim_{t\to x} \left(\frac{f(t)-f(x)}{t-x}\right) \lim_{t\to x} (t-x) \\
&= f'(x) \cdot 0 \\
&= 0
\end{aligned}
$$

Therefore, differentiable is a stronger condition than continuous.

> There exists some function that is continuous but not differentiable.
> 
> For example, $f(x) = |x|$ is continuous at $x=0$, but not differentiable at $x=0$.
>
> We can see that the left-hand limit and the right-hand limit are not the same.
>
> $$ \lim_{t\to 0^-} \frac{|t|-|0|}{t-0} = -1 \quad \text{and} \quad \lim_{t\to 0^+} \frac{|t|-|0|}{t-0} = 1 $$
>
> Therefore, the limit does not exist. for $f(x) = |x|$ at $x=0$.

#### Theorem 5.3

Suppose $f$ is differentiable at $x\in [a,b]$ and $g$ is differentiable at a point $x\in [a,b]$. Then $f+g$, $fg$ and $f/g$ are differentiable at $x$, and

(a) $(f+g)'(x) = f'(x) + g'(x)$  
(b) $(fg)'(x) = f'(x)g(x) + f(x)g'(x)$  
(c) $\left(\frac{f}{g}\right)'(x) = \frac{f'(x)g(x) - f(x)g'(x)}{g(x)^2}$, provided $g(x)\ne 0$

Proof:

Since the limit of product is the product of the limits, we can use the definition of the derivative to prove the theorem.

(a)

$$
\begin{aligned}
(f+g)'(x) &= \lim_{t\to x} \frac{(f+g)(t)-(f+g)(x)}{t-x} \\
&= \lim_{t\to x} \frac{f(t)-f(x)}{t-x} + \lim_{t\to x} \frac{g(t)-g(x)}{t-x} \\
&= f'(x) + g'(x)
\end{aligned}
$$

(b)

Since $f$ is differentiable at $x$, we have $\lim_{t\to x} f(t) = f(x)$.

$$
\begin{aligned}
(fg)'(x) &= \lim_{t\to x} \left(\frac{f(t)g(t)-f(x)g(x)}{t-x}\right) \\
&= \lim_{t\to x} \left(f(t)\frac{g(t)-g(x)}{t-x} + g(x)\frac{f(t)-f(x)}{t-x}\right) \\
&= f(t) \lim_{t\to x} \frac{g(t)-g(x)}{t-x} + g(x) \lim_{t\to x} \frac{f(t)-f(x)}{t-x} \\
&= f(x)g'(x) + g(x)f'(x)
\end{aligned}
$$

(c)

$$  
\begin{aligned}
\left(\frac{f}{g}\right)'(x) &= \lim_{t\to x}\left(\frac{f(t)g(x)}{g(t)g(x)} - \frac{f(x)g(x)}{g(t)g(x)}\right) \\
&= \frac{1}{g(t)g(x)}\left(\lim_{t\to x} (f(t)g(x)-f(x)g(t))\right) \\
\end{aligned}
$$

