sum a x^k + b from k = 1 to N