x²+x+x+1
=x(x+1)+1(x+1)
=(x+1)(x+1)
Please see some steps
Step 1 : prime factorisation of 1
=1×1
Step 2 : for split of middle term >sign of constant term > Here sign of constant term is (+)
So we can write the middle term (x+x)
Step 3 : after processing you also know how to choose common term