Concept:
To solve this integral, first simplify each term of the integrand using basic division or algebraic manipulation to make them easier to integrate using the $\int \frac{1}{u} du = \log|u| + C$ rule.
Step 1: Simplify the integrand.
Expand and simplify the terms:
\[ \frac{x-a}{x} = \frac{x}{x} - \frac{a}{x} = 1 - \frac{a}{x} \]
For the second term, use the $+a, -a$ trick:
\[ \frac{x}{x+a} = \frac{x + a - a}{x+a} = \frac{x+a}{x+a} - \frac{a}{x+a} = 1 - \frac{a}{x+a} \]
Step 2: Combine the simplified terms.
The full integrand becomes:
\[ \left( 1 - \frac{a}{x} \right) - \left( 1 - \frac{a}{x+a} \right) \]
\[ = 1 - \frac{a}{x} - 1 + \frac{a}{x+a} \]
\[ = \frac{a}{x+a} - \frac{a}{x} \]
Step 3: Perform the integration.
\[ \int \left( \frac{a}{x+a} - \frac{a}{x} \right) dx = a \log|x+a| - a \log|x| + C \]
Using the property $\log M - \log N = \log \frac{M}{N}$:
\[ = a \log \left| \frac{x+a}{x} \right| + C \]