From: Dan G. <dg...@us...> - 2011-05-18 20:36:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Maxima, A Computer Algebra System". The branch, master has been updated via 120f31e72216cbee3615e617b4570c271d83c9c6 (commit) from 1b0d8a405143f7c55aa45525be8a789883c48697 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 120f31e72216cbee3615e617b4570c271d83c9c6 Author: Dan Gildea <dgildea> Date: Wed May 18 16:33:55 2011 -0400 src/defint.lisp: o intcv: check which root gives inverse of new var of integration fixes Incorrect integral of log(1+a/(x*t)^2) - ID: 3291160 src/limit.lisp: o add comment tests/rtestint.mac: o add integrate(log(1+7/(x^2)),x,1,inf); diff --git a/src/defint.lisp b/src/defint.lisp index b377ab2..2d250d1 100644 --- a/src/defint.lisp +++ b/src/defint.lisp @@ -335,6 +335,15 @@ in the interval of integration.") (t (intcv1 d ind nv)))) (t ())))))) +;; test whether fun2 is inverse of fun1 at val +(defun test-inverse (fun1 var1 fun2 var2 val) + (let* ((out1 (let ((var var1)) + (no-err-sub val fun1))) + (out2 (let ((var var2)) + (no-err-sub out1 fun2)))) + (alike1 val out2))) + +;; integration change of variable (defun intcv (nv ind flag) (let ((d (bx**n+a nv)) (*roots ()) (*failures ()) ($breakup ())) @@ -360,8 +369,14 @@ in the interval of integration.") (t (putprop 'yx t 'internal);; keep var from appearing in questions to user (solve (m+t 'yx (m*t -1 nv)) var 1.) - (cond (*roots - (setq d (caddar *roots)) + (cond ((setq d ;; look for root that is inverse of nv + (do* ((roots *roots (cddr roots)) + (root (caddar roots) (caddar roots))) + ((null root) nil) + (if (test-inverse nv var root 'yx ll) + ;; to do: check upper limit, + ;; test for minf/inf + (return root)))) (cond (flag (intcv2 d ind nv)) (t (intcv1 d ind nv)))) (t ())))))))) diff --git a/src/limit.lisp b/src/limit.lisp index f2c1cc2..aa3eb16 100644 --- a/src/limit.lisp +++ b/src/limit.lisp @@ -232,8 +232,7 @@ It appears in LIMIT and DEFINT.......") (if ans (return (clean-limit-exp ans)) - (return (cons '(%limit) args))))) -; (return (nounlimit exp var val))))) + (return (cons '(%limit) args))))) ;; failure: return nounform (restore-assumptions)))) (defun clean-limit-exp (exp) diff --git a/tests/rtestint.mac b/tests/rtestint.mac index ead8ca3..6d8965f 100644 --- a/tests/rtestint.mac +++ b/tests/rtestint.mac @@ -1359,3 +1359,7 @@ integrate(%e^(-1/x^2),x,0,1); /* definite integration introduces xy variable - ID: 3292707 */ integrate((log((2-x)/2)+log(2))/(1-x), x, 0, 1); 'integrate((log((2-x)/2)+log(2))/(1-x), x, 0, 1); + +/* Incorrect integral of log(1+a/(x*t)^2) - ID: 3291160 */ +integrate(log(1+7/(x^2)),x,1,inf); +(14*atan(sqrt(7))-sqrt(7)*log(8))/sqrt(7); ----------------------------------------------------------------------- Summary of changes: src/defint.lisp | 19 +++++++++++++++++-- src/limit.lisp | 3 +-- tests/rtestint.mac | 4 ++++ 3 files changed, 22 insertions(+), 4 deletions(-) hooks/post-receive -- Maxima, A Computer Algebra System |