Thanks Robert for such a helpful reply. There is no problem in having
things hard coded. If everything was a variable we'd never get off the
ground!
I couldn't get your sin.lisp to load but this did point the way to the
following code which does the job. I've placed this into a newsin.lisp
file and then load it via the load("newsin.lisp") command. Did I miss
something with what you sent?
Thanks
Chris
--------------------------------
(defmvar $integration_constant '$k)
(defmfun sinint (exp var)
;; *integrator-level* is a recursion counter for INTEGRATOR. See
;; INTEGRATOR for more details. Initialize it here.
(let ((*integrator-level* 0))
(declare (special *integrator-level*))
(cond ((mnump var) (merror "Attempt to integrate wrt a number: ~:M"
var))
(($ratp var) (sinint exp (ratdisrep var)))
(($ratp exp) (sinint (ratdisrep exp) var))
((mxorlistp exp)
(cons (car exp)
(mapcar #'(lambda (y) (sinint y var)) (cdr exp))))
((mequalp exp)
(list (car exp) (sinint (cadr exp) var)
(add2 (sinint (caddr exp) var)
(concat $integration_constant
(incf $integration_constant_counter)))))
((and (atom var)
(isinop exp var))
(list '(%integrate) exp var))
((let ((ans (simplify
(let ($opsubst varlist genvar stack)
(integrator exp var)))))
(if (sum-of-intsp ans)
(list '(%integrate) exp var)
ans))))))