 partial fractions - Maple Help

convert/parfrac

convert to partial fraction form Calling Sequence convert(f, parfrac) convert(f, parfrac, x) convert(f, parfrac, K) convert(f, parfrac, x, K) convert(flist, parfrac, x) Parameters

 f - rational function in x x - main variable name K - (optional) real, complex, a field extension, true, false, sqrfree flist - list consisting of the numerator, prefactored denominator, and powers (this is a programmer entry point) Description

 • Convert to parfrac performs a partial fraction decomposition of the rational function f in the variable x.
 • If no x is provided, parfrac attempts to determine a suitable x, and proceeds if the operation is not ambiguous. For example, an expression that is a rational polynomial in both $a$ and $b$ requires that the variable be specified.
 • The optional argument K specifies how the denominator in f is to be factored.  If this argument is not specified, the denominator is factored by the factor command, which factors over the field implied by the coefficients present.
 • If the optional argument K is real (or complex), then a real (complex) floating-point factorization of the denominator is performed.
 Note: This is implemented only for the univariate case.
 • If the argument K is RootOf or a radical or a list or set of RootOfs or radicals, then the denominators are factored over the algebraic number field implied by the field extensions K.
 • If the argument K is the name sqrfree' then a square-free partial factorization is computed. A square-free factorization of the denominator in x is computed.
 • If the last argument is true', this declares that the denominator of f is already in the desired factored form, and no factorization is required.
 Note: Such a partial fraction decomposition can be done only if the factors in the denominator are relatively prime to each other.
 • If the programmer entry point form is used, then x must be a name, and the input flist must have the form:
 $[n,[\mathrm{f1},\mathrm{p1}],[\mathrm{f2},\mathrm{p2}],...]$
 where $n$ is the numerator, and ${\mathrm{f1}}^{\mathrm{p1}},{\mathrm{f2}}^{\mathrm{p2}},...$ are the denominator factors. All $\mathrm{f1},\mathrm{f2},...$ must be relatively prime, and all $\mathrm{p1},\mathrm{p2},...$ must be positive integer values.
 • The programmer form also provides the output in a different form:
 $[p,[\mathrm{f1},\mathrm{n11},\mathrm{n12},...],[\mathrm{f2},\mathrm{n21},\mathrm{n22},...],...]$
 where $p$ is the polynomial part, $\mathrm{f1},\mathrm{f2},...$ are as in the input, and the $\mathrm{n11},\mathrm{n12},...$ are the numerators of the partial fraction form such that the algebraic partial fraction form can be obtained as:
 $p+\frac{\mathrm{n11}}{\mathrm{f1}}+\frac{\mathrm{n12}}{{\mathrm{f1}}^{2}}+...+\frac{\mathrm{n21}}{\mathrm{f2}}+\frac{\mathrm{n22}}{{\mathrm{f2}}^{2}}+...$
 • Note: The programmer form output is dense, meaning all zero coefficients are included, and the polynomial part is always included (even if zero). Examples

 > $f≔\frac{{x}^{5}+1}{{x}^{4}-{x}^{2}}$
 ${f}{≔}\frac{{{x}}^{{5}}{+}{1}}{{{x}}^{{4}}{-}{{x}}^{{2}}}$ (1)
 > $\mathrm{convert}\left(f,\mathrm{parfrac},x\right)$
 ${x}{+}\frac{{1}}{{x}{-}{1}}{-}\frac{{1}}{{{x}}^{{2}}}$ (2)
 > $\mathrm{convert}\left(f,\mathrm{parfrac}\right)$
 ${x}{+}\frac{{1}}{{x}{-}{1}}{-}\frac{{1}}{{{x}}^{{2}}}$ (3)
 > $f≔\frac{x}{{\left(x-b\right)}^{2}}$
 ${f}{≔}\frac{{x}}{{\left({x}{-}{b}\right)}^{{2}}}$ (4)
 > $\mathrm{convert}\left(f,\mathrm{parfrac},x\right)$
 $\frac{{1}}{{x}{-}{b}}{+}\frac{{b}}{{\left({x}{-}{b}\right)}^{{2}}}$ (5)

Note: This is an error because Maple cannot determine whether to use x or b.

 > $\mathrm{convert}\left(f,\mathrm{parfrac}\right)$
 > $f≔\frac{2.3x}{5.4{x}^{3}-2.3x+1}$
 ${f}{≔}\frac{{2.3}{}{x}}{{5.4}{}{{x}}^{{3}}{-}{2.3}{}{x}{+}{1}}$ (6)
 > $\mathrm{convert}\left(f,\mathrm{parfrac},x\right)$
 $\frac{{0.224031228437975}{}{x}{+}{0.0633606213907298}}{{{x}}^{{2}}{-}{0.809184744236785}{}{x}{+}{0.228854024379624}}{-}\frac{{0.224031228437975}}{{x}{+}{0.809184744236785}}$ (7)
 > $\mathrm{convert}\left(f,\mathrm{parfrac},x,\mathrm{complex}\right)$
 $\frac{{0.112015614218987}{-}{0.301653861716895}{}{I}}{{x}{-}{0.404592372118392}{-}{0.255262681963574}{}{I}}{+}\frac{{0.112015614218987}{+}{0.301653861716895}{}{I}}{{x}{-}{0.404592372118392}{+}{0.255262681963574}{}{I}}{-}\frac{{0.224031228437975}}{{x}{+}{0.809184744236785}}$ (8)
 > $f≔\frac{4{x}^{3}-6{x}^{2}-2}{{x}^{4}-2{x}^{3}-2x+4}$
 ${f}{≔}\frac{{4}{}{{x}}^{{3}}{-}{6}{}{{x}}^{{2}}{-}{2}}{{{x}}^{{4}}{-}{2}{}{{x}}^{{3}}{-}{2}{}{x}{+}{4}}$ (9)
 > $\mathrm{convert}\left(f,\mathrm{parfrac},x\right)$
 $\frac{{3}{}{{x}}^{{2}}}{{{x}}^{{3}}{-}{2}}{+}\frac{{1}}{{x}{-}{2}}$ (10)

The cubic factor (x^3-2) does not factor over the integers.

 > $\mathrm{convert}\left(f,\mathrm{parfrac},x,{2}^{\frac{1}{3}}\right)$
 $\frac{{-}{2}{}{x}{-}{{2}}^{{1}}{{3}}}}{{-}{{2}}^{{2}}{{3}}}{-}{{2}}^{{1}}{{3}}}{}{x}{-}{{x}}^{{2}}}{-}\frac{{6}}{\left({{2}}^{{1}}{{3}}}{-}{2}\right){}\left({{2}}^{{2}}{{3}}}{+}{2}{}{{2}}^{{1}}{{3}}}{+}{4}\right){}\left({x}{-}{2}\right)}{+}\frac{\left({{2}}^{{2}}{{3}}}{-}{1}\right){}{{2}}^{{1}}{{3}}}}{\left({{2}}^{{1}}{{3}}}{-}{2}\right){}\left({-}{x}{+}{{2}}^{{1}}{{3}}}\right)}$ (11)
 > $\mathrm{convert}\left(f,\mathrm{parfrac},x,\mathrm{real}\right)$
 $\frac{{1.00000000000000}}{{x}{-}{2.}}{+}\frac{{1.00000000000000}}{{x}{-}{1.25992104989487}}{+}\frac{{2.}{}{x}{+}{1.25992104989487}}{{{x}}^{{2}}{+}{1.25992104989487}{}{x}{+}{1.58740105196820}}$ (12)
 > $\mathrm{convert}\left(f,\mathrm{parfrac},x,\mathrm{complex}\right)$
 $\frac{{1.00000000000000}{+}{4.44089209850062}{×}{{10}}^{{-16}}{}{I}}{{x}{-}{2.}}{+}\frac{{0.999999999999999}{-}{4.52026797604398}{×}{{10}}^{{-16}}{}{I}}{{x}{-}{1.25992104989487}}{+}\frac{{1.00000000000000}{+}{1.28868884147498}{×}{{10}}^{{-16}}{}{I}}{{x}{+}{0.629960524947437}{+}{1.09112363597172}{}{I}}{+}\frac{{1.}{-}{1.20931296393162}{×}{{10}}^{{-16}}{}{I}}{{x}{+}{0.629960524947437}{-}{1.09112363597172}{}{I}}$ (13)
 > $p≔{x}^{5}-2{x}^{4}-2{x}^{3}+4{x}^{2}+x-2:$
 > $f≔\frac{36}{p}$
 ${f}{≔}\frac{{36}}{{{x}}^{{5}}{-}{2}{}{{x}}^{{4}}{-}{2}{}{{x}}^{{3}}{+}{4}{}{{x}}^{{2}}{+}{x}{-}{2}}$ (14)
 > $\mathrm{convert}\left(f,\mathrm{parfrac},x\right)$
 ${-}\frac{{4}}{{x}{+}{1}}{+}\frac{{4}}{{x}{-}{2}}{-}\frac{{9}}{{\left({x}{-}{1}\right)}^{{2}}}{-}\frac{{3}}{{\left({x}{+}{1}\right)}^{{2}}}$ (15)
 > $\mathrm{convert}\left(f,\mathrm{parfrac},x,\mathrm{sqrfree}\right)$
 $\frac{{-}{4}{}{x}{-}{8}}{{{x}}^{{2}}{-}{1}}{+}\frac{{4}}{{x}{-}{2}}{+}\frac{{-}{12}{}{x}{-}{24}}{{\left({{x}}^{{2}}{-}{1}\right)}^{{2}}}$ (16)
 > $f≔\frac{36}{\mathrm{convert}\left(p,\mathrm{sqrfree},x\right)}$
 ${f}{≔}\frac{{36}}{\left({x}{-}{2}\right){}{\left({{x}}^{{2}}{-}{1}\right)}^{{2}}}$ (17)
 > $\mathrm{convert}\left(f,\mathrm{parfrac},x,\mathrm{true}\right)$
 $\frac{{-}{4}{}{x}{-}{8}}{{{x}}^{{2}}{-}{1}}{+}\frac{{4}}{{x}{-}{2}}{+}\frac{{-}{12}{}{x}{-}{24}}{{\left({{x}}^{{2}}{-}{1}\right)}^{{2}}}$ (18)

Programmer entry point form,

 > $\mathrm{fl}≔\left[4{x}^{3}-6{x}^{2}-2,\left[x-2,2\right],\left[{x}^{3}-2,1\right]\right]$
 ${\mathrm{fl}}{≔}\left[{4}{}{{x}}^{{3}}{-}{6}{}{{x}}^{{2}}{-}{2}{,}\left[{x}{-}{2}{,}{2}\right]{,}\left[{{x}}^{{3}}{-}{2}{,}{1}\right]\right]$ (19)
 > $\mathrm{pl}≔\mathrm{convert}\left(\mathrm{fl},\mathrm{parfrac},x\right)$
 ${\mathrm{pl}}{≔}\left[{0}{,}\left[{x}{-}{2}{,}{2}{,}{1}\right]{,}\left[{{x}}^{{3}}{-}{2}{,}{-}{2}{}{{x}}^{{2}}{-}{x}{-}{2}\right]\right]$ (20)

which you can compare to the regular form.

 > $f≔\frac{\mathrm{fl}\left[1\right]}{\mathrm{mul}\left({i\left[1\right]}^{i\left[2\right]},i=\mathrm{fl}\left[2..-1\right]\right)}$
 ${f}{≔}\frac{{4}{}{{x}}^{{3}}{-}{6}{}{{x}}^{{2}}{-}{2}}{{\left({x}{-}{2}\right)}^{{2}}{}\left({{x}}^{{3}}{-}{2}\right)}$ (21)
 > $p≔\mathrm{convert}\left(f,\mathrm{parfrac},x,\mathrm{true}\right)$
 ${p}{≔}\frac{{1}}{{\left({x}{-}{2}\right)}^{{2}}}{+}\frac{{-}{2}{}{{x}}^{{2}}{-}{x}{-}{2}}{{{x}}^{{3}}{-}{2}}{+}\frac{{2}}{{x}{-}{2}}$ (22)
 > $\mathrm{pl}\left[1\right]+\mathrm{add}\left(\mathrm{add}\left(\frac{i\left[j\right]}{{i\left[1\right]}^{j-1}},j=2..\mathrm{nops}\left(i\right)\right),i=\mathrm{pl}\left[2..-1\right]\right)$
 $\frac{{1}}{{\left({x}{-}{2}\right)}^{{2}}}{+}\frac{{-}{2}{}{{x}}^{{2}}{-}{x}{-}{2}}{{{x}}^{{3}}{-}{2}}{+}\frac{{2}}{{x}{-}{2}}$ (23)