Logistic Functions. A logistic the form

Lecture 6.

function is a function f (x) given by a formula of

N with b 6= 0, b > 0. 1 + Ab−x The graph of such a logistic function has the general shape: Untitled-1 f (x) =

Untitled-1

1

N

N b>1

b 1) N • The y intercept is y = ; 1+A • If b > 1, then for very large values of x the value of f (x) is close to N — called the limiting value; • Since

  N N f (x) = = x bx , −x 1 + Ab b +A for small values of x   N bx f (x) ≈ 1+A is approximately exponential.

Example 1. Let’s graph the logistic function f (x) =

8 1 + (2−x)

We note that it crosses the y-axis at y = 4 and near that axis it behaves like the exponential 4 · 2x. Moreover, f (x) is always positive and below y = 8. And, finally, as x assumes large positive value it is close to 8 and when x assumes large negative values, it is close to 0. Example 2. A small college is hit by a highly contagious flu epidemic. Only spotty records were taken, but for the first 20 days of the epidemic, on six days there is the following record of the number of people infected, where x is the number of the day and y the number infected up through that day: x 1 2 4 6 15 20 y 6 10 16 26 89 94 A quick glance at the plot of this data suggests that the record of the number infected as a function of time could be well modeled by a logistic function. And, indeed, applying logistic regression we find the best fit logistic model to be f (x) = with graph

96 , 1 + 22(1.43)−1

Untitled-1

1

80 60 40 20

5

10

2

15

20

Limits.

Lecture 6. (Part 2)

The idea of a “limit” plays a big role in mathematics. A rigorous treatment would be way too much, but informally and for what we need, a good intuitive feel for the notion together with some fairly obvious technical skill will do us nicely in this course. To set the stage consider the function f (x) defined by cases by  x + 1, if x ≤ 1; f (x) = 3, if x > 1. 3

c

2

s

y = f (x) 1

−3

−2

1

2

Now suppose that you are a very small bug walking along this graph on a foggy day toward the y-axis starting on the graph at about x = 3. It’s too foggy to see exactly what is ahead, but as you approach x = 1, what do you expect to find the height of the graph when you reach x = 1? Surely, you’d expect to find y = 3. That you don’t does not change your expectations, just your realization — this time a nasty shock. On the other hand suppose you start your hike on the graph at about x = 0 and this time climb to the right away from the y-axis. Now what do you expect to be the height of the graph when you reach x = 1? Fortunately, this time you are lucky and actually realize your expectations, y is 2. 3

The deal with “limits” is that what we realize is irrelevant — what counts is what we expect to find. We’ll worry about realizations later. But as far as limits go we say • The limit as and write

x approaches 1 from the right is 3, lim f (x) = 3.

x→1+

• The limit as and write

x approaches 1 from the left is 2, lim f (x) = 2.

x→1−

Let’s return to our touring bug. Suppose that he starts walking on the left of the y-axis toward the point on the graph with x = −1 from either side of that point. Clearly, what he’d expect to find when he reached x = −1 is y = 0. That he finds y = 0, although good luck for the bug, is irrelevant to us; what counts for us is that he was right in expecting y = 0. And now we say • The

limit as x approaches -1 is 0, and write lim f (x) = 0.

x→−1

This is a case where the direction of our approach doesn’t matter. At x = 1 the direction is critical. Indeed, • The

limit as x approaches 1 does not exist!

4

There are a couple of other cases we must consider. Start with the function 1 f (x) = 1 + . x Untitled-1 Its graph is:

4

2

-2

-1

1

2

3

-2

-4

Now if we were to walk this graph to the right toward the sunset, we’d never actually come to the end (there is none), but we’d surely observe that we can get y as close to 1 as we might want simply by walking far enough. So we expect that if we could walk to the end, we’d find y = 1. Similarly, if we walked to left, we find exactly the same thing. Thus we say • The limit as and write

x approaches positive infinity is 1, lim f (x) = 1.

x→+∞

• The limit as and write

x approaches negative infinity is 1, lim f (x) = 1.

x→−∞

5

Now suppose we get out our climbing axe, and start hiking toward x = 0 from the right of the y-axis. We’ll never get to x = 0, but we note that no matter what height for y we might choose, we eventually get higher than that by getting close enough to x = 0. A similar thing happens, but in the opposite direction, if we start on the left of the y-axis, and slide down the graph toward x = 0. And so to describe this situation we now say • The limit as +∞, and write

x approaches 0 from the right is lim f (x) = +∞.

x→0+

• The limit as x and write

approaches 0 from the left is −∞, lim f (x) = −∞.

x→0−

Warning!! There is no such number as infinity!! The symbol ∞ and the word “infinity” are used simply as short hand. To say that x approaches +∞ or that limx→a f (x) = ∞ is simply to say that the variable x assumes arbitrarily large values or that the function f (x) may be made larger than any chosen number by choosing x close enough to a. So far we have dealt only with specific examples. But they just illustrate much more general limits. But for us all limits will have the form lim f (x) = L, x→a

where   a real number; a real number; a = plus or minus a real number; and L = plus or minus ∞.  plus or minus ∞. 6

Once we’re in hand of just a few simple, and fairly obvious, facts and willing to do some algebraic manipulation, computing the majority of limits we’ll encounter here is not a big challenge. In a few cases we may just have to use a “numerical” argument of the sort discussed at length in Section 10.1. Still some of the most common glitches to watch for: Bad Stuff. If you hit any of the following forms, either your limit does not exist or you have not analyzed the function properly and it’s back to the drawing board: 0 ; 0

±∞ ; ±∞

0 · ±∞;

∞0 ;

0∞;

00

Basic Rules of Limits. On page xxx of the text there are given several Rules of Limits. We will not list them again, here. But let’s use them, and some common sense, to compute several limits. One class of limits that we will often encounter is of the form f (x) − f (a) , lim x→a x−a in which the limit actually exists but the limits of both numerator 0 and denominator are 0. Since the form is bad, this may require 0 some work, usually we will be able to factor both numerator and denominator allowing us to cancel an offending factor. We’ll try some of these next.

7

Example 1. lim 5x2 + 2x − 3 = x→2

 2 if x > 2; x , Example 2. Let g(x) = x + 1, if x < 2; Then  5, if x = 2. g(2) =

lim g(x) =

x→2−

lim g(x) =

x→2+

lim g(x) =

x→2

x2 − 4 Example 3. lim = x→2 x − 2 f (x) − f (3) = x→3 x−3

Example 4. Let f (x) = 4x2. Find lim

g(a + h) − g(a) = h→a h

Example 5. Let g(x) = 1/x and a 6= 0. Then lim 2x3 − 5x2 + 7 Example 6. lim = x→+∞ 6x3 + 4x − 5 1 = x→2 (x − 2)2

Example 7. lim



 5 2 Example 8. lim (6x )= x→0 x2 If we are too hasty, we’ll come out with ∞ · 0. So let’s think a bit. Example 9. Here’s a toughie. limx→+∞ xe−x = Here our only hope is to try a numerical or graphical approach. 8

Continuity.

Lecture 6. (Part 3)

Consider the function f (x) defined by cases: ( 1 f (x) = 2 x + 1, if x 6= 2 1, if x = 2. So its graph is: y = f (x)

       

3    c      s  

2 1    

 

-1

1

2

3

4

5

If our bug now goes hiking along this graph toward the point with x = 2, then he will certainly expect to find that when he gets to x = 2, he’ll find y = 2; in other words, in this example lim f (x) = 2.

x→2

But when he gets to x = 2, he will not find that y = 2, and in fact he’ll have a nasty fall. We say, then, that f (x) is

not continuous at x = 2.

However, as he hikes toward the point with x = 4, he will expect to find y = 3, and he does! That is, lim f (x) = f (4).

x→4

And so now we say that f (x) is

continuous at x = 4. 9

With any function f (x) as we approach some value x = a in its domain we “expect” that when we get to x = a, we’ll find that f (a) equals lim f (x). If we find that, we say the function is continuous x→a at that point, but if we do not, we say the function is discontinuous or not continuous at that point. In other words, with continuity we “realize what we expect.” Formally, A function f is its domain if

continuous at a value x = a in f (a) = lim f (x). x→a

Otherwise it is discontinuous there. Finally, it is continuous on a set S if it is continuous at each point in the set; otherwise it is discontinuous on S . We will also often say simply that a function is continuous if it is continuous on its domain. You’ll frequently hear people say the “A function is continuous on some interval if you can draw its graph without lifting your pencil off the paper.” For the vast majority of the functions that we’ll encounter, that is a pretty good description. Technically, though, there are some very wild ugly functions that are continuous but for which you just couldn’t actually “draw” their graphs! Let’s finish this part with some examples:

10

 Example 1. The function f (x) =

3, if x ≤ 2; is continuous 2, if x > 2,

at every point except at x = 2. Example 2. The function f (x) = 5x2 − x + 4 is continuous. x2 − 4 Example 3. The function g(x) = is continuous at very x−2 value of x except for x = 2 where it is discontinuous; it is not even defined there! But if we add just one point to its graph of g, it will be continuous everywhere. What point should we add? Maybe a graph would help. How about the function f in Example 1— could we patch that one up? Example 4. The function h(x) = 1/x2 is continuous at every value of x except at x = 0. But here we note that there is no single point we could add to make it continuous. So the functions h and g, of Example 3, miss being continuous at only one value, but the “discontinuity” is more serious for h than for g. How about the function f of Example 1? We’ll look at this business some more later. Example 5. The function f (x) = |x| is continuous at every real value of x. But note that at the point x = 0 its graph has a sharp corner. For someone running along the graph this corner might be a nasty spot, but the function is still continuous there. So how can we identify such behavior? In this case, it’s quite simple, the graph does not have a “tangent line” at that point. This we will deal with next!

11