Possible bug - wrong integral for exp(-k*t)/sqrt(k*t)
Subject: Possible bug - wrong integral for exp(-k*t)/sqrt(k*t)
From: Wolfgang Jenkner
Date: Wed, 10 Mar 2004 09:48:47 +0100
Kevin Ellwood <kellwood@ameritech.net> writes:
> (C1) integrate(exp(-k*t)/sqrt(k*t),t);
>
> (D1) SQRT(%PI) k ERF(SQRT(k t))
> The correct answer is:
>
> SQRT(%PI) ERF(SQRT(k t)) /k
Thanks. Just an inadvertence with sweeping consequences.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: sin.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/sin.lisp,v
retrieving revision 1.4
diff -u -r1.4 sin.lisp
--- sin.lisp 14 Aug 2002 18:46:46 -0000 1.4
+++ sin.lisp 10 Mar 2004 07:28:35 -0000
@@ -535,6 +535,11 @@
((NOT (FLOATP X)) 1)
(T (CDR (MAXIMA-RATIONALIZE X)))))
+;; EXP = f(t,u) where f is some function with, say, VAR = t,
+;; u^k = RATROOT = e*(a*t+b)/(c*t+d), where the smallest possible k
+;; is calculated below.
+;; As always, W is an alist which associates to the coefficients
+;; a, b... (and to VAR) their values.
(DEFUN RATROOT (EXP VAR RATROOT W)
(PROG (ROOTLIST K Y W1)
(COND ((SETQ Y (CHEBYF EXP VAR)) (RETURN Y)))
@@ -569,7 +574,7 @@
((MEXPT) VAR ((MPLUS) -1 K))))))
((MEXPT) ((MPLUS)
((MTIMES) C ((MEXPT) VAR K))
- ((MTIMES) -1 A))
+ ((MTIMES) -1 A e))
2)))))
VAR))
(RETURN (SUBSTINT (SIMPLIFY (LIST '(MEXPT)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wolfgang