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

@test integrate(x^5*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(1//6*x^6*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1//36*e^-1//2*x^5*(d+e*x^2)^(1/2)+5//96*d^3*e^-3*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-5//96*x*d^2*e^-5//2*(d+e*x^2)^(1/2)+5//144*d*e^-3//2*x^3*(d+e*x^2)^(1/2))
@test integrate(x^3*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(1//4*x^4*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-3//32*d^2*e^-2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1//16*e^-1//2*x^3*(d+e*x^2)^(1/2)+3//32*d*x*e^-3//2*(d+e*x^2)^(1/2))
@test integrate(x*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :((1/2)*x^2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1//4*x*e^-1//2*(d+e*x^2)^(1/2)+1//4*d*e^-1*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2))
@test integrate(x^-1*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)*log(x)+(1/2)*d^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*Polylogarithms.polylog(2,exp(2*arcsinh(x*d^-1//2*e^(1/2))))+-1//2*d^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*arcsinh(x*d^-1//2*e^(1/2))^2+d^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*arcsinh(x*d^-1//2*e^(1/2))*log(1+-1*exp(2*arcsinh(x*d^-1//2*e^(1/2))))+-1*d^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*arcsinh(x*d^-1//2*e^(1/2))*log(x))
@test integrate(x^-3*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-1//2*x^-2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1//2*d^-1*e^(1/2)*x^-1*(d+e*x^2)^(1/2))
@test integrate(x^-5*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-1//4*x^-4*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1//12*d^-1*e^(1/2)*x^-3*(d+e*x^2)^(1/2)+1//6*d^-2*e^3//2*x^-1*(d+e*x^2)^(1/2))
@test integrate(x^-7*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-1//6*x^-6*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-4//45*d^-3*e^5//2*x^-1*(d+e*x^2)^(1/2)+-1//30*d^-1*e^(1/2)*x^-5*(d+e*x^2)^(1/2)+2//45*d^-2*e^3//2*x^-3*(d+e*x^2)^(1/2))
@test integrate(x^-9*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-1//8*x^-8*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1//35*d^-3*e^5//2*x^-3*(d+e*x^2)^(1/2)+-1//56*d^-1*e^(1/2)*x^-7*(d+e*x^2)^(1/2)+2//35*d^-4*e^7//2*x^-1*(d+e*x^2)^(1/2)+3//140*d^-2*e^3//2*x^-5*(d+e*x^2)^(1/2))
@test integrate(x^6*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-1//49*e^-7//2*(d+e*x^2)^7//2+1//7*x^7*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1//7*d^2*e^-7//2*(d+e*x^2)^3//2+1//7*d^3*e^-7//2*(d+e*x^2)^(1/2)+3//35*d*e^-7//2*(d+e*x^2)^5//2)
@test integrate(x^4*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-1//25*e^-5//2*(d+e*x^2)^5//2+1//5*x^5*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1//5*d^2*e^-5//2*(d+e*x^2)^(1/2)+2//15*d*e^-5//2*(d+e*x^2)^3//2)
@test integrate(x^2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-1//9*e^-3//2*(d+e*x^2)^3//2+1//3*x^3*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+1//3*d*e^-3//2*(d+e*x^2)^(1/2))
@test integrate(arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(x*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1*e^-1//2*(d+e*x^2)^(1/2))
@test integrate(x^-2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-1*x^-1*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1*d^-1//2*e^(1/2)*arctanh(d^-1//2*(d+e*x^2)^(1/2)))
@test integrate(x^-4*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-1//3*x^-3*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+1//6*d^-3//2*e^3//2*arctanh(d^-1//2*(d+e*x^2)^(1/2))+-1//6*d^-1*e^(1/2)*x^-2*(d+e*x^2)^(1/2))
@test integrate(x^-6*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-1//5*x^-5*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-3//40*d^-5//2*e^5//2*arctanh(d^-1//2*(d+e*x^2)^(1/2))+-1//20*d^-1*e^(1/2)*x^-4*(d+e*x^2)^(1/2)+3//40*d^-2*e^3//2*x^-2*(d+e*x^2)^(1/2))
@test integrate(x^9//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(2//11*x^11//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-4//121*e^-1//2*x^9//2*(d+e*x^2)^(1/2)+-60//847*d^2*e^-5//2*x^(1/2)*(d+e*x^2)^(1/2)+36//847*d*e^-3//2*x^5//2*(d+e*x^2)^(1/2)+30//847*d^11//4*e^-11//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^5//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(2//7*x^7//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-4//49*e^-1//2*x^5//2*(d+e*x^2)^(1/2)+20//147*d*e^-3//2*x^(1/2)*(d+e*x^2)^(1/2)+-10//147*d^7//4*e^-7//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^(1/2)*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(2//3*x^3//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-4//9*e^-1//2*x^(1/2)*(d+e*x^2)^(1/2)+2//9*d^3//4*e^-3//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^-3//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-2*x^-1//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+2*d^-1//4*e^1//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^-7//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-2//5*x^-5//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-4//15*d^-1*e^(1/2)*x^-3//2*(d+e*x^2)^(1/2)+-2//15*d^-5//4*e^5//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^-11//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-2//9*x^-9//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-4//63*d^-1*e^(1/2)*x^-7//2*(d+e*x^2)^(1/2)+20//189*d^-2*e^3//2*x^-3//2*(d+e*x^2)^(1/2)+10//189*d^-9//4*e^9//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^-15//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-2//13*x^-13//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-60//1001*d^-3*e^5//2*x^-3//2*(d+e*x^2)^(1/2)+-4//143*d^-1*e^(1/2)*x^-11//2*(d+e*x^2)^(1/2)+36//1001*d^-2*e^3//2*x^-7//2*(d+e*x^2)^(1/2)+-30//1001*d^-13//4*e^13//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^7//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(2//9*x^9//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-4//81*e^-1//2*x^7//2*(d+e*x^2)^(1/2)+28//405*d*e^-3//2*x^3//2*(d+e*x^2)^(1/2)+-28//135*d^2*e^-2*x^(1/2)*(d+e*x^2)^(1/2)*(d^(1/2)+x*e^(1/2))^-1+-14//135*d^9//4*e^-9//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2)+28//135*d^9//4*e^-9//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.E(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^3//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(2//5*x^5//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-4//25*e^-1//2*x^3//2*(d+e*x^2)^(1/2)+12//25*d*e^-1*x^(1/2)*(d+e*x^2)^(1/2)*(d^(1/2)+x*e^(1/2))^-1+-12//25*d^5//4*e^-5//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.E(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2)+6//25*d^5//4*e^-5//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^-1//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(2*x^(1/2)*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-4*x^(1/2)*(d+e*x^2)^(1/2)*(d^(1/2)+x*e^(1/2))^-1+-2*d^1//4*e^-1//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2)+4*d^1//4*e^-1//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.E(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^-5//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-2//3*x^-3//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-4//3*d^-1*e^(1/2)*x^-1//2*(d+e*x^2)^(1/2)+4//3*e*d^-1*x^(1/2)*(d+e*x^2)^(1/2)*(d^(1/2)+x*e^(1/2))^-1+-4//3*d^-3//4*e^3//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.E(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2)+2//3*d^-3//4*e^3//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^-9//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2), x) == :(-2//7*x^-7//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-4//35*d^-1*e^(1/2)*x^-5//2*(d+e*x^2)^(1/2)+12//35*d^-2*e^3//2*x^-1//2*(d+e*x^2)^(1/2)+-12//35*d^-2*e^2*x^(1/2)*(d+e*x^2)^(1/2)*(d^(1/2)+x*e^(1/2))^-1+-6//35*d^-7//4*e^7//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.F(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2)+12//35*d^-7//4*e^7//4*((d^(1/2)+x*e^(1/2))^-2*(d+e*x^2))^(1/2)*(d+e*x^2)^-1//2*(d^(1/2)+x*e^(1/2))*Elliptic.E(2*arctan(d^-1//4*e^1//4*x^(1/2)),1/2))
@test integrate(x^3*arctanh(a+b*x^4), x) == :(1//8*b^-1*log(1+-1*(a+b*x^4)^2)+1//4*b^-1*(a+b*x^4)*arctanh(a+b*x^4))
@test integrate(x^(-1+n)*arctanh(a+b*x^n), x) == :((1/2)*b^-1*n^-1*log(1+-1*(a+b*x^n)^2)+b^-1*n^-1*(a+b*x^n)*arctanh(a+b*x^n))
@test integrate((1+-1*c^2*x^2)^-1*(a+b*arctanh((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))^3, x) == :(-2*c^-1*(a+b*arctanh((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))^3*arctanh(1+-2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+-3//4*b^3*c^-1*Polylogarithms.polylog(4,-1+2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+3//4*b^3*c^-1*Polylogarithms.polylog(4,1+-2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+-3//2*b*c^-1*(a+b*arctanh((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))^2*Polylogarithms.polylog(2,-1+2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+-3//2*b^2*c^-1*(a+b*arctanh((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))*Polylogarithms.polylog(3,1+-2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+3//2*b*c^-1*(a+b*arctanh((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))^2*Polylogarithms.polylog(2,1+-2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+3//2*b^2*c^-1*(a+b*arctanh((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))*Polylogarithms.polylog(3,-1+2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1))
@test integrate((1+-1*c^2*x^2)^-1*(a+b*arctanh((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))^2, x) == :((1/2)*b^2*c^-1*Polylogarithms.polylog(3,-1+2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+-2*c^-1*(a+b*arctanh((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))^2*arctanh(1+-2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+-1//2*b^2*c^-1*Polylogarithms.polylog(3,1+-2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+b*c^-1*(a+b*arctanh((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))*Polylogarithms.polylog(2,1+-2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+-1*b*c^-1*(a+b*arctanh((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))*Polylogarithms.polylog(2,-1+2*(1+-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1))
@test integrate((1+-1*c^2*x^2)^-1*(a+b*arctanh((1+c*x)^-1//2*(1+-1*c*x)^(1/2))), x) == :((1/2)*b*c^-1*Polylogarithms.polylog(2,-1*(1+c*x)^-1//2*(1+-1*c*x)^(1/2))+-1*a*c^-1*log((1+c*x)^-1//2*(1+-1*c*x)^(1/2))+-1//2*b*c^-1*Polylogarithms.polylog(2,(1+c*x)^-1//2*(1+-1*c*x)^(1/2)))
@test integrate(x^m*arctanh(tanh(a+b*x)), x) == :(x^(1+m)*(1+m)^-1*arctanh(tanh(a+b*x))+-1*b*x^(2+m)*(2+m^2+3m)^-1)
@test integrate(x^2*arctanh(tanh(a+b*x)), x) == :(-1//12*b*x^4+1//3*x^3*arctanh(tanh(a+b*x)))
@test integrate(x*arctanh(tanh(a+b*x)), x) == :((1/2)*x^2*arctanh(tanh(a+b*x))+-1//6*b*x^3)
@test integrate(arctanh(tanh(a+b*x)), x) == :((1/2)*b^-1*arctanh(tanh(a+b*x))^2)
@test integrate(x^-1*arctanh(tanh(a+b*x)), x) == :(b*x+-1*(-1*arctanh(tanh(a+b*x))+b*x)*log(x))
@test integrate(x^-2*arctanh(tanh(a+b*x)), x) == :(b*log(x)+-1*x^-1*arctanh(tanh(a+b*x)))
@test integrate(x^-3*arctanh(tanh(a+b*x)), x) == :(-1//2*b*x^-1+-1//2*x^-2*arctanh(tanh(a+b*x)))
@test integrate(x^-4*arctanh(tanh(a+b*x)), x) == :(-1//3*x^-3*arctanh(tanh(a+b*x))+-1//6*b*x^-2)
@test integrate(x^m*arctanh(tanh(a+b*x))^2, x) == :(x^(1+m)*(1+m)^-1*arctanh(tanh(a+b*x))^2+2*b^2*x^(3+m)*(6+m^3+6*m^2+11m)^-1+-2*b*x^(2+m)*(2+m^2+3m)^-1*arctanh(tanh(a+b*x)))
@test integrate(x^3*arctanh(tanh(a+b*x))^2, x) == :(1//4*x^4*arctanh(tanh(a+b*x))^2+1//60*b^2*x^6+-1//10*b*x^5*arctanh(tanh(a+b*x)))
@test integrate(x^2*arctanh(tanh(a+b*x))^2, x) == :(1//3*x^3*arctanh(tanh(a+b*x))^2+1//30*b^2*x^5+-1//6*b*x^4*arctanh(tanh(a+b*x)))
@test integrate(x*arctanh(tanh(a+b*x))^2, x) == :(-1//12*b^-2*arctanh(tanh(a+b*x))^4+1//3*x*b^-1*arctanh(tanh(a+b*x))^3)
@test integrate(arctanh(tanh(a+b*x))^2, x) == :(1//3*b^-1*arctanh(tanh(a+b*x))^3)
@test integrate(x^-1*arctanh(tanh(a+b*x))^2, x) == :((1/2)*arctanh(tanh(a+b*x))^2+(-1*arctanh(tanh(a+b*x))+b*x)^2*log(x)+-1*b*x*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^-2*arctanh(tanh(a+b*x))^2, x) == :(-1*x^-1*arctanh(tanh(a+b*x))^2+2*x*b^2+-2*b*(-1*arctanh(tanh(a+b*x))+b*x)*log(x))
@test integrate(x^-3*arctanh(tanh(a+b*x))^2, x) == :(b^2*log(x)+-1//2*x^-2*arctanh(tanh(a+b*x))^2+-1*b*x^-1*arctanh(tanh(a+b*x)))
@test integrate(x^-4*arctanh(tanh(a+b*x))^2, x) == :(1//3*x^-3*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^3)
@test integrate(x^m*arctanh(tanh(a+b*x))^3, x) == :(x^(1+m)*(1+m)^-1*arctanh(tanh(a+b*x))^3+-6*b^3*x^(4+m)*(1+m)^-1*(24+m^3+9*m^2+26m)^-1+-3*b*x^(2+m)*(2+m^2+3m)^-1*arctanh(tanh(a+b*x))^2+6*b^2*x^(3+m)*(6+m^3+6*m^2+11m)^-1*arctanh(tanh(a+b*x)))
@test integrate(x^3*arctanh(tanh(a+b*x))^3, x) == :(-1//140*b^3*x^7+1//4*x^4*arctanh(tanh(a+b*x))^3+-3//20*b*x^5*arctanh(tanh(a+b*x))^2+1//20*b^2*x^6*arctanh(tanh(a+b*x)))
@test integrate(x^2*arctanh(tanh(a+b*x))^3, x) == :(1//60*b^-3*arctanh(tanh(a+b*x))^6+-1//10*x*b^-2*arctanh(tanh(a+b*x))^5+1//4*b^-1*x^2*arctanh(tanh(a+b*x))^4)
@test integrate(x*arctanh(tanh(a+b*x))^3, x) == :(-1//20*b^-2*arctanh(tanh(a+b*x))^5+1//4*x*b^-1*arctanh(tanh(a+b*x))^4)
@test integrate(arctanh(tanh(a+b*x))^3, x) == :(1//4*b^-1*arctanh(tanh(a+b*x))^4)
@test integrate(x^-1*arctanh(tanh(a+b*x))^3, x) == :(1//3*arctanh(tanh(a+b*x))^3+-1*(-1*arctanh(tanh(a+b*x))+b*x)^3*log(x)+-1*arctanh(tanh(a+b*x))^2*(-1//2*arctanh(tanh(a+b*x))+(1/2)*b*x)+b*x*(-1*arctanh(tanh(a+b*x))+b*x)^2)
@test integrate(x^-2*arctanh(tanh(a+b*x))^3, x) == :(-1*x^-1*arctanh(tanh(a+b*x))^3+3//2*b*arctanh(tanh(a+b*x))^2+-3*x*b^2*(-1*arctanh(tanh(a+b*x))+b*x)+3*b*(-1*arctanh(tanh(a+b*x))+b*x)^2*log(x))
@test integrate(x^-3*arctanh(tanh(a+b*x))^3, x) == :(3*x*b^3+-1//2*x^-2*arctanh(tanh(a+b*x))^3+-3*b^2*(-1*arctanh(tanh(a+b*x))+b*x)*log(x)+-3//2*b*x^-1*arctanh(tanh(a+b*x))^2)
@test integrate(x^-4*arctanh(tanh(a+b*x))^3, x) == :(b^3*log(x)+-1//3*x^-3*arctanh(tanh(a+b*x))^3+-1*b^2*x^-1*arctanh(tanh(a+b*x))+-1//2*b*x^-2*arctanh(tanh(a+b*x))^2)
@test integrate(x^-5*arctanh(tanh(a+b*x))^3, x) == :(1//4*x^-4*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^4)
@test integrate(x^-6*arctanh(tanh(a+b*x))^3, x) == :(1//5*x^-5*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^4+1//20*b*x^-4*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^4)
@test integrate(x^m*arctanh(tanh(a+b*x))^4, x) == :(x^(1+m)*(1+m)^-1*arctanh(tanh(a+b*x))^4+-4*b*x^(2+m)*(2+m^2+3m)^-1*arctanh(tanh(a+b*x))^3+12*b^2*x^(3+m)*(6+m^3+6*m^2+11m)^-1*arctanh(tanh(a+b*x))^2+-24*b^3*x^(4+m)*(1+m)^-1*(24+m^3+9*m^2+26m)^-1*arctanh(tanh(a+b*x))+24*b^4*x^(5+m)*(1+m)^-1*(2+m)^-1*(3+m)^-1*(20+m^2+9m)^-1)
@test integrate(x^6*arctanh(tanh(a+b*x))^4, x) == :(1//7*x^7*arctanh(tanh(a+b*x))^4+1//2310*b^4*x^11+-1//14*b*x^8*arctanh(tanh(a+b*x))^3+-1//210*b^3*x^10*arctanh(tanh(a+b*x))+1//42*b^2*x^9*arctanh(tanh(a+b*x))^2)
@test integrate(x^5*arctanh(tanh(a+b*x))^4, x) == :(1//6*x^6*arctanh(tanh(a+b*x))^4+1//1260*b^4*x^10+-2//21*b*x^7*arctanh(tanh(a+b*x))^3+-1//126*b^3*x^9*arctanh(tanh(a+b*x))+1//28*b^2*x^8*arctanh(tanh(a+b*x))^2)
@test integrate(x^4*arctanh(tanh(a+b*x))^4, x) == :(1//5*x^5*arctanh(tanh(a+b*x))^4+1//630*b^4*x^9+-2//15*b*x^6*arctanh(tanh(a+b*x))^3+-1//70*b^3*x^8*arctanh(tanh(a+b*x))+2//35*b^2*x^7*arctanh(tanh(a+b*x))^2)
@test integrate(x^3*arctanh(tanh(a+b*x))^4, x) == :(-1//280*b^-4*arctanh(tanh(a+b*x))^8+-1//10*b^-2*x^2*arctanh(tanh(a+b*x))^6+1//5*b^-1*x^3*arctanh(tanh(a+b*x))^5+1//35*x*b^-3*arctanh(tanh(a+b*x))^7)
@test integrate(x^2*arctanh(tanh(a+b*x))^4, x) == :(1//105*b^-3*arctanh(tanh(a+b*x))^7+-1//15*x*b^-2*arctanh(tanh(a+b*x))^6+1//5*b^-1*x^2*arctanh(tanh(a+b*x))^5)
@test integrate(x*arctanh(tanh(a+b*x))^4, x) == :(-1//30*b^-2*arctanh(tanh(a+b*x))^6+1//5*x*b^-1*arctanh(tanh(a+b*x))^5)
@test integrate(arctanh(tanh(a+b*x))^4, x) == :(1//5*b^-1*arctanh(tanh(a+b*x))^5)
@test integrate(x^-1*arctanh(tanh(a+b*x))^4, x) == :(1//4*arctanh(tanh(a+b*x))^4+(-1*arctanh(tanh(a+b*x))+b*x)^4*log(x)+(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(tanh(a+b*x))^2+-1*arctanh(tanh(a+b*x))^3*(-1//3*arctanh(tanh(a+b*x))+1//3*b*x)+-1*b*x*(-1*arctanh(tanh(a+b*x))+b*x)^3)
@test integrate(x^-2*arctanh(tanh(a+b*x))^4, x) == :(-1*x^-1*arctanh(tanh(a+b*x))^4+4//3*b*arctanh(tanh(a+b*x))^3+-4*b*(-1*arctanh(tanh(a+b*x))+b*x)^3*log(x)+-2*b*arctanh(tanh(a+b*x))^2*(-1*arctanh(tanh(a+b*x))+b*x)+4*x*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^2)
@test integrate(x^-3*arctanh(tanh(a+b*x))^4, x) == :(3*b^2*arctanh(tanh(a+b*x))^2+-1//2*x^-2*arctanh(tanh(a+b*x))^4+-6*x*b^3*(-1*arctanh(tanh(a+b*x))+b*x)+-2*b*x^-1*arctanh(tanh(a+b*x))^3+6*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^2*log(x))
@test integrate(x^-4*arctanh(tanh(a+b*x))^4, x) == :(4*x*b^4+-1//3*x^-3*arctanh(tanh(a+b*x))^4+-4*b^3*(-1*arctanh(tanh(a+b*x))+b*x)*log(x)+-2*b^2*x^-1*arctanh(tanh(a+b*x))^2+-2//3*b*x^-2*arctanh(tanh(a+b*x))^3)
@test integrate(x^-5*arctanh(tanh(a+b*x))^4, x) == :(b^4*log(x)+-1//4*x^-4*arctanh(tanh(a+b*x))^4+-1*b^3*x^-1*arctanh(tanh(a+b*x))+-1//2*b^2*x^-2*arctanh(tanh(a+b*x))^2+-1//3*b*x^-3*arctanh(tanh(a+b*x))^3)
@test integrate(x^-6*arctanh(tanh(a+b*x))^4, x) == :(1//5*x^-5*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^5)
@test integrate(x^-7*arctanh(tanh(a+b*x))^4, x) == :(1//6*x^-6*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^5+1//30*b*x^-5*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^5)
@test integrate(x^-8*arctanh(tanh(a+b*x))^4, x) == :(1//7*x^-7*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^5+1//21*b*x^-6*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^5+1//105*b^2*x^-5*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^5)
@test integrate(x^-10*arctanh(tanh(a+b*x))^4, x) == :(-1//9*x^-9*arctanh(tanh(a+b*x))^4+-1//630*b^4*x^-5+-1//18*b*x^-8*arctanh(tanh(a+b*x))^3+-1//42*b^2*x^-7*arctanh(tanh(a+b*x))^2+-1//126*b^3*x^-6*arctanh(tanh(a+b*x)))
@test integrate(x^-11*arctanh(tanh(a+b*x))^4, x) == :(-1//10*x^-10*arctanh(tanh(a+b*x))^4+-1//1260*b^4*x^-6+-2//45*b*x^-9*arctanh(tanh(a+b*x))^3+-1//60*b^2*x^-8*arctanh(tanh(a+b*x))^2+-1//210*b^3*x^-7*arctanh(tanh(a+b*x)))
@test integrate(x*arctanh(tanh(a+b*x))^6, x) == :(-1//56*b^-2*arctanh(tanh(a+b*x))^8+1//7*x*b^-1*arctanh(tanh(a+b*x))^7)
@test integrate(x^3*arctanh(tanh(a+b*x))^-1, x) == :(1//3*b^-1*x^3+x*b^-3*(-1*arctanh(tanh(a+b*x))+b*x)^2+b^-4*(-1*arctanh(tanh(a+b*x))+b*x)^3*log(arctanh(tanh(a+b*x)))+(1/2)*b^-2*x^2*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^2*arctanh(tanh(a+b*x))^-1, x) == :((1/2)*b^-1*x^2+x*b^-2*(-1*arctanh(tanh(a+b*x))+b*x)+b^-3*(-1*arctanh(tanh(a+b*x))+b*x)^2*log(arctanh(tanh(a+b*x))))
@test integrate(x*arctanh(tanh(a+b*x))^-1, x) == :(x*b^-1+b^-2*(-1*arctanh(tanh(a+b*x))+b*x)*log(arctanh(tanh(a+b*x))))
@test integrate(arctanh(tanh(a+b*x))^-1, x) == :(b^-1*log(arctanh(tanh(a+b*x))))
@test integrate(x^-1*arctanh(tanh(a+b*x))^-1, x) == :((-1*arctanh(tanh(a+b*x))+b*x)^-1*log(arctanh(tanh(a+b*x)))+-1*(-1*arctanh(tanh(a+b*x))+b*x)^-1*log(x))
@test integrate(x^-2*arctanh(tanh(a+b*x))^-1, x) == :(x^-1*(-1*arctanh(tanh(a+b*x))+b*x)^-1+b*(-1*arctanh(tanh(a+b*x))+b*x)^-2*log(arctanh(tanh(a+b*x)))+-1*b*(-1*arctanh(tanh(a+b*x))+b*x)^-2*log(x))
@test integrate(x^-3*arctanh(tanh(a+b*x))^-1, x) == :((1/2)*x^-2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+b*x^-1*(-1*arctanh(tanh(a+b*x))+b*x)^-2+b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*log(arctanh(tanh(a+b*x)))+-1*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*log(x))
@test integrate(x^4*arctanh(tanh(a+b*x))^-2, x) == :(4//3*b^-2*x^3+-1*b^-1*x^4*arctanh(tanh(a+b*x))^-1+2*b^-3*x^2*(-1*arctanh(tanh(a+b*x))+b*x)+4*x*b^-4*(-1*arctanh(tanh(a+b*x))+b*x)^2+4*b^-5*(-1*arctanh(tanh(a+b*x))+b*x)^3*log(arctanh(tanh(a+b*x))))
@test integrate(x^3*arctanh(tanh(a+b*x))^-2, x) == :(3//2*b^-2*x^2+-1*b^-1*x^3*arctanh(tanh(a+b*x))^-1+3*x*b^-3*(-1*arctanh(tanh(a+b*x))+b*x)+3*b^-4*(-1*arctanh(tanh(a+b*x))+b*x)^2*log(arctanh(tanh(a+b*x))))
@test integrate(x^2*arctanh(tanh(a+b*x))^-2, x) == :(2*x*b^-2+b^-3*(-2*arctanh(tanh(a+b*x))+2*b*x)*log(arctanh(tanh(a+b*x)))+-1*b^-1*x^2*arctanh(tanh(a+b*x))^-1)
@test integrate(x*arctanh(tanh(a+b*x))^-2, x) == :(b^-2*log(arctanh(tanh(a+b*x)))+-1*x*b^-1*arctanh(tanh(a+b*x))^-1)
@test integrate(arctanh(tanh(a+b*x))^-2, x) == :(-1*b^-1*arctanh(tanh(a+b*x))^-1)
@test integrate(x^-1*arctanh(tanh(a+b*x))^-2, x) == :((-1*arctanh(tanh(a+b*x))+b*x)^-2*log(x)+-1*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-1+-1*(-1*arctanh(tanh(a+b*x))+b*x)^-2*log(arctanh(tanh(a+b*x))))
@test integrate(x^-2*arctanh(tanh(a+b*x))^-2, x) == :(x^-1*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-1+-2*b*(-1*arctanh(tanh(a+b*x))+b*x)^-3*log(arctanh(tanh(a+b*x)))+-2*b*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1+2*b*(-1*arctanh(tanh(a+b*x))+b*x)^-3*log(x))
@test integrate(x^-3*arctanh(tanh(a+b*x))^-2, x) == :((1/2)*x^-2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-1+-3*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-4*log(arctanh(tanh(a+b*x)))+-3*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-1+3*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-4*log(x)+3//2*b*x^-1*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1)
@test integrate(x^4*arctanh(tanh(a+b*x))^-3, x) == :(3*b^-3*x^2+-2*b^-2*x^3*arctanh(tanh(a+b*x))^-1+6*x*b^-4*(-1*arctanh(tanh(a+b*x))+b*x)+6*b^-5*(-1*arctanh(tanh(a+b*x))+b*x)^2*log(arctanh(tanh(a+b*x)))+-1//2*b^-1*x^4*arctanh(tanh(a+b*x))^-2)
@test integrate(x^3*arctanh(tanh(a+b*x))^-3, x) == :(3*x*b^-3+b^-4*(-3*arctanh(tanh(a+b*x))+3*b*x)*log(arctanh(tanh(a+b*x)))+-3//2*b^-2*x^2*arctanh(tanh(a+b*x))^-1+-1//2*b^-1*x^3*arctanh(tanh(a+b*x))^-2)
@test integrate(x^2*arctanh(tanh(a+b*x))^-3, x) == :(b^-3*log(arctanh(tanh(a+b*x)))+-1*x*b^-2*arctanh(tanh(a+b*x))^-1+-1//2*b^-1*x^2*arctanh(tanh(a+b*x))^-2)
@test integrate(x*arctanh(tanh(a+b*x))^-3, x) == :(-1//2*b^-2*arctanh(tanh(a+b*x))^-1+-1//2*x*b^-1*arctanh(tanh(a+b*x))^-2)
@test integrate(arctanh(tanh(a+b*x))^-3, x) == :(-1//2*b^-1*arctanh(tanh(a+b*x))^-2)
@test integrate(x^-1*arctanh(tanh(a+b*x))^-3, x) == :((-1*arctanh(tanh(a+b*x))+b*x)^-3*log(arctanh(tanh(a+b*x)))+(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1+-1*(-1*arctanh(tanh(a+b*x))+b*x)^-3*log(x)+-1*(-2*arctanh(tanh(a+b*x))+2*b*x)^-1*arctanh(tanh(a+b*x))^-2)
@test integrate(x^-2*arctanh(tanh(a+b*x))^-3, x) == :(x^-1*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-2+-3*b*(-1*arctanh(tanh(a+b*x))+b*x)^-4*log(x)+3*b*(-1*arctanh(tanh(a+b*x))+b*x)^-4*log(arctanh(tanh(a+b*x)))+3*b*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-1+-3//2*b*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-2)
@test integrate(x^-3*arctanh(tanh(a+b*x))^-3, x) == :((1/2)*x^-2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-2+-6*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-5*log(x)+-3*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-2+6*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-5*log(arctanh(tanh(a+b*x)))+6*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-4*arctanh(tanh(a+b*x))^-1+2*b*x^-1*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-2)
@test integrate(x^4*arctanh(tanh(a+b*x))^(1/2), x) == :(256//3465*b^-5*arctanh(tanh(a+b*x))^11//2+-128//315*x*b^-4*arctanh(tanh(a+b*x))^9//2+-16//15*b^-2*x^3*arctanh(tanh(a+b*x))^5//2+2//3*b^-1*x^4*arctanh(tanh(a+b*x))^3//2+32//35*b^-3*x^2*arctanh(tanh(a+b*x))^7//2)
@test integrate(x^3*arctanh(tanh(a+b*x))^(1/2), x) == :(-32//315*b^-4*arctanh(tanh(a+b*x))^9//2+-4//5*b^-2*x^2*arctanh(tanh(a+b*x))^5//2+2//3*b^-1*x^3*arctanh(tanh(a+b*x))^3//2+16//35*x*b^-3*arctanh(tanh(a+b*x))^7//2)
@test integrate(x^2*arctanh(tanh(a+b*x))^(1/2), x) == :(16//105*b^-3*arctanh(tanh(a+b*x))^7//2+-8//15*x*b^-2*arctanh(tanh(a+b*x))^5//2+2//3*b^-1*x^2*arctanh(tanh(a+b*x))^3//2)
@test integrate(x*arctanh(tanh(a+b*x))^(1/2), x) == :(-4//15*b^-2*arctanh(tanh(a+b*x))^5//2+2//3*x*b^-1*arctanh(tanh(a+b*x))^3//2)
@test integrate(arctanh(tanh(a+b*x))^(1/2), x) == :(2//3*b^-1*arctanh(tanh(a+b*x))^3//2)
@test integrate(x^-1*arctanh(tanh(a+b*x))^(1/2), x) == :(2*arctanh(tanh(a+b*x))^(1/2)+-2*(-1*arctanh(tanh(a+b*x))+b*x)^(1/2)*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-2*arctanh(tanh(a+b*x))^(1/2), x) == :(-1*x^-1*arctanh(tanh(a+b*x))^(1/2)+b*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-3*arctanh(tanh(a+b*x))^(1/2), x) == :(-1//2*x^-2*arctanh(tanh(a+b*x))^(1/2)+b^2*(-4*arctanh(tanh(a+b*x))+4*b*x)^-1*arctanh(tanh(a+b*x))^-1//2+-1//4*b*x^-1*arctanh(tanh(a+b*x))^-1//2+1//4*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-3//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-4*arctanh(tanh(a+b*x))^(1/2), x) == :(-1//3*x^-3*arctanh(tanh(a+b*x))^(1/2)+-1*b^3*(-24*arctanh(tanh(a+b*x))+24*b*x)^-1*arctanh(tanh(a+b*x))^-3//2+-1//12*b*x^-2*arctanh(tanh(a+b*x))^-1//2+1//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1//2+1//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-5//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2))+1//24*b^2*x^-1*arctanh(tanh(a+b*x))^-3//2)
@test integrate(x^4*arctanh(tanh(a+b*x))^3//2, x) == :(256//15015*b^-5*arctanh(tanh(a+b*x))^13//2+-128//1155*x*b^-4*arctanh(tanh(a+b*x))^11//2+-16//35*b^-2*x^3*arctanh(tanh(a+b*x))^7//2+2//5*b^-1*x^4*arctanh(tanh(a+b*x))^5//2+32//105*b^-3*x^2*arctanh(tanh(a+b*x))^9//2)
@test integrate(x^3*arctanh(tanh(a+b*x))^3//2, x) == :(-32//1155*b^-4*arctanh(tanh(a+b*x))^11//2+-12//35*b^-2*x^2*arctanh(tanh(a+b*x))^7//2+2//5*b^-1*x^3*arctanh(tanh(a+b*x))^5//2+16//105*x*b^-3*arctanh(tanh(a+b*x))^9//2)
@test integrate(x^2*arctanh(tanh(a+b*x))^3//2, x) == :(16//315*b^-3*arctanh(tanh(a+b*x))^9//2+-8//35*x*b^-2*arctanh(tanh(a+b*x))^7//2+2//5*b^-1*x^2*arctanh(tanh(a+b*x))^5//2)
@test integrate(x*arctanh(tanh(a+b*x))^3//2, x) == :(-4//35*b^-2*arctanh(tanh(a+b*x))^7//2+2//5*x*b^-1*arctanh(tanh(a+b*x))^5//2)
@test integrate(arctanh(tanh(a+b*x))^3//2, x) == :(2//5*b^-1*arctanh(tanh(a+b*x))^5//2)
@test integrate(x^-1*arctanh(tanh(a+b*x))^3//2, x) == :(2//3*arctanh(tanh(a+b*x))^3//2+-1*arctanh(tanh(a+b*x))^(1/2)*(-2*arctanh(tanh(a+b*x))+2*b*x)+2*(-1*arctanh(tanh(a+b*x))+b*x)^3//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-2*arctanh(tanh(a+b*x))^3//2, x) == :(-1*x^-1*arctanh(tanh(a+b*x))^3//2+3*b*arctanh(tanh(a+b*x))^(1/2)+-3*b*(-1*arctanh(tanh(a+b*x))+b*x)^(1/2)*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-3*arctanh(tanh(a+b*x))^3//2, x) == :(-1//2*x^-2*arctanh(tanh(a+b*x))^3//2+-3//4*b*x^-1*arctanh(tanh(a+b*x))^(1/2)+3//4*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-4*arctanh(tanh(a+b*x))^3//2, x) == :(-1//3*x^-3*arctanh(tanh(a+b*x))^3//2+b^3*(-8*arctanh(tanh(a+b*x))+8*b*x)^-1*arctanh(tanh(a+b*x))^-1//2+-1//4*b*x^-2*arctanh(tanh(a+b*x))^(1/2)+-1//8*b^2*x^-1*arctanh(tanh(a+b*x))^-1//2+1//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-3//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^4*arctanh(tanh(a+b*x))^5//2, x) == :(256//45045*b^-5*arctanh(tanh(a+b*x))^15//2+-128//3003*x*b^-4*arctanh(tanh(a+b*x))^13//2+-16//63*b^-2*x^3*arctanh(tanh(a+b*x))^9//2+2//7*b^-1*x^4*arctanh(tanh(a+b*x))^7//2+32//231*b^-3*x^2*arctanh(tanh(a+b*x))^11//2)
@test integrate(x^3*arctanh(tanh(a+b*x))^5//2, x) == :(-32//3003*b^-4*arctanh(tanh(a+b*x))^13//2+-4//21*b^-2*x^2*arctanh(tanh(a+b*x))^9//2+2//7*b^-1*x^3*arctanh(tanh(a+b*x))^7//2+16//231*x*b^-3*arctanh(tanh(a+b*x))^11//2)
@test integrate(x^2*arctanh(tanh(a+b*x))^5//2, x) == :(16//693*b^-3*arctanh(tanh(a+b*x))^11//2+-8//63*x*b^-2*arctanh(tanh(a+b*x))^9//2+2//7*b^-1*x^2*arctanh(tanh(a+b*x))^7//2)
@test integrate(x*arctanh(tanh(a+b*x))^5//2, x) == :(-4//63*b^-2*arctanh(tanh(a+b*x))^9//2+2//7*x*b^-1*arctanh(tanh(a+b*x))^7//2)
@test integrate(arctanh(tanh(a+b*x))^5//2, x) == :(2//7*b^-1*arctanh(tanh(a+b*x))^7//2)
@test integrate(x^-1*arctanh(tanh(a+b*x))^5//2, x) == :(2//5*arctanh(tanh(a+b*x))^5//2+-1*arctanh(tanh(a+b*x))^3//2*(-2//3*arctanh(tanh(a+b*x))+2//3*b*x)+-2*(-1*arctanh(tanh(a+b*x))+b*x)^5//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2))+2*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^-2*arctanh(tanh(a+b*x))^5//2, x) == :(-1*x^-1*arctanh(tanh(a+b*x))^5//2+5//3*b*arctanh(tanh(a+b*x))^3//2+-5*b*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)+5*b*(-1*arctanh(tanh(a+b*x))+b*x)^3//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-3*arctanh(tanh(a+b*x))^5//2, x) == :(-1//2*x^-2*arctanh(tanh(a+b*x))^5//2+15//4*b^2*arctanh(tanh(a+b*x))^(1/2)+-15//4*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^(1/2)*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2))+-5//4*b*x^-1*arctanh(tanh(a+b*x))^3//2)
@test integrate(x^-4*arctanh(tanh(a+b*x))^5//2, x) == :(-1//3*x^-3*arctanh(tanh(a+b*x))^5//2+-5//8*b^2*x^-1*arctanh(tanh(a+b*x))^(1/2)+-5//12*b*x^-2*arctanh(tanh(a+b*x))^3//2+5//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-5*arctanh(tanh(a+b*x))^5//2, x) == :(-1//4*x^-4*arctanh(tanh(a+b*x))^5//2+5*b^4*(-64*arctanh(tanh(a+b*x))+64*b*x)^-1*arctanh(tanh(a+b*x))^-1//2+-5//24*b*x^-3*arctanh(tanh(a+b*x))^3//2+-5//32*b^2*x^-2*arctanh(tanh(a+b*x))^(1/2)+-5//64*b^3*x^-1*arctanh(tanh(a+b*x))^-1//2+5//64*b^4*(-1*arctanh(tanh(a+b*x))+b*x)^-3//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-6*arctanh(tanh(a+b*x))^5//2, x) == :(-1//5*x^-5*arctanh(tanh(a+b*x))^5//2+-1*b^5*(-128*arctanh(tanh(a+b*x))+128*b*x)^-1*arctanh(tanh(a+b*x))^-3//2+-1//8*b*x^-4*arctanh(tanh(a+b*x))^3//2+-1//16*b^2*x^-3*arctanh(tanh(a+b*x))^(1/2)+-1//64*b^3*x^-2*arctanh(tanh(a+b*x))^-1//2+1//128*b^4*x^-1*arctanh(tanh(a+b*x))^-3//2+3//128*b^5*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1//2+3//128*b^5*(-1*arctanh(tanh(a+b*x))+b*x)^-5//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^4*arctanh(tanh(a+b*x))^-1//2, x) == :(256//315*b^-5*arctanh(tanh(a+b*x))^9//2+2*b^-1*x^4*arctanh(tanh(a+b*x))^(1/2)+-128//35*x*b^-4*arctanh(tanh(a+b*x))^7//2+-16//3*b^-2*x^3*arctanh(tanh(a+b*x))^3//2+32//5*b^-3*x^2*arctanh(tanh(a+b*x))^5//2)
@test integrate(x^3*arctanh(tanh(a+b*x))^-1//2, x) == :(-32//35*b^-4*arctanh(tanh(a+b*x))^7//2+-4*b^-2*x^2*arctanh(tanh(a+b*x))^3//2+2*b^-1*x^3*arctanh(tanh(a+b*x))^(1/2)+16//5*x*b^-3*arctanh(tanh(a+b*x))^5//2)
@test integrate(x^2*arctanh(tanh(a+b*x))^-1//2, x) == :(16//15*b^-3*arctanh(tanh(a+b*x))^5//2+2*b^-1*x^2*arctanh(tanh(a+b*x))^(1/2)+-8//3*x*b^-2*arctanh(tanh(a+b*x))^3//2)
@test integrate(x*arctanh(tanh(a+b*x))^-1//2, x) == :(-4//3*b^-2*arctanh(tanh(a+b*x))^3//2+2*x*b^-1*arctanh(tanh(a+b*x))^(1/2))
@test integrate(arctanh(tanh(a+b*x))^-1//2, x) == :(2*b^-1*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^-1*arctanh(tanh(a+b*x))^-1//2, x) == :(2*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-2*arctanh(tanh(a+b*x))^-1//2, x) == :(-1*x^-1*arctanh(tanh(a+b*x))^-1//2+b*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-1//2+b*(-1*arctanh(tanh(a+b*x))+b*x)^-3//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-3*arctanh(tanh(a+b*x))^-1//2, x) == :(-1//2*x^-2*arctanh(tanh(a+b*x))^-1//2+-1*b^2*(-4*arctanh(tanh(a+b*x))+4*b*x)^-1*arctanh(tanh(a+b*x))^-3//2+1//4*b*x^-1*arctanh(tanh(a+b*x))^-3//2+3//4*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1//2+3//4*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-5//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-4*arctanh(tanh(a+b*x))^-1//2, x) == :(-1//3*x^-3*arctanh(tanh(a+b*x))^-1//2+b^3*(-8*arctanh(tanh(a+b*x))+8*b*x)^-1*arctanh(tanh(a+b*x))^-5//2+-5//24*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-3//2+-1//8*b^2*x^-1*arctanh(tanh(a+b*x))^-5//2+1//12*b*x^-2*arctanh(tanh(a+b*x))^-3//2+5//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-1//2+5//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-7//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^4*arctanh(tanh(a+b*x))^-3//2, x) == :(-256//35*b^-5*arctanh(tanh(a+b*x))^7//2+-32*b^-3*x^2*arctanh(tanh(a+b*x))^3//2+-2*b^-1*x^4*arctanh(tanh(a+b*x))^-1//2+16*b^-2*x^3*arctanh(tanh(a+b*x))^(1/2)+128//5*x*b^-4*arctanh(tanh(a+b*x))^5//2)
@test integrate(x^3*arctanh(tanh(a+b*x))^-3//2, x) == :(32//5*b^-4*arctanh(tanh(a+b*x))^5//2+-16*x*b^-3*arctanh(tanh(a+b*x))^3//2+-2*b^-1*x^3*arctanh(tanh(a+b*x))^-1//2+12*b^-2*x^2*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^2*arctanh(tanh(a+b*x))^-3//2, x) == :(-16//3*b^-3*arctanh(tanh(a+b*x))^3//2+-2*b^-1*x^2*arctanh(tanh(a+b*x))^-1//2+8*x*b^-2*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x*arctanh(tanh(a+b*x))^-3//2, x) == :(4*b^-2*arctanh(tanh(a+b*x))^(1/2)+-2*x*b^-1*arctanh(tanh(a+b*x))^-1//2)
@test integrate(arctanh(tanh(a+b*x))^-3//2, x) == :(-2*b^-1*arctanh(tanh(a+b*x))^-1//2)
@test integrate(x^-1*arctanh(tanh(a+b*x))^-3//2, x) == :(-2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-1//2+-2*(-1*arctanh(tanh(a+b*x))+b*x)^-3//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-2*arctanh(tanh(a+b*x))^-3//2, x) == :(-1*x^-1*arctanh(tanh(a+b*x))^-3//2+b*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-3//2+-3*b*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1//2+-3*b*(-1*arctanh(tanh(a+b*x))+b*x)^-5//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-3*arctanh(tanh(a+b*x))^-3//2, x) == :(-1//2*x^-2*arctanh(tanh(a+b*x))^-3//2+-3*b^2*(-4*arctanh(tanh(a+b*x))+4*b*x)^-1*arctanh(tanh(a+b*x))^-5//2+-15//4*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-1//2+-15//4*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-7//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2))+3//4*b*x^-1*arctanh(tanh(a+b*x))^-5//2+5//4*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-3//2)
@test integrate(x^-4*arctanh(tanh(a+b*x))^-3//2, x) == :(-1//3*x^-3*arctanh(tanh(a+b*x))^-3//2+5*b^3*(-8*arctanh(tanh(a+b*x))+8*b*x)^-1*arctanh(tanh(a+b*x))^-7//2+-35//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-4*arctanh(tanh(a+b*x))^-1//2+-35//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-9//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2))+-7//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-5//2+-5//8*b^2*x^-1*arctanh(tanh(a+b*x))^-7//2+1//4*b*x^-2*arctanh(tanh(a+b*x))^-5//2+35//24*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-3//2)
@test integrate(x^4*arctanh(tanh(a+b*x))^-5//2, x) == :(256//15*b^-5*arctanh(tanh(a+b*x))^5//2+32*b^-3*x^2*arctanh(tanh(a+b*x))^(1/2)+-128//3*x*b^-4*arctanh(tanh(a+b*x))^3//2+-16//3*b^-2*x^3*arctanh(tanh(a+b*x))^-1//2+-2//3*b^-1*x^4*arctanh(tanh(a+b*x))^-3//2)
@test integrate(x^3*arctanh(tanh(a+b*x))^-5//2, x) == :(-32//3*b^-4*arctanh(tanh(a+b*x))^3//2+-4*b^-2*x^2*arctanh(tanh(a+b*x))^-1//2+16*x*b^-3*arctanh(tanh(a+b*x))^(1/2)+-2//3*b^-1*x^3*arctanh(tanh(a+b*x))^-3//2)
@test integrate(x^2*arctanh(tanh(a+b*x))^-5//2, x) == :(16//3*b^-3*arctanh(tanh(a+b*x))^(1/2)+-8//3*x*b^-2*arctanh(tanh(a+b*x))^-1//2+-2//3*b^-1*x^2*arctanh(tanh(a+b*x))^-3//2)
@test integrate(x*arctanh(tanh(a+b*x))^-5//2, x) == :(-4//3*b^-2*arctanh(tanh(a+b*x))^-1//2+-2//3*x*b^-1*arctanh(tanh(a+b*x))^-3//2)
@test integrate(arctanh(tanh(a+b*x))^-5//2, x) == :(-2//3*b^-1*arctanh(tanh(a+b*x))^-3//2)
@test integrate(x^-1*arctanh(tanh(a+b*x))^-5//2, x) == :(-2*(-3*arctanh(tanh(a+b*x))+3*b*x)^-1*arctanh(tanh(a+b*x))^-3//2+2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1//2+2*(-1*arctanh(tanh(a+b*x))+b*x)^-5//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-2*arctanh(tanh(a+b*x))^-5//2, x) == :(-1*x^-1*arctanh(tanh(a+b*x))^-5//2+b*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-5//2+5*b*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-1//2+5*b*(-1*arctanh(tanh(a+b*x))+b*x)^-7//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2))+-5//3*b*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-3//2)
@test integrate(x^-3*arctanh(tanh(a+b*x))^-5//2, x) == :(-1//2*x^-2*arctanh(tanh(a+b*x))^-5//2+-5*b^2*(-4*arctanh(tanh(a+b*x))+4*b*x)^-1*arctanh(tanh(a+b*x))^-7//2+-35//12*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-3//2+5//4*b*x^-1*arctanh(tanh(a+b*x))^-7//2+7//4*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-5//2+35//4*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-4*arctanh(tanh(a+b*x))^-1//2+35//4*b^2*(-1*arctanh(tanh(a+b*x))+b*x)^-9//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^-4*arctanh(tanh(a+b*x))^-5//2, x) == :(-1//3*x^-3*arctanh(tanh(a+b*x))^-5//2+35*b^3*(-24*arctanh(tanh(a+b*x))+24*b*x)^-1*arctanh(tanh(a+b*x))^-9//2+-35//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-4*arctanh(tanh(a+b*x))^-3//2+-35//24*b^2*x^-1*arctanh(tanh(a+b*x))^-9//2+-15//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-7//2+5//12*b*x^-2*arctanh(tanh(a+b*x))^-7//2+21//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-5//2+105//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-5*arctanh(tanh(a+b*x))^-1//2+105//8*b^3*(-1*arctanh(tanh(a+b*x))+b*x)^-11//2*arctan((-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(tanh(a+b*x))^(1/2)))
@test integrate(x^7//2*arctanh(tanh(a+b*x)), x) == :(-4//99*b*x^11//2+2//9*x^9//2*arctanh(tanh(a+b*x)))
@test integrate(x^5//2*arctanh(tanh(a+b*x)), x) == :(-4//63*b*x^9//2+2//7*x^7//2*arctanh(tanh(a+b*x)))
@test integrate(x^3//2*arctanh(tanh(a+b*x)), x) == :(-4//35*b*x^7//2+2//5*x^5//2*arctanh(tanh(a+b*x)))
@test integrate(x^(1/2)*arctanh(tanh(a+b*x)), x) == :(-4//15*b*x^5//2+2//3*x^3//2*arctanh(tanh(a+b*x)))
@test integrate(x^-1//2*arctanh(tanh(a+b*x)), x) == :(2*x^(1/2)*arctanh(tanh(a+b*x))+-4//3*b*x^3//2)
@test integrate(x^-3//2*arctanh(tanh(a+b*x)), x) == :(-2*x^-1//2*arctanh(tanh(a+b*x))+4*b*x^(1/2))
@test integrate(x^-5//2*arctanh(tanh(a+b*x)), x) == :(-4//3*b*x^-1//2+-2//3*x^-3//2*arctanh(tanh(a+b*x)))
@test integrate(x^-7//2*arctanh(tanh(a+b*x)), x) == :(-4//15*b*x^-3//2+-2//5*x^-5//2*arctanh(tanh(a+b*x)))
@test integrate(x^7//2*arctanh(tanh(a+b*x))^2, x) == :(2//9*x^9//2*arctanh(tanh(a+b*x))^2+16//1287*b^2*x^13//2+-8//99*b*x^11//2*arctanh(tanh(a+b*x)))
@test integrate(x^5//2*arctanh(tanh(a+b*x))^2, x) == :(2//7*x^7//2*arctanh(tanh(a+b*x))^2+16//693*b^2*x^11//2+-8//63*b*x^9//2*arctanh(tanh(a+b*x)))
@test integrate(x^3//2*arctanh(tanh(a+b*x))^2, x) == :(2//5*x^5//2*arctanh(tanh(a+b*x))^2+16//315*b^2*x^9//2+-8//35*b*x^7//2*arctanh(tanh(a+b*x)))
@test integrate(x^(1/2)*arctanh(tanh(a+b*x))^2, x) == :(2//3*x^3//2*arctanh(tanh(a+b*x))^2+16//105*b^2*x^7//2+-8//15*b*x^5//2*arctanh(tanh(a+b*x)))
@test integrate(x^-1//2*arctanh(tanh(a+b*x))^2, x) == :(2*x^(1/2)*arctanh(tanh(a+b*x))^2+16//15*b^2*x^5//2+-8//3*b*x^3//2*arctanh(tanh(a+b*x)))
@test integrate(x^-3//2*arctanh(tanh(a+b*x))^2, x) == :(-2*x^-1//2*arctanh(tanh(a+b*x))^2+-16//3*b^2*x^3//2+8*b*x^(1/2)*arctanh(tanh(a+b*x)))
@test integrate(x^-5//2*arctanh(tanh(a+b*x))^2, x) == :(-2//3*x^-3//2*arctanh(tanh(a+b*x))^2+16//3*b^2*x^(1/2)+-8//3*b*x^-1//2*arctanh(tanh(a+b*x)))
@test integrate(x^-7//2*arctanh(tanh(a+b*x))^2, x) == :(-16//15*b^2*x^-1//2+-2//5*x^-5//2*arctanh(tanh(a+b*x))^2+-8//15*b*x^-3//2*arctanh(tanh(a+b*x)))
@test integrate(x^7//2*arctanh(tanh(a+b*x))^3, x) == :(-32//6435*b^3*x^15//2+2//9*x^9//2*arctanh(tanh(a+b*x))^3+-4//33*b*x^11//2*arctanh(tanh(a+b*x))^2+16//429*b^2*x^13//2*arctanh(tanh(a+b*x)))
@test integrate(x^5//2*arctanh(tanh(a+b*x))^3, x) == :(-32//3003*b^3*x^13//2+2//7*x^7//2*arctanh(tanh(a+b*x))^3+-4//21*b*x^9//2*arctanh(tanh(a+b*x))^2+16//231*b^2*x^11//2*arctanh(tanh(a+b*x)))
@test integrate(x^3//2*arctanh(tanh(a+b*x))^3, x) == :(-32//1155*b^3*x^11//2+2//5*x^5//2*arctanh(tanh(a+b*x))^3+-12//35*b*x^7//2*arctanh(tanh(a+b*x))^2+16//105*b^2*x^9//2*arctanh(tanh(a+b*x)))
@test integrate(x^(1/2)*arctanh(tanh(a+b*x))^3, x) == :(-32//315*b^3*x^9//2+2//3*x^3//2*arctanh(tanh(a+b*x))^3+-4//5*b*x^5//2*arctanh(tanh(a+b*x))^2+16//35*b^2*x^7//2*arctanh(tanh(a+b*x)))
@test integrate(x^-1//2*arctanh(tanh(a+b*x))^3, x) == :(2*x^(1/2)*arctanh(tanh(a+b*x))^3+-32//35*b^3*x^7//2+-4*b*x^3//2*arctanh(tanh(a+b*x))^2+16//5*b^2*x^5//2*arctanh(tanh(a+b*x)))
@test integrate(x^-3//2*arctanh(tanh(a+b*x))^3, x) == :(-2*x^-1//2*arctanh(tanh(a+b*x))^3+32//5*b^3*x^5//2+-16*b^2*x^3//2*arctanh(tanh(a+b*x))+12*b*x^(1/2)*arctanh(tanh(a+b*x))^2)
@test integrate(x^-5//2*arctanh(tanh(a+b*x))^3, x) == :(-32//3*b^3*x^3//2+-2//3*x^-3//2*arctanh(tanh(a+b*x))^3+-4*b*x^-1//2*arctanh(tanh(a+b*x))^2+16*b^2*x^(1/2)*arctanh(tanh(a+b*x)))
@test integrate(x^-7//2*arctanh(tanh(a+b*x))^3, x) == :(-2//5*x^-5//2*arctanh(tanh(a+b*x))^3+32//5*b^3*x^(1/2)+-16//5*b^2*x^-1//2*arctanh(tanh(a+b*x))+-4//5*b*x^-3//2*arctanh(tanh(a+b*x))^2)
@test integrate(x^7//2*arctanh(tanh(a+b*x))^-1, x) == :(2//7*b^-1*x^7//2+-2*b^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^7//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+2*b^-4*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^3+2//3*b^-3*x^3//2*(-1*arctanh(tanh(a+b*x))+b*x)^2+2//5*b^-2*x^5//2*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^5//2*arctanh(tanh(a+b*x))^-1, x) == :(2//5*b^-1*x^5//2+-2*b^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^5//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+2*b^-3*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^2+2//3*b^-2*x^3//2*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^3//2*arctanh(tanh(a+b*x))^-1, x) == :(2//3*b^-1*x^3//2+-2*b^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^3//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+2*b^-2*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^(1/2)*arctanh(tanh(a+b*x))^-1, x) == :(2*b^-1*x^(1/2)+-2*b^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^(1/2)*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2))
@test integrate(x^-1//2*arctanh(tanh(a+b*x))^-1, x) == :(-2*b^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2))
@test integrate(x^-3//2*arctanh(tanh(a+b*x))^-1, x) == :(2*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+-2*b^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-3//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2))
@test integrate(x^-5//2*arctanh(tanh(a+b*x))^-1, x) == :(2//3*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+-2*b^3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-5//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+2*b*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2)
@test integrate(x^-7//2*arctanh(tanh(a+b*x))^-1, x) == :(2//5*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+-2*b^5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-7//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+2*b^2*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3+2//3*b*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2)
@test integrate(x^7//2*arctanh(tanh(a+b*x))^-2, x) == :(7//5*b^-2*x^5//2+-1*b^-1*x^7//2*arctanh(tanh(a+b*x))^-1+-7*b^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^5//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+7*b^-4*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^2+7//3*b^-3*x^3//2*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^5//2*arctanh(tanh(a+b*x))^-2, x) == :(5//3*b^-2*x^3//2+-1*b^-1*x^5//2*arctanh(tanh(a+b*x))^-1+-5*b^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^3//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+5*b^-3*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^3//2*arctanh(tanh(a+b*x))^-2, x) == :(3*b^-2*x^(1/2)+-1*b^-1*x^3//2*arctanh(tanh(a+b*x))^-1+-3*b^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^(1/2)*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2))
@test integrate(x^(1/2)*arctanh(tanh(a+b*x))^-2, x) == :(-1*b^-1*x^(1/2)*arctanh(tanh(a+b*x))^-1+-1*b^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2))
@test integrate(x^-1//2*arctanh(tanh(a+b*x))^-2, x) == :(b^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+-1*b^-1*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+-1*b^-1*x^-1//2*arctanh(tanh(a+b*x))^-1)
@test integrate(x^-3//2*arctanh(tanh(a+b*x))^-2, x) == :(-3*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2+-1*b^-1*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+-1*b^-1*x^-3//2*arctanh(tanh(a+b*x))^-1+3*b^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-5//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2))
@test integrate(x^-5//2*arctanh(tanh(a+b*x))^-2, x) == :(-5//3*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2+-1*b^-1*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+-1*b^-1*x^-5//2*arctanh(tanh(a+b*x))^-1+-5*b*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3+5*b^3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-7//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2))
@test integrate(x^-7//2*arctanh(tanh(a+b*x))^-2, x) == :(-7//5*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2+-1*b^-1*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+-1*b^-1*x^-7//2*arctanh(tanh(a+b*x))^-1+-7*b^2*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-4+7*b^5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-9//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+-7//3*b*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3)
@test integrate(x^7//2*arctanh(tanh(a+b*x))^-3, x) == :(35//12*b^-3*x^3//2+-35//4*b^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^3//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+-7//4*b^-2*x^5//2*arctanh(tanh(a+b*x))^-1+-1//2*b^-1*x^7//2*arctanh(tanh(a+b*x))^-2+35//4*b^-4*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^5//2*arctanh(tanh(a+b*x))^-3, x) == :(15//4*b^-3*x^(1/2)+-15//4*b^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^(1/2)*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+-5//4*b^-2*x^3//2*arctanh(tanh(a+b*x))^-1+-1//2*b^-1*x^5//2*arctanh(tanh(a+b*x))^-2)
@test integrate(x^3//2*arctanh(tanh(a+b*x))^-3, x) == :(-3//4*b^-2*x^(1/2)*arctanh(tanh(a+b*x))^-1+-3//4*b^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+-1//2*b^-1*x^3//2*arctanh(tanh(a+b*x))^-2)
@test integrate(x^(1/2)*arctanh(tanh(a+b*x))^-3, x) == :(-1//2*b^-1*x^(1/2)*arctanh(tanh(a+b*x))^-2+-1//4*b^-2*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+-1//4*b^-2*x^-1//2*arctanh(tanh(a+b*x))^-1+1//4*b^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2))
@test integrate(x^-1//2*arctanh(tanh(a+b*x))^-3, x) == :(-3//4*b^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-5//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+-1//2*b^-1*x^-1//2*arctanh(tanh(a+b*x))^-2+1//4*b^-2*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+1//4*b^-2*x^-3//2*arctanh(tanh(a+b*x))^-1+3//4*b^-1*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2)
@test integrate(x^-3//2*arctanh(tanh(a+b*x))^-3, x) == :(15//4*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3+-15//4*b^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-7//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+-1//2*b^-1*x^-3//2*arctanh(tanh(a+b*x))^-2+3//4*b^-2*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+3//4*b^-2*x^-5//2*arctanh(tanh(a+b*x))^-1+5//4*b^-1*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2)
@test integrate(x^-5//2*arctanh(tanh(a+b*x))^-3, x) == :(35//12*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3+-35//4*b^3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-9//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+-1//2*b^-1*x^-5//2*arctanh(tanh(a+b*x))^-2+5//4*b^-2*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+5//4*b^-2*x^-7//2*arctanh(tanh(a+b*x))^-1+7//4*b^-1*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2+35//4*b*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-4)
@test integrate(x^-7//2*arctanh(tanh(a+b*x))^-3, x) == :(63//20*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3+-63//4*b^5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-11//2*arctanh(b^(1/2)*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1//2)+-1//2*b^-1*x^-7//2*arctanh(tanh(a+b*x))^-2+7//4*b^-2*x^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1+7//4*b^-2*x^-9//2*arctanh(tanh(a+b*x))^-1+9//4*b^-1*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2+21//4*b*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-4+63//4*b^2*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-5)
@test integrate(x^3//2*arctanh(tanh(a+b*x))^(1/2), x) == :(1//3*x^5//2*arctanh(tanh(a+b*x))^(1/2)+-1//8*b^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^3*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+-1//8*b^-2*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(tanh(a+b*x))^(1/2)+-1//12*b^-1*x^3//2*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^(1/2)*arctanh(tanh(a+b*x))^(1/2), x) == :((1/2)*x^3//2*arctanh(tanh(a+b*x))^(1/2)+-1//4*b^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+-1//4*b^-1*x^(1/2)*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^-1//2*arctanh(tanh(a+b*x))^(1/2), x) == :(x^(1/2)*arctanh(tanh(a+b*x))^(1/2)+-1*b^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2))
@test integrate(x^-3//2*arctanh(tanh(a+b*x))^(1/2), x) == :(-2*x^-1//2*arctanh(tanh(a+b*x))^(1/2)+2*b^(1/2)*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2))
@test integrate(x^-5//2*arctanh(tanh(a+b*x))^(1/2), x) == :(2//3*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^3//2)
@test integrate(x^-7//2*arctanh(tanh(a+b*x))^(1/2), x) == :(2//5*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^3//2+4//15*b*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^3//2)
@test integrate(x^-9//2*arctanh(tanh(a+b*x))^(1/2), x) == :(2//7*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^3//2+8//35*b*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^3//2+16//105*b^2*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^3//2)
@test integrate(x^-11//2*arctanh(tanh(a+b*x))^(1/2), x) == :(2//9*x^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^3//2+4//21*b*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^3//2+16//105*b^2*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^3//2+32//315*b^3*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-4*arctanh(tanh(a+b*x))^3//2)
@test integrate(x^3//2*arctanh(tanh(a+b*x))^3//2, x) == :(1//4*x^5//2*arctanh(tanh(a+b*x))^3//2+-1//8*x^5//2*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)+3//64*b^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^4*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+1//32*b^-1*x^3//2*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(tanh(a+b*x))^(1/2)+3//64*b^-2*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^3*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^(1/2)*arctanh(tanh(a+b*x))^3//2, x) == :(1//3*x^3//2*arctanh(tanh(a+b*x))^3//2+-1//4*x^3//2*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)+1//8*b^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^3*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+1//8*b^-1*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^-1//2*arctanh(tanh(a+b*x))^3//2, x) == :((1/2)*x^(1/2)*arctanh(tanh(a+b*x))^3//2+-3//4*x^(1/2)*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)+3//4*b^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2))
@test integrate(x^-3//2*arctanh(tanh(a+b*x))^3//2, x) == :(-2*x^-1//2*arctanh(tanh(a+b*x))^3//2+-3*b^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+3*b*x^(1/2)*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^-5//2*arctanh(tanh(a+b*x))^3//2, x) == :(2*b^3//2*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+-2//3*x^-3//2*arctanh(tanh(a+b*x))^3//2+-2*b*x^-1//2*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^-7//2*arctanh(tanh(a+b*x))^3//2, x) == :(2//5*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^5//2)
@test integrate(x^-9//2*arctanh(tanh(a+b*x))^3//2, x) == :(2//7*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^5//2+4//35*b*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^5//2)
@test integrate(x^-11//2*arctanh(tanh(a+b*x))^3//2, x) == :(2//9*x^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^5//2+8//63*b*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^5//2+16//315*b^2*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^5//2)
@test integrate(x^-13//2*arctanh(tanh(a+b*x))^3//2, x) == :(2//11*x^-11//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^5//2+4//33*b*x^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^5//2+16//231*b^2*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^5//2+32//1155*b^3*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-4*arctanh(tanh(a+b*x))^5//2)
@test integrate(x^(1/2)*arctanh(tanh(a+b*x))^5//2, x) == :(1//4*x^3//2*arctanh(tanh(a+b*x))^5//2+-5//24*x^3//2*arctanh(tanh(a+b*x))^3//2*(-1*arctanh(tanh(a+b*x))+b*x)+-5//64*b^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^4*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+5//32*x^3//2*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(tanh(a+b*x))^(1/2)+-5//64*b^-1*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^3*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^-1//2*arctanh(tanh(a+b*x))^5//2, x) == :(1//3*x^(1/2)*arctanh(tanh(a+b*x))^5//2+-5//8*b^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^3*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+-5//12*x^(1/2)*arctanh(tanh(a+b*x))^3//2*(-1*arctanh(tanh(a+b*x))+b*x)+5//8*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^-3//2*arctanh(tanh(a+b*x))^5//2, x) == :(-2*x^-1//2*arctanh(tanh(a+b*x))^5//2+5//2*b*x^(1/2)*arctanh(tanh(a+b*x))^3//2+15//4*b^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+-15//4*b*x^(1/2)*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^-5//2*arctanh(tanh(a+b*x))^5//2, x) == :(-2//3*x^-3//2*arctanh(tanh(a+b*x))^5//2+-5*b^3//2*(-1*arctanh(tanh(a+b*x))+b*x)*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+5*b^2*x^(1/2)*arctanh(tanh(a+b*x))^(1/2)+-10//3*b*x^-1//2*arctanh(tanh(a+b*x))^3//2)
@test integrate(x^-7//2*arctanh(tanh(a+b*x))^5//2, x) == :(2*b^5//2*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+-2//5*x^-5//2*arctanh(tanh(a+b*x))^5//2+-2*b^2*x^-1//2*arctanh(tanh(a+b*x))^(1/2)+-2//3*b*x^-3//2*arctanh(tanh(a+b*x))^3//2)
@test integrate(x^-9//2*arctanh(tanh(a+b*x))^5//2, x) == :(2//7*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^7//2)
@test integrate(x^-11//2*arctanh(tanh(a+b*x))^5//2, x) == :(2//9*x^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^7//2+4//63*b*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^7//2)
@test integrate(x^-13//2*arctanh(tanh(a+b*x))^5//2, x) == :(2//11*x^-11//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^7//2+8//99*b*x^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^7//2+16//693*b^2*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^7//2)
@test integrate(x^-15//2*arctanh(tanh(a+b*x))^5//2, x) == :(2//13*x^-13//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^7//2+12//143*b*x^-11//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^7//2+16//429*b^2*x^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^7//2+32//3003*b^3*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-4*arctanh(tanh(a+b*x))^7//2)
@test integrate(x^5//2*arctanh(tanh(a+b*x))^-1//2, x) == :(1//3*b^-1*x^5//2*arctanh(tanh(a+b*x))^(1/2)+5//8*b^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^3*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+5//8*b^-3*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(tanh(a+b*x))^(1/2)+5//12*b^-2*x^3//2*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^3//2*arctanh(tanh(a+b*x))^-1//2, x) == :((1/2)*b^-1*x^3//2*arctanh(tanh(a+b*x))^(1/2)+3//4*b^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+3//4*b^-2*x^(1/2)*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^(1/2)*arctanh(tanh(a+b*x))^-1//2, x) == :(b^-1*x^(1/2)*arctanh(tanh(a+b*x))^(1/2)+b^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2))
@test integrate(x^-1//2*arctanh(tanh(a+b*x))^-1//2, x) == :(2*b^-1//2*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2))
@test integrate(x^-3//2*arctanh(tanh(a+b*x))^-1//2, x) == :(2*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^-5//2*arctanh(tanh(a+b*x))^-1//2, x) == :(2//3*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^(1/2)+4//3*b*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^-7//2*arctanh(tanh(a+b*x))^-1//2, x) == :(2//5*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^(1/2)+8//15*b*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^(1/2)+16//15*b^2*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^-9//2*arctanh(tanh(a+b*x))^-1//2, x) == :(2//7*x^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^(1/2)+12//35*b*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^(1/2)+16//35*b^2*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^(1/2)+32//35*b^3*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-4*arctanh(tanh(a+b*x))^(1/2))
@test integrate(x^7//2*arctanh(tanh(a+b*x))^-3//2, x) == :(-2*b^-1*x^7//2*arctanh(tanh(a+b*x))^-1//2+7//3*b^-2*x^5//2*arctanh(tanh(a+b*x))^(1/2)+35//8*b^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^3*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+35//8*b^-4*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(tanh(a+b*x))^(1/2)+35//12*b^-3*x^3//2*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^5//2*arctanh(tanh(a+b*x))^-3//2, x) == :(-2*b^-1*x^5//2*arctanh(tanh(a+b*x))^-1//2+5//2*b^-2*x^3//2*arctanh(tanh(a+b*x))^(1/2)+15//4*b^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+15//4*b^-3*x^(1/2)*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^3//2*arctanh(tanh(a+b*x))^-3//2, x) == :(-2*b^-1*x^3//2*arctanh(tanh(a+b*x))^-1//2+3*b^-2*x^(1/2)*arctanh(tanh(a+b*x))^(1/2)+3*b^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2))
@test integrate(x^(1/2)*arctanh(tanh(a+b*x))^-3//2, x) == :(2*b^-3//2*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+-2*b^-1*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)
@test integrate(x^-1//2*arctanh(tanh(a+b*x))^-3//2, x) == :(-2*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-1//2)
@test integrate(x^-3//2*arctanh(tanh(a+b*x))^-3//2, x) == :(2*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-1//2+-4*b*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1//2)
@test integrate(x^-5//2*arctanh(tanh(a+b*x))^-3//2, x) == :(2//3*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-1//2+-16//3*b^2*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-1//2+8//3*b*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1//2)
@test integrate(x^-7//2*arctanh(tanh(a+b*x))^-3//2, x) == :(2//5*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-1//2+-32//5*b^3*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-4*arctanh(tanh(a+b*x))^-1//2+4//5*b*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1//2+16//5*b^2*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-1//2)
@test integrate(x^7//2*arctanh(tanh(a+b*x))^-5//2, x) == :(-14//3*b^-2*x^5//2*arctanh(tanh(a+b*x))^-1//2+-2//3*b^-1*x^7//2*arctanh(tanh(a+b*x))^-3//2+35//4*b^-9//2*(-1*arctanh(tanh(a+b*x))+b*x)^2*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+35//6*b^-3*x^3//2*arctanh(tanh(a+b*x))^(1/2)+35//4*b^-4*x^(1/2)*arctanh(tanh(a+b*x))^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x))
@test integrate(x^5//2*arctanh(tanh(a+b*x))^-5//2, x) == :(5*b^-3*x^(1/2)*arctanh(tanh(a+b*x))^(1/2)+5*b^-7//2*(-1*arctanh(tanh(a+b*x))+b*x)*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+-10//3*b^-2*x^3//2*arctanh(tanh(a+b*x))^-1//2+-2//3*b^-1*x^5//2*arctanh(tanh(a+b*x))^-3//2)
@test integrate(x^3//2*arctanh(tanh(a+b*x))^-5//2, x) == :(2*b^-5//2*arctanh(b^(1/2)*x^(1/2)*arctanh(tanh(a+b*x))^-1//2)+-2*b^-2*x^(1/2)*arctanh(tanh(a+b*x))^-1//2+-2//3*b^-1*x^3//2*arctanh(tanh(a+b*x))^-3//2)
@test integrate(x^(1/2)*arctanh(tanh(a+b*x))^-5//2, x) == :(-2*x^3//2*(-3*arctanh(tanh(a+b*x))+3*b*x)^-1*arctanh(tanh(a+b*x))^-3//2)
@test integrate(x^-1//2*arctanh(tanh(a+b*x))^-5//2, x) == :(-2*x^(1/2)*(-3*arctanh(tanh(a+b*x))+3*b*x)^-1*arctanh(tanh(a+b*x))^-3//2+4//3*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-1//2)
@test integrate(x^-3//2*arctanh(tanh(a+b*x))^-5//2, x) == :(2*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-3//2+-8//3*b*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-3//2+16//3*b*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-1//2)
@test integrate(x^-5//2*arctanh(tanh(a+b*x))^-5//2, x) == :(2//3*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-3//2+4*b*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-3//2+-16//3*b^2*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-3//2+32//3*b^2*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-4*arctanh(tanh(a+b*x))^-1//2)
@test integrate(x^-7//2*arctanh(tanh(a+b*x))^-5//2, x) == :(2//5*x^-5//2*(-1*arctanh(tanh(a+b*x))+b*x)^-1*arctanh(tanh(a+b*x))^-3//2+-128//15*b^3*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-4*arctanh(tanh(a+b*x))^-3//2+16//15*b*x^-3//2*(-1*arctanh(tanh(a+b*x))+b*x)^-2*arctanh(tanh(a+b*x))^-3//2+32//5*b^2*x^-1//2*(-1*arctanh(tanh(a+b*x))+b*x)^-3*arctanh(tanh(a+b*x))^-3//2+256//15*b^3*x^(1/2)*(-1*arctanh(tanh(a+b*x))+b*x)^-5*arctanh(tanh(a+b*x))^-1//2)
@test integrate(x*arctanh(tanh(a+b*x))^n, x) == :(x*b^-1*(1+n)^-1*arctanh(tanh(a+b*x))^(1+n)+-1*b^-2*(1+n)^-1*(2+n)^-1*arctanh(tanh(a+b*x))^(2+n))
@test integrate(arctanh(tanh(a+b*x))^n, x) == :(b^-1*(1+n)^-1*arctanh(tanh(a+b*x))^(1+n))
@test integrate(x^m*arccoth(tanh(a+b*x)), x) == :(x^(1+m)*(1+m)^-1*arccoth(tanh(a+b*x))+-1*b*x^(2+m)*(2+m^2+3m)^-1)
@test integrate(x^2*arctanh(coth(a+b*x)), x) == :(-1//12*b*x^4+1//3*x^3*arctanh(coth(a+b*x)))
@test integrate(x*arctanh(coth(a+b*x)), x) == :((1/2)*x^2*arctanh(coth(a+b*x))+-1//6*b*x^3)
@test integrate(arctanh(coth(a+b*x)), x) == :((1/2)*b^-1*arctanh(coth(a+b*x))^2)
@test integrate(x^-1*arctanh(coth(a+b*x)), x) == :(b*x+-1*(-1*arctanh(coth(a+b*x))+b*x)*log(x))
@test integrate(x^-2*arctanh(coth(a+b*x)), x) == :(b*log(x)+-1*x^-1*arctanh(coth(a+b*x)))
@test integrate(x^-3*arctanh(coth(a+b*x)), x) == :(-1//2*b*x^-1+-1//2*x^-2*arctanh(coth(a+b*x)))
@test integrate(arctanh(cosh(x)), x) == :(-1*Polylogarithms.polylog(2,-1*exp(x))+x*arctanh(cosh(x))+-2*x*arctanh(exp(x))+Polylogarithms.polylog(2,exp(x)))
@test integrate(x*arctanh(cosh(x)), x) == :(-1*Polylogarithms.polylog(3,exp(x))+x*Polylogarithms.polylog(2,exp(x))+(1/2)*x^2*arctanh(cosh(x))+-1*x*Polylogarithms.polylog(2,-1*exp(x))+-1*x^2*arctanh(exp(x))+Polylogarithms.polylog(3,-1*exp(x)))
@test integrate(x^2*arctanh(cosh(x)), x) == :(-2*Polylogarithms.polylog(4,-1*exp(x))+2*Polylogarithms.polylog(4,exp(x))+x^2*Polylogarithms.polylog(2,exp(x))+-1*x^2*Polylogarithms.polylog(2,-1*exp(x))+-2*x*Polylogarithms.polylog(3,exp(x))+2*x*Polylogarithms.polylog(3,-1*exp(x))+-2//3*x^3*arctanh(exp(x))+1//3*x^3*arctanh(cosh(x)))
@test integrate(x^2*arctanh(c+d*tanh(a+b*x)), x) == :(-1//6*x^3*log(1+(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+-1//8*b^-3*Polylogarithms.polylog(4,-1*(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+1//3*x^3*arctanh(c+d*tanh(a+b*x))+1//6*x^3*log(1+(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+1//8*b^-3*Polylogarithms.polylog(4,-1*(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+-1//4*x*b^-2*Polylogarithms.polylog(3,-1*(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+-1//4*b^-1*x^2*Polylogarithms.polylog(2,-1*(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+1//4*x*b^-2*Polylogarithms.polylog(3,-1*(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+1//4*b^-1*x^2*Polylogarithms.polylog(2,-1*(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x)))
@test integrate(x*arctanh(c+d*tanh(a+b*x)), x) == :((1/2)*x^2*arctanh(c+d*tanh(a+b*x))+-1//4*x^2*log(1+(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+-1//8*b^-2*Polylogarithms.polylog(3,-1*(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+1//4*x^2*log(1+(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+1//8*b^-2*Polylogarithms.polylog(3,-1*(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+-1//4*x*b^-1*Polylogarithms.polylog(2,-1*(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+1//4*x*b^-1*Polylogarithms.polylog(2,-1*(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x)))
@test integrate(arctanh(c+d*tanh(a+b*x)), x) == :(x*arctanh(c+d*tanh(a+b*x))+(1/2)*x*log(1+(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+-1//2*x*log(1+(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+-1//4*b^-1*Polylogarithms.polylog(2,-1*(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+1//4*b^-1*Polylogarithms.polylog(2,-1*(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x)))
@test integrate(x^3*arctanh(1+d+d*tanh(a+b*x)), x) == :(-1//8*x^4*log(1+(1+d)*exp(2a+2*b*x))+1//4*x^4*arctanh(1+d+d*tanh(a+b*x))+1//20*b*x^5+3//16*b^-4*Polylogarithms.polylog(5,-1*(1+d)*exp(2a+2*b*x))+-3//8*x*b^-3*Polylogarithms.polylog(4,-1*(1+d)*exp(2a+2*b*x))+-1//4*b^-1*x^3*Polylogarithms.polylog(2,-1*(1+d)*exp(2a+2*b*x))+3//8*b^-2*x^2*Polylogarithms.polylog(3,-1*(1+d)*exp(2a+2*b*x)))
@test integrate(x^2*arctanh(1+d+d*tanh(a+b*x)), x) == :(-1//6*x^3*log(1+(1+d)*exp(2a+2*b*x))+-1//8*b^-3*Polylogarithms.polylog(4,-1*(1+d)*exp(2a+2*b*x))+1//3*x^3*arctanh(1+d+d*tanh(a+b*x))+1//12*b*x^4+-1//4*b^-1*x^2*Polylogarithms.polylog(2,-1*(1+d)*exp(2a+2*b*x))+1//4*x*b^-2*Polylogarithms.polylog(3,-1*(1+d)*exp(2a+2*b*x)))
@test integrate(x*arctanh(1+d+d*tanh(a+b*x)), x) == :((1/2)*x^2*arctanh(1+d+d*tanh(a+b*x))+-1//4*x^2*log(1+(1+d)*exp(2a+2*b*x))+1//6*b*x^3+1//8*b^-2*Polylogarithms.polylog(3,-1*(1+d)*exp(2a+2*b*x))+-1//4*x*b^-1*Polylogarithms.polylog(2,-1*(1+d)*exp(2a+2*b*x)))
@test integrate(arctanh(1+d+d*tanh(a+b*x)), x) == :(x*arctanh(1+d+d*tanh(a+b*x))+(1/2)*b*x^2+-1//2*x*log(1+(1+d)*exp(2a+2*b*x))+-1//4*b^-1*Polylogarithms.polylog(2,-1*(1+d)*exp(2a+2*b*x)))
@test integrate(x^3*arctanh(1+-1d+-1*d*tanh(a+b*x)), x) == :(-1//8*x^4*log(1+(1+-1d)*exp(2a+2*b*x))+1//4*x^4*arctanh(1+-1d+-1*d*tanh(a+b*x))+1//20*b*x^5+3//16*b^-4*Polylogarithms.polylog(5,-1*(1+-1d)*exp(2a+2*b*x))+-3//8*x*b^-3*Polylogarithms.polylog(4,-1*(1+-1d)*exp(2a+2*b*x))+-1//4*b^-1*x^3*Polylogarithms.polylog(2,-1*(1+-1d)*exp(2a+2*b*x))+3//8*b^-2*x^2*Polylogarithms.polylog(3,-1*(1+-1d)*exp(2a+2*b*x)))
@test integrate(x^2*arctanh(1+-1d+-1*d*tanh(a+b*x)), x) == :(-1//6*x^3*log(1+(1+-1d)*exp(2a+2*b*x))+-1//8*b^-3*Polylogarithms.polylog(4,-1*(1+-1d)*exp(2a+2*b*x))+1//3*x^3*arctanh(1+-1d+-1*d*tanh(a+b*x))+1//12*b*x^4+-1//4*b^-1*x^2*Polylogarithms.polylog(2,-1*(1+-1d)*exp(2a+2*b*x))+1//4*x*b^-2*Polylogarithms.polylog(3,-1*(1+-1d)*exp(2a+2*b*x)))
@test integrate(x*arctanh(1+-1d+-1*d*tanh(a+b*x)), x) == :((1/2)*x^2*arctanh(1+-1d+-1*d*tanh(a+b*x))+-1//4*x^2*log(1+(1+-1d)*exp(2a+2*b*x))+1//6*b*x^3+1//8*b^-2*Polylogarithms.polylog(3,-1*(1+-1d)*exp(2a+2*b*x))+-1//4*x*b^-1*Polylogarithms.polylog(2,-1*(1+-1d)*exp(2a+2*b*x)))
@test integrate(arctanh(1+-1d+-1*d*tanh(a+b*x)), x) == :(x*arctanh(1+-1d+-1*d*tanh(a+b*x))+(1/2)*b*x^2+-1//2*x*log(1+(1+-1d)*exp(2a+2*b*x))+-1//4*b^-1*Polylogarithms.polylog(2,-1*(1+-1d)*exp(2a+2*b*x)))
@test integrate(x^2*arctanh(c+d*coth(a+b*x)), x) == :(-1//6*x^3*log(1+-1*(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+-1//8*b^-3*Polylogarithms.polylog(4,(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+1//3*x^3*arctanh(c+d*coth(a+b*x))+1//6*x^3*log(1+-1*(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+1//8*b^-3*Polylogarithms.polylog(4,(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+-1//4*x*b^-2*Polylogarithms.polylog(3,(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+-1//4*b^-1*x^2*Polylogarithms.polylog(2,(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+1//4*x*b^-2*Polylogarithms.polylog(3,(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+1//4*b^-1*x^2*Polylogarithms.polylog(2,(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x)))
@test integrate(x*arctanh(c+d*coth(a+b*x)), x) == :((1/2)*x^2*arctanh(c+d*coth(a+b*x))+-1//4*x^2*log(1+-1*(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+-1//8*b^-2*Polylogarithms.polylog(3,(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+1//4*x^2*log(1+-1*(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+1//8*b^-2*Polylogarithms.polylog(3,(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+-1//4*x*b^-1*Polylogarithms.polylog(2,(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+1//4*x*b^-1*Polylogarithms.polylog(2,(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x)))
@test integrate(arctanh(c+d*coth(a+b*x)), x) == :(x*arctanh(c+d*coth(a+b*x))+(1/2)*x*log(1+-1*(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x))+-1//2*x*log(1+-1*(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+-1//4*b^-1*Polylogarithms.polylog(2,(1+c+-1d)^-1*(1+c+d)*exp(2a+2*b*x))+1//4*b^-1*Polylogarithms.polylog(2,(1+d+-1c)^-1*(1+-1c+-1d)*exp(2a+2*b*x)))
@test integrate(x^3*arctanh(1+d+d*coth(a+b*x)), x) == :(-1//8*x^4*log(1+-1*(1+d)*exp(2a+2*b*x))+1//4*x^4*arctanh(1+d+d*coth(a+b*x))+1//20*b*x^5+3//16*b^-4*Polylogarithms.polylog(5,(1+d)*exp(2a+2*b*x))+-3//8*x*b^-3*Polylogarithms.polylog(4,(1+d)*exp(2a+2*b*x))+-1//4*b^-1*x^3*Polylogarithms.polylog(2,(1+d)*exp(2a+2*b*x))+3//8*b^-2*x^2*Polylogarithms.polylog(3,(1+d)*exp(2a+2*b*x)))
@test integrate(x^2*arctanh(1+d+d*coth(a+b*x)), x) == :(-1//6*x^3*log(1+-1*(1+d)*exp(2a+2*b*x))+-1//8*b^-3*Polylogarithms.polylog(4,(1+d)*exp(2a+2*b*x))+1//3*x^3*arctanh(1+d+d*coth(a+b*x))+1//12*b*x^4+-1//4*b^-1*x^2*Polylogarithms.polylog(2,(1+d)*exp(2a+2*b*x))+1//4*x*b^-2*Polylogarithms.polylog(3,(1+d)*exp(2a+2*b*x)))
@test integrate(x*arctanh(1+d+d*coth(a+b*x)), x) == :((1/2)*x^2*arctanh(1+d+d*coth(a+b*x))+-1//4*x^2*log(1+-1*(1+d)*exp(2a+2*b*x))+1//6*b*x^3+1//8*b^-2*Polylogarithms.polylog(3,(1+d)*exp(2a+2*b*x))+-1//4*x*b^-1*Polylogarithms.polylog(2,(1+d)*exp(2a+2*b*x)))
@test integrate(arctanh(1+d+d*coth(a+b*x)), x) == :(x*arctanh(1+d+d*coth(a+b*x))+(1/2)*b*x^2+-1//2*x*log(1+-1*(1+d)*exp(2a+2*b*x))+-1//4*b^-1*Polylogarithms.polylog(2,(1+d)*exp(2a+2*b*x)))
@test integrate(x^3*arctanh(1+-1d+-1*d*coth(a+b*x)), x) == :(-1//8*x^4*log(1+-1*(1+-1d)*exp(2a+2*b*x))+1//4*x^4*arctanh(1+-1d+-1*d*coth(a+b*x))+1//20*b*x^5+3//16*b^-4*Polylogarithms.polylog(5,(1+-1d)*exp(2a+2*b*x))+-3//8*x*b^-3*Polylogarithms.polylog(4,(1+-1d)*exp(2a+2*b*x))+-1//4*b^-1*x^3*Polylogarithms.polylog(2,(1+-1d)*exp(2a+2*b*x))+3//8*b^-2*x^2*Polylogarithms.polylog(3,(1+-1d)*exp(2a+2*b*x)))
@test integrate(x^2*arctanh(1+-1d+-1*d*coth(a+b*x)), x) == :(-1//6*x^3*log(1+-1*(1+-1d)*exp(2a+2*b*x))+-1//8*b^-3*Polylogarithms.polylog(4,(1+-1d)*exp(2a+2*b*x))+1//3*x^3*arctanh(1+-1d+-1*d*coth(a+b*x))+1//12*b*x^4+-1//4*b^-1*x^2*Polylogarithms.polylog(2,(1+-1d)*exp(2a+2*b*x))+1//4*x*b^-2*Polylogarithms.polylog(3,(1+-1d)*exp(2a+2*b*x)))
@test integrate(x*arctanh(1+-1d+-1*d*coth(a+b*x)), x) == :((1/2)*x^2*arctanh(1+-1d+-1*d*coth(a+b*x))+-1//4*x^2*log(1+-1*(1+-1d)*exp(2a+2*b*x))+1//6*b*x^3+1//8*b^-2*Polylogarithms.polylog(3,(1+-1d)*exp(2a+2*b*x))+-1//4*x*b^-1*Polylogarithms.polylog(2,(1+-1d)*exp(2a+2*b*x)))
@test integrate(arctanh(1+-1d+-1*d*coth(a+b*x)), x) == :(x*arctanh(1+-1d+-1*d*coth(a+b*x))+(1/2)*b*x^2+-1//2*x*log(1+-1*(1+-1d)*exp(2a+2*b*x))+-1//4*b^-1*Polylogarithms.polylog(2,(1+-1d)*exp(2a+2*b*x)))
@test integrate((e+f*x)^3*arctanh(tan(a+b*x)), x) == :(-3//16*b^-4*f^3*Polylogarithms.polylog(5,-1*im*exp(2*im*(a+b*x)))+1//4*f^-1*(e+f*x)^4*arctanh(tan(a+b*x))+3//16*b^-4*f^3*Polylogarithms.polylog(5,im*exp(2*im*(a+b*x)))+-3//8*f*b^-2*(e+f*x)^2*Polylogarithms.polylog(3,im*exp(2*im*(a+b*x)))+-1//4*im*b^-1*(e+f*x)^3*Polylogarithms.polylog(2,-1*im*exp(2*im*(a+b*x)))+1//4*im*b^-1*(e+f*x)^3*Polylogarithms.polylog(2,im*exp(2*im*(a+b*x)))+1//4*im*f^-1*(e+f*x)^4*arctan(exp(2*im*(a+b*x)))+3//8*f*b^-2*(e+f*x)^2*Polylogarithms.polylog(3,-1*im*exp(2*im*(a+b*x)))+-3//8*im*b^-3*f^2*(e+f*x)*Polylogarithms.polylog(4,im*exp(2*im*(a+b*x)))+3//8*im*b^-3*f^2*(e+f*x)*Polylogarithms.polylog(4,-1*im*exp(2*im*(a+b*x))))
@test integrate((e+f*x)^2*arctanh(tan(a+b*x)), x) == :(1//3*f^-1*(e+f*x)^3*arctanh(tan(a+b*x))+-1//4*im*b^-1*(e+f*x)^2*Polylogarithms.polylog(2,-1*im*exp(2*im*(a+b*x)))+-1//4*f*b^-2*(e+f*x)*Polylogarithms.polylog(3,im*exp(2*im*(a+b*x)))+-1//8*im*b^-3*f^2*Polylogarithms.polylog(4,im*exp(2*im*(a+b*x)))+1//3*im*f^-1*(e+f*x)^3*arctan(exp(2*im*(a+b*x)))+1//4*im*b^-1*(e+f*x)^2*Polylogarithms.polylog(2,im*exp(2*im*(a+b*x)))+1//4*f*b^-2*(e+f*x)*Polylogarithms.polylog(3,-1*im*exp(2*im*(a+b*x)))+1//8*im*b^-3*f^2*Polylogarithms.polylog(4,-1*im*exp(2*im*(a+b*x))))
@test integrate((e+f*x)*arctanh(tan(a+b*x)), x) == :((1/2)*f^-1*(e+f*x)^2*arctanh(tan(a+b*x))+-1//8*f*b^-2*Polylogarithms.polylog(3,im*exp(2*im*(a+b*x)))+1//8*f*b^-2*Polylogarithms.polylog(3,-1*im*exp(2*im*(a+b*x)))+(1/2)*im*f^-1*(e+f*x)^2*arctan(exp(2*im*(a+b*x)))+-1//4*im*b^-1*(e+f*x)*Polylogarithms.polylog(2,-1*im*exp(2*im*(a+b*x)))+1//4*im*b^-1*(e+f*x)*Polylogarithms.polylog(2,im*exp(2*im*(a+b*x))))
@test integrate(arctanh(tan(a+b*x)), x) == :(x*arctanh(tan(a+b*x))+im*x*arctan(exp(2*im*(a+b*x)))+-1//4*im*b^-1*Polylogarithms.polylog(2,-1*im*exp(2*im*(a+b*x)))+1//4*im*b^-1*Polylogarithms.polylog(2,im*exp(2*im*(a+b*x))))
@test integrate(x^2*arctanh(c+d*tan(a+b*x)), x) == :(-1//6*x^3*log(1+(1+c+im*d)^-1*(1+c+-1*im*d)*exp(2*im*a+2*im*b*x))+1//3*x^3*arctanh(c+d*tan(a+b*x))+1//6*x^3*log(1+(1+-1c+-1*im*d)^-1*(1+-1c+im*d)*exp(2*im*a+2*im*b*x))+-1//4*x*b^-2*Polylogarithms.polylog(3,-1*(1+c+im*d)^-1*(1+c+-1*im*d)*exp(2*im*a+2*im*b*x))+-1//8*im*b^-3*Polylogarithms.polylog(4,-1*(1+c+im*d)^-1*(1+c+-1*im*d)*exp(2*im*a+2*im*b*x))+1//4*x*b^-2*Polylogarithms.polylog(3,-1*(1+-1c+-1*im*d)^-1*(1+-1c+im*d)*exp(2*im*a+2*im*b*x))+1//8*im*b^-3*Polylogarithms.polylog(4,-1*(1+-1c+-1*im*d)^-1*(1+-1c+im*d)*exp(2*im*a+2*im*b*x))+-1//4*im*b^-1*x^2*Polylogarithms.polylog(2,-1*(1+-1c+-1*im*d)^-1*(1+-1c+im*d)*exp(2*im*a+2*im*b*x))+1//4*im*b^-1*x^2*Polylogarithms.polylog(2,-1*(1+c+im*d)^-1*(1+c+-1*im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(x*arctanh(c+d*tan(a+b*x)), x) == :((1/2)*x^2*arctanh(c+d*tan(a+b*x))+-1//4*x^2*log(1+(1+c+im*d)^-1*(1+c+-1*im*d)*exp(2*im*a+2*im*b*x))+-1//8*b^-2*Polylogarithms.polylog(3,-1*(1+c+im*d)^-1*(1+c+-1*im*d)*exp(2*im*a+2*im*b*x))+1//4*x^2*log(1+(1+-1c+-1*im*d)^-1*(1+-1c+im*d)*exp(2*im*a+2*im*b*x))+1//8*b^-2*Polylogarithms.polylog(3,-1*(1+-1c+-1*im*d)^-1*(1+-1c+im*d)*exp(2*im*a+2*im*b*x))+-1//4*im*x*b^-1*Polylogarithms.polylog(2,-1*(1+-1c+-1*im*d)^-1*(1+-1c+im*d)*exp(2*im*a+2*im*b*x))+1//4*im*x*b^-1*Polylogarithms.polylog(2,-1*(1+c+im*d)^-1*(1+c+-1*im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(arctanh(c+d*tan(a+b*x)), x) == :(x*arctanh(c+d*tan(a+b*x))+(1/2)*x*log(1+(1+-1c+-1*im*d)^-1*(1+-1c+im*d)*exp(2*im*a+2*im*b*x))+-1//2*x*log(1+(1+c+im*d)^-1*(1+c+-1*im*d)*exp(2*im*a+2*im*b*x))+-1//4*im*b^-1*Polylogarithms.polylog(2,-1*(1+-1c+-1*im*d)^-1*(1+-1c+im*d)*exp(2*im*a+2*im*b*x))+1//4*im*b^-1*Polylogarithms.polylog(2,-1*(1+c+im*d)^-1*(1+c+-1*im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(x^2*arctanh(1+d*tan(a+b*x)+-1*im*d), x) == :(-1//6*x^3*log(1+(1+-1*im*d)*exp(2*im*a+2*im*b*x))+1//3*x^3*arctanh(1+d*tan(a+b*x)+-1*im*d)+-1//4*x*b^-2*Polylogarithms.polylog(3,-1*(1+-1*im*d)*exp(2*im*a+2*im*b*x))+-1//8*im*b^-3*Polylogarithms.polylog(4,-1*(1+-1*im*d)*exp(2*im*a+2*im*b*x))+1//12*im*b*x^4+1//4*im*b^-1*x^2*Polylogarithms.polylog(2,-1*(1+-1*im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(x*arctanh(1+d*tan(a+b*x)+-1*im*d), x) == :((1/2)*x^2*arctanh(1+d*tan(a+b*x)+-1*im*d)+-1//4*x^2*log(1+(1+-1*im*d)*exp(2*im*a+2*im*b*x))+-1//8*b^-2*Polylogarithms.polylog(3,-1*(1+-1*im*d)*exp(2*im*a+2*im*b*x))+1//6*im*b*x^3+1//4*im*x*b^-1*Polylogarithms.polylog(2,-1*(1+-1*im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(arctanh(1+d*tan(a+b*x)+-1*im*d), x) == :(x*arctanh(1+d*tan(a+b*x)+-1*im*d)+-1//2*x*log(1+(1+-1*im*d)*exp(2*im*a+2*im*b*x))+(1/2)*im*b*x^2+1//4*im*b^-1*Polylogarithms.polylog(2,-1*(1+-1*im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(x^2*arctanh(1+im*d+-1*d*tan(a+b*x)), x) == :(-1//6*x^3*log(1+(1+im*d)*exp(2*im*a+2*im*b*x))+1//3*x^3*arctanh(1+im*d+-1*d*tan(a+b*x))+-1//4*x*b^-2*Polylogarithms.polylog(3,-1*(1+im*d)*exp(2*im*a+2*im*b*x))+-1//8*im*b^-3*Polylogarithms.polylog(4,-1*(1+im*d)*exp(2*im*a+2*im*b*x))+1//12*im*b*x^4+1//4*im*b^-1*x^2*Polylogarithms.polylog(2,-1*(1+im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(x*arctanh(1+im*d+-1*d*tan(a+b*x)), x) == :((1/2)*x^2*arctanh(1+im*d+-1*d*tan(a+b*x))+-1//4*x^2*log(1+(1+im*d)*exp(2*im*a+2*im*b*x))+-1//8*b^-2*Polylogarithms.polylog(3,-1*(1+im*d)*exp(2*im*a+2*im*b*x))+1//6*im*b*x^3+1//4*im*x*b^-1*Polylogarithms.polylog(2,-1*(1+im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(arctanh(1+im*d+-1*d*tan(a+b*x)), x) == :(x*arctanh(1+im*d+-1*d*tan(a+b*x))+-1//2*x*log(1+(1+im*d)*exp(2*im*a+2*im*b*x))+(1/2)*im*b*x^2+1//4*im*b^-1*Polylogarithms.polylog(2,-1*(1+im*d)*exp(2*im*a+2*im*b*x)))
@test integrate((e+f*x)^3*arctanh(cot(a+b*x)), x) == :(-3//16*b^-4*f^3*Polylogarithms.polylog(5,-1*im*exp(2*im*(a+b*x)))+1//4*f^-1*(e+f*x)^4*arctanh(cot(a+b*x))+3//16*b^-4*f^3*Polylogarithms.polylog(5,im*exp(2*im*(a+b*x)))+-3//8*f*b^-2*(e+f*x)^2*Polylogarithms.polylog(3,im*exp(2*im*(a+b*x)))+-1//4*im*b^-1*(e+f*x)^3*Polylogarithms.polylog(2,-1*im*exp(2*im*(a+b*x)))+1//4*im*b^-1*(e+f*x)^3*Polylogarithms.polylog(2,im*exp(2*im*(a+b*x)))+1//4*im*f^-1*(e+f*x)^4*arctan(exp(2*im*(a+b*x)))+3//8*f*b^-2*(e+f*x)^2*Polylogarithms.polylog(3,-1*im*exp(2*im*(a+b*x)))+-3//8*im*b^-3*f^2*(e+f*x)*Polylogarithms.polylog(4,im*exp(2*im*(a+b*x)))+3//8*im*b^-3*f^2*(e+f*x)*Polylogarithms.polylog(4,-1*im*exp(2*im*(a+b*x))))
@test integrate((e+f*x)^2*arctanh(cot(a+b*x)), x) == :(1//3*f^-1*(e+f*x)^3*arctanh(cot(a+b*x))+-1//4*im*b^-1*(e+f*x)^2*Polylogarithms.polylog(2,-1*im*exp(2*im*(a+b*x)))+-1//4*f*b^-2*(e+f*x)*Polylogarithms.polylog(3,im*exp(2*im*(a+b*x)))+-1//8*im*b^-3*f^2*Polylogarithms.polylog(4,im*exp(2*im*(a+b*x)))+1//3*im*f^-1*(e+f*x)^3*arctan(exp(2*im*(a+b*x)))+1//4*im*b^-1*(e+f*x)^2*Polylogarithms.polylog(2,im*exp(2*im*(a+b*x)))+1//4*f*b^-2*(e+f*x)*Polylogarithms.polylog(3,-1*im*exp(2*im*(a+b*x)))+1//8*im*b^-3*f^2*Polylogarithms.polylog(4,-1*im*exp(2*im*(a+b*x))))
@test integrate((e+f*x)*arctanh(cot(a+b*x)), x) == :((1/2)*f^-1*(e+f*x)^2*arctanh(cot(a+b*x))+-1//8*f*b^-2*Polylogarithms.polylog(3,im*exp(2*im*(a+b*x)))+1//8*f*b^-2*Polylogarithms.polylog(3,-1*im*exp(2*im*(a+b*x)))+(1/2)*im*f^-1*(e+f*x)^2*arctan(exp(2*im*(a+b*x)))+-1//4*im*b^-1*(e+f*x)*Polylogarithms.polylog(2,-1*im*exp(2*im*(a+b*x)))+1//4*im*b^-1*(e+f*x)*Polylogarithms.polylog(2,im*exp(2*im*(a+b*x))))
@test integrate(arctanh(cot(a+b*x)), x) == :(x*arctanh(cot(a+b*x))+im*x*arctan(exp(2*im*(a+b*x)))+-1//4*im*b^-1*Polylogarithms.polylog(2,-1*im*exp(2*im*(a+b*x)))+1//4*im*b^-1*Polylogarithms.polylog(2,im*exp(2*im*(a+b*x))))
@test integrate(x^2*arctanh(c+d*cot(a+b*x)), x) == :(-1//6*x^3*log(1+-1*(1+c+-1*im*d)^-1*(1+c+im*d)*exp(2*im*a+2*im*b*x))+1//3*x^3*arctanh(c+d*cot(a+b*x))+1//6*x^3*log(1+-1*(1+-1c+im*d)^-1*(1+-1c+-1*im*d)*exp(2*im*a+2*im*b*x))+-1//4*x*b^-2*Polylogarithms.polylog(3,(1+c+-1*im*d)^-1*(1+c+im*d)*exp(2*im*a+2*im*b*x))+-1//8*im*b^-3*Polylogarithms.polylog(4,(1+c+-1*im*d)^-1*(1+c+im*d)*exp(2*im*a+2*im*b*x))+1//4*x*b^-2*Polylogarithms.polylog(3,(1+-1c+im*d)^-1*(1+-1c+-1*im*d)*exp(2*im*a+2*im*b*x))+1//8*im*b^-3*Polylogarithms.polylog(4,(1+-1c+im*d)^-1*(1+-1c+-1*im*d)*exp(2*im*a+2*im*b*x))+-1//4*im*b^-1*x^2*Polylogarithms.polylog(2,(1+-1c+im*d)^-1*(1+-1c+-1*im*d)*exp(2*im*a+2*im*b*x))+1//4*im*b^-1*x^2*Polylogarithms.polylog(2,(1+c+-1*im*d)^-1*(1+c+im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(x*arctanh(c+d*cot(a+b*x)), x) == :((1/2)*x^2*arctanh(c+d*cot(a+b*x))+-1//4*x^2*log(1+-1*(1+c+-1*im*d)^-1*(1+c+im*d)*exp(2*im*a+2*im*b*x))+-1//8*b^-2*Polylogarithms.polylog(3,(1+c+-1*im*d)^-1*(1+c+im*d)*exp(2*im*a+2*im*b*x))+1//4*x^2*log(1+-1*(1+-1c+im*d)^-1*(1+-1c+-1*im*d)*exp(2*im*a+2*im*b*x))+1//8*b^-2*Polylogarithms.polylog(3,(1+-1c+im*d)^-1*(1+-1c+-1*im*d)*exp(2*im*a+2*im*b*x))+-1//4*im*x*b^-1*Polylogarithms.polylog(2,(1+-1c+im*d)^-1*(1+-1c+-1*im*d)*exp(2*im*a+2*im*b*x))+1//4*im*x*b^-1*Polylogarithms.polylog(2,(1+c+-1*im*d)^-1*(1+c+im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(arctanh(c+d*cot(a+b*x)), x) == :(x*arctanh(c+d*cot(a+b*x))+(1/2)*x*log(1+-1*(1+-1c+im*d)^-1*(1+-1c+-1*im*d)*exp(2*im*a+2*im*b*x))+-1//2*x*log(1+-1*(1+c+-1*im*d)^-1*(1+c+im*d)*exp(2*im*a+2*im*b*x))+-1//4*im*b^-1*Polylogarithms.polylog(2,(1+-1c+im*d)^-1*(1+-1c+-1*im*d)*exp(2*im*a+2*im*b*x))+1//4*im*b^-1*Polylogarithms.polylog(2,(1+c+-1*im*d)^-1*(1+c+im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(x^2*arctanh(1+im*d+d*cot(a+b*x)), x) == :(-1//6*x^3*log(1+-1*(1+im*d)*exp(2*im*a+2*im*b*x))+1//3*x^3*arctanh(1+im*d+d*cot(a+b*x))+-1//4*x*b^-2*Polylogarithms.polylog(3,(1+im*d)*exp(2*im*a+2*im*b*x))+-1//8*im*b^-3*Polylogarithms.polylog(4,(1+im*d)*exp(2*im*a+2*im*b*x))+1//12*im*b*x^4+1//4*im*b^-1*x^2*Polylogarithms.polylog(2,(1+im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(x*arctanh(1+im*d+d*cot(a+b*x)), x) == :((1/2)*x^2*arctanh(1+im*d+d*cot(a+b*x))+-1//4*x^2*log(1+-1*(1+im*d)*exp(2*im*a+2*im*b*x))+-1//8*b^-2*Polylogarithms.polylog(3,(1+im*d)*exp(2*im*a+2*im*b*x))+1//6*im*b*x^3+1//4*im*x*b^-1*Polylogarithms.polylog(2,(1+im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(arctanh(1+im*d+d*cot(a+b*x)), x) == :(x*arctanh(1+im*d+d*cot(a+b*x))+-1//2*x*log(1+-1*(1+im*d)*exp(2*im*a+2*im*b*x))+(1/2)*im*b*x^2+1//4*im*b^-1*Polylogarithms.polylog(2,(1+im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(x^2*arctanh(1+-1*im*d+-1*d*cot(a+b*x)), x) == :(-1//6*x^3*log(1+-1*(1+-1*im*d)*exp(2*im*a+2*im*b*x))+1//3*x^3*arctanh(1+-1*im*d+-1*d*cot(a+b*x))+-1//4*x*b^-2*Polylogarithms.polylog(3,(1+-1*im*d)*exp(2*im*a+2*im*b*x))+-1//8*im*b^-3*Polylogarithms.polylog(4,(1+-1*im*d)*exp(2*im*a+2*im*b*x))+1//12*im*b*x^4+1//4*im*b^-1*x^2*Polylogarithms.polylog(2,(1+-1*im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(x*arctanh(1+-1*im*d+-1*d*cot(a+b*x)), x) == :((1/2)*x^2*arctanh(1+-1*im*d+-1*d*cot(a+b*x))+-1//4*x^2*log(1+-1*(1+-1*im*d)*exp(2*im*a+2*im*b*x))+-1//8*b^-2*Polylogarithms.polylog(3,(1+-1*im*d)*exp(2*im*a+2*im*b*x))+1//6*im*b*x^3+1//4*im*x*b^-1*Polylogarithms.polylog(2,(1+-1*im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(arctanh(1+-1*im*d+-1*d*cot(a+b*x)), x) == :(x*arctanh(1+-1*im*d+-1*d*cot(a+b*x))+-1//2*x*log(1+-1*(1+-1*im*d)*exp(2*im*a+2*im*b*x))+(1/2)*im*b*x^2+1//4*im*b^-1*Polylogarithms.polylog(2,(1+-1*im*d)*exp(2*im*a+2*im*b*x)))
@test integrate(arctanh(exp(x)), x) == :((1/2)*Polylogarithms.polylog(2,exp(x))+-1//2*Polylogarithms.polylog(2,-1*exp(x)))
@test integrate(x*arctanh(exp(x)), x) == :((1/2)*Polylogarithms.polylog(3,-1*exp(x))+-1//2*Polylogarithms.polylog(3,exp(x))+(1/2)*x*Polylogarithms.polylog(2,exp(x))+-1//2*x*Polylogarithms.polylog(2,-1*exp(x)))
@test integrate(x^2*arctanh(exp(x)), x) == :(-1*Polylogarithms.polylog(4,-1*exp(x))+x*Polylogarithms.polylog(3,-1*exp(x))+(1/2)*x^2*Polylogarithms.polylog(2,exp(x))+-1*x*Polylogarithms.polylog(3,exp(x))+-1//2*x^2*Polylogarithms.polylog(2,-1*exp(x))+Polylogarithms.polylog(4,exp(x)))
@test integrate(arctanh(exp(a+b*x)), x) == :((1/2)*b^-1*Polylogarithms.polylog(2,exp(a+b*x))+-1//2*b^-1*Polylogarithms.polylog(2,-1*exp(a+b*x)))
@test integrate(x*arctanh(exp(a+b*x)), x) == :((1/2)*b^-2*Polylogarithms.polylog(3,-1*exp(a+b*x))+-1//2*b^-2*Polylogarithms.polylog(3,exp(a+b*x))+(1/2)*x*b^-1*Polylogarithms.polylog(2,exp(a+b*x))+-1//2*x*b^-1*Polylogarithms.polylog(2,-1*exp(a+b*x)))
@test integrate(x^2*arctanh(exp(a+b*x)), x) == :(b^-3*Polylogarithms.polylog(4,exp(a+b*x))+-1*b^-3*Polylogarithms.polylog(4,-1*exp(a+b*x))+x*b^-2*Polylogarithms.polylog(3,-1*exp(a+b*x))+(1/2)*b^-1*x^2*Polylogarithms.polylog(2,exp(a+b*x))+-1*x*b^-2*Polylogarithms.polylog(3,exp(a+b*x))+-1//2*b^-1*x^2*Polylogarithms.polylog(2,-1*exp(a+b*x)))
@test integrate(arctanh(a+b*f^(c+d*x)), x) == :((1/2)*d^-1*log(f)^-1*Polylogarithms.polylog(2,1+-2*(1+a+b*f^(c+d*x))^-1)+-1//2*d^-1*log(f)^-1*Polylogarithms.polylog(2,1+-2*b*f^(c+d*x)*(1+-1a)^-1*(1+a+b*f^(c+d*x))^-1)+d^-1*log(f)^-1*arctanh(a+b*f^(c+d*x))*log(2*b*f^(c+d*x)*(1+-1a)^-1*(1+a+b*f^(c+d*x))^-1)+-1*d^-1*log(f)^-1*arctanh(a+b*f^(c+d*x))*log(2*(1+a+b*f^(c+d*x))^-1))
@test integrate(x*arctanh(a+b*f^(c+d*x)), x) == :(-1//4*x^2*log(1+b*f^(c+d*x)*(1+a)^-1)+-1//4*x^2*log(1+-1a+-1*b*f^(c+d*x))+1//4*x^2*log(1+-1*b*f^(c+d*x)*(1+-1a)^-1)+1//4*x^2*log(1+a+b*f^(c+d*x))+(1/2)*d^-2*log(f)^-2*Polylogarithms.polylog(3,-1*b*f^(c+d*x)*(1+a)^-1)+-1//2*d^-2*log(f)^-2*Polylogarithms.polylog(3,b*f^(c+d*x)*(1+-1a)^-1)+(1/2)*x*d^-1*log(f)^-1*Polylogarithms.polylog(2,b*f^(c+d*x)*(1+-1a)^-1)+-1//2*x*d^-1*log(f)^-1*Polylogarithms.polylog(2,-1*b*f^(c+d*x)*(1+a)^-1))
@test integrate(x^2*arctanh(a+b*f^(c+d*x)), x) == :(-1//6*x^3*log(1+b*f^(c+d*x)*(1+a)^-1)+-1//6*x^3*log(1+-1a+-1*b*f^(c+d*x))+1//6*x^3*log(1+-1*b*f^(c+d*x)*(1+-1a)^-1)+1//6*x^3*log(1+a+b*f^(c+d*x))+d^-3*log(f)^-3*Polylogarithms.polylog(4,b*f^(c+d*x)*(1+-1a)^-1)+-1*d^-3*log(f)^-3*Polylogarithms.polylog(4,-1*b*f^(c+d*x)*(1+a)^-1)+x*d^-2*log(f)^-2*Polylogarithms.polylog(3,-1*b*f^(c+d*x)*(1+a)^-1)+(1/2)*d^-1*x^2*log(f)^-1*Polylogarithms.polylog(2,b*f^(c+d*x)*(1+-1a)^-1)+-1*x*d^-2*log(f)^-2*Polylogarithms.polylog(3,b*f^(c+d*x)*(1+-1a)^-1)+-1//2*d^-1*x^2*log(f)^-1*Polylogarithms.polylog(2,-1*b*f^(c+d*x)*(1+a)^-1))
@test integrate(arctanh(sinh(a*c+b*c*x))*exp(c*(a+b*x)), x) == :(b^-1*c^-1*arctanh(sinh(c*(a+b*x)))*exp(a*c+b*c*x)+(1/2)*b^-1*c^-1*(1+2^(1/2))*log(3+-1*exp(2*c*(a+b*x))+2*2^(1/2))+(1/2)*b^-1*c^-1*(1+-1*2^(1/2))*log(3+-1*exp(2*c*(a+b*x))+-2*2^(1/2)))
@test integrate(arctanh(cosh(a*c+b*c*x))*exp(c*(a+b*x)), x) == :(b^-1*c^-1*log(1+-1*exp(2*c*(a+b*x)))+b^-1*c^-1*arctanh(cosh(c*(a+b*x)))*exp(a*c+b*c*x))
@test integrate(arctanh(tanh(a*c+b*c*x))*exp(c*(a+b*x)), x) == :(-1*b^-1*c^-1*exp(a*c+b*c*x)+b^-1*c^-1*arctanh(tanh(c*(a+b*x)))*exp(a*c+b*c*x))
@test integrate(arctanh(coth(a*c+b*c*x))*exp(c*(a+b*x)), x) == :(-1*b^-1*c^-1*exp(a*c+b*c*x)+b^-1*c^-1*arctanh(coth(c*(a+b*x)))*exp(a*c+b*c*x))
@test integrate(arctanh(sech(a*c+b*c*x))*exp(c*(a+b*x)), x) == :(b^-1*c^-1*log(1+-1*exp(2*c*(a+b*x)))+b^-1*c^-1*arctanh(sech(c*(a+b*x)))*exp(a*c+b*c*x))
@test integrate(arctanh(csch(a*c+b*c*x))*exp(c*(a+b*x)), x) == :(b^-1*c^-1*arctanh(csch(c*(a+b*x)))*exp(a*c+b*c*x)+(1/2)*b^-1*c^-1*(1+2^(1/2))*log(3+-1*exp(2*c*(a+b*x))+2*2^(1/2))+(1/2)*b^-1*c^-1*(1+-1*2^(1/2))*log(3+-1*exp(2*c*(a+b*x))+-2*2^(1/2)))
@test integrate(x^-1*(a+b*arctanh(c*x^n))*(d+e*log(f*x^m)), x) == :(a*d*log(x)+(1/2)*a*e*m^-1*log(f*x^m)^2+(1/2)*b*d*n^-1*Polylogarithms.polylog(2,c*x^n)+-1//2*b*d*n^-1*Polylogarithms.polylog(2,-1*c*x^n)+(1/2)*b*e*m*n^-2*Polylogarithms.polylog(3,-1*c*x^n)+(1/2)*b*e*n^-1*Polylogarithms.polylog(2,c*x^n)*log(f*x^m)+-1//2*b*e*m*n^-2*Polylogarithms.polylog(3,c*x^n)+-1//2*b*e*n^-1*Polylogarithms.polylog(2,-1*c*x^n)*log(f*x^m))

ext: jl

max_stars_repo_path: test/7 Inverse hyperbolic functions/7.3 Inverse hyperbolic tangent/7.3.7 Inverse hyperbolic tangent functions.jl


text:
# Read saved R datasets in the RDA2 or RDX2 format
# Files written in this format often have the extension .rda or .RData

require("gzip")
using GZip

##############################################################################
##
## A table of R's SEXPREC tags.  No longer used but good to have around.
##
##############################################################################

const SXPtab = [                        # Defined in Rinternals.h
                0x00=>"NULL",
                0x01=>"Symbol",
                0x02=>"Pairlist",
                0x03=>"Closure",
                0x04=>"Environment",
                0x05=>"Promise",
                0x06=>"Lang",
                0x07=>"Special",
                0x08=>"Builtin",
                0x09=>"Char",        # "scalar" string type (internal only)
                0x0a=>"Logical",     # almost BitArray but allows NA's
                0x0d=>"Integer",     # Array{Int32, 1}
                0x0e=>"Real",        # Array{Float64, 1}
                0x0f=>"Complex",     # Array{Complex128, 1}
                0x10=>"String",      # Array{ASCIIString, 1}
                0x11=>"Dot",         # dot-dot-dot object
                0x12=>"Any",         # make "any" args work
                0x13=>"List",        # generic vector, {} but with names
                0x14=>"Expr",        # expressions vectors
                0x15=>"ByteCode",
                0x16=>"XPtr",
                0x17=>"WeakRef",
                0x18=>"Raw",
                0x19=>"S4",
                0x1e=>"New",          # fresh node created in new page
                0x1f=>"Free",         # node released by GC
                0x63=>"Function",       # closure or builtin
                                        # Defined in serialize.c
                0xf1=>"BaseEnv",
                0xf2=>"EmptyEnv",
                0xf3=>"BCREPREF",
                0xf4=>"BCREPDEF",
                0xf5=>"GenericRef",
                0xf6=>"ClassRef",
                0xf7=>"Persist",
                0xf8=>"Package",
                0xf9=>"Namespace",
                0xfa=>"BaseNamespace",
                0xfb=>"MissingArg",
                0xfc=>"UnboundValue",
                0xfd=>"GlobalEnv",
                0xfe=>"NilValue", # terminates a pairs list?
                0xff=>"Ref"
                ]

##############################################################################
##
## Constants used as NA patterns in R.
## (I assume 1954 is the year of Ross's birth or something like that.)
##
##############################################################################

if ENDIAN_BOM == 0x01020304
    const R_NA_FLOAT64 = reinterpret(Float64, [0x7ff00000, uint32(1954)])[1]
else
    const R_NA_FLOAT64 = reinterpret(Float64, [uint32(1954), 0x7ff00000])[1]
end
const R_NA_INT32 = typemin(Int32)

##############################################################################
##
## Julia types encapsulating various types of R SEXPRECs
##
##############################################################################

typealias Hash Dict{ASCIIString, Any}
const nullhash = Hash()

abstract RSEXPREC               # Basic R object - symbolic expression

abstract RVEC <: RSEXPREC               # Vector R object

type RSymbol <: RSEXPREC        # Not quite the same as a Julia symbol
    displayname::ASCIIString
end

type RList <: RVEC                   # "list" in R == Julia cell array
    data::Array{Any, 1}
    attr::Hash
end

type RNumeric <: RVEC
    data::Array{Float64, 1}
    attr::Hash
end

type RComplex <: RVEC
    data::Array{Complex128, 1}
    attr::Hash
end

type RInteger <: RVEC
    data::Array{Int32, 1}
    attr::Hash
end

type RLogical <: RVEC
    data::BitArray{1}
    missng::BitArray{1}
    attr::Hash
end

type RString <: RVEC                    # Vector of character strings
    data::Array{ASCIIString, 1}
    missng::BitArray{1}
    attr::Hash
end

##############################################################################
##
## R objects in the file are preceded by a Uint32 giving the type and
## some flags.  These functiona unpack bits in the flags.  The isobj
## bit might be useful for distinguishing an RInteger from a factor or
## an RList from a data.frame.
##
##############################################################################

isobj(fl::Uint32) = bool(fl & 0x00000100)
hasattr(fl::Uint32) = bool(fl & 0x00000200)
hastag(fl::Uint32) = bool(fl & 0x00000400)

##############################################################################
##
## Utilities for reading a single data element - ASCII format if A
## The read<type>orNA functions are needed because the ASCII format
## stores the NA as the string 'NA'.  Perhaps it would be easier to
## wrap the conversion in a try/catch block.
##
##############################################################################

readint32(io::IO, A::Bool) = A ? int32(readline(io)) : hton(read(io, Int32))
readuint32(io::IO, A::Bool) = A ? uint32(readline(io)) : hton(read(io, Uint32))
readfloat64(io::IO, A::Bool) = A ? float64(readline(io)) : hton(read(io, Float64))

function readintorNA(io::IO, A::Bool)
    if A
        str = chomp(readline(io));
        return str == "NA" ? R_NA_INT32 : int32(str)
    end
    hton(read(io, Int32))
end

function readfloatorNA(io::IO, A::Bool)
    if A
        str = chomp(readline(io));
        return str == "NA" ? R_NA_FLOAT64 : float64(str)
    end
    hton(read(io, Float64))
end

function InputChar(io::IO, fl::Uint32, A::Bool)  # a single character string
    @assert uint8(fl) ==  0x09
    ## levs = uint16(fl >> 12)
### watch out for levs in here.  Generally it has the value 0x40 so that fl = 0x00040009 (262153)
### if levs == 0x00 then the next line should be -1 to indicate the NA_STRING
    nchar = readuint32(io, A)
    if A
        str = unescape_string(chomp(readline(io)))
        return length(str) == nchar ? str : error("Character string length mismatch")
    end
    bytestring(read(io, Array(Uint8, nchar)))
end

function namedobjects(io::IO, fl::Uint32, A::Bool, symtab::Array{RSymbol,1})
    if !hasattr(fl) return nullhash end
    res = Hash()
    fl = readuint32(io,A)
    while uint8(fl) != 0xfe
        ## need to call RSymbol here b/c of symbol reference table
        nm = RSymbol(io, readuint32(io, A), A, symtab).displayname
        assign(res, readitem(io, A, symtab), nm)
        fl = readuint32(io, A)
    end
    res
end

function RNumeric(io::IO, fl::Uint32, A::Bool, symtab::Array{RSymbol,1})
    @assert uint8(fl) == 0x0e
    n = readuint32(io, A)
    RNumeric([readfloatorNA(io, A)::Float64 for i in 1:n],
             namedobjects(io, fl, A, symtab))
end

function RInteger(io::IO, fl::Uint32, A::Bool, symtab::Array{RSymbol,1})
    @assert uint8(fl) == 0x0d
    n = readint32(io, A)
    RInteger([readintorNA(io, A)::Int32 for i in 1:n],
             namedobjects(io, fl, A, symtab))
end

function RLogical(io::IO, fl::Uint32, A::Bool, symtab::Array{RSymbol,1})
    @assert uint8(fl) == 0x0a
    n = readuint32(io, A)
    rr = [readintorNA(io, A)::Int32 for i in 1:n]
    RLogical(convert(BitArray{1}, rr), convert(BitArray{1}, rr .== R_NA_INTEGER),
             namedobjects(io, fl, A, symtab))
end

function RComplex(io::IO, fl::Uint32, A::Bool, symtab::Array{RSymbol,1})
    @assert uint8(fl) == 0x0f
    n = readuint32(io, A)
    RComplex([(readfloatorNA(io,A) + readfloatorNA(io, A)*im)::Complex128 for i in 1:n],
             namedobjects(io, fl, A, symtab))
end

function RString(io::IO, fl::Uint32, A::Bool, symtab::Array{RSymbol,1})
    @assert uint8(fl) == 0x10
    n = readuint32(io, A)
    data = Array(ASCIIString, n)
    for i in 1:n
        fl1 = readuint32(io, A)
        data[i] = InputChar(io, fl1, A)
    end
    RString(data, falses(int(n)), namedobjects(io, fl, A, symtab))
end

function RList(io::IO, fl::Uint32, A::Bool, symtab::Array{RSymbol,1})
    @assert uint8(fl) == 0x13
    n = readuint32(io, A)
    RList([readitem(io, A, symtab) for i in 1:n], namedobjects(io, fl, A, symtab))
end

function RSymbol(io::IO, fl::Uint32, A::Bool, symtab::Array{RSymbol,1})
    if uint8(fl) == 0xff return symtab[fl >> 8] end
    @assert uint8(fl) == 0x01
    res = RSymbol(InputChar(io, readuint32(io, A), A))
    push!(symtab, res)
    res
end

function readitem(io::IO, A::Bool, symtab::Array{RSymbol,1})
    ff = readuint32(io, A)
    fl = uint8(ff)
    if fl == 0x01 return RSymbol(io, ff, A, symtab) end
    if fl == 0x0a return RLogical(io, ff, A, symtab) end
    if fl == 0x0d return RInteger(io, ff, A, symtab) end
    if fl == 0x0e return RNumeric(io, ff, A, symtab) end
    if fl == 0x0f return RComplex(io, ff, A, symtab) end
    if fl == 0x10 return RString(io, ff, A, symtab) end
    if fl == 0x13 return RList(io, ff, A, symtab) end
### Should not occur at the top level
###    if fl == 0xf3 return nothing end      # terminates dotted pair lists
###    if fl == 0x09 return InputChar(io, ff, A) end
    error("Encountered flag $ff corresponding to type $(SXPtab[fl])")
end

function read_rda(io::IO)
    header = chomp(readline(io))
    @assert header[1] == 'R' # readable header (or RDX2)
    @assert header[2] == 'D'
    @assert header[4] == '2'
    A = chomp(readline(io)) == "A"
    @assert readint32(io, A) == 2    # format version
    symtab = Array(RSymbol,0)
    Rver = readint32(io, A)
    println("Written by version $(div(Rver,65536)).$(div(Rver%65536, 256)).$(Rver%256)")
    Rmin = readint32(io, A)
    println("Minimal R version: $(div(Rmin,65536)).$(div(Rmin%65536, 256)).$(Rmin%256)")
    namedobjects(io, 0x00000200, A, symtab)
end

read_rda(fnm::ASCIIString) = gzopen(read_rda, fnm)

size(rv::RVEC) = size(rv.data)
size(rl::RList) = inherits(rl, "dataframe") ? (length(rl.data[1]), length(rl.data)) : length(rl.data)
length(rl::RList) = length(rl.data)
length(ri::RInteger) = length(ri.data)
length(rn::RNumeric) = length(rn.data)
class(v::RVEC) = has(v.attr, "class") ? v.attr["class"].data : Array(ASCIIString,0)
class(x) = Array(ASCIIString, 0)
inherits(x, clnm::ASCIIString) = any(class(x) .== clnm)

names(v::RVEC) = has(v.attr, "names") ? v.attr["names"].data : Array(ASCIIString,0)
row_names(v::RVEC) = has(v.attr, "row.names") ? v.attr["row.names"].data : Array(ASCIIString,0)

data(rl::RLogical) = DataArray(rl.data, rl.missng)
data(rn::RNumeric) = DataArray(rn.data, rn.data .== R_NA_FLOAT64)
function data(ri::RInteger)
    inherits(ri, "factor") ? PooledDataArray(uint16(ri.data), ri.attr["levels"].data) :
    DataArray(ri.data, ri.data .== R_NA_INT32)
end

data(rs::RString) = DataArray(rs.data, falses(length(rs.data)))
function data(rc::RComplex)
    DataArray(rc.data, BitArray(real(rc.data) .== R_NA_FLOAT64) |
              BitArray(imag(rc.data) .== R_NA_FLOAT64))
end

DataFrame(rl::RList) = DataFrame(map(x->data(x), rl.data), rl.attr["names"].data)


text:
module TestTypeDef
    using Base.Test
    using CategoricalArrays
    using CategoricalArrays: DefaultRefType

    pool = CategoricalPool(
        [
            "a",
            "b",
            "c"
        ],
        Dict(
            "a" => DefaultRefType(1),
            "b" => DefaultRefType(2),
            "c" => DefaultRefType(3),
        )
    )

    @test isa(pool, CategoricalPool)

    @test isa(pool.index, Vector)
    @test length(pool.index) == 3
    @test pool.index[1] == "a"
    @test pool.index[2] == "b"
    @test pool.index[3] == "c"

    @test isa(pool.invindex, Dict)
    @test length(pool.invindex) == 3
    @test pool.invindex["a"] === DefaultRefType(1)
    @test pool.invindex["b"] === DefaultRefType(2)
    @test pool.invindex["c"] === DefaultRefType(3)

    @test isa(pool.order, Vector{DefaultRefType})
    @test length(pool.order) == 3
    @test pool.order[1] === DefaultRefType(1)
    @test pool.order[2] === DefaultRefType(2)
    @test pool.order[3] === DefaultRefType(3)

    for i in 1:3
        x = CategoricalValue(i, pool)

        @test isa(x, CategoricalValue)

        @test isa(x.level, DefaultRefType)
        @test x.level === DefaultRefType(i)

        @test isa(x.pool, CategoricalPool)
        @test x.pool === pool
    end

    pool = CategoricalPool(
        [
            "a",
            "b",
            "c"
        ],
        Dict(
            "a" => DefaultRefType(1),
            "b" => DefaultRefType(2),
            "c" => DefaultRefType(3),
        ),
        [
            DefaultRefType(3),
            DefaultRefType(2),
            DefaultRefType(1),
        ]
    )

    @test isa(pool, CategoricalPool)

    @test isa(pool.index, Vector)
    @test length(pool.index) == 3
    @test pool.index[1] == "a"
    @test pool.index[2] == "b"
    @test pool.index[3] == "c"

    @test isa(pool.invindex, Dict)
    @test length(pool.invindex) == 3
    @test pool.invindex["a"] === DefaultRefType(1)
    @test pool.invindex["b"] === DefaultRefType(2)
    @test pool.invindex["c"] === DefaultRefType(3)

    @test isa(pool.order, Vector{DefaultRefType})
    @test length(pool.order) == 3
    @test pool.order[1] === DefaultRefType(3)
    @test pool.order[2] === DefaultRefType(2)
    @test pool.order[3] === DefaultRefType(1)

    for i in 1:3
        y = CategoricalValue(i, pool)

        @test isa(y, CategoricalValue)

        @test isa(y.level, DefaultRefType)
        @test y.level === DefaultRefType(i)

        @test isa(y.pool, CategoricalPool)
        @test y.pool === pool
    end
end