Proof:
Let the A.P. have \(n\) terms. Given:
- First term \(a = t_1 = p\)
- Second term \(t_2 = q\)
- Last term \(t_n = r\)
Common difference \(d = t_2 - t_1 = q - p\) (with \(q \neq p\)).
Using the \(n\)th term formula \(t_n = a + (n - 1)d\):
\(r = p + (n - 1)(q - p)\)
\(r - p = (n - 1)(q - p)\)
\(n - 1 = \dfrac{r - p}{q - p}\)
\(n = \dfrac{r - p}{q - p} + 1 = \dfrac{r - p + q - p}{q - p} = \dfrac{q + r - 2p}{q - p}\).
Now, the sum of all \(n\) terms of the A.P. is:
\(S_n = \dfrac{n}{2}(t_1 + t_n)\)
Substituting \(n = \dfrac{q + r - 2p}{q - p}\), \(t_1 = p\), and \(t_n = r\):
\(S_n = \dfrac{1}{2} \left(\dfrac{q + r - 2p}{q - p}\right)(p + r) = (q + r - 2p) \times \dfrac{(p + r)}{2(q - p)}\).
Hence proved.
Check with an example: For the A.P. \(2, 5, 8, 11\) (\(p = 2, q = 5, r = 11\)), the sum is \(2 + 5 + 8 + 11 = 26\), and the formula gives \((5 + 11 - 4) \times \dfrac{2 + 11}{2(5 - 2)} = 12 \times \dfrac{13}{6} = 26\).