Edit the title as seems fit.
$\begin{align} (a^3+b^3) &= (a+b)(a^2 -ab+b^2) \\ &= (a+b)^3 -3ab(a+b) \end{align}$
And so on and so forth. Right now, I only need these expansions in solving quadratic equations. But why do signs vary in the expansions? (asterisk). What controls this? I see that something similar comes in $a^2-b^2 = (a+b)(a-b)$ to allow the intermediate term(s) to cancel but how does this translate to other (higher-order) forms?
Level: US Grade-10 equivalent.