Calculus
Knowledge of the calculus is often regarded as the dividing line between amateur and professional scientists. Calculus is regarded, in its own right, as one of the most beautiful creations of the human mind, comparable in its magnificence with the masterworks of Shakespeare, Mozart, Rembrandt, and Michelangelo. The invention of calculus is usually credited to Isaac Newton and Gottfried Wilhelm Leibniz in the 17th century. Some of the germinal ideas can, however, be traced back to Archimedes in the third century BC. Archimedes exploited the notion of adding up an infinite number of infinitesimal elements in order to determine areas and volumes of geometrical figures. We have already mentioned how he calculated the value of by repeatedly doubling the number of sides of a polygon inscribed in a circle. The prototype problem in differential calculus is to determine the slope of a function at each point x. As we have seen, this is easy for a straight line. The challenge comes when the function has a more complicated dependence on x. A further elaboration concerns the curvature of a function, describing how the slope changes with x. Newton’s motivation for inventing differential calculus was to formulate the laws of motion—to determine how the planets move under the gravitational attraction of the Sun, how the Moon moves around the Earth, and how fast an apple falls to the ground from a tree. Thus Newton was most directly concerned with how quantities change as functions of time, thereby involving quantities such as velocity and acceleration.
What does it mean when the speedometer on your car reads 35 miles/hr at some particular instant? It doesn’t mean, you will readily agree, that you have come exactly 35 miles in the last hour or that you can expect to travel 35 miles in the next hour. You will almost certainly slow down and speed up during different parts of your trip and your speedometer will respond accordingly. You can certainly calculate your averagespeed for the entire journey by dividing the number of miles by the number of hours, but your speedometer readings will have been sometimes slower, sometimes faster, than this average value.
Let the variable r represent the distance you have traveled from your starting point, and let t represent the elapsed time. Figure 6.1 is a plot of your progress, distance traveled as a function of time, as represented by the function . Your stops for red lights show up as horizontal segments, where t continues to increase but r stands still. Suppose, at the beginning of your trip, your watch reads and your odometer reads , while, at the end, your watch and odometer read and , respectively. Your average speed—we’ll call it for velocity—for the whole trip is given by
(6.1)
You might have noted that the later part of your trip, after odometer reading at time , was somewhat faster than the earlier part. You could thereby calculate your speeds for the separate legs of the trip
(6.2)
You might continue dividing your trip into smaller and smaller increments, and calculate your average speed for each increment. Eventually, you should be able to match the actual readings on your speedometer!
To do this more systematically, let us calculate the average speed over a small time interval around some time t, say between and . We wind up with the same result somewhat more neatly by considering the time interval between t and . Let the corresponding odometer readings be designated and and their difference by . The average speed in this interval is given by
(6.3)
and is represented by the slope of the chord intersecting the curve at the two points and . As we make and smaller and smaller, the secant will approach the tangent to the curve at the point . The slope of this tangent then represents the instantaneous speed—as shown by the speedometer reading—at time t. This can be expressed mathematically as
(6.4)
In the notation of differential calculus, this limit is written
(6.5)
verbalized as “the derivative of r with respect to t” or more briefly as “DRDT.” Alternative ways of writing the derivative are , and . For the special case when the independent variable is time, its derivative, the velocity, is written . This was Newton’s original notation for the quantity he called a “fluxion.”
You’ve possibly heard about a hot new Porsche that can “accelerate from 0 to 60 mph in 3.8 seconds.” Just as velocity is the time derivative of distance, acceleration is the time derivative of velocity:
(6.6)
It thus represents the second derivative of distance, written
(6.7)
Alternative notations for are and . Newton’s second law of motion states that the force F on a body of mass m causes an acceleration given by
(6.8)
After your drive to your lakeside destination, you might want to take a spin in your new speedboat. Speedboats are likely to have speedometers but not odometers. Suppose, given your newfound appreciation of calculus, you would like to somehow apply calculus to your speedboat ride. It turns out that using data from your speedometer and wristwatch, you can determine the distance your boat has traveled. Dimensionally, distance = speed time, or, expressed in the style of factor-label analysis,
(6.9)
During a short interval of time around a time , your velocity might be practically constant, say, mph. The distance you covered during this time would then be given by . If you start at time , the distance you cover by time , namely , can be approximated by the sum of n individual contributions:
(6.10)
This can be represented, as shown in Figure 6.2, as the sum of areas of a series of vertical strips of height and width . In concept, your computation of distance can be made exact by making the time intervals shorter and shorter ( for all i) and letting the number of intervals approach infinity . Graphically, this is equivalent to finding the area under a smooth curve representing between the times and . This defines the definite integral of the function , written
(6.11)
Let us reiterate the results of the last two sections using more standard notation. Expressed in the starkest terms, the two fundamental operations of calculus have the objective of either (i) determining the slope of a function at a given point or (ii) determining the area under a curve. The first is the subject of differential calculus, the second, of integral calculus.
Consider a function , which is graphed in Figure 6.3. The slope of the function at the point x can be determined by a limiting process in which a small chord through the points and is made to approach the tangent at . The slope of this tangent is understood to represent the slope of the function at the point x. Its value is given by the derivative
(6.12)
which can also be written , or . When , a small increment of x, approaches zero, it is conventionally written dx, called the differential of x. Symbolically:
(6.13)
Note that the limit in Eq. (6.12) involves the ratio of two quantities both of which approach zero. It is an article of faith to accept that their ratio can still approach a finite limit while both numerator and denominator vanish. In the words of Bishop Berkeley, a contemporary of Newton, “May we not call them ghosts of departed quantities?”
The prototype problem in integral calculus is to determine the area under a curve representing a function between the two values and , as shown in Figure 6.4. The strategy again is to approximate the area by an array of rectangular strips. It is most convenient to divide the range into n strips of equal width . We use the convention that the ith strip lies between the values labeled and . Consistent with this notation, and . Also note that for all i. The area of the n strips adds up to
(6.14)
In mathematical jargon, this is called a Riemann sum. As we divide the area into a greater and greater number of narrower strips, and . The limiting process defines the definite integral (also called a Riemann integral):
(6.15)
Note that when the function is negative, it subtracts from the sum (6.14). Thus the integral (6.15) represents the net area above the x-axis, with regions below the axis making negative contributions.
Figure 6.4 Evaluation of the definite integral . The areas of the rectangles above the x-axis are added, those below the x-axis are subtracted. The integral equals the limit as and .
Suppose now that the function has the property that , where the function is called the antiderivative of . Accordingly, in Eq. (6.14) can be approximated by
(6.16)
Noting that , Eq. (6.14) can be written
(6.17)
Note that every intermediate value is canceled out in successive terms.
In the limit as and , we arrive at the fundamental theorem of calculus:
(6.18)
This connects differentiation with integration and shows them to be essentially inverse operations.
In our definitions of derivatives and integrals, we have been carefree in assuming that the functions and were appropriately well behaved. For functions which correspond to physical variables, this is almost always the case. But just to placate any horrified mathematicians who might be reading this, there are certain conditions which must be fulfilled for functions to be differentiable and/or integrable. A necessary condition for to exist is that the function be continuous. Figure 6.5 shows an example of a function with a discontinuity at . The derivative cannot be defined at that point. (Actually, for a finite-jump discontinuity, mathematical physicists regard as proportional to the deltafunction, , which has the remarkable property of being infinite at the point , but zero everywhere else.) Even a continuous function can be nondifferentiable, for example, the function , which oscillates so rapidly as that its derivative at , is undefined. Such pathological behavior is, as we have noted, rare in physical applications. We might also have to contend with functions which are continuous but not smooth. In such cases, the derivative at a point is discontinuous, depending on which direction it is evaluated. The prototype example is the absolute value function . For , while for , thus the derivative is discontinuous at .
Figure 6.5 Three functions with pathologies in their derivatives. Left: is discontinuous at . Center: has discontinuous derivative at . Right: has undefined derivative as .
Generally, the definite integral exists for functions that have at most a finite number of finite discontinuities—classified as piecewise continuous. Most often an integral “does not exist” if it blows up to an infinite value, for example, . These are also known as improper integrals.
The terms “differentiating” and “finding the derivative” are synonymous. A few simple rules suffice to determine the derivatives of most functions you will encounter. These can usually be deduced from the definition of derivative in Eq. (6.12). Consider first the function , where a is a constant. We will need
(6.19)
from the binomial expansion (3.92). It follows then that
(6.20)
Finally, taking the limit , we find
(6.21)
For the cases :
(6.22)
The first formula means that the derivative of a constant is zero. Equation (6.21) is also valid for fractional or negative values of n. Thus we find
(6.23)
For the exponential function , we find
(6.24)
(6.25)
Thus the exponential function equals its own derivative! This result also follows from term-by-term differentiation of the series (3.104). The result (6.25) is easy generalized to give
(6.26)
For the natural logarithm , we find
(6.27)
having used several properties of logarithms and the definition of the exponential function. Therefore
(6.28)
For logarithm to the base b
(6.29)
We can thus show
(6.30)
Don’t confuse this with the result .
Derivatives of the trigonometric functions can be readily found using Euler’s theorem (4.57):
(6.31)
Therefore
(6.32)
and equating the separate real and imaginary parts, we find
(6.33)
The other trigonometric derivatives can be found from these and we simply list the results:
(6.34)
The derivatives of the hyperbolic functions are easily found from their exponential forms (4.66). These are analogous to the trigonometric results, except that there is no minus sign:
(6.35)
Techniques which enable us to find derivatives of more complicated functions can be based on the chain rule. Suppose we are given what can be called a “function of a function of x,” say . For example, the Gaussian function represents an exponential of the square of x. The derivative of a composite function involves the limit of the quantity
The function can be considered a variable itself, in the sense that . We can therefore write
(6.36)
For example,
(6.37)
In effect, we have evaluated this derivative by a change of variables from x to .
The derivatives of the inverse trigonometric functions, such as , can be evaluated using the chain rule. If , then . Taking of both sides in the last form, we find
(6.38)
But
(6.39)
(6.40)
We can show analogously that
(6.41)
and
(6.42)
Implicit differentiation is a method of finding for a functional relation which cannot be easily solved for . Suppose, for example, we have y and x related by . This cannot be solved for y in closed form. However, taking of both sides and solving for , we obtain
(6.43)
Implicit differentiation can be applied more generally to any functional relation of the form .
We have already used the fact that the derivative of a sum or difference equals the sum or difference of the derivatives. More generally
(6.44)
The derivative of a product of two functions is given by
(6.45)
while for a quotient
(6.46)
We had earlier introduced the antiderivative of a function , meaning that . Since gives , the inverse would imply that must be the derivative of . More generally, we could say that the antiderivative of equals since the constant will disappear upon taking the derivative.
The fundamental theorem (6.18) can be rewritten with replacing x as the integration variable and x replacing the limiting value b. This gives
(6.47)
This will be expressed in the form
(6.48)
The antiderivative of a function will hereafter be called the indefinite integral and be designated . Thus the result derived in the last paragraph can now be written
(6.49)
All the derivatives we obtained in Sections 6.4 and 6.5 can now be “turned inside out” to give the following integral formulas; in all cases a constant is to be added to the right-hand side:
(6.50)
(6.51)
(6.52)
(6.53)
(6.54)
(6.55)
(6.56)
For all the above integrals, the constant drops out if we put in limits of integration, for example
(6.57)
You can find many Tables of Integrals which list hundreds of other functions. A very valuable resource is the Mathematica integration website: http://integrals.wolfram.com/. For example, you can easily find that
(6.58)
You do have to use the Mathematica conventions for the integrand, in this case “x/Sqrt[aˆ2 - xˆ2].”
From a fundamental point of view, integration is less demanding than differentiation, as far as the conditions imposed on the class of functions. As a consequence, numerical integration is a lot easier to carry out than numerical differentiation. If we seek explicit functional forms (sometimes referred to closed forms) for the two operations of calculus, the situation is reversed. You can find a closed form for the derivative of almost any function. But, even some simple functional forms cannot be integrated explicitly, at least not in terms of elementary functions. For example, there are no simple formulas for the indefinite integrals or . These can, however, be used to definite new functions, namely, the error function and the exponential integral for the two examples just given.
There are a number of standard procedures which can enable a large number of common integrals to be evaluated explicitly. The simplest strategy is integration by substitution, which means changing of the variable of integration. Consider, for example, the integral . The integral can be evaluated in closed form even though cannot. The trick is to define a new variable , so that . We have then that . The integral becomes tractable in terms of y:
(6.59)
The result can be checked by taking the derivative of .
As a second example consider the integral (6.58) above, which we found using the Mathematica computer program. A first simplification would be to write so that
(6.60)
Next we note the tantalizing resemblance of to . This suggests a second variable transformation , with . The integral becomes
(6.61)
in agreement with the result obtained earlier.
Trigonometric identities suggest that integrals containing the forms can sometimes be evaluated using a substitution or . Likewise forms containing suggest a possible transformation such as or . Forms containing suggest possibilities such as or .
Integration by parts is another method suggested by the formula for the derivative of a product, Eq. (6.45). In differential form, this can be expressed
(6.62)
where u and v are understood to be functions of x. Integrating (6.62). we obtain the well-known formula for integration by parts
(6.63)
This is useful whenever is easier to evaluate than . As an example, consider , another case of a very elementary function which doesn’t have an easy integral. But if we set and , then and we find using (6.63) that
(6.64)
An integral of the type
can often be evaluated by the method of partial fractions. We can always find constants A and B such that
(6.65)
Therefore the integral can be reduced to
(6.66)
which might be easier to solve. In the event that the denominator contains factors raised to powers, the procedure must be generalized. For example,
(6.67)
and more generally,
(6.68)
The second derivative of a function is the derivative of , defined by
(6.69)
Putting in the definition (6.12) of the first derivative, this can also be written
(6.70)
This formula is convenient for numerical evaluation of second derivatives. For analytical purposes, we can simply apply all the derivative techniques of Sections 6.4 and 6.5 to the function . Higher derivatives can be defined analogously
(6.71)
These will be used in the following chapter to obtain power-series representations for functions.
Recall that the first derivative is a measure of the instantaneous slope of the function at x. When , the function is increasing with x, that is, it slopes upward. Conversely, when , the function decreases with x and slopes downward. At points x where the function is instantaneously horizontal. This is called a stationary point and may represent a local maximum or minimum, depending on the sign of at that point.
The second derivative is analogously a measure of the increase or decrease in the slope . When , the slope is increasing with x and the function has an upward curvature. It is concave upward and would hold water if it were a cup. Conversely, when , the function must have a downward curvature. It is concave downward and water would spill out. A point where , where the curvature is zero, is known as an inflection point. Most often, for a continuous function, an inflection point represents a point of transition between positive and negative curvature.
Let us return to our consideration of stationary points, where . If , the curvature is downward and this must therefore represent a local maximum of the function . The tangent at the maximum rests on top of the curve. We call this maximum “local” because there is no restriction on having an even larger value somewhere else. The maximum possible value of a function in its entire domain is called its global maximum. Analogously, when and , we have a local minimum. In this case, the curve rests on its tangent. Three features described above are illustrated in Figure 6.6. A point where both and , assuming the function is not simply a constant, is known as a horizontal inflection point.
The gamma function is one of a class of functions which is most conveniently defined by a definite integral. Consider first the following integral, which can be evaluated exactly:
(6.72)
A very useful trick is to take the derivative of an integral with respect to one of its parameters (not the variable of integration). Suppose we know the definite integral
(6.73)
where is a parameter not involved in the integration. We can take of both sides to give
(6.74)
This operation is valid for all reasonably well-behaved functions. (For the derivative of a function of two variables with respect to one of these variables, we have written the partial derivative in place of . Partial derivatives will be dealt with more systematically in Chapter 10.) Applying this operation to the integral (6.72), we find
(6.75)
We have therefore obtained a new definite integral:
(6.76)
Taking again we find
(6.77)
Repeating the process n times
(6.78)
Setting , now that its job is done, we wind up a neat integral formula for
(6.79)
This is certainly not the most convenient way to evaluate , but suppose we replace n by a noninteger. In conventional notation, this defines the gamma function:
(6.80)
When is an integer, this reduces to the factorial by the relation
(6.81)
Occasionally the notation is used for even for noninteger .
For the case
(6.82)
The integral can be evaluated with a change of variables giving
(6.83)
where we have recalled Laplace’s famous result from Eq. (1.21)
(6.84)
Thus
(6.85)
the relation we had teased you with in Eq. (3.84).
Figure 6.7 shows a plot of the gamma function. For , the function is a smooth interpolation between integer factorials. becomes infinite for
An apocryphal story is told of a math major showing a psychology student the formula for the infamous Gaussian or bell-shaped curve, which purports to represent the distribution of human intelligence and such. The formula for a normalized Gaussian looks like this:
(6.86)
and is graphed in Figure 6.8. The psychology student, unable to fathom the fact that this formula contained , the ratio between the circumference and diameter of a circle, asked, “Whatever does have to do with intelligence?” The math student is supposed to have replied, “If your IQ were high enough, you would understand!” The comes, of course, from Laplace’s integral (1.21), slightly generalized to
(6.87)
With the appropriate choice of variables, this gives the normalization condition for the Gaussian function
(6.88)
The average value of the variable x is given by
(6.89)
The standard deviation, , commonly called “sigma,” parametrizes the half-width of the distribution. It is defined as the root mean square of the distribution. The mean square is given by
(6.90)
To evaluate the integrals (6.89) and (6.90) for the Gaussian distribution, we need the additional integrals
(6.91)
Since the integrand in the first integral is an odd function, contributions from and exactly cancel to give zero. The second integral can be found by taking on both sides of (6.87), the same trick we used in Section 6.9. For the IQ distribution shown in Figure 6.8, the average IQ is 100 and sigma is approximately equal to 15 or 16 IQ points.
A Gaussian distribution can also arise as a limiting case of a binomial distribution. A good illustration is the statistics of coin tossing. Suppose that the toss of a coin gives, with equal a priori probability, heads (H) or tails (T). A second toss will give four equally possible results: HH, HT, TH, and TT, with a 1 2 1 distribution for 0, 1, and 2 heads, respectively. Three tosses will give eight equal possibilities: HHH, HHT, HTH, THH, TTH, THT, HTT, and TTT, with a 1 3 3 1 distribution for 0, 1, 2, and 3 heads, respectively. Clearly we are generating a binomial distribution of the form (3.91):
(6.92)
where r is the number of heads in n coin tosses. Figure 6.9 plots the binomial distribution for . As , the binomial distribution approaches a Gaussian (6.86), with and . Remarkably, sigma also increases with n but only as its square root. If we were to toss a coin one million times, the average number of heads would be 500,000 but the likely discrepancy would be around 500, one way or the other.
Figure 6.9 Binomial distribution for 10 coin tosses, shown as histogram. The distribution is well approximated by a Gaussian centered at with .
The percentage of a distribution between two finite values is obtained by integrating the Gaussian over this range:
(6.93)
This cannot, in general, be expressed as a simple function. As in the case of the gamma function in the previous section, the error function can be defined by a definite integral
(6.94)
The constant is chosen so that . Note also that and that erf is an odd function. It is also useful to define the complementary error function
(6.95)
These functions are graphed in Figure 6.10. The integral (6.93) reduces to
(6.96)
In particular, the fraction of a Gaussian distribution beyond one standard deviation on either side is given by
(6.97)
This means that about 68.3% of the probability lies between .
The average IQ of college graduates has been estimated to lie in the range 114–115, about one sigma above the average for the population as a whole. College professors allegedly have an average IQ around 132. Thus the chance is only about 15% that you are smarter than your Professor. But, although you can’t usually best him or her by raw brainpower, you can still do very well with “street smarts” which you are hopefully acquiring from this book.
It may be difficult or even impossible in some cases to express an indefinite integral in analytic form. Or the function might be in the form of numerical data with . One can still find accurate numerical approximations for corresponding definite integrals . The most elementary method is very nearly a restatement of the definition of a Riemann sum, Eq. 6.14, but uses a row of trapezoidal strips to approximate the integral, as shown in Figure 6.11According to the trapezoidal rule the integral is approximated by the sum of the areas of the pink trapezoids. Using the notation , this can be written
(6.98)
More generally, approximating the integral using n trapezoids,
(6.99)
Clearly, the result will become more accurate as n is increased and is decreased.
A somewhat better numerical approximation can be obtained using Simpson’s rule. This requires an even value of n and can be expressed as a summation analogous to Eq. (6.99), but with modified values of the coefficients:
(6.100)
Note that the first and last terms have coefficients 1, while the intermediate coefficients alternate between 4 and 2. The basis of Simpson’s rule is the replacement of the linear segments atop the trapezoidal strips by parabolic arcs over each pair of strips. The three y values associated with two adjacent strips can be fitted to a parabola . Integration then gives
(6.101)
and summation over of such adjacent structures leads to Simpson’s rule.
There exist even more accurate formulas for numerical integration, but it is more convenient to turn the work over to a computer. In Mathematica, the command NIntegrate[f[x],{x,a,b}], with a specified function and limits a and b, performs the integration using an appropriate algorithm, if necessary, with recursively varying subdivisions.
3.236.100.210