Usual method of partial fractions decomposition over the reals seems to fail. I assumed that it would be straightforward to find the partial fraction decomposition over the reals of the rational function $$f(x) = \frac{1}{(x^2 +1)^2}.$$ However, when I try what I thought would be the usual method of writing it as $$\frac{1}{(x^2+1)^2} = \frac{Ax + B}{x^2 + 1} + \frac{Cx + D}{(x^2+1)^2},$$ I find that the only choice of constants is $A = B = C = 0$, and $D = 1$, simply reproducing what I started with. Typically, one might think that this would be a logical approach to finding the indefinite integral of $f(x)$, but it seems to fail here. Could someone explain why this happens, or where I have made a mistake?
For the record, the integral is elementary using the substitution $x = \tan \theta$ and  a trig identity in the result.
 A: The method didn't "fail". Partial Fractions had already reached the point that you want it to reach, namely one in which you have to do integrals all of which are of one of the following forms:

*

*$\displaystyle \int \frac{A}{(ax+b)^k}\,dx$, $k\geq 1$. These yield to a substitution $u=ax+b$.

*$\displaystyle \int\frac{Ax}{q(x)^k}\,dx$, $k\gt 1$, $q(x)$ an irreducible quadratic; which can be solved by completing the square and doing some substitutions.

*$\displaystyle \int\frac{B}{q(x)}\,dx$ where $q(x)$ is irreducible quadratic, which can be solved by completing the square and doing some substitutions.

*$\displaystyle\int \frac{B}{(q(x))^k}\,dx$ with $k\gt 1$. These can be solved using the Reduction formulas.

The corresponding reduction formula,
$$\int\frac{dw}{(w^2+b^2)^n} = \frac{1}{2b^2(n-1)}\left(\frac{w}{(w^2+b^2)^{n-1}} + (2n-3)\int\frac{dw}{(w^2+b^2)^{n-1}}\right)$$
gives
$$F(x) = \int \frac{dx}{(x^2+1)^2} = \frac{x}{2(x^2+1)} + \frac{1}{2}\int\frac{dx}{x^2+1}= \frac{x}{2(x^2+1)} + \frac{1}{2}\arctan(x) + C.$$
(See the long discussion here; the case of an irreducible quadratic denominator raised to some power with constant numerator is item 5 towards the end).
You can verify this holds by differentiation:
$$
F'(x) = \frac{1}{2}\left( \frac{(x^2+1) - 2x^2}{(x^2+1)^2} + \frac{1}{x^2+1}\right) = \frac{1}{2}\left(\frac{1-x^2+x^2+1}{(x^2+1)^2}\right) = \frac{1}{(x^2+1)^2}.$$
A: A partial fraction decomposition over the reals is of the form
$$
\frac{p(z)}{q(z)} = P(x)+\sum _{i=1}^{m}\sum _{r=1}^{j_{i}}{\frac {A_{ir}}{(x-a_{i})^{r}}}+\sum _{i=1}^{n}\sum _{r=1}^{k_{i}}{\frac {B_{ir}x+C_{ir}}{(x^{2}+b_{i}x+c_{i})^{r}}} \, ,
$$
where the $a_i$ are the real zeros of the denominator $q$ and
$(x^{2}+b_{i}x+c_{i})$ are the quadratic factors of $q$ without real zeros.
So $\frac{1}{(x^2 +1)^2}$ is a term that cannot be further decomposed.
The terms with quadratic terms in the denominator are not needed if the decomposition is done over the complex numbers:
$$
 f(z) = \frac{1}{(x^2 +1)^2} = \frac{1}{(x -i)^2(x+i)^2}
$$
can be decomposed into
$$
\frac{A}{x-i}+\frac{B}{(x-i)^2} + \frac{C}{x+i} + \frac{D}{(x+i)^2} \, ,
$$
concretely:
$$
\frac{1}{(x -i)^2(x+i)^2}
= \frac{-i/4}{x-i}+\frac{-1/4}{(x-i)^2} + \frac{i/4}{x+i} + \frac{-1/4}{(x+i)^2}
$$
