(x ^ 3 + 8x ^ 2 + 21x + 18) can be factored into ( x + 2 )( x + 3 )( x + 3 ). We divide by ( x + 2 ), and they cancel. Expanding
( x + 3 ) ^ 2 gives us x ^ 2 + 6x + 9. A = 1, B = 6, and C = 9. D is the one value that x can't be. If x was -2, then we would be dividing by 0, which absolutely can't happen. So, D = -2. Adding them together, A + B + C + D = 1 + 6 + 9 + (-2) = 14.