Sum of first n terms of an AP

Adding up the first nn terms of an arithmetic progression one by one works fine when nn is small, but it becomes painfully slow the moment nn runs into the hundreds or thousands. Karl Friedrich Gauss, as a schoolboy, is said to have spotted a shortcut for exactly this problem: pair the first and last term, the second and second-last, and so on — every pair adds up to the same total. That single trick is the seed of the sum formula for an AP, Sn=n2[2a+(n−1)d]S_n = \frac{n}{2}[2a+(n-1)d], which turns a long addition into one substitution. This article builds on the nnth-term formula from the CBSE Class 10 chapter Arithmetic Progressions. You already know how to find a single term ana_n; here you learn to add up a whole run of them at once, in two equivalent forms, and to move fluently between a sum SnS_n and an individual term ana_n.

The core insight

The sum of the first nn terms of an AP is nn times the average of its first and last term, Sn=n2(a+an)S_n=\tfrac{n}{2}(a+a_n), which expands to Sn=n2[2a+(n−1)d]S_n=\tfrac{n}{2}[2a+(n-1)d] when only aa and dd are known.

The core idea

An arithmetic progression (AP) is a list of numbers in which each term differs from the one before it by a fixed amount, the common difference dd. Denote the first term aa, and let SnS_n stand for the sum of its first nn terms — not any single term, but the running total. For any AP with first term aa and common difference dd, the sum of the first nn terms is

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

where: aa is the first term, dd is the common difference, nn is the number of terms being added, and SnS_n is their sum. The bracketed quantity 2a+(n−1)d2a+(n-1)d is exactly twice the average of the first and last term — the formula in disguise. If the last term ana_n (sometimes written ll) is already known, a shorter equivalent form avoids recomputing dd altogether:

Sn=n2(a+an).S_n = \frac{n}{2}\big(a + a_n\big).

where: aa is the first term and ana_n is the nnth (last) term being summed. This second form reads simply as "number of terms times the average of the first and last term," and it is the more convenient choice whenever a problem hands you the last term directly. The two forms are not independent facts to memorise separately — the second collapses into the first the instant you substitute an=a+(n−1)da_n = a+(n-1)d. Reach for Sn=n2[2a+(n−1)d]S_n=\tfrac{n}{2}[2a+(n-1)d] when you know aa, dd and nn but not the last term; reach for Sn=n2(a+an)S_n=\tfrac{n}{2}(a+a_n) when the last term is already sitting in front of you. A companion idea, tested just as often, links a sum back to a single term. Since SnS_n is the running total through the nnth term while Sn−1S_{n-1} stops one term earlier, their difference isolates that one term:

an=Sn−Sn−1.a_n = S_n - S_{n-1}.

where: SnS_n is the sum of the first nn terms and Sn−1S_{n-1} is the sum of the first n−1n-1 terms, so their difference is whatever got added last, namely ana_n. This relation is useful even when the AP's rule is not given explicitly, as long as a formula for SnS_n in terms of nn is known. The picture below shows why pairing works: stack the terms as bars of increasing height and lay a second, upside-down copy of the same staircase against it — together they tile a rectangle of constant height 2a+(n−1)d2a+(n-1)d and width nn, so twice the sum is that rectangle's area.

Figure
Bars for an AP staircase paired with an upside down copy forming a rectangle whose height is twice the average term and whose width is the number of terms
Pairing an AP staircase with its mirror image tiles a rectangle height 2a+(n-1)d baseline n columns, each pair summing to the same total forward staircase (the AP itself) reversed staircase (mirror copy) Together the two staircases fill a rectangle of area n times (2a+(n-1)d), so S_n is half of that.
Derivation AThe sum formula from pairing terms

The goal is to derive Sn=n2[2a+(n−1)d]S_n=\tfrac{n}{2}[2a+(n-1)d] from nothing more than writing the sum twice — once forwards and once backwards — and adding the two copies term by term, the same pairing trick young Gauss is said to have used on 1+2+⋯+1001+2+\cdots+100.

Step 1. Write SnS_n as the sum of the first nn terms in the usual forward order: Sn=a+(a+d)+(a+2d)+⋯+(a+(n−1)d)S_n = a + (a+d) + (a+2d) + \cdots + (a+(n-1)d), where the last term is an=a+(n−1)da_n = a+(n-1)d.

Step 2. Write the very same sum again, but list the terms in reverse order, from last to first: Sn=an+(an−d)+(an−2d)+⋯+aS_n = a_n + (a_n-d) + (a_n-2d) + \cdots + a. This is legal because addition does not care about order — it is still the same total SnS_n.

Step 3. Add the two equations together, position by position. The first terms of each give a+ana+a_n; the second terms give (a+d)+(an−d)=a+an(a+d)+(a_n-d) = a+a_n as well, since the +d+d and −d-d cancel; every subsequent pair collapses the same way, because whatever is added on one side is subtracted on the other. So every one of the nn columns contributes exactly a+ana+a_n, and adding the two copies of SnS_n gives 2Sn=n(a+an)2S_n = n(a+a_n).

Step 4. Divide both sides by 22: Sn=n2(a+an)S_n = \dfrac{n}{2}(a+a_n). Finally substitute an=a+(n−1)da_n = a+(n-1)d to reach the form used when the last term is not yet known: Sn=n2[a+a+(n−1)d]=n2[2a+(n−1)d]S_n = \dfrac{n}{2}\big[a + a + (n-1)d\big] = \dfrac{n}{2}\big[2a+(n-1)d\big], which is the formula stated above.

Worked example

Question. Find the sum of the first 20 terms of the AP 2,5,8,11,…2, 5, 8, 11, \ldots, and then use that sum together with S19S_{19} to recover the 20th term directly.

Step 1. Identify aa and dd. Here a=2a = 2 and d=5−2=3d = 5-2 = 3. We want S20S_{20}, so n=20n=20.

Step 2. Apply Sn=n2[2a+(n−1)d]S_n = \dfrac{n}{2}[2a+(n-1)d]: S20=202[2(2)+(20−1)(3)]=10[4+57]=10×61=610S_{20} = \dfrac{20}{2}\big[2(2)+(20-1)(3)\big] = 10\big[4+57\big] = 10\times 61 = 610. So the sum of the first 20 terms is 610\boxed{610}.

Step 3. Cross-check with the other form. The 20th term is a20=a+19d=2+19(3)=59a_{20} = a+19d = 2+19(3) = 59, so S20=202(a+a20)=10(2+59)=10×61=610S_{20} = \dfrac{20}{2}(a+a_{20}) = 10(2+59) = 10\times 61 = 610 — the same answer, confirming both forms agree.

Step 4. Recover a20a_{20} from two sums, without ever using the nnth-term formula. Compute S19=192[2(2)+(18)(3)]=192[4+54]=192(58)=19×29=551S_{19} = \dfrac{19}{2}\big[2(2)+(18)(3)\big] = \dfrac{19}{2}\big[4+54\big] = \dfrac{19}{2}(58) = 19\times 29 = 551. Then a20=S20−S19=610−551=59a_{20} = S_{20}-S_{19} = 610-551 = \mathbf{59}, exactly matching Step 3 and illustrating an=Sn−Sn−1a_n = S_n - S_{n-1} in action.

Competitive stretch

A problem may instead give you the sum and ask for nn. For the AP 9,17,25,…9,17,25,\ldots (here a=9a=9, d=8d=8), asking how many terms give Sn=636S_n=636 leads to 636=n2[18+8(n−1)]636=\dfrac{n}{2}[18+8(n-1)], which simplifies to 4n2+5n−636=04n^2+5n-636=0. Factoring gives (4n+53)(n−12)=0(4n+53)(n-12)=0, so n=12n=12 or the rejected negative root n=−534n=-\tfrac{53}{4}. Check: S12=122[18+11(8)]=6(106)=636S_{12}=\dfrac{12}{2}[18+11(8)]=6(106)=636. ✓

Common traps

  • Mixing up aa and ana_n. The first form uses aa (first term) inside 2a+(n−1)d2a+(n-1)d; the second form uses ana_n (last term) directly. Do not plug the last term into the slot meant for the first term.
  • Forgetting the n2\tfrac{n}{2} factor. Computing 2a+(n−1)d2a+(n-1)d correctly and then forgetting to multiply by n2\tfrac{n}{2} is one of the most common arithmetic slips.
  • Keeping the wrong root of the quadratic. When solving for nn from a given SnS_n, always discard negative or non-integer roots, because nn counts terms and must be a positive whole number.
  • Confusing SnS_n with ana_n. SnS_n is a cumulative total; ana_n is a single term. Using a sum formula where a term formula is needed (or the reverse) leads to the wrong equation entirely.

Ask the tutor: If a quadratic pops out while solving for nn and you are unsure which root to keep, ask the AI tutor to walk through the factoring and the reasoning for rejecting the invalid root.

Why does the pairing trick add the forward and reverse listing instead of just adding the terms directly?

Adding the terms directly is exactly what SnS_n already means, but doing it term by term for a large nn is slow. The trick is to write the very same total twice, once forwards and once backwards, and add those two copies of SnS_n together column by column. Every column then produces the same value, a+ana+a_n, because the +d+d steps in one listing exactly cancel the −d-d steps in the other. That turns a long, varying addition into one repeated value multiplied by nn, then halved because two copies of SnS_n were used.

How do I know which of the two sum formulas to use in a given problem?

Look at what the question already gives you. If you know the first term aa, the common difference dd, and the number of terms nn, but not the last term, use Sn=n2[2a+(n−1)d]S_n=\tfrac{n}{2}[2a+(n-1)d]. If the last term ana_n (or ll) is stated directly, or you can spot it quickly, use Sn=n2(a+an)S_n=\tfrac{n}{2}(a+a_n) instead — it saves a step because you skip finding dd altogether. Both forms always give the same answer since one follows from the other by substituting an=a+(n−1)da_n=a+(n-1)d.

If I am given Sn as a formula in n, can I find any term of the AP without knowing a and d?

Yes. Since an=Sn−Sn−1a_n=S_n-S_{n-1} holds for every AP regardless of what aa and dd are, you can find any term just by evaluating the given SnS_n formula at nn and at n−1n-1 and subtracting. This is especially handy when a problem states SnS_n as an algebraic expression in nn (for example Sn=3n2+2nS_n=3n^2+2n) without ever mentioning aa or dd explicitly; the first term itself is simply a1=S1a_1=S_1, since there is no S0S_0 to subtract.

Before this

Where this leads