factor bug?



Should factor() give abs(x) in this example?

(%i15) display2d:false;
(%o15) false
(%i16) kill(all);
(%o0) done
(%i1) integrate(asec(x),x);
(%o1) x*asec(x)-log(sqrt(1-1/x^2)+1)/2+log(sqrt(1-1/x^2)-1)/2
(%i2) factor(%);
(%o2) -(log((abs(x)+sqrt(x^2-1))/abs(x))-log((sqrt(x^2-1)-abs(x))/abs(x))-2*x*asec(x))/2
(%i3) diff(%,x);
(%o3) -(abs(x)*(('diff(abs(x),x,1)+x/sqrt(x^2-1))/abs(x)-(abs(x)+sqrt(x^2-1))*'diff(abs(x),x,1)/x^2)/(abs(x)+sqrt(x^2-1))
        -abs(x)*((x/sqrt(x^2-1)-'diff(abs(x),x,1))/abs(x)-(sqrt(x^2-1)-abs(x))*'diff(abs(x),x,1)/x^2)/(sqrt(x^2-1)-abs(x))-2*asec(x)
        -2/(sqrt(1-1/x^2)*x))
        /2
(%i4) trigsimp(%);
(%o4) ((x^3-x)*'diff(abs(x),x,1)+(1-x^2)*abs(x)+x*sqrt(x^2-1)*asec(x))/(x*sqrt(x^2-1))
(%i5) build_info();

Maxima version: 5.25.0
Maxima build date: 16:14 8/15/2011
Host type: i686-pc-mingw32
Lisp implementation type: GNU Common Lisp (GCL)
Lisp implementation version: GCL 2.6.8

You cannot get back to asec(x) after factoring, but you can if you don?t factor.

Rich