Solution:
Key idea: We complete the square to reach t2+a2, and then use the standard form ∫t2+a2dt=2tt2+a2+2a2logt+t2+a2+C.
Step 1 — Complete the square.
We add and subtract 22=4, the square of half the coefficient 4.
x2+4x+6=(x2+4x+4)+2
x2+4x+6=(x+2)2+(2)2
Step 2 — Apply the formula.
We use the formula with t=x+2 and a2=2, so the coefficient 2a2 is 1.
I=2x+2x2+4x+6+logx+2+x2+4x+6+C
Therefore, ∫x2+4x+6dx=2(x+2)x2+4x+6+logx+2+x2+4x+6+C, for all real x.