Concept:
• For integrals of the form \( \int \frac{px + q}{ax^2 + bx + c} \, dx \), we express the numerator as \( A \cdot \frac{d}{dx}(\text{denominator}) + B \).
• This splits the integral into a log term and a term involving completing the square.
Step 1: Decompose the numerator
The derivative of the denominator is \(\frac{d}{dx}(x^2 + 4x + 5) = 2x + 4\).
Let \(x + 3 = A(2x + 4) + B\).
Comparing coefficients of \(x\): \(2A = 1 \implies A = 1/2\).
Comparing constants: \(4A + B = 3 \implies 4(1/2) + B = 3 \implies 2 + B = 3 \implies B = 1\).
So, \(x + 3 = \frac{1}{2}(2x + 4) + 1\).
Step 2: Split the integral
\[ I = \int \frac{\frac{1}{2}(2x + 4) + 1}{x^2 + 4x + 5} \, dx \]
\[ I = \frac{1}{2} \int \frac{2x + 4}{x^2 + 4x + 5} \, dx + \int \frac{1}{x^2 + 4x + 5} \, dx \]
Step 3: Evaluate each part
Part 1 is a direct log form:
\[ I_1 = \frac{1}{2} \log|x^2 + 4x + 5| \]
For Part 2, complete the square: \(x^2 + 4x + 5 = (x + 2)^2 + 1\).
\[ I_2 = \int \frac{dx}{(x + 2)^2 + 1} = \tan^{-1}(x + 2) \]
Step 4: Combine the results
\[ I = \frac{1}{2} \log|x^2 + 4x + 5| + \tan^{-1}(x + 2) + C \]