We are given the integral:
\[
\int \frac{1}{(x+1)(x+2)} \, dx
\]
We will decompose the fraction into partial fractions:
\[
\frac{1}{(x+1)(x+2)} = \frac{A}{x+1} + \frac{B}{x+2}
\]
Multiplying both sides by \( (x+1)(x+2) \), we get:
\[
1 = A(x+2) + B(x+1)
\]
Expanding both sides:
\[
1 = A(x+2) + B(x+1)
\]
\[
1 = A(x) + 2A + B(x) + B
\]
\[
1 = (A + B)x + (2A + B)
\]
Now, comparing the coefficients of like terms:
For the \( x \)-terms: \( A + B = 0 \)
For the constant terms: \( 2A + B = 1 \)
From \( A + B = 0 \), we have \( B = -A \). Substituting this into \( 2A + B = 1 \):
\[
2A - A = 1 \implies A = 1
\]
Thus, \( B = -1 \).
Therefore, we have the partial fraction decomposition:
\[
\frac{1}{(x+1)(x+2)} = \frac{1}{x+1} - \frac{1}{x+2}
\]
Now, integrating each term:
\[
\int \frac{1}{x+1} \, dx = \log |x+1|
\]
\[
\int \frac{1}{x+2} \, dx = \log |x+2|
\]
Thus, the solution to the integral is:
\[
\log |x+1| - \log |x+2| + c
\]
This can be written as:
\[
\log \left| \frac{x+1}{x+2} \right| + c
\]
Thus, the correct answer is option (3).