• No results found

Exercises

2.6 FINITE AND INFINITE CALCULUS

We've learned a variety of ways to deal with sums directly. Now it's time to acquire a broader perspective, by looking at the problem of summa- tion from a higher level. Mathematicians have developed a \nite calculus," analogous to the more traditional innite calculus, by which it's possible to approach summation in a nice, systematic fashion.

Innite calculus is based on the properties of the derivative operatorD, dened by

Df(x) = lim

h0

f(x+h) −f(x)

h .

Finite calculus is based on the properties of the dierence operator∆, dened by

∆f(x) = f(x+1) −f(x). (2.42)

This is the nite analog of the derivative in which we restrict ourselves to positive integer values of h. Thus, h = 1 is the closest we can get to the \limit" ash→0, and∆f(x)is the value of¡f(x+h) −f(x)¢/hwhenh=1.

The symbols D and ∆ are called operators because they operate on functions to give new functions; they are functions of functions that produce functions. Iffis a suitably smooth function of real numbers to real numbers, then Df is also a function from reals to reals. And if f is any real-to-real As opposed to a

cassette function. function, so is∆f. The values of the functions Dfand ∆fat a point x are given by the denitions above.

Early on in calculus we learn howD operates on the powersf(x) =xm.

In such casesDf(x) =mxm−1. We can write this informally withfomitted,

D(xm) = mxm−1.

It would be nice if the∆operator would produce an equally elegant result; unfortunately it doesn't. We have, for example,

∆(x3) = (x+1)3x3 = 3x2+3x+1 .

But there is a type of \mth power" that does transform nicely under∆, Math power.

and this is what makes nite calculus interesting. Such newfangled mth powers are dened by the rule

xm =

mfactors

z }| {

x(x−1). . .(x−m+1), integerm0. (2.43) Notice the little straight line under the m; this implies that the m factors are supposed to go down and down, stepwise. There's also a corresponding

denition where the factors go up and up:

xm =

mfactors

z }| {

x(x+1). . .(x+m−1), integerm0. (2.44) When m = 0, we have x0 = x0 = 1, because a product of no factors is

conventionally taken to be1 (just as a sum of no terms is conventionally0). The quantity xm is called \x to the m falling," if we have to read it

aloud; similarly, xm is \x to the m rising." These functions are also called

falling factorial powers and rising factorial powers, since they are closely related to the factorial functionn! =n(n−1). . .(1). In fact,n! =nn =1n.

Several other notations for factorial powers appear in the mathematical

literature, notably \Pochhammer's symbol" (x)m for xm or xm; notations Mathematical

terminology is sometimes crazy: Pochhammer [293] actually used the notation(x)m for the binomial coecientąx

m ć

, not for factorial powers. likex(m)orx

(m)are also seen forxm. But the underline/overline convention is catching on, because it's easy to write, easy to remember, and free of redundant parentheses.

Falling powersxm are especially nice with respect to. We have

∆(xm) = (x+1)mxm

= (x+1)x . . .(x−m+2) − x . . .(x−m+2)(x−m+1) = m x(x−1). . .(x−m+2),

hence the nite calculus has a handy law to matchD(xm) =mxm−1:

∆(xm) = mxm−1. (2.45)

This is the basic factorial fact.

The operator D of innite calculus has an inverse, the anti-derivative (or integration) operatorR. The Fundamental Theorem of Calculus relatesD toR:

g(x) = Df(x) if and only if Z

g(x)dx = f(x) +C .

HereRg(x)dx, the indenite integral of g(x), is the class of functions whose derivative is g(x). Analogously, ∆ has as an inverse, the anti-dierence (or

\Quemadmodum ad dierentiam denotandam usi sumus signo ∆, ita summam indi- cabimus signoΣ.

. . . ex quo quatio

z = ∆y, si inver- tatur, dabit quoque

y=Σz+C." | L. Euler [110] summation) operatorP; and there's another Fundamental Theorem:

g(x) = ∆f(x) if and only if Xg(x)δx = f(x) +C . (2.46) Here Pg(x)δx, the indenite sum of g(x), is the class of functions whose dierence is g(x). (Notice that the lowercase δ relates to uppercase ∆ as drelates toD.) The \C" for indenite integrals is an arbitrary constant; the \C" for indenite sums is any function p(x)such thatp(x+1) =p(x). For

example,Cmight be the periodic function a+bsin2πx; such functions get washed out when we take dierences, just as constants get washed out when we take derivatives. At integer values ofx, the functionCis constant.

Now we're almost ready for the punch line. Innite calculus also has denite integrals: Ifg(x) =Df(x), then

Zb a g(x)dx = f(x) ¯ ¯ ¯b a = f(b) −f(a).

Therefore nite calculus | ever mimicking its more famous cousin | has def- inite sums: Ifg(x) =∆f(x), then

Xb ag(x)δx = f(x) ¯ ¯ ¯b a = f(b) −f(a). (2.47)

This formula gives a meaning to the notationPbag(x)δx, just as the previous

formula denesRbag(x)dx. But what does Pb

ag(x)δxreally mean, intuitively? We've dened it by

analogy, not by necessity. We want the analogy to hold, so that we can easily remember the rules of nite calculus; but the notation will be useless if we don't understand its signicance. Let's try to deduce its meaning by looking rst at some special cases, assuming thatg(x) =∆f(x) =f(x+1) −f(x). If b=a, we have

Xa

ag(x)δx = f(a) −f(a) = 0 .

Next, ifb=a+1, the result is Xa+1

a g(x)δx = f(a+1) −f(a) = g(a).

More generally, ifbincreases by 1, we have Xb+1 a g(x)δx − Xb ag(x)δx = ¡ f(b+1) −f(a)¢−¡f(b) −f(a)¢ = f(b+1) −f(b) = g(b).

These observations, and mathematical induction, allow us to deduce exactly whatPb

ag(x)δx means in general, whenaandbare integers withba:

Xb ag(x)δx = bX−1 k=a g(k) = X ak<b g(k), for integersba. (2.48)

In other words, the denite sum is the same as an ordinary sum with limits, You call this a

Let's try to recap this in a slightly dierent way. Suppose we've been given an unknown sum that's supposed to be evaluated in closed form, and suppose we can write it in the formPak<bg(k) =

Pb

ag(x)δx. The theory

of nite calculus tells us that we can express the answer as f(b) −f(a), if we can only nd an indenite sum or anti-dierence function f such that g(x) = f(x+1) −f(x). One way to understand this principle is to write P

ak<bg(k)out in full, using the three-dots notation:

X

ak<b

¡

f(k+1) −f(k)¢ = ¡f(a+1) −f(a)¢+¡f(a+2) −f(a+1)¢+· · · +¡f(b−1) −f(b−2)¢+¡f(b) −f(b−1)¢. Everything on the right-hand side cancels, exceptf(b) −f(a); sof(b) −f(a) is the value of the sum. (Sums of the form Pak<b

¡

f(k+1) −f(k)¢ are often called telescoping, by analogy with a collapsed telescope, because the

thickness of a collapsed telescope is determined solely by the outer radius of And all this time I thought it was telescoping because it collapsed from a very long expression to a very short one. the outermost tube and the inner radius of the innermost tube.)

But rule (2.48) applies only whenba; what happens if b < a? Well, (2.47) says that we must have

Xb

ag(x)δx = f(b) −f(a)

= −¡f(a) −f(b)¢ = −Xa

bg(x)δx .

This is analogous to the corresponding equation for denite integration. A similar argument provesPb

a+

Pc b=

Pc

a, the summation analog of the iden-

tityRab+Rbc =Rca. In full garb, Xb ag(x)δx+ Xc bg(x)δx = Xc ag(x)δx , (2.49)

for all integersa,b, andc.

At this point a few of us are probably starting to wonder what all these

parallels and analogies buy us. Well for one, denite summation gives us a Others have been wondering this for some time now. simple way to compute sums of falling powers: The basic laws (2.45), (2.47),

and (2.48) imply the general law X 0k<n km = km+1 m+1 ¯ ¯ ¯ ¯ n 0 = n m+1 m+1, for integersm, n0. (2.50) This formula is easy to remember because it's so much like the familiar Rn

In particular, when m = 1 we have k1 = k, so the principles of nite

calculus give us an easy way to remember the fact that X

0k<n

k = n

2

2 = n(n−1)/2 .

The denite-sum method also gives us an inkling that sums over the range 0k < noften turn out to be simpler than sums over1kn; the former are justf(n) −f(0), while the latter must be evaluated asf(n+1) −f(1).

Ordinary powers can also be summed in this new way, if we rst express them in terms of falling powers. For example,

k2 = k2+k1, hence X 0k<n k2 = n 3 3 + n2 2 = 1 3n(n−1)(n−2+32) = 13n(n− 12)(n−1).

Replacingn byn+1 gives us yet another way to compute the value of our old friend n=

P

0knk2 in closed form.

With friends like

this. . . Gee, that was pretty easy. In fact, it was easier than any of the umpteen

other ways that beat this formula to death in the previous section. So let's try to go up a notch, from squares to cubes: A simple calculation shows that

k3 = k3+3k2+k1.

(It's always possible to convert between ordinary powers and factorial powers by using Stirling numbers, which we will study in Chapter 6.) Thus

X ak<b k3 = k4 4 +k 3+ k2 2 ¯ ¯ ¯ ¯ b a .

Falling powers are therefore very nice for sums. But do they have any other redeeming features? Must we convert our old friendly ordinary powers to falling powers before summing, but then convert back before we can do anything else? Well, no, it's often possible to work directly with factorial powers, because they have additional properties. For example, just as we have(x+y)2=x2+2xy+y2, it turns out that(x+y)2=x2+2x1y1+y2,

and the same analogy holds between(x+y)m and(x+y)m. (This \factorial

binomial theorem" is proved in exercise 5.37.)

So far we've considered only falling powers that have nonnegative expo- nents. To extend the analogies with ordinary powers to negative exponents,

we need an appropriate denition ofxm form < 0. Looking at the sequence

x3 = x(x−1)(x−2), x2 = x(x1),

x1 = x ,

x0 = 1 ,

we notice that to get from x3 to x2 to x1 to x0 we divide by x2, then

by x−1, then byx. It seems reasonable (if not imperative) that we should divide byx+1next, to get fromx0tox−1, thereby makingx−1=1/(x+1).

Continuing, the rst few negative-exponent falling powers are x−1 = 1 x+1, x−2 = 1 (x+1)(x+2), x−3 = 1 (x+1)(x+2)(x+3),

and our general denition for negative falling powers is

x−m = 1

(x+1)(x+2). . .(x+m), form > 0. (2.51)

(It's also possible to dene falling powers for real or even complexm, but we How can a complex number be even? will defer that until Chapter 5.)

With this denition, falling powers have additional nice properties. Per- haps the most important is a general law of exponents, analogous to the law

xm+n = xmxn

for ordinary powers. The falling-power version is

xm+n = xm(xm)n, integersmandn. (2.52)

For example,x2+3=x2(x2)3; and with a negativenwe have

x2−3 = x2(x−2)−3 = x(x−1) 1

(x−1)x(x+1) = 1

x+1 = x −1.

If we had chosen to dene x−1 as 1/x instead of as 1/(x+1), the law of

exponents (2.52) would have failed in cases likem= −1 andn=1. In fact, we could have used (2.52) to tell us exactly how falling powers ought to be

dened in the case of negative exponents, by setting m = −n. When an Laws have their exponents and their detractors. existing notation is being extended to cover more cases, it's always best to

Now let's make sure that the crucial dierence property holds for our newly dened falling powers. Does∆xm=mxm−1whenm < 0? Ifm= −2,

for example, the dierence is ∆x−2 = 1 (x+2)(x+3)− 1 (x+1)(x+2) = (x+1) − (x+3) (x+1)(x+2)(x+3) = −2x−3.

Yes | it works! A similar argument applies for allm < 0.

Therefore the summation property (2.50) holds for negative falling powers as well as positive ones, as long as no division by zero occurs:

Xb ax mδx = xm+1 m+1 ¯ ¯ ¯ ¯ b a , form6= −1.

But what about whenm= −1? Recall that for integration we use Zb a x−1dx = lnx ¯ ¯ ¯b a

whenm= −1. We'd like to have a nite analog of lnx; in other words, we

seek a functionf(x)such that x−1 = 1

x+1 = ∆f(x) = f(x+1) −f(x). It's not too hard to see that

f(x) = 1 1+ 1 2+· · ·+ 1 x

is such a function, whenxis an integer, and this quantity is just the harmonic numberHx of (2.13). Thus Hx is the discrete analog of the continuous lnx.

(We will deneHx for nonintegerxin Chapter 6, but integer values are good

enough for present purposes. We'll also see in Chapter 9 that, for largex, the value ofHx−lnxis approximately0.577+1/(2x). HenceHxand lnxare not

0.577exactly? Maybe they mean

1/3. Then again, maybe not.

only analogous, their values usually dier by less than1.)

We can now give a complete description of the sums of falling powers:

Xb ax mδx =        xm+1 m+1 ¯ ¯ ¯ ¯ b a , ifm6= −1; Hx ¯ ¯ ¯b a, ifm= −1. (2.53)

This formula indicates why harmonic numbers tend to pop up in the solutions to discrete problems like the analysis of quicksort, just as so-called natural logarithms arise naturally in the solutions to continuous problems.

Now that we've found an analog for lnx, let's see if there's one for ex.

What functionf(x)has the property that∆f(x) =f(x), corresponding to the identityDex=ex? Easy:

f(x+1) −f(x) = f(x) ⇐⇒ f(x+1) = 2f(x);

so we're dealing with a simple recurrence, and we can takef(x) =2x as the

discrete exponential function.

The dierence ofcx is also quite simple, for arbitraryc, namely

∆(cx) = cx+1cx = (c1)cx.

Hence the anti-dierence ofcx iscx/(c1), ifc6=1. This fact, together with

the fundamental laws (2.47) and (2.48), gives us a tidy way to understand the general formula for the sum of a geometric progression:

X ak<b ck = Xb ac xδx = cx c−1 ¯ ¯ ¯ ¯ b a = cb−ca c−1 , forc6=1.

Every time we encounter a function f that might be useful as a closed form, we can compute its dierence∆f=g; then we have a functiongwhose

indenite sum Pg(x)δx is known. Table 55 is the beginning of a table of `Table 55' is on page 55. Get it? dierence/anti-dierence pairs useful for summation.

Despite all the parallels between continuous and discrete math, some continuous notions have no discrete analog. For example, the chain rule of innite calculus is a handy rule for the derivative of a function of a function; but there's no corresponding chain rule of nite calculus, because there's no nice form for∆f¡g(x)¢. Discrete change-of-variables is hard, except in certain cases like the replacement ofxbyc±x.

However, ∆¡f(x)g(x)¢ does have a fairly nice form, and it provides us with a rule for summation by parts, the nite analog of what innite calculus calls integration by parts. Let's recall that the formula

D(uv) = u Dv+v Du

of innite calculus leads to the rule for integration by parts, Z

u Dv = uv− Z

Table 55 What's the dierence? f=Σg ∆f=g f=Σg ∆f=g x0=1 0 2x 2x x1=x 1 cx (c1)cx x2=x(x1) 2x cx/(c1) cx xm mxm−1 cf c∆f xm+1/(m+1) xm f+g ∆f+∆g Hx x−1=1/(x+1) f g f∆g+Eg∆f

after integration and rearranging terms; we can do a similar thing in nite calculus.

We start by applying the dierence operator to the product of two func- tionsu(x)andv(x):

∆¡u(x)v(x)¢ = u(x+1)v(x+1) −u(x)v(x) = u(x+1)v(x+1) −u(x)v(x+1)

+u(x)v(x+1) −u(x)v(x)

= u(x)∆v(x) + v(x+1)∆u(x). (2.54) This formula can be put into a convenient form using the shift operator E, dened by

Ef(x) = f(x+1).

Substituting Ev(x) for v(x+1) yields a compact rule for the dierence of a product:

∆(uv) = u ∆v + Ev ∆u . (2.55)

(The E is a bit of a nuisance, but it makes the equation correct.) Taking Innite calculus

avoids E here by

letting 1→0. the indenite sum on both sides of this equation, and rearranging its terms,yields the advertised rule for summation by parts: X

u ∆v = uv−XEv ∆u . (2.56)

As with innite calculus, limits can be placed on all three terms, making the indenite sums denite.

This rule is useful when the sum on the left is harder to evaluate than the one on the right. Let's look at an example. The functionRxexdxis typically

integrated by parts; its discrete analog is Px2xδx, which we encountered

I guess ex = 2x, for small values

u(x) = xand ∆v(x) = 2x; hence ∆u(x) =1, v(x) =2x, and Ev(x) =2x+1.

Plugging into (2.56) gives X

x2xδx = x2x X2x+1δx = x2x 2x+1 + C .

And we can use this to evaluate the sum we did before, by attaching limits:

n X k=0 k2k = Xn+1 0 x2 xδx = x2x2x+1 ¯¯¯n+1 0 = ¡(n+1)2n+1−2n+2¢− (0·20−21) = (n−1)2n+1+2 . It's easier to nd the sum this way than to use the perturbation method,

because we don't have to think. The ultimate goal

of mathematics is to eliminate all need for intelligent thought.

We stumbled across a formula for P0k<nHk earlier in this chapter,

and counted ourselves lucky. But we could have found our formula (2.36) systematically, if we had known about summation by parts. Let's demonstrate this assertion by tackling a sum that looks even harder, P0k<nkHk. The

solution is not dicult if we are guided by analogy with Rxlnx dx: We take u(x) =Hx and ∆v(x) =x= x1, hence ∆u(x) =x−1, v(x) =x2/2, Ev(x) =

(x+1)2/2, and we have X xHxδx = x

Related documents