SourceForge has been redesigned. Learn more.
Close

#2270 integrate bug

open
nobody
None
5
2012-11-18
2011-09-07
Aleksas
No

Wrong:
(%i1) integrate(acos((x-1/2)/sqrt(1-x^2)),x);
(%o1) -(%pi*x)/2

The result should be
(%i2) sol:(2^(3/2)*x*acos((2*x-1)/(2*sqrt(1-x^2)))
-sqrt(2)*asin((10*x+1)/(2*sqrt(7)*(x+1)))
+sqrt(2)*asin((6*x-5)/(2*sqrt(7)*(x-1)))
+asin((4*x-1)/sqrt(7)))/2^(3/2)$
Test of sol:
(%i3) f:acos((x-1/2)/sqrt(1-x^2))$
(%i4) diff(sol,x)-f,radcan;
(%o4) 0
(%i5) is(%=0);
(%o5) true

Next a detailed solution has bug:
(%i6) load(bypart)$
(%i7) assume(abs(x)<1);
(%o7) [abs(x)<1]
(%i8) byparts(f,x,f,x),factor$
(%i9) sol1:ev(%, nouns),factor$
Test of sol1:
(%i10) diff(sol1,x)-f,radcan$
(%i11) is(%=0);
(%o11) false

Note: this integral is from
http://www.math.utexas.edu/pipermail/maxima/2011/025866.html
(%i12) S1:'integrate(acos((2*c+k*u)/sqrt((1-k^2/4)*(1-u^2))),u)$
(%i13) subst([k=2/sqrt(5),c=-1/2/sqrt(5)],S1),factor;
(%o13) integrate(acos((2*u-1)/(2*sqrt(1-u^2))),u)

Discussion

  • Aleksas

    Aleksas - 2011-09-07

    WolframAlpha solution of this problem is not correct.
    The result is undefined for x=0 (in real domain).

     
  • Aleksas

    Aleksas - 2011-09-10

    Correct value of
    integrate(acos((x-1/2)/sqrt(1-x^2)),x)
    and "radcan" bug

    (%i1) f:acos((x-1/2)/sqrt(1-x^2))$
    (%i2) load(bypart)$
    (%i3) assume(abs(x)<1)$
    (%i4) byparts(f,x,f,1),factor$
    (%i5) sol2:ev(%, nouns),factor;
    (%o5) (2^(3/2)*x*acos((2*x-1)/(2*sqrt(1-x^2)))
    -sqrt(2)*asin((10*x+1)/(2*sqrt(7)*(x+1)))
    -sqrt(2)*asin((6*x-5)/(2*sqrt(7)*(x-1)))
    +asin((4*x-1)/sqrt(7)))/2^(3/2)

    Test of solution(the first method):
    (%i6) diff(sol2,x)-f$ factor(%);
    (%o7) 0
    (%i8) is(%=0);
    (%o8) true

    Test of solution(the second method):
    (%i9) diff(sol2,x)-f$ radcan(%);
    (%o10) 1/((%i*x-%i)*sqrt(8*x^2-4*x-3))
    (%i11) is(%=0);
    (%o11) false

    I think that solution sol2 is correct
    and "radcan" has bug

    (%i12) build_info()$
    Maxima version: 5.25.0
    Maxima build date: 12:0 8/2/2011
    Host type: i686-pc-mingw32
    Lisp implementation type: Clozure Common Lisp
    Lisp implementation version: Version 1.7-r14925M (WindowsX8632)

     

Log in to post a comment.