
Usually I write sitting at my desk but I began writing this prologue sitting in a traffic jam. One of the tools we develop in this chapter -- called the divergence -- can be used to study traffic jams.
Click here to open a new window with a Java applet. Arrange the two windows so that they overlap and you can move easily back-and-forth between them by clicking on the exposed portion of the inactive window to make it active. When you are done with the applet, close its window.
This applet can be useful in understanding one of the two main ideas in this chapter -- divergence -- but this applet can be difficult to interpret. Please read the instructions below very carefully.
You can change this later BUT don't do this yet. If you do want to change P(x) LATER use the box to the right of the label -- Enter P(x) at right.

You can read some interesting things from this initial graph. Notice that P(1) is larger than P(-1). This means that cars are flowing out of the interval [-1, 1] at the right at a higher rate than they are flowing into the interval at the left. What effect would you expect this to have on both the number of cars and the traffic density in this interval?

The range of the y-axis is chosen to highlight the change in traffic density. Notice by the end of the animation (shown above) the traffic density has risen along some parts of the road -- can you explain why? It has fallen along other parts of the road -- can you explain why? The area of the salmon region is roughly the total number of cars in this section of the road. The previous sentence would be completely correct if the bottom of the y-axis represented zero traffic density. It might not, but the area of the salmon region still gives an indication of the number of cars in this section of the road. Notice that this area and, hence, the number of cars in this section of the road decreases as the animation runs. Can you explain why? You can rerun the animation by clicking on the brown "graph paper."
What is noteworthy about each of these functions? What effect does this have on the traffic density?
Traffic jams often occur at places where the traffic density is increasing. For this reason it is important to have a way of measuring the rate of change of the traffic density.
We use the notation div P(x) -- read "the divergence of P at x -- for the rate at which the traffic density at x is decreasing. Thus, traffic jams often occur at points where div P(x) < 0.
We can estimate the density of traffic at a point x by looking at a short stretch of the road -- between x and x + h where h is a small number. The rate at which cars are flowing into this interval from the left is given by P(x) and the rate at which cars are flowing out of this interval on the right is by P(x + h). Thus, the rate at which the number of cars in the interval is decreasing is

and the rate at which the traffic density in this interval is decreasing is

By looking at smaller values of h we get better estimates for the rate at which the traffic density at the point x is decreasing and we get the exact rate at which the traffic density at the point x is decreasing by taking the limit. This limit is the divergence of P at the point x.

Thus, traffic density at a point x is increasing if
For this reason traffic engineers pay particular attention to points at which P'(x) is negative -- that is, points at which the rate of traffic flow is decreasing -- for example, at curves in the road where drivers slow down or on uphill slopes or places where the road is particularly scenic.
Experiment with the applet we used earlier to verify the statement that "traffic density increases at points where P'(x) is negative."
Traffic engineers can monitor what is going on in an interval [a, b] in two different ways --
Inside the interval
At any given time the total number of cars inside the interval is given by

Note the greek letter rho --
-- we use rho(x) and
interchangeably.
If the rate at which the traffic density at each point was decreasing is given by a constant R then the rate at which the total number of cars in the interval was decreasing would be R(b - a). More generally, the rate at which the traffic density is decreasing is given by div P(x) and simple multiplication must be replaced by integration

where the last line follows from the Fundamental Theorem of Calculus. Note that the last line is not surprizing. It says that the rate at which the total number of cars in the interval [a, b] is decreasing is equal to the rate at which cars are leaving the interval on the right minus the rate at whcih they are entering the interval on the left.
Monitoring the entrance and the exit
The last formula above tells us the obvious -- we can monitor the rate at which the total number of cars in the interval is decreasing by monitoring the number entering and leaving.
We have just seen an important but obvious theorem --
The Divergence Theorem in R

This chapter is about theorems like the divergence theorem that relate what is happening inside a region with what is happening along its boundary.