## Project II: The Derivative of an Integral

As in the graph below, consider some continuous nonnegative
function f(t) on some interval [a,b], let x be between a and b,
and let h be some small positive number. For any such x, define F(x)
to be the integral of f(t) from a to x.

### [1] The Quantities F(x) and F(x+h)

The quantity F(x) can be thought of as the area of the region
between the graph of f(t) and the t-axis, over the interval [a,x].
This region is shown in the graph below with the hatched shading.
The quantity F(x+h) can be thought of as the area of the region
between the graph of f(t) and the t-axis, over the interval [a,x+h].
This is shown in the graph below by the region with the hatched
shading, together with the region with the speckled shading.

### [2] The Quantity F(x+h)-F(x)

The quantity F(x+h)-F(x) corresponds to the region between the
graph of f(t) and the t-axis, over the interval [x,x+h], represented
in both the graph above and the graph below by the region with just
the speckled shading.

### [3] A Rectangular Approximation

As shown in the graph below, F(x+h)-F(x) is about equal to the
area f(x)h inside the rectangle whose boundary is indicated in bold.
The height of this rectangle is given by f(x), which is independent
of h.

### [4] An Average Length

The quantity (F(x+h)-F(x))/h is an area divided by a length,
so the result is also a length. In fact, (F(x+h)-F(x))/h is precisely
the average of f(t) over the interval [x,x+h].

### [5] The Derivative Formula

From [3], f(x)h is an approximation for (F(x+h)-F(x)), so
f(x) is an approximation for (F(x+h)-F(x))/h. If it's good enough,
then we'd expect that f(x) and (F(x+h)-F(x))/h have the same limit
as h approaches 0. But f(x) doesn't depend on h, so it is its own
limit, and the limit of (F(x+h)-F(x))/h is, by definition, F'(x).
Thus we expect F'(x)=f(x).
How do we know if it is good enough? If f(t) is either increasing
or decreasing, then we have an error formula. The left Riemann sum
(which is just f(x)h) using one rectangle over the interval x to x+h
differs from the integral of f(t) over the interval (which is
just F(x+h)-F(x)) by at most |f(x+h)-f(x)|h. Thus (F(x+h)-F(x))/h and
f(x) differ by at most |f(x+h)-f(x)|, so the difference between
(F(x+h)-F(x))/h and f(x) goes to 0 as h does. Thus they really do have
the same limit, so in fact F'(x)=f(x).

### [6] An Average Rate for a Special Function

Now we specialize to the case that a=0 and f(t)=exp((-t^2)/2)/(2p)^(1/2),
where p represents 3.1415... and ^ represents exponentiation. Thus F(1) is
the integral, from 0 to 1, of f(t), which we can estimate using
the Riem program on our calculators. Using 100 right-hand rectangles
with xmin=0 and xmax=1, Riem gives the estimate.34056 for F(1).
Similarly, using 100 right-hand rectangles with xmin=0 and
xmax=1.001, Riem gives the estimate.34080 for F(1.001). These
estimates now can be used to get the estimate
(.34080-.34056)/0.001=.24 for (F(1.001)-F(1))/0.001.
(Note: if it were really just F(1.001)-F(1) that we wanted to estimate
it would be better to use Riem with xmin=1 and xmax=1.001.
Otherwise we end up dealing with the region shaded by hatchmarks
in the first graph above in estimating both F(1.001) and F(1),
even though it cancels out when we subtract. Roundoff errors are
potentially very important when computing the difference of two
relatively large numbers with a small difference. If we do use Riem
with xmin=1 and xmax=1.001, we get the estimate 0.00024185 for
F(1.001)-F(1), hence an estimate of 0.242 for (F(1.001)-F(1))/0.001.
Not only is this estimate likely to be more accurate, but it takes
only half as much work to obtain.)

### [7] The Instantaneous Rate

In [6] we estimated the average rate of change of F(x) over the
interval x=1 to x=1.001, obtaining an estimate of 0.24 for F'(1). But
in [5] we found that F'(x)=f(x); i.e., F'(1)=exp(-1/2)/(2p)^(1/2)=.2420.
We see that our estimate 0.24 and our calculation 0.2420 are in
fairly good agreement.

### [8] Practice with the Chain Rule

Now define G(x) to be the integral of f(t) from 0 to x^2. Notice
that G(x) is an integral from t=0 to t=x^2, while F(x) is the exact
same integral, only from t=0 to t=x. Thus G(x)=F(x^2). By the chain
rule, the derivative G'(x)=(F(x^2))' of F(x^2) is F'(x^2)(x^2)'=2xF'(x^2).
Thus G'(x)=2xF'(x^2), but by [5] we know F'(x)=f(x), so
G'(x)=2xf(x^2)=(2x)exp(-x^4/2)/(2p)^(1/2).