Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.
Close
From: <geriko@ma...>  20101129 17:42:50

Integrals for some relatively simple functions cannot be computed by maxima. For instance. for sqrt(x+sqrt(1+x^2))/x integral is (sqrt(1+x^2)*(x+sqrt(1+x^2))*(2*sqrt(x+sqrt(1+x^2))2*atan(sqrt(x+sqrt(1+x^2)))+log(1+sqrt(x+sqrt(1+x^2)))log(1+sqrt(x+sqrt(1+x^2)))))/(1+x^2+x*sqrt(1+x^2)) latest maxima (5.22.1) is not able to compute that: > maxima Maxima 5.22.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.14gentoo Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) integrate(sqrt(x+sqrt(1+x^2))/x, x); / 2 [ sqrt(sqrt(x + 1) + x) (%o1) I  dx ] x / Tried it with a few previous versions of maxima with the same result. Regards, G. 
From: SourceForge.net <noreply@so...>  20090528 12:39:52

Bugs item #2797885, was opened at 20090528 12:39 Message generated for change (Tracker Item Submitted) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2797885&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: problem with integration Initial Comment: (%i3) integrate((%e**(%i*x))*sin(x),x); Division by 0  an error. To debug this try debugmode(true); (%i4) integrate((cos(x) + %i*sin(x))*sin(x),x); sin(2 x) %i (x  ) 2 2 cos (x) (%o4)    2 2 Maxima version: 5.18.1 Maxima build date: 11:35 5/25/2009 host type: i686pclinuxgnuoldld lispimplementationtype: CLISP lispimplementationversion: 2.44.1 (20080223) (built 3437275172) (memory 3452232938) Maybe I don't know something... maybe some mathematic details? Or maybe maxima is using two different methods in each case?  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2797885&group_id=4933 
From: SourceForge.net <noreply@so...>  20090528 17:21:18

Bugs item #2797885, was opened at 20090528 14:39 Message generated for change (Comment added) made by crategus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2797885&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None >Group: Includes proposed fix Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: problem with integration Initial Comment: (%i3) integrate((%e**(%i*x))*sin(x),x); Division by 0  an error. To debug this try debugmode(true); (%i4) integrate((cos(x) + %i*sin(x))*sin(x),x); sin(2 x) %i (x  ) 2 2 cos (x) (%o4)    2 2 Maxima version: 5.18.1 Maxima build date: 11:35 5/25/2009 host type: i686pclinuxgnuoldld lispimplementationtype: CLISP lispimplementationversion: 2.44.1 (20080223) (built 3437275172) (memory 3452232938) Maybe I don't know something... maybe some mathematic details? Or maybe maxima is using two different methods in each case?  >Comment By: Dieter Kaiser (crategus) Date: 20090528 19:21 Message: The problem is the routine sceint, which uses the following formula: (%i7) integrate(exp(a*x)*sin(b*x),x); (%o7) %e^(a*x)*(a*sin(b*x)b*cos(b*x))/(b^2+a^2) But for a=%i and b=1 this does not work. b^2+a^2 is zero and we get the error division by zero. A correct solution after a fix is: (%i8) integrate(exp(%i*x)*sin(x),x); (%o8) %i*x/2%e^(2*%i*x)/4 This is a possible fix: (defun sceint (exp sc var) (let* ((ecoef (car (islinear (caddr exp) var))) (sccoef (car (islinear (cadr sc) var))) (scarg (cadr sc)) (absval (add (power ecoef 2) (power sccoef 2)))) (if (zerop1 absval) ;; The numerator is zero. Exponentialize the expression ;; and try again. ($expand (integrator ($exponentialize (mul exp sc)) var)) (mul (div exp (add (power ecoef 2) (power sccoef 2))) (add (mul ecoef sc) (if (eq (caar sc) '%sin) (mul* (neg sccoef) `((%cos) ,scarg)) (mul* sccoef `((%sin) ,scarg)))))))) Dieter Kaiser  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2797885&group_id=4933 
From: SourceForge.net <noreply@so...>  20090528 21:43:46

Bugs item #2797885, was opened at 20090528 14:39 Message generated for change (Comment added) made by crategus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2797885&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Includes proposed fix >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: problem with integration Initial Comment: (%i3) integrate((%e**(%i*x))*sin(x),x); Division by 0  an error. To debug this try debugmode(true); (%i4) integrate((cos(x) + %i*sin(x))*sin(x),x); sin(2 x) %i (x  ) 2 2 cos (x) (%o4)    2 2 Maxima version: 5.18.1 Maxima build date: 11:35 5/25/2009 host type: i686pclinuxgnuoldld lispimplementationtype: CLISP lispimplementationversion: 2.44.1 (20080223) (built 3437275172) (memory 3452232938) Maybe I don't know something... maybe some mathematic details? Or maybe maxima is using two different methods in each case?  >Comment By: Dieter Kaiser (crategus) Date: 20090528 23:43 Message: The suggested change has been checked out. Maxima now gets the result: (%i14) expand(integrate(exp(%i*x)*sin(x),x)); (%o14) %i*x/2%e^(2*%i*x)/4 These are the results for related integrands: (%i15) expand(integrate(exp(x)*sin(%i*x),x)); (%o15) %i*%e^(2*x)/4%i*x/2 (%i16) expand(integrate(exp(%i*x)*cos(x),x)); (%o16) x/2%i*%e^(2*%i*x)/4 (%i17) expand(integrate(exp(x)*cos(%i*x),x)); (%o17) %e^(2*x)/4+x/2 Closing this bug report as fixed. Dieter Kaiser  Comment By: Dieter Kaiser (crategus) Date: 20090528 19:21 Message: The problem is the routine sceint, which uses the following formula: (%i7) integrate(exp(a*x)*sin(b*x),x); (%o7) %e^(a*x)*(a*sin(b*x)b*cos(b*x))/(b^2+a^2) But for a=%i and b=1 this does not work. b^2+a^2 is zero and we get the error division by zero. A correct solution after a fix is: (%i8) integrate(exp(%i*x)*sin(x),x); (%o8) %i*x/2%e^(2*%i*x)/4 This is a possible fix: (defun sceint (exp sc var) (let* ((ecoef (car (islinear (caddr exp) var))) (sccoef (car (islinear (cadr sc) var))) (scarg (cadr sc)) (absval (add (power ecoef 2) (power sccoef 2)))) (if (zerop1 absval) ;; The numerator is zero. Exponentialize the expression ;; and try again. ($expand (integrator ($exponentialize (mul exp sc)) var)) (mul (div exp (add (power ecoef 2) (power sccoef 2))) (add (mul ecoef sc) (if (eq (caar sc) '%sin) (mul* (neg sccoef) `((%cos) ,scarg)) (mul* sccoef `((%sin) ,scarg)))))))) Dieter Kaiser  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2797885&group_id=4933 