Sub topic 4
Summing an AP: Two Forms of the Formula
Assume you can solve simple linear equations and recognise an arithmetic progression (AP). An AP is a sequence in which the difference between consecutive terms is constant. This constant is called the common difference, written as d.
For an AP, use:
afor the first termdfor the common differencenfor the number of termslfor the last termS_nfor the sum of the firstnterms
The two sum formulas
The first formula uses the first term and the common difference:
S_n = n/2 [2a + (n - 1)d]
The second formula uses the first and last terms:
S_n = n/2 (a + l)
You can use either formula. Choose the one that uses the information already given.
| Given information | Most useful formula |
|---|---|
| `a`, `d`, and `n` | `S_n = n/2 [2a + (n - 1)d]` |
| `a`, `l`, and `n` | `S_n = n/2 (a + l)` |
Why the formulas work
Write the AP forwards and backwards:
a, a + d, a + 2d, ..., l
l, l - d, l - 2d, ..., a
Adding corresponding terms gives a + l every time. There are n pairs, so adding both rows gives n(a + l). This counts the original sum twice. Therefore:
S_n = n(a + l)/2
The last term of an AP is:
l = a + (n - 1)d
Substituting this into the first formula gives:
S_n = n/2 [a + a + (n - 1)d]
So:
S_n = n/2 [2a + (n - 1)d]
Worked example
Find the sum of the first 10 terms of the AP:
3, 7, 11, 15, ...
Here, a = 3, d = 4, and n = 10. Use the first form:
S_10 = 10/2 [2(3) + (10 - 1)(4)]
S_10 = 5[6 + 36]
S_10 = 210
The tenth term is l = 3 + 9(4) = 39. Using the second form checks the answer:
S_10 = 10/2 (3 + 39) = 5(42) = 210
def ap_nth(a, d, n):
return a + (n - 1) * d
def ap_sum(a, d, n):
return n * (2 * a + (n - 1) * d) // 2
print(ap_nth(3, 4, 10)) # 39
print(ap_sum(3, 4, 10)) # 210Common errors and CAT checks
- Do not use
n/2as the number of terms. It is a multiplier applied to the bracket. - In the first formula, use
(n - 1)d, notnd. - If the last term is given, use
n/2(a + l)directly. - Check whether the number of terms is known. If only endpoints are given, first calculate
nusingl = a + (n - 1)d. - For a decreasing AP,
dis negative. Keep its sign throughout the calculation.
Exercise
Find the sum of all terms in the AP 12, 17, 22, ..., 97.
Show answer
There are n = 1 + (97 - 12)/5 = 18 terms. Thus S_n = 18/2(12 + 97) = 981.