# [Maxima] A partfrac limitation

Robert Marik marik at mendelu.cz
Tue Apr 1 13:58:32 CDT 2008

```Hi Zoltan, I think that there should be denom(e)

my_partfrac(e, x) := partfrac(num(e)/factor_with_solve(denom(e), x), x)\$

Another problem is that factor_with_solve factors over complex numbers. I
used the following:
(factor_with_solve_real is very close to factor_with_solve but gives
factorization over reals)

factor_with_solve_real(expr, n) := block(
[sol, fac, expr1],
sol : solve(expr, n),
expr : ratexpand(expr),
fac : ratcoef(expr, n, hipow(expr, n)),
for i:1 thru length(sol) do (
if not(freeof(n, rhs(sol[i]))) then error(),
if imagpart(rectform(rhs(sol[i])))=0 then
fac : fac * (n - rhs(sol[i]))^multiplicities[i]
else
(if imagpart(rectform(rhs(sol[i])))>0 then
fac:
fac*(ratsimp(expand((n-rhs(sol[i]))*(n-conjugate(rhs(sol[i]))))))^multiplicities[i])

),
if expand(expr)#expand(fac) then error(),
fac
)\$

my_partfrac(e, x) := partfrac(num(e)/factor_with_solve_real(denom(e), x),
x);

Robert M.

On Tue, Apr 1, 2008 at 8:15 PM, Kovács Zoltán <kovzol at matek.hu> wrote:

> Dear All, I have the same problem with partfrac like Albert Reiner had:
>
> kovzol at pascal:~\$ maxima
> Maxima 5.13.0 http://maxima.sourceforge.net
> Using Lisp CLISP 2.38 (2006-01-24)
> Dedicated to the memory of William Schelter.
> This is a development version of Maxima. The function bug_report()
> provides bug reporting information.
> (%i2) my_partfrac(e, x) := partfrac(num(e)/factor_with_solve(e, x), x)\$
> (%i3) my_partfrac(1/(x^4+20*x^2+120), x);
> Division by 0
> #0: my_partfrac(e=1/(x^4+20*x^2+120),x=x)(simplify_sum.mac line 511)
> -- an error.  To debug this try debugmode(true);
>
> Am I using a too old version of Maxima?
>
> Best regards, Zoltan
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080401/df201cf8/attachment.htm
```