Maxima get this results
(%i39) integrate(a^2*(1-cos(t))^2*sqrt(a^2*sin(t)^2+a^2*(1-cos(t))^2), t, 0, 2*%pi);
(%o39) (188*a^3)/15
but Wolfram Alpha's answer is (256 a^3)/15
if you change upper limit to %pi
(%i40) integrate(a^2*(1-cos(t))^2*sqrt(a^2*sin(t)^2+a^2*(1-cos(t))^2), t, 0, %pi);
(%o40) (128*a^3)/15
or change
(%i41) integrate(a^2*(1-cos(t))^2*sqrt(a^2*sin(t)^2+a^2*(1-cos(t))^2), t, %pi, 2*%pi);
(%o41) (128*a^3)/15
the answer is correct.
wxMaxima version: 21.05.2_MSW
using wxWidgets version: wxWidgets 3.1.4
Maxima version: 5.45.1
Maxima build date: 2021-07-04 21:51:12
Host type: x86_64-w64-mingw32
System type: Win32 6.2.9200 X86-64
Lisp implementation type: SBCL
Lisp implementation version: 2.0.0
wxMaxima's idea of the directory layout is:
User configuration dir: C:\Users\serg/maxima/
Help dir: C:\maxima-5.45.1\share/doc/wxmaxima
Thanks for the report, a couple of notes. (1) Looks like the bug still happens with a = 1. I'll look for a simpler example too.
(2) Looks like
integrate
is calling RISCHINT to get an antiderivative, and then evaluating that. Looks like the antiderivative is invalid -- plotting the result fromintegrate(..., t)
(i.e., indefinite integral) shows that it seems to switch from one branch ofsqrt
to the other at t = %pi. So that seems to be a bug in RISCHINT -- it's not noticing the issue withsqrt
.A simpler example which shows the bug is just
For both the original example and the smaller one I found, I see that the result contains
atan2(sin(t), cos(t))
. I think the problem stems from that, not from RISCHINT.Substituting
atan2(sin(t), cos(t)) = t
and then evaluating the result at2*%pi
and 0 yields 256/15 (with a = 1), which agrees with Mma.Plotting
atan2(sin(t), cos(t))
over 0 to2*%pi
shows a jump att = %pi
when it changes from%pi
to- %pi
.Maxima assumes
atan2
returns a result in the range[- %pi, %pi]
instead of[0, 2*%pi]
. I'm not sure what would need to change, but from what I remember, that assumption is pretty deeply ingrained.A related issue is that RISCHINT converts trig functions to complex exponentials and then works on that. I guess we would want to verify that the complex exponential result is correct, so that it's only the final step, involving a complex exponential which ended up as
atan2(sin(t), cos(t))
, is problematic.