If the sum of n terms of an A.P. is nA+n2B, where A,B are constants, then its common difference will be