1) A difference of perfect cubes (a3 - b3) is always obtained from the factors
(a - b)(a2 + ab + b2)
where a is the cubed root of the first term and b is the cubed root of the second term.
2) A sum of perfect cubes, (a3 + b3) is always obtained from the factors
(a + b)(a2 - ab + b2)
where a is the cubed root of the first term and b is the cubed root of the second term.
EXAMPLE: # 1 8x3 + 27 factors as:
(2x + 3)(4x2 - (2x)(3) + 9) = (2x + 3)(4x2 - 6x + 9)
# 2 64y3 - 125 factors as:
(4y - 5)(16y2 + (4y)(5) + 25) = (4y - 5)(16y2 + 20y + 25)
Note the signs in each case.
When you have a sum of cubes, the sign of the binomial term is positive (like the original polynomial), while the sign of the middle term of the trinomial is negative.
When you have a difference of cubes, the sign of the binomial term is negative (like the original polynomial) and the sign of the middle term of the trinomial factor is positive.