Manipulating sums
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:
- Putting multiple things under a summation sign in LaTeX
- Simplifying sums by generalizing binomial coefficients
- A bit of notation from Iverson
- Changing variables in a sum
- Chebyshev polynomials come up again.
Let's get started. The equation I want to focus on is the following.
Putting things under a sum in LaTeXI 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
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:
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 functionsIt'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.
Change of variablesWe could get rid of the requirement that j is even by replacing j with 2k for a new variable k. Now our sum is
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 againGlennF 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.
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
If you don't like that definition, you could use another definition and the equation becomes a theorem.