Here, we see that the term in x in the equation is 6, so we start by looking for a perfect square where the second term would be 6 : we get 6/2 = 3 so we try (x+3)2. However, (x+3)2 = x2+ 6x + 9. We thus have (x+3)2 - 1. We then use the fact that (a+b)(a-b) = a2 - b2 and obtain (x+2)(x+4) = x**2 + 6x + 8.