Let the first term of the AP be 'a' and the common difference be 'd'.
The sum of the first n terms of an AP is given by the formula:
S_n = n/2 * [2a + (n-1)d]
Given that the sum of the first four terms is 40:
S_4 = 4/2 * [2a + (4-1)d] = 2[2a + 3d] = 40
2a + 3d = 20 (Equation 1)
Given that the sum of the first 14 terms is 280:
S_14 = 14/2 * [2a + (14-1)d] = 7[2a + 13d] = 280
2a + 13d = 40 (Equation 2)
Subtracting Equation 1 from Equation 2:
(2a + 13d) - (2a + 3d) = 40 - 20
10d = 20
d = 2
Substitute d = 2 into Equation 1:
2a + 3(2) = 20
2a + 6 = 20
2a = 14
a = 7
Now we can find the sum of the first n terms:
S_n = n/2 * [2a + (n-1)d]
S_n = n/2 * [2(7) + (n-1)2]
S_n = n/2 * [14 + 2n - 2]
S_n = n/2 * [12 + 2n]
S_n = n(6 + n)
S_n = n^2 + 6n