## Calculus: Early Transcendentals (2nd Edition)

$$\frac{{\left( {x - 2} \right)\sqrt {{x^2} - 4x} }}{2} + 14\ln \left| {\frac{{x - 2 + \sqrt {{x^2} - 4x} }}{2}} \right| + 6\sqrt {{x^2} - 4x} + C$$
\eqalign{ & \int {\frac{{{x^2} + 2x + 4}}{{\sqrt {{x^2} - 4x} }}} dx \cr & {\text{completing the square}} \cr & = \int {\frac{{{x^2} + 2x + 1 + 3}}{{\sqrt {{x^2} - 4x + 4 - 4} }}} dx \cr & = \int {\frac{{{{\left( {x + 1} \right)}^2} + 3}}{{\sqrt {{{\left( {x - 2} \right)}^2} - 4} }}} dx \cr & u = x - 2,{\text{ }}du = dx \cr & = \int {\frac{{{{\left( {u + 3} \right)}^2} + 3}}{{\sqrt {{u^2} - 4} }}} du = \int {\frac{{{u^2} + 6u + 12}}{{\sqrt {{u^2} - 4} }}} du \cr & {\text{substitute }}u = 2\sec \theta ,{\text{ }}du = 2\sec \theta \tan \theta d\theta \cr & = \int {\frac{{4{{\sec }^2}\theta + 12\sec \theta + 12}}{{\sqrt {4{{\sec }^2}\theta - 4} }}\left( {2\sec \theta tan\theta d\theta } \right)} \cr & = \int {\frac{{4{{\sec }^2}\theta + 12\sec \theta + 12}}{{2\sqrt {{{\sec }^2}\theta - 1} }}\left( {2\sec \theta tan\theta d\theta } \right)} \cr & {\text{pythagorean identity}} \cr & = \int {\frac{{4{{\sec }^2}\theta + 12\sec \theta + 12}}{{\sqrt {{{\tan }^2}\theta } }}\left( {\sec \theta tan\theta d\theta } \right)} \cr & = \int {\left( {4{{\sec }^2}\theta + 12\sec \theta + 12} \right)\left( {\sec \theta d\theta } \right)} \cr & = \int {\left( {4{{\sec }^3}\theta + 12{{\sec }^2}\theta + 12\sec \theta } \right)d\theta } \cr & {\text{integrating}} \cr & = \frac{4}{2}\sec \theta \tan \theta + \frac{4}{2}\ln \left| {\sec \theta + \tan \theta } \right| + 12\tan \theta + 12\ln \left| {\sec \theta + \tan \theta } \right| + C \cr & = 2\sec \theta \tan \theta + 14\ln \left| {\sec \theta + \tan \theta } \right| + 12\tan \theta + C \cr & = 2\left( {\frac{u}{2}} \right)\left( {\frac{{\sqrt {{u^2} - 4} }}{2}} \right) + 14\ln \left| {\frac{u}{2} + \frac{{\sqrt {{u^2} - 4} }}{2}} \right| + 12\left( {\frac{{\sqrt {{u^2} - 4} }}{2}} \right) + C \cr & = \frac{{u\sqrt {{u^2} - 4} }}{2} + 14\ln \left| {\frac{{u + \sqrt {{u^2} - 4} }}{2}} \right| + 6\sqrt {{u^2} - 4} + C \cr & u = x - 2 \cr & = \frac{{\left( {x - 2} \right)\sqrt {{{\left( {x - 2} \right)}^2} - 4} }}{2} + 14\ln \left| {\frac{{x - 2 + \sqrt {{{\left( {x - 2} \right)}^2} - 4} }}{2}} \right| + 6\sqrt {{{\left( {x - 2} \right)}^2} - 4} + C \cr & = \frac{{\left( {x - 2} \right)\sqrt {{x^2} - 4x} }}{2} + 14\ln \left| {\frac{{x - 2 + \sqrt {{x^2} - 4x} }}{2}} \right| + 6\sqrt {{x^2} - 4x} + C \cr}