Partial Fraction Decomposition

I just got 2 quick questions about Partial Fraction Decomposition :

1) 2x-4/x(x-1)^2 = A/x + B/x-1 + C/(x-1)^2 , I was wondering how my professor got B/x-1 ?

2) x+6/(x+2)(x^2+4) = A/x+2 + Bx+C/x^2+4 , I was wondering how my professor got Bx+C/x^2+4 ? How come the B and C are together? I thought it was supposed to be A/something + B/something + C/something?

Re: Partial Fraction Decomposition

1) It's a standard technique when you have repeated factors, because it's possible for a quadratic denominator to have up to a linear numerator rather than constant.

2) Again, quadratic denominators can have up to linear numerators. So you need to take into account that you need a linear function in the numerator.

Generally, to have algebraic proper fractions, the numerator can be any degree up to one less than the denominator's degree.