If the sum of p terms of an AP is q and the sum of q term is p, then the sum of p + q terms will be:
let first term be a and common difference be b
so pth term =a+(p−1)d
and sum of first p terms =p2(2a+(p−1)d)=q
hence (2a+(p−1)d)=2qp....(1)
and qth term =a+(q−1)p
and sum of first q terms =q2(2a+(q−1)d)=p
hence (2a+(q−1)d)=2pq....(2)
subtract (1) from (2)
(p−q)d=2(qp−pq)=2(q2−p2)q
so, d=−2(p+q)pq....(3)
(p+q)th term =(a+(p+q−1)d)
and sum of its first (p+q) term =(p+q)2(2a+(p+q−1)d)
=(p+q)2(2a+(p−1)d+qd)=(2qp+qd)(p+q)2... from(3)
=(2qp−2−2qp)p+q2
=−(p+q)