Key idea: For a linear expression over a quadratic, write the numerator as (a multiple of the derivative of the quadratic) + (a constant). The first part gives a logarithm, and for the second part we complete the square and use ∫X2+a2dx=a1tan−1aX.
Step 1 — Split the numerator.
The derivative of x2+4x+7 is 2x+4. We write x+7 as 21(2x+4)+5.
I=21∫x2+4x+72x+4dx+5∫x2+4x+7dx
Step 2 — Integrate the first part.
The numerator is exactly the derivative of the denominator, so we get a logarithm. No modulus is needed, because x2+4x+7 is always positive.
21∫x2+4x+72x+4dx=21log(x2+4x+7)
Step 3 — Complete the square in the second part.
Half of 4 is 2, so we add and subtract 4.
x2+4x+7=(x+2)2+3
x2+4x+7=(x+2)2+(3)2
Step 4 — Integrate the second part.
Using the special form with X=x+2 and a=3, we multiply the result by 5.
5∫(x+2)2+(3)2dx=35tan−1(3x+2)
Step 5 — Add the parts.
We add the two results and one constant of integration.