Let the first term of the A.P. is a and the common difference be d.
Now the sum of first p terms is p2(2a+(p−1)d).....(1) and that of first q terms is q2(2a+(q−1)d)......(2).
According to the problem,
p2(2a+(p−1)d)=q2(2a+(q−1)d)
or, 2a(p−q)−d{q(q−1)−p(p−1)}=0
or, 2a(p−q)−d{q2−p2+(p−q)}=0
or, (p−q){2a+d(p+q−1)}=0
or, 2a+d(p+q−1)=0 [ Since p≠q]......(1).
Now the sum of first (p+q) terms is p+q2{2a+(p+q−1)d}=0 [ Using (1)].