Nothin' to it but to do it. Where did you hide your algebra skills?
Work on your notation skills, too. ax+b/(x^2 + 1) is no good. Think about the order of operations.
I get a = 2 and d = -2
Let's see what you get.
I got ax+b(x-1)(x-1)^2 + c(x^2+1)(x-1)^2 +d(x^2+1)(x-1)
===> ax+b(x^3 -3x^2+3x-1) +C(x^3-3x^2+3x-1) +D(x^3-x^2+x-1)=-2x+4
can it not be solved like this by usually putting in values for x?
Comparing coefficients is the reliable way to go. the substitution method you suggest has three drawbacks.
1) Emotional turmoil. It causes me pain to substitute values I know are not in the Domain. Nevertheless, it works for lots of things, however...
2) It takes Complex numbers for that x^2 + 1 part. That's likely to be worse than it's worth. Essentially, it doesn't work with strictly quadratic (or higher order) factors.
3) Actually, it doesn't work for ANY quadratic factors. You see that x = 1 is your ONLY substitution. This will not buy you FOUR parameters.
So, if you've ALWAYS only linear factors, and you really don't mind deliberately substituting values not in the Domain, just go ahead and substitute values that will make the individual demoninators zero.
In other words, compare the coefficients. The odd substitution method is a trick that looks compelling in very specific circumstances. Get better at basic algebra (order of operations, for example) and it will not be as bad as you might be conjuring.
Here's the very simple idea.
One polynomial: ax^2 + bx + c
Another polynomial: dx^2 + ex + f
These two polynomials are EXACTLY the same if and only if all the corresponding coefficients are identical. This gives:
a = d -- Comparing the x^2 coefficients
b = e -- Comparing the x coefficients
c = f -- Comparing the constant terms.
The idea is very simple. There is no question that the algebra can be a bit messy. You must pay attention and get better at it.