I do not know the formula, but know the answer. Your function x^2+x looks like not-complete standart quadratic equation
a^2+2ab+b^2
(where a^2=x^2, 2ab=x, but missing b^2),
if it would be complete we could write it as
(a+b)^2.
To make it complete we add missing b^2,
if our a=x and 2ab=x...