Calculus Lab #2:  Limits & Continuity

Goals:	1.  Introduce graphical methods for solving problems
	2.  Learn how to evaluate limits in Mathematica
	3.  Understand the meaning of limits through graphs
	4.  Practice evaluating limits via tables, graphs, and algebra
	5.  Learn how to determine continuity of a function on open/closed intervals
	6.  Understand and use the Intermediate Value Theorem

1.  Saving the world via graphs.

As you will discover, one of the uses of calculus is to find where some function reaches a maximum or a minimum.  This comes in handy when we're trying to maximize profit, minimize pollution, maximize structural strength, minimize energy use, or when we're trying to save the world.

	A giant laser cannon has been constructed and installed on the moon to destroy a comet headed for Earth.  This laser was constructed around a core consisting of a huge berylium crystal.  In the seconds before firing, the laser is pumped with radiation at the natural frequency of berylium (to create a resonance build-up in the electric field).  The strength of the electric field is described by the function:
		f(t) = 400(t) sin(t)
with t representing the time in seconds after the pumping begins.

	The process of firing the laser will destroy the delicate crystal, so it can only be fired once (and it must be fired within 10 seconds after pumping has begun).  The energy of the laser beam will be proportional to the magnitude of the electromagnetic field at the time it is fired.  No one knows how much energy will be required to destroy the comet.
	
	You have been assigned the task of selecting the exact instant to fire the laser (after the radiation has begun to pump-in).  When should you fire the laser?  Why should you fire it at this time?

1.  Define the function f(x) = 400(t) sin(t) and plot it.
2.  What is the domain of this function?
3.  Explain what the axes of the graph represent.

Terminology:	There are two peaks and a valley in this portion of the graph.  The technical terms are local maxima (for the peaks) and local minimia (for the valley(s)).  The value of the function at these points is a local maximum or minimum value (an extreme value).

Since we want to maximize the energy of the laser, we'll need to find the time at which the energy field is maximized.  

4.  Zoom in on the maximum by restricting the range of your plot.
5.  At what time does it appear as though energy is maximized?  Round your answer to three significant digits.

2.  Saving it again through calculus concepts.

Rate of change (the slope of a line, for example) is the central idea in Calculus: We can understand a function by understanding the rate at which it changes.

	An epidemic of Monkeypox breaks out on a small tropical island which has a population of 5000.  Luckily, the disease is not fatal and only lasts for five days.  The number of people who have been infected is a function of time, S(t), where t is the number of days since the island was quarantined.  At the time of the quarantine, there were 20 people with Monkeypox.  U.S. officials are concerned about the progress of the epidemic and have created a mathematical model based on typical behavior of epidemics.  They want to know when the epidemic will be growing most rapidly.

	The model chosen for the epidemic is:  S (t)=(100000/(20+4980(e^(-t/4)))).
	The following syntax will define the function and plot it twice.  The first graph shows the progress of the epidemic over the first 10 days since quarantine.  The second graph shows the progress of the disease over the course of 50 days.

s[x_] = 
        (100000/(20 + 4980 Exp[-x/4]));
Plot[s[x], {x, 0, 10}];
Plot[s[x], {x, 0, 50}]

The rate of change of S(t) (or rate of infection) measures how S(t) is changing (how rapidly the infection is spreading).  Mathematically, we write the rate of change as:  S´(t).   S´(t) is a new function that gives the rate of change at any time.

    For example, after 10 days, the model predicts the epidemic will be spreading at a rate of about 55 people per day. This is represented by the value of S´(10).  The following syntax demonstrates this result.

sprime[x_] = (∂_x) s[x];
N[sprime[10]]

Suppose we graph S'(x) -- the rate of change for the function.  Can you predict what that plot will look like?  When will the epidemic be growing at the fastest pace?

Plot[sprime[x], {x, 0, 50}]

3.  Limits in Mathematica

Let's quickly evaluate some limits using Mathematica.  These examples should be in your notes.
	You should always begin by graphing the function.

f[x_] = (((x^2) + x + 2)/(x + 1));
Plot[f[x], {x, -10, 10}]

Now, using the Calculus palette, you can evaluate the limit of this function.

Limit[f[x], x -> 1]

    Limit[f[x], x -> -1]

Try this using the function:  g(x)=((sin(x))/(7  x))

g[x_] = Sin[4  x]/(7  x);
Plot[g[x], {x, -2 π, 2  π}]  
Limit[Sin[4  x]/(7  x), x -> 0]

Let's try one more...

h[x_] = (((x^3) - 1)/Abs)[(x^2) -  1];
Plot[h[x], {x, 0.9, 1.1}]
Limit[h[x], x -> 1]

Limit[f[x], x -> 1, 
      Direction -> 1]
Limit[f[x], x -> 1, Direction -> -1]

Does this limit exist?

4.  Continuity

When people say, "Let's get some continuity here," it means that they don't want dramatic changes -- they would like the normal way of doing things to continue uninterrupted.

A function is continuous if it continues on its way uninterrupted.  In other words, a function is continuous if you can draw it without lifting up your pencil.  Continuity is an important concept in calculus, since almost all the important calculus theorems require our functions to be continuous. 

A function is continuous if it meets the following three criteria:
	1.  f(a) is defined
	2.  The limit of f(x) as x approaches a exists.
	3.  The limit of f(x) as x approaches a is equal to f(a)

Let's examine these criteria one by one.

The first criteria states that in order for a function to be continuous, a function must be defined at all points on the interval.
	Example:  The function f(x)=(Sqrt[x])is not defined for negative values.  Therefore, the function is not continuous at, say, x = -4.

The second criteria states that the limit of the function must exist at a point if the function is continuous at that point.  Your textbook has a good picture of this (and the other criteria) on page 68.

The third criteria states that the limit must approach the value we'd expect it to approach via direct substitution.  In other words, there are not jumps or gaps in the graph of the function.

Plot the following three functions and determine if they are continuous or not.

j[x_] = (((x^3) - 1)/Abs)[(x^2) -  1];
Plot[j[x], {x, 0, 2}]

Not continuous at X = 1, since it doesn't exist.  This is a jump discontinuity (nonremovable)

k[x_] = (1/x);
Plot[k[x], {x, -3, 3}]

Not continuous at X = 0, since the limits are not equal.  This is a jump discontinuity (nonremovable)

l[x_] = (((x^2) - 1)/(x - 1));
Plot[l[x], {x, -3, 3}]

Not continuous at X = 1, since the function is not defined.  This is a point discontinuity (removable if we define f(x)=2 when X=1)

5.  Intermediate Value Theorem

Mark this day on your calendar -- we've arrived at our first official calculus theorem.

If a function f(x) is continuous on the closed interval [a,b], then for every real number d between f(a) and f(b), there exists a c between a and b such that f(c) = d.

In other words, if x can take on any value between a and b, then the function must take on all values between f(a) and f(b).
Let's explain what this means using a simple example.

The following graph shows the relationship between the number of days past November 1st (X) and an individual's weight (Y).  You'll notice that this individual gained weight near Thanksgiving and Christmas and lost some of those extra pounds in between the holidays.

f[x_] = (4.658) Sin[ .14  x -  .408]  +  
          178.59; 
Plot[f[x], {x, 0, 60}, PlotRange -> {170, 195}]

Using the Intermediate Value Theorem:
	Let a = 35 (December 5th)
	Let b = 60 (December 30th)
	What are the values of f(a) and f(b)?

According to the theorem, I can choose any value between 174.045 and 183.204 (for example, 179.6) and I am guaranteed that at some time between December 5th and December 30th, the individual actually weighed that much.

Another example:
On your drive to work, you begin at a speed of 0 mph.  Once you hit the interstate, you cruise at 65 mph.  Let X = time and f(x) represent the speed of your car at any given time.
	1.  Is this a continuous function?
	2.  What does the Intermediate Value Theorem say about this situation?

5.  Questions (Turn in for credit)

Do the following section 1.4 homework exercises on pages 76-77.  I will collect these homework problems at the end of the week.  I will not force you to use Mathematica for this assignment.

Page 76-77:  3-19 odd, 37-41 odd, 75-79 odd, 95, 99

6.  Reflection

At the end of each Mathematica session, I want you to write a sentence or two describing what you learned (or just list important concepts from this lab).  You can later use these reflections as a reference for other Mathematica Labs.

Print out your answers to the lab questions and turn them in for credit.