You are on page 1of 12

Sum Uses of Calculus

David Altizio

October 18, 2020

Differentiation and integration are two powerful tools for handling various sums
that would be impenetrable with other methods. In this handout, we explore some
of these methods. This discussion concludes with a peek into the worlds of the
gamma function and the beta integral.
Thanks to Kevin Wu, Nathan Cho, and others for looking through this handout.

1 Introduction
It may not be so obvious that techniques from real analysis allow us to come to grips more
easily with sums, especially for people who come from the math contest world where these
techniques are not usually taught. It turns out, however, the exact opposite is true - devel-
opments in the continuous analytic world have done wonders to enhance our knowledge on
“discrete” objects such as summations!1 In this handout we’ll focus on deriving some of these
techniques and seeing some of their interesting applications.
As an introduction, we present the following proposition. It should hopefully persuade
you that this stuff is useful - it allows us to take a mildly-annoying computation and destroy
it very easily.

Proposition 1. Let P (x) be a polynomial with roots r1 , r2 , . . ., rk . Then

1 1 1 P 0 (x)
+ + ··· + =
x − r1 x − r2 x − rk P (x)

for every x with P (x) , 0.

Proof. All computations below are formal (so we don’t need to worry about domain restric-
tions). Write P (x) = a(x − r1 )(x − r2 ) · · · (x − rk ), where a is any complex number. Then

log P (x) = log a + log(x − r1 ) + log(x − r2 ) + · · · + log(x − rk ),

upon which taking the derivative of both sides yields

P 0 (x) 1 1 1
= + + ··· + .
P (x) x − r1 x − r2 x − rk

For example, if r, s, and t are the roots of the polynomial

P (x) = x3 − 2017x2 + 2018x − 2019,


1 Those with analysis background may see this as obvious, since sums are nothing more than integrals over the
counting measure....

1
Sum Uses of Calculus David Altizio Page 2

then
1 1 1 P 0 (1) 3 − 2 · 2017 + 2018 2013
+ + = = = .
1−r 1−s 1−t P (1) 1 − 2017 + 2018 − 2019 2017
Simple, right?

2 Power Series and Definitions


As stated in the previous section, to use the techniques of real analysis to evaluate sums we
first need to re-formulate them in ways that are amenable to analytic techniques. The key
observation is to note that real analysis is, first and foremost, a subject about functions. Thus,
one way to port the problem to an analytic setting is to define a function f (x) which equals
our sum at a given value of x. This way, we may instead find a closed form for f (x) and recover
our original sum as a corollary. The best way to do this, as it turns out, lies in the notion of
power series.

Definition 1. A power series (centered at 0) is an infinite series of the form



X
an zn = a0 + a1 z + a2 z2 + · · · ,
n=0

where ai ∈ C for all i ≥ 0.

An important question in this space is the question of when a given power series converges.
It is clear that any power series converges when z = 0, but a priori this may be the only value
of z for which the sum converges. While this exact question is difficult to answer, we can
relatively easily get an approximate answer which is often good enough.

Definition 2. The real number


!−1
1/n
R B lim sup |an | (1)
n→∞

is defined to be the radius of convergence of the power series. This quantity is so-named
because the power series converges normallya on {z : |z| < R} and diverges on the set
{z : |z| > R}.
a i.e. uniformly on every compact subset

(Here, lim sup is essentially a crossover between a limit and a supremum; see [2] for more
information. That being said, the exact value of the radius of convergence often isn’t so im-
portant, and often times you can determine it without appealing to the official definition.)
A note is in order. We’ll often be a bit relaxed about convergence issues in this handout,
and in most cases it’s clear that certain computations can be done without difficulty. But it’s
important to realize that not everything is as rosy as we would like!
Here is a silly yet classical example: what is the value of the series
S := 1 − 1 + 1 − 1 + 1 − 1 + · · ·?
On one hand, we may group the (2n − 1)st and (2n)th terms in the series together for every
n ≥ 1 to obtain
S = (1 − 1) + (1 − 1) + (1 − 1) + · · · = 0.
On the other hand, we may group the (2n)th and (2n + 1)st terms together for every n ≥ 1 to
obtain
S = 1 + (−1 + 1) + (−1 + 1) + · · · = 1.
Sum Uses of Calculus David Altizio Page 3

So if we’re not careful we deduce that 0 = 1!


The above example shows that we can’t always rearrange terms of sums (and therefore
power series) however we like and expect the value of the sum to be preserved.
Fortunately, there are cases where we don’t have to be so paranoid.

Definition 3. Let (an )n≥0 be a sequence of complex numbers. We say that the infinite
P P
series S := n≥0 an is absolutely convergent if n≥0 |an | < ∞. Series which are convergent
but not absolutely convergent are called conditionally convergent.

It turns out that absolutely convergent series are very nice: they allow us, for instance, to
swap the order of summation without affecting the value of the sum. The constraint that our
sums be absolutely convergent is not the weakest hypothesis we may impose, but it ends up
working in almost all cases.2

3 Common Power Series


As alluded to earlier, pretty much any summation is a power series in disguise. For example,
suppose we wanted to evaluate the sum ∞ 1
P
n=0 2n . One method of doing this is to consider the
function F defined by
X ∞
F(z) = zn
n=0

and observe that the sum we want to compute is F( 21 ). This may seem overkill, until we realize
this is exactly what we do when we cite the geometric series formula
a
a + ar + ar 2 + ar 3 + · · · = .
1−r
1
In particular, the function z 7→ 1−z is represented by the power series 1 + z + z2 + · · · whenever
|z| < 1.
So how do we find power series expansions for other functions? The answer lies in the
following theorem.

Theorem 1 (Taylor Series). Let f : C → C be a “sufficiently nice”a function. Then there


exists some R ∈ R+ ∪ {∞} such that whenever z is a complex number with |z| < R,

X f (n) (0) f 00 (0)z2
f (z) = zn = f (0) + f 0 (0)z + + ··· , (2)
n! 2
n=0

where f (n) (0) denotes the nth derivative of f evaluated at 0.


a The actual conditions are surprisingly tricky; for instance, infinitely differentiable is not enough.

Of course, we’re sweeping technical issues under the rug (as one should never do in analy-
sis...), but most of the series you’ll be working with in your lifetime should have Taylor series
in the way you expect.
We’ve already seen one example of a Taylor series above. The function F(z) = (1 − z)−1 has
nthderivative equal to F (n) (z) = n!(1 − z)−(n+1) ; plugging this into (2) above gives back the
geometric series formula. Here are a few other important ones.

2 For a more detailed analysis of these ideas, consult any measure theory or real analysis textbook.
Sum Uses of Calculus David Altizio Page 4

Example 1. The function F(z) = ez has nth derivative equal to F (n) (z) = ez , so Taylor’s
Formula gives
∞ n
z2 z3 X z
ez = 1 + z + + + · · · = .
2! 3! n!
n=0
By the Ratio Test, this sum converges for every complex number z; in particular, R = ∞.

Example 2. Let x be a real number. Plugging in z = ix into the previous example (re-
member, we have allowed our inputs to be complex!) yields

ix
X (ix)n
cos x + i sin x = e =
n!
n=0
(∗) X (ix)n X (ix)n
= +
n! n!
n≥0 even n≥0 odd
∞ 2k ∞ 2k+1
X x (−1)k X x (−1)k
= +i .
(2k)! (2k + 1)!
k=0 k=0

(Note that absolute convergence allows us to rearrange the sum as in (∗).) Setting the real
and imaginary parts equal gives us the two power series
∞ 2k+1
X x (−1)k x3 x5
sin x = =x− + − ···
(2k + 1)! 3! 5!
k=0

and
∞ 2k
X x (−1)k x2 x4
cos x = = 1− + − ··· .
(2k)! 2! 4!
k=0

(These results also hold when x is complex, but in order to understand them we need
a better notion of what the sine and cosine of a complex number actually are, which is
beyond the scope of this handout.)

Example 3 (Generalized Binomial Formula). Let α be any real number. The function
G(z) = (1 + z)α has nth derivative equal to

G(n) (z) = α(α − 1) · · · (α − n + 1)(1 + z)α−n .

Hence Taylor’s Formula implies



X α(α − 1) · · · (α − n + 1)
(1 + z)α = zn
n!
n=0

within some region of the form {|z| < R}, and via (1) we may compute R = 1. This is a
massive generalization of the normal Binomial Theorem!
As a specific example, let α = −k, where k is a positive integer. Remark that
! !
−k (−k)(−k − 1) · · · (−k − n + 1) n (k + n − 1)! n k+n−1
= = (−1) = (−1) .
n n! n!(k − 1)! n
Sum Uses of Calculus David Altizio Page 5

Thus we obtain the power series equality


∞ ! ∞ !
1 X
n k+n−1 n
X k+n−1 n
= (−1) (−z) = z .
(1 − z)k n=0 n
n=0
n

For k = 1 this gives back the geometric series formula as expected.

With even these rudimentary power sums we can solve some fairly sophisticated problems.

Example 4 ([2]). Show that



X 1 √
= e,
(2n)!!
n=0

where n!! = n(n − 2)(n − 4) · · · is the double factorial.

Proof. Write
1 1 1 1
= = = ,
(2n)!! (2n)(2n − 2) · · · (2) 2n (n)(n − 1) · · · (1) 2n n!
so that
∞ ∞
X (1/2)n √
X 1
= = e.
(2n)!! n!
n=0 n=0

Example 5 (Stanford 2013). Let



X sin nx
f (x) = .
n!
n=0

Compute f ( π3 ).

Proof. At first glance, the sum for f reminds us heavily of the power series expansion for ex .
In fact, we can directly use this power series expansion once we turn the sin nx terms into
power terms – i.e. terms of the form zn for some number z.
The key observation is to realize that sin nx is the imaginary part of einx . This means that

∞ 
X sin nx X einx 
 = = eeix .
 
= = 
n! n!

n=0 n=0

Now upon expanding


ix
ee = ecos x ei sin x = ecos x (cos sin x + i sin sin x),

3
we deduce that f (x) = ecos x sin sin x, and so f ( π3 ) = e1/2 sin 2 .

4 Manipulating Power Series


While power series are by themselves fairly useful, their true power shines through once we
start manipulating them. However, as we stated in the section on power series, we can’t always
manipulate power series in any way we want, so we need to be a bit careful.
Sum Uses of Calculus David Altizio Page 6

Recall that given any two power series n≥0 an zn and n≥0 bn zn , we can add and multiply
P P
them via X X X
an zn + bn z n = (an + bn )zn
n≥0 n≥0 n≥0
and   
X  X  X
n n

 a z
n 

 

  b z
n 
=
 (an b0 + an−1 b1 + · · · + a0 bn )zn .
n≥0 n≥0 n≥0
But it turns out that under certain circumstances we can differentiate and integrate power
series too!

Theorem 2 (Differentiation of Power Series). Let F : C → C be a function with power


series representation
X∞
F(z) B an z n .
n=0

which converges within some region R = {|z| < R} (so that the radius of convergence is R).
Then F is differentiable in R, and

X
F 0 (z) = nan zn−1 .
n=1

More strongly, F and F 0 have the same radius of convergence.

The proof of Theorem 2 is quite technical; see [1].

Theorem 3. Let F : R → R be a function with power series representation



X
F(x) B an x n .
n=0

which converges within some region R = {|x| < R}. Then an antiderivative G of F exists
within R, and

X xn+1
G(x) = G(0) + an .
n+1
n=0

Essentially the previous two theorems tell us that as long as our power series are “nice
enough”, we can differentiate and integrate them term by term.

Example 6. Differentiating the Binomial Theorem expansion


n ! n !
n
X n k X n k
(1 + z) = z = 1+ z
k k
k=0 k=1

yields
n !
n−1
X n k−1
n(1 + z) = k z .
k
k=1

In particular, setting z = 1 in the above equality gives the identity


n !
X n
k = n2n−1 .
k
k=1
Sum Uses of Calculus David Altizio Page 7

(Of course, it’s possible to evaluate the above sum using elementary methods, but having
multiple approaches to the same problem is never a bad thing!)

Example 7. Recalling the geometric power series

1
= 1 − z + z2 + · · · ,
1+z
we may integrate term by term to get

z2 z3
ln(1 + z) = C + z − + + ···
2 3
for some constant C. Plugging in z = 0 yields C = 0, and so we have the power series

z2 z3
ln(1 + z) = z − + + ··· . (3)
2 3

The above example is important because it shows us why the restriction |z| < R in Theorem
2 is important: we can’t necessarily predict convergence of our power series when |z| = R.
Indeed, plugging z = −1 into (3) yields a divergent sum, but plugging in z = 1 yields the
equality
1 1
1 − + − · · · = ln 2.
2 3

5 Surprise Integration
This idea of using calculus to aid in manipulations extends beyond simple power series - you
can use them in many other situations as well! Sometimes a sum is pesky to evaluate by itself,
but writing some term as the integral of some function makes it surprisingly easier to handle.
This is most easily seen in action, so here is an instructive example.

Example 8 (AwesomeMath Summer Program). Let n be a positive integer. Prove that


n n
2r − 1
! X
X 1 n
= . (4)
r r r
r=1 r=1

Proof. It’s not obvious how to explicitly compute either the left hand or right hand side of this
equality. We may be reminded of the Chairperson identity nr = nr n−1
 
r−1 , but unfortunately the
numerology doesn’t give us an exact match.
R1
Instead, we can notice the magical rewrite 1r = 0 xr−1 dx. This allows us to swap the sum
and the integral and use the Binomial Theorem to write
n !Z 1 Z 1X n Z1
(1 + x)n − 1
!
X n r−1 n r−1
x dx = x dx = dx.
r 0 0 r 0 x
r=1 r=1

This is somewhat promising, because the right hand side looks somewhat close to the right
hand side of (4)!
The next step is somewhat tricky, but several factors - for instance, the presence of the 2
and the lack of binomial coefficients on the right hand side of (4) - motivate the substitution
u = x + 1. Then du = dx, and so the integral we want becomes
Z2 n Z 2X n n Z 2 n
u −1 r−1
X
r−1
X 2r − 1
du = u dr = u dr = .
1 u −1 1 r=1 1
r=1 r=1
r
Sum Uses of Calculus David Altizio Page 8

We’re done.
R1
While this problem may seem fairly contrived, the manipulation 1r = 0 xr−1 dx is actually
surprisingly useful. Some more examples can be found at the end of the handout.

6 A More Involved Example


We conclude this handout with one last example. This example serves to both introduce some
important ideas in calculus and to bridge the gap between introductory examples and more
involved computations. (It also happened to be the inspiration for this handout!)

Example 9. Compute

X 1
2n
. (5)
n=0 n

At first glance, it is not obvious that this sum has a closed form, much less one that can be
computed by hand. It turns out that this closed form is actually relatively nice, which is a nice
surprise.
Before computing the above sum, however, we will need to introduce a strange function
that shows up a lot in higher mathematics.

Definition 4. For all complex numbers z with <(z) > 0, the Gamma function Γ (z) is
defined via Z∞
Γ (z) := e−x xz−1 dx.
0

The restriction <(z) > 0 is necessary for the integral to converge.3


R∞
Observe that Γ (1) = 0 e−x dx = 1. Additionally, for arbitrary complex z, a simple applica-
tion of Integration by Parts yields
Γ (z + 1) = zΓ (z)
(check this!). Combining these two facts yields Γ (n) = (n − 1)! for all positive integers n.
The Gamma function allows us to transform factorials into integrals, which definitely fits
the theme of this handout. But it’s not so obvious how this allows us to solve the problem
above. The answer lies in the following extremely useful lemma.

Lemma 1 (Beta Integral). For any positive real numbers p and q,


Z 1
Γ (p)Γ (q)
u p−1 (1 − u)q−1 du = . (6)
0 Γ (p + q)

The proof of this lemma is tricky and requires knowledge of multivariate calculus to un-
derstand. For the sake of completeness we present it here, but feel free to skip it if you want.

Proof. Write
Z ∞ Z ∞ Z ∞Z ∞
p−1 −x q−1 −y
Γ (p)Γ (q) = x e dx · y e dy = xp−1 y q−1 e−x e−y dx dy.
0 0 0 0

3 That being said, Γ admits a natural extension to C \ {0, −1, −2, . . .}. See any graduate complex analysis text for
details.
Sum Uses of Calculus David Altizio Page 9

Now make the unmotivated change of variables x = tu, y = t(1 − u). The Jacobian of this
transformation is t, and so the integral becomes
Z 1Z ∞ Z 1Z ∞
p−1 q−1 −tu −t(1−u)
(tu) (t(1 − u)) e e t dt du = t p+q−1 u p−1 (1 − u)q−1 e−t−1 dt du
0 0 0 0
Z1 ! Z1 !
p+q−1 −t−1 p−1 q−1
= t e dt u (1 − u) du
0 0
Z 1
= Γ (p + q) u p−1 (1 − u)q−1 du.
0

Huzzah.

In preparation for the forthcoming mathematics, we rewrite (5) as


∞ ∞
X 1 X n!n!
(2n)!
= .
(2n)!
n=0 n!n! n=0

The summand in the above equation reminds us of (6). Unfortunately, Γ (n) = (n − 1)!, not n!;
this means that
n!n! Γ (n + 1)Γ (n + 1)
= ,
(2n)! Γ (2n + 1)
and now the lemma does not apply since (n + 1) + (n + 1) , 2n + 1.
However, the equality (n + 1) + n = 2n + 1 is true, and so we can use the lemma provided
that one of those n! terms turns into an (n − 1)!. This amounts to dividing the nth term in the
summation by n, which we can do by taking the integral of an appropriate power series.

Proof. Define the function F : [0, 1] → R via



X n!(n − 1)!
F(z) := zn .
(2n)!
n=1

A simple application of the ratio test tells us that the sum on the right converges for all |z| < 4;
Theorem 2 tells us that F 0 (z) is defined for |z| < 4. The requested sum is then 1 + F 0 (1).
Now observe that
Z 1
n!(n − 1)! n Γ (n + 1)Γ (n) n
z = z = t n−1 (z(1 − t))n dt.
(2n)! Γ (2n + 1) 0

Absolute convergence allows us to swap the order of the summation and the integral, and so
within a neighborhood of z = 1 we have
∞ ∞ Z 1
X n!(n − 1)! n
X
z = t n−1 (z(1 − t))n dt
(2n)! 0
n=1 n=1

Z 1X
= t n−1 (z(1 − t))n dt
0 n=1
Z 1 Z 1
z(1 − t) 1−t
= dt = dt.
0 1 − tz(1 − t) 0 t 2 − t + 1z
z z
p p
Evaluating this integral (details left to the interested reader) yields that F(z) = 2 4−z arctan 4−z
for all z where the sum makes sense.
Sum Uses of Calculus David Altizio Page 10

It remains to differentiate this with respect to z. Onep good way to do this is to recognize the
z
above expression as 2u(z) arctan u(z), where u(z) := 4−z . Then an application of the Chain
Rule yields " #
0 0 u(z)
F (z) = (2u(z) arctan u(z)) = 2 + arctan u(z) u 0 (z).
1 + u(z)2
√ √
3
Now u(1) = 3 and a simple computation gives u 0 (1) = 2 9 3 , so
 1  √
 √ 1  2 3 2 √ 1
3
F 0 (1) = 2  + arctan √ · = π 3+ .
 
1 + 1  9 27 3

3 3

All in all, we obtain the surprising result


∞ √
X 1 2
2n
= 1 + F 0 (1) = (18 + π 3) .
27
n=0 n

7 Problems
Some of these problems admit non-calculus methods to solve them; they are in this handout
because I feel the calculus apporach is sufficiently motivated.
1. (Stanford 2010) Evaluate

X 13k
ke−13 .
k!
k=0

2. (Putnam 2014) Prove that every nonzero coefficient of the Taylor series of (1 − x + x2 )ex
about x = 0 is a rational number whose numerator (in lowest terms) is either 1 or a prime
number. [This isn’t a sums problem so much as it is a test of power series manipulation.]
3. Compute

X (−1)n+1
n(n + 1)
n=1
P∞ zn+1
by deriving a closed form for n=1 n(n+1) .
4. Show that

X x2k+1 (−1)k
x3 x5
arctan x = x − + − ··· =
3 5 2k + 1
k=0
for all x with |x| < 1.
5. Some beta integral practice: use (6) to prove that
Z1
dx 128
√ = .
0 1 − x1/4 35

Although not strictly necessary, you may use Γ ( 12 ) = π if need be. (Try to prove this!)
6. (Berkeley 2018) Let
n
n 2k+1
X !
hn B .
k k+1
k=0
Find

X h n
.
n!
n=0
Sum Uses of Calculus David Altizio Page 11

7. (Harvard-MIT 2005) Compute



X 4
.
(4k)!
k=0

8. (Stanford 2012) Evaluate


∞ X

X 1
.
nm(n + m + 1)
n=1 m=1
Pn 1
9. (Berkeley 2017) Define Hn = k=1 k . Evaluate
2017 !
X 2017
Hn (−1)n .
n
n=1

10. Determine the value of


n
X n
k
lim .
n→∞ nk (k + 3)
k=0

11. (Putnam 1967) Show that the sum of the first n terms in the binomial expansion of
(2 − 1)−n is 21 , where n is a positive integer.
12. (USA TST 2001) Express
n
X
(−1)k (n − k)!(n + k)!
k=0
in closed form.
1 2n
13. Let Cn := n+1 n denote the nth Catalan number. Show that
∞ √
X 1 4 3π
= 2+ .
Cn 27
n=0

14. Calculate !
1 1 1 1
lim + + + ··· + .
n→∞ 2 · 4 5 · 7 8 · 10 (3n − 1)(3n + 1)
15. (USA TST 2000) Let n be a positive integer. Prove that
!−1 !−1 !−1
n + 1 2 22 2n+1
!
n n n
+ + ··· + = n+1 + + ··· + .
0 1 n 2 1 2 n+1
P∞ 1 π2
16. (Stanford 2014) Given that n=1 n2 = 6 , compute the sum

X 1
.
2 n2
n
n=1

17. (Putnam 1981/Canada-USA Mathcamp 2017, generalized) For p a prime, let sp (n) be
the sum of the digits of n in its base-p representation. Compute the sum

X sp (n)
.
n(n + 1)
n=1

18. (Putnam 2005) Let Sn denote the set of all permutations of the numbers 1, 2, . . . , n. For
π ∈ Sn , let σ (π) = 1 if π is an even permutation and σ (π) = −1 if π is an odd permutation.
Also, let v(π) denote the number of fixed points of π. Show that
X σ (π) n
= (−1)n+1 .
v(π) + 1 n+1
π∈Sn
Sum Uses of Calculus David Altizio Page 12

References
[1] Proof of the Differentiation Theorem: Reed College Course Notes for Math 111 and Math
112. http://people.reed.edu/˜mayer/math112.html/html2/node40.html#difffpff
[2] Joy of Mathematics: a blog by Apostolos Koudouklas. https://www.math.tolaso.com.
gr/
[3] Limit superior and limit inferior: Wikipedia. https://en.wikipedia.org/wiki/
Limit_superior_and_limit_inferior

You might also like