My textbook in algebra states without proof that:
A rational function:
$$s(x)=\frac{p(x)}{(x-\alpha)^m(x-\beta)^n}$$
Where $\alpha \neq \beta$ and $\deg(p(x)<\deg(m+n)$, can always be
partially decomposed as:
$$\frac{A_1}{x-\alpha}+\frac{A_2}{(x-\alpha)^2}+ \ldots
+\frac{A_m}{(x-\alpha)^m}+\frac{B_1}{x-\beta}+\frac{B_2}{(x-\beta)^2}+ \ldots
+\frac{B_n}{(x-\beta)^n}$$
I can motivate that this holds true for simple cases such as $$\frac{y}{(x+a)(x+a_2)}$$
Which can then be written as:
$$\frac{A}{x+a}+\frac{B}{x+a_2}$$
I can motivate that squared polynomials can be dealt with in very special cases, so that:
$$f(x)=\frac{x+2}{(x+1)^2}$$
can be written as:
$$f(x)=\frac{(x+1)+1}{(x+1)^2}]=\frac{1}{(x+1)}+\frac{1}{(x+1)^2}$$
....But that only worked since the nominator was divisible with the denominator and a denominator with one degree lower could be yielded. How can this be generalized to the general case?
I mean, we could easily have something like:
$$f(x)=\frac{x+2}{(x+1)^{1000}}$$
Using the same reasoning as above, this could possibly be rewritten as:
$$\frac{1}{(x+1)^{999}}+\frac{1}{(x+1)^{1000}}$$
But what could possibly be the motivation for expanding this expression to a thousand different terms, as is implied by the textbook?
EDIT:
My question is not so much about why we are expanding the expression that way but about how that's even possible without a compatible numerator.
Let us take $\left(\left(x-\alpha\right)-\left(x-\beta\right)\right)$ and raise it to the power of $m+n-1$ as follows: $$ \left(\beta-\alpha\right)^{m+n-1} = \left(\left(x-\alpha\right)-\left(x-\beta\right)\right)^{m+n-1} \\ =\sum_{k=0}^{m+n-1}\binom{n+m-1}{k} (-1)^{m+n-1-k} (x-\alpha)^k (x-\beta)^{m+n-1-k} \\ =\sum_{k=0}^{m-1} \binom{n+m-1}{k} (-1)^{m+n-1-k} (x-\alpha)^k (x-\beta)^{m+n-1-k} \\ +\sum_{k=m}^{m+n-1}\binom{n+m-1}{k} (-1)^{m+n-1-k} (x-\alpha)^k (x-\beta)^{m+n-1-k} \\ =(x-\beta)^n \sum_{k=0}^{m-1} \binom{n+m-1}{k} (-1)^{m+n-1-k} (x-\alpha)^k (x-\beta)^{m-1-k} \\ +(x-\alpha)^m \sum_{k=m}^{m+n-1}\binom{n+m-1}{k} (-1)^{m+n-1-k} (x-\alpha)^{k-m} (x-\beta)^{m+n-1-k} \\ =(x-\beta)^n \sum_{k=0}^{m-1} \binom{n+m-1}{k} (-1)^{m+n-1-k} (x-\alpha)^k (x-\beta)^{m-1-k} \\ +(x-\alpha)^m \sum_{k=0}^{n-1} \binom{n+m-1}{k} (-1)^k (x-\beta)^k (x-\alpha)^{n-1-k} $$ In the last step, I substituted $k$ with $n+m-1-k$ in the second sum.
If we set $$ u_1(x)=\frac{1}{(\beta-\alpha)^{m+n-1}} \;\;\sum_{k=0}^{n-1}\binom{n+m-1}{k} (-1)^k (x-\beta)^k (x-\alpha)^{n-1-k} $$ and $$ v_1(x)=\frac{1}{(\beta-\alpha)^{m+n-1}} \;\;\sum_{k=0}^{m-1}\binom{n+m-1}{k} (-1)^{m+n-1-k} (x-\alpha)^k (x-\beta)^{m-1-k} $$ then we have a polynomial $u_1$ and a polynomial $v_1$ such that $$ u_1(x)(x-\alpha)^m + v_1(x)(x-\beta)^n = 1 $$ This is also the only time we need $\alpha\neq\beta.$
We can multiply this on both sides with $p(x)$, that is, the numerator of the original fraction: $$ p(x)u_1(x)(x-\alpha)^m + p(x)v_1(x)(x-\beta)^n = p(x) $$ Now we have to show that we can "convert" $p(x)u(x)$ to a polynomial $u_p(x)$ of degree $n-1$ (or less) and $p(x)v(x)$ to a polynomial $v_p(x)$ of degree $m-1$ or less such that $$ u_p(x)(x-\alpha)^m + v_p(x)(x-\beta)^n = p(x) $$ still holds. If $$ p(x)u_1(x)(x-\alpha)^m + p(x)v_1(x)(x-\beta)^n = p(x) $$ then $$ \;\;\;\left(p(x)u_1(x)+(x-\beta)^n q(x)\right)(x-\alpha)^m \\ + \left(p(x)v_1(x)-(x-\alpha)^m q(x)\right)(x-\beta)^n \\ = p(x) $$ holds for any polyomial $q.$ We perfom polynomial long division (divide $p(x)v_1(x)$ by $(x-\alpha)^m$) to get the $q$ and the remainder $r$ of degree $m-1$ or less: $$ p(x)v_1(x) = (x-\alpha)^m q(x) + r(x) $$ Now we set $v_p(x) = p(x)v_1(x) - (x-\alpha)^m q(x) = r(x)$, which has a degree of $m-1$ or less.
With the same $q$, we set $u_p(x) = p(x)u_1(x) + (x-\beta)^n q(x)$. As we know that with this $u_p$, we have $u_p(x)(x-\alpha)^m + v_p(x)(x-\beta)^n = p(x)$, and as we also know that the degrees of $p(x)$ and $v_p(x)(x-\beta)^n$ are at most $m+n-1$, we can be sure that the degree of $u_p(x)(x-\alpha)^m$ is also at most $m+n-1,$ which means that the degree of $u_p(x)$ is at most $n-1.$
Put all this together and you get $$ \frac{p(x)}{(x-\alpha)^m(x-\beta)^n} = \frac{u_p(x)(x-\alpha)^m + v_p(x)(x-\beta)^n}{(x-\alpha)^m(x-\beta)^n} = \frac{v_p(x)}{(x-\alpha)^m} + \frac{u_p(x)}{(x-\beta)^n} $$ You can now obviously create new polynomials $u_{p,\beta}$ and $v_{p,\alpha}$ such that $u_{p,\beta}(x-\beta)=u_p(x)$ and $v_{p,\alpha}(x-\alpha)=v_p(x).$ $u_{p,\beta}$ has the same degree as $u_p$, and $v_{p,\alpha}$ has the same degree as $v_p.$ Use the coefficients of those polynomials as solution for the $A_i$ and $B_j$ as follows $$ v_{p,\alpha}(x-\alpha)=A_1(x-\alpha)^{m-1} + A_2(x-\alpha)^{m-2} + \ldots + A_{m-1}(x-\alpha) + A_m \\ u_{p,\beta}(x-\beta)=B_1(x-\beta)^{n-1} + B_2(x-\beta)^{n-2} + \ldots + B_{n-1}(x-\beta) + B_n $$ and everything falls into place.