<s>[INST] Why do partial fractions sometimes switch the sign? According to my solution manual this a valid partial decomposition:
$$\frac1{(x^2-1)^2}=\frac A{x-1}+\frac B{(x-1)^2}+\frac C{x+1}+\frac D{(x+1)^2}$$
I'm not sure how I was supposed to know to flip the signs of the $1$ for $C$ and $D$? Is there some general rule I'm missing?
 [/INST] You're not “flipping the signs”—you are using each of the factors of $x^2-1$.  In this case, they happen to be $x-1$ and $x+1$.
The partial fraction decomposition can be stated very generally.  But maybe it's best to illustrate with cases.  If the denominator were just $(x^2-1) = (x-1)(x+1)$, you would have each of those factors in a denominator:
$$
    \frac{1}{x^2-1} = \frac{1}{(x-1)(x+1)} = \frac{A}{x-1} + \frac{B}{x+1}
$$
This works for any product of distinct linear factors: just add one term for each factor, with a constant numerator.  It doesn't work for repeated factors, though.  In that case, you need to add one term to the PFD for each power of the repeated factor, up to the repeated power shown.  So:
\begin{align*}
    \frac{x}{(x-1)^2} &= \frac{A}{x-1} + \frac{B}{(x-1)^2} \\
    \frac{x}{(x-1)^3} &= \frac{A}{x-1} + \frac{B}{(x-1)^2} + \frac{C}{(x-1)^3}\\
\end{align*}
and so on.  The reason why is complicated, but basically you need enough independent constants to fit all possible numerators.
In your problem, $(x^2-1)^2$ factors as $(x-1)^2(x+1)^2$.  So we have to do the repeated-factor thing twice, once for $x-1$ and one for $x+1$.  Hence:
$$
    \frac{1}{(x^2-1)^2} = \frac{A}{x-1} + \frac{B}{(x-1)^2} + \frac{C}{x+1}+ \frac{D}{(x+1)^2}
$$
</s>