Step 1: Break down the integrand.
We want to perform partial fraction decomposition on
\[
\frac{x^2}{(x+1)^2(x+2)^2}
\]
Step 2: Set up partial fractions.
\[
\frac{x^2}{(x+1)^2(x+2)^2} = \frac{A}{x+1} + \frac{B}{(x+1)^2} + \frac{C}{x+2} + \frac{D}{(x+2)^2}
\]
Step 3: Solve for the constants.
Multiply both sides by \( (x+1)^2(x+2)^2 \) and solve for \( A, B, C, D \). After simplification, we get
\[
A = 1, B = -4, C = 0, D = 0
\]
Step 4: Integrate each term.
\[
\int \frac{1}{x+1} \, dx = \log|x+1|
\]
\[
\int \frac{-4}{(x+2)} \, dx = -\frac{4}{x+2}
\]
Step 5: Combine the results.
\[
\int \frac{x^2}{(x+1)^2(x+2)^2} \, dx = \log|x + 1| - \frac{4}{x + 2} + c
\]
Step 6: Conclusion.
The final answer is \( \log|x + 1| - \frac{4}{x + 2} + c \).