enclose code in four tildes before and after
wxMaxima version: 13.4.0
Maxima version: 5.31.1
Maxima build date: 2013-09-24 09:49:12
Host type: i686-pc-mingw32
Lisp implementation type: GNU Common Lisp (GCL)
Lisp implementation version: GCL 2.6.8
(assume(k>0,r>0),display2d:false,ldisp([integrate(r*demoivre(integrate(exp(%i*k*r*w),w,-1,1)),r,0,inf) ,integrate(r*ratsimp(demoivre(integrate(exp(%i*k*r*w),w,-1,1))),r,0,inf)]));
gives
[2*'integrate(sin(k*r),r,0,inf), 2*('integrate(sin(k*r),r,0,inf))/k]
Both expressions should have k in denominator but the first one, without using ratsimp, DOES NOT
- perhaps you can see this easier in the usual fancy display output without using
' display2d:false '
enclose code in four tildes before and after
2nd attempt to format
I've revised the title to reflect what I've figured out.
(1) defint (definite integral) returns 2 different results, depending on form of integrand (either with or without ratsimp). That's a bug.
(2) defint doesn't notice that the integral is divergent. This is a missed opportunity; it should be easy to determine that the integral is divergent.
I've simplified the bug a little bit:
(%i2) foo : r*(%i*(cos(k*r)-%i*sin(k*r))/(k*r)-%i*(%i*sin(k*r)+cos(k*r))/(k*r)) $ (%i3) defint (foo, r, 0, inf); (%o3) 2*'integrate(sin(k*r),r,0,inf) (%i4) defint (ratsimp (foo), r, 0, inf); (%o4) 2*('integrate(sin(k*r),r,0,inf))/k
If defint can't figure out that the integral is divergent, it should return %o4 (with factor 1/k in result).
By the way, the indefinite integral, with or without ratsimp, is correct.
(%i6) integrate (foo, r); (%o6) -2*cos(k*r)/k^2 (%i7) integrate (ratsimp (foo), r); (%o7) -2*cos(k*r)/k^2
Log in to post a comment.