Let the first term be A and common difference D.
Sp+1=p+q2[2A+(p+q−1)D] (1)
It is given that Tp=a and Tq=b
∴{A+(p−1)D=aA+(q−1)D=b}
Substracting, (p−q)D=a−b
∴D=a−bp−q (2)
Adding, 2A+(p+q−2)D=a+b
or 2A+(p+q−1)D=a+b+D
=a+b+a−bp−q, by (2) ..(3)
Hence from (1) and (3),
Sp+q=p+q2[a+b+a−bp−q].