Let a be the first term and d is common difference of the A.P then sum of n terms in A.P is Sn = (\(\frac{n}{2}\))[ 2a + (n – 1) d]
Here, sp= q
Sq = p
Sp = (\(\frac{P}{2}\)) [2a + (p – 1) d]
q = \(\frac{P}{2}\)[2a + (p – 1) d]
\(\frac{2q}{2}\) = [2a + (p – 1) d] --------(1)
Sq = P =\((\frac{q}{2})\)[2a + (q -1)d]
\(\frac{2P}{q}\) = [2a + (q - 1)d] .......... (2)
subtract (1) from (2) we get
(q - p)d = \((\frac{2P}{q}) - (\frac{2q}{p})\)
(q – p) d = (2p2 - 2q2) / pq -----------(3)
d = -2(q + p) / pq -----------(3)
Sum of first (p + q) terms

[From (1) and (3)]
