# Easy ways to find partial fraction representation? (via a concrete example)

In a homework assignment (about generating functions) the students find themselves having to expand $\frac{3-7x+9x^{2}-3x^{3}}{\left(1-x\right)^{4}}$ intro partial fractions. Using some automated tool (e.g. Wolfram alpha) the expansion is found right away: $\frac{3}{1-x}-\frac{2}{\left(1-x\right)^{3}}+\frac{2}{\left(1-x\right)^{4}}$.

However, sending the students to use Wolfram alpha instead of computing by themselves seems problematic to me. However, I have no idea how the partial fraction representation can be found without a lot of dirty work involved, which will ensure the students hate the exercise instead of learning from it.

My question - is there some "nice" way of doing such things I am simply unaware of? Of course, the best answer is a demonstration on the concrete case of $\frac{3-7x+9x^{2}-3x^{3}}{\left(1-x\right)^{4}}$ - but only give it if your method is simple enough so that writing it down is not a lot of work...

-
It is a good question, but one has to remember that sometimes dirtying one's hands is a vital tool of great importance. – Asaf Karagila Aug 9 '11 at 9:23
True that. =) When looking for an amazing trick fails, getting your hands dirty and finding the solution might make one think "oh, but to get there, this way is sooo much better!" – Patrick Da Silva Aug 9 '11 at 10:56
Asaf, I strongly agree with you. However, after dirtying my hands in this particular question I believe there is not much to gain here by going the brute-force way. – Gadi A Aug 9 '11 at 11:10

One thing that students sometimes find appealing (and I did when I first saw it), is the use of Taylor polynomials. Put $f(x) = (3 - 7x+9x^2 -3x^3)$, and then write $f(x)$ as $f(1) + f^{\prime}(1)(x-1) + \frac{f^{"}(1)}{2!}(x-1)^{2} + \frac{f^{(3)}(1)}{3!}(x-1)^{3}$. Of course, the same trick will work whenever you have a rational function of the form $\frac{g(x)}{(x-a)^d}$ to deal with. If $g(x)$ has degree $n,$ just write it as $\sum_{j=0}^{n} \frac{g^{(j)}(a)}{j!}(x-a)^{j}$.

-
Wow, this is extremely elegant! Thanks! – Gadi A Aug 9 '11 at 11:11

In this particular case, I think the quickest way is to introduce a new variable $t=1-x$. So just substitute $x=1-t$ and expand: $$\frac{3-7x+9x^{2}-3x^{3}}{\left(1-x\right)^{4}}= \frac{3-7(1-t)+9(1-t)^{2}-3(1-t)^{3}}{t^{4}}= \frac{2-2t+0t^2+3t^3}{t^4}= \frac{2}{t^4} - \frac{2}{t^3} + \frac{3}{t}.$$ Now put $t=1-x$ back, and you have the partial fractions decomposition.

-
This is of course almost the same as Geoff's suggestion, but it uses that a polynomial is its own Maclaurin series, so one can simply expand instead of computing each coefficient by differentiation. – Hans Lundmark Aug 9 '11 at 11:40

$${3-7x+9x^2-3x^3\over(1-x)^4}={A\over1-x}+{B\over(1-x)^2}+{C\over(1-x)^3}+{D\over(1-x)^4}$$

$$3-7x+9x^2-3x^3=A(1-x)^3+B(1-x)^2+C(1-x)+D$$

Substitute $x=1$ to get $D$. Differentiate and substitute $x=1$ to get $C$. Differentiate again and let $x=1$ to get $B$. Guess what? Differentiate again and put $x=1$ to get $A$.

-
Interesting. This seems like Geoff's method in a slightly different phrasing. – Gadi A Aug 9 '11 at 11:13
@Gadi, yes, but I posted 5 minutes earlier. – Gerry Myerson Aug 9 '11 at 13:01

When you do that thing, you use the fact that the polynomials $1$,$(1-x)$, $(1-x)^2$, $(1-x)^3$ and $(1-x)^4$ form a basis of the vector space of polynomials of degree $\le 4$, and thus you try to express $3-7x+9x^2-3x^3$ as a linear combination of $(1-x)$, ... $(1-x)^4$. Clearly since the polynomial you're dealing with has degree $3$, so that you don't need the degree $4$ term (i.e. we are sure that the coefficient in front of it is $0$, so we don't need a term of the form "$E(1-x)^4$"). This leaves you with the following system : $$3-7x+9x^2-3x^3 = A + B(1-x) + C(1-x)^2 + D(1-x)^3$$ The "dirty work" you are saying is always going to be linear algebra, and unless you do calculation by hand (and this might involve tricks, like plugging in numbers, differentiating, manipulations, etc), the only easy trick (the one in which you just "apply a formula") there is is to form a matrix and invert it. To see how this could go, write your polynomial in the form $(3,-7,9,-3)$, which is its writing over the standard basis $\{1,x,x^2,x^3\}$. With that in mind, expand the polynomials on the RHS to find $$A + B(1-x) + C(1-x)^2 + D(1-x)^3 = (A+B+C+D) + (-B-2C-3D)x + (C+D)x^2 + (-D)x^3.$$ This means that a polynomial written over the basis $\{1,(1-x),(1-x)^2,(1-x)^3\}$ with coefficients $(A,B,C,D)$ gets mapped to a polynomial written over the basis $\{1,x,x^2,x^3\}$ with coefficients $(A+B+C+D,-B-2C-3D,C+D,-D)$. This means $$\begin{bmatrix} 3 \\ -7 \\ 9 \\ -3 \\ \end{bmatrix} = \begin{bmatrix} A+B+C+D \\ -B-2C-3D \\ C+3D \\ -D \\ \end{bmatrix} = \begin{bmatrix} 1 & 1 & 1 & 1 \\ 0 & -1 & -2 & -3 \\ 0 & 0 & 1 & 3 \\ 0 & 0 & 0 & -1 \\ \end{bmatrix} \begin{bmatrix} A \\ B \\ C \\ D \\ \end{bmatrix}$$ So that if you invert the matrix and multiply it by your vector of coefficients you get the new vector $(A,B,C,D)$ with your requested coefficients. Dividing the first equation above gives you what you wanted.

This is far from being the most quick way to do it by hand since we humans are very lazy to invert matrices =) But as Gerry Myerson and Geoff Robinson have shown, there are ways to find some coefficients quickly and that simplifies the work.

Hope that helps,

-
You don't need $(1-x)^4$, true, but you do need 4 basis elements. The one you're using without explicitly saying so is $(1-x)^0$, better known as $1$. – Gerry Myerson Aug 9 '11 at 9:43
Oh, and it's seldom a good idea to solve a system of linear equations by inverting the matrix - use row-reduction instead. This matrix is already row-reduced, so you can read off the solutions by back-substitution. Clearly $D=3$, then from the 3rd equation $C=6$, etc. Of course, these are wrong, because the coefficient of $x^2$ should be $C+3D$. – Gerry Myerson Aug 9 '11 at 9:48
"Inverting the matrix", "row-reduction"... you can invert the matrix with your favorite method :P right for the 3d, I'll correct that. – Patrick Da Silva Aug 9 '11 at 9:53