Article 534XY Manipulating sums

Manipulating sums

by
John
from John D. Cook on (#534XY)

This post is a list of five spinoffs of my previous post. Except for the last point it doesn't build on the previous post per se, but I'll use a sum from that post to illustrate five things:

  1. Putting multiple things under a summation sign in LaTeX
  2. Simplifying sums by generalizing binomial coefficients
  3. A bit of notation from Iverson
  4. Changing variables in a sum
  5. Chebyshev polynomials come up again.

Let's get started. The equation I want to focus on is the following.

mansum1.svgPutting things under a sum in LaTeX

I said in the previous post that you could equate the real parts of the left and right side to show that cos n can be written as sums and products of cos and sin . To write this in LaTeX we'd say

mansum2.svg

The command that makes it possible to put two lines of stuff under the summation is \substack. Here's the LaTeX code that produce the summation sign and the text below it.

 \sum_{\substack{0 \leq j \leq n \\ j \text{ even}}}
Binomial coefficients

We can simply the sum by removing the limits on j and implicitly letting j run over all integers:

mansum3.svg

This is because the binomial coefficient term is zero when j > n or j < 0. (See this post for an explanation of more general binomial coefficients.)

Indicator functions

It's often helpful to turn a sum over a complicated region into a more complicated sum over a simpler region. That is, it's often easier to deal with complications in the summand than in the domain of summation.

In our case, instead of summing over even integers, we could sum over all integers, if we multiply the summand by a function that is 0 on odd numbers and 1 on even numbers. That is, we multiply by the indicator function of the even integers. The indicator function of a set is 1 on that set and 0 everywhere else.

Kenneth Iverson's notation uses a Boolean expression in brackets to indicate the function that is 1 if the condition is true and 0 otherwise. So [j even] means the function that is 1 when j is even and 0 when j is odd. So we could write our sum as follows.

mansum4.svg

Change of variables

We could get rid of the requirement that j is even by replacing j with 2k for a new variable k. Now our sum is

mansum5.svg

Notice a couple things. For one thing we were table to write (-1)k rather than i2k.

More importantly, the change of variables was trivial because the sum runs over all integers. If we had explicit limits on j, we would have to change them to different explicit limits on k.

Changing limits of summation is error-prone. This happens a lot, for example, when computing power series solutions for differential equations, and there are mnemonics for reducing errors such as limits and exponents move in opposite directions." These complications go away when you sum over all integers.

Chebyshev strikes again

GlennF left a comment on the previous post to the effect that the sum we've been talking about reduces to a Chebyshev polynomial.

Since the powers of sin are all even, we can replace sin^2 with 1 - cos^2 and get the following.

mansum6.svg

Now the left side is a polynomial in cos , call it P(cos ). Then P = Tn, the nth Chebyshev polynomial because as explained here, one way to define the Chebyshev polynomials is by

mansum7.svg

If you don't like that definition, you could use another definition and the equation becomes a theorem.

bVe34U5-a84
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments