Step 1: Understanding the Question:
We can solve this integral using partial fractions or by manipulating the integrand.
Step 3: Detailed Explanation:
Consider the expression:
\[ \frac{1}{\cos x(1 + \cos x)} = \frac{(1 + \cos x) - \cos x}{\cos x(1 + \cos x)} \]
\[ = \frac{1}{\cos x} - \frac{1}{1 + \cos x} \]
\[ = \sec x - \frac{1}{2\cos^2(x/2)} \]
\[ = \sec x - \frac{1}{2}\sec^2(x/2) \]
Now, integrate each term:
\[ I = \int \sec x \, dx - \frac{1}{2} \int \sec^2(x/2) \, dx \]
Standard integral of \( \sec x \) is \( \log|\sec x + \tan x| \).
For the second term, use substitution \( u = x/2, du = 1/2 dx \):
\[ \frac{1}{2} \int \sec^2(x/2) \, dx = \tan(x/2) \]
Result:
\[ I = \log(\sec x + \tan x) - \tan(x/2) + c \]
Step 4: Final Answer:
The result is option (D).