Partial Fraction Decomp. Why repeated factors. And why the (Cx+D) for quadratics? 1) First, why are powers of linear factors repeated?
For example, $(x+1)^2$ gets $\frac{A}{(x+1)}$ and $\frac{B}{(x+1)^2}$ 
2) Why does a quad factor like $x^2+1$ get a term $\frac{Cx+d}{x^2+1}$
Looking for an example that shows WHY you need a linear term above the quadratic, and WHY you need to repeat the factors.
 A: We have to assume that the numerator is of order at most one less than the order of the denominator, since if the order was higher, long division could be performed to reduce it, leaving a remainder whose order is again at most one less than the denominator.
As for the repeated factors, theoretically we should put $$\frac {Ax+B}{(x-1)^2}$$
However,$$\frac {Ax+B}{(x-1)^2}=\frac{Ax-A}{(x-1)^2}+\frac{-A+B}{(x-1)^2}$$ and hence we write $$\frac{A}{(x-1)}+\frac{B}{(x-1)^2}$$
A: This results from the theory of finitely generated modules over PIDs (the ring of polynomials $K[x]$ over a field $K$ is a PID).
The general result is this:  any power $P(x)^m$ of an irreducible polynomial $P(x)$ in a rational function has a contribution
$$\frac{a_1(x)}{P(x)}+\dots+\frac{a_m(x)}{P(x)^m}$$
in the partial fractions decomposition, where $\deg a_i(x)<\deg P(x)$ for all $i$.
A: Here are some trivial counterexamples that illustrate why we must consider terms of the given form:

*

*Consider the rational expression $$\frac{1}{x^2 (x + 1)} .$$ If we did not require terms with lower powers in the denominator, applying partial fractions to this expression would give entail solving $$\frac{1}{x^2 (x + 1)} = \frac{A}{x^2} + \frac{B}{x + 1}$$ for some constant $A$. Cross-multiplying gives $1 = A(x + 1) + B x^2$, and comparing like coefficients yields a contradiction, and hence there is no such decomposition as written.


*Similarly, consider the rational expression $$\frac{x}{x^2 + 1} .$$ If we did not require a linear term in the numerator of expressions with irreducible quadratics in the denominator, applying partial fractions to this expression would entail solving $$\frac{x}{x^2 + 1} = \frac{A}{x^2 + 1} .$$ Again, there is no solution $A$.
Edit In the handwritten computations in the edit to the original question, the computations in the candidate decomposition with only two terms is incorrect: Writing
$$\frac{1}{(x - 1) (x + 1)^2} = \frac{A}{x - 1} + \frac{B}{(x + 1)^2}$$
and cross-multiplying gives
$$1 = A(x + 1)^2 + B(x - 1) = A x^2 + (2 A + B) x + (A - B) .$$
Then, comparing like coefficients gives the system
$$
\left\{\begin{array}{rcl}
A &=& 0\\
2 A + B &=& 0\\
A - B &=& 1
\end{array}\right. 
$$
but this system has no solution, so yet again there is no such decomposition. (One can verify that something has gone wrong in the handwritten solution by combining the expression into a single ratio of polynomials.)
A: *

*Powers of linear factors in the denominator of a rational function indicate poles of higher order. Any rewriting of the original rational function as a sum of "simpler" rational functions (which is what partial fraction decomposition really is) would need to have a pole of the same order somewhere on the right hand side.


If you don't know what poles are, consider multiplying both sides with $(x+1)$ (no square). Then the left hand side is still unbounded near $x=-1,$ so the right hand side cannot have a finite limit there.


*One way to look at this is to note that $x^2+1$ is even, and there is no hope of rewriting a general function (odd+even parts) as a linear combination of even functions.


(update after clarification of question)
If you "arbitrarily" put a rational function like $\frac1{(x+1)^2(x-1)}$ equal to a linear combination of simple rational functions of your own choice, like in your first example, then you will obtain values for the coefficients but these are "necessary" and not "sufficient". If you work the result from your first example backwards then you obtain the rational function $\frac{x-2}{4(x-1)(x+1)^2}$ which is different from the original.
The general setting for this kind of trick is Bezout's theorem for polynomials: if $P(x)$ and $Q(x)$ have no common factors then there exist polynomials $A(x)$ and $B(x)$ such that $A(x)P(x)+B(x)Q(x)$ is the constant $1.$ Applying this to $P(x)=(x+1)^2$ and $Q(x)=x-1$ we see that we can write $\frac1{(x+1)^2(x-1)}=\frac{AP+BQ}{PQ}$ as a linear combination of $\frac1{(x+1)^2}$ and $\frac1{(x-1)}$ but the coefficients are polynomials the degrees of which can be chosen to be smaller than the degrees of the numerators, but not necessarily smaller than that. So instead of repeating the factor $(x+1)$ in the first degree you could also write the decomposition as
$$\frac1{(x+1)^2(x-1)}=\frac E{x-1}+\frac{Fx+G}{(x+1)^2}$$
As it turns out, the more usual form
$$\frac1{(x+1)^2(x-1)}=\frac A{x-1}+\frac{B}{x+1}+\frac{C}{(x+1)^2}$$
is "equivalent" to this in terms of getting a determined system of linear equations, but more "useful" when finding primitive functions (indefinite integrals).
