How to factorize $a^2-b^2-a+b+(a+b-1)^2$? The answer is $(a+b-1)(2a-1)$ but I have no idea how to get this answer.

Using $a^2-b^2=(a+b)(a-b)$ we find $a^2-b^2-a+b=(a+b-1)(a-b)$. The first factor also occurs in the remaining summand.
