## #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))\$
(%o4) 0
(%i5) is(%=0);
(%o5) true

Next a detailed solution has bug:
(%i7) assume(abs(x)<1);
(%o7) [abs(x)<1]
(%i8) byparts(f,x,f,x),factor\$
(%i9) sol1:ev(%, nouns),factor\$
Test of sol1:
(%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 - 2011-09-07

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

• Aleksas - 2011-09-10

Correct value of
integrate(acos((x-1/2)/sqrt(1-x^2)),x)

(%i1) f:acos((x-1/2)/sqrt(1-x^2))\$
(%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):
(%o10) 1/((%i*x-%i)*sqrt(8*x^2-4*x-3))
(%i11) is(%=0);
(%o11) false

I think that solution sol2 is correct