# [Maxima] Unsimplified integral from rischint

Dieter Kaiser drdieterkaiser at web.de
Thu Sep 3 17:11:04 CDT 2009

```In the test file rtest5.mac example 48 gives an expected error:

/* test fails because it's not simplified -- do ?print(integrate(%
e^x*erf(x),x)) */

integrate(%e^x*erf(x),x);
%e^x*erf(x)-%e^(1/4)*erf(x-1/2)\$

I had a look at the risch algorithm to find the reason for the error and
I have found it in the routine getfncoeff. I have done a comment into
the corrected code:

(defun getfncoeff (a form)
(cond ((null a) 0)
((equal (car a) 0) (getfncoeff (cdr a) form))
((eq (caaar a) 'mplus) (ratpl (getfncoeff (cdar a) form)
(getfncoeff (cdr a) form)))
((eq (caaar a) 'mtimes)
(destructuring-let (((coef . newfn) (getfnsplit (cdar a))))

; (car a) is a mtimes expression. We insert coef and newfn as the
; new arguments to the mtimes expression. This causes problems if
;   (1) coef is a mtimes expression too and
;   (2) (car a) has already a simp flag
; We get a nested mtimes expression, which does not further simplify.
;	   (setf (cdar a) (list coef newfn))

;; Insert a complete mtimes expression without simpflag.
;; Nested mtimes expressions simplify further.
(setf (car a) (list '(mtimes) coef newfn))
...

With this change to the code example 48 in rtest5.mac will work. There
are no other changes to the testsuite or share_testsuite.