We want to perform the following division:

First, we rewrite the numerator and denominator as follows: 

Then, we divide the term of greatest degree of the numerator by the term of greatest degree of the denominator and write the result bellow the denominator:
d² + 8d + 12 | d + 2
 d
Now we subtract from the numerator the product of this division and the denominator:
 d² + 8d + 12 | d + 2
-d² - 2d | d
 6d + 12 
Now we reproduce the same steps again with this result
Setep 1:
 d² + 8d + 12 | d + 2
-d² - 2d | d
 6d + 12 | d + 2
 d + 6
Step 2:
 d² + 8d + 12 | d + 2
-d² - 2d | d
 6d + 12 | d + 2
 -6d - 12 | d + 6
 0
Since this division has no rest, the answer is given by:
