Step 1: Understanding the Question:
We must algebraically manipulate and integrate a complex rational function to match a specified generic output format, thereby solving for the constants A and B.
Step 2: Detailed Explanation:
Let the integral be $I = \int \frac{x^4 + 1}{x(x^2 + 1)^2} dx$.
To break this complex fraction down, notice that the numerator $(x^4 + 1)$ can be cleverly rewritten by completing the square relative to the denominator:
$x^4 + 1 = (x^2 + 1)^2 - 2x^2$
Substitute this brilliant manipulation back into the integral:
$I = \int \frac{(x^2 + 1)^2 - 2x^2}{x(x^2 + 1)^2} dx$
Now, split the massive fraction into two much simpler independent fractions:
$I = \int \left( \frac{(x^2 + 1)^2}{x(x^2 + 1)^2} - \frac{2x^2}{x(x^2 + 1)^2} \right) dx$
Cancel the common terms:
$I = \int \left( \frac{1}{x} - \frac{2x}{(x^2 + 1)^2} \right) dx$
Now we can integrate the two terms completely separately:
1. First term:
$\int \frac{1}{x} dx = \log|x|$
2. Second term:
$\int \frac{2x}{(x^2 + 1)^2} dx$
Use u-substitution. Let $u = x^2 + 1 \implies du = 2x dx$.
$\int u^{-2} du = \frac{u^{-1}}{-1} = -\frac{1}{u} = -\frac{1}{x^2 + 1}$
Combining the results (and being careful with the minus sign from the split):
$I = \log|x| - \left( -\frac{1}{x^2 + 1} \right) + c$
$I = \log|x| + \frac{1}{1 + x^2} + c$
Compare this result with the given generic expression $A \log|x| + \frac{B}{1 + x^2} + c$:
By direct comparison, $A = 1$ and $B = 1$.
The question asks for the value of $A - B$:
$A - B = 1 - 1 = 0$.
Step 3: Final Answer:
The value of $A - B$ is 0, matching option (a).