Need some insight into how to determine A, C, and D

(x^2 - 2x - 1) /(((x - 1)^2)(x^2 + 1)

A / ( x - 1) + B / (x - 1)² + (Cx +D) / (x² + 1)

x² - 2x - 1 = A(x - 1 )(x² + 1) - (x² +1) + (Cx + D)(x - 1)²

Now I know that B = -1. What i'm having trouble is figuring out the others. I've tried foiling out everything but then when I equate coefficients, i'll have two variables equal to each other. Any help is appreciated (Worried)