Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## #1737 unsimplified result from integrate

closed
nobody
None
4
2009-08-31
2009-08-21
Barton Willis
No

(%i14) :lisp(defun \$pprint (x) (let ((*print-circle* nil)) (print x)));

(%i26) integrate(1/x/sqrt(x^2-1),x);
(%o26) -asin(1/abs(x))

The mabs expression is missing a simp flag

(%i27) pprint(%);
((MTIMES SIMP) -1 ((%ASIN SIMP) ((MEXPT SIMP) ((MABS) \$X) -1)))
(%o27) -asin(1/abs(x))

After another simplification, all is well

(%i28) expand(%,0,0);
(%o28) -asin(1/abs(x))
(%i29) pprint(%);
((MTIMES SIMP) -1 ((%ASIN SIMP) ((MEXPT SIMP) ((MABS SIMP) \$X) -1)))
(%o29) -asin(1/abs(x))

## Discussion

• Dieter Kaiser
2009-08-30

The problem is in the routine den1den1 in the file irinte.lisp.

This is the improved code to get a correct simplified expression:

(defun den1den1 (c b a x)
(let ((exp2 (add (mul b x) a a)) ; exp2 = b*x+2*a
(exp3 (inv (simplify (list '(mabs) x))))) ; exp3 = 1/abs(x)
...

Dieter Kaiser

• Dieter Kaiser
2009-08-31

The suggested fix has been committed.

The following example now simplifies correctly:

(%i5) assume(x>0)\$
(%i6) integrate(1/x/sqrt(x^2-1),x);
(%o6) -asin(1/x)

Closing this bug report as fixed.
Dieter Kaiser

• Dieter Kaiser
2009-08-31

• status: open --> closed