If the sum of first n terms of an AP is An+Bn2 where A and B are constants, then find the common difference of AP.
A. A
B. 3A
C. B
D. 2A