# [Maxima] rootsof problem -- design doesn't have enough info!

Richard Fateman fateman at cs.berkeley.edu
Thu May 14 14:08:47 CDT 2009

```Raymond Toy wrote:
> Richard Fateman wrote:
>
>> Who added integrate_use_rootsof  etc?  The essential idea is OK in
>> there, but is problematical.
>>
>>
> I think Bill Schelter added that long ago.
>
> Ray
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
I have a fix for this, which is in one function in sinint.  To test it
integrate_use_rootsof:true\$
integrate(1/(a*x^3+x+1),x);

thnx
RJF

(defun integrate-use-rootsof (f q variable &aux qprime ff qq
;; this program is used if \$integrate_use_rootsof is true,
;; and rational function integration of f/q wrt variable
;; can make use of it.
;;
;; fixed by RJF 5/14/09 to work on non-monic denoms and also
;; add 2nd arg to rootsof, so it makes sense for multivariate polys:
;; the second arg of rootsof is the main variable in the poly wrt
defining roots.

(setq lead (pdisrep(p-lc q)))  ;; inserted pdisprep; rjf
(setq qprime (disrep (pderivative q (p-var q))))
(setq ff (disrep f)
qq (subst dummy variable (disrep q)));put correct variable in poly

`((\$lsum) ((mtimes) ;removed factor of lead, which was just wrong. rjf
,(div*  (subst dummy variable ff)
(subst dummy variable qprime))
((%log) ,(sub* variable  dummy)))  ,dummy
((\$rootsof) ,qq ,dummy))) ; use 2nd arg to rootsof to indicate main var.

```