I'm trying to figure out how a colleague factored an expression. I don't get how:
$$a^3+a^2b-(b+1)=(a-1)[a^2+a(b+1)+(b+1)]$$
Multiplying the result I see it's true, but not sure how he got there..is this a general rule for cubic expressions of this form?
Thanks,
P
\begin{align*} a^3+a^2b-(b+1) &=a^3-a^2+a^2+a^2b-(b+1) \\&=a^3-a^2+a^2(b+1)-(b+1) \\&=(a-1)a^2+(a^2-1)(b+1) \\&=(a-1)a^2+(a-1)(a+1)(b+1) \\&=(a-1)(a^2+(a+1)(b+1)) \\&=(a-1)(a^2+a(b+1)+(b+1)) \end{align*}