# Formula for sum of first $n$ odd integers

I'm self-studying Spivak's Calculus and I'm currently going through the pages and problems on induction. This is my first encounter with induction and I would like for someone more experienced than me to give me a hint and direction. The first problem is as follows:

Find a formula for $$\sum_{i=1}^n(2i-1)=1+3+5+...+(2n-1)$$ And the related following problem:

Find a formula for $$\sum_{i=1}^n(2i-1)^2=1^2+3^2+5^2+...+(2n-1)^2$$

The given hints are: "What do these expressions have to do with $1+2+3+...+2n$ and $1^2+2^2+3^2+...+(2n)^2$?"

I recognize that the above sums are the sum of all the odd integers from $1$ to $n$ and the sum of all the squares of the odd integers from $1$ to $n$, respectively. My question is, in problems like these does one just do a bunch of trial and error, as I have done for quite a while now, or is there a more clever way to go about it?

• Please, try to make the titles of your questions more informative. E.g., Why does $a<b$ imply $a+c<b+c$? is much more useful for other users than A question about inequality. From How can I ask a good question?: Make your title as descriptive as possible. In many cases one can actually phrase the title as the question, at least in such a way so as to be comprehensible to an expert reader. You can find more tips for choosing a good title here. – Emre Jun 4 '16 at 13:09
• I should mention that we know that the formula for $1+2+3+...+n =\frac{n(n+1)}{2}$ – Kristoffer Gertz Jun 4 '16 at 13:11
• @Emre Got it, I will do so for my future questions. – Kristoffer Gertz Jun 4 '16 at 13:13
• Not a duplicate, but you should also check this question: math.stackexchange.com/questions/1806906/… – Emre Jun 4 '16 at 13:27

There is a simple rule: For any arithmetic progression, that is any series where the difference between consecutive elements is constant, the sum is equal to the number of elements, multiplied by the average between the first and the last element.

In your case, the first element is 1, the last element is 2n - 1, the average is n, there are n elements, therefore the sum is $n^2$.

$$1+3+5+...+(2n-1)=n\times\,n=n^2$$

• Nice! $\;\!\;\!$ – goblin Jun 5 '16 at 2:28
• The partitioning of $\mathbb{N}^2$ displayed here can be rigorously defined as the coimage of $\mathrm{max} : \mathbb{N}^2 \rightarrow \mathbb{N}$. I'm guessing there's generalizations of this idea in tropical geometry. – goblin Jun 5 '16 at 7:00

For example:

$$\sum_{i=1}^n(2i-1)=2\sum_{i=1}^ni-\sum_{i=1}^n1$$

Observe the last sum is just $\;1+1+...+1=n\;$ . Work this out and the other question, too.

## Hint:

$$\sum_{i=1}^n (2i-1)=\sum_{i=1}^{2n} i-\sum_{i=1}^n 2i$$ $$\sum_{i=1}^n (2i-1)^2=\sum_{i=1}^{2n} i^2-\sum_{i=1}^n (2i)^2$$

I guess you know the identities $\sum_{i=1}^n i=\frac{n(n+1)}2$,$\sum_{i=1}^n i^2=\frac{n(n+1)(2n+1)}6$. Now, try to write $\sum_{i=1}^n 2i$ in terms of $\sum_{i=1}^n i$.

Similarly, try to write $\sum_{i=1}^n (2i)^2$ in terms of $\sum_{i=1}^n i^2$.

Here is the rest, hover on the yellow block if you want to see:

$\sum_{i=1}^n (2i)^2=4\sum_{i=1}^n i^2\qquad\sum_{i=1}^n (2i)=2\sum_{i=1}^n i$

The hint suggests you know the formulas for $1+2+...+2n$ and $1^2+2^2+...(2n)^2$. The first one is obvious ($\sum_{k=1}^N k = N(N+1)/2$), the second one is a bit less.

Once you realised this, your two sums can easily be expressed as a function of these two formulas.

To some extent: yes, it is a matter of trial and error, but you can get quite educated about it. But I'll answer your question properly later on, because it is an important and good question and independent of the particular examples used to illustrate it.

With $\sum(2i-1)$, simply adding a few terms by hand shows you that the answer is $n^2$. Proving that the answer is $n^2$ is then just a matter of proving that going from $n=N$ to $n=N+1$ means adding $2N+1$ to the total, and going from $N^2$ to $(N+1)^2$ means adding $2N+1$ to the total… so if it's true for $n=N$ then it's true for $n=N+1$. That's the inductive step. As for the first term in the deduction, that depends on taste and personality. Some people like to think that the sum of the first 1 odd numbers is 1; others, that the sum of the first 0 odd numbers is 0. Each kind of person secretly despises the other.

On the other hand, it has to be said that Spivak seems not to want you to use induction here, if you are meant to use the knowledge that $1+2+3+...+n =\frac12{n(n+1)}$ (and where did that knowledge come from, pray, if not from induction?). All you do is take the total of all numbers up to $2n$ (ie. $\frac12{2n(2n+1)}$) and get rid of the even numbers by subtracting twice the total of all numbers up to $n$ (i.e. twice $\frac12{n(n+1)}$). Which, written out, is very easy and gives you $n^2$. But it is not induction.

If you happen to know $\sum{i^2}$ then the second question is much like the first (but remember to subtract four times the shorter series from the longer one, because of the squaring). This is also not anything to do with deduction.

So, then: "In problems like these does one just do a bunch of trial and error, as I have done for quite a while now, or is there a more clever way to go about it?".

Here are three approaches to finding the sums of series before starting to prove the result. It's good to have all of them available.

1. Know $\sum{i^a}$ for $a=0, 1, 2, 3$. It doesn't require much memorising. Then combine the sums for whatever you are being asked to find the sum of (including using the trick that Spivak is making you use here).
2. Note that $\sum{1}=n/1!$, $\sum{i}=n(n+1)/2!$, $\sum{i(i+1)}=n(n+1)(n+2)/3!$, $\sum{i(i+1)(i+2)}=n(n+1)(n+2)(n+3)/4!$, and so on for ever. The inductive proof of these is very easy and the patterns themselves are easy to memorise. Every polynomial can be expressed as the sum of multiples of these easily-summable pieces. In fact, this is the way I was first taught to work out $\sum{i^2}$.
3. Be brutal. Note that a sum of values of a polynomial of degree $a$ will be a polynomial of degree $a+1$. So, for instance taking a sum of squares, say that the sum is $ax^3+bx^2+cx+d$ and prove this by induction. As you go through the inductive proof, you will be forced to give values to the coefficients to make the induction work. In this way you can find the values of all the coefficients and prove the result, both at the same time.

And the other half of your "Trial and error?" question is this: sums based on consecutive numbers (1, 2, 3,... rather than 1, 3, 5,... or even 1, 2, 4, 5, 7, 8, 10,...) are always easier. So if you have a sum which - as in Spivak's exercise - doesn't take in all consecutive values of $i$, the first thing you should do is put it together from sums which are made of consecutive values. This is a skill (or an instinct) which helps in many areas of maths, notably combinatorics.

\begin{align} \sum_{i=1}^n (2i-1)&=\sum_{i=1}^n\binom i1+\binom {i-1}1\\ &=\binom {n+1}2+\binom n2\\ &=n^2\qquad\blacksquare\\ \sum_{i=1}^n(2i-1)^2&= \color{blue}{1^2}+\color{purple}{3^2}+\color{green}{5^2}+\cdots+\color{red}{(2n-1)^2}\\ &=\color{blue}{\binom 12+\binom 22}+ \color{purple}{\binom 32+\binom 42}+ \color{green}{\binom 52+\binom 62}+\cdots + \color{red}{\binom {2n-1}2+\binom {2n}2}\\ &=\sum_{r=1}^{2n}\binom r2\\ &=\binom {2n+1}3 =\frac {n(2n-1)(2n+1)}3\qquad\blacksquare\end{align}

One has

\begin{align}\sum_{i=1}^{2n} i&=\sum_{i =1}^{n}(2i-1)+\sum_{i=1}^n2i\\&=S+2\sum_{i=1}^ni\end{align}

Now assume we have proven (by induction...) that $\sum\limits_{i=1}^ni={n(n+1)\over 2}$ we can rewrite the above as

$$n(2n+1)=S+n(n+1)$$

Solving for $S$ we get

$$S=n^2$$

And we can do the same with the sum of squares

\begin{align}\sum_{i=1}^{2n} i^2&=\sum_{i =1}^{n}(2i-1)^2+\sum_{i=1}^n(2i)^2\\&=S+4\sum_{i=1}^ni^2\end{align}

Now we use $\sum\limits_{i=1}^ni^2={n(n+1)(2n+1)\over 6}$ to rewrite

$${2n(2n+1)(4n+1)\over 6}=S+4{n(n+1)(2n+1)\over 6}$$

Solving for $S$ we get

$$S={n(2n+1)\over 6}(8n+2-4n-4)={n(2n-1)(2n+1)\over 3}$$

• You're right ! I had forgotten a factor $4$ in the sum of squares. – marwalix Jun 4 '16 at 17:50