# Sums

The sum of f(k) as k goes from m to n is given by \sum_{k=m}^{n}f(k)

## Parts of the Sum Expression To type the summation symbol, use the command \sum. The symbol is a capital sigma, however, compare the two symbols in your document.

Compare the summation symbol, $$\sum$$, to a capital sigma, $$\Sigma$$.

The sigma obtained with the \sum command is larger, so that there is more space for the limits of the sum.

The lower limit of the sum is added in subscript, indicated by an underscore. The upper limit of the sum is added in superscript, indicated by a caret. For example, the sum from the lower limit of k = 1 to the upper limit of 3 is obtained by

$$\sum_{k=1}^{3}$$

Remember, as always, to use curly braces to group characters in subscript and superscript.

Finally, the expression being summed can be typed next to the summation symbol. For example, if we are summing k squared from k = 1 to 3, we would type

$$\sum_{k=1}^{3}k^2$$

## Exercise 6.2.1

Typeset the expression for the sum of the first n numbers, ## Solution 6.2.1

The expression is typeset with the code

$\sum_{k=1}^{n}k = \frac{k(k+1)}{2}$

Remember to use curly braces to group the upper and lower limits of the sum, as well as the numerator and denominator in the fraction on the right-hand side.

## Display style for sums

Compare sums in inline and display mode. What differences do you notice between the two?

In display mode, the upper and lower limits are above and below the sigma, respectively. In contrast, the inline version puts the upper and lower limits next to the sigma. You may find that the display version is slightly more readable, with the limits more separate from the expression. If so, consider using \displaystyle when typesetting sums inline.

Inline style sum: Display style sum: 