If the sum of the first p terms of an AP is ap^2 +bp, find its common difference.

Manmeet Singh's image