Notice how the top is an addition of two cubes, namely x and 2.
You can rewrite the equation as:
[tex]\frac{x^{3} + 2^{3}}{x + 2}[/tex]
Now, (a + b)³ can be simplified down to (a + b)(a² - ab + b²)
Following the same pattern, we get:
[tex]\frac{(x + 2)(x^{2} - 2x + 4)}{x + 2}[/tex]
[tex]= x^{2} - 2x + 4[/tex]