Evaluate the integral: \[ I = \int \frac{\cos x + x \sin x}{x (x + \cos x)} dx =\]
Step 1: Observe the structure of the integrand
We are given: \[ I = \int \frac{\cos x + x \sin x}{x(x + \cos x)} \, dx \] Notice that the denominator is: \[ x(x + \cos x) \] And the numerator: \[ \cos x + x \sin x \] This resembles the derivative of the denominator. Let’s check.
Step 2: Let the denominator be \( u \)
Let: \[ u = x + \cos x \Rightarrow \frac{du}{dx} = 1 - \sin x \quad \text{(Not useful)} \] But try: \[ f(x) = \log \left| \frac{x}{x + \cos x} \right| \Rightarrow \frac{d}{dx} \left( \log \left| \frac{x}{x + \cos x} \right| \right) = \frac{d}{dx} \left( \log |x| - \log |x + \cos x| \right) \] Derivatives: \[ \frac{d}{dx}(\log |x|) = \frac{1}{x}, \quad \frac{d}{dx}(\log |x + \cos x|) = \frac{1 - \sin x}{x + \cos x} \] So: \[ \frac{d}{dx} \left( \log \left| \frac{x}{x + \cos x} \right| \right) = \frac{1}{x} - \frac{1 - \sin x}{x + \cos x} \] Now make common denominator: \[ = \frac{(x + \cos x) - x(1 - \sin x)}{x(x + \cos x)} = \frac{x + \cos x - x + x \sin x}{x(x + \cos x)} = \frac{\cos x + x \sin x}{x(x + \cos x)} \] Which matches the given integrand.
Therefore, \[ \int \frac{\cos x + x \sin x}{x (x + \cos x)} \, dx = \log \left| \frac{x}{x + \cos x} \right| + C \]
\( \boxed{ \log \left| \frac{x}{x + \cos x} \right| + C } \)
Evaluate: \[ \int_1^5 \left( |x-2| + |x-4| \right) \, dx \]