Expansion into partial fractions I've the following fractions given:


*

*$$\frac{a_0\cdot k_0}{b_0\cdot x + b_1\cdot x^2 + b_2 \cdot x^3 + b_4\cdot x^4+b_4\cdot x^4+b_5\cdot x^5}$$

*$$\frac{a_0\cdot k_0}{b_0\cdot x^2 + b_1\cdot x^3 + b_2 \cdot x^4 + b_3\cdot x^5+b_4\cdot x^6}$$

*$$v_0 \cdot \frac{b_1+b_2\cdot x+b_3\cdot x^2+b_4\cdot x^3}{b_0+b_1\cdot x + b_2\cdot x^2 + b_3 \cdot x^3 + b_4\cdot x^4}$$

*$$v_2\cdot \frac{b_4}{b_0+b_1\cdot x + b_2\cdot x^2 + b_3 \cdot x^3 + b_4\cdot x^4}$$
I need them "rewritten" in partial fractions. So I get:


*

*$$a_0\cdot k_0\cdot \biggl[\frac{c_1}{x-d_1} + \frac{c_2}{x-d_2}+ \frac{c_3}{x-d_3}+ \frac{c_4}{x-d_4}+ \frac{c_5}{x-d_5} \biggr]$$

*$$a_0\cdot k_0\cdot \biggl[\frac{f_1}{x-g_1} + \frac{f_2}{x-g_2}+ \frac{f_3}{x-g_3}+ \frac{c_g}{x-f_4}+ \frac{f_5}{g-d_5}+\frac{f_6}{x-g_6} \biggr]$$

*$$v_0\cdot\biggl[\frac{h_1}{x-j_1} + \frac{h_2}{x-j_2}+ \frac{h_3}{x-j_3}+ \frac{h_4}{x-j_4}\biggr]$$

*$$v_2\cdot\biggl[\frac{k_1}{x-l_1} + \frac{k_2}{x-l_2}+ \frac{k_3}{x-l_3}+ \frac{k_4}{x-l_4}\biggr]$$


... are those correct? Or are there some mistakes in these fractions?
Does anyone know how I can perform this decomposition symbolic with matlab?
Thank you in advance!
 A: It Matlab you can take advantage of the MuPAD function partfrac (documentation). In the case of your first fraction (some of the indexes seem like they might be typos, but I used what was in your question):
syms a0 b0 k0 x;
b = [b0 sym('b',[1 5])];
f = a0*k0/sum(b.*x.^[1:4 4 5])
pf = feval(symengine,'partfrac',f,x)
pretty(expand(pf))

which returns
pf =
    a0 k0   a0 b1 k0   a0 b2 k0 x   a0 b3 k0 x    a0 b4 k0 x    a0 b5 k0 x
    ----- - -------- - ---------- - ----------- - ----------- - -----------
     b0 x      #1          #1            #1            #1            #1

    where

               2                    2          3          3          4
       #1 == b0  + b0 b1 x + b0 b2 x  + b0 b3 x  + b0 b4 x  + b0 b5 x

I recommend reading about the options for the partfrac function. You can use the 'Full' option to expand into linear factors, but the example above doesn't do so simply with arbitrary coefficients (you should use assumptions if you know anything about there values and domains). You can read more about calling MuPAD functions from within Matlab here.
If you have numeric rather than symbolic coefficients, you should use residue (documentation) instead. Read more here.
