(t-3)(t2+3t+9)=t(t2+3t+9)-3(t2+3t+9)=
t3+3t2+9t-3t2-9t-27=t3-27 or t3-33 (difference of two cubes).
(t+3)(t2-3t+9)=t(t2-3t+9)+3(t2-3t+9)=
t3-3t2+9t+3t2-9t+27=t3+27 or t3+33 (sum of two cubes).
This shows how the difference and sum of two cubes factorises. Notice how the minus sign in either the first factor or the second factor causes terms to cancel out just leaving the cubes.
This "trick" applies to the sum and difference of other powers. For example, sixth power:
(x-y)(x5+x4y+x3y2+x2y3+xy4+y5)=
x6+x5y+x4y2+x3y3+x2y4+xy5-x5y-x4y2-x3y3-x2y4-xy5-y6=
x6-y6 (y can also be any number).
(x+y)(x5-x4y+x3y2-x2y3+xy4-y5)=
x6-x5y+x4y2-x3y3+x2y4-xy5+x5y-x4y2+x3y3-x2y4+xy5-y6=
x6-y6. Note how the alternating position of the minus sign causes all but two terms to cancel out.
Knowing this trick enables you to factor the sum or difference of the same integer powers (power must be greater than 2) of two different quantities. Although you can also factor x2-y2, x2+y2 does not factor into real factors.