Work on each open interval where the original integrand is real and defined.
Complete the square (x+2)²−9.
For J=∫√(u²+A)du, integrate by parts with dv=du. Use u²=(u²+A)−A to get 2J=u√(u²+A)+A∫du/√(u²+A). For √(A−u²), the analogous identity uses an arcsine. Substitute the standard log or arcsine primitive.