Deriving the Formula for the Sum of an Arithmetic Progression (AP)

Understanding Arithmetic Progression (AP)

An arithmetic progression (AP) is a sequence of numbers such that the difference between any two consecutive terms is constant. This constant difference is known as the common difference (d).  

For example, the sequence 2, 5, 8, 11, ... is an AP with a common difference of 3.

Deriving the Formula

Let's consider an AP with the first term a_1 and a common difference d. The nth term of this AP is given by:

a_n = a_1 + (n-1)d

Now, let's denote the sum of the first n terms of this AP as S_n. We can write S_n as:

S_n = a_1 + (a_1 + d) + ... + (a_1 + (n-2)d) + (a_1 + (n-1)d)

We can also write S_n in reverse order:

S_n = (a_1 + (n-1)d) + (a_1 + (n-2)d) + ... + (a_1 + d) + a_1

Adding these two equations, we get:

2S_n = (2a_1 + (n-1)d) + (2a_1 + (n-1)d) + ... + (2a_1 + (n-1)d) (n times)

Simplifying:

2S_n = n * (2a_1 + (n-1)d)

Dividing both sides by 2:

S_n = (n/2) * [2a_1 + (n-1)d]

This is the formula for the sum of the first n terms of an arithmetic progression.

Watch the video if you still have any doubts :)


Comments

Post a Comment

Popular posts from this blog

Finding the Power of K-Size Subarrays: A Comprehensive Guide

AtCoder Beginner Contest 43: Problem A - Children and Candies Solved! (Two Approaches)