Maths · Ch 5 · Topic 4 of 5Sum of n terms
Topic 4 of 5

Sum of the first n terms

About 70 minutes · 3 things to learn
By the end you can…
  • Derive S_n = n/2 [2a + (n − 1)d] and S_n = n/2 (a + l).
  • Find S_n, or find n (including from a quadratic in n, deciding whether one or both roots are valid), a or d from a given sum.
  • Find the sum of the first n natural numbers, of odd numbers and of multiples in a range; find a_n from S_n using a_n = S_n − S_(n−1); find the sum of the last k terms.

The story goes that a teacher once asked a class to add all the whole numbers from 1 to 100. One pupil, the young Carl Friedrich Gauss, is said to have answered in moments: 5050. He did not add faster than everyone else — he added smarter, by pairing the numbers. This topic turns his trick into a formula that adds up any AP.

Gauss's pairing idea

Write the sum forwards, then backwards underneath, and add each column:

S=1+2+3+⋯+100S=100+99+98+⋯+1\begin{aligned} S &= 1 + 2 + 3 + \cdots + 100 \\ S &= 100 + 99 + 98 + \cdots + 1 \end{aligned}

Every column adds to 101, and there are 100 columns. So 2S=100×1012S = 100 \times 101, which gives S=5050S = 5050. The same idea works for every AP.

Deriving the formula for SnS_n

Let SnS_n be the sum of the first n terms of an AP with first term a and common difference d.

Statement Reason
Sn=a+(a+d)+⋯+[a+(n−1)d]S_n = a + (a + d) + \cdots + [a + (n - 1)d] The first n terms written forwards. Call this (1).
Sn=[a+(n−1)d]+[a+(n−2)d]+⋯+aS_n = [a + (n - 1)d] + [a + (n - 2)d] + \cdots + a The same terms written backwards. Call this (2).
Each column of (1) and (2) adds to 2a+(n−1)d2a + (n - 1)d. The first column is a+[a+(n−1)d]a + [a + (n - 1)d]. Moving one column to the right adds d to the top term and takes d away from the bottom term, so the column total never changes.
2Sn=n[2a+(n−1)d]2S_n = n[2a + (n - 1)d] Adding (1) and (2): there are n columns, each with the same total.
Sn=n2[2a+(n−1)d]S_n = \dfrac{n}{2}[2a + (n - 1)d] Divide both sides by 2.
Sn=n2(a+l)S_n = \dfrac{n}{2}(a + l) 2a+(n−1)d=a+[a+(n−1)d]=a+l2a + (n - 1)d = a + [a + (n - 1)d] = a + l, where l=anl = a_n is the last of the n terms.

Which sum formula?

  • Use Sn=n2(a+l)S_n = \dfrac{n}{2}(a + l) when you know the last term of the terms being added. Here l must be the nth term — the last of these n terms, not the last term of some longer list.
  • Otherwise use Sn=n2[2a+(n−1)d]S_n = \dfrac{n}{2}[2a + (n - 1)d].

Two special sums: 1+2+3+⋯+n=n(n+1)21 + 2 + 3 + \cdots + n = \dfrac{n(n + 1)}{2} (here a=1a = 1, l=nl = n), and the first n odd numbers 1+3+5+⋯+(2n−1)=n2(1+2n−1)=n21 + 3 + 5 + \cdots + (2n - 1) = \dfrac{n}{2}(1 + 2n - 1) = n^2.

Finding n from a sum

Putting a known sum into the formula gives a quadratic in n. Solve it (factorise, as in Chapter 4) and test both roots:

  • A negative root, or one that is not a whole number, is rejected: n counts terms.
  • If both roots are positive whole numbers, the sum really is reached twice. This can happen only when the terms change sign (a and d have opposite signs): the terms between the two answers add up to 0. Then both are valid — unless the story rules one out (for example, it would need a negative number of objects in a row).

Quick reminder (Chapter 4). To factorise an2+bn+can^2 + bn + c, find two numbers whose product is a×ca \times c and whose sum is b, and split the middle term. For 2n2+3n−2302n^2 + 3n - 230: product −460-460, sum 3 → 23 and −20-20, so 2n2+23n−20n−230=(2n+23)(n−10)2n^2 + 23n - 20n - 230 = (2n + 23)(n - 10).

Going backwards: ana_n from SnS_n

The sum of the first n terms minus the sum of the first n−1n - 1 terms leaves the nth term:

an=Sn−Sn−1(n≥2),a1=S1a_n = S_n - S_{n-1} \quad (n \geq 2), \qquad a_1 = S_1

The sum of the last k terms

The last k of n terms are themselves an AP, from the (n−k+1)(n - k + 1)th term to the last term l. So their sum is k2(an−k+1+l)\dfrac{k}{2}(a_{n-k+1} + l). A second route: Sn−Sn−kS_n - S_{n-k}.

Visuals

Gauss pairing and the double staircase Top: S = 3 + 7 + 11 + 15 + 19. Row 'forwards': 3, 7, 11, 15, 19; under it row 'backwards': 19, 15, 11, 7, 3. A bracket round each of the 5 columns gives its total 22; a brace under them reads 'n columns'; each column = a + l. Caption: 5 columns × 22 = 110 = 2S, so S = 55. Box: 2S = n(a + l) → S = n/2 (a + l), the same as Sₙ = n/2 (a + l), and Sₙ = n/2 [2a + (n − 1)d]. Bottom: on a grid of 1-unit cells, 5 solid bars of heights 3, 7, 11, 15, 19 (forwards); on top of each a hatched bar from the backwards list (19, 15, 11, 7, 3), so every column reaches exactly 22 and together they make a rectangle 5 bars wide and 22 units high, labelled 'rectangle = 2S'. Arrows: width n = 5 along the bottom, height a + l = 22 up the side. S = 3 + 7 + 11 + 15 + 19 forwards 3 7 11 15 19 backwards 19 15 11 7 3 22 22 22 22 22 n columns each column = a + l 5 columns × 22 = 110 = 2S, so S = 55 2S = n(a + l) S = n 2 (a + l) Sn = n 2 (a + l) and, as l = a + (n − 1)d, Sn = n 2 [2a + (n − 1)d] forwards backwards rectangle = 2S 3 19 7 15 11 11 15 7 19 3 0 5 10 15 20 22 height a + l = 22 width n = 5
Gauss pairing and the double staircaseThe derivation as a picture: two copies of the sum fit together into a rectangle n by (a + l).
Formula card Formula card, two columns: formula and 'use it when…'. (1) any term: aₙ = a + (n − 1)d — any term; or find a, d or n. (2) sum: Sₙ = n/2 [2a + (n − 1)d] — sum when the last term is not known. (3) sum with last term: Sₙ = n/2 (a + l) — sum when l, the last of THESE n terms, is known. (4) from the end: kth term from the end = l − (k − 1)d — count back from the last term. (5) term from a sum: aₙ = Sₙ − Sₙ₋₁ (n ≥ 2), a₁ = S₁ — Sₙ given as a formula, a term asked. (6) three consecutive terms: 2b = a + c. Strip at the bottom: n must be a positive whole number — test every root. AP formula card formula use it when… (1) any term an = a + (n − 1)d any term; or find a, d or n (2) sum Sn = n 2 [2a + (n − 1)d] sum when the last term is not known (3) sum with last term Sn = n 2 (a + l) sum when l, the last of THESE n terms, is known (4) from the end kth term from the end = l − (k − 1)d count back from the last term (5) term from a sum an = Sn − Sn−1 (n 2) a1 = S1 Sn given as a formula, a term asked (6) three consecutive terms 2b = a + c three consecutive terms n must be a positive whole number — test every root
Formula cardEvery formula of the chapter on one card, each with the clue that tells you when to use it.

The AP explorer from Topic 3 opens here in its sum view. It shows the running total as each bar is added, and a "pair them up" button that folds the bars into Gauss's pairs.

AP explorer AP explorer at its start values a = 3, d = 4, n = 5, in the terms view: the AP 3, 7, 11, 15, 19; sliders for a, d and n; five bars of heights 3, 7, 11, 15 and 19 standing on a zero line, the third (11) outlined and labelled 'middle term'; read-out aₙ = a + (n − 1)d = 3 + (5 − 1) × 4 = 19. In the interactive version you move the sliders and the bars, the nth term, the middle term(s) and the sums update; a 'sum' view shows the running sum and how the terms pair up. AP explorer terms sum 3, 7, 11, 15, 19 a 3 d 4 n 5 0 10 20 3 7 11 15 19 middle term an = a + (n − 1)d = 3 + (5 − 1) × 4 = 19
AP explorer (interactive)Sₙ grow term by term and check that n/2 (a + l) gives the same total.

Worked examples

Worked example 1

A sum by each formula

Question. Find (a) the sum of the first 18 terms of the AP 14,19,24,…14, 19, 24, \ldots (b) 50+46+42+⋯+(−18)50 + 46 + 42 + \cdots + (-18).

Given: (a) a=14a = 14, d=5d = 5, n=18n = 18 (b) a=50a = 50, d=−4d = -4, last term l=−18l = -18. Asked: each sum.

Concept used: Sn=n2[2a+(n−1)d]S_n = \dfrac{n}{2}[2a + (n - 1)d] when l is unknown; Sn=n2(a+l)S_n = \dfrac{n}{2}(a + l) when l is known. Why it applies: in (a) the last term is not given; in (b) it is, but n is not.

  1. 1

    (a)

    Substitute into Sn=n2[2a+(n−1)d]S_n = \dfrac{n}{2}[2a + (n - 1)d].

    S18=182[2×14+17×5]S_{18} = \dfrac{18}{2}[2 \times 14 + 17 \times 5]
  2. 2

    Work out the bracket.

    S18=9[28+85]S_{18} = 9[28 + 85]
  3. 3

    Add, then multiply.

    S18=9×113=1017S_{18} = 9 \times 113 = 1017
  4. 4

    (b)

    Find n from l=a+(n−1)dl = a + (n - 1)d.

    −18=50+(n−1)(−4)-18 = 50 + (n - 1)(-4)
  5. 5

    Subtract 50 from both sides.

    −68=(n−1)(−4)-68 = (n - 1)(-4)
  6. 6

    Divide by −4-4.

    17=n−117 = n - 1
  7. 7

    Add 1.

    n=18n = 18
  8. 8

    Now use Sn=n2(a+l)S_n = \dfrac{n}{2}(a + l).

    S18=182(50+(−18))=9×32=288S_{18} = \dfrac{18}{2}(50 + (-18)) = 9 \times 32 = 288
  9. Check: (a) a18=14+17×5=99a_{18} = 14 + 17 \times 5 = 99, and 182(14+99)=9×113=1017\dfrac{18}{2}(14 + 99) = 9 \times 113 = 1017 ✔. (b) the other formula: 9[100+17×(−4)]=9×32=2889[100 + 17 \times (-4)] = 9 \times 32 = 288 ✔.

  10. Answer (a) 1017 (b) 288

    Common trap: In (b), using n=17n = 17 (from 684\dfrac{68}{4}) and forgetting to add 1. Then 172(50−18)=272\dfrac{17}{2}(50 - 18) = 272 — the count is one short.

Worked example 2

Finding n: one root or both?

Question. (a) How many terms of the AP 5,9,13,…5, 9, 13, \ldots are needed to make a sum of 230? (b) How many terms of the AP 30,26,22,…30, 26, 22, \ldots are needed to make a sum of 120? Explain your answer.

Given: (a) a=5a = 5, d=4d = 4, Sn=230S_n = 230 (b) a=30a = 30, d=−4d = -4, Sn=120S_n = 120. Asked: n.

Concept used: Sn=n2[2a+(n−1)d]S_n = \dfrac{n}{2}[2a + (n - 1)d] gives a quadratic in n; test both roots. Why it applies: n is unknown and appears twice in the formula.

  1. 1

    (a)

    Substitute.

    230=n2[10+(n−1)×4]230 = \dfrac{n}{2}[10 + (n - 1) \times 4]
  2. 2

    Simplify the bracket: 10+4n−4=4n+610 + 4n - 4 = 4n + 6.

    230=n2(4n+6)230 = \dfrac{n}{2}(4n + 6)
  3. 3

    Divide 4n+64n + 6 by 2.

    230=n(2n+3)230 = n(2n + 3)
  4. 4

    Expand the bracket.

    230=2n2+3n230 = 2n^2 + 3n
  5. 5

    Subtract 230 from both sides.

    2n2+3n−230=02n^2 + 3n - 230 = 0
  6. 6

    Factorise (2×(−230)=−460=23×(−20)2 \times (-230) = -460 = 23 \times (-20), and 23−20=323 - 20 = 3).

    (2n+23)(n−10)=0(2n + 23)(n - 10) = 0
  7. 7

    So n=10n = 10 or n=−232n = -\dfrac{23}{2}. A number of terms cannot be negative (or a fraction), so reject −232-\dfrac{23}{2}.

  8. 8

    (b)

    Substitute.

    120=n2[60+(n−1)(−4)]120 = \dfrac{n}{2}[60 + (n - 1)(-4)]
  9. 9

    Simplify the bracket: 60−4n+4=64−4n60 - 4n + 4 = 64 - 4n.

    120=n2(64−4n)120 = \dfrac{n}{2}(64 - 4n)
  10. 10

    Divide 64−4n64 - 4n by 2.

    120=n(32−2n)120 = n(32 - 2n)
  11. 11

    Expand the bracket.

    120=32n−2n2120 = 32n - 2n^2
  12. 12

    Add 2n22n^2 and subtract 32n32n on both sides.

    2n2−32n+120=02n^2 - 32n + 120 = 0
  13. 13

    Divide every term by 2.

    n2−16n+60=0n^2 - 16n + 60 = 0
  14. 14

    Factorise.

    (n−6)(n−10)=0(n - 6)(n - 10) = 0
  15. 15

    So n=6n = 6 or n=10n = 10. Both are positive whole numbers, so test both: S6=3(60−20)=120S_6 = 3(60 - 20) = 120 ✔ and S10=5(60−36)=120S_{10} = 5(60 - 36) = 120 ✔. Both are valid.

  16. 16

    Why? The 7th to 10th terms are 6,2,−2,−66, 2, -2, -6, which add up to 0. So adding them leaves the sum at 120.

  17. Check: (a) S10=5[10+36]=5×46=230S_{10} = 5[10 + 36] = 5 \times 46 = 230 ✔.

  18. Answer (a) 10 terms (b) 6 terms or 10 terms — both give 120, because terms 7 to 10 add up to 0.

    Common trap: In (b), rejecting n=10n = 10 "because only one answer is allowed". Reject a root only for a reason: negative, not whole, or impossible in the story.

Worked example 3

Finding d or a from a sum

Question. (a) The first term of an AP is 13 and the sum of its first 12 terms is 486. Find the common difference and the 12th term. (b) The common difference of an AP is −3-3 and the sum of its first 10 terms is 25. Find the first term.

Given: (a) a=13a = 13, n=12n = 12, S12=486S_{12} = 486 (b) d=−3d = -3, n=10n = 10, S10=25S_{10} = 25. Asked: (a) d and a12a_{12} (b) a.

Concept used: Sn=n2[2a+(n−1)d]S_n = \dfrac{n}{2}[2a + (n - 1)d] with one unknown. Why it applies: three of the four quantities S, a, d, n are known.

  1. 1

    (a)

    Substitute.

    486=122[26+11d]486 = \dfrac{12}{2}[26 + 11d]
  2. 2

    122=6\dfrac{12}{2} = 6; divide both sides by 6.

    81=26+11d81 = 26 + 11d
  3. 3

    Subtract 26.

    55=11d55 = 11d
  4. 4

    Divide by 11.

    d=5d = 5
  5. 5

    The 12th term: a12=13+11×5=68a_{12} = 13 + 11 \times 5 = 68.

  6. 6

    (b)

    Substitute.

    25=102[2a+9×(−3)]25 = \dfrac{10}{2}[2a + 9 \times (-3)]
  7. 7

    Simplify: 102=5\dfrac{10}{2} = 5 and 9×(−3)=−279 \times (-3) = -27.

    25=5(2a−27)25 = 5(2a - 27)
  8. 8

    Divide both sides by 5.

    5=2a−275 = 2a - 27
  9. 9

    Add 27.

    32=2a32 = 2a
  10. 10

    Divide by 2.

    a=16a = 16
  11. Check: (a) 122(13+68)=6×81=486\dfrac{12}{2}(13 + 68) = 6 \times 81 = 486 ✔. (b) the AP is 16,13,10,…16, 13, 10, \ldots; a10=16−27=−11a_{10} = 16 - 27 = -11 and 102(16−11)=25\dfrac{10}{2}(16 - 11) = 25 ✔.

  12. Answer (a) d=5d = 5, a12=68a_{12} = 68 (b) a=16a = 16

    Common trap: In (b), writing 9×(−3)9 \times (-3) as +27+27, which gives 2a+27=52a + 27 = 5 and a=−11a = -11 — that is the last term, not the first.

Worked example 4

The sum of multiples of two numbers

Question. Find the sum of all the integers between 1 and 300 that are multiples of both 6 and 8.

Given: the range 1 to 300; divisors 6 and 8. Asked: the sum.

Concept used: multiples of both 6 and 8 are multiples of LCM(6, 8); they form an AP; then Sn=n2(a+l)S_n = \dfrac{n}{2}(a + l). Why it applies: first and last terms are easy to find.

  1. 1

    6=2×36 = 2 \times 3 and 8=238 = 2^3, so LCM(6,8)=23×3=24\text{LCM}(6, 8) = 2^3 \times 3 = 24.

  2. 2

    The multiples of 24 between 1 and 300 are 24,48,…,28824, 48, \ldots, 288 (since 24×12=28824 \times 12 = 288 and 24×13=312>30024 \times 13 = 312 > 300).

  3. 3

    Number of terms: put l=288l = 288.

    288=24+(n−1)×24288 = 24 + (n - 1) \times 24
  4. 4

    Subtract 24 from both sides.

    264=(n−1)×24264 = (n - 1) \times 24
  5. 5

    Divide by 24.

    11=n−111 = n - 1
  6. 6

    Add 1.

    n=12n = 12
  7. 7

    Sum.

    S12=122(24+288)S_{12} = \dfrac{12}{2}(24 + 288)
  8. 8

    Work it out.

    S12=6×312=1872S_{12} = 6 \times 312 = 1872
  9. Check: 24+48+⋯+288=24×(1+2+⋯+12)=24×78=187224 + 48 + \cdots + 288 = 24 \times (1 + 2 + \cdots + 12) = 24 \times 78 = 1872 ✔.

  10. Answer 1872

    Common trap: Using 6×8=486 \times 8 = 48: the list 48,96,…,28848, 96, \ldots, 288 has 6 terms and sum 1008 — it misses 24, 72, 120, 168, 216 and 264.

Worked example 5

The nth term from a formula for SnS_n

Question. The sum of the first n terms of an AP is Sn=2n2+11nS_n = 2n^2 + 11n. Find the first term, the common difference and the 15th term.

Given: Sn=2n2+11nS_n = 2n^2 + 11n. Asked: a, d and a15a_{15}.

Concept used: a1=S1a_1 = S_1 and an=Sn−Sn−1a_n = S_n - S_{n-1}. Why it applies: subtracting the sum of the first n−1n - 1 terms from the sum of the first n leaves the nth term.

  1. 1

    First term.

    a1=S1=2(1)2+11(1)=13a_1 = S_1 = 2(1)^2 + 11(1) = 13
  2. 2

    S2=2(4)+22=30S_2 = 2(4) + 22 = 30, so a2=S2−S1=30−13=17a_2 = S_2 - S_1 = 30 - 13 = 17.

  3. 3

    Common difference: d=a2−a1=17−13=4d = a_2 - a_1 = 17 - 13 = 4.

  4. 4

    General term (for n≥2n \geq 2).

    an=[2n2+11n]−[2(n−1)2+11(n−1)]a_n = [2n^2 + 11n] - [2(n - 1)^2 + 11(n - 1)]
  5. 5

    Expand the second bracket: 2(n2−2n+1)+11n−11=2n2+7n−92(n^2 - 2n + 1) + 11n - 11 = 2n^2 + 7n - 9.

    an=2n2+11n−2n2−7n+9a_n = 2n^2 + 11n - 2n^2 - 7n + 9
  6. 6

    Collect like terms.

    an=4n+9a_n = 4n + 9
  7. 7

    This also gives a1=4+9=13a_1 = 4 + 9 = 13 ✔, so it holds for every n. The 15th term: a15=4×15+9=69a_{15} = 4 \times 15 + 9 = 69.

  8. Check: with a=13a = 13 and d=4d = 4, the sum formula gives Sn=n2[26+4(n−1)]=n2(4n+22)=2n2+11nS_n = \dfrac{n}{2}[26 + 4(n - 1)] = \dfrac{n}{2}(4n + 22) = 2n^2 + 11n ✔.

  9. Answer a=13a = 13, d=4d = 4, a15=69a_{15} = 69 (and an=4n+9a_n = 4n + 9)

    Common trap: Putting n=15n = 15 into SnS_n: 2(225)+165=6152(225) + 165 = 615 is the sum of the first 15 terms, not the 15th term.

Worked example 6

The sum of the last k terms

Question. The AP 9,12,15,…9, 12, 15, \ldots has 40 terms. Find the sum of its last 12 terms.

Given: a=9a = 9, d=3d = 3, n=40n = 40. Asked: the sum of the last 12 terms.

Concept used: the last 12 terms are an AP from the (40−12+1)=29(40 - 12 + 1) = 29th term to the 40th term. Why it applies: we can find both ends of that AP.

  1. 1

    The last term.

    l=a40=9+39×3=126l = a_{40} = 9 + 39 \times 3 = 126
  2. 2

    The first of the last 12 terms is the 29th term.

    a29=9+28×3=93a_{29} = 9 + 28 \times 3 = 93
  3. 3

    Sum of these 12 terms.

    122(93+126)=6×219=1314\dfrac{12}{2}(93 + 126) = 6 \times 219 = 1314
  4. Check (second route): S40−S28S_{40} - S_{28}. S40=20(9+126)=2700S_{40} = 20(9 + 126) = 2700; a28=90a_{28} = 90, so S28=14(9+90)=1386S_{28} = 14(9 + 90) = 1386; 2700−1386=13142700 - 1386 = 1314 ✔.

  5. Answer 1314

    Common trap: Starting the last 12 terms at the 28th term (40−12=2840 - 12 = 28). From the 28th to the 40th there are 13 terms, not 12.

6 examples · they get harder as you go

Quick check

Answer without scrolling up
Quick check · 1 of 4MCQ1 mark

The sum of the first 20 terms of the AP 2,5,8,…2, 5, 8, \ldots is:

Quick check · 2 of 4Very short answer1 mark

For an AP, Sn=n2+4nS_n = n^2 + 4n. Find a5a_5.

Quick check · 3 of 4Very short answer1 mark

Find 1+2+3+⋯+601 + 2 + 3 + \cdots + 60.

Quick check · 4 of 4Short answer3 marks

Without looking back, derive Sn=n2[2a+(n−1)d]S_n = \dfrac{n}{2}[2a + (n - 1)d], and use it to show Sn=n2(a+l)S_n = \dfrac{n}{2}(a + l). (3 marks)

Key points

  • Sn=n2[2a+(n−1)d]=n2(a+l)S_n = \dfrac{n}{2}[2a + (n - 1)d] = \dfrac{n}{2}(a + l) — derived by adding the sum to itself written backwards.
  • Use n2(a+l)\dfrac{n}{2}(a + l) only when l is the last of the n terms you are adding.
  • 1+2+⋯+n=n(n+1)21 + 2 + \cdots + n = \dfrac{n(n + 1)}{2}; 1+3+⋯+(2n−1)=n21 + 3 + \cdots + (2n - 1) = n^2.
  • A sum gives a quadratic in n: reject a root only for a reason; when both roots are positive whole numbers (terms change sign), both can be valid.
  • an=Sn−Sn−1a_n = S_n - S_{n-1} for n≥2n \geq 2, and a1=S1a_1 = S_1.
  • Sum of the last k terms =k2(an−k+1+l)=Sn−Sn−k= \dfrac{k}{2}(a_{n-k+1} + l) = S_n - S_{n-k}.
My notesComing soon