Remembering the standard formula for (a+b)3=a3+b3+3a2b+3ab2(a+b)3=a3+b3+3a2b+3ab2 will help in this question.
If a=x and b= 1, we get: (x+1)3=x3+1+3x2+3x(x+1)3=x3+1+3x2+3x
We can notice that we already have all the terms except 1 in the given expression.
Let us add and subtract 1 in the expression:
x3+3x2+3x+1−1−7x3+3x2+3x+1−1−7
= (x+1)3−8(x+1)3−8
= (x+1)3−23(x+1)3−23 (23=823=8)
Since a3−b3=(a−b)(a2+b2+ab)a3−b3=(a−b)(a2+b2+ab)
= (x+1−2)((x+1)2+22+(x+1)∗2)(x+1−2)((x+1)2+22+(x+1)∗2)
= (x−1)(x2+1+2x+4+2x+2)(x−1)(x2+1+2x+4+2x+2)
= (x−1)(x2+4x+7)(x−1)(x2+4x+7)