10.1 Limits and Slope

484 days ago by mpaul

Average Rate of Change

As you hopefully know, slope is \frac{\Delta y}{\Delta x} where \Delta means change.

If y = f(x), then the slope between two points (a, f(a)) and (b, f(b)) is \frac{f(b) - f(a)}{b - a}.

We can think of slope at a point as:

f'(a) = \lim_{b \rightarrow a} \frac{f(b) - f(a)}{b - a}

                             or

f'(a) = \lim_{h \rightarrow 0} \frac{f(a+h) - f(a)}{h}

f(x) = (x^3 - 8)/(x - 2) f 
       
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ \frac{x^{3} - 8}{x - 2}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ \frac{x^{3} - 8}{x - 2}
def slope(f, a, b): return (f(b)-f(a))/(b-a) @interact def avg_rate_of_change(a=1, b=-1): print f A,B = (a,f(a)), (b,f(b)) if a == b: m = derivative(f)(a) print 'slope at',A,': ', m else: m = slope(f, a, b) print 'slope between',A,'and',B,': ', m df(x) = m*(x-a) + f(a) start, end = min(a,b), max(a,b) show(plot(f, start-1, end+1)+\ point([A, B], color = 'red')+\ plot(df, start-1, end+1, color = 'black', linestyle = '--')) 
       

Click to the left again to hide and once more to show the dynamic interactive window

\lim _{x\rightarrow a} f(x) = L

This statement means that f(x) gets arbitrarily close to L as x gets arbitrarily close to a.

f(x) = (x^3-8)/(x-2) show(f) 
       

\lim_{x \rightarrow 2^{-}}f(x)

This means find \lim f(x) as x approaches 2 from the left:

[round(f(x), 2) for x in [1.00 .. 1.99, step = .01]] 
       

\lim_{x \rightarrow 2^{+}}f(x)

This means find \lim f(x) as x approaches 2 from the right:

[round(f(x), 2) for x in [3.00 .. 2.01, step = -.01]] 
       

f(x) when x is 2:

f(2) 
       

Uh-oh.  

It looks like f(x) has no defined value when x = 2!

However, it sure looks like 12 is the limit of f(x) as x approaches 2.

\lim_{x \rightarrow 2} f(x) = 12

lim(f, x=2) 
       
plot(f, -3, 3)+point((2, 12), color = 'red') 
       
lim(f, x=2) 
       

Note that with this function we can factor and simplify:

f(x) = (x^3 - 8)/(x - 2) show(f) 
       
show(factor(x^3-8)) 
       
show(factor(f)) 
       
g(x) = factor(f) g 
       
g(2) 
       

Doing something like this is not always possible when finding limits, but when it is,

we call it a removable discontinuity.

 
       

Slope at a Point

f'(a) = \lim_{x \rightarrow a} \frac{f(x) - f(a)}{x - a}

                             or

f'(a) = \lim_{h \rightarrow 0} \frac{f(a+h) - f(a)}{h}

@interact def slope(a = 1, h = (0..5,step=1/10)): f(x) = x^2 if h == 0: m = derivative(f)(a) print 'slope at',(a,f(a)),': ', m else: m = (f(a+h)-f(a))/h print 'slope between',(a,f(a)),'and',(a+h, f(a+h)),': ', m df(x) = m*(x-a) + f(a) show(plot(f,a-h-3,a+h+3)+\ plot(df,a-h-3,a+h+3, color = 'black', linestyle = '--')+\ points([(a, f(a)), (a+h, f(a+h))], color = 'red')) 
       

Click to the left again to hide and once more to show the dynamic interactive window

Derivative of f(x)

\lim_{\Delta x \rightarrow 0}\frac{\Delta y}{\Delta x} = \frac{\delta y}{\delta x}

f'(x) =  \frac{\delta f(x)}{\delta x}

f'(x) = \lim_{h \rightarrow 0} \frac{f(x+h) - f(x)}{h}

f(x) = x^3 derivative(f, x) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ 3 \, x^{2}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ 3 \, x^{2}
f(x) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}x^{3}
\newcommand{\Bold}[1]{\mathbf{#1}}x^{3}
var('x h') f(x+h) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}{\left(h + x\right)}^{3}
\newcommand{\Bold}[1]{\mathbf{#1}}{\left(h + x\right)}^{3}
expand(f(x+h)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}h^{3} + 3 \, h^{2} x + 3 \, h x^{2} + x^{3}
\newcommand{\Bold}[1]{\mathbf{#1}}h^{3} + 3 \, h^{2} x + 3 \, h x^{2} + x^{3}
_ - f(x) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}h^{3} + 3 \, h^{2} x + 3 \, h x^{2}
\newcommand{\Bold}[1]{\mathbf{#1}}h^{3} + 3 \, h^{2} x + 3 \, h x^{2}
_/h 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{h^{3} + 3 \, h^{2} x + 3 \, h x^{2}}{h}
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{h^{3} + 3 \, h^{2} x + 3 \, h x^{2}}{h}
expand(_) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}h^{2} + 3 \, h x + 3 \, x^{2}
\newcommand{\Bold}[1]{\mathbf{#1}}h^{2} + 3 \, h x + 3 \, x^{2}
limit(_, h=0) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}3 \, x^{2}
\newcommand{\Bold}[1]{\mathbf{#1}}3 \, x^{2}