SIN integration patch (chebyf)



This gives a lisp error

integrate(sqrt(k*t)*t,t);

The same is true if we give the integrand a different shape

integrate(k*t^2/sqrt(k*t),t);

Some other integrals are returned in noun form

integrate(sqrt(k*t)*t^(1/3),t);

So this does not seem to be a simplification issue but an actual
integration bug, for which I propose the following patch.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: sin.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/sin.lisp,v
retrieving revision 1.5
diff -u -r1.5 sin.lisp
--- sin.lisp	11 Mar 2004 04:55:24 -0000	1.5
+++ sin.lisp	31 Mar 2004 18:42:16 -0000
@@ -585,6 +585,7 @@
 
 (DEFUN SUBST41 (EXP A B) (SUBST4 EXP)) 
 
+;; exp = a*t^r1*(c1+c2*t^q)^r2, where var = t.
 (DEFUN CHEBYF (EXP VAR) 
   (PROG (R1 R2 D1 D2 N1 N2 W Q) 
 	(COND ((NOT (SETQ W
@@ -601,6 +602,15 @@
 				((COEFFTT) (A FREEVAR)))
 			      NIL)))
 	       (RETURN NIL)))
+	(when (zerop1 (cdr (sassq 'c1 w #'nill)))
+	  (return
+	    (mul*
+	     ;; This factor is locally constant as long as t and
+	     ;; c2*t^q avoid log's branch cut.
+	     (subliss w '((mtimes) a ((mexpt) var ((mtimes) -1 q r2))
+			  ((mexpt) ((mtimes) c2 ((mexpt) var q)) r2)))
+	     (integrator
+	      (subliss w '((mexpt) var ((mplus) r1 ((mtimes) q r2)))) var))))
 	(SETQ Q (CDR (SASSQ 'Q W 'NILL)))
 	(SETQ 
 	 W
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Wolfgang