Step 1: Understanding the Concept:
We use partial fractions to decompose the integrand. Let $x^2 = t$ (temporarily for the fraction part).
Step 2: Formula Application:
$\frac{x^4+1}{x(x^2+1)^2} = \frac{(x^2+1)^2 - 2x^2}{x(x^2+1)^2} = \frac{1}{x} - \frac{2x}{(x^2+1)^2}$.
Step 3: Explanation:
Integrating both terms:
$\int \frac{1}{x} \, dx - \int \frac{2x}{(x^2+1)^2} \, dx$.
Let $u = x^2+1 \implies du = 2x \, dx$.
$I = \log |x| - \int u^{-2} \, du = \log |x| - \frac{u^{-1}}{-1} = \log |x| + \frac{1}{x^2+1} + c$.
Comparing with given form: $A = 1, B = 1$.
$A - B = 1 - (- \text{careful with sign})$. Actually, $B$ is the coefficient of $1/(1+x^2)$, so $B=1$.
$A - B = 1 - 1 = 0$. (Correction: If $B$ corresponds to the negative sign in substitution, re-evaluating the $A-B$ target vs options). With $A=1, B=1$, $A-B=0$.
Step 4: Final Answer:
$A - B = 0$.