Dear Nils, Thanks for your answer! Even if the symbolic integration techniques that maxima uses cannot tackle this problem, it would be good if the computer could somehow catch that there is a problem instead of returning the wrong answer.
Best wishes, Anne On 7/19/14 6:33 PM, Nils Bruin wrote: > On Sat, 19 Jul 2014, Anne Schilling wrote: > >> That answer is wrong as is the symbolic integral for the double integral. >> The answer should be 4/\pi. > > Yep, the integrand fails to be differentiable for x=1/2 and if you look at > the antiderivative that maxima chooses, you'll notice the use of "sgn" > which blows up horribly for arguments equal to 0. I'm not an expert on > symbolic integration algorithms. Even if you write out the the function > entirely in real-valued components: > > sage: A=e^(2*I*pi*x) + 1 > sage: B=sqrt(A.real()^2+A.imag()^2) > sage: B.simplify() > sqrt((cos(2*pi*x) + 1)^2 + sin(2*pi*x)^2) > > (this simplification is a little scary in its own right: it's assuming x > is real without me telling it! But then again, "simplify" is always at > your own risk) > > you'll get an antiderivative that has trouble at x=1/2 (a vanishing > denominator, so you get bad results from that as well: > > sage: integrate(B.simplify(),x,0,1) > 0 > > I think the problem is that in principle, B would have an antiderivative, > but it would only be once continuously differentiable at x=1/2, and it > doesn't seem such functions can be produced by the integration algorithms > used. So an antiderivative is produced that is discontinuous at x=1/2 and > problems ensue. I suspect that this kind of integral fundamentally cannot > be tackled with the symbolic integration techniques that maxima uses. > > -------------------------------------------------------- > Nils Bruin Department of Mathematics > PIMS-SFU Site Director Simon Fraser University > telephone: (778) 782 3794 Burnaby, BC > fax: (778) 782 4947 CANADA, V5A 1S6 > e-mail: nbr...@cecm.sfu.ca > WWW: http://www.cecm.sfu.ca/~nbruin -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.