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

@test integrate(x^5*arccoth(a*x), x) == :(-1//6*a^-6*arctanh(a*x)+1//6*x*a^-5+1//6*x^6*arccoth(a*x)+1//18*a^-3*x^3+1//30*a^-1*x^5)
@test integrate(x^4*arccoth(a*x), x) == :(1//5*x^5*arccoth(a*x)+1//10*a^-5*log(1+-1*a^2*x^2)+1//10*a^-3*x^2+1//20*a^-1*x^4)
@test integrate(x^3*arccoth(a*x), x) == :(-1//4*a^-4*arctanh(a*x)+1//4*x*a^-3+1//4*x^4*arccoth(a*x)+1//12*a^-1*x^3)
@test integrate(x^2*arccoth(a*x), x) == :(1//3*x^3*arccoth(a*x)+1//6*a^-1*x^2+1//6*a^-3*log(1+-1*a^2*x^2))
@test integrate(x*arccoth(a*x), x) == :((1/2)*x*a^-1+(1/2)*x^2*arccoth(a*x)+-1//2*a^-2*arctanh(a*x))
@test integrate(arccoth(a*x), x) == :(x*arccoth(a*x)+(1/2)*a^-1*log(1+-1*a^2*x^2))
@test integrate(x^-1*arccoth(a*x), x) == :((1/2)*Polylogarithms.polylog(2,-1*a^-1*x^-1)+-1//2*Polylogarithms.polylog(2,a^-1*x^-1))
@test integrate(x^-2*arccoth(a*x), x) == :(a*log(x)+-1*x^-1*arccoth(a*x)+-1//2*a*log(1+-1*a^2*x^2))
@test integrate(x^-3*arccoth(a*x), x) == :((1/2)*a^2*arctanh(a*x)+-1//2*a*x^-1+-1//2*x^-2*arccoth(a*x))
@test integrate(x^-4*arccoth(a*x), x) == :(-1//3*x^-3*arccoth(a*x)+-1//6*a*x^-2+-1//6*a^3*log(1+-1*a^2*x^2)+1//3*a^3*log(x))
@test integrate(x^-5*arccoth(a*x), x) == :(-1//4*a^3*x^-1+-1//4*x^-4*arccoth(a*x)+-1//12*a*x^-3+1//4*a^4*arctanh(a*x))
@test integrate(x^5*arccoth(a*x)^2, x) == :(-1//6*a^-6*arccoth(a*x)^2+1//6*x^6*arccoth(a*x)^2+1//60*a^-2*x^4+4//45*a^-4*x^2+23//90*a^-6*log(1+-1*a^2*x^2)+1//3*x*a^-5*arccoth(a*x)+1//9*a^-3*x^3*arccoth(a*x)+1//15*a^-1*x^5*arccoth(a*x))
@test integrate(x^4*arccoth(a*x)^2, x) == :(-3//10*a^-5*arctanh(a*x)+-1//5*a^-5*Polylogarithms.polylog(2,1+-2*(1+-1*a*x)^-1)+1//5*a^-5*arccoth(a*x)^2+1//5*x^5*arccoth(a*x)^2+1//30*a^-2*x^3+3//10*x*a^-4+-2//5*a^-5*arccoth(a*x)*log(2*(1+-1*a*x)^-1)+1//5*a^-3*x^2*arccoth(a*x)+1//10*a^-1*x^4*arccoth(a*x))
@test integrate(x^3*arccoth(a*x)^2, x) == :(-1//4*a^-4*arccoth(a*x)^2+1//3*a^-4*log(1+-1*a^2*x^2)+1//4*x^4*arccoth(a*x)^2+1//12*a^-2*x^2+(1/2)*x*a^-3*arccoth(a*x)+1//6*a^-1*x^3*arccoth(a*x))
@test integrate(x^2*arccoth(a*x)^2, x) == :(-1//3*a^-3*Polylogarithms.polylog(2,1+-2*(1+-1*a*x)^-1)+-1//3*a^-3*arctanh(a*x)+1//3*x*a^-2+1//3*a^-3*arccoth(a*x)^2+1//3*x^3*arccoth(a*x)^2+-2//3*a^-3*arccoth(a*x)*log(2*(1+-1*a*x)^-1)+1//3*a^-1*x^2*arccoth(a*x))
@test integrate(x*arccoth(a*x)^2, x) == :((1/2)*a^-2*log(1+-1*a^2*x^2)+(1/2)*x^2*arccoth(a*x)^2+-1//2*a^-2*arccoth(a*x)^2+x*a^-1*arccoth(a*x))
@test integrate(arccoth(a*x)^2, x) == :(x*arccoth(a*x)^2+a^-1*arccoth(a*x)^2+-1*a^-1*Polylogarithms.polylog(2,1+-2*(1+-1*a*x)^-1)+-2*a^-1*arccoth(a*x)*log(2*(1+-1*a*x)^-1))
@test integrate(x^-1*arccoth(a*x)^2, x) == :((1/2)*Polylogarithms.polylog(3,1+-2*(1+a*x)^-1)+-1//2*Polylogarithms.polylog(3,1+-2*a*x*(1+a*x)^-1)+Polylogarithms.polylog(2,1+-2*(1+a*x)^-1)*arccoth(a*x)+-1*Polylogarithms.polylog(2,1+-2*a*x*(1+a*x)^-1)*arccoth(a*x)+2*arccoth(a*x)^2*arccoth(1+-2*(1+-1*a*x)^-1))
@test integrate(x^-2*arccoth(a*x)^2, x) == :(a*arccoth(a*x)^2+-1*a*Polylogarithms.polylog(2,-1+2*(1+a*x)^-1)+-1*x^-1*arccoth(a*x)^2+2*a*arccoth(a*x)*log(2+-2*(1+a*x)^-1))
@test integrate(x^-3*arccoth(a*x)^2, x) == :(a^2*log(x)+(1/2)*a^2*arccoth(a*x)^2+-1//2*a^2*log(1+-1*a^2*x^2)+-1//2*x^-2*arccoth(a*x)^2+-1*a*x^-1*arccoth(a*x))
@test integrate(x^-4*arccoth(a*x)^2, x) == :(-1//3*a^2*x^-1+-1//3*a^3*Polylogarithms.polylog(2,-1+2*(1+a*x)^-1)+-1//3*x^-3*arccoth(a*x)^2+1//3*a^3*arccoth(a*x)^2+1//3*a^3*arctanh(a*x)+-1//3*a*x^-2*arccoth(a*x)+2//3*a^3*arccoth(a*x)*log(2+-2*(1+a*x)^-1))
@test integrate(x^-5*arccoth(a*x)^2, x) == :(-1//3*a^4*log(1+-1*a^2*x^2)+-1//4*x^-4*arccoth(a*x)^2+-1//12*a^2*x^-2+1//4*a^4*arccoth(a*x)^2+2//3*a^4*log(x)+-1//2*a^3*x^-1*arccoth(a*x)+-1//6*a*x^-3*arccoth(a*x))
@test integrate(x^5*arccoth(a*x)^3, x) == :(-23//30*a^-6*Polylogarithms.polylog(2,1+-2*(1+-1*a*x)^-1)+-19//60*a^-6*arctanh(a*x)+-1//6*a^-6*arccoth(a*x)^3+1//6*x^6*arccoth(a*x)^3+1//60*a^-3*x^3+19//60*x*a^-5+23//30*a^-6*arccoth(a*x)^2+(1/2)*x*a^-5*arccoth(a*x)^2+-23//15*a^-6*arccoth(a*x)*log(2*(1+-1*a*x)^-1)+1//6*a^-3*x^3*arccoth(a*x)^2+1//10*a^-1*x^5*arccoth(a*x)^2+1//20*a^-2*x^4*arccoth(a*x)+4//15*a^-4*x^2*arccoth(a*x))
@test integrate(x^4*arccoth(a*x)^3, x) == :((1/2)*a^-5*log(1+-1*a^2*x^2)+-9//20*a^-5*arccoth(a*x)^2+1//5*a^-5*arccoth(a*x)^3+1//5*x^5*arccoth(a*x)^3+1//20*a^-3*x^2+3//10*a^-5*Polylogarithms.polylog(3,1+-2*(1+-1*a*x)^-1)+-3//5*a^-5*arccoth(a*x)^2*log(2*(1+-1*a*x)^-1)+-3//5*a^-5*Polylogarithms.polylog(2,1+-2*(1+-1*a*x)^-1)*arccoth(a*x)+1//10*a^-2*x^3*arccoth(a*x)+3//10*a^-3*x^2*arccoth(a*x)^2+3//20*a^-1*x^4*arccoth(a*x)^2+9//10*x*a^-4*arccoth(a*x))
@test integrate(x^3*arccoth(a*x)^3, x) == :(a^-4*arccoth(a*x)^2+-1*a^-4*Polylogarithms.polylog(2,1+-2*(1+-1*a*x)^-1)+-1//4*a^-4*arccoth(a*x)^3+-1//4*a^-4*arctanh(a*x)+1//4*x*a^-3+1//4*x^4*arccoth(a*x)^3+-2*a^-4*arccoth(a*x)*log(2*(1+-1*a*x)^-1)+1//4*a^-1*x^3*arccoth(a*x)^2+1//4*a^-2*x^2*arccoth(a*x)+3//4*x*a^-3*arccoth(a*x)^2)
@test integrate(x^2*arccoth(a*x)^3, x) == :((1/2)*a^-3*Polylogarithms.polylog(3,1+-2*(1+-1*a*x)^-1)+(1/2)*a^-3*log(1+-1*a^2*x^2)+-1//2*a^-3*arccoth(a*x)^2+1//3*a^-3*arccoth(a*x)^3+1//3*x^3*arccoth(a*x)^3+x*a^-2*arccoth(a*x)+(1/2)*a^-1*x^2*arccoth(a*x)^2+-1*a^-3*arccoth(a*x)^2*log(2*(1+-1*a*x)^-1)+-1*a^-3*Polylogarithms.polylog(2,1+-2*(1+-1*a*x)^-1)*arccoth(a*x))
@test integrate(x*arccoth(a*x)^3, x) == :((1/2)*x^2*arccoth(a*x)^3+-3//2*a^-2*Polylogarithms.polylog(2,1+-2*(1+-1*a*x)^-1)+-1//2*a^-2*arccoth(a*x)^3+3//2*a^-2*arccoth(a*x)^2+-3*a^-2*arccoth(a*x)*log(2*(1+-1*a*x)^-1)+3//2*x*a^-1*arccoth(a*x)^2)
@test integrate(arccoth(a*x)^3, x) == :(x*arccoth(a*x)^3+a^-1*arccoth(a*x)^3+3//2*a^-1*Polylogarithms.polylog(3,1+-2*(1+-1*a*x)^-1)+-3*a^-1*arccoth(a*x)^2*log(2*(1+-1*a*x)^-1)+-3*a^-1*Polylogarithms.polylog(2,1+-2*(1+-1*a*x)^-1)*arccoth(a*x))
@test integrate(x^-1*arccoth(a*x)^3, x) == :(-3//4*Polylogarithms.polylog(4,1+-2*a*x*(1+a*x)^-1)+3//4*Polylogarithms.polylog(4,1+-2*(1+a*x)^-1)+2*arccoth(a*x)^3*arccoth(1+-2*(1+-1*a*x)^-1)+-3//2*arccoth(a*x)^2*Polylogarithms.polylog(2,1+-2*a*x*(1+a*x)^-1)+-3//2*Polylogarithms.polylog(3,1+-2*a*x*(1+a*x)^-1)*arccoth(a*x)+3//2*arccoth(a*x)^2*Polylogarithms.polylog(2,1+-2*(1+a*x)^-1)+3//2*Polylogarithms.polylog(3,1+-2*(1+a*x)^-1)*arccoth(a*x))
@test integrate(x^-2*arccoth(a*x)^3, x) == :(a*arccoth(a*x)^3+-1*x^-1*arccoth(a*x)^3+-3//2*a*Polylogarithms.polylog(3,-1+2*(1+a*x)^-1)+-3*a*Polylogarithms.polylog(2,-1+2*(1+a*x)^-1)*arccoth(a*x)+3*a*arccoth(a*x)^2*log(2+-2*(1+a*x)^-1))
@test integrate(x^-3*arccoth(a*x)^3, x) == :((1/2)*a^2*arccoth(a*x)^3+-3//2*a^2*Polylogarithms.polylog(2,-1+2*(1+a*x)^-1)+-1//2*x^-2*arccoth(a*x)^3+3//2*a^2*arccoth(a*x)^2+3*a^2*arccoth(a*x)*log(2+-2*(1+a*x)^-1)+-3//2*a*x^-1*arccoth(a*x)^2)
@test integrate(x^-4*arccoth(a*x)^3, x) == :(a^3*log(x)+(1/2)*a^3*arccoth(a*x)^2+-1//2*a^3*Polylogarithms.polylog(3,-1+2*(1+a*x)^-1)+-1//2*a^3*log(1+-1*a^2*x^2)+-1//3*x^-3*arccoth(a*x)^3+1//3*a^3*arccoth(a*x)^3+a^3*arccoth(a*x)^2*log(2+-2*(1+a*x)^-1)+-1*a^2*x^-1*arccoth(a*x)+-1*a^3*Polylogarithms.polylog(2,-1+2*(1+a*x)^-1)*arccoth(a*x)+-1//2*a*x^-2*arccoth(a*x)^2)
@test integrate(x^-5*arccoth(a*x)^3, x) == :(a^4*arccoth(a*x)^2+-1*a^4*Polylogarithms.polylog(2,-1+2*(1+a*x)^-1)+-1//4*a^3*x^-1+-1//4*x^-4*arccoth(a*x)^3+1//4*a^4*arccoth(a*x)^3+1//4*a^4*arctanh(a*x)+2*a^4*arccoth(a*x)*log(2+-2*(1+a*x)^-1)+-3//4*a^3*x^-1*arccoth(a*x)^2+-1//4*a*x^-3*arccoth(a*x)^2+-1//4*a^2*x^-2*arccoth(a*x))
@test integrate((d+e*x)^-1*arccoth(c*x)^2, x) == :((1/2)*e^-1*Polylogarithms.polylog(3,1+-2*(1+c*x)^-1)+-1//2*e^-1*Polylogarithms.polylog(3,1+-2*c*(1+c*x)^-1*(e+c*d)^-1*(d+e*x))+e^-1*arccoth(c*x)^2*log(2*c*(1+c*x)^-1*(e+c*d)^-1*(d+e*x))+e^-1*Polylogarithms.polylog(2,1+-2*(1+c*x)^-1)*arccoth(c*x)+-1*e^-1*arccoth(c*x)^2*log(2*(1+c*x)^-1)+-1*e^-1*Polylogarithms.polylog(2,1+-2*c*(1+c*x)^-1*(e+c*d)^-1*(d+e*x))*arccoth(c*x))
@test integrate((c+d*x^2)^4*arccoth(a*x), x) == :(x*c^4*arccoth(a*x)+1//9*d^4*x^9*arccoth(a*x)+1//72*a^-1*d^4*x^8+1//630*a^-9*(35*d^4+315*a^8*c^4+180*c*a^2*d^3+378*a^4*c^2*d^2+420*d*a^6*c^3)*log(1+-1*a^2*x^2)+1//378*a^-3*d^3*x^6*(7d+36*c*a^2)+1//630*d*a^-7*x^2*(35*d^3+420*a^6*c^3+180*c*a^2*d^2+378*d*a^4*c^2)+1//1260*a^-5*d^2*x^4*(35*d^2+378*a^4*c^2+180*c*d*a^2)+4//3*d*c^3*x^3*arccoth(a*x)+4//7*c*d^3*x^7*arccoth(a*x)+6//5*c^2*d^2*x^5*arccoth(a*x))
@test integrate((c+d*x^2)^3*arccoth(a*x), x) == :(x*c^3*arccoth(a*x)+1//7*d^3*x^7*arccoth(a*x)+1//42*a^-1*d^3*x^6+1//70*a^-7*(5*d^3+35*a^6*c^3+21*c*a^2*d^2+35*d*a^4*c^2)*log(1+-1*a^2*x^2)+d*c^2*x^3*arccoth(a*x)+1//70*d*a^-5*x^2*(5*d^2+35*a^4*c^2+21*c*d*a^2)+1//140*a^-3*d^2*x^4*(5d+21*c*a^2)+3//5*c*d^2*x^5*arccoth(a*x))
@test integrate((c+d*x^2)^2*arccoth(a*x), x) == :(x*c^2*arccoth(a*x)+1//5*d^2*x^5*arccoth(a*x)+1//20*a^-1*d^2*x^4+1//30*a^-5*(3*d^2+15*a^4*c^2+10*c*d*a^2)*log(1+-1*a^2*x^2)+1//30*d*a^-3*x^2*(3d+10*c*a^2)+2//3*c*d*x^3*arccoth(a*x))
@test integrate((c+d*x^2)*arccoth(a*x), x) == :(c*x*arccoth(a*x)+1//3*d*x^3*arccoth(a*x)+1//6*d*a^-1*x^2+1//6*a^-3*(d+3*c*a^2)*log(1+-1*a^2*x^2))
@test integrate((c+d*x^2)^-1*arccoth(a*x), x) == :((1/2)*c^-1//2*d^-1//2*arctan(x*c^-1//2*d^(1/2))*log(-2*c^(1/2)*d^(1/2)*(c^(1/2)+-1*im*x*d^(1/2))^-1*(-1*d^(1/2)+im*a*c^(1/2))^-1*(1+-1*a*x))+(1/2)*c^-1//2*d^-1//2*arctan(x*c^-1//2*d^(1/2))*log(1+a^-1*x^-1)+-1//2*c^-1//2*d^-1//2*arctan(x*c^-1//2*d^(1/2))*log(2*c^(1/2)*d^(1/2)*(c^(1/2)+-1*im*x*d^(1/2))^-1*(d^(1/2)+im*a*c^(1/2))^-1*(1+a*x))+-1//2*c^-1//2*d^-1//2*arctan(x*c^-1//2*d^(1/2))*log(1+-1*a^-1*x^-1)+-1//4*im*c^-1//2*d^-1//2*Polylogarithms.polylog(2,1+2*c^(1/2)*d^(1/2)*(c^(1/2)+-1*im*x*d^(1/2))^-1*(-1*d^(1/2)+im*a*c^(1/2))^-1*(1+-1*a*x))+1//4*im*c^-1//2*d^-1//2*Polylogarithms.polylog(2,1+-2*c^(1/2)*d^(1/2)*(c^(1/2)+-1*im*x*d^(1/2))^-1*(d^(1/2)+im*a*c^(1/2))^-1*(1+a*x)))
@test integrate((c+d*x^2)^-2*arccoth(a*x), x) == :((1/2)*x*c^-1*(c+d*x^2)^-1*arccoth(a*x)+(1/2)*c^-3//2*d^-1//2*arccoth(a*x)*arctan(x*c^-1//2*d^(1/2))+-1//4*a*c^-1*(d+c*a^2)^-1*log(c+d*x^2)+-1//8*im*c^-3//2*d^-1//2*Polylogarithms.polylog(2,a*(im*d^(1/2)+a*c^(1/2))^-1*(c^(1/2)+im*x*d^(1/2)))+-1//8*im*c^-3//2*d^-1//2*Polylogarithms.polylog(2,a*(im*d^(1/2)+a*c^(1/2))^-1*(c^(1/2)+-1*im*x*d^(1/2)))+1//4*a*c^-1*(d+c*a^2)^-1*log(1+-1*a^2*x^2)+1//8*im*c^-3//2*d^-1//2*Polylogarithms.polylog(2,a*(a*c^(1/2)+-1*im*d^(1/2))^-1*(c^(1/2)+im*x*d^(1/2)))+1//8*im*c^-3//2*d^-1//2*Polylogarithms.polylog(2,a*(a*c^(1/2)+-1*im*d^(1/2))^-1*(c^(1/2)+-1*im*x*d^(1/2)))+-1//8*im*c^-3//2*d^-1//2*log(-1*d^(1/2)*(-1*d^(1/2)+im*a*c^(1/2))^-1*(1+a*x))*log(1+-1*im*x*c^-1//2*d^(1/2))+-1//8*im*c^-3//2*d^-1//2*log(-1*d^(1/2)*(-1*d^(1/2)+im*a*c^(1/2))^-1*(1+-1*a*x))*log(1+im*x*c^-1//2*d^(1/2))+1//8*im*c^-3//2*d^-1//2*log(d^(1/2)*(d^(1/2)+im*a*c^(1/2))^-1*(1+a*x))*log(1+im*x*c^-1//2*d^(1/2))+1//8*im*c^-3//2*d^-1//2*log(d^(1/2)*(d^(1/2)+im*a*c^(1/2))^-1*(1+-1*a*x))*log(1+-1*im*x*c^-1//2*d^(1/2)))
@test integrate((c+d*x^2)^-3*arccoth(a*x), x) == :(-3//32*im*c^-5//2*d^-1//2*Polylogarithms.polylog(2,a*(im*d^(1/2)+a*c^(1/2))^-1*(c^(1/2)+im*x*d^(1/2)))+-3//32*im*c^-5//2*d^-1//2*Polylogarithms.polylog(2,a*(im*d^(1/2)+a*c^(1/2))^-1*(c^(1/2)+-1*im*x*d^(1/2)))+1//4*x*c^-1*(c+d*x^2)^-2*arccoth(a*x)+1//8*a*c^-1*(c+d*x^2)^-1*(d+c*a^2)^-1+3//8*x*c^-2*(c+d*x^2)^-1*arccoth(a*x)+3//8*c^-5//2*d^-1//2*arccoth(a*x)*arctan(x*c^-1//2*d^(1/2))+3//32*im*c^-5//2*d^-1//2*Polylogarithms.polylog(2,a*(a*c^(1/2)+-1*im*d^(1/2))^-1*(c^(1/2)+im*x*d^(1/2)))+3//32*im*c^-5//2*d^-1//2*Polylogarithms.polylog(2,a*(a*c^(1/2)+-1*im*d^(1/2))^-1*(c^(1/2)+-1*im*x*d^(1/2)))+-3//32*im*c^-5//2*d^-1//2*log(-1*d^(1/2)*(-1*d^(1/2)+im*a*c^(1/2))^-1*(1+a*x))*log(1+-1*im*x*c^-1//2*d^(1/2))+-3//32*im*c^-5//2*d^-1//2*log(-1*d^(1/2)*(-1*d^(1/2)+im*a*c^(1/2))^-1*(1+-1*a*x))*log(1+im*x*c^-1//2*d^(1/2))+-1//16*a*c^-2*(d+c*a^2)^-2*(3d+5*c*a^2)*log(c+d*x^2)+1//16*a*c^-2*(d+c*a^2)^-2*(3d+5*c*a^2)*log(1+-1*a^2*x^2)+3//32*im*c^-5//2*d^-1//2*log(d^(1/2)*(d^(1/2)+im*a*c^(1/2))^-1*(1+a*x))*log(1+im*x*c^-1//2*d^(1/2))+3//32*im*c^-5//2*d^-1//2*log(d^(1/2)*(d^(1/2)+im*a*c^(1/2))^-1*(1+-1*a*x))*log(1+-1*im*x*c^-1//2*d^(1/2)))
@test integrate((c+d*x^2)^-3//2*arccoth(a*x), x) == :(-1*c^-1*(d+c*a^2)^-1//2*arctanh(a*(c+d*x^2)^(1/2)*(d+c*a^2)^-1//2)+x*c^-1*(c+d*x^2)^-1//2*arccoth(a*x))
@test integrate((c+d*x^2)^-5//2*arccoth(a*x), x) == :(-1//3*c^-2*(d+c*a^2)^-3//2*(2d+3*c*a^2)*arctanh(a*(c+d*x^2)^(1/2)*(d+c*a^2)^-1//2)+1//3*a*c^-1*(c+d*x^2)^-1//2*(d+c*a^2)^-1+1//3*x*c^-1*(c+d*x^2)^-3//2*arccoth(a*x)+2//3*x*c^-2*(c+d*x^2)^-1//2*arccoth(a*x))
@test integrate((c+d*x^2)^-7//2*arccoth(a*x), x) == :(-1//15*c^-3*(d+c*a^2)^-5//2*(8*d^2+15*a^4*c^2+20*c*d*a^2)*arctanh(a*(c+d*x^2)^(1/2)*(d+c*a^2)^-1//2)+1//5*x*c^-1*(c+d*x^2)^-5//2*arccoth(a*x)+1//15*a*c^-1*(c+d*x^2)^-3//2*(d+c*a^2)^-1+4//15*x*c^-2*(c+d*x^2)^-3//2*arccoth(a*x)+8//15*x*c^-3*(c+d*x^2)^-1//2*arccoth(a*x)+1//15*a*c^-2*(c+d*x^2)^-1//2*(d+c*a^2)^-2*(4d+7*c*a^2))
@test integrate((c+d*x^2)^-9//2*arccoth(a*x), x) == :(-1//35*c^-4*(d+c*a^2)^-7//2*(16*d^3+35*a^6*c^3+56*c*a^2*d^2+70*d*a^4*c^2)*arctanh(a*(c+d*x^2)^(1/2)*(d+c*a^2)^-1//2)+1//7*x*c^-1*(c+d*x^2)^-7//2*arccoth(a*x)+1//35*a*c^-1*(c+d*x^2)^-5//2*(d+c*a^2)^-1+6//35*x*c^-2*(c+d*x^2)^-5//2*arccoth(a*x)+8//35*x*c^-3*(c+d*x^2)^-3//2*arccoth(a*x)+16//35*x*c^-4*(c+d*x^2)^-1//2*arccoth(a*x)+1//35*a*c^-3*(c+d*x^2)^-1//2*(d+c*a^2)^-3*(8*d^2+19*a^4*c^2+22*c*d*a^2)+1//105*a*c^-2*(c+d*x^2)^-3//2*(d+c*a^2)^-2*(6d+11*c*a^2))
@test integrate((a+-1*a*x^2)^(1/2)*arccoth(x), x) == :((1/2)*(a+-1*a*x^2)^(1/2)+(1/2)*x*(a+-1*a*x^2)^(1/2)*arccoth(x)+(1/2)*im*a*(1+-1*x^2)^(1/2)*(a+-1*a*x^2)^-1//2*Polylogarithms.polylog(2,im*(1+x)^-1//2*(1+-1x)^(1/2))+-1*a*(1+-1*x^2)^(1/2)*(a+-1*a*x^2)^-1//2*arccoth(x)*arctan((1+x)^-1//2*(1+-1x)^(1/2))+-1//2*im*a*(1+-1*x^2)^(1/2)*(a+-1*a*x^2)^-1//2*Polylogarithms.polylog(2,-1*im*(1+x)^-1//2*(1+-1x)^(1/2)))
@test integrate((a+-1*a*x^2)^-1//2*arccoth(x), x) == :(im*(1+-1*x^2)^(1/2)*(a+-1*a*x^2)^-1//2*Polylogarithms.polylog(2,im*(1+x)^-1//2*(1+-1x)^(1/2))+-1*im*(1+-1*x^2)^(1/2)*(a+-1*a*x^2)^-1//2*Polylogarithms.polylog(2,-1*im*(1+x)^-1//2*(1+-1x)^(1/2))+-2*(1+-1*x^2)^(1/2)*(a+-1*a*x^2)^-1//2*arccoth(x)*arctan((1+x)^-1//2*(1+-1x)^(1/2)))
@test integrate((a+-1*a*x^2)^-3//2*arccoth(x), x) == :(-1*a^-1*(a+-1*a*x^2)^-1//2+x*a^-1*(a+-1*a*x^2)^-1//2*arccoth(x))
@test integrate((a+-1*a*x^2)^-5//2*arccoth(x), x) == :(-2//3*a^-2*(a+-1*a*x^2)^-1//2+-1//9*a^-1*(a+-1*a*x^2)^-3//2+1//3*x*a^-1*(a+-1*a*x^2)^-3//2*arccoth(x)+2//3*x*a^-2*(a+-1*a*x^2)^-1//2*arccoth(x))
@test integrate((a+-1*a*x^2)^-7//2*arccoth(x), x) == :(-8//15*a^-3*(a+-1*a*x^2)^-1//2+-4//45*a^-2*(a+-1*a*x^2)^-3//2+-1//25*a^-1*(a+-1*a*x^2)^-5//2+1//5*x*a^-1*(a+-1*a*x^2)^-5//2*arccoth(x)+4//15*x*a^-2*(a+-1*a*x^2)^-3//2*arccoth(x)+8//15*x*a^-3*(a+-1*a*x^2)^-1//2*arccoth(x))
@test integrate((1+-1*x^2)^-1*arccoth(x)^-1, x) == :(log(arccoth(x)))
@test integrate((1+-1*x^2)^-1*arccoth(x)^n, x) == :((1+n)^-1*arccoth(x)^(1+n))
@test integrate((1+-1*x^2)^-2*arccoth(x)^2, x) == :(1//4*arctanh(x)+1//6*arccoth(x)^3+x*(4+-4*x^2)^-1+-1*(2+-2*x^2)^-1*arccoth(x)+x*(2+-2*x^2)^-1*arccoth(x)^2)
@test integrate(x*(1+-1*x^2)^-1*arccoth(x), x) == :((1/2)*Polylogarithms.polylog(2,(-1+x)^-1*(1+x))+-1//2*arccoth(x)^2+arccoth(x)*log(2*(1+-1x)^-1))
@test integrate((1+-1*x^2)^-1*arccoth(x), x) == :((1/2)*arccoth(x)^2)
@test integrate(x*(1+-1*x^2)^-2*arccoth(x), x) == :(-1//4*arctanh(x)+(2+-2*x^2)^-1*arccoth(x)+-1*x*(4+-4*x^2)^-1)
@test integrate((1+-1*x^2)^-2*arccoth(x), x) == :(-1*(4+-4*x^2)^-1+1//4*arccoth(x)^2+x*(2+-2*x^2)^-1*arccoth(x))
@test integrate(x*(1+-1*x^2)^-3*arccoth(x), x) == :(-3//32*arctanh(x)+-3*x*(32+-32*x^2)^-1+-1//16*x*(1+-1*x^2)^-2+1//4*(1+-1*x^2)^-2*arccoth(x))
@test integrate((1+-1*x^2)^-3*arccoth(x), x) == :(-3*(16+-16*x^2)^-1+-1//16*(1+-1*x^2)^-2+3//16*arccoth(x)^2+3*x*(8+-8*x^2)^-1*arccoth(x)+1//4*x*(1+-1*x^2)^-2*arccoth(x))
@test integrate(x^3*arccoth(a+b*x), x) == :(1//4*x^4*arccoth(a+b*x)+1//12*b^-4*(a+b*x)^3+-1//2*a*b^-4*(a+b*x)^2+-1//8*b^-4*(1+a)^4*log(1+a+b*x)+1//4*x*b^-3*(1+6*a^2)+1//8*b^-4*(1+-1a)^4*log(1+-1a+-1*b*x))
@test integrate(x^2*arccoth(a+b*x), x) == :(1//3*x^3*arccoth(a+b*x)+1//6*b^-3*(a+b*x)^2+-1*a*x*b^-2+1//6*b^-3*(1+a)^3*log(1+a+b*x)+1//6*b^-3*(1+-1a)^3*log(1+-1a+-1*b*x))
@test integrate(x*arccoth(a+b*x), x) == :((1/2)*x*b^-1+(1/2)*x^2*arccoth(a+b*x)+-1//4*b^-2*(1+a)^2*log(1+a+b*x)+1//4*b^-2*(1+-1a)^2*log(1+-1a+-1*b*x))
@test integrate(arccoth(a+b*x), x) == :((1/2)*b^-1*log(1+-1*(a+b*x)^2)+b^-1*(a+b*x)*arccoth(a+b*x))
@test integrate(x^-1*arccoth(a+b*x), x) == :((1/2)*Polylogarithms.polylog(2,1+-2*(1+a+b*x)^-1)+-1//2*Polylogarithms.polylog(2,1+-2*b*x*(1+-1a)^-1*(1+a+b*x)^-1)+arccoth(a+b*x)*log(2*b*x*(1+-1a)^-1*(1+a+b*x)^-1)+-1*arccoth(a+b*x)*log(2*(1+a+b*x)^-1))
@test integrate(x^-2*arccoth(a+b*x), x) == :(-1*x^-1*arccoth(a+b*x)+b*(1+-1*a^2)^-1*log(x)+-1*b*(2+-2a)^-1*log(1+-1a+-1*b*x)+-1*b*(2+2a)^-1*log(1+a+b*x))
@test integrate(x^-3*arccoth(a+b*x), x) == :(-1//2*x^-2*arccoth(a+b*x)+-1*b*x^-1*(2+-2*a^2)^-1+-1//4*b^2*(1+-1a)^-2*log(1+-1a+-1*b*x)+1//4*b^2*(1+a)^-2*log(1+a+b*x)+a*b^2*(1+-1*a^2)^-2*log(x))
@test integrate(x^3*arccoth(a+b*x)^2, x) == :(1//4*x^4*arccoth(a+b*x)^2+1//12*b^-4*(a+b*x)^2+1//12*b^-4*log(1+-1*(a+b*x)^2)+a*b^-4*arctanh(a+b*x)+-1*a*x*b^-3+-1//4*b^-4*arccoth(a+b*x)^2*(1+a^4+6*a^2)+1//4*b^-4*(1+6*a^2)*log(1+-1*(a+b*x)^2)+1//6*b^-4*(a+b*x)^3*arccoth(a+b*x)+a*b^-4*(1+a^2)*Polylogarithms.polylog(2,-1*(1+-1a+-1*b*x)^-1*(1+a+b*x))+(1/2)*b^-4*(1+6*a^2)*(a+b*x)*arccoth(a+b*x)+-1*a*b^-4*(a+b*x)^2*arccoth(a+b*x)+-1*a*b^-4*arccoth(a+b*x)^2*(1+a^2)+2*a*b^-4*(1+a^2)*arccoth(a+b*x)*log(2*(1+-1a+-1*b*x)^-1))
@test integrate(x^2*arccoth(a+b*x)^2, x) == :(-1//3*b^-3*arctanh(a+b*x)+1//3*x*b^-2+1//3*x^3*arccoth(a+b*x)^2+-1*a*b^-3*log(1+-1*(a+b*x)^2)+-1//3*b^-3*(1+3*a^2)*Polylogarithms.polylog(2,-1*(1+-1a+-1*b*x)^-1*(1+a+b*x))+1//3*b^-3*(a+b*x)^2*arccoth(a+b*x)+1//3*b^-3*arccoth(a+b*x)^2*(1+3*a^2)+-2*a*b^-3*(a+b*x)*arccoth(a+b*x)+-1//3*b^-3*(2+6*a^2)*arccoth(a+b*x)*log(2*(1+-1a+-1*b*x)^-1)+1//3*a*b^-3*arccoth(a+b*x)^2*(3+a^2))
@test integrate(x*arccoth(a+b*x)^2, x) == :((1/2)*b^-2*log(1+-1*(a+b*x)^2)+(1/2)*x^2*arccoth(a+b*x)^2+a*b^-2*Polylogarithms.polylog(2,-1*(1+-1a+-1*b*x)^-1*(1+a+b*x))+b^-2*(a+b*x)*arccoth(a+b*x)+-1*a*b^-2*arccoth(a+b*x)^2+-1//2*b^-2*arccoth(a+b*x)^2*(1+a^2)+2*a*b^-2*arccoth(a+b*x)*log(2*(1+-1a+-1*b*x)^-1))
@test integrate(arccoth(a+b*x)^2, x) == :(b^-1*arccoth(a+b*x)^2+-1*b^-1*Polylogarithms.polylog(2,-1*(1+-1a+-1*b*x)^-1*(1+a+b*x))+b^-1*arccoth(a+b*x)^2*(a+b*x)+-2*b^-1*arccoth(a+b*x)*log(2*(1+-1a+-1*b*x)^-1))
@test integrate(x^-1*arccoth(a+b*x)^2, x) == :((1/2)*Polylogarithms.polylog(3,1+-2*(1+a+b*x)^-1)+-1//2*Polylogarithms.polylog(3,1+-2*b*x*(1+-1a)^-1*(1+a+b*x)^-1)+arccoth(a+b*x)^2*log(2*b*x*(1+-1a)^-1*(1+a+b*x)^-1)+Polylogarithms.polylog(2,1+-2*(1+a+b*x)^-1)*arccoth(a+b*x)+-1*arccoth(a+b*x)^2*log(2*(1+a+b*x)^-1)+-1*Polylogarithms.polylog(2,1+-2*b*x*(1+-1a)^-1*(1+a+b*x)^-1)*arccoth(a+b*x))
@test integrate(x^-2*arccoth(a+b*x)^2, x) == :(-1*x^-1*arccoth(a+b*x)^2+b*(1+-1*a^2)^-1*Polylogarithms.polylog(2,1+-2*(1+a+b*x)^-1)+b*(2+-2a)^-1*Polylogarithms.polylog(2,-1*(1+-1a+-1*b*x)^-1*(1+a+b*x))+-1*b*(1+-1*a^2)^-1*Polylogarithms.polylog(2,1+-2*b*x*(1+-1a)^-1*(1+a+b*x)^-1)+-1*b*(2+2a)^-1*Polylogarithms.polylog(2,1+-2*(1+a+b*x)^-1)+b*(1+a)^-1*arccoth(a+b*x)*log(2*(1+a+b*x)^-1)+b*(1+-1a)^-1*arccoth(a+b*x)*log(2*(1+-1a+-1*b*x)^-1)+-2*b*(1+-1*a^2)^-1*arccoth(a+b*x)*log(2*(1+a+b*x)^-1)+2*b*(1+-1*a^2)^-1*arccoth(a+b*x)*log(2*b*x*(1+-1a)^-1*(1+a+b*x)^-1))
@test integrate(x^-3*arccoth(a+b*x)^2, x) == :(-1//2*x^-2*arccoth(a+b*x)^2+b^2*(1+-1*a^2)^-2*log(x)+1//4*b^2*(1+a)^-2*Polylogarithms.polylog(2,1+-2*(1+a+b*x)^-1)+1//4*b^2*(1+-1a)^-2*Polylogarithms.polylog(2,-1*(1+-1a+-1*b*x)^-1*(1+a+b*x))+a*b^2*(1+-1*a^2)^-2*Polylogarithms.polylog(2,1+-2*(1+a+b*x)^-1)+(1/2)*b^2*(1+-1a)^-2*arccoth(a+b*x)*log(2*(1+-1a+-1*b*x)^-1)+-1*a*b^2*(1+-1*a^2)^-2*Polylogarithms.polylog(2,1+-2*b*x*(1+-1a)^-1*(1+a+b*x)^-1)+-1*b*x^-1*(1+-1*a^2)^-1*arccoth(a+b*x)+-1*b^2*(1+a)^-2*(2+-2a)^-1*log(1+a+b*x)+-1//2*b^2*(1+a)^-1*(1+-1a)^-2*log(1+-1a+-1*b*x)+-1//2*b^2*(1+a)^-2*arccoth(a+b*x)*log(2*(1+a+b*x)^-1)+-2*a*b^2*(1+-1*a^2)^-2*arccoth(a+b*x)*log(2*(1+a+b*x)^-1)+2*a*b^2*(1+-1*a^2)^-2*arccoth(a+b*x)*log(2*b*x*(1+-1a)^-1*(1+a+b*x)^-1))
@test integrate((c+d*x^2)^-1*arccoth(a+b*x), x) == :(-1//4*d^-1//2*(-1c)^-1//2*Polylogarithms.polylog(2,(a+b*x)^-1*(c*b^2+a*d*(1+a)+b*d^(1/2)*(-1c)^(1/2))^-1*(c*b^2+d*a^2)*(1+a+b*x))+-1//4*d^-1//2*(-1c)^-1//2*Polylogarithms.polylog(2,-1*(a+b*x)^-1*(c*b^2+b*d^(1/2)*(-1c)^(1/2)+-1*a*d*(1+-1a))^-1*(c*b^2+d*a^2)*(1+-1a+-1*b*x))+1//4*d^-1//2*(-1c)^-1//2*Polylogarithms.polylog(2,(a+b*x)^-1*(c*b^2+a*d*(1+a)+-1*b*d^(1/2)*(-1c)^(1/2))^-1*(c*b^2+d*a^2)*(1+a+b*x))+1//4*d^-1//2*(-1c)^-1//2*Polylogarithms.polylog(2,-1*(a+b*x)^-1*(c*b^2+-1*a*d*(1+-1a)+-1*b*d^(1/2)*(-1c)^(1/2))^-1*(c*b^2+d*a^2)*(1+-1a+-1*b*x))+-1//4*d^-1//2*(-1c)^-1//2*log((a+b*x)^-1*(1+a+b*x))*log(1+-1*(a+b*x)^-1*(c*b^2+a*d*(1+a)+b*d^(1/2)*(-1c)^(1/2))^-1*(c*b^2+d*a^2)*(1+a+b*x))+-1//4*d^-1//2*(-1c)^-1//2*log(-1*(a+b*x)^-1*(1+-1a+-1*b*x))*log(1+(a+b*x)^-1*(c*b^2+b*d^(1/2)*(-1c)^(1/2)+-1*a*d*(1+-1a))^-1*(c*b^2+d*a^2)*(1+-1a+-1*b*x))+1//4*d^-1//2*(-1c)^-1//2*log((a+b*x)^-1*(1+a+b*x))*log(1+-1*(a+b*x)^-1*(c*b^2+a*d*(1+a)+-1*b*d^(1/2)*(-1c)^(1/2))^-1*(c*b^2+d*a^2)*(1+a+b*x))+1//4*d^-1//2*(-1c)^-1//2*log(-1*(a+b*x)^-1*(1+-1a+-1*b*x))*log(1+(a+b*x)^-1*(c*b^2+-1*a*d*(1+-1a)+-1*b*d^(1/2)*(-1c)^(1/2))^-1*(c*b^2+d*a^2)*(1+-1a+-1*b*x)))
@test integrate((c+d*x)^-1*arccoth(a+b*x), x) == :((1/2)*d^-1*Polylogarithms.polylog(2,1+-2*(1+a+b*x)^-1)+-1//2*d^-1*Polylogarithms.polylog(2,1+-2*b*(1+a+b*x)^-1*(d+b*c+-1*a*d)^-1*(c+d*x))+d^-1*arccoth(a+b*x)*log(2*b*(1+a+b*x)^-1*(d+b*c+-1*a*d)^-1*(c+d*x))+-1*d^-1*arccoth(a+b*x)*log(2*(1+a+b*x)^-1))
@test integrate((c+d*x^-2)^-1*arccoth(a+b*x), x) == :((1/2)*x*c^-1*(-1*log(-1*(a+b*x)^-1*(1+-1a+-1*b*x))+-1*log(a+b*x)+log(-1+a+b*x))+(1/2)*x*c^-1*(-1*log(1+a+b*x)+log((a+b*x)^-1*(1+a+b*x))+log(a+b*x))+-1//4*d^(1/2)*(-1c)^-3//2*Polylogarithms.polylog(2,(-1c)^(1/2)*(b*d^(1/2)+(-1c)^(1/2)*(1+a))^-1*(1+a+b*x))+-1//4*d^(1/2)*(-1c)^-3//2*Polylogarithms.polylog(2,(-1c)^(1/2)*(b*d^(1/2)+(-1c)^(1/2)*(1+-1a))^-1*(1+-1a+-1*b*x))+1//4*d^(1/2)*(-1c)^-3//2*Polylogarithms.polylog(2,(-1c)^(1/2)*((-1c)^(1/2)*(1+a)+-1*b*d^(1/2))^-1*(1+a+b*x))+1//4*d^(1/2)*(-1c)^-3//2*Polylogarithms.polylog(2,(-1c)^(1/2)*((-1c)^(1/2)*(1+-1a)+-1*b*d^(1/2))^-1*(1+-1a+-1*b*x))+(1/2)*b^-1*c^-1*(1+a+b*x)*log(1+a+b*x)+(1/2)*b^-1*c^-1*(1+-1a+-1*b*x)*log(-1+a+b*x)+-1//2*c^-3//2*d^(1/2)*(-1*log(-1*(a+b*x)^-1*(1+-1a+-1*b*x))+-1*log(a+b*x)+log(-1+a+b*x))*arctan(x*c^(1/2)*d^-1//2)+-1//2*c^-3//2*d^(1/2)*(-1*log(1+a+b*x)+log((a+b*x)^-1*(1+a+b*x))+log(a+b*x))*arctan(x*c^(1/2)*d^-1//2)+-1//4*d^(1/2)*(-1c)^-3//2*log(b*(b*d^(1/2)+(-1c)^(1/2)*(1+a))^-1*(d^(1/2)+-1*x*(-1c)^(1/2)))*log(1+a+b*x)+-1//4*d^(1/2)*(-1c)^-3//2*log(b*(b*d^(1/2)+(-1c)^(1/2)*(1+-1a))^-1*(d^(1/2)+x*(-1c)^(1/2)))*log(-1+a+b*x)+1//4*d^(1/2)*(-1c)^-3//2*log(-1*b*((-1c)^(1/2)*(1+a)+-1*b*d^(1/2))^-1*(d^(1/2)+x*(-1c)^(1/2)))*log(1+a+b*x)+1//4*d^(1/2)*(-1c)^-3//2*log(-1*b*((-1c)^(1/2)*(1+-1a)+-1*b*d^(1/2))^-1*(d^(1/2)+-1*x*(-1c)^(1/2)))*log(-1+a+b*x))
@test integrate((c+d*x^(1/2))^-1*arccoth(a+b*x), x) == :(c*d^-2*Polylogarithms.polylog(2,b^(1/2)*(c*b^(1/2)+d*(-1+-1a)^(1/2))^-1*(c+d*x^(1/2)))+c*d^-2*Polylogarithms.polylog(2,b^(1/2)*(c*b^(1/2)+-1*d*(-1+-1a)^(1/2))^-1*(c+d*x^(1/2)))+d^-1*x^(1/2)*log((a+b*x)^-1*(1+a+b*x))+-1*c*d^-2*Polylogarithms.polylog(2,b^(1/2)*(c*b^(1/2)+d*(1+-1a)^(1/2))^-1*(c+d*x^(1/2)))+-1*c*d^-2*Polylogarithms.polylog(2,b^(1/2)*(c*b^(1/2)+-1*d*(1+-1a)^(1/2))^-1*(c+d*x^(1/2)))+-1*d^-1*x^(1/2)*log(-1*(a+b*x)^-1*(1+-1a+-1*b*x))+c*d^-2*log(-1*(a+b*x)^-1*(1+-1a+-1*b*x))*log(c+d*x^(1/2))+c*d^-2*log(d*(c*b^(1/2)+d*(-1+-1a)^(1/2))^-1*((-1+-1a)^(1/2)+-1*b^(1/2)*x^(1/2)))*log(c+d*x^(1/2))+c*d^-2*log(-1*d*(c*b^(1/2)+-1*d*(-1+-1a)^(1/2))^-1*((-1+-1a)^(1/2)+b^(1/2)*x^(1/2)))*log(c+d*x^(1/2))+-1*c*d^-2*log((a+b*x)^-1*(1+a+b*x))*log(c+d*x^(1/2))+-1*c*d^-2*log(d*(c*b^(1/2)+d*(1+-1a)^(1/2))^-1*((1+-1a)^(1/2)+-1*b^(1/2)*x^(1/2)))*log(c+d*x^(1/2))+-1*c*d^-2*log(-1*d*(c*b^(1/2)+-1*d*(1+-1a)^(1/2))^-1*((1+-1a)^(1/2)+b^(1/2)*x^(1/2)))*log(c+d*x^(1/2))+-2*b^-1//2*d^-1*(1+-1a)^(1/2)*arctanh(b^(1/2)*x^(1/2)*(1+-1a)^-1//2)+2*b^-1//2*d^-1*(1+a)^(1/2)*arctan(b^(1/2)*x^(1/2)*(1+a)^-1//2))
@test integrate((c+d*x^-1//2)^-1*arccoth(a+b*x), x) == :(c^-3*d^2*Polylogarithms.polylog(2,b^(1/2)*(c*(1+-1a)^(1/2)+d*b^(1/2))^-1*(d+c*x^(1/2)))+c^-3*d^2*Polylogarithms.polylog(2,-1*b^(1/2)*(c*(1+-1a)^(1/2)+-1*d*b^(1/2))^-1*(d+c*x^(1/2)))+(1/2)*x*c^-1*log((a+b*x)^-1*(1+a+b*x))+-1*c^-3*d^2*Polylogarithms.polylog(2,b^(1/2)*(c*(-1+-1a)^(1/2)+d*b^(1/2))^-1*(d+c*x^(1/2)))+-1*c^-3*d^2*Polylogarithms.polylog(2,-1*b^(1/2)*(c*(-1+-1a)^(1/2)+-1*d*b^(1/2))^-1*(d+c*x^(1/2)))+-1//2*x*c^-1*log(-1*(a+b*x)^-1*(1+-1a+-1*b*x))+d*c^-2*x^(1/2)*log(-1*(a+b*x)^-1*(1+-1a+-1*b*x))+c^-3*d^2*log((a+b*x)^-1*(1+a+b*x))*log(d+c*x^(1/2))+c^-3*d^2*log(c*(c*(1+-1a)^(1/2)+d*b^(1/2))^-1*((1+-1a)^(1/2)+-1*b^(1/2)*x^(1/2)))*log(d+c*x^(1/2))+c^-3*d^2*log(c*(c*(1+-1a)^(1/2)+-1*d*b^(1/2))^-1*((1+-1a)^(1/2)+b^(1/2)*x^(1/2)))*log(d+c*x^(1/2))+(1/2)*b^-1*c^-1*(1+a)*log(1+a+b*x)+(1/2)*b^-1*c^-1*(1+-1a)*log(1+-1a+-1*b*x)+-1*d*c^-2*x^(1/2)*log((a+b*x)^-1*(1+a+b*x))+-1*c^-3*d^2*log(-1*(a+b*x)^-1*(1+-1a+-1*b*x))*log(d+c*x^(1/2))+-1*c^-3*d^2*log(c*(c*(-1+-1a)^(1/2)+d*b^(1/2))^-1*((-1+-1a)^(1/2)+-1*b^(1/2)*x^(1/2)))*log(d+c*x^(1/2))+-1*c^-3*d^2*log(c*(c*(-1+-1a)^(1/2)+-1*d*b^(1/2))^-1*((-1+-1a)^(1/2)+b^(1/2)*x^(1/2)))*log(d+c*x^(1/2))+-2*d*b^-1//2*c^-2*(1+a)^(1/2)*arctan(b^(1/2)*x^(1/2)*(1+a)^-1//2)+2*d*b^-1//2*c^-2*(1+-1a)^(1/2)*arctanh(b^(1/2)*x^(1/2)*(1+-1a)^-1//2))
@test integrate((a+b*x+c*x^2)^-1*arccoth(d+e*x), x) == :((1/2)*(b^2+-4*a*c)^-1//2*Polylogarithms.polylog(2,1+(e*(b+(b^2+-4*a*c)^(1/2))+2*c*(1+-1d))^-1*(1+d+e*x)^-1*(-4*c*(d+e*x)+-2*e*(b+(b^2+-4*a*c)^(1/2))+4*c*d))+-1//2*(b^2+-4*a*c)^-1//2*Polylogarithms.polylog(2,1+(1+d+e*x)^-1*(2c+b*e+-1*e*(b^2+-4*a*c)^(1/2)+-2*c*d)^-1*(-4*c*(d+e*x)+-2*e*(b+-1*(b^2+-4*a*c)^(1/2))+4*c*d))+(b^2+-4*a*c)^-1//2*arccoth(d+e*x)*log(2*e*(e*(b+-1*(b^2+-4*a*c)^(1/2))+2*c*(1+-1d))^-1*(1+d+e*x)^-1*(b+-1*(b^2+-4*a*c)^(1/2)+2*c*x))+-1*(b^2+-4*a*c)^-1//2*arccoth(d+e*x)*log(2*e*(e*(b+(b^2+-4*a*c)^(1/2))+2*c*(1+-1d))^-1*(1+d+e*x)^-1*(b+(b^2+-4*a*c)^(1/2)+2*c*x)))
@test integrate(x^2*arccoth(x^(1/2)), x) == :(-1//3*arctanh(x^(1/2))+1//3*x^(1/2)+1//9*x^3//2+1//15*x^5//2+1//3*x^3*arccoth(x^(1/2)))
@test integrate(x*arccoth(x^(1/2)), x) == :((1/2)*x^(1/2)+-1//2*arctanh(x^(1/2))+1//6*x^3//2+(1/2)*x^2*arccoth(x^(1/2)))
@test integrate(arccoth(x^(1/2)), x) == :(x^(1/2)+-1*arctanh(x^(1/2))+x*arccoth(x^(1/2)))
@test integrate(x^-1*arccoth(x^(1/2)), x) == :(-1*Polylogarithms.polylog(2,x^-1//2)+Polylogarithms.polylog(2,-1*x^-1//2))
@test integrate(x^-2*arccoth(x^(1/2)), x) == :(-1*x^-1//2+-1*x^-1*arccoth(x^(1/2))+arctanh(x^(1/2)))
@test integrate(x^-3*arccoth(x^(1/2)), x) == :((1/2)*arctanh(x^(1/2))+-1//2*x^-1//2+-1//6*x^-3//2+-1//2*x^-2*arccoth(x^(1/2)))
@test integrate(x^3//2*arccoth(x^(1/2)), x) == :(1//5*x+1//5*log(1+-1x)+1//10*x^2+2//5*x^5//2*arccoth(x^(1/2)))
@test integrate(x^(1/2)*arccoth(x^(1/2)), x) == :(1//3*x+1//3*log(1+-1x)+2//3*x^3//2*arccoth(x^(1/2)))
@test integrate(x^-1//2*arccoth(x^(1/2)), x) == :(2*x^(1/2)*arccoth(x^(1/2))+log(1+-1x))
@test integrate(x^-3//2*arccoth(x^(1/2)), x) == :(-1*log(1+-1x)+-2*x^-1//2*arccoth(x^(1/2))+log(x))
@test integrate(x^-1*arccoth(a*x^5), x) == :(-1//10*Polylogarithms.polylog(2,a^-1*x^-5)+1//10*Polylogarithms.polylog(2,-1*a^-1*x^-5))
@test integrate(arccoth(x^-1), x) == :((1/2)*log(1+-1*x^2)+x*arccoth(x^-1))
@test integrate(x^-1*arccoth(a*x^n), x) == :((1/2)*n^-1*Polylogarithms.polylog(2,-1*a^-1*x^(-1n))+-1//2*n^-1*Polylogarithms.polylog(2,a^-1*x^(-1n)))
@test integrate((a+b*x)*arccoth(a+b*x), x) == :((1/2)*x+-1//2*b^-1*arctanh(a+b*x)+(1/2)*b^-1*(a+b*x)^2*arccoth(a+b*x))
@test integrate((a+b*x)^2*arccoth(a+b*x), x) == :(1//6*b^-1*(a+b*x)^2+1//6*b^-1*log(1+-1*(a+b*x)^2)+1//3*b^-1*(a+b*x)^3*arccoth(a+b*x))
@test integrate((a+b*x)^-1*arccoth(a+b*x), x) == :((1/2)*b^-1*Polylogarithms.polylog(2,-1*(a+b*x)^-1)+-1//2*b^-1*Polylogarithms.polylog(2,(a+b*x)^-1))
@test integrate((a+b*x)^-2*arccoth(a+b*x), x) == :(b^-1*log(a+b*x)+-1//2*b^-1*log(1+-1*(a+b*x)^2)+-1*b^-1*(a+b*x)^-1*arccoth(a+b*x))
@test integrate((2+2x)^-1*arccoth(1+x), x) == :(-1//4*Polylogarithms.polylog(2,(1+x)^-1)+1//4*Polylogarithms.polylog(2,-1*(1+x)^-1))
@test integrate((d*x+a*d*b^-1)^-1*arccoth(a+b*x), x) == :((1/2)*d^-1*Polylogarithms.polylog(2,-1*(a+b*x)^-1)+-1//2*d^-1*Polylogarithms.polylog(2,(a+b*x)^-1))
@test integrate((e+f*x)^3*(a+b*arccoth(c+d*x)), x) == :(1//4*f^-1*(e+f*x)^4*(a+b*arccoth(c+d*x))+1//12*b*d^-4*f^3*(c+d*x)^3+(1/2)*b*d^-4*f^2*(c+d*x)^2*(d*e+-1*c*f)+-1//8*b*d^-4*f^-1*(-1*f+d*e+-1*c*f)^4*log(1+c+d*x)+1//4*b*f*x*d^-3*(f^2*(1+6*c^2)+6*d^2*e^2+-12*c*d*e*f)+1//8*b*d^-4*f^-1*(f+d*e+-1*c*f)^4*log(1+-1c+-1*d*x))
@test integrate((e+f*x)^2*(a+b*arccoth(c+d*x)), x) == :(1//3*f^-1*(e+f*x)^3*(a+b*arccoth(c+d*x))+1//6*b*d^-3*f^2*(c+d*x)^2+b*f*x*d^-2*(d*e+-1*c*f)+-1//6*b*d^-3*f^-1*(d*e+-1*f*(1+c))^3*log(1+c+d*x)+1//6*b*d^-3*f^-1*(f+d*e+-1*c*f)^3*log(1+-1c+-1*d*x))
@test integrate((a+b*arccoth(c+d*x))*(e+f*x), x) == :((1/2)*f^-1*(e+f*x)^2*(a+b*arccoth(c+d*x))+(1/2)*b*f*x*d^-1+-1//4*b*d^-2*f^-1*(d*e+-1*f*(1+c))^2*log(1+c+d*x)+1//4*b*d^-2*f^-1*(f+d*e+-1*c*f)^2*log(1+-1c+-1*d*x))
@test integrate(a+b*arccoth(c+d*x), x) == :(a*x+(1/2)*b*d^-1*log(1+-1*(c+d*x)^2)+b*d^-1*(c+d*x)*arccoth(c+d*x))
@test integrate((e+f*x)^-1*(a+b*arccoth(c+d*x)), x) == :(f^-1*(a+b*arccoth(c+d*x))*log(2*d*(1+c+d*x)^-1*(f+d*e+-1*c*f)^-1*(e+f*x))+(1/2)*b*f^-1*Polylogarithms.polylog(2,1+-2*(1+c+d*x)^-1)+-1*f^-1*(a+b*arccoth(c+d*x))*log(2*(1+c+d*x)^-1)+-1//2*b*f^-1*Polylogarithms.polylog(2,1+-2*d*(1+c+d*x)^-1*(f+d*e+-1*c*f)^-1*(e+f*x)))
@test integrate((a+b*arccoth(c+d*x))^2*(e+f*x)^2, x) == :(1//3*d^-3*(a+b*arccoth(c+d*x))^2*(f^2*(1+3*c^2)+3*d^2*e^2+-6*c*d*e*f)+1//3*f^-1*(a+b*arccoth(c+d*x))^2*(e+f*x)^3+-1//3*b^2*d^-3*f^2*arctanh(c+d*x)+-1//3*b^2*d^-3*(f^2*(1+3*c^2)+3*d^2*e^2+-6*c*d*e*f)*Polylogarithms.polylog(2,-1*(1+-1c+-1*d*x)^-1*(1+c+d*x))+1//3*x*b^2*d^-2*f^2+f*b^2*d^-3*(d*e+-1*c*f)*log(1+-1*(c+d*x)^2)+-2//3*b*d^-3*(a+b*arccoth(c+d*x))*(f^2*(1+3*c^2)+3*d^2*e^2+-6*c*d*e*f)*log(2*(1+-1c+-1*d*x)^-1)+-1//3*d^-3*f^-1*(a+b*arccoth(c+d*x))^2*(d*e+-1*c*f)*(d^2*e^2+f^2*(3+c^2)+-2*c*d*e*f)+1//3*b*d^-3*f^2*(c+d*x)^2*(a+b*arccoth(c+d*x))+2*a*b*f*x*d^-2*(d*e+-1*c*f)+2*f*b^2*d^-3*(c+d*x)*(d*e+-1*c*f)*arccoth(c+d*x))
@test integrate((a+b*arccoth(c+d*x))^2*(e+f*x), x) == :(d^-2*(a+b*arccoth(c+d*x))^2*(d*e+-1*c*f)+(1/2)*f^-1*(a+b*arccoth(c+d*x))^2*(e+f*x)^2+(1/2)*f*b^2*d^-2*log(1+-1*(c+d*x)^2)+-1*b^2*d^-2*(d*e+-1*c*f)*Polylogarithms.polylog(2,-1*(1+-1c+-1*d*x)^-1*(1+c+d*x))+-1//2*d^-2*f^-1*(a+b*arccoth(c+d*x))^2*(d^2*e^2+f^2*(1+c^2)+-2*c*d*e*f)+a*b*f*x*d^-1+f*b^2*d^-2*(c+d*x)*arccoth(c+d*x)+-2*b*d^-2*(a+b*arccoth(c+d*x))*(d*e+-1*c*f)*log(2*(1+-1c+-1*d*x)^-1))
@test integrate((a+b*arccoth(c+d*x))^2, x) == :(d^-1*(a+b*arccoth(c+d*x))^2+d^-1*(a+b*arccoth(c+d*x))^2*(c+d*x)+-1*b^2*d^-1*Polylogarithms.polylog(2,-1*(1+-1c+-1*d*x)^-1*(1+c+d*x))+-2*b*d^-1*(a+b*arccoth(c+d*x))*log(2*(1+-1c+-1*d*x)^-1))
@test integrate((a+b*arccoth(c+d*x))^2*(e+f*x)^-1, x) == :(f^-1*(a+b*arccoth(c+d*x))^2*log(2*d*(1+c+d*x)^-1*(f+d*e+-1*c*f)^-1*(e+f*x))+(1/2)*b^2*f^-1*Polylogarithms.polylog(3,1+-2*(1+c+d*x)^-1)+-1*f^-1*(a+b*arccoth(c+d*x))^2*log(2*(1+c+d*x)^-1)+-1//2*b^2*f^-1*Polylogarithms.polylog(3,1+-2*d*(1+c+d*x)^-1*(f+d*e+-1*c*f)^-1*(e+f*x))+b*f^-1*(a+b*arccoth(c+d*x))*Polylogarithms.polylog(2,1+-2*(1+c+d*x)^-1)+-1*b*f^-1*(a+b*arccoth(c+d*x))*Polylogarithms.polylog(2,1+-2*d*(1+c+d*x)^-1*(f+d*e+-1*c*f)^-1*(e+f*x)))
@test integrate((a+b*arccoth(c+d*x))^3*(e+f*x)^2, x) == :(1//3*d^-3*(a+b*arccoth(c+d*x))^3*(f^2*(1+3*c^2)+3*d^2*e^2+-6*c*d*e*f)+1//3*f^-1*(a+b*arccoth(c+d*x))^3*(e+f*x)^3+(1/2)*b^3*d^-3*f^2*log(1+-1*(c+d*x)^2)+(1/2)*b^3*d^-3*(f^2*(1+3*c^2)+3*d^2*e^2+-6*c*d*e*f)*Polylogarithms.polylog(3,1+-2*(1+-1c+-1*d*x)^-1)+-1//2*b*d^-3*f^2*(a+b*arccoth(c+d*x))^2+a*x*b^2*d^-2*f^2+b^3*d^-3*f^2*(c+d*x)*arccoth(c+d*x)+(1/2)*b*d^-3*f^2*(a+b*arccoth(c+d*x))^2*(c+d*x)^2+-1*b*d^-3*(a+b*arccoth(c+d*x))^2*(f^2*(1+3*c^2)+3*d^2*e^2+-6*c*d*e*f)*log(2*(1+-1c+-1*d*x)^-1)+-1*b^2*d^-3*(a+b*arccoth(c+d*x))*(f^2*(1+3*c^2)+3*d^2*e^2+-6*c*d*e*f)*Polylogarithms.polylog(2,1+-2*(1+-1c+-1*d*x)^-1)+-3*f*b^3*d^-3*(d*e+-1*c*f)*Polylogarithms.polylog(2,-1*(1+-1c+-1*d*x)^-1*(1+c+d*x))+3*b*f*d^-3*(a+b*arccoth(c+d*x))^2*(d*e+-1*c*f)+-1//3*d^-3*f^-1*(a+b*arccoth(c+d*x))^3*(d*e+-1*c*f)*(d^2*e^2+f^2*(3+c^2)+-2*c*d*e*f)+-6*f*b^2*d^-3*(a+b*arccoth(c+d*x))*(d*e+-1*c*f)*log(2*(1+-1c+-1*d*x)^-1)+3*b*f*d^-3*(a+b*arccoth(c+d*x))^2*(c+d*x)*(d*e+-1*c*f))
@test integrate((a+b*arccoth(c+d*x))^3*(e+f*x), x) == :(d^-2*(a+b*arccoth(c+d*x))^3*(d*e+-1*c*f)+(1/2)*f^-1*(a+b*arccoth(c+d*x))^3*(e+f*x)^2+-3//2*f*b^3*d^-2*Polylogarithms.polylog(2,-1*(1+-1c+-1*d*x)^-1*(1+c+d*x))+-1//2*d^-2*f^-1*(a+b*arccoth(c+d*x))^3*(d^2*e^2+f^2*(1+c^2)+-2*c*d*e*f)+3//2*b*f*d^-2*(a+b*arccoth(c+d*x))^2+3//2*b^3*d^-2*(d*e+-1*c*f)*Polylogarithms.polylog(3,1+-2*(1+-1c+-1*d*x)^-1)+-3*b*d^-2*(a+b*arccoth(c+d*x))^2*(d*e+-1*c*f)*log(2*(1+-1c+-1*d*x)^-1)+-3*f*b^2*d^-2*(a+b*arccoth(c+d*x))*log(2*(1+-1c+-1*d*x)^-1)+-3*b^2*d^-2*(a+b*arccoth(c+d*x))*(d*e+-1*c*f)*Polylogarithms.polylog(2,1+-2*(1+-1c+-1*d*x)^-1)+3//2*b*f*d^-2*(a+b*arccoth(c+d*x))^2*(c+d*x))
@test integrate((a+b*arccoth(c+d*x))^3, x) == :(d^-1*(a+b*arccoth(c+d*x))^3+d^-1*(a+b*arccoth(c+d*x))^3*(c+d*x)+3//2*b^3*d^-1*Polylogarithms.polylog(3,1+-2*(1+-1c+-1*d*x)^-1)+-3*b*d^-1*(a+b*arccoth(c+d*x))^2*log(2*(1+-1c+-1*d*x)^-1)+-3*b^2*d^-1*(a+b*arccoth(c+d*x))*Polylogarithms.polylog(2,1+-2*(1+-1c+-1*d*x)^-1))
@test integrate((a+b*arccoth(c+d*x))^3*(e+f*x)^-1, x) == :(f^-1*(a+b*arccoth(c+d*x))^3*log(2*d*(1+c+d*x)^-1*(f+d*e+-1*c*f)^-1*(e+f*x))+-1*f^-1*(a+b*arccoth(c+d*x))^3*log(2*(1+c+d*x)^-1)+-3//4*b^3*f^-1*Polylogarithms.polylog(4,1+-2*d*(1+c+d*x)^-1*(f+d*e+-1*c*f)^-1*(e+f*x))+3//4*b^3*f^-1*Polylogarithms.polylog(4,1+-2*(1+c+d*x)^-1)+-3//2*b*f^-1*(a+b*arccoth(c+d*x))^2*Polylogarithms.polylog(2,1+-2*d*(1+c+d*x)^-1*(f+d*e+-1*c*f)^-1*(e+f*x))+-3//2*b^2*f^-1*(a+b*arccoth(c+d*x))*Polylogarithms.polylog(3,1+-2*d*(1+c+d*x)^-1*(f+d*e+-1*c*f)^-1*(e+f*x))+3//2*b*f^-1*(a+b*arccoth(c+d*x))^2*Polylogarithms.polylog(2,1+-2*(1+c+d*x)^-1)+3//2*b^2*f^-1*(a+b*arccoth(c+d*x))*Polylogarithms.polylog(3,1+-2*(1+c+d*x)^-1))
@test integrate((1+-1*c^2*x^2)^-1*(a+b*arccoth((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))^3, x) == :(-2*c^-1*(a+b*arccoth((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))^3*arccoth(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+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+3//4*b^3*c^-1*Polylogarithms.polylog(4,1+-2*(1+c*x)^-1//2*(1+(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1*(1+-1*c*x)^(1/2))+-3//2*b*c^-1*(a+b*arccoth((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))^2*Polylogarithms.polylog(2,1+-2*(1+(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+-3//2*b^2*c^-1*(a+b*arccoth((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))*Polylogarithms.polylog(3,1+-2*(1+(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+3//2*b*c^-1*(a+b*arccoth((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))^2*Polylogarithms.polylog(2,1+-2*(1+c*x)^-1//2*(1+(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1*(1+-1*c*x)^(1/2))+3//2*b^2*c^-1*(a+b*arccoth((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))*Polylogarithms.polylog(3,1+-2*(1+c*x)^-1//2*(1+(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1*(1+-1*c*x)^(1/2)))
@test integrate((1+-1*c^2*x^2)^-1*(a+b*arccoth((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+c*x)^-1//2*(1+(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1*(1+-1*c*x)^(1/2))+-2*c^-1*(a+b*arccoth((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))^2*arccoth(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+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1)+b*c^-1*(a+b*arccoth((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))*Polylogarithms.polylog(2,1+-2*(1+c*x)^-1//2*(1+(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1*(1+-1*c*x)^(1/2))+-1*b*c^-1*(a+b*arccoth((1+c*x)^-1//2*(1+-1*c*x)^(1/2)))*Polylogarithms.polylog(2,1+-2*(1+(1+c*x)^-1//2*(1+-1*c*x)^(1/2))^-1))
@test integrate((1+-1*c^2*x^2)^-1*(a+b*arccoth((1+c*x)^-1//2*(1+-1*c*x)^(1/2))), x) == :((1/2)*b*c^-1*Polylogarithms.polylog(2,(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*(1+c*x)^(1/2)*(1+-1*c*x)^-1//2))
@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*arccoth(tanh(a+b*x)), x) == :(-1//12*b*x^4+1//3*x^3*arccoth(tanh(a+b*x)))
@test integrate(x*arccoth(tanh(a+b*x)), x) == :((1/2)*x^2*arccoth(tanh(a+b*x))+-1//6*b*x^3)
@test integrate(arccoth(tanh(a+b*x)), x) == :((1/2)*b^-1*arccoth(tanh(a+b*x))^2)
@test integrate(x^-1*arccoth(tanh(a+b*x)), x) == :(b*x+-1*(-1*arccoth(tanh(a+b*x))+b*x)*log(x))
@test integrate(x^-2*arccoth(tanh(a+b*x)), x) == :(b*log(x)+-1*x^-1*arccoth(tanh(a+b*x)))
@test integrate(x^-3*arccoth(tanh(a+b*x)), x) == :(-1//2*b*x^-1+-1//2*x^-2*arccoth(tanh(a+b*x)))
@test integrate(x^-4*arccoth(tanh(a+b*x)), x) == :(-1//3*x^-3*arccoth(tanh(a+b*x))+-1//6*b*x^-2)
@test integrate(x^m*arccoth(tanh(a+b*x))^2, x) == :(x^(1+m)*(1+m)^-1*arccoth(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*arccoth(tanh(a+b*x)))
@test integrate(x^3*arccoth(tanh(a+b*x))^2, x) == :(1//4*x^4*arccoth(tanh(a+b*x))^2+1//60*b^2*x^6+-1//10*b*x^5*arccoth(tanh(a+b*x)))
@test integrate(x^2*arccoth(tanh(a+b*x))^2, x) == :(1//3*x^3*arccoth(tanh(a+b*x))^2+1//30*b^2*x^5+-1//6*b*x^4*arccoth(tanh(a+b*x)))
@test integrate(x*arccoth(tanh(a+b*x))^2, x) == :(-1//12*b^-2*arccoth(tanh(a+b*x))^4+1//3*x*b^-1*arccoth(tanh(a+b*x))^3)
@test integrate(arccoth(tanh(a+b*x))^2, x) == :(1//3*b^-1*arccoth(tanh(a+b*x))^3)
@test integrate(x^-1*arccoth(tanh(a+b*x))^2, x) == :((1/2)*arccoth(tanh(a+b*x))^2+(-1*arccoth(tanh(a+b*x))+b*x)^2*log(x)+-1*b*x*(-1*arccoth(tanh(a+b*x))+b*x))
@test integrate(x^-2*arccoth(tanh(a+b*x))^2, x) == :(-1*x^-1*arccoth(tanh(a+b*x))^2+2*x*b^2+-2*b*(-1*arccoth(tanh(a+b*x))+b*x)*log(x))
@test integrate(x^-3*arccoth(tanh(a+b*x))^2, x) == :(b^2*log(x)+-1//2*x^-2*arccoth(tanh(a+b*x))^2+-1*b*x^-1*arccoth(tanh(a+b*x)))
@test integrate(x^-4*arccoth(tanh(a+b*x))^2, x) == :(1//3*x^-3*(-1*arccoth(tanh(a+b*x))+b*x)^-1*arccoth(tanh(a+b*x))^3)
@test integrate(x^-5*arccoth(tanh(a+b*x))^2, x) == :(1//4*x^-4*(-1*arccoth(tanh(a+b*x))+b*x)^-1*arccoth(tanh(a+b*x))^3+1//12*b*x^-3*(-1*arccoth(tanh(a+b*x))+b*x)^-2*arccoth(tanh(a+b*x))^3)
@test integrate(x^m*arccoth(tanh(a+b*x))^3, x) == :(x^(1+m)*(1+m)^-1*arccoth(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*arccoth(tanh(a+b*x))^2+6*b^2*x^(3+m)*(6+m^3+6*m^2+11m)^-1*arccoth(tanh(a+b*x)))
@test integrate(x^4*arccoth(tanh(a+b*x))^3, x) == :(-1//280*b^3*x^8+1//5*x^5*arccoth(tanh(a+b*x))^3+-1//10*b*x^6*arccoth(tanh(a+b*x))^2+1//35*b^2*x^7*arccoth(tanh(a+b*x)))
@test integrate(x^3*arccoth(tanh(a+b*x))^3, x) == :(-1//140*b^3*x^7+1//4*x^4*arccoth(tanh(a+b*x))^3+-3//20*b*x^5*arccoth(tanh(a+b*x))^2+1//20*b^2*x^6*arccoth(tanh(a+b*x)))
@test integrate(x^2*arccoth(tanh(a+b*x))^3, x) == :(1//60*b^-3*arccoth(tanh(a+b*x))^6+-1//10*x*b^-2*arccoth(tanh(a+b*x))^5+1//4*b^-1*x^2*arccoth(tanh(a+b*x))^4)
@test integrate(x*arccoth(tanh(a+b*x))^3, x) == :(-1//20*b^-2*arccoth(tanh(a+b*x))^5+1//4*x*b^-1*arccoth(tanh(a+b*x))^4)
@test integrate(arccoth(tanh(a+b*x))^3, x) == :(1//4*b^-1*arccoth(tanh(a+b*x))^4)
@test integrate(x^-1*arccoth(tanh(a+b*x))^3, x) == :(1//3*arccoth(tanh(a+b*x))^3+-1*(-1*arccoth(tanh(a+b*x))+b*x)^3*log(x)+-1*arccoth(tanh(a+b*x))^2*(-1//2*arccoth(tanh(a+b*x))+(1/2)*b*x)+b*x*(-1*arccoth(tanh(a+b*x))+b*x)^2)
@test integrate(x^-2*arccoth(tanh(a+b*x))^3, x) == :(-1*x^-1*arccoth(tanh(a+b*x))^3+3//2*b*arccoth(tanh(a+b*x))^2+-3*x*b^2*(-1*arccoth(tanh(a+b*x))+b*x)+3*b*(-1*arccoth(tanh(a+b*x))+b*x)^2*log(x))
@test integrate(x^-3*arccoth(tanh(a+b*x))^3, x) == :(3*x*b^3+-1//2*x^-2*arccoth(tanh(a+b*x))^3+-3*b^2*(-1*arccoth(tanh(a+b*x))+b*x)*log(x)+-3//2*b*x^-1*arccoth(tanh(a+b*x))^2)
@test integrate(x^-4*arccoth(tanh(a+b*x))^3, x) == :(b^3*log(x)+-1//3*x^-3*arccoth(tanh(a+b*x))^3+-1*b^2*x^-1*arccoth(tanh(a+b*x))+-1//2*b*x^-2*arccoth(tanh(a+b*x))^2)
@test integrate(x^-5*arccoth(tanh(a+b*x))^3, x) == :(1//4*x^-4*(-1*arccoth(tanh(a+b*x))+b*x)^-1*arccoth(tanh(a+b*x))^4)
@test integrate(x^-6*arccoth(tanh(a+b*x))^3, x) == :(1//5*x^-5*(-1*arccoth(tanh(a+b*x))+b*x)^-1*arccoth(tanh(a+b*x))^4+1//20*b*x^-4*(-1*arccoth(tanh(a+b*x))+b*x)^-2*arccoth(tanh(a+b*x))^4)
@test integrate(x^3*arccoth(tanh(a+b*x))^-1, x) == :(1//3*b^-1*x^3+x*b^-3*(-1*arccoth(tanh(a+b*x))+b*x)^2+b^-4*(-1*arccoth(tanh(a+b*x))+b*x)^3*log(arccoth(tanh(a+b*x)))+(1/2)*b^-2*x^2*(-1*arccoth(tanh(a+b*x))+b*x))
@test integrate(x^2*arccoth(tanh(a+b*x))^-1, x) == :((1/2)*b^-1*x^2+x*b^-2*(-1*arccoth(tanh(a+b*x))+b*x)+b^-3*(-1*arccoth(tanh(a+b*x))+b*x)^2*log(arccoth(tanh(a+b*x))))
@test integrate(x*arccoth(tanh(a+b*x))^-1, x) == :(x*b^-1+b^-2*(-1*arccoth(tanh(a+b*x))+b*x)*log(arccoth(tanh(a+b*x))))
@test integrate(arccoth(tanh(a+b*x))^-1, x) == :(b^-1*log(arccoth(tanh(a+b*x))))
@test integrate(x^-1*arccoth(tanh(a+b*x))^-1, x) == :((-1*arccoth(tanh(a+b*x))+b*x)^-1*log(arccoth(tanh(a+b*x)))+-1*(-1*arccoth(tanh(a+b*x))+b*x)^-1*log(x))
@test integrate(x^-2*arccoth(tanh(a+b*x))^-1, x) == :(x^-1*(-1*arccoth(tanh(a+b*x))+b*x)^-1+b*(-1*arccoth(tanh(a+b*x))+b*x)^-2*log(arccoth(tanh(a+b*x)))+-1*b*(-1*arccoth(tanh(a+b*x))+b*x)^-2*log(x))
@test integrate(x^-3*arccoth(tanh(a+b*x))^-1, x) == :((1/2)*x^-2*(-1*arccoth(tanh(a+b*x))+b*x)^-1+b*x^-1*(-1*arccoth(tanh(a+b*x))+b*x)^-2+b^2*(-1*arccoth(tanh(a+b*x))+b*x)^-3*log(arccoth(tanh(a+b*x)))+-1*b^2*(-1*arccoth(tanh(a+b*x))+b*x)^-3*log(x))
@test integrate(x^4*arccoth(tanh(a+b*x))^-2, x) == :(4//3*b^-2*x^3+-1*b^-1*x^4*arccoth(tanh(a+b*x))^-1+2*b^-3*x^2*(-1*arccoth(tanh(a+b*x))+b*x)+4*x*b^-4*(-1*arccoth(tanh(a+b*x))+b*x)^2+4*b^-5*(-1*arccoth(tanh(a+b*x))+b*x)^3*log(arccoth(tanh(a+b*x))))
@test integrate(x^3*arccoth(tanh(a+b*x))^-2, x) == :(3//2*b^-2*x^2+-1*b^-1*x^3*arccoth(tanh(a+b*x))^-1+3*x*b^-3*(-1*arccoth(tanh(a+b*x))+b*x)+3*b^-4*(-1*arccoth(tanh(a+b*x))+b*x)^2*log(arccoth(tanh(a+b*x))))
@test integrate(x^2*arccoth(tanh(a+b*x))^-2, x) == :(2*x*b^-2+b^-3*(-2*arccoth(tanh(a+b*x))+2*b*x)*log(arccoth(tanh(a+b*x)))+-1*b^-1*x^2*arccoth(tanh(a+b*x))^-1)
@test integrate(x*arccoth(tanh(a+b*x))^-2, x) == :(b^-2*log(arccoth(tanh(a+b*x)))+-1*x*b^-1*arccoth(tanh(a+b*x))^-1)
@test integrate(arccoth(tanh(a+b*x))^-2, x) == :(-1*b^-1*arccoth(tanh(a+b*x))^-1)
@test integrate(x^-1*arccoth(tanh(a+b*x))^-2, x) == :((-1*arccoth(tanh(a+b*x))+b*x)^-2*log(x)+-1*(-1*arccoth(tanh(a+b*x))+b*x)^-1*arccoth(tanh(a+b*x))^-1+-1*(-1*arccoth(tanh(a+b*x))+b*x)^-2*log(arccoth(tanh(a+b*x))))
@test integrate(x^-2*arccoth(tanh(a+b*x))^-2, x) == :(x^-1*(-1*arccoth(tanh(a+b*x))+b*x)^-1*arccoth(tanh(a+b*x))^-1+-2*b*(-1*arccoth(tanh(a+b*x))+b*x)^-3*log(arccoth(tanh(a+b*x)))+-2*b*(-1*arccoth(tanh(a+b*x))+b*x)^-2*arccoth(tanh(a+b*x))^-1+2*b*(-1*arccoth(tanh(a+b*x))+b*x)^-3*log(x))
@test integrate(x^-3*arccoth(tanh(a+b*x))^-2, x) == :((1/2)*x^-2*(-1*arccoth(tanh(a+b*x))+b*x)^-1*arccoth(tanh(a+b*x))^-1+-3*b^2*(-1*arccoth(tanh(a+b*x))+b*x)^-4*log(arccoth(tanh(a+b*x)))+-3*b^2*(-1*arccoth(tanh(a+b*x))+b*x)^-3*arccoth(tanh(a+b*x))^-1+3*b^2*(-1*arccoth(tanh(a+b*x))+b*x)^-4*log(x)+3//2*b*x^-1*(-1*arccoth(tanh(a+b*x))+b*x)^-2*arccoth(tanh(a+b*x))^-1)
@test integrate(x^4*arccoth(tanh(a+b*x))^-3, x) == :(3*b^-3*x^2+-2*b^-2*x^3*arccoth(tanh(a+b*x))^-1+6*x*b^-4*(-1*arccoth(tanh(a+b*x))+b*x)+6*b^-5*(-1*arccoth(tanh(a+b*x))+b*x)^2*log(arccoth(tanh(a+b*x)))+-1//2*b^-1*x^4*arccoth(tanh(a+b*x))^-2)
@test integrate(x^3*arccoth(tanh(a+b*x))^-3, x) == :(3*x*b^-3+b^-4*(-3*arccoth(tanh(a+b*x))+3*b*x)*log(arccoth(tanh(a+b*x)))+-3//2*b^-2*x^2*arccoth(tanh(a+b*x))^-1+-1//2*b^-1*x^3*arccoth(tanh(a+b*x))^-2)
@test integrate(x^2*arccoth(tanh(a+b*x))^-3, x) == :(b^-3*log(arccoth(tanh(a+b*x)))+-1*x*b^-2*arccoth(tanh(a+b*x))^-1+-1//2*b^-1*x^2*arccoth(tanh(a+b*x))^-2)
@test integrate(x*arccoth(tanh(a+b*x))^-3, x) == :(-1//2*b^-2*arccoth(tanh(a+b*x))^-1+-1//2*x*b^-1*arccoth(tanh(a+b*x))^-2)
@test integrate(arccoth(tanh(a+b*x))^-3, x) == :(-1//2*b^-1*arccoth(tanh(a+b*x))^-2)
@test integrate(x^-1*arccoth(tanh(a+b*x))^-3, x) == :((-1*arccoth(tanh(a+b*x))+b*x)^-3*log(arccoth(tanh(a+b*x)))+(-1*arccoth(tanh(a+b*x))+b*x)^-2*arccoth(tanh(a+b*x))^-1+-1*(-1*arccoth(tanh(a+b*x))+b*x)^-3*log(x)+-1*(-2*arccoth(tanh(a+b*x))+2*b*x)^-1*arccoth(tanh(a+b*x))^-2)
@test integrate(x^-2*arccoth(tanh(a+b*x))^-3, x) == :(x^-1*(-1*arccoth(tanh(a+b*x))+b*x)^-1*arccoth(tanh(a+b*x))^-2+-3*b*(-1*arccoth(tanh(a+b*x))+b*x)^-4*log(x)+3*b*(-1*arccoth(tanh(a+b*x))+b*x)^-4*log(arccoth(tanh(a+b*x)))+3*b*(-1*arccoth(tanh(a+b*x))+b*x)^-3*arccoth(tanh(a+b*x))^-1+-3//2*b*(-1*arccoth(tanh(a+b*x))+b*x)^-2*arccoth(tanh(a+b*x))^-2)
@test integrate(x^-3*arccoth(tanh(a+b*x))^-3, x) == :((1/2)*x^-2*(-1*arccoth(tanh(a+b*x))+b*x)^-1*arccoth(tanh(a+b*x))^-2+-6*b^2*(-1*arccoth(tanh(a+b*x))+b*x)^-5*log(x)+-3*b^2*(-1*arccoth(tanh(a+b*x))+b*x)^-3*arccoth(tanh(a+b*x))^-2+6*b^2*(-1*arccoth(tanh(a+b*x))+b*x)^-5*log(arccoth(tanh(a+b*x)))+6*b^2*(-1*arccoth(tanh(a+b*x))+b*x)^-4*arccoth(tanh(a+b*x))^-1+2*b*x^-1*(-1*arccoth(tanh(a+b*x))+b*x)^-2*arccoth(tanh(a+b*x))^-2)
@test integrate(x*arccoth(tanh(a+b*x))^n, x) == :(x*b^-1*(1+n)^-1*arccoth(tanh(a+b*x))^(1+n)+-1*b^-2*(1+n)^-1*(2+n)^-1*arccoth(tanh(a+b*x))^(2+n))
@test integrate(arccoth(tanh(a+b*x))^n, x) == :(b^-1*(1+n)^-1*arccoth(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*arccoth(coth(a+b*x)), x) == :(-1//12*b*x^4+1//3*x^3*arccoth(coth(a+b*x)))
@test integrate(x*arccoth(coth(a+b*x)), x) == :((1/2)*x^2*arccoth(coth(a+b*x))+-1//6*b*x^3)
@test integrate(arccoth(coth(a+b*x)), x) == :((1/2)*b^-1*arccoth(coth(a+b*x))^2)
@test integrate(x^-1*arccoth(coth(a+b*x)), x) == :(b*x+-1*(-1*arccoth(coth(a+b*x))+b*x)*log(x))
@test integrate(x^-2*arccoth(coth(a+b*x)), x) == :(b*log(x)+-1*x^-1*arccoth(coth(a+b*x)))
@test integrate(x^-3*arccoth(coth(a+b*x)), x) == :(-1//2*b*x^-1+-1//2*x^-2*arccoth(coth(a+b*x)))
@test integrate(arccoth(cosh(x)), x) == :(-1*Polylogarithms.polylog(2,-1*exp(x))+x*arccoth(cosh(x))+-2*x*arctanh(exp(x))+Polylogarithms.polylog(2,exp(x)))
@test integrate(x*arccoth(cosh(x)), x) == :(-1*Polylogarithms.polylog(3,exp(x))+x*Polylogarithms.polylog(2,exp(x))+(1/2)*x^2*arccoth(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*arccoth(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*arccoth(cosh(x)))
@test integrate(x^2*arccoth(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*arccoth(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*arccoth(c+d*tanh(a+b*x)), x) == :((1/2)*x^2*arccoth(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(arccoth(c+d*tanh(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(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*arccoth(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*arccoth(1+d+d*tanh(a+b*x)), x) == :((1/2)*x^2*arccoth(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(arccoth(1+d+d*tanh(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(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*arccoth(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*arccoth(1+-1d+-1*d*tanh(a+b*x)), x) == :((1/2)*x^2*arccoth(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(arccoth(1+-1d+-1*d*tanh(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(c+d*coth(a+b*x)), x) == :((1/2)*x^2*arccoth(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(arccoth(c+d*coth(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(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*arccoth(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*arccoth(1+d+d*coth(a+b*x)), x) == :((1/2)*x^2*arccoth(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(arccoth(1+d+d*coth(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(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*arccoth(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*arccoth(1+-1d+-1*d*coth(a+b*x)), x) == :((1/2)*x^2*arccoth(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(arccoth(1+-1d+-1*d*coth(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(tan(a+b*x)), x) == :(1//3*f^-1*(e+f*x)^3*arccoth(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)*arccoth(tan(a+b*x)), x) == :((1/2)*f^-1*(e+f*x)^2*arccoth(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(arccoth(tan(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(c+d*tan(a+b*x)), x) == :((1/2)*x^2*arccoth(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(arccoth(c+d*tan(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(1+d*tan(a+b*x)+-1*im*d), x) == :((1/2)*x^2*arccoth(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(arccoth(1+d*tan(a+b*x)+-1*im*d), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(1+im*d+-1*d*tan(a+b*x)), x) == :((1/2)*x^2*arccoth(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(arccoth(1+im*d+-1*d*tan(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(cot(a+b*x)), x) == :(1//3*f^-1*(e+f*x)^3*arccoth(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)*arccoth(cot(a+b*x)), x) == :((1/2)*f^-1*(e+f*x)^2*arccoth(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(arccoth(cot(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(c+d*cot(a+b*x)), x) == :((1/2)*x^2*arccoth(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(arccoth(c+d*cot(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(1+im*d+d*cot(a+b*x)), x) == :((1/2)*x^2*arccoth(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(arccoth(1+im*d+d*cot(a+b*x)), x) == :(x*arccoth(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*arccoth(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*arccoth(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*arccoth(1+-1*im*d+-1*d*cot(a+b*x)), x) == :((1/2)*x^2*arccoth(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(arccoth(1+-1*im*d+-1*d*cot(a+b*x)), x) == :(x*arccoth(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(x^-1*(a+b*arccoth(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,-1*c^-1*x^(-1n))+-1//2*b*d*n^-1*Polylogarithms.polylog(2,c^-1*x^(-1n))+(1/2)*b*e*m*n^-2*Polylogarithms.polylog(3,-1*c^-1*x^(-1n))+(1/2)*b*e*n^-1*Polylogarithms.polylog(2,-1*c^-1*x^(-1n))*log(f*x^m)+-1//2*b*e*m*n^-2*Polylogarithms.polylog(3,c^-1*x^(-1n))+-1//2*b*e*n^-1*Polylogarithms.polylog(2,c^-1*x^(-1n))*log(f*x^m))
@test integrate(x^3*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2)), x) == :(-1//8*e*x^4*(a+b*arccoth(c*x))+1//4*x^4*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2))+-2//3*b*e*x*c^-3+-1//4*e*c^-4*(a+b*arccoth(c*x))*log(1+-1*c^2*x^2)+-1//4*e*c^-2*x^2*(a+b*arccoth(c*x))+-1//8*b*c^-4*(-3*e+2d)*arctanh(c*x)+-1//18*b*e*c^-1*x^3+1//8*b*x*c^-3*(-3*e+2d)+1//24*b*c^-1*x^3*(-1*e+2d)+2//3*b*e*c^-4*arctanh(c*x)+1//4*b*e*x*c^-3*log(1+-1*c^2*x^2)+1//12*b*e*c^-1*x^3*log(1+-1*c^2*x^2))
@test integrate(x*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2)), x) == :((1/2)*d*x^2*(a+b*arccoth(c*x))+-1//2*e*x^2*(a+b*arccoth(c*x))+b*e*c^-2*arctanh(c*x)+(1/2)*b*x*c^-1*(d+-1*e)+-1*b*e*x*c^-1+-1//2*b*c^-2*(d+-1*e)*arctanh(c*x)+(1/2)*b*e*x*c^-1*log(1+-1*c^2*x^2)+-1//2*e*c^-2*(1+-1*c^2*x^2)*(a+b*arccoth(c*x))*log(1+-1*c^2*x^2))
@test integrate(x^-1*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2)), x) == :(a*d*log(x)+b*e*Polylogarithms.polylog(3,c^-1*(c+x^-1))+b*e*Polylogarithms.polylog(3,-1*c^-1*x^-1)+(1/2)*b*d*Polylogarithms.polylog(2,-1*c^-1*x^-1)+-1*b*e*Polylogarithms.polylog(3,c^-1*x^-1)+-1*b*e*Polylogarithms.polylog(3,1+-1*c^-1*x^-1)+-1//2*a*e*Polylogarithms.polylog(2,c^2*x^2)+-1//2*b*d*Polylogarithms.polylog(2,c^-1*x^-1)+b*e*Polylogarithms.polylog(2,1+-1*c^-1*x^-1)*log(1+-1*c^-1*x^-1)+(1/2)*b*e*log(1+-1*c^-1*x^-1)^2*log(c^-1*x^-1)+(1/2)*b*e*(-1*log(1+-1*c^2*x^2)+log(-1*c^2*x^2)+log(1+c^-1*x^-1)+log(1+-1*c^-1*x^-1))*Polylogarithms.polylog(2,c^-1*x^-1)+(1/2)*b*e*Polylogarithms.polylog(2,-1*c^-1*x^-1)*log(-1*c^2*x^2)+-1*b*e*Polylogarithms.polylog(2,c^-1*(c+x^-1))*log(c^-1*(c+x^-1))+-1//2*b*e*log(1+c^-1*x^-1)^2*log(-1*c^-1*x^-1)+-1//2*b*e*(-1*log(1+-1*c^2*x^2)+log(-1*c^2*x^2)+log(1+c^-1*x^-1)+log(1+-1*c^-1*x^-1))*Polylogarithms.polylog(2,-1*c^-1*x^-1)+-1//2*b*e*Polylogarithms.polylog(2,c^-1*x^-1)*log(-1*c^2*x^2))
@test integrate(x^-3*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2)), x) == :(-1//2*x^-2*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2))+e*c^2*((1/2)*a+(1/2)*b)*log(1+-1*c*x)+e*c^2*((1/2)*a+-1//2*b)*log(1+c*x)+(1/2)*b*e*c^2*Polylogarithms.polylog(2,1+-2*(1+-1*c*x)^-1)+(1/2)*b*e*c^2*Polylogarithms.polylog(2,-1+2*(1+c*x)^-1)+(1/2)*b*c^2*(d+e*log(1+-1*c^2*x^2))*arctanh(c*x)+-1*a*e*c^2*log(x)+-1//2*b*c*x^-1*(d+e*log(1+-1*c^2*x^2))+-1//2*b*e*c^2*arccoth(c*x)^2+-1//2*b*e*c^2*arctanh(c*x)^2+b*e*c^2*arctanh(c*x)*log(2*(1+-1*c*x)^-1)+-1*b*e*c^2*arccoth(c*x)*log(2+-2*(1+c*x)^-1))
@test integrate(x^-5*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2)), x) == :(-1//4*x^-4*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2))+e*c^4*(-1//3*b+1//4*a)*log(1+c*x)+e*c^4*(1//3*b+1//4*a)*log(1+-1*c*x)+-1//2*a*e*c^4*log(x)+-1//4*b*e*c^4*arccoth(c*x)^2+-1//4*b*e*c^4*arctanh(c*x)^2+-1//4*b*e*c^4*arctanh(c*x)+-1//4*b*c^3*x^-1*(d+e*log(1+-1*c^2*x^2))+-1//12*b*c*x^-3*(d+e*log(1+-1*c^2*x^2))+1//4*a*e*c^2*x^-2+1//4*b*e*c^4*Polylogarithms.polylog(2,1+-2*(1+-1*c*x)^-1)+1//4*b*e*c^4*Polylogarithms.polylog(2,-1+2*(1+c*x)^-1)+1//4*b*c^4*(d+e*log(1+-1*c^2*x^2))*arctanh(c*x)+5//12*b*e*c^3*x^-1+(1/2)*b*e*c^4*arctanh(c*x)*log(2*(1+-1*c*x)^-1)+-1//2*b*e*c^4*arccoth(c*x)*log(2+-2*(1+c*x)^-1)+1//4*b*e*c^2*x^-2*arccoth(c*x))
@test integrate(x^4*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2)), x) == :(-2//25*a*e*x^5+1//5*x^5*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2))+-77//300*b*e*c^-3*x^2+-23//75*b*e*c^-5*log(1+-1*c^2*x^2)+-9//200*b*e*c^-1*x^4+-2//5*a*e*x*c^-4+-2//15*a*e*c^-2*x^3+-2//25*b*e*x^5*arccoth(c*x)+-1//20*b*e*c^-5*log(1+-1*c^2*x^2)^2+-1//20*e*c^-5*(3b+4a)*log(1+-1*c*x)+1//5*b*e*c^-5*arccoth(c*x)^2+1//10*b*c^-5*(d+e*log(1+-1*c^2*x^2))*log(1+-1*c^2*x^2)+1//10*b*c^-3*x^2*(d+e*log(1+-1*c^2*x^2))+1//20*b*c^-1*x^4*(d+e*log(1+-1*c^2*x^2))+1//20*e*c^-5*(-3b+4a)*log(1+c*x)+-2//5*b*e*x*c^-4*arccoth(c*x)+-2//15*b*e*c^-2*x^3*arccoth(c*x))
@test integrate(x^2*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2)), x) == :(-2//9*a*e*x^3+1//3*x^3*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2))+-5//18*b*e*c^-1*x^2+-4//9*b*e*c^-3*log(1+-1*c^2*x^2)+-2//3*a*e*x*c^-2+-2//9*b*e*x^3*arccoth(c*x)+-1//6*e*c^-3*(b+2a)*log(1+-1*c*x)+-1//12*b*e*c^-3*log(1+-1*c^2*x^2)^2+1//3*b*e*c^-3*arccoth(c*x)^2+1//6*b*c^-1*x^2*(d+e*log(1+-1*c^2*x^2))+1//6*b*c^-3*(d+e*log(1+-1*c^2*x^2))*log(1+-1*c^2*x^2)+1//6*e*c^-3*(-1b+2a)*log(1+c*x)+-2//3*b*e*x*c^-2*arccoth(c*x))
@test integrate((a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2)), x) == :(x*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2))+-2*a*e*x+e*b^-1*c^-1*(a+b*arccoth(c*x))^2+-1*b*e*c^-1*log(1+-1*c^2*x^2)+-2*b*e*x*arccoth(c*x)+1//4*b*c^-1*e^-1*(d+e*log(1+-1*c^2*x^2))^2)
@test integrate(x^-2*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2)), x) == :(-1*x^-1*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2))+(1/2)*b*c*(d+e*log(1+-1*c^2*x^2))*log(1+-1*(1+-1*c^2*x^2)^-1)+-1*c*e*b^-1*(a+b*arccoth(c*x))^2+-1//2*b*c*e*Polylogarithms.polylog(2,(1+-1*c^2*x^2)^-1))
@test integrate(x^-4*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2)), x) == :(-1//3*x^-3*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2))+-1*b*e*c^3*log(x)+-1//3*e*b^-1*c^3*(a+b*arccoth(c*x))^2+-1//6*b*e*c^3*Polylogarithms.polylog(2,(1+-1*c^2*x^2)^-1)+1//3*b*e*c^3*log(1+-1*c^2*x^2)+1//6*b*c^3*(d+e*log(1+-1*c^2*x^2))*log(1+-1*(1+-1*c^2*x^2)^-1)+2//3*e*c^2*x^-1*(a+b*arccoth(c*x))+-1//6*b*c*x^-2*(1+-1*c^2*x^2)*(d+e*log(1+-1*c^2*x^2)))
@test integrate(x^-6*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2)), x) == :(-1//5*x^-5*(a+b*arccoth(c*x))*(d+e*log(1+-1*c^2*x^2))+-5//6*b*e*c^5*log(x)+-1//5*e*b^-1*c^5*(a+b*arccoth(c*x))^2+-1//10*b*e*c^5*Polylogarithms.polylog(2,(1+-1*c^2*x^2)^-1)+-1//20*b*c*x^-4*(d+e*log(1+-1*c^2*x^2))+1//10*b*c^5*(d+e*log(1+-1*c^2*x^2))*log(1+-1*(1+-1*c^2*x^2)^-1)+2//5*e*c^4*x^-1*(a+b*arccoth(c*x))+2//15*e*c^2*x^-3*(a+b*arccoth(c*x))+7//60*b*e*c^3*x^-2+19//60*b*e*c^5*log(1+-1*c^2*x^2)+-1//10*b*c^3*x^-2*(1+-1*c^2*x^2)*(d+e*log(1+-1*c^2*x^2)))
@test integrate(x*(a+b*arccoth(c*x))*(d+e*log(f+g*x^2)), x) == :((1/2)*d*x^2*(a+b*arccoth(c*x))+-1//2*e*x^2*(a+b*arccoth(c*x))+(1/2)*b*x*c^-1*(d+-1*e)+-1*b*e*x*c^-1+-1//2*b*c^-2*(d+-1*e)*arctanh(c*x)+(1/2)*b*e*x*c^-1*log(f+g*x^2)+(1/2)*e*g^-1*(a+b*arccoth(c*x))*(f+g*x^2)*log(f+g*x^2)+b*e*c^-1*f^(1/2)*g^-1//2*arctan(x*f^-1//2*g^(1/2))+(1/2)*b*e*c^-2*g^-1*(g+f*c^2)*Polylogarithms.polylog(2,1+-2*(1+c*x)^-1)+-1//4*b*e*c^-2*g^-1*(g+f*c^2)*Polylogarithms.polylog(2,1+-2*c*(1+c*x)^-1*(g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+x*g^(1/2)))+-1//4*b*e*c^-2*g^-1*(g+f*c^2)*Polylogarithms.polylog(2,1+-2*c*(1+c*x)^-1*(-1*g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+-1*x*g^(1/2)))+(1/2)*b*e*c^-2*g^-1*(g+f*c^2)*arctanh(c*x)*log(2*c*(1+c*x)^-1*(g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+x*g^(1/2)))+(1/2)*b*e*c^-2*g^-1*(g+f*c^2)*arctanh(c*x)*log(2*c*(1+c*x)^-1*(-1*g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+-1*x*g^(1/2)))+-1*b*e*c^-2*g^-1*(g+f*c^2)*arctanh(c*x)*log(2*(1+c*x)^-1)+-1//2*b*e*c^-2*g^-1*(g+f*c^2)*arctanh(c*x)*log(f+g*x^2))
@test integrate((a+b*arccoth(c*x))*(d+e*log(f+g*x^2)), x) == :(x*(a+b*arccoth(c*x))*(d+e*log(f+g*x^2))+-2*a*e*x+(1/2)*b*e*c^-1*Polylogarithms.polylog(2,c^2*(g+f*c^2)^-1*(f+g*x^2))+(1/2)*b*c^-1*(d+e*log(f+g*x^2))*log(g*(g+f*c^2)^-1*(1+-1*c^2*x^2))+-1*b*e*c^-1*log(1+-1*c^2*x^2)+-2*b*e*x*arccoth(c*x)+2*a*e*f^(1/2)*g^-1//2*arctan(x*f^-1//2*g^(1/2))+b*e*f^(1/2)*g^-1//2*arctan(x*f^-1//2*g^(1/2))*log(-2*f^(1/2)*g^(1/2)*(f^(1/2)+-1*im*x*g^(1/2))^-1*(-1*g^(1/2)+im*c*f^(1/2))^-1*(1+-1*c*x))+b*e*f^(1/2)*g^-1//2*arctan(x*f^-1//2*g^(1/2))*log(1+c^-1*x^-1)+(1/2)*im*b*e*f^(1/2)*g^-1//2*Polylogarithms.polylog(2,1+-2*f^(1/2)*g^(1/2)*(f^(1/2)+-1*im*x*g^(1/2))^-1*(g^(1/2)+im*c*f^(1/2))^-1*(1+c*x))+-1*b*e*f^(1/2)*g^-1//2*arctan(x*f^-1//2*g^(1/2))*log(2*f^(1/2)*g^(1/2)*(f^(1/2)+-1*im*x*g^(1/2))^-1*(g^(1/2)+im*c*f^(1/2))^-1*(1+c*x))+-1*b*e*f^(1/2)*g^-1//2*arctan(x*f^-1//2*g^(1/2))*log(1+-1*c^-1*x^-1)+-1//2*im*b*e*f^(1/2)*g^-1//2*Polylogarithms.polylog(2,1+2*f^(1/2)*g^(1/2)*(f^(1/2)+-1*im*x*g^(1/2))^-1*(-1*g^(1/2)+im*c*f^(1/2))^-1*(1+-1*c*x)))
@test integrate(x^-2*(a+b*arccoth(c*x))*(d+e*log(f+g*x^2)), x) == :(-1*x^-1*(a+b*arccoth(c*x))*(d+e*log(f+g*x^2))+(1/2)*b*c*e*Polylogarithms.polylog(2,1+g*f^-1*x^2)+(1/2)*b*c*(d+e*log(f+g*x^2))*log(-1*g*f^-1*x^2)+-1//2*b*c*e*Polylogarithms.polylog(2,c^2*(g+f*c^2)^-1*(f+g*x^2))+-1//2*b*c*(d+e*log(f+g*x^2))*log(g*(g+f*c^2)^-1*(1+-1*c^2*x^2))+2*a*e*f^-1//2*g^(1/2)*arctan(x*f^-1//2*g^(1/2))+b*e*f^-1//2*g^(1/2)*arctan(x*f^-1//2*g^(1/2))*log(-2*f^(1/2)*g^(1/2)*(f^(1/2)+-1*im*x*g^(1/2))^-1*(-1*g^(1/2)+im*c*f^(1/2))^-1*(1+-1*c*x))+b*e*f^-1//2*g^(1/2)*arctan(x*f^-1//2*g^(1/2))*log(1+c^-1*x^-1)+(1/2)*im*b*e*f^-1//2*g^(1/2)*Polylogarithms.polylog(2,1+-2*f^(1/2)*g^(1/2)*(f^(1/2)+-1*im*x*g^(1/2))^-1*(g^(1/2)+im*c*f^(1/2))^-1*(1+c*x))+-1*b*e*f^-1//2*g^(1/2)*arctan(x*f^-1//2*g^(1/2))*log(2*f^(1/2)*g^(1/2)*(f^(1/2)+-1*im*x*g^(1/2))^-1*(g^(1/2)+im*c*f^(1/2))^-1*(1+c*x))+-1*b*e*f^-1//2*g^(1/2)*arctan(x*f^-1//2*g^(1/2))*log(1+-1*c^-1*x^-1)+-1//2*im*b*e*f^-1//2*g^(1/2)*Polylogarithms.polylog(2,1+2*f^(1/2)*g^(1/2)*(f^(1/2)+-1*im*x*g^(1/2))^-1*(-1*g^(1/2)+im*c*f^(1/2))^-1*(1+-1*c*x)))
@test integrate(x^-3*(a+b*arccoth(c*x))*(d+e*log(f+g*x^2)), x) == :(-1//2*x^-2*(a+b*arccoth(c*x))*(d+e*log(f+g*x^2))+(1/2)*b*c^2*(d+e*log(f+g*x^2))*arctanh(c*x)+-1//2*b*c*x^-1*(d+e*log(f+g*x^2))+-1//2*b*e*c^2*Polylogarithms.polylog(2,1+-2*(1+c*x)^-1)+1//4*b*e*c^2*Polylogarithms.polylog(2,1+-2*c*(1+c*x)^-1*(g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+x*g^(1/2)))+1//4*b*e*c^2*Polylogarithms.polylog(2,1+-2*c*(1+c*x)^-1*(-1*g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+-1*x*g^(1/2)))+a*e*g*f^-1*log(x)+b*e*c^2*arctanh(c*x)*log(2*(1+c*x)^-1)+(1/2)*b*e*g*f^-1*Polylogarithms.polylog(2,-1*c^-1*x^-1)+-1//2*a*e*g*f^-1*log(f+g*x^2)+-1//2*b*e*g*f^-1*Polylogarithms.polylog(2,c^-1*x^-1)+-1//2*b*e*g*f^-1*Polylogarithms.polylog(2,1+-2*(1+c*x)^-1)+-1//2*b*e*c^2*arctanh(c*x)*log(2*c*(1+c*x)^-1*(g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+x*g^(1/2)))+-1//2*b*e*c^2*arctanh(c*x)*log(2*c*(1+c*x)^-1*(-1*g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+-1*x*g^(1/2)))+1//4*b*e*g*f^-1*Polylogarithms.polylog(2,1+-2*c*(1+c*x)^-1*(g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+x*g^(1/2)))+1//4*b*e*g*f^-1*Polylogarithms.polylog(2,1+-2*c*(1+c*x)^-1*(-1*g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+-1*x*g^(1/2)))+b*c*e*f^-1//2*g^(1/2)*arctan(x*f^-1//2*g^(1/2))+b*e*g*f^-1*arccoth(c*x)*log(2*(1+c*x)^-1)+-1//2*b*e*g*f^-1*arccoth(c*x)*log(2*c*(1+c*x)^-1*(g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+x*g^(1/2)))+-1//2*b*e*g*f^-1*arccoth(c*x)*log(2*c*(1+c*x)^-1*(-1*g^(1/2)+c*(-1*f)^(1/2))^-1*((-1*f)^(1/2)+-1*x*g^(1/2))))
@test integrate(arccoth(exp(x)), x) == :((1/2)*Polylogarithms.polylog(2,-1*exp(-1x))+-1//2*Polylogarithms.polylog(2,exp(-1x)))
@test integrate(x*arccoth(exp(x)), x) == :((1/2)*Polylogarithms.polylog(3,-1*exp(-1x))+-1//2*Polylogarithms.polylog(3,exp(-1x))+(1/2)*x*Polylogarithms.polylog(2,-1*exp(-1x))+-1//2*x*Polylogarithms.polylog(2,exp(-1x)))
@test integrate(x^2*arccoth(exp(x)), x) == :(-1*Polylogarithms.polylog(4,exp(-1x))+x*Polylogarithms.polylog(3,-1*exp(-1x))+(1/2)*x^2*Polylogarithms.polylog(2,-1*exp(-1x))+-1*x*Polylogarithms.polylog(3,exp(-1x))+-1//2*x^2*Polylogarithms.polylog(2,exp(-1x))+Polylogarithms.polylog(4,-1*exp(-1x)))
@test integrate(arccoth(exp(a+b*x)), x) == :((1/2)*b^-1*Polylogarithms.polylog(2,-1*exp(-1a+-1*b*x))+-1//2*b^-1*Polylogarithms.polylog(2,exp(-1a+-1*b*x)))
@test integrate(x*arccoth(exp(a+b*x)), x) == :((1/2)*b^-2*Polylogarithms.polylog(3,-1*exp(-1a+-1*b*x))+-1//2*b^-2*Polylogarithms.polylog(3,exp(-1a+-1*b*x))+(1/2)*x*b^-1*Polylogarithms.polylog(2,-1*exp(-1a+-1*b*x))+-1//2*x*b^-1*Polylogarithms.polylog(2,exp(-1a+-1*b*x)))
@test integrate(x^2*arccoth(exp(a+b*x)), x) == :(b^-3*Polylogarithms.polylog(4,-1*exp(-1a+-1*b*x))+-1*b^-3*Polylogarithms.polylog(4,exp(-1a+-1*b*x))+x*b^-2*Polylogarithms.polylog(3,-1*exp(-1a+-1*b*x))+(1/2)*b^-1*x^2*Polylogarithms.polylog(2,-1*exp(-1a+-1*b*x))+-1*x*b^-2*Polylogarithms.polylog(3,exp(-1a+-1*b*x))+-1//2*b^-1*x^2*Polylogarithms.polylog(2,exp(-1a+-1*b*x)))
@test integrate(arccoth(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*arccoth(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*arccoth(a+b*f^(c+d*x))*log(2*(1+a+b*f^(c+d*x))^-1))
@test integrate(x*arccoth(a+b*f^(c+d*x)), x) == :(-1//4*x^2*log(1+-1*(a+b*f^(c+d*x))^-1)+-1//4*x^2*log(1+b*f^(c+d*x)*(1+a)^-1)+1//4*x^2*log(1+(a+b*f^(c+d*x))^-1)+1//4*x^2*log(1+-1*b*f^(c+d*x)*(1+-1a)^-1)+(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*arccoth(a+b*f^(c+d*x)), x) == :(-1//6*x^3*log(1+-1*(a+b*f^(c+d*x))^-1)+-1//6*x^3*log(1+b*f^(c+d*x)*(1+a)^-1)+1//6*x^3*log(1+(a+b*f^(c+d*x))^-1)+1//6*x^3*log(1+-1*b*f^(c+d*x)*(1+-1a)^-1)+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((a+-1*a*x^2)^-1*(b+-2*b*arccoth(x))^-1, x) == :(-1//2*a^-1*b^-1*log(1+-2*arccoth(x)))
@test integrate(x^3*arccoth(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)*arccoth(a+b*x^4))
@test integrate(x^(-1+n)*arccoth(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)*arccoth(a+b*x^n))
@test integrate(arccoth(sinh(a*c+b*c*x))*exp(c*(a+b*x)), x) == :(b^-1*c^-1*arccoth(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(arccoth(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*arccoth(cosh(c*(a+b*x)))*exp(a*c+b*c*x))
@test integrate(arccoth(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*arccoth(tanh(c*(a+b*x)))*exp(a*c+b*c*x))
@test integrate(arccoth(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*arccoth(coth(c*(a+b*x)))*exp(a*c+b*c*x))
@test integrate(arccoth(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*arccoth(sech(c*(a+b*x)))*exp(a*c+b*c*x))
@test integrate(arccoth(csch(a*c+b*c*x))*exp(c*(a+b*x)), x) == :(b^-1*c^-1*arccoth(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)))

max_stars_repo_path: test/7 Inverse hyperbolic functions/7.4 Inverse hyperbolic cotangent/7.4.1 Inverse hyperbolic cotangent functions.jl


text:
# Silhouette

# this function returns r of size (k, n), such that
# r[i, j] is the sum of distances of all points from cluster i to sample j
#
function sil_aggregate_dists(k::Int, a::AbstractVector{Int}, dists::AbstractMatrix{T}) where T<:Real
    n = length(a)
    S = typeof((one(T)+one(T))/2)
    r = zeros(S, k, n)
    @inbounds for j = 1:n
        for i = 1:j-1
            r[a[i],j] += dists[i,j]
        end
        for i = j+1:n
            r[a[i],j] += dists[i,j]
        end
    end
    return r
end

"""
    silhouettes(assignments::AbstractVector, [counts,] dists)
    silhouettes(clustering::ClusteringResult, dists)

Compute silhouette values for individual points w.r.t. given clustering.

  * `assignments` the vector of point assignments (cluster indices)
  * `counts` the optional vector of cluster sizes (how many points assigned to each cluster; should match `assignments`)
  * `clustering` the output of some clustering method
  * `dists` point×point pairwise distance matrix

Returns a vector of silhouette values for each individual point.

`mean(silhouettes(...))` could be used as a measure of clustering quality;
higher values indicate better separation of clusters w.r.t. distances provided in `dists`.

#### References
  1. [Silhouette Wikipedia page](http://en.wikipedia.org/wiki/Silhouette_(clustering)).
  2. Peter J. Rousseeuw (1987). "Silhouettes: a Graphical Aid to the Interpretation and Validation of Cluster Analysis". Computational and Applied Mathematics. 20: 53–65.
"""
function silhouettes(assignments::AbstractVector{<:Integer},
                     counts::AbstractVector{<:Integer},
                     dists::AbstractMatrix{T}) where T<:Real

    n = length(assignments)
    k = length(counts)
    k >= 2 || throw(ArgumentError("silhouettes() not defined for the degenerated clustering with a single cluster."))
    for j = 1:n
        (1 <= assignments[j] <= k) || throw(ArgumentError("Bad assignments[$j]=$(assignments[j]): should be in 1:$k range."))
    end
    sum(counts) == n || throw(ArgumentError("Mismatch between assignments ($n) and counts (sum(counts)=$(sum(counts)))."))
    size(dists) == (n, n) || throw(DimensionMismatch("The size of a distance matrix ($(size(dists))) doesn't match the length of assignment vector ($n)."))

    # compute average distance from each cluster to each point --> r
    r = sil_aggregate_dists(k, assignments, dists)
    # from sum to average
    @inbounds for j = 1:n
        for i = 1:k
            c = counts[i]
            if i == assignments[j]
                c -= 1
            end
            if c == 0
                r[i,j] = 0
            else
                r[i,j] /= c
            end
        end
    end

    # compute a and b
    # a: average distance w.r.t. the assigned cluster
    # b: the minimum average distance w.r.t. other cluster
    a = similar(r, n)
    b = similar(r, n)

    for j = 1:n
        l = assignments[j]
        a[j] = r[l, j]

        v = typemax(eltype(b))
        for i = 1:k
            @inbounds rij = r[i,j]
            if (i != l) && (rij < v)
                v = rij
            end
        end
        b[j] = v
    end

    # compute silhouette score
    sil = a   # reuse the memory of a for sil
    for j = 1:n
        if counts[assignments[j]] == 1
            sil[j] = 0
        else
            #If both a[i] and b[i] are equal to 0 or Inf, silhouettes is defined as 0
            @inbounds sil[j] = a[j] < b[j] ? 1 - a[j]/b[j] :
                               a[j] > b[j] ? b[j]/a[j] - 1 :
                               zero(eltype(r))
        end
    end
    return sil
end

silhouettes(R::ClusteringResult, dists::AbstractMatrix) =
    silhouettes(assignments(R), counts(R), dists)

function silhouettes(assignments::AbstractVector{<:Integer}, dists::AbstractMatrix)
    counts = fill(0, maximum(assignments))
    for a in assignments
        counts[a] += 1
    end
    silhouettes(assignments, counts, dists)
end

ext: jl


text:
# applies the jacobi preconditioner of the laplacian (diagonal entries)
function jacobi{Tv,Ti}(la::SparseMatrixCSC{Tv,Ti})

	d = diag(la)

	f = function(b::Array{Float64,1})
		res = copy(b) - mean(b)

		res = res ./ d

		return res - mean(res)
	end

	return f

end

# applies the gauss siedel preconditioner. precond = (D + L) * D^-1 * (D + U)
function gs{Tv,Ti}(la::SparseMatrixCSC{Tv,Ti})

	m1 = LowerTriangular(la)
	m2 = 1 ./ diag(la)
	m3 = UpperTriangular(la)

	f = function(b::Array{Float64,1})
		res = copy(b) - mean(b)

		res = m3 \ res
		res = res ./ m2
		res = m1 \ res

		return res - mean(res)
	end

	return f

end


text:
### A Pluto.jl notebook ###
# v0.18.1

using Markdown
using InteractiveUtils

# ╔═╡ 34a6ee83-5c46-4661-910e-925ea33ef625
begin
	let
		using Pkg
		Pkg.activate(mktempdir())
		Pkg.Registry.update()
		Pkg.add("PlutoUI")
		Pkg.add("Statistics")
		Pkg.add("StatsBase")
		Pkg.add("ImageMorphology")
		Pkg.add("ImageFiltering")
		Pkg.add("CSV")
		Pkg.add("DataFrames")
		Pkg.add("GLM")
		Pkg.add(url="https://github.com/JuliaHealth/DICOM.jl")
		Pkg.add(url="https://github.com/Dale-Black/DICOMUtils.jl")
		Pkg.add(url="https://github.com/Dale-Black/PhantomSegmentation.jl")
		Pkg.add(url="https://github.com/Dale-Black/CalciumScoring.jl")
	end

	using PlutoUI
	using Statistics
	using StatsBase: quantile!
	using ImageMorphology
	using ImageFiltering
	using CSV
	using DataFrames
	using GLM
	using DICOM
	using DICOMUtils
	using PhantomSegmentation
	using CalciumScoring
end

# ╔═╡ c34ae2e3-466f-4280-8786-b0e92dbb2792
TableOfContents()

# ╔═╡ ff0a6e93-9c5e-4ac2-af02-ce253b535c6b
begin
	VENDER = "Canon_Aquilion_One_Vision"
	BASE_PATH = "/Users/daleblack/Google Drive/Datasets/"
end;

# ╔═╡ 7d8366d8-9cc5-49b3-8db3-1b9db6d12c92
scans = collect(1:10)

# ╔═╡ 60fe5916-a1a6-11ec-1fbe-8952690e9d06
begin
	dfs = []
	for s in scans
		SCAN_NUMBER = s
		root_path = string(BASE_PATH, VENDER)
		dcm_path_list = dcm_list_builder(root_path)
		pth = dcm_path_list[SCAN_NUMBER]
		scan = basename(pth)
		header, dcm_array, slice_thick_ori1 = dcm_reader(pth)

		# Segment Heart
		masked_array, center_insert, mask = mask_heart(header, dcm_array, size(dcm_array, 3)÷2)

		# Segment Calcium Rod
		calcium_image, slice_CCI, quality_slice, cal_rod_slice = mask_rod(masked_array, header)

		# Calibration Prep
		array_filtered = abs.(mapwindow(median, calcium_image[:, :, cal_rod_slice], (3, 3)))
		bool_arr = array_filtered .> 0
		bool_arr_erode = (((erode(erode(bool_arr)))))
		c_img = calcium_image[:, :, cal_rod_slice-1:cal_rod_slice+1]
		mask_cal_3D = Array{Bool}(undef, size(c_img))
		for z in 1:size(c_img, 3)
			mask_cal_3D[:, :, z] = bool_arr_erode
		end
		cal_insert_mean = mean(c_img[mask_cal_3D])
		# cal_insert_mean = quantile!(c_img[mask_cal_3D], 0.7)

		# Calibration line
		density_array_calc = [0, 200] # mg/cc
		intensity_array = [0, cal_insert_mean] # HU
		df_cal = DataFrame(:density => density_array_calc, :intensity => intensity_array)
		linearRegressor = lm(@formula(intensity ~ density), df_cal)
		linearFit = predict(linearRegressor)
		m = linearRegressor.model.pp.beta0[2]
		b = linearRegressor.model.rr.mu[1]
		density(intensity) = (intensity - b) / m
		intensity(ρ) = m*ρ + b

		# angle_factor = RMSE_Dict["factor"]
		angle_factor = -4
		mask_L_HD, mask_M_HD, mask_S_HD, mask_L_MD, mask_M_MD, mask_S_MD, mask_L_LD, mask_M_LD, mask_S_LD = mask_inserts(
			dcm_array, masked_array, header, slice_CCI, center_insert; angle_factor=angle_factor)

		arr = masked_array[:, :, slice_CCI-3:slice_CCI+3]
		single_arr = masked_array[:, :, slice_CCI]
		pixel_size = DICOMUtils.get_pixel_size(header)

		# Score Large InsertS
		## High Density
		mask_L_HD_3D = Array{Bool}(undef, size(arr))
		for z in 1:size(arr, 3)
			mask_L_HD_3D[:, :, z] = mask_L_HD
		end
		dilated_mask_L_HD = dilate(dilate(mask_L_HD_3D))
		ring_mask_L_HD = dilate(dilate(dilate(dilate(mask_L_HD_3D)))) - dilate(dilate(dilate(mask_L_HD_3D)))
		single_ring_mask_L_HD = Bool.(ring_mask_L_HD[:, :, 3])
		s_bkg_L_HD = mean(single_arr[single_ring_mask_L_HD])
		S_Obj_HD = intensity(800)
		ρ_hd = 0.8 # mg/mm^3
		alg_L_HD = Integrated(arr[mask_L_HD_3D])
		mass_l_hd = score(s_bkg_L_HD, S_Obj_HD, pixel_size, ρ_hd, alg_L_HD)

		## Medium Density
		mask_L_MD_3D = Array{Bool}(undef, size(arr))
		for z in 1:size(arr, 3)
			mask_L_MD_3D[:, :, z] = mask_L_MD
		end
		dilated_mask_L_MD = dilate(dilate(mask_L_MD_3D))
		ring_mask_L_MD = dilate(dilate(dilate(dilate(mask_L_MD_3D)))) - dilate(dilate(dilate(mask_L_MD_3D)))
		single_ring_mask_L_MD = Bool.(ring_mask_L_MD[:, :, 3])
		s_bkg_L_MD = mean(single_arr[single_ring_mask_L_MD])
		S_Obj_MD = intensity(400)
		ρ_md = 0.4 # mg/mm^3
		alg_L_MD = Integrated(arr[mask_L_MD_3D])
		mass_l_md = score(s_bkg_L_MD, S_Obj_MD, pixel_size, ρ_md, alg_L_MD)

		## Low Density
		mask_L_LD_3D = Array{Bool}(undef, size(arr))
		for z in 1:size(arr, 3)
			mask_L_LD_3D[:, :, z] = mask_L_LD
		end
		dilated_mask_L_LD = dilate(dilate(mask_L_LD_3D))
		ring_mask_L_LD = dilate(dilate(dilate(dilate(mask_L_LD_3D)))) - dilate(dilate(dilate(mask_L_LD_3D)))
		single_ring_mask_L_LD = Bool.(ring_mask_L_LD[:, :, 3])
		s_bkg_L_LD = mean(single_arr[single_ring_mask_L_LD])
		S_Obj_LD = intensity(200)
		ρ_ld = 0.2 # mg/mm^3
		alg_L_LD = Integrated(arr[mask_L_LD_3D])
		mass_l_ld = score(s_bkg_L_LD, S_Obj_LD, pixel_size, ρ_ld, alg_L_LD)

		# Score Medium Inserts
		## High Density
		mask_M_HD_3D = Array{Bool}(undef, size(arr))
		for z in 1:size(arr, 3)
			mask_M_HD_3D[:, :, z] = mask_M_HD
		end
		dilated_mask_M_HD = dilate(dilate(dilate(dilate(mask_M_HD_3D))))
		ring_mask_M_HD = dilate(dilate(dilate(dilate(dilate(mask_M_HD_3D))))) - dilate(dilate(dilate(dilate(mask_M_HD_3D))))
		single_ring_mask_M_HD = Bool.(ring_mask_M_HD[:, :, 3])
		s_bkg_M_HD = mean(single_arr[single_ring_mask_M_HD])
		alg_M_HD = Integrated(arr[mask_M_HD_3D])
		mass_m_hd = score(s_bkg_M_HD, S_Obj_HD, pixel_size, ρ_hd, alg_M_HD)

		## Medium Density
		mask_M_MD_3D = Array{Bool}(undef, size(arr))
		for z in 1:size(arr, 3)
			mask_M_MD_3D[:, :, z] = mask_M_MD
		end
		dilated_mask_M_MD = dilate(dilate(dilate(dilate(mask_M_MD_3D))))
		ring_mask_M_MD = dilate(dilate(dilate(dilate(dilate(dilate(mask_M_MD_3D)))))) - dilate(dilate(dilate(dilate(dilate(mask_M_MD_3D)))))
		single_ring_mask_M_MD = Bool.(ring_mask_M_MD[:, :, 3])
		s_bkg_M_MD = mean(single_arr[single_ring_mask_M_MD])
		alg_M_MD = Integrated(arr[mask_M_MD_3D])
		mass_m_md = score(s_bkg_M_MD, S_Obj_MD, pixel_size, ρ_md, alg_M_MD)

		## Low Density
		mask_M_LD_3D = Array{Bool}(undef, size(arr))
		for z in 1:size(arr, 3)
			mask_M_LD_3D[:, :, z] = mask_M_LD
		end
		dilated_mask_M_LD = dilate(dilate(dilate(dilate(dilate(mask_M_LD_3D)))))
		ring_mask_M_LD = dilate(dilate(dilate(dilate(dilate(dilate(mask_M_LD_3D)))))) - dilate(dilate(dilate(dilate(dilate(mask_M_LD_3D)))))
		single_ring_mask_M_LD = Bool.(ring_mask_M_LD[:, :, 3])
		s_bkg_M_LD = mean(single_arr[single_ring_mask_M_LD])
		alg_M_LD = Integrated(arr[mask_M_LD_3D])
		mass_m_ld = score(s_bkg_M_LD, S_Obj_LD, pixel_size, ρ_ld, alg_M_LD)

		# Score Small Inserts
		## High Density
		mask_S_HD_3D = Array{Bool}(undef, size(arr))
		for z in 1:size(arr, 3)
			mask_S_HD_3D[:, :, z] = mask_S_HD
		end
		dilated_mask_S_HD = dilate(dilate(dilate(dilate(dilate((mask_S_HD_3D))))))
		ring_mask_S_HD = dilate(dilate(dilate(dilate(dilate(mask_S_HD_3D))))) - dilate(dilate(dilate(dilate(mask_S_HD_3D))))
		single_ring_mask_S_HD = Bool.(ring_mask_S_HD[:, :, 3])
		s_bkg_S_HD = mean(single_arr[single_ring_mask_S_HD])
		alg_S_HD = Integrated(arr[mask_S_HD_3D])
		mass_s_hd = score(s_bkg_S_HD, S_Obj_HD, pixel_size, ρ_hd, alg_S_HD)

		## Medium Density
		mask_S_MD_3D = Array{Bool}(undef, size(arr))
		for z in 1:size(arr, 3)
			mask_S_MD_3D[:, :, z] = mask_S_MD
		end
		dilated_mask_S_MD = dilate(dilate(dilate(dilate(dilate(mask_S_MD_3D)))))
		ring_mask_S_MD = dilate(dilate(dilate(dilate(dilate(mask_S_MD_3D))))) - dilate(dilate(dilate(dilate(mask_S_MD_3D))))
		single_ring_mask_S_MD = Bool.(ring_mask_S_MD[:, :, 3])
		s_bkg_S_MD = mean(single_arr[single_ring_mask_S_MD])
		alg_S_MD = Integrated(arr[mask_S_MD_3D])
		mass_s_md = score(s_bkg_S_MD, S_Obj_MD, pixel_size, ρ_md, alg_S_MD)

		## Low Density
		mask_S_LD_3D = Array{Bool}(undef, size(arr))
		for z in 1:size(arr, 3)
			mask_S_LD_3D[:, :, z] = mask_S_LD
		end
		dilated_mask_S_LD = dilate(dilate(dilate(dilate(dilate(mask_S_LD_3D)))))
		ring_mask_S_LD = dilate(dilate(dilate(dilate(dilate(mask_S_LD_3D))))) - dilate(dilate(dilate(dilate(mask_S_LD_3D))))
		single_ring_mask_S_LD = Bool.(ring_mask_S_LD[:, :, 3])
		s_bkg_S_LD = mean(single_arr[single_ring_mask_S_LD])
		alg_S_LD = Integrated(arr[mask_S_LD_3D])
		mass_s_ld = score(s_bkg_S_LD, S_Obj_LD, pixel_size, ρ_ld, alg_S_LD)

		# Results
		density_array = [0, 200, 400, 800]
		inserts = [
			"Low Density",
			"Medium Density",
			"High Density"
		]
		ground_truth_mass_large = [
			19.6,
			39.3,
			78.5
		] # mg

		calculated_mass_large = [
			mass_l_ld,
			mass_l_md,
			mass_l_hd
		]
		ground_truth_mass_medium = [
			4.2,
			8.5,
			17.0
		]
		calculated_mass_medium = [
			mass_m_ld,
			mass_m_md,
			mass_m_hd
		]
		ground_truth_mass_small = [
			0.2,
			0.3,
			0.6
		]
		calculated_mass_small = [
			mass_s_ld,
			mass_s_md,
			mass_s_hd
		]

		df = DataFrame(
			scan = scan,
			inserts = inserts,
			ground_truth_mass_large = ground_truth_mass_large,
			calculated_mass_large = calculated_mass_large,
			ground_truth_mass_medium = ground_truth_mass_medium,
			calculated_mass_medium = calculated_mass_medium,
			ground_truth_mass_small = ground_truth_mass_small,
			calculated_mass_small = calculated_mass_small
		)
		push!(dfs, df)
	end
end

# ╔═╡ c8b89590-c7c4-4c40-93c4-9fd905eb3328
md"""
# Save Results
"""

# ╔═╡ 47dfa770-47ea-47ee-98e7-87da471ab01c
new_df = vcat(dfs[1:10]...)

# ╔═╡ e730f5ae-ae32-4869-9a59-98933bcba510
if ~isdir(string(cd(pwd, "..") , "/data/output/", VENDER, "_integrated_score_script"))
	mkdir(string(cd(pwd, "..") , "/data/output/", VENDER, "_integrated_score_script"))
end

# ╔═╡ 75e9e00c-9603-46e9-a009-7cdc76f1a2cc
output_path = string(cd(pwd, "..") , "/data/output/", VENDER, "_integrated_score_script", "/output.csv")

# ╔═╡ a0872982-dcbb-4278-beaf-70409400b514
CSV.write(output_path, new_df)

# ╔═╡ Cell order:
# ╠═34a6ee83-5c46-4661-910e-925ea33ef625
# ╠═c34ae2e3-466f-4280-8786-b0e92dbb2792
# ╠═ff0a6e93-9c5e-4ac2-af02-ce253b535c6b
# ╠═7d8366d8-9cc5-49b3-8db3-1b9db6d12c92
# ╠═60fe5916-a1a6-11ec-1fbe-8952690e9d06
# ╟─c8b89590-c7c4-4c40-93c4-9fd905eb3328
# ╠═47dfa770-47ea-47ee-98e7-87da471ab01c
# ╠═e730f5ae-ae32-4869-9a59-98933bcba510
# ╠═75e9e00c-9603-46e9-a009-7cdc76f1a2cc
# ╠═a0872982-dcbb-4278-beaf-70409400b514

max_stars_repo_name: MolloiLab/CAC-stanford-data

max_issues_repo_name: MolloiLab/CAC-stanford-data

max_forks_repo_name: MolloiLab/CAC-stanford-data


text:
module AWSAuth

export SignatureV4, AWS4AuthLayer

include("signaturev4.jl")

using .SignatureV4

end # module