(x + 3)^3 = (x + 3)(x + 3)(x + 3)
(x + 3)(x + 3) = x(x + 3) + 3(x + 3) = x*x + 3*x + 3*x + 3*3 = x² + 3x + 3x + 9
= x² + 6x + 9
(x + 3)^3 = (x + 3)(x + 3)(x + 3) = (x² + 6x + 9)(x + 3)
(x² + 6x + 9)(x + 3) = x*(x² + 6x + 9) +3*(x² + 6x + 9)
= x³ + 6x² + 9x + 3x² + 18x + 27
= x³ + 6x² +3x² + 9x + 18x + 27
(x + 3)^3 = x³ + 9x² + 27x + 27
(x - 1)(x + 1) = x(x + 1) - 1(x + 1) = x*x + x*1 -1*x -1*1 = x² + x - x - 1 = x² - 1
2(x+3)^3-(x-1)(x+1) = 2*(x³ + 9x² + 27x + 27 ) - (x² - 1)
= 2x³ + 18x² + 54x + 54 - x² + 1
= 2x³ + 18x² - x² + 54x + 54
= 2x³ + 17x² + 54x + 54
Hope this explains it.