<s>[INST] 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.
 [/INST] 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}.$$
</s>