text:
using Rubin
using Tests
using Elliptic
using HypergeometricFunctions
using Polylogarithms
using SpecialFunctions

@test integrate(x^4*(a+b*arccosh(c*x))*(d+e*x^2), x) == :(1//5*d*x^5*(a+b*arccosh(c*x))+1//7*e*x^7*(a+b*arccosh(c*x))+-8//3675*b*c^-7*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(30*e+49*d*c^2)+-4//3675*b*c^-5*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(30*e+49*d*c^2)+-1//49*b*e*c^-1*x^6*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-1//1225*b*c^-3*x^4*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(30*e+49*d*c^2))
@test integrate(x^3*(a+b*arccosh(c*x))*(d+e*x^2), x) == :(1//4*d*x^4*(a+b*arccosh(c*x))+1//6*e*x^6*(a+b*arccosh(c*x))+-1//96*b*c^-6*(5*e+9*d*c^2)*arccosh(c*x)+-1//36*b*e*c^-1*x^5*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-1//96*b*x*c^-5*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(5*e+9*d*c^2)+-1//144*b*c^-3*x^3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(5*e+9*d*c^2))
@test integrate(x^2*(a+b*arccosh(c*x))*(d+e*x^2), x) == :(1//3*d*x^3*(a+b*arccosh(c*x))+1//5*e*x^5*(a+b*arccosh(c*x))+-2//225*b*c^-5*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(12*e+25*d*c^2)+-1//25*b*e*c^-1*x^4*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-1//225*b*c^-3*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(12*e+25*d*c^2))
@test integrate(x*(a+b*arccosh(c*x))*(d+e*x^2), x) == :((1/2)*d*x^2*(a+b*arccosh(c*x))+1//4*e*x^4*(a+b*arccosh(c*x))+-1//32*b*c^-4*(3*e+8*d*c^2)*arccosh(c*x)+-1//16*b*e*c^-1*x^3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-1//32*b*x*c^-3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(3*e+8*d*c^2))
@test integrate((a+b*arccosh(c*x))*(d+e*x^2), x) == :(d*x*(a+b*arccosh(c*x))+1//3*e*x^3*(a+b*arccosh(c*x))+-1//9*b*c^-3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(2*e+9*d*c^2)+-1//9*b*e*c^-1*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2))
@test integrate(x^-1*(a+b*arccosh(c*x))*(d+e*x^2), x) == :(d*(a+b*arccosh(c*x))*log(x)+(1/2)*e*x^2*(a+b*arccosh(c*x))+-1//4*b*e*c^-2*arccosh(c*x)+-1//4*b*e*x*c^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+b*d*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)*log(1+-1*exp(2*im*arcsin(c*x)))+-1*b*d*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)*log(x)+-1//2*im*b*d*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)^2+-1//2*im*b*d*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*Polylogarithms.polylog(2,exp(2*im*arcsin(c*x))))
@test integrate(x^-2*(a+b*arccosh(c*x))*(d+e*x^2), x) == :(e*x*(a+b*arccosh(c*x))+-1*d*x^-1*(a+b*arccosh(c*x))+b*c*d*arctan((1+c*x)^(1/2)*(-1+c*x)^(1/2))+-1*b*e*c^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2))
@test integrate(x^-3*(a+b*arccosh(c*x))*(d+e*x^2), x) == :(e*(a+b*arccosh(c*x))*log(x)+-1//2*d*x^-2*(a+b*arccosh(c*x))+(1/2)*b*c*d*x^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+b*e*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)*log(1+-1*exp(2*im*arcsin(c*x)))+-1*b*e*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)*log(x)+-1//2*im*b*e*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)^2+-1//2*im*b*e*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*Polylogarithms.polylog(2,exp(2*im*arcsin(c*x))))
@test integrate(x^-4*(a+b*arccosh(c*x))*(d+e*x^2), x) == :(-1*e*x^-1*(a+b*arccosh(c*x))+-1//3*d*x^-3*(a+b*arccosh(c*x))+1//6*b*c*(6*e+d*c^2)*arctan((1+c*x)^(1/2)*(-1+c*x)^(1/2))+1//6*b*c*d*x^-2*(1+c*x)^(1/2)*(-1+c*x)^(1/2))
@test integrate(x^4*(d+e*x^2)^2*(a+b*arccosh(c*x)), x) == :(1//5*d^2*x^5*(a+b*arccosh(c*x))+1//9*e^2*x^9*(a+b*arccosh(c*x))+2//7*d*e*x^7*(a+b*arccosh(c*x))+-2//945*b*c^-9*(1+c*x)^-1//2*(1+-1*c^2*x^2)^2*(-1+c*x)^-1//2*(70*e^2+63*c^4*d^2+135*d*e*c^2)+1//81*b*c^-9*e^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^5*(-1+c*x)^-1//2+1//315*b*c^-9*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(35*e^2+63*c^4*d^2+90*d*e*c^2)+1//525*b*c^-9*(1+c*x)^-1//2*(1+-1*c^2*x^2)^3*(-1+c*x)^-1//2*(70*e^2+21*c^4*d^2+90*d*e*c^2)+-2//441*b*e*c^-9*(1+c*x)^-1//2*(1+-1*c^2*x^2)^4*(-1+c*x)^-1//2*(14*e+9*d*c^2))
@test integrate(x^3*(d+e*x^2)^2*(a+b*arccosh(c*x)), x) == :(1//4*d^2*x^4*(a+b*arccosh(c*x))+1//8*e^2*x^8*(a+b*arccosh(c*x))+1//3*d*e*x^6*(a+b*arccosh(c*x))+-1//3072*b*c^-8*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(105*e^2+288*c^4*d^2+320*d*e*c^2)*arctanh(c*x*(-1+c^2*x^2)^-1//2)+1//64*b*c^-1*e^2*x^7*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)+1//3072*b*x*c^-7*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(105*e^2+288*c^4*d^2+320*d*e*c^2)+1//4608*b*c^-5*x^3*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(105*e^2+288*c^4*d^2+320*d*e*c^2)+1//1152*b*e*c^-3*x^5*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(21*e+64*d*c^2))
@test integrate(x^2*(d+e*x^2)^2*(a+b*arccosh(c*x)), x) == :(1//3*d^2*x^3*(a+b*arccosh(c*x))+1//7*e^2*x^7*(a+b*arccosh(c*x))+2//5*d*e*x^5*(a+b*arccosh(c*x))+-1//49*b*c^-7*e^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^4*(-1+c*x)^-1//2+-1//315*b*c^-7*(1+c*x)^-1//2*(1+-1*c^2*x^2)^2*(-1+c*x)^-1//2*(45*e^2+35*c^4*d^2+84*d*e*c^2)+1//105*b*c^-7*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(15*e^2+35*c^4*d^2+42*d*e*c^2)+1//175*b*e*c^-7*(1+c*x)^-1//2*(1+-1*c^2*x^2)^3*(-1+c*x)^-1//2*(15*e+14*d*c^2))
@test integrate(x*(d+e*x^2)^2*(a+b*arccosh(c*x)), x) == :(1//6*e^-1*(d+e*x^2)^3*(a+b*arccosh(c*x))+1//36*b*x*c^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^2*(1+-1*c^2*x^2)+1//288*b*x*c^-5*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(15*e^2+44*c^4*d^2+44*d*e*c^2)+5//144*b*x*c^-3*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(d+e*x^2)*(e+2*d*c^2)+-1//96*b*c^-6*e^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+2*d*c^2)*(5*e^2+8*c^4*d^2+8*d*e*c^2)*arctanh(c*x*(-1+c^2*x^2)^-1//2))
@test integrate((d+e*x^2)^2*(a+b*arccosh(c*x)), x) == :(x*d^2*(a+b*arccosh(c*x))+1//5*e^2*x^5*(a+b*arccosh(c*x))+2//3*d*e*x^3*(a+b*arccosh(c*x))+1//15*b*c^-5*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(3*e^2+15*c^4*d^2+10*d*e*c^2)+1//25*b*c^-5*e^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^3*(-1+c*x)^-1//2+-2//45*b*e*c^-5*(1+c*x)^-1//2*(1+-1*c^2*x^2)^2*(-1+c*x)^-1//2*(3*e+5*d*c^2))
@test integrate(x^-3*(d+e*x^2)^2*(a+b*arccosh(c*x)), x) == :((1/2)*e^2*x^2*(a+b*arccosh(c*x))+-1//2*d^2*x^-2*(a+b*arccosh(c*x))+2*d*e*(a+b*arccosh(c*x))*log(x)+-1//4*b*c^-2*e^2*arccosh(c*x)+(1/2)*b*c*d^2*x^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-1//4*b*x*c^-1*e^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-1*im*b*d*e*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)^2+-1*im*b*d*e*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*Polylogarithms.polylog(2,exp(2*im*arcsin(c*x)))+-2*b*d*e*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)*log(x)+2*b*d*e*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)*log(1+-1*exp(2*im*arcsin(c*x))))
@test integrate(x^-4*(d+e*x^2)^2*(a+b*arccosh(c*x)), x) == :(x*e^2*(a+b*arccosh(c*x))+-1//3*d^2*x^-3*(a+b*arccosh(c*x))+-2*d*e*x^-1*(a+b*arccosh(c*x))+b*c^-1*e^2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)+-1//6*b*c*d^2*x^-2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)+1//6*b*c*d*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(12*e+d*c^2)*arctan((-1+c^2*x^2)^(1/2)))
@test integrate(x^4*(d+e*x^2)^3*(a+b*arccosh(c*x)), x) == :(1//5*d^3*x^5*(a+b*arccosh(c*x))+1//11*e^3*x^11*(a+b*arccosh(c*x))+1//3*d*e^2*x^9*(a+b*arccosh(c*x))+3//7*e*d^2*x^7*(a+b*arccosh(c*x))+-1//121*b*c^-11*e^3*(1+c*x)^-1//2*(1+-1*c^2*x^2)^6*(-1+c*x)^-1//2+-1//3465*b*c^-11*(1+c*x)^-1//2*(1+-1*c^2*x^2)^2*(-1+c*x)^-1//2*(525*e^3+462*c^6*d^3+1485*e*c^4*d^2+1540*d*c^2*e^2)+1//1155*b*c^-11*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(105*e^3+231*c^6*d^3+385*d*c^2*e^2+495*e*c^4*d^2)+1//1925*b*c^-11*(1+c*x)^-1//2*(1+-1*c^2*x^2)^3*(-1+c*x)^-1//2*(350*e^3+77*c^6*d^3+495*e*c^4*d^2+770*d*c^2*e^2)+-1//1617*b*e*c^-11*(1+c*x)^-1//2*(1+-1*c^2*x^2)^4*(-1+c*x)^-1//2*(210*e^2+99*c^4*d^2+308*d*e*c^2)+1//297*b*c^-11*e^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^5*(-1+c*x)^-1//2*(15*e+11*d*c^2))
@test integrate(x^3*(d+e*x^2)^3*(a+b*arccosh(c*x)), x) == :(1//10*e^-2*(d+e*x^2)^5*(a+b*arccosh(c*x))+-1//8*d*e^-2*(d+e*x^2)^4*(a+b*arccosh(c*x))+-1//76800*b*x*c^-9*e^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(-1890*e^4+1232*c^8*d^4+-7758*c^4*d^2*e^2+-6615*d*c^2*e^3+-2536*e*c^6*d^3)+1//100*b*x*c^-1*e^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^4*(1+-1*c^2*x^2)+1//5120*b*c^-10*e^-2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(-126*e^5+128*c^10*d^5+-800*c^4*d^2*e^3+-525*d*c^2*e^4+-480*c^6*d^3*e^2)*arctanh(c*x*(-1+c^2*x^2)^-1//2)+-1//38400*b*x*c^-7*e^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(d+e*x^2)*(-630*e^3+136*c^6*d^3+-1617*d*c^2*e^2+-1096*e*c^4*d^2)+1//1600*b*x*c^-3*e^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^3*(1+-1*c^2*x^2)*(18*e+11*d*c^2)+1//9600*b*x*c^-5*e^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^2*(1+-1*c^2*x^2)*(126*e^2+26*c^4*d^2+201*d*e*c^2))
@test integrate(x^2*(d+e*x^2)^3*(a+b*arccosh(c*x)), x) == :(1//3*d^3*x^3*(a+b*arccosh(c*x))+1//9*e^3*x^9*(a+b*arccosh(c*x))+3//5*e*d^2*x^5*(a+b*arccosh(c*x))+3//7*d*e^2*x^7*(a+b*arccosh(c*x))+-1//945*b*c^-9*(1+c*x)^-1//2*(1+-1*c^2*x^2)^2*(-1+c*x)^-1//2*(140*e^3+105*c^6*d^3+378*e*c^4*d^2+405*d*c^2*e^2)+1//81*b*c^-9*e^3*(1+c*x)^-1//2*(1+-1*c^2*x^2)^5*(-1+c*x)^-1//2+1//315*b*c^-9*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(35*e^3+105*c^6*d^3+135*d*c^2*e^2+189*e*c^4*d^2)+-1//441*b*c^-9*e^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^4*(-1+c*x)^-1//2*(28*e+27*d*c^2)+1//525*b*e*c^-9*(1+c*x)^-1//2*(1+-1*c^2*x^2)^3*(-1+c*x)^-1//2*(70*e^2+63*c^4*d^2+135*d*e*c^2))
@test integrate(x*(d+e*x^2)^3*(a+b*arccosh(c*x)), x) == :(1//8*e^-1*(d+e*x^2)^4*(a+b*arccosh(c*x))+1//64*b*x*c^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^3*(1+-1*c^2*x^2)+-1//1024*b*c^-8*e^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(35*e^4+128*c^8*d^4+160*d*c^2*e^3+256*e*c^6*d^3+288*c^4*d^2*e^2)*arctanh(c*x*(-1+c^2*x^2)^-1//2)+1//1536*b*x*c^-5*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(d+e*x^2)*(35*e^2+104*c^4*d^2+104*d*e*c^2)+5//3072*b*x*c^-7*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(e+2*d*c^2)*(21*e^2+40*c^4*d^2+40*d*e*c^2)+7//384*b*x*c^-3*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^2*(1+-1*c^2*x^2)*(e+2*d*c^2))
@test integrate((d+e*x^2)^3*(a+b*arccosh(c*x)), x) == :(x*d^3*(a+b*arccosh(c*x))+1//7*e^3*x^7*(a+b*arccosh(c*x))+e*d^2*x^3*(a+b*arccosh(c*x))+3//5*d*e^2*x^5*(a+b*arccosh(c*x))+-1//49*b*c^-7*e^3*(1+c*x)^-1//2*(1+-1*c^2*x^2)^4*(-1+c*x)^-1//2+1//35*b*c^-7*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(5*e^3+35*c^6*d^3+21*d*c^2*e^2+35*e*c^4*d^2)+-1//105*b*e*c^-7*(1+c*x)^-1//2*(1+-1*c^2*x^2)^2*(-1+c*x)^-1//2*(15*e^2+35*c^4*d^2+42*d*e*c^2)+3//175*b*c^-7*e^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^3*(-1+c*x)^-1//2*(5*e+7*d*c^2))
@test integrate(x^-1*(d+e*x^2)^3*(a+b*arccosh(c*x)), x) == :(d^3*(a+b*arccosh(c*x))*log(x)+1//6*e^3*x^6*(a+b*arccosh(c*x))+-5//96*b*c^-6*e^3*arccosh(c*x)+3//2*e*d^2*x^2*(a+b*arccosh(c*x))+3//4*d*e^2*x^4*(a+b*arccosh(c*x))+-9//32*b*d*c^-4*e^2*arccosh(c*x)+-3//4*b*e*c^-2*d^2*arccosh(c*x)+-5//96*b*x*c^-5*e^3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-5//144*b*c^-3*e^3*x^3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-1//36*b*c^-1*e^3*x^5*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+b*d^3*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)*log(1+-1*exp(2*im*arcsin(c*x)))+-1*b*d^3*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)*log(x)+-9//32*b*d*x*c^-3*e^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-3//4*b*e*x*c^-1*d^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-3//16*b*d*c^-1*e^2*x^3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-1//2*im*b*d^3*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)^2+-1//2*im*b*d^3*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*Polylogarithms.polylog(2,exp(2*im*arcsin(c*x))))
@test integrate(x^-2*(d+e*x^2)^3*(a+b*arccosh(c*x)), x) == :(-1*d^3*x^-1*(a+b*arccosh(c*x))+1//5*e^3*x^5*(a+b*arccosh(c*x))+d*e^2*x^3*(a+b*arccosh(c*x))+3*e*x*d^2*(a+b*arccosh(c*x))+1//25*b*c^-5*e^3*(1+c*x)^-1//2*(1+-1*c^2*x^2)^3*(-1+c*x)^-1//2+b*c*d^3*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*arctan((-1+c^2*x^2)^(1/2))+-1//15*b*c^-5*e^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^2*(-1+c*x)^-1//2*(2*e+5*d*c^2)+1//5*b*e*c^-5*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(e^2+15*c^4*d^2+5*d*e*c^2))
@test integrate(x^-3*(d+e*x^2)^3*(a+b*arccosh(c*x)), x) == :(-1//2*d^3*x^-2*(a+b*arccosh(c*x))+1//4*e^3*x^4*(a+b*arccosh(c*x))+3*e*d^2*(a+b*arccosh(c*x))*log(x)+3//2*d*e^2*x^2*(a+b*arccosh(c*x))+-1//2*b*c*d^3*x^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)+1//16*b*c^-1*e^3*x^3*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)+-3*b*e*d^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)*log(x)+3*b*e*d^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)*log(1+-1*exp(2*im*arcsin(c*x)))+-3//2*im*b*e*d^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*arcsin(c*x)^2+-3//2*im*b*e*d^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c*x)^-1//2*Polylogarithms.polylog(2,exp(2*im*arcsin(c*x)))+-3//32*b*c^-4*e^2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+8*d*c^2)*arctanh(c*x*(-1+c^2*x^2)^-1//2)+3//32*b*x*c^-3*e^2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(e+8*d*c^2))
@test integrate(x^-4*(d+e*x^2)^3*(a+b*arccosh(c*x)), x) == :(-1//3*d^3*x^-3*(a+b*arccosh(c*x))+1//3*e^3*x^3*(a+b*arccosh(c*x))+-3*e*d^2*x^-1*(a+b*arccosh(c*x))+3*d*x*e^2*(a+b*arccosh(c*x))+-1//9*b*c^-3*e^3*(1+c*x)^-1//2*(1+-1*c^2*x^2)^2*(-1+c*x)^-1//2+-1//6*b*c*d^3*x^-2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)+1//3*b*c^-3*e^2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(e+9*d*c^2)+1//6*b*c*d^2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(18*e+d*c^2)*arctan((-1+c^2*x^2)^(1/2)))
@test integrate((d+e*x^2)^4*(a+b*arccosh(c*x)), x) == :(x*d^4*(a+b*arccosh(c*x))+1//9*e^4*x^9*(a+b*arccosh(c*x))+4//3*e*d^3*x^3*(a+b*arccosh(c*x))+4//7*d*e^3*x^7*(a+b*arccosh(c*x))+6//5*d^2*e^2*x^5*(a+b*arccosh(c*x))+1//81*b*c^-9*e^4*(1+c*x)^-1//2*(1+-1*c^2*x^2)^5*(-1+c*x)^-1//2+1//315*b*c^-9*(1+c*x)^-1//2*(-1+c*x)^-1//2*(1+-1*c^2*x^2)*(35*e^4+315*c^8*d^4+180*d*c^2*e^3+378*c^4*d^2*e^2+420*e*c^6*d^3)+-4//441*b*c^-9*e^3*(1+c*x)^-1//2*(1+-1*c^2*x^2)^4*(-1+c*x)^-1//2*(7*e+9*d*c^2)+-4//945*b*e*c^-9*(1+c*x)^-1//2*(1+-1*c^2*x^2)^2*(-1+c*x)^-1//2*(35*e^3+105*c^6*d^3+135*d*c^2*e^2+189*e*c^4*d^2)+2//525*b*c^-9*e^2*(1+c*x)^-1//2*(1+-1*c^2*x^2)^3*(-1+c*x)^-1//2*(35*e^2+63*c^4*d^2+90*d*e*c^2))
@test integrate(x^4*(d+e*x^2)^-1*(a+b*arccosh(c*x)), x) == :(1//3*e^-1*x^3*(a+b*arccosh(c*x))+(1/2)*b*e^-5//2*(-1d)^3//2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-5//2*(-1d)^3//2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-5//2*(-1d)^3//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-5//2*(-1d)^3//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1*a*d*x*e^-2+-1//2*b*e^-5//2*(-1d)^3//2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*e^-5//2*(-1d)^3//2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^-5//2*(-1d)^3//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^-5//2*(-1d)^3//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1*b*d*x*e^-2*arccosh(c*x)+-2//9*b*c^-3*e^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+b*d*c^-1*e^-2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+-1//9*b*c^-1*e^-1*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2))
@test integrate(x^3*(d+e*x^2)^-1*(a+b*arccosh(c*x)), x) == :((1/2)*e^-1*x^2*(a+b*arccosh(c*x))+(1/2)*d*b^-1*e^-2*(a+b*arccosh(c*x))^2+-1//2*b*d*e^-2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d*e^-2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d*e^-2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d*e^-2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d*e^-2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d*e^-2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d*e^-2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d*e^-2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//4*b*c^-2*e^-1*arccosh(c*x)+-1//4*b*x*c^-1*e^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2))
@test integrate(x^2*(d+e*x^2)^-1*(a+b*arccosh(c*x)), x) == :(a*x*e^-1+b*x*e^-1*arccosh(c*x)+(1/2)*b*e^-3//2*(-1d)^(1/2)*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-3//2*(-1d)^(1/2)*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-3//2*(-1d)^(1/2)*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-3//2*(-1d)^(1/2)*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*e^-3//2*(-1d)^(1/2)*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*e^-3//2*(-1d)^(1/2)*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^-3//2*(-1d)^(1/2)*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^-3//2*(-1d)^(1/2)*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1*b*c^-1*e^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2))
@test integrate(x*(d+e*x^2)^-1*(a+b*arccosh(c*x)), x) == :((1/2)*b*e^-1*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-1*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-1*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-1*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-1*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-1*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-1*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-1*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b^-1*e^-1*(a+b*arccosh(c*x))^2)
@test integrate((d+e*x^2)^-1*(a+b*arccosh(c*x)), x) == :((1/2)*b*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x))))
@test integrate(x^-1*(d+e*x^2)^-1*(a+b*arccosh(c*x)), x) == :(d^-1*(a+b*arccosh(c*x))*log(1+exp(2*arccosh(c*x)))+(1/2)*b*d^-1*Polylogarithms.polylog(2,-1*exp(2*arccosh(c*x)))+-1//2*b*d^-1*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d^-1*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d^-1*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d^-1*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-1*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-1*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-1*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-1*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x))))
@test integrate(x^-2*(d+e*x^2)^-1*(a+b*arccosh(c*x)), x) == :(-1*d^-1*x^-1*(a+b*arccosh(c*x))+b*c*d^-1*arctan((1+c*x)^(1/2)*(-1+c*x)^(1/2))+(1/2)*b*e^(1/2)*(-1d)^-3//2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^(1/2)*(-1d)^-3//2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^(1/2)*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^(1/2)*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*e^(1/2)*(-1d)^-3//2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*e^(1/2)*(-1d)^-3//2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^(1/2)*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^(1/2)*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x))))
@test integrate(x^-3*(d+e*x^2)^-1*(a+b*arccosh(c*x)), x) == :(-1//2*d^-1*x^-2*(a+b*arccosh(c*x))+(1/2)*b*e*d^-2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e*d^-2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e*d^-2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e*d^-2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e*d^-2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e*d^-2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e*d^-2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e*d^-2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1*e*d^-2*(a+b*arccosh(c*x))*log(1+exp(2*arccosh(c*x)))+-1//2*b*e*d^-2*Polylogarithms.polylog(2,-1*exp(2*arccosh(c*x)))+(1/2)*b*c*d^-1*x^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2))
@test integrate(x^-4*(d+e*x^2)^-1*(a+b*arccosh(c*x)), x) == :(-1//3*d^-1*x^-3*(a+b*arccosh(c*x))+e*d^-2*x^-1*(a+b*arccosh(c*x))+(1/2)*b*e^3//2*(-1d)^-5//2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^3//2*(-1d)^-5//2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^3//2*(-1d)^-5//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^3//2*(-1d)^-5//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*e^3//2*(-1d)^-5//2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*e^3//2*(-1d)^-5//2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^3//2*(-1d)^-5//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^3//2*(-1d)^-5//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//6*b*c^3*d^-1*arctan((1+c*x)^(1/2)*(-1+c*x)^(1/2))+-1*b*c*e*d^-2*arctan((1+c*x)^(1/2)*(-1+c*x)^(1/2))+1//6*b*c*d^-1*x^-2*(1+c*x)^(1/2)*(-1+c*x)^(1/2))
@test integrate(x^3*(d+e*x^2)^-2*(a+b*arccosh(c*x)), x) == :((1/2)*b*e^-2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b^-1*e^-2*(a+b*arccosh(c*x))^2+(1/2)*d*e^-2*(d+e*x^2)^-1*(a+b*arccosh(c*x))+-1//2*b*c*d^(1/2)*e^-2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-1//2*arctanh(x*d^-1//2*(-1+c^2*x^2)^-1//2*(e+d*c^2)^(1/2)))
@test integrate(x*(d+e*x^2)^-2*(a+b*arccosh(c*x)), x) == :(-1//2*e^-1*(d+e*x^2)^-1*(a+b*arccosh(c*x))+(1/2)*b*c*d^-1//2*e^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-1//2*arctanh(x*d^-1//2*(-1+c^2*x^2)^-1//2*(e+d*c^2)^(1/2)))
@test integrate(x^-1*(d+e*x^2)^-2*(a+b*arccosh(c*x)), x) == :(d^-2*(a+b*arccosh(c*x))*log(1+exp(2*arccosh(c*x)))+(1/2)*b*d^-2*Polylogarithms.polylog(2,-1*exp(2*arccosh(c*x)))+(1/2)*d^-1*(d+e*x^2)^-1*(a+b*arccosh(c*x))+-1//2*b*d^-2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d^-2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d^-2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d^-2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*c*d^-3//2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-1//2*arctanh(x*d^-1//2*(-1+c^2*x^2)^-1//2*(e+d*c^2)^(1/2)))
@test integrate(x^-3*(d+e*x^2)^-2*(a+b*arccosh(c*x)), x) == :(-1//2*d^-2*x^-2*(a+b*arccosh(c*x))+b*e*d^-3*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+b*e*d^-3*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+b*e*d^-3*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+b*e*d^-3*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+e*d^-3*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+e*d^-3*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+e*d^-3*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+e*d^-3*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1*b*e*d^-3*Polylogarithms.polylog(2,-1*exp(2*arccosh(c*x)))+-2*e*d^-3*(a+b*arccosh(c*x))*log(1+exp(2*arccosh(c*x)))+-1//2*e*d^-2*(d+e*x^2)^-1*(a+b*arccosh(c*x))+(1/2)*b*c*d^-2*x^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+(1/2)*b*c*e*d^-5//2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-1//2*arctanh(x*d^-1//2*(-1+c^2*x^2)^-1//2*(e+d*c^2)^(1/2)))
@test integrate(x^4*(d+e*x^2)^-2*(a+b*arccosh(c*x)), x) == :(a*x*e^-2+b*x*e^-2*arccosh(c*x)+-3//4*b*e^-5//2*(-1d)^(1/2)*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-3//4*b*e^-5//2*(-1d)^(1/2)*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-3//4*e^-5//2*(-1d)^(1/2)*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-3//4*e^-5//2*(-1d)^(1/2)*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//4*d*e^-5//2*((-1d)^(1/2)+-1*x*e^(1/2))^-1*(a+b*arccosh(c*x))+1//4*d*e^-5//2*((-1d)^(1/2)+x*e^(1/2))^-1*(a+b*arccosh(c*x))+3//4*b*e^-5//2*(-1d)^(1/2)*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//4*b*e^-5//2*(-1d)^(1/2)*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//4*e^-5//2*(-1d)^(1/2)*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//4*e^-5//2*(-1d)^(1/2)*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1*b*c^-1*e^-2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+(1/2)*b*c*d*e^-5//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^(1/2))+-1//2*b*c*d*e^-5//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^(1/2)*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2))
@test integrate(x^2*(d+e*x^2)^-2*(a+b*arccosh(c*x)), x) == :(-1//4*e^-3//2*((-1d)^(1/2)+x*e^(1/2))^-1*(a+b*arccosh(c*x))+1//4*e^-3//2*((-1d)^(1/2)+-1*x*e^(1/2))^-1*(a+b*arccosh(c*x))+-1//4*b*e^-3//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//4*b*e^-3//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//4*e^-3//2*(-1d)^-1//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//4*e^-3//2*(-1d)^-1//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//4*b*e^-3//2*(-1d)^-1//2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//4*b*e^-3//2*(-1d)^-1//2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//4*e^-3//2*(-1d)^-1//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//4*e^-3//2*(-1d)^-1//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*c*e^-3//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^(1/2)*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2)+-1//2*b*c*e^-3//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^(1/2)))
@test integrate((d+e*x^2)^-2*(a+b*arccosh(c*x)), x) == :(-1//4*b*e^-1//2*(-1d)^-3//2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//4*b*e^-1//2*(-1d)^-3//2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//4*d^-1*e^-1//2*((-1d)^(1/2)+-1*x*e^(1/2))^-1*(a+b*arccosh(c*x))+-1//4*e^-1//2*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//4*e^-1//2*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//4*b*e^-1//2*(-1d)^-3//2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//4*b*e^-1//2*(-1d)^-3//2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//4*d^-1*e^-1//2*((-1d)^(1/2)+x*e^(1/2))^-1*(a+b*arccosh(c*x))+1//4*e^-1//2*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//4*e^-1//2*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*c*d^-1*e^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^(1/2))+-1//2*b*c*d^-1*e^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^(1/2)*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2))
@test integrate(x^-2*(d+e*x^2)^-2*(a+b*arccosh(c*x)), x) == :(-1*d^-2*x^-1*(a+b*arccosh(c*x))+b*c*d^-2*arctan((1+c*x)^(1/2)*(-1+c*x)^(1/2))+-3//4*b*e^(1/2)*(-1d)^-5//2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-3//4*b*e^(1/2)*(-1d)^-5//2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-3//4*e^(1/2)*(-1d)^-5//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-3//4*e^(1/2)*(-1d)^-5//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//4*d^-2*e^(1/2)*((-1d)^(1/2)+x*e^(1/2))^-1*(a+b*arccosh(c*x))+1//4*d^-2*e^(1/2)*((-1d)^(1/2)+-1*x*e^(1/2))^-1*(a+b*arccosh(c*x))+3//4*b*e^(1/2)*(-1d)^-5//2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//4*b*e^(1/2)*(-1d)^-5//2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//4*e^(1/2)*(-1d)^-5//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//4*e^(1/2)*(-1d)^-5//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*c*d^-2*e^(1/2)*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^(1/2)*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2)+-1//2*b*c*d^-2*e^(1/2)*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^(1/2)))
@test integrate(x^5*(d+e*x^2)^-3*(a+b*arccosh(c*x)), x) == :((1/2)*b*e^-3*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-3*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-3*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*e^-3*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-3*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-3*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-3*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-3*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b^-1*e^-3*(a+b*arccosh(c*x))^2+d*e^-3*(d+e*x^2)^-1*(a+b*arccosh(c*x))+-1//4*d^2*e^-3*(d+e*x^2)^-2*(a+b*arccosh(c*x))+-1*b*c*d^(1/2)*e^-3*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-1//2*arctanh(x*d^-1//2*(-1+c^2*x^2)^-1//2*(e+d*c^2)^(1/2))+1//8*b*c*d*x*e^-2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^-1*(e+d*c^2)^-1*(1+-1*c^2*x^2)+1//8*b*c*d^(1/2)*e^-3*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-3//2*(e+2*d*c^2)*arctanh(x*d^-1//2*(-1+c^2*x^2)^-1//2*(e+d*c^2)^(1/2)))
@test integrate(x*(d+e*x^2)^-3*(a+b*arccosh(c*x)), x) == :(-1//4*e^-1*(d+e*x^2)^-2*(a+b*arccosh(c*x))+1//8*b*c*x*d^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^-1*(e+d*c^2)^-1*(1+-1*c^2*x^2)+1//8*b*c*d^-3//2*e^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-3//2*(e+2*d*c^2)*arctanh(x*d^-1//2*(-1+c^2*x^2)^-1//2*(e+d*c^2)^(1/2)))
@test integrate(x^-1*(d+e*x^2)^-3*(a+b*arccosh(c*x)), x) == :(d^-3*(a+b*arccosh(c*x))*log(1+exp(2*arccosh(c*x)))+(1/2)*b*d^-3*Polylogarithms.polylog(2,-1*exp(2*arccosh(c*x)))+(1/2)*d^-2*(d+e*x^2)^-1*(a+b*arccosh(c*x))+-1//2*b*d^-3*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d^-3*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d^-3*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*b*d^-3*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-3*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-3*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-3*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*d^-3*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//4*d^-1*(d+e*x^2)^-2*(a+b*arccosh(c*x))+-1//2*b*c*d^-5//2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-1//2*arctanh(x*d^-1//2*(-1+c^2*x^2)^-1//2*(e+d*c^2)^(1/2))+-1//8*b*c*d^-5//2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-3//2*(e+2*d*c^2)*arctanh(x*d^-1//2*(-1+c^2*x^2)^-1//2*(e+d*c^2)^(1/2))+-1//8*b*c*e*x*d^-2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^-1*(e+d*c^2)^-1*(1+-1*c^2*x^2))
@test integrate(x^-3*(d+e*x^2)^-3*(a+b*arccosh(c*x)), x) == :(-1//2*d^-3*x^-2*(a+b*arccosh(c*x))+-1*e*d^-3*(d+e*x^2)^-1*(a+b*arccosh(c*x))+-3*e*d^-4*(a+b*arccosh(c*x))*log(1+exp(2*arccosh(c*x)))+-3//2*b*e*d^-4*Polylogarithms.polylog(2,-1*exp(2*arccosh(c*x)))+-1//4*e*d^-2*(d+e*x^2)^-2*(a+b*arccosh(c*x))+3//2*b*e*d^-4*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//2*b*e*d^-4*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//2*b*e*d^-4*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//2*b*e*d^-4*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//2*e*d^-4*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//2*e*d^-4*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//2*e*d^-4*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//2*e*d^-4*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*b*c*d^-3*x^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)+b*c*e*d^-7//2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-1//2*arctanh(x*d^-1//2*(-1+c^2*x^2)^-1//2*(e+d*c^2)^(1/2))+1//8*b*c*e*d^-7//2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-3//2*(e+2*d*c^2)*arctanh(x*d^-1//2*(-1+c^2*x^2)^-1//2*(e+d*c^2)^(1/2))+1//8*b*c*x*d^-3*e^2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^-1*(e+d*c^2)^-1*(1+-1*c^2*x^2))
@test integrate(x^4*(d+e*x^2)^-3*(a+b*arccosh(c*x)), x) == :(-1//16*e^-5//2*((-1d)^(1/2)+x*e^(1/2))^-1*(5a+5*b*arccosh(c*x))+1//16*e^-5//2*((-1d)^(1/2)+-1*x*e^(1/2))^-1*(5a+5*b*arccosh(c*x))+-3//16*b*e^-5//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-3//16*b*e^-5//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//16*e^-5//2*(-1d)^(1/2)*((-1d)^(1/2)+-1*x*e^(1/2))^-2*(a+b*arccosh(c*x))+-1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//16*e^-5//2*(-1d)^(1/2)*((-1d)^(1/2)+x*e^(1/2))^-2*(a+b*arccosh(c*x))+1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//16*b*e^-5//2*(-1d)^-1//2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//16*b*e^-5//2*(-1d)^-1//2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-5//8*b*c*e^-5//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^(1/2))+5//8*b*c*e^-5//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^(1/2)*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2)+-1//8*b*d*c^3*e^-5//2*(e^(1/2)+c*(-1d)^(1/2))^-3//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-3//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^(1/2))+1//8*b*d*c^3*e^-5//2*(e^(1/2)+c*(-1d)^(1/2))^-3//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-3//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^(1/2)*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2)+-1//16*b*c*e^-2*(-1d)^(1/2)*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(e+d*c^2)^-1*((-1d)^(1/2)+x*e^(1/2))^-1+-1//16*b*c*e^-2*(-1d)^(1/2)*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(e+d*c^2)^-1*((-1d)^(1/2)+-1*x*e^(1/2))^-1)
@test integrate(x^2*(d+e*x^2)^-3*(a+b*arccosh(c*x)), x) == :(-1//16*b*e^-3//2*(-1d)^-3//2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//16*b*e^-3//2*(-1d)^-3//2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//16*d^-1*e^-3//2*((-1d)^(1/2)+-1*x*e^(1/2))^-1*(a+b*arccosh(c*x))+-1//16*e^-3//2*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//16*e^-3//2*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//16*e^-3//2*(-1d)^-1//2*((-1d)^(1/2)+-1*x*e^(1/2))^-2*(a+b*arccosh(c*x))+1//16*b*e^-3//2*(-1d)^-3//2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//16*b*e^-3//2*(-1d)^-3//2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//16*d^-1*e^-3//2*((-1d)^(1/2)+x*e^(1/2))^-1*(a+b*arccosh(c*x))+1//16*e^-3//2*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//16*e^-3//2*(-1d)^-3//2*(a+b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//16*e^-3//2*(-1d)^-1//2*((-1d)^(1/2)+x*e^(1/2))^-2*(a+b*arccosh(c*x))+-1//8*b*c^3*e^-3//2*(e^(1/2)+c*(-1d)^(1/2))^-3//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-3//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^(1/2)*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2)+1//8*b*c^3*e^-3//2*(e^(1/2)+c*(-1d)^(1/2))^-3//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-3//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^(1/2))+-1//8*b*c*d^-1*e^-3//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^(1/2)*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2)+1//8*b*c*d^-1*e^-3//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^(1/2))+-1//16*b*c*e^-1*(-1d)^-1//2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(e+d*c^2)^-1*((-1d)^(1/2)+x*e^(1/2))^-1+-1//16*b*c*e^-1*(-1d)^-1//2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(e+d*c^2)^-1*((-1d)^(1/2)+-1*x*e^(1/2))^-1)
@test integrate((d+e*x^2)^-3*(a+b*arccosh(c*x)), x) == :(-3//16*b*e^-1//2*(-1d)^-5//2*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-3//16*b*e^-1//2*(-1d)^-5//2*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//16*d^-2*e^-1//2*((-1d)^(1/2)+-1*x*e^(1/2))^-1*(3a+3*b*arccosh(c*x))+-1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arccosh(c*x))*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arccosh(c*x))*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//16*e^-1//2*(-1d)^-3//2*((-1d)^(1/2)+-1*x*e^(1/2))^-2*(a+b*arccosh(c*x))+1//16*d^-2*e^-1//2*((-1d)^(1/2)+x*e^(1/2))^-1*(3a+3*b*arccosh(c*x))+1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arccosh(c*x))*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arccosh(c*x))*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+1//16*e^-1//2*(-1d)^-3//2*((-1d)^(1/2)+x*e^(1/2))^-2*(a+b*arccosh(c*x))+3//16*b*e^-1//2*(-1d)^-5//2*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+3//16*b*e^-1//2*(-1d)^-5//2*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-3//8*b*c*d^-2*e^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^(1/2)*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2)+-1//8*b*c^3*d^-1*e^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-3//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-3//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^(1/2))+-1//16*b*c*(-1d)^-3//2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(e+d*c^2)^-1*((-1d)^(1/2)+x*e^(1/2))^-1+-1//16*b*c*(-1d)^-3//2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(e+d*c^2)^-1*((-1d)^(1/2)+-1*x*e^(1/2))^-1+1//8*b*c^3*d^-1*e^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-3//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-3//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^(1/2)*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2)+3//8*b*c*d^-2*e^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^-1//2*arctanh((1+c*x)^(1/2)*(-1+c*x)^-1//2*(e^(1/2)+c*(-1d)^(1/2))^-1//2*(-1*e^(1/2)+c*(-1d)^(1/2))^(1/2)))
@test integrate((a+b*arccosh(c*x))^2*(d+e*x^2)^3, x) == :(x*d^3*(a+b*arccosh(c*x))^2+2*x*b^2*d^3+1//7*e^3*x^7*(a+b*arccosh(c*x))^2+2//343*b^2*e^3*x^7+e*d^2*x^3*(a+b*arccosh(c*x))^2+2//9*e*b^2*d^2*x^3+3//5*d*e^2*x^5*(a+b*arccosh(c*x))^2+6//125*d*b^2*e^2*x^5+12//1225*b^2*c^-2*e^3*x^5+16//735*b^2*c^-4*e^3*x^3+32//245*x*b^2*c^-6*e^3+4//3*e*x*b^2*c^-2*d^2+8//75*d*b^2*c^-2*e^2*x^3+16//25*d*x*b^2*c^-4*e^2+-2*b*c^-1*d^3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-32//245*b*c^-7*e^3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-16//25*b*d*c^-5*e^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-16//245*b*c^-5*e^3*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-12//245*b*c^-3*e^3*x^4*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-4//3*b*e*c^-3*d^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-2//49*b*c^-1*e^3*x^6*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-8//25*b*d*c^-3*e^2*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-6//25*b*d*c^-1*e^2*x^4*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-2//3*b*e*c^-1*d^2*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x)))
@test integrate((a+b*arccosh(c*x))^2*(d+e*x^2)^2, x) == :(x*d^2*(a+b*arccosh(c*x))^2+2*x*b^2*d^2+1//5*e^2*x^5*(a+b*arccosh(c*x))^2+2//125*b^2*e^2*x^5+2//3*d*e*x^3*(a+b*arccosh(c*x))^2+4//27*d*e*b^2*x^3+8//225*b^2*c^-2*e^2*x^3+16//75*x*b^2*c^-4*e^2+8//9*d*e*x*b^2*c^-2+-2*b*c^-1*d^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-16//75*b*c^-5*e^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-8//9*b*d*e*c^-3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-8//75*b*c^-3*e^2*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-2//25*b*c^-1*e^2*x^4*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-4//9*b*d*e*c^-1*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x)))
@test integrate((a+b*arccosh(c*x))^2*(d+e*x^2), x) == :(d*x*(a+b*arccosh(c*x))^2+2*d*x*b^2+1//3*e*x^3*(a+b*arccosh(c*x))^2+2//27*e*b^2*x^3+4//9*e*x*b^2*c^-2+-2*b*d*c^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-4//9*b*e*c^-3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))+-2//9*b*e*c^-1*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x)))
@test integrate((a+b*arccosh(c*x))^2, x) == :(x*(a+b*arccosh(c*x))^2+2*x*b^2+-2*b*c^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x)))
@test integrate((a+b*arccosh(c*x))^2*(d+e*x^2)^-1, x) == :(b^2*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(3,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+b^2*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(3,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))^2*log(1+-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+(1/2)*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))^2*log(1+-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1*b^2*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(3,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1*b^2*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(3,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))^2*log(1+e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1//2*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))^2*log(1+e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+b*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))*Polylogarithms.polylog(2,e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+b*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))*Polylogarithms.polylog(2,e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1*b*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))*Polylogarithms.polylog(2,-1*e^(1/2)*((-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x)))+-1*b*e^-1//2*(-1d)^-1//2*(a+b*arccosh(c*x))*Polylogarithms.polylog(2,-1*e^(1/2)*(-1*(-1*e+-1*d*c^2)^(1/2)+c*(-1d)^(1/2))^-1*exp(arccosh(c*x))))
@test integrate((a+b*arccosh(c*x))^-1*(d+e*x^2)^2, x) == :(b^-1*c^-1*d^2*cosh(a*b^-1)*sinhintegral(b^-1*(a+b*arccosh(c*x)))+-1*b^-1*c^-1*d^2*coshintegral(b^-1*(a+b*arccosh(c*x)))*sinh(a*b^-1)+-3//16*b^-1*c^-5*e^2*coshintegral(3*arccosh(c*x)+3*a*b^-1)*sinh(3*a*b^-1)+-1//8*b^-1*c^-5*e^2*coshintegral(a*b^-1+arccosh(c*x))*sinh(a*b^-1)+-1//16*b^-1*c^-5*e^2*coshintegral(5*arccosh(c*x)+5*a*b^-1)*sinh(5*a*b^-1)+1//8*b^-1*c^-5*e^2*cosh(a*b^-1)*sinhintegral(a*b^-1+arccosh(c*x))+1//16*b^-1*c^-5*e^2*cosh(5*a*b^-1)*sinhintegral(5*arccosh(c*x)+5*a*b^-1)+3//16*b^-1*c^-5*e^2*cosh(3*a*b^-1)*sinhintegral(3*arccosh(c*x)+3*a*b^-1)+(1/2)*d*e*b^-1*c^-3*cosh(a*b^-1)*sinhintegral(a*b^-1+arccosh(c*x))+(1/2)*d*e*b^-1*c^-3*cosh(3*a*b^-1)*sinhintegral(3*arccosh(c*x)+3*a*b^-1)+-1//2*d*e*b^-1*c^-3*coshintegral(3*arccosh(c*x)+3*a*b^-1)*sinh(3*a*b^-1)+-1//2*d*e*b^-1*c^-3*coshintegral(a*b^-1+arccosh(c*x))*sinh(a*b^-1))
@test integrate((a+b*arccosh(c*x))^-1*(d+e*x^2), x) == :(d*b^-1*c^-1*cosh(a*b^-1)*sinhintegral(b^-1*(a+b*arccosh(c*x)))+-1*d*b^-1*c^-1*coshintegral(b^-1*(a+b*arccosh(c*x)))*sinh(a*b^-1)+-1//4*e*b^-1*c^-3*coshintegral(3*arccosh(c*x)+3*a*b^-1)*sinh(3*a*b^-1)+-1//4*e*b^-1*c^-3*coshintegral(a*b^-1+arccosh(c*x))*sinh(a*b^-1)+1//4*e*b^-1*c^-3*cosh(a*b^-1)*sinhintegral(a*b^-1+arccosh(c*x))+1//4*e*b^-1*c^-3*cosh(3*a*b^-1)*sinhintegral(3*arccosh(c*x)+3*a*b^-1))
@test integrate((a+b*arccosh(c*x))^-1, x) == :(b^-1*c^-1*cosh(a*b^-1)*sinhintegral(b^-1*(a+b*arccosh(c*x)))+-1*b^-1*c^-1*coshintegral(b^-1*(a+b*arccosh(c*x)))*sinh(a*b^-1))
@test integrate((a+b*arccosh(c*x))^-2*(d+e*x^2)^2, x) == :(b^-2*c^-1*d^2*cosh(a*b^-1)*coshintegral(a*b^-1+arccosh(c*x))+-1*b^-2*c^-1*d^2*sinh(a*b^-1)*sinhintegral(a*b^-1+arccosh(c*x))+-9//16*b^-2*c^-5*e^2*sinh(3*a*b^-1)*sinhintegral(3*arccosh(c*x)+3*a*b^-1)+-5//16*b^-2*c^-5*e^2*sinh(5*a*b^-1)*sinhintegral(5*arccosh(c*x)+5*a*b^-1)+-1//8*b^-2*c^-5*e^2*sinh(a*b^-1)*sinhintegral(a*b^-1+arccosh(c*x))+1//8*b^-2*c^-5*e^2*cosh(a*b^-1)*coshintegral(a*b^-1+arccosh(c*x))+5//16*b^-2*c^-5*e^2*cosh(5*a*b^-1)*coshintegral(5*arccosh(c*x)+5*a*b^-1)+9//16*b^-2*c^-5*e^2*cosh(3*a*b^-1)*coshintegral(3*arccosh(c*x)+3*a*b^-1)+(1/2)*d*e*b^-2*c^-3*cosh(a*b^-1)*coshintegral(a*b^-1+arccosh(c*x))+-1*b^-1*c^-1*d^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^-1+-3//2*d*e*b^-2*c^-3*sinh(3*a*b^-1)*sinhintegral(3*arccosh(c*x)+3*a*b^-1)+-1//2*d*e*b^-2*c^-3*sinh(a*b^-1)*sinhintegral(a*b^-1+arccosh(c*x))+3//2*d*e*b^-2*c^-3*cosh(3*a*b^-1)*coshintegral(3*arccosh(c*x)+3*a*b^-1)+-1*b^-1*c^-1*e^2*x^4*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^-1+-2*d*e*b^-1*c^-1*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^-1)
@test integrate((a+b*arccosh(c*x))^-2*(d+e*x^2), x) == :(d*b^-2*c^-1*cosh(a*b^-1)*coshintegral(a*b^-1+arccosh(c*x))+-1*d*b^-2*c^-1*sinh(a*b^-1)*sinhintegral(a*b^-1+arccosh(c*x))+-3//4*e*b^-2*c^-3*sinh(3*a*b^-1)*sinhintegral(3*arccosh(c*x)+3*a*b^-1)+-1//4*e*b^-2*c^-3*sinh(a*b^-1)*sinhintegral(a*b^-1+arccosh(c*x))+1//4*e*b^-2*c^-3*cosh(a*b^-1)*coshintegral(a*b^-1+arccosh(c*x))+3//4*e*b^-2*c^-3*cosh(3*a*b^-1)*coshintegral(3*arccosh(c*x)+3*a*b^-1)+-1*d*b^-1*c^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^-1+-1*e*b^-1*c^-1*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^-1)
@test integrate((a+b*arccosh(c*x))^-2, x) == :(b^-2*c^-1*cosh(a*b^-1)*coshintegral(a*b^-1+arccosh(c*x))+-1*b^-2*c^-1*sinh(a*b^-1)*sinhintegral(a*b^-1+arccosh(c*x))+-1*b^-1*c^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^-1)
@test integrate((a+b*arccosh(c*x))^(1/2)*(d+e*x^2)^2, x) == :(x*d^2*(a+b*arccosh(c*x))^(1/2)+1//5*e^2*x^5*(a+b*arccosh(c*x))^(1/2)+2//3*d*e*x^3*(a+b*arccosh(c*x))^(1/2)+-1//4*pi^(1/2)*b^(1/2)*c^-1*d^2*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+-1//4*pi^(1/2)*b^(1/2)*c^-1*d^2*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-1//32*pi^(1/2)*b^(1/2)*c^-5*e^2*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+-1//32*pi^(1/2)*b^(1/2)*c^-5*e^2*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-1//8*d*e*pi^(1/2)*b^(1/2)*c^-3*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+-1//8*d*e*pi^(1/2)*b^(1/2)*c^-3*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-1//192*3^(1/2)*pi^(1/2)*b^(1/2)*c^-5*e^2*erf(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(3*a*b^-1)+-1//192*3^(1/2)*pi^(1/2)*b^(1/2)*c^-5*e^2*erfi(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-3*a*b^-1)+-1//1600*5^(1/2)*pi^(1/2)*b^(1/2)*c^-5*e^2*erf(5^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(5*a*b^-1)+-1//1600*5^(1/2)*pi^(1/2)*b^(1/2)*c^-5*e^2*erfi(5^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-5*a*b^-1)+-1//72*d*e*3^(1/2)*pi^(1/2)*b^(1/2)*c^-3*erf(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(3*a*b^-1)+-1//72*d*e*3^(1/2)*pi^(1/2)*b^(1/2)*c^-3*erfi(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-3*a*b^-1))
@test integrate((a+b*arccosh(c*x))^(1/2)*(d+e*x^2), x) == :(d*x*(a+b*arccosh(c*x))^(1/2)+1//3*e*x^3*(a+b*arccosh(c*x))^(1/2)+-1//4*d*pi^(1/2)*b^(1/2)*c^-1*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+-1//4*d*pi^(1/2)*b^(1/2)*c^-1*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-1//16*e*pi^(1/2)*b^(1/2)*c^-3*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+-1//16*e*pi^(1/2)*b^(1/2)*c^-3*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-1//144*e*3^(1/2)*pi^(1/2)*b^(1/2)*c^-3*erf(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(3*a*b^-1)+-1//144*e*3^(1/2)*pi^(1/2)*b^(1/2)*c^-3*erfi(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-3*a*b^-1))
@test integrate((a+b*arccosh(c*x))^(1/2), x) == :(x*(a+b*arccosh(c*x))^(1/2)+-1//4*pi^(1/2)*b^(1/2)*c^-1*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+-1//4*pi^(1/2)*b^(1/2)*c^-1*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1))
@test integrate((a+b*arccosh(c*x))^3//2*(d+e*x^2), x) == :(d*x*(a+b*arccosh(c*x))^3//2+1//3*e*x^3*(a+b*arccosh(c*x))^3//2+-3//2*b*d*c^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^(1/2)+-3//8*d*pi^(1/2)*b^3//2*c^-1*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+-3//32*e*pi^(1/2)*b^3//2*c^-3*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+-1//3*b*e*c^-3*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^(1/2)+3//8*d*pi^(1/2)*b^3//2*c^-1*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+3//32*e*pi^(1/2)*b^3//2*c^-3*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-1//6*b*e*c^-1*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^(1/2)+-1//288*e*3^(1/2)*pi^(1/2)*b^3//2*c^-3*erf(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(3*a*b^-1)+1//288*e*3^(1/2)*pi^(1/2)*b^3//2*c^-3*erfi(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-3*a*b^-1))
@test integrate((a+b*arccosh(c*x))^3//2, x) == :(x*(a+b*arccosh(c*x))^3//2+-3//2*b*c^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^(1/2)+-3//8*pi^(1/2)*b^3//2*c^-1*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+3//8*pi^(1/2)*b^3//2*c^-1*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1))
@test integrate((a+b*arccosh(c*x))^-1//2*(d+e*x^2)^2, x) == :((1/2)*pi^(1/2)*b^-1//2*c^-1*d^2*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-1//2*pi^(1/2)*b^-1//2*c^-1*d^2*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+-1//16*pi^(1/2)*b^-1//2*c^-5*e^2*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+1//16*pi^(1/2)*b^-1//2*c^-5*e^2*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-1//4*d*e*pi^(1/2)*b^-1//2*c^-3*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+-1//32*3^(1/2)*pi^(1/2)*b^-1//2*c^-5*e^2*erf(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(3*a*b^-1)+-1//160*5^(1/2)*pi^(1/2)*b^-1//2*c^-5*e^2*erf(5^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(5*a*b^-1)+1//4*d*e*pi^(1/2)*b^-1//2*c^-3*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+1//32*3^(1/2)*pi^(1/2)*b^-1//2*c^-5*e^2*erfi(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-3*a*b^-1)+1//160*5^(1/2)*pi^(1/2)*b^-1//2*c^-5*e^2*erfi(5^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-5*a*b^-1)+-1//12*d*e*3^(1/2)*pi^(1/2)*b^-1//2*c^-3*erf(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(3*a*b^-1)+1//12*d*e*3^(1/2)*pi^(1/2)*b^-1//2*c^-3*erfi(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-3*a*b^-1))
@test integrate((a+b*arccosh(c*x))^-1//2*(d+e*x^2), x) == :((1/2)*d*pi^(1/2)*b^-1//2*c^-1*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-1//2*d*pi^(1/2)*b^-1//2*c^-1*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+-1//8*e*pi^(1/2)*b^-1//2*c^-3*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+1//8*e*pi^(1/2)*b^-1//2*c^-3*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-1//24*e*3^(1/2)*pi^(1/2)*b^-1//2*c^-3*erf(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(3*a*b^-1)+1//24*e*3^(1/2)*pi^(1/2)*b^-1//2*c^-3*erfi(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-3*a*b^-1))
@test integrate((a+b*arccosh(c*x))^-1//2, x) == :((1/2)*pi^(1/2)*b^-1//2*c^-1*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-1//2*pi^(1/2)*b^-1//2*c^-1*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1))
@test integrate((a+b*arccosh(c*x))^-3//2*(d+e*x^2), x) == :(d*pi^(1/2)*b^-3//2*c^-1*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+d*pi^(1/2)*b^-3//2*c^-1*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-2*d*b^-1*c^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^-1//2+1//4*e*pi^(1/2)*b^-3//2*c^-3*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+1//4*e*pi^(1/2)*b^-3//2*c^-3*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-2*e*b^-1*c^-1*x^2*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^-1//2+1//4*e*3^(1/2)*pi^(1/2)*b^-3//2*c^-3*erf(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(3*a*b^-1)+1//4*e*3^(1/2)*pi^(1/2)*b^-3//2*c^-3*erfi(3^(1/2)*b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-3*a*b^-1))
@test integrate((a+b*arccosh(c*x))^-3//2, x) == :(pi^(1/2)*b^-3//2*c^-1*erf(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(a*b^-1)+pi^(1/2)*b^-3//2*c^-1*erfi(b^-1//2*(a+b*arccosh(c*x))^(1/2))*exp(-1*a*b^-1)+-2*b^-1*c^-1*(1+c*x)^(1/2)*(-1+c*x)^(1/2)*(a+b*arccosh(c*x))^-1//2)
@test integrate((d+e*x^2)^-3//2*(a+b*arccosh(c*x)), x) == :(x*d^-1*(d+e*x^2)^-1//2*(a+b*arccosh(c*x))+-1*b*d^-1*e^-1//2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2))
@test integrate((d+e*x^2)^-7//2*(a+b*arccosh(c*x)), x) == :(1//5*x*d^-1*(d+e*x^2)^-5//2*(a+b*arccosh(c*x))+4//15*x*d^-2*(d+e*x^2)^-3//2*(a+b*arccosh(c*x))+8//15*x*d^-3*(d+e*x^2)^-1//2*(a+b*arccosh(c*x))+-8//15*b*d^-3*e^-1//2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(-1+c^2*x^2)^(1/2)*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+1//15*b*c*d^-1*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^-3//2*(e+d*c^2)^-1*(1+-1*c^2*x^2)+2//15*b*c*d^-2*(1+c*x)^-1//2*(-1+c*x)^-1//2*(d+e*x^2)^-1//2*(e+d*c^2)^-2*(1+-1*c^2*x^2)*(2*e+3*d*c^2))

max_stars_repo_path: test/7 Inverse hyperbolic functions/7.2 Inverse hyperbolic cosine/7.2.4b (f x)^m (d+e x^2)^p (a+b arccosh(c x))^n.jl


text:
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.

mutable struct OSDisk <: SwaggerModel
    osType::Any # spec type: Union{ Nothing, String } # spec name: osType
    encryptionSettings::Any # spec type: Union{ Nothing, DiskEncryptionSettings } # spec name: encryptionSettings
    name::Any # spec type: Union{ Nothing, String } # spec name: name
    vhd::Any # spec type: Union{ Nothing, VirtualHardDisk } # spec name: vhd
    image::Any # spec type: Union{ Nothing, VirtualHardDisk } # spec name: image
    caching::Any # spec type: Union{ Nothing, Caching } # spec name: caching
    createOption::Any # spec type: Union{ Nothing, CreateOption } # spec name: createOption
    diskSizeGB::Any # spec type: Union{ Nothing, Int32 } # spec name: diskSizeGB
    managedDisk::Any # spec type: Union{ Nothing, ManagedDiskParameters } # spec name: managedDisk

    function OSDisk(;osType=nothing, encryptionSettings=nothing, name=nothing, vhd=nothing, image=nothing, caching=nothing, createOption=nothing, diskSizeGB=nothing, managedDisk=nothing)
        o = new()
        validate_property(OSDisk, Symbol("osType"), osType)
        setfield!(o, Symbol("osType"), osType)
        validate_property(OSDisk, Symbol("encryptionSettings"), encryptionSettings)
        setfield!(o, Symbol("encryptionSettings"), encryptionSettings)
        validate_property(OSDisk, Symbol("name"), name)
        setfield!(o, Symbol("name"), name)
        validate_property(OSDisk, Symbol("vhd"), vhd)
        setfield!(o, Symbol("vhd"), vhd)
        validate_property(OSDisk, Symbol("image"), image)
        setfield!(o, Symbol("image"), image)
        validate_property(OSDisk, Symbol("caching"), caching)
        setfield!(o, Symbol("caching"), caching)
        validate_property(OSDisk, Symbol("createOption"), createOption)
        setfield!(o, Symbol("createOption"), createOption)
        validate_property(OSDisk, Symbol("diskSizeGB"), diskSizeGB)
        setfield!(o, Symbol("diskSizeGB"), diskSizeGB)
        validate_property(OSDisk, Symbol("managedDisk"), managedDisk)
        setfield!(o, Symbol("managedDisk"), managedDisk)
        o
    end
end # type OSDisk

const _property_map_OSDisk = Dict{Symbol,Symbol}(Symbol("osType")=>Symbol("osType"), Symbol("encryptionSettings")=>Symbol("encryptionSettings"), Symbol("name")=>Symbol("name"), Symbol("vhd")=>Symbol("vhd"), Symbol("image")=>Symbol("image"), Symbol("caching")=>Symbol("caching"), Symbol("createOption")=>Symbol("createOption"), Symbol("diskSizeGB")=>Symbol("diskSizeGB"), Symbol("managedDisk")=>Symbol("managedDisk"))
const _property_types_OSDisk = Dict{Symbol,String}(Symbol("osType")=>"String", Symbol("encryptionSettings")=>"DiskEncryptionSettings", Symbol("name")=>"String", Symbol("vhd")=>"VirtualHardDisk", Symbol("image")=>"VirtualHardDisk", Symbol("caching")=>"Caching", Symbol("createOption")=>"CreateOption", Symbol("diskSizeGB")=>"Int32", Symbol("managedDisk")=>"ManagedDiskParameters")
Base.propertynames(::Type{ OSDisk }) = collect(keys(_property_map_OSDisk))
Swagger.property_type(::Type{ OSDisk }, name::Symbol) = Union{Nothing,eval(Meta.parse(_property_types_OSDisk[name]))}
Swagger.field_name(::Type{ OSDisk }, property_name::Symbol) =  _property_map_OSDisk[property_name]

const _allowed_OSDisk_osType = ["Windows", "Linux"]

function check_required(o::OSDisk)
    (getproperty(o, Symbol("createOption")) === nothing) && (return false)
    true
end

function validate_property(::Type{ OSDisk }, name::Symbol, val)
    if name === Symbol("osType")
        Swagger.validate_param(name, "OSDisk", :enum, val, _allowed_OSDisk_osType)
    end
end

ext: jl


max_stars_repo_name: hustf/Gravityfield

max_issues_repo_name: hustf/Gravityfield

max_forks_repo_name: hustf/Gravityfield


text:
begin
  import Pkg; Pkg.activate(".")
  Pkg.add("DifferentialEquations")
  Pkg.add("Optim")
end

using DifferentialEquations, Plots

function f(du,u,p,t)
  du[1] = u[2]
  du[2] = -p
end

u₀ = [50.0,0.0]
tspan = (0.0,15.0)
p = 9.8

prob = ODEProblem(f,u₀,tspan, p)
sol = solve(prob,Tsit5())
plot(sol, label = ["Displacement" "Velocity"],
  xlabel="Time (s)",
  ylabel="Displacement (m) | Velocity (m/s)")

# But where is the ground?
function condition(u,t,integrator) # Event when event_f(u,t) == 0
  u[1]
end

function affect!(integrator)
  integrator.u[2] = -integrator.u[2]
end

cb = ContinuousCallback(condition,affect!, save_positions=(false, false))

sol = solve(prob,Tsit5(), callback=cb)
plot(sol, label = ["Displacement" "Velocity"],
  xlabel="Time (s)",
  ylabel="Displacement (m) | Velocity (m/s)")

### Air resistance
function f₂(du,u,p,t)
  g, Cd = p
  du[1] = u[2]
  du[2] = -(g+u[2]^2*Cd*sign(u[2]))
end

p = (9.81, 15e-2)

prob = ODEProblem(f₂, u₀,tspan, p)
sol = solve(prob, Tsit5(), callback=cb)

plot(sol, label = ["Displacement" "Velocity"],
  xlabel="Time (s)",
  ylabel="Displacement (m) | Velocity (m/s)")

### Optim.jl
using Optim

function compute_ODE(p; times=1:0.5:15)
  prob = ODEProblem(f₂, u₀,tspan, p)
  sol = solve(prob, Tsit5(), saveat=times, callback = cb)
  return sol.t , hcat(sol.u...)[1,:]
end

time, exp_disp = compute_ODE((9.81, 5e-2))
exp_disp .+= 0.75randn(length(exp_disp)) # add noise

scatter(time, exp_disp, label="Experiment", xlabel="Time(s)", ylabel="Displacement (m)")

function objective(Cd)
  _, sim_disp = compute_ODE((9.81, Cd[1]))
  return sum((sim_disp.- exp_disp).^2)
end

res = optimize(objective, [5e-3], Newton(), Optim.Options(store_trace=true, extended_trace=true))
Cd = res.minimizer[1]

plot!(compute_ODE((9.81, Cd); times=0:0.1:15), label="Simulated")

### Visual
for iteration in res.trace[1:10]
  Cd = iteration.metadata["x"][1]
  pl = scatter(time, exp_disp, label="Experiment", xlabel="Time(s)", ylabel="Displacement (m)")
  plot!(pl, compute_ODE((9.81, Cd); times=0:0.1:15), label="Simulated (Cd: $Cd")
  display(pl)
  sleep(1.0)
end


text:
using Test
using LinearAlgebra
using QBase
using Random
using CVChannel

@testset "./src/states.jl" begin

@testset "wernerState" begin
    @test isapprox(wernerState(2,1),[1/3 0 0 0 ; 0 1/6 1/6 0 ; 0 1/6 1/6 0 ; 0 0 0 1/3], atol = 1e-6)
    @test isapprox(wernerState(2,0),[0 0 0 0 ; 0 1/2 -1/2 0 ; 0 -1/2 1/2 0 ; 0 0 0 0], atol = 1e-6)
    @test isapprox(wernerState(2,1/2),[1/6 0 0 0 ; 0 1/3 -1/6 0 ; 0 -1/6 1/3 0 ; 0 0 0 1/6], atol = 1e-6)

    @testset "errors" begin
        @test_throws DomainError wernerState(1, 0.5)
        @test_throws DomainError wernerState(2, -.1)
        @test_throws DomainError wernerState(2, 1.1)
    end
end

@testset "axisymmetricState" begin
    @testset "x=0., y=0. is maximally mixed" begin
        x = 0
        y = 0
        for d in 2:8
            d = 2
            ρ_axi = axisymmetricState(d,x,y)
            @test ρ_axi == Matrix(I, (d^2, d^2))/d^2
        end
    end

    @testset "bell state is 'upper right corner'" begin
        ϵ = 1e-8

        for d in 2:8
            bell_state = generalized_bell_states(d)[1]

            x = CVChannel._axisymmetric_x_bounds(d)[2] - ϵ
            y = CVChannel._axisymmetric_y_bounds(d)[2]

            ρ_axi = axisymmetricState(d, x, y)
            @test ρ_axi ≈ bell_state
        end
    end

    @testset "light scan over range " begin
        y_step = 0.5
        x_step = 0.5
        for d in 2:4
            y_bounds = CVChannel._axisymmetric_y_bounds(d)
            for y in y_bounds[1]:y_step:y_bounds[2]
                x_constraints = CVChannel._axisymmetric_x_constraints(d,y)
                for x in x_constraints[1]:x_step:x_constraints[2]
                    ρ_axi = axisymmetricState(d,x,y)
                    @test is_density_matrix(ρ_axi)
                end
            end
        end
    end

    @testset "domain errors" begin
        @test_throws DomainError axisymmetricState(1,0.,0.)
        @test_throws DomainError axisymmetricState(2,0.,2.)
        @test_throws DomainError axisymmetricState(2,2.,0.)
        @test_throws DomainError axisymmetricState(2,1(2*sqrt(2))+1e-5,0.)
    end
end

@testset "haarStates" begin
    @testset "verifying states, n = $n" for n in 1:5
        @testset "d = $d" for d in 1:5
            rand_states = haarStates(n, d)

            @test length(rand_states) == n
            @test all(ρ -> size(ρ) == (d,d), rand_states)
            @test all(ρ -> is_density_matrix(ρ), rand_states)
        end
    end

    @testset "seeded random states verification" begin
        Random.seed!(666)
        rand_states = haarStates(4,2)
        match_states = [
            [
                0.9068588653033508 + 0.0im -0.2824120726122391 - 0.06862423017367089im;
                -0.2824120726122391 + 0.06862423017367089im 0.09314113469664888 + 0.0im
            ],
            [
                0.3718976279148742 + 0.0im -0.3176606642535559 + 0.36425469750183553im;
                -0.3176606642535559 - 0.36425469750183553im 0.628102372085126 + 0.0im
            ],
            [
                0.4049640512580946 + 0.0im -0.1688517083280211 - 0.46093087230238206im;
                -0.1688517083280211 + 0.46093087230238206im 0.5950359487419055 + 0.0im
            ],
            [
                0.17921064730550684 + 0.0im -0.3426052023877003 + 0.17238290661991693im;
                -0.3426052023877003 - 0.17238290661991693im 0.8207893526944933 + 0.0im
            ]
        ]

        @test all(i -> rand_states[i] ≈ match_states[i], 1:4)
    end
end

end

max_forks_repo_name: ChitambarLab/cv-channel


text:
function get_map_shape_local(data_dir::String)

    zipfile = data_dir*"Regions_(December_2017)_Boundaries.zip"
    r = ZipFile.Reader(zipfile)
    for f in r.files
        println("Filename: $(f.name)")
        open(f.name, "w") do io
            write(io,read(f))
        end
    end
    close(r)
end

function load_map(fname::String)
    return Shapefile.shapes(Shapefile.Table(fname))
end


text:
using LibNCurses

randtxt(n) = foldl(*, rand(split("1234567890abcdefghijklmnopqrstuvwxyz", ""), n))

initscr()

for i in 1:20
    LibNCurses.mvwaddstr(i, 1, randtxt(50))
end

row = rand(1:20)
col = rand(1:50)
ch = LibNCurses.winch(row, col)
LibNCurses.mvwaddstr(col, 52, "The character at ($row, $col) is $ch.") )

max_stars_repo_name: ethansaxenian/RosettaDecode

max_issues_repo_name: ethansaxenian/RosettaDecode

max_forks_repo_name: ethansaxenian/RosettaDecode


text:
@testset "compute_beta.jl" begin

end


text:
module QuadTrigInterpMod

import FEM: AbstractInterpolator, Point2, FENode2, Vertex6, inv2x2t!, det2x2,
       dNmatrix, Jmatrix, dNdxmatrix, Nvec, get_area

export QuadTrigInterp

immutable QuadTrigInterp <: AbstractInterpolator
    N::Vector{Float64}
    dN::Matrix{Float64}
    dNdx::Matrix{Float64}
    J::Matrix{Float64}
end

function QuadTrigInterp()
    N = zeros(6)
    dN = zeros(6,2)
    dNdx = Array(Float64, 6, 2)
    J = Array(Float64, 2, 2)
    QuadTrigInterp(N, dN, dNdx, J)
end
get_allocated_N(i::QuadTrigInterp) = i.N
get_allocated_dN(i::QuadTrigInterp) = i.dN
get_allocated_dNdx(i::QuadTrigInterp) = i.dNdx
get_allocated_J(i::QuadTrigInterp) = i.J

# Shape functions in local coords
# http://www.colorado.edu/engineering/CAS/courses.d/IFEM.d/IFEM.Ch16.d/IFEM.Ch16.pdf
function Nvec(interp::QuadTrigInterp, loc_coords::Point2)

    ξ = loc_coords[1]
    η = loc_coords[2]
    γ = 1 - ξ - η

    N = get_allocated_N(interp)

    N[1] = ξ * (2ξ - 1)
    N[2] = η * (2η - 1)
    N[3] = γ * (2γ - 1)
    N[4] = 4ξ * η
    N[5] = 4η * γ
    N[6] = 4ξ * γ

    return N
end

function dNmatrix(interp::QuadTrigInterp, loc_coords::Point2)
    ξ = loc_coords.(1)
    η = loc_coords.(2)
    γ = 1 - ξ - η

    dN = get_allocated_dN(interp)

    dN[1, 1] = 4ξ - 1
    dN[1, 2] = 0

    dN[2, 1] = 0
    dN[2, 2] = 4η - 1

    dN[3, 1] = -4γ + 1
    dN[3, 2] = -4γ + 1

    dN[4, 1] = 4η
    dN[4, 2] = 4ξ

    dN[5, 1] = -4η
    dN[5, 2] = 4(γ - η)

    dN[6, 1] = 4(γ - ξ)
    dN[6, 2] = -4ξ

    return dN
end

#const nfields = 6
function Jmatrix(interp::QuadTrigInterp,
                 vertices::Vertex6, nodes::Vector{FENode2},
                 dN::Matrix{Float64})

    J = get_allocated_J(interp)
    fill!(J, 0.0)
    for row in 1:size(dN, 1)
        x = nodes[vertices.(row)].coords.x
        y = nodes[vertices.(row)].coords.y

        J[1, 1] += dN[row, 1] * x
        J[1, 2] += dN[row, 1] * y
        J[2, 1] += dN[row, 2] * x
        J[2, 2] += dN[row, 2] * y
    end
    return J
end

function dNdxmatrix(interp::QuadTrigInterp, local_coords::Point2,
                    vertices::Vertex6, nodes::Vector{FENode2})
        dN = dNmatrix(interp, local_coords)
        J = Jmatrix(interp, vertices, nodes, dN)
        A_mul_B!(interp.dNdx, dN, inv2x2t!(J))
        return interp.dNdx
end

end # module


text:
function removeWeak(mut_counts, remove_weak_muttypes)

    sum_mut_counts = reshape(sum(mut_counts, dims=2), size(mut_counts, 1))
    sort_idx = sortperm(sum_mut_counts)
    sort_muts = sum_mut_counts[sort_idx]

    cumsum_sort_muts = cumsum(sort_muts) / sum(mut_counts)
    n_types_to_remove = length(cumsum_sort_muts[cumsum_sort_muts .< remove_weak_muttypes])

    return mut_counts[sort_idx[n_types_to_remove+1:end], :], sort_idx, n_types_to_remove
end

max_stars_repo_name: ypradat/sigprofilerjulia

max_issues_repo_name: ypradat/sigprofilerjulia

max_forks_repo_name: ypradat/sigprofilerjulia


text:
## make the surface struct
using HiQGA.transD_GP, Random
surface = transD_GP.Surface(imagegrid;useML=false, σ=noisegrid)
## stationary GP options
nmin, nmax= 2, 100
pnorm = 2.
K = transD_GP.GP.Mat32()
ftrain = surface.d[surface.select]
fbounds = permutedims([extrema(ftrain)...])
δ = 0.3
λ = [50_000,50_000.]
demean = false
sampledc = true
sdev_prop = 0.05*diff(fbounds, dims=2)[:]
sdev_pos = 0.05*abs.([diff([extrema(xall[1,:])...])[1], diff([extrema(xall[2,:])...])[1]])
updatenonstat = false
needλ²fromlog = false
## Initialize a stationary GP using these options
Random.seed!(12)
opt = transD_GP.OptionsStat(nmin = nmin,
                        nmax = nmax,
                        xbounds = [minimum(xall[1,:]) maximum(xall[1,:]);
                                   minimum(xall[2,:]) maximum(xall[2,:])],
                        fbounds = fbounds,
                        xall = xall,
                        λ = λ,
                        δ = δ,
                        demean = demean,
                        sampledc = sampledc,
                        sdev_prop = sdev_prop,
                        sdev_pos = sdev_pos,
                        pnorm = pnorm,
                        quasimultid = false,
                        K = K,
                        timesλ = 3,
                        needλ²fromlog = needλ²fromlog,
                        updatenonstat = updatenonstat
                        )

max_stars_repo_name: GeoscienceAustralia/HiQGA

max_issues_repo_name: GeoscienceAustralia/HiQGA

max_forks_repo_name: GeoscienceAustralia/HiQGA


text:
export    textWidth, DrawText, DrawSelectedText, setTextContext, PushToRow, fontSlant, fontWeight
#======================================================================================#
#
#======================================================================================#
function fontSlant(shape)
    if shape.flags[TextItalic]
        return Cairo.FONT_SLANT_ITALIC
    elseif shape.flags[TextOblique]
        return Cairo.FONT_SLANT_OBLIQUE
    else
        return Cairo.FONT_SLANT_NORMAL
    end
end
#======================================================================================#
function fontWeight(shape)
    if shape.flags[TextBold]
        return Cairo.FONT_WEIGHT_BOLD
    else
        return Cairo.FONT_WEIGHT_NORMAL
    end
end# ======================================================================================
#  This is to tell text_extents() how to measure text
# ======================================================================================
function setTextContext(ctx::CairoContext, node::TextElement)
    font = node.parent.font
    slant  = fontSlant(font)
    weight = fontWeight(font)
    select_font_face(ctx, font.family, slant, weight);
    set_font_size(ctx, font.size);
end
#======================================================================================#
function TextWidth(node::TextElement)
    ctx = CairoContext( CairoRGBSurface(0,0) )
    setTextContext(ctx, node)
    return text_extents(ctx, node.shape.text )[3]
end
#======================================================================================#
# TODO: simplify / clean up
# Called from: LayoutBegin.jl ~30
# PushToRow(document, node, l,t,w)
# l,t,w   define the content area of the parent
##======================================================================================#
function PushToRow(document::Page, node::TextElement, l::Float64, t::Float64, wide::Float64)
    #set up all variables...
    text = node.shape.text # Entire unbroken string
    ctx = CairoContext( CairoRGBSurface(0,0) )
    setTextContext(ctx, node)
    fontheight = text_extents(ctx, text )[4]
    # clean out old text.
    node.parent.rows = []

    function textToNode(line, textWidth)
        parent = node.parent # This would be like say a 'p' element
        textLine = TextLine(parent, line, l, t, textWidth, parent.font.lineHeight*fontheight)
        textNode = TextElement(parent, textLine)
        flags = getFlags(parent)
        feedRow(parent, textNode)
    end

     # TODO: make faster.
     breaks = vcat([ i.match.offset+1 for i in eachmatch(r" ", text)], length(text))
     lastbreak = 1
     lineWidth = wide
     if length(breaks) > 1
         for i in 2:length(breaks)
             extetents = text_extents(ctx, text[lastbreak:breaks[i]])
             if extetents[3] >= lineWidth # Too long ...cut!
                 brk = breaks[i-1]
                 line = text[lastbreak:brk]
                 textToNode(line, text_extents(ctx, line)[3])
                 lastbreak = brk
                 lineWidth = wide
             end
         end
     end
     line = text[lastbreak:length(text)]
     textToNode(line, text_extents(ctx,line )[3])
     destroy(ctx)
end
#======================================================================================#
# TODO: simplify / clean up
##
#======================================================================================#
# function getTextFor(ctx, maxLength, start, text)
#     while
#
#
#     for i in 2:length(breaks)
#         extetents = text_extents(ctx, text[lastbreak:breaks[i]])
#         if extetents[3] >= lineWidth # Too long ...cut!
#             brk = breaks[i-1]
#             line = text[lastbreak:brk]
#             textToNode(line, text_extents(ctx, line)[3])
#             lastbreak = brk
#             lineWidth = wide
#         end
#     end
# end
# ======================================================================================
#
# ======================================================================================
function DrawSelectedText(ctx::CairoContext, nodeList, l,r,t,b, clipPath)
last = length(nodeList)
width,left = 0,0
allSelectedText = ""

    function PaintBox(ctx, color, l,t,r,b)
        setcolor( ctx, color...)
        rectangle(ctx,  l,t,r,b )
        fill(ctx)
    end

offset = 0
    for n in 1:last
        chunkStart, chunkEnd = 0,0
        s = nodeList[n].shape #n.shape
        setTextContext(ctx, nodeList[n]) # this is to tell text_extents() how to measure text

        # TODO: make this work when start and end are on the same line!
        if n == 1 # First selected line!
            offset = 0
            newLeft = 0
            start = l-s.left
            for i in 1:length(s.text)
                extents = text_extents(ctx, s.text[1:i] )[3];
                if extents < start
                    offset = i
                    newLeft = extents
                else
                    break
                end
            end
            allSelectedText *= s.text[offset+1:end] * "\n"
            left, width = s.left+newLeft,  s.width-newLeft
            if newLeft > 0 # how much to redraw before selection start
                color = inheritColor(nodeList[n].parent) #nodeList[n].parent.shape.color
                if length(color) == 0
                    color = [0,0,0]
                end
                PaintBox(ctx, color, s.left,  s.top, newLeft,  s.height)
            end
        elseif  n == last # Last selected line!
            newRight = 0
            offset = 0
            ending = r-s.left # actual selected width.
            for i in length(s.text):-1:1
                extents = text_extents(ctx, s.text[1:i] )[3];
                if extents > ending
                    offset = i
                    newRight = extents
                else
                    break
                end
            end

            allSelectedText *= s.text[1:offset] * "\n"
            left, width = s.left,  newRight
            if newRight > 0 # how much to redraw after selection end
                #chunkStart, chunkEnd = left+width, s.left+s.width
                color = inheritColor(nodeList[n].parent) #nodeList[n].parent.shape.color
                PaintBox(ctx, color, left+width,  s.top, s.width-width,  s.height+1)
            end
        else
            allSelectedText *= s.text * "\n"
            left, width = s.left,  s.width+1
        end
clipboard(allSelectedText)

        rectangle(ctx,  clipPath... )
        clip(ctx)
        # if chunkStart == 0 # how much to redraw before/after selection
        #     # this does not take into considderation the posibility that the parent could have an image, gradiant or transparency.
        #     # It may be best to redraw the parent and use this rectangle as a clipping area to reduce the time consumed.
        #     color = nodeList[n].parent.shape.color
        #     println(color)
        #
        #     PaintBox(ctx, color, chunkStart,  s.top, chunkEnd,  s.height+1)
        # end
        PaintBox(ctx, [0.956357, 0.95884, 0.188998], left,  s.top, width,  s.height+1)
        DrawText(ctx, nodeList[n], clipPath)
    end
end
# ======================================================================================
# Draw text.
# ======================================================================================
# -extents[4] is the top of the text
# ======================================================================================
function DrawText(ctx::CairoContext, node, clipPath)
    font = node.parent.font
    shape = node.shape
    left = node.shape.left
    set_antialias(ctx,6)
    slant  = fontSlant(font)
    weight = fontWeight(font)
    select_font_face(ctx, font.family, slant, weight);
    set_font_size(ctx, font.size);
    text = shape.text

# Trim leading space because it causes text to be offset.
if text[1] == ' '
    text = text[2:end]
end

    if !font.flags[TextPath]
        move_to(ctx, shape.left, shape.top + font.size);
        setcolor(ctx, font.color...)
        show_text(ctx, text);

    else  # shaddow
          move_to(ctx, shape.left+4, shape.top + font.size+4);
          text_path(ctx, text);
          setcolor(ctx,  0,0,0,0.4) # fill color
          fill_preserve(ctx);
          setcolor(ctx,  0,0,0,0.1) # outline color
          set_line_width(ctx,  4 ); # 2.56 MyText.lineWidth
          stroke(ctx);

          move_to(ctx, shape.left+4, shape.top + font.size+4);
          text_path(ctx, text);
          setcolor(ctx,  0,0,0,0.2) # fill color
          fill_preserve(ctx);
          setcolor(ctx,  0,0,0,0.1) # outline color
          set_line_width(ctx,  2 ); # 2.56 MyText.lineWidth
          stroke(ctx);

          move_to(ctx, shape.left, shape.top + font.size);
          text_path(ctx, text);
          setcolor(ctx, font.fill...) # fill color
          fill_preserve(ctx);
          setcolor(ctx, font.color...) # outline color
          set_line_width(ctx, font.lineWidth ); # 2.56 MyText.lineWidth
          stroke(ctx);
    end
end


text:
module AoGExtensions

export quantileband, binscatter
export draw!, draw, facet!

include("layout.jl")
include("analyses.jl")

end


text:
include("helper.jl")

include("standardchop.jl")

include("blas.jl")
include("lyap.jl")

include("clenshaw.jl")

include("hesseneigs.jl")

include("LowRankMatrix.jl")
include("AlmostBandedMatrix.jl")
include("RaggedMatrix.jl")

include("rowvector.jl")


text:
"""
    Eigenbrot(filename)
Construct an Eigenbrot from a file, which should be a FITS
file (including a gzipped FITS file), or an image type that
can be loaded by ImageMagick.

    Eigenbrot(data::Matrix{ComplexF64}, fft = false)
Construct an Eigenbrot from a matrix of complex values.

    Eigenbrot(rows::Integer, cols::Integer, fft = false)
Construct an unitialised Eigenbrot of size `rows×cols`.

    Eigenbrot(f::Function, rows::Integer, cols::Integer, fft = false)
Construct an Eigenbrot of size `rows×cols`, using `f(x, y)` to
calculate the data values.

    Eigenbrot(img::Matrix{Gray{T}}, fft = false) where {T}
Construct an Eigenbrot from a grey scale image.
"""
mutable struct Eigenbrot
    vals::Matrix{ComplexF64}
    fft::Bool
    have_min_max::Bool
    maxCmp::Float64
    minCmp::Float64
    maxMag::Float64
    Eigenbrot(data::Matrix{T}, fft = false) where {T <: Number} =
        new(ComplexF64.(data), fft, false)
end

Eigenbrot(rows::Integer, cols::Integer, fft = false) =
        Eigenbrot(Matrix{ComplexF64}(undef, rows, cols), fft)

@enum Scale LinearScale LogScale RootScale
@enum Component RealPart ImagPart Magn Phase

struct ImageSetting
    c::Component
    s::Scale
    p::Int
    ImageSetting(component::Component, scale::Scale, power::Integer = 2) =
        new(component, scale, power)
end

function Eigenbrot(f::Function, rows::Integer, cols::Integer, fft = false)
    xMax = div(cols, 2) - 1
    xMin = xMax - cols + 1
    yMax = div(rows, 2) - 1
    yMin = yMax - rows + 1
    return Eigenbrot([ComplexF64(f(x, y)) for y in yMin:yMax, x in xMin:xMax], fft)
end

function Eigenbrot(img::Matrix{Gray{T}}, fft = false) where {T}
    h, w = size(img)
    cdata = Matrix{ComplexF64}(undef, h, w)
    for c in 1:w
        for r in 1:h
            cdata[h - r + 1, c] = ComplexF64(round(UInt8, 255 * img[r, c].val))
        end
    end
    return Eigenbrot(cdata, fft)
end

Eigenbrot(img::Matrix{C}, fft = false) where {C <: Colorant} =
    Eigenbrot(Gray.(img), fft)

function read_fits(file::AbstractString)
    fits = FITS(file)
    hdu = nothing
    for u in fits
        if isa(u, ImageHDU)
            hdu = u
            break
        end
    end
    if hdu == nothing
        error("No image found in FITS file '$file'")
    end
    isfft, comment = read_key(hdu, "ISFFT")
    data = read(hdu)

    if ndims(data) > 2
        w, h = size(data)
        cdata = Matrix{ComplexF64}(undef, h, w)
        for c in 1:w
            for r in 1:h
                cdata[r, c] = ComplexF64(data[c, r, 1], data[c, r, 2])
            end
        end
    elseif ndims(data) == 2
        cdata = map(x -> ComplexF64(x), data)
        reshape(cdata, size(data, 1), size(data, 2))
    else
        cdata = map(x -> ComplexF64(x), data)
    end
    return Eigenbrot(cdata, isfft)
end

function read_image(file::AbstractString)
    img = nothing
    try
        img = load(file)
    catch
        error("Can't read file $file.")
    end
    #=
    Images.jl greyscale conversion uses the
    values from CCIR 601, as does the C++-version of
    Eigenbroetler. See
    https://en.wikipedia.org/wiki/Grayscale
    =#
    return Eigenbrot(img)
end

const fits_magic = b"SIMPLE "
const gzip_magic = [0x1f, 0x8b]
const max_magic_len = max(length(fits_magic), length(gzip_magic))

function Eigenbrot(filename::AbstractString)
    t = open(filename)
    by = read(t, max_magic_len)
    close(t)
    if by[1:length(fits_magic)] == fits_magic || by[1:length(gzip_magic)] == gzip_magic
        return read_fits(filename)
    else
        return read_image(filename)
    end
end

Images.width(eb::Eigenbrot) = size(eb.vals, 2)
Images.height(eb::Eigenbrot) = size(eb.vals, 1)
isFFT(eb::Eigenbrot) = eb.fft

for name in (:ndims, :length, :size)
    @eval begin
        Base.$name(eb::Eigenbrot) = $name(eb.vals)
    end
end

Base.size(eb::Eigenbrot, args...) = size(eb.vals, args...)

Base.getindex(eb::Eigenbrot, row::Integer, col::Integer) = getindex(eb.vals, row, col)
Base.getindex(eb::Eigenbrot,
              rows::AbstractRange{T},
              cols::AbstractRange{U}) where {T <: Integer, U <: Integer} =
                  getindex(eb.vals, rows, cols)
Base.getindex(eb::Eigenbrot, indices::Vector{T}) where {T <: Integer} =
    getindex(eb.vals, indices)
Base.getindex(eb::Eigenbrot, rc::Tuple{T, U}) where {T <: Integer, U <: Integer} =
                  getindex(eb.vals, rc[1], rc[2])

function Base.setindex!(eb::Eigenbrot, val::Number, row::Integer, col::Integer)
    reset!(eb)
    setindex!(eb.vals, val, row, col)
end

function Base.setindex!(eb::Eigenbrot, val::Number, indices::Vector{T}) where {T <: Integer}
    reset!(eb)
    setindex!(eb.vals, val, indices)
end

function Base.setindex!(eb::Eigenbrot, val::Number,
                        rc::Tuple{T, U}) where {T <: Integer, U <: Integer}
    reset!(eb)
    setindex!(eb.vals, val, rc[1], rc[2])
end

reset!(eb::Eigenbrot) = (eb.have_min_max = false)

"""
    fill!(eb, x)
Fill Eigenbrot `eb` with the number `x`.
"""
function Base.fill!(eb::Eigenbrot, x::Number)
    reset!(eb)
    fill!(eb.vals, x)
end

"""
    save(filename::AbstractString, eb::Eigenbrot)
Write Eigenbrot `eb` to a file in FITS format

    save(filename::AbstractString, eb::Eigenbrot, cmp::ImageSetting; colours::Symbol)
Save a bitmap representation of a component of Eigenbrot `eb` to
`filename`. The file format will be determined by the file name.
The component of the data and the scaling method are determined by `cmp`.

    save(filename, eb::Eigenbrot, cmp::ImageSetting, cmp2::ImageSetting; colours::Symbol)
Save a bitmap representation of two components of Eigenbrot `eb` to
`filename`. The file format will be determined by the file name.
The components of the data and the scaling method are determined by `cmp`
and `cmp2`.
"""
function FileIO.save(filename::AbstractString, eb::Eigenbrot)
    keys = ["COMMENT", "ISFFT"]
    values = [nothing, eb.fft]
    comments = ["CREATED BY AN EIGENBROETLER",
                eb.fft ? "image in Fourier space?" : "image in real space?"]
    hdr = FITSHeader(keys, values, comments)
    fits = FITS(filename, "w")
    w = width(eb)
    h = height(eb)
    hlen = w * h
    lpData = Vector{Float64}(undef, hlen * 2)
    real = 1
    imag = 1 + hlen
    for r in 1:h
        for c in 1:w
            v = eb.vals[r, c]
            lpData[real] = v.re
            lpData[imag] = v.im
            real += 1
            imag += 1
        end
    end
    lpData = reshape(lpData, w, h, 2)
    write(fits, lpData, header=hdr, name=nothing, ver=nothing)
    close(fits)
end

"""
    image(eb::Eigenbrot, cmp::ImageSetting; colours::Symbol)
Construct a bitmap representation of a component of Eigenbrot `eb`.
The component of the data and the scaling method are determined by `cmp`.

    image(eb::Eigenbrot, cmp::ImageSettingb, cmp2::ImageSetting; colours::Symbol)
Construct a bitmap representation of two components of Eigenbrot `eb`.
The components of the data and the scaling method are determined by `cmp`
and `cmp2`.
"""
function image(eb::Eigenbrot,
               cmp::ImageSetting,
               cmp2::Union{Nothing, ImageSetting} = nothing;
               colours::Union{Symbol, AbstractString} = :grey)
    w = w2 = width(eb)
    h = height(eb)
    hlen = w * h
    calculate_ranges!(eb)
    (cmp2 != nothing) && (w2 *= 2)
    pal = palette(colours)
    img = Matrix{RGB{N0f8}}(undef, h, w2)
    calculate_pixels!(img, eb, cmp, pal, 0)
    (cmp2 != nothing) && calculate_pixels!(img, eb, cmp2, pal, h * w)
    return img
end

FileIO.save(filename::AbstractString, eb::Eigenbrot,
     cmp::ImageSetting,
     cmp2::Union{Nothing, ImageSetting} = nothing;
     colours::Union{Symbol, AbstractString} = :grey) =
         save(filename, image(eb, cmp, cmp2, colours = colours))

scaleLogarithmic(x::Float64, ::Int) = log10(x)
scaleLinear(x::Float64, ::Int) = x
scaleRoot(x::Float64, p::Int) = x ^ (1.0 / p)

function calculate_pixels!(img::Matrix{RGB{N0f8}}, eb::Eigenbrot,
                           cmp::ImageSetting, palette::Palette, idx::Integer)
    h, w = size(eb.vals)
    if cmp.c == Phase
        # Phase part
        minValue = -π
        maxValue = +π
        scaleFactor = (NUM_COLOURS - 1) / (maxValue - minValue)
        for c in 1:w
            for r in h:-1:1
                k = trunc(Int, scaleFactor * (angle(eb.vals[r, c]) - minValue))
                idx += 1
                img[idx] = palette[1 + k]
            end
        end
    elseif cmp.c == Magn
        # Magnitude part
        scaler = cmp.s == LinearScale ? scaleLinear : (cmp.s == LogScale ? scaleLogarithmic : scaleRoot)
        minValue = 0.0
        maxValue = eb.maxMag
        offset = (cmp.s == LogScale) ? 1.0 : 0.0
        if isapprox(maxValue, minValue)
            scaleFactor = (NUM_COLOURS >> 1) - 1.0
            minValue -= offset
            maxValue -= offset
        else
            offset = minValue - offset
            scaleFactor = (NUM_COLOURS - 1) /
                (scaler(maxValue - offset, cmp.p) - scaler(minValue - offset, cmp.p))
        end
        for c in 1:w
            for r in h:-1:1
                k = trunc(Int, scaler(abs(eb.vals[r, c]) - offset, cmp.p) * scaleFactor)
                idx += 1
                img[idx] = palette[1 + k]
            end
        end
    else
        scaler = scaleLinear
        minValue = eb.minCmp
        maxValue = eb.maxCmp
        if isapprox(maxValue, minValue)
            scaleFactor = (NUM_COLOURS >> 1) - 1.0
            offset = 0.0
        else
            offset = minValue
            scaleFactor = (NUM_COLOURS - 1) /
                (scaler(maxValue - offset, cmp.p) - scaler(minValue - offset, cmp.p))
        end
        select = (cmp.c == RealPart) ? real : imag
        for c in 1:w
            for r in h:-1:1
                k = trunc(Int, scaler(select(eb.vals[r, c]) - offset, cmp.p) * scaleFactor)
                idx += 1
                img[idx] = palette[1 + k]
            end
        end
    end
end

function Base.show(io::IO, eb::Eigenbrot)
    print(io, "Eigenbrot(", height(eb), "x", width(eb), ", ",
          isFFT(eb) ? "Fourier" : "Real", " space)")
 end

"""
    calculate_ranges!(eb::Eigenbrot)
Calculate minimum and maximum values in an `Eigenbrot`.
Used for calculating pixel values in an image.
"""
function calculate_ranges!(eb::Eigenbrot)
    if eb.have_min_max
        return
    end
    eb.maxCmp = typemin(Float64)
    eb.minCmp = typemax(Float64)
    eb.maxMag = 0.0
    for x in eb.vals
        eb.maxCmp = max(eb.maxCmp, real(x), imag(x))
        eb.minCmp = min(eb.minCmp, real(x), imag(x))
        eb.maxMag = max(eb.maxMag, abs(x))
    end
    eb.have_min_max = true
    return
end

Base.similar(eb::Eigenbrot) = Eigenbrot(height(eb), width(eb))

Base.copy(eb::Eigenbrot) = Eigenbrot(copy(eb.vals), eb.fft)

"""
    pixel(eb::Eigenbrot, x::Real, y::Real)
Return a tuple , `(row, column)`, indexing the closest position
in `eb` to to the Cartesian location `(x, y)`. The inverse of `coords`.
    pixel(eb::Eigenbrot, xy::Tuple{Real, Real})
Return a tuple , `(row, column)`, indexing the closest position
in `eb` to to the Cartesian location given by `xy`. The inverse of `coords`.
"""
function pixel(eb::Eigenbrot, x::Real, y::Real)
    h, w = size(eb.vals)
    xMax = div(w, 2)
    xMin = xMax - w
    yMax = div(h, 2)
    yMin = yMax - h
    (round(Int, 1 + h * (y - yMin) / height(eb)),
     round(Int, 1 + w * (x - xMin) / width(eb)))
end

pixel(eb::Eigenbrot, xy::Tuple{T, U}) where {T <: Real, U <: Real} =
    pixel(eb, xy[1], xy[2])

"""
    coords(eb::Eigenbrot, r::Integer, c::Integer)
Return a tuple, `(x, y)`, of the Cartesian location
mapped by the pixel `eb[r, c]`. The inverse of `pixel`.
    coords(eb::Eigenbrot, rc::Tuple{Integer, Integer})
Return a tuple , `(x, y)`, of the Cartesian location
mapped by the pixel `eb[rc]`. The inverse of `pixel`.
"""
function coords(eb::Eigenbrot, r::Integer, c::Integer)
    h, w = size(eb.vals)
    xMin = div(w, 2) - w
    yMin = div(h, 2) - h
    (xMin + (c - 1) * width(eb) / w,
     yMin + (r - 1) * height(eb) / h)
end

coords(eb::Eigenbrot, rc::Tuple{T, U}) where {T <: Integer, U <: Integer} =
    coords(eb, rc[1], rc[2])