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

@test integrate(x^4*arcsech(a*x)^2, x) == :(-3//20*x*a^-4+-1//30*a^-2*x^3+1//5*x^5*arcsech(a*x)^2+-3//10*a^-5*arcsech(a*x)*arctan(exp(arcsech(a*x)))+-3//20*im*a^-5*Polylogarithms.polylog(2,im*exp(arcsech(a*x)))+3//20*im*a^-5*Polylogarithms.polylog(2,-1*im*exp(arcsech(a*x)))+-3//20*x*a^-4*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)*arcsech(a*x)+-1//10*a^-2*x^3*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)*arcsech(a*x))
@test integrate(x^3*arcsech(a*x)^2, x) == :(-1//3*a^-4*log(x)+-1//12*a^-2*x^2+1//4*x^4*arcsech(a*x)^2+-1//3*a^-4*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)*arcsech(a*x)+-1//6*a^-2*x^2*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)*arcsech(a*x))
@test integrate(x^2*arcsech(a*x)^2, x) == :(-1//3*x*a^-2+1//3*x^3*arcsech(a*x)^2+-2//3*a^-3*arcsech(a*x)*arctan(exp(arcsech(a*x)))+-1//3*im*a^-3*Polylogarithms.polylog(2,im*exp(arcsech(a*x)))+1//3*im*a^-3*Polylogarithms.polylog(2,-1*im*exp(arcsech(a*x)))+-1//3*x*a^-2*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)*arcsech(a*x))
@test integrate(x*arcsech(a*x)^2, x) == :((1/2)*x^2*arcsech(a*x)^2+-1*a^-2*log(x)+-1*a^-2*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)*arcsech(a*x))
@test integrate(arcsech(a*x)^2, x) == :(x*arcsech(a*x)^2+-4*a^-1*arcsech(a*x)*arctan(exp(arcsech(a*x)))+-2*im*a^-1*Polylogarithms.polylog(2,im*exp(arcsech(a*x)))+2*im*a^-1*Polylogarithms.polylog(2,-1*im*exp(arcsech(a*x))))
@test integrate(x^-1*arcsech(a*x)^2, x) == :((1/2)*Polylogarithms.polylog(3,-1*exp(2*arcsech(a*x)))+1//3*arcsech(a*x)^3+-1*arcsech(a*x)^2*log(1+exp(2*arcsech(a*x)))+-1*Polylogarithms.polylog(2,-1*exp(2*arcsech(a*x)))*arcsech(a*x))
@test integrate(x^-2*arcsech(a*x)^2, x) == :(-2*x^-1+-1*x^-1*arcsech(a*x)^2+2*x^-1*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)*arcsech(a*x))
@test integrate(x^-3*arcsech(a*x)^2, x) == :(-1//4*a^2*arcsech(a*x)^2+-1//4*x^-2*(1+a*x)*(1+-1*a*x)+(1/2)*x^-2*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)*arcsech(a*x)+-1//2*x^-2*arcsech(a*x)^2*(1+a*x)*(1+-1*a*x))
@test integrate(x^-4*arcsech(a*x)^2, x) == :(-2//27*x^-3+-4//9*a^2*x^-1+-1//3*x^-3*arcsech(a*x)^2+2//9*x^-3*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)*arcsech(a*x)+4//9*a^2*x^-1*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)*arcsech(a*x))
@test integrate(x^4*arcsech(a*x)^3, x) == :((1/2)*a^-5*arctan(a^-1*x^-1*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x))+1//5*x^5*arcsech(a*x)^3+-9//20*im*a^-5*Polylogarithms.polylog(3,-1*im*exp(arcsech(a*x)))+-9//20*x*a^-4*arcsech(a*x)+-9//20*a^-5*arcsech(a*x)^2*arctan(exp(arcsech(a*x)))+-1//10*a^-2*x^3*arcsech(a*x)+9//20*im*a^-5*Polylogarithms.polylog(3,im*exp(arcsech(a*x)))+-9//20*im*a^-5*Polylogarithms.polylog(2,im*exp(arcsech(a*x)))*arcsech(a*x)+1//20*x*a^-4*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)+9//20*im*a^-5*Polylogarithms.polylog(2,-1*im*exp(arcsech(a*x)))*arcsech(a*x)+-9//40*x*a^-4*((1+a*x)^-1*(1+-1*a*x))^(1/2)*arcsech(a*x)^2*(1+a*x)+-3//20*a^-2*x^3*((1+a*x)^-1*(1+-1*a*x))^(1/2)*arcsech(a*x)^2*(1+a*x))
@test integrate(x^3*arcsech(a*x)^3, x) == :((1/2)*a^-4*Polylogarithms.polylog(2,-1*exp(2*arcsech(a*x)))+-1//2*a^-4*arcsech(a*x)^2+1//4*x^4*arcsech(a*x)^3+a^-4*arcsech(a*x)*log(1+exp(2*arcsech(a*x)))+-1//4*a^-2*x^2*arcsech(a*x)+1//4*a^-4*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)+-1//2*a^-4*((1+a*x)^-1*(1+-1*a*x))^(1/2)*arcsech(a*x)^2*(1+a*x)+-1//4*a^-2*x^2*((1+a*x)^-1*(1+-1*a*x))^(1/2)*arcsech(a*x)^2*(1+a*x))
@test integrate(x^2*arcsech(a*x)^3, x) == :(a^-3*arctan(a^-1*x^-1*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x))+1//3*x^3*arcsech(a*x)^3+im*a^-3*Polylogarithms.polylog(3,im*exp(arcsech(a*x)))+-1*im*a^-3*Polylogarithms.polylog(3,-1*im*exp(arcsech(a*x)))+-1*x*a^-2*arcsech(a*x)+-1*a^-3*arcsech(a*x)^2*arctan(exp(arcsech(a*x)))+im*a^-3*Polylogarithms.polylog(2,-1*im*exp(arcsech(a*x)))*arcsech(a*x)+-1*im*a^-3*Polylogarithms.polylog(2,im*exp(arcsech(a*x)))*arcsech(a*x)+-1//2*x*a^-2*((1+a*x)^-1*(1+-1*a*x))^(1/2)*arcsech(a*x)^2*(1+a*x))
@test integrate(x*arcsech(a*x)^3, x) == :((1/2)*x^2*arcsech(a*x)^3+-3//2*a^-2*arcsech(a*x)^2+3//2*a^-2*Polylogarithms.polylog(2,-1*exp(2*arcsech(a*x)))+3*a^-2*arcsech(a*x)*log(1+exp(2*arcsech(a*x)))+-3//2*a^-2*((1+a*x)^-1*(1+-1*a*x))^(1/2)*arcsech(a*x)^2*(1+a*x))
@test integrate(arcsech(a*x)^3, x) == :(x*arcsech(a*x)^3+-6*im*a^-1*Polylogarithms.polylog(3,-1*im*exp(arcsech(a*x)))+-6*a^-1*arcsech(a*x)^2*arctan(exp(arcsech(a*x)))+6*im*a^-1*Polylogarithms.polylog(3,im*exp(arcsech(a*x)))+-6*im*a^-1*Polylogarithms.polylog(2,im*exp(arcsech(a*x)))*arcsech(a*x)+6*im*a^-1*Polylogarithms.polylog(2,-1*im*exp(arcsech(a*x)))*arcsech(a*x))
@test integrate(x^-1*arcsech(a*x)^3, x) == :(-3//4*Polylogarithms.polylog(4,-1*exp(2*arcsech(a*x)))+1//4*arcsech(a*x)^4+-1*arcsech(a*x)^3*log(1+exp(2*arcsech(a*x)))+-3//2*arcsech(a*x)^2*Polylogarithms.polylog(2,-1*exp(2*arcsech(a*x)))+3//2*Polylogarithms.polylog(3,-1*exp(2*arcsech(a*x)))*arcsech(a*x))
@test integrate(x^-2*arcsech(a*x)^3, x) == :(-1*x^-1*arcsech(a*x)^3+-6*x^-1*arcsech(a*x)+6*x^-1*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)+3*x^-1*((1+a*x)^-1*(1+-1*a*x))^(1/2)*arcsech(a*x)^2*(1+a*x))
@test integrate(x^-3*arcsech(a*x)^3, x) == :(-3//8*a^2*arcsech(a*x)+-1//4*a^2*arcsech(a*x)^3+3//8*x^-2*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)+-1//2*x^-2*arcsech(a*x)^3*(1+a*x)*(1+-1*a*x)+-1//4*x^-2*(1+a*x)*(3+-3*a*x)*arcsech(a*x)+3//4*x^-2*((1+a*x)^-1*(1+-1*a*x))^(1/2)*arcsech(a*x)^2*(1+a*x))
@test integrate(x^-4*arcsech(a*x)^3, x) == :(-2//9*x^-3*arcsech(a*x)+-1//3*x^-3*arcsech(a*x)^3+-4//3*a^2*x^-1*arcsech(a*x)+2//27*x^-3*((1+a*x)^-1*(1+-1*a*x))^3//2*(1+a*x)^3+1//3*x^-3*((1+a*x)^-1*(1+-1*a*x))^(1/2)*arcsech(a*x)^2*(1+a*x)+14//9*a^2*x^-1*((1+a*x)^-1*(1+-1*a*x))^(1/2)*(1+a*x)+2//3*a^2*x^-1*((1+a*x)^-1*(1+-1*a*x))^(1/2)*arcsech(a*x)^2*(1+a*x))
@test integrate(x^6*(a+b*arcsech(c*x)), x) == :(1//7*x^7*(a+b*arcsech(c*x))+-5//112*b*x*c^-6*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+-5//168*b*c^-4*x^3*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+-1//42*b*c^-2*x^5*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+5//112*b*c^-7*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arcsin(c*x))
@test integrate(x^5*(a+b*arcsech(c*x)), x) == :(1//6*x^6*(a+b*arcsech(c*x))+-4//45*b*c^-6*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+-2//45*b*c^-4*x^2*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+-1//30*b*c^-2*x^4*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2))
@test integrate(x^4*(a+b*arcsech(c*x)), x) == :(1//5*x^5*(a+b*arcsech(c*x))+-3//40*b*x*c^-4*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+-1//20*b*c^-2*x^3*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+3//40*b*c^-5*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arcsin(c*x))
@test integrate(x^3*(a+b*arcsech(c*x)), x) == :(1//4*x^4*(a+b*arcsech(c*x))+-1//6*b*c^-4*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+-1//12*b*c^-2*x^2*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2))
@test integrate(x^2*(a+b*arcsech(c*x)), x) == :(1//3*x^3*(a+b*arcsech(c*x))+-1//6*b*x*c^-2*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+1//6*b*c^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arcsin(c*x))
@test integrate(x*(a+b*arcsech(c*x)), x) == :((1/2)*x^2*(a+b*arcsech(c*x))+-1//2*b*c^-2*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2))
@test integrate(a+b*arcsech(c*x), x) == :(a*x+b*x*arcsech(c*x)+b*c^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arcsin(c*x))
@test integrate(x^-1*(a+b*arcsech(c*x)), x) == :((1/2)*b^-1*(a+b*arcsech(c*x))^2+-1*(a+b*arcsech(c*x))*log(1+exp(2*arcsech(c*x)))+-1//2*b*Polylogarithms.polylog(2,-1*exp(2*arcsech(c*x))))
@test integrate(x^-2*(a+b*arcsech(c*x)), x) == :(-1*x^-1*(a+b*arcsech(c*x))+b*x^-1*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2))
@test integrate(x^-3*(a+b*arcsech(c*x)), x) == :(-1//2*x^-2*(a+b*arcsech(c*x))+1//4*b*x^-2*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+1//4*b*c^2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+c*x)^(1/2)*(1+-1*c*x)^(1/2)))
@test integrate(x^-4*(a+b*arcsech(c*x)), x) == :(-1//3*x^-3*(a+b*arcsech(c*x))+1//9*b*x^-3*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+2//9*b*c^2*x^-1*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2))
@test integrate(x^-5*(a+b*arcsech(c*x)), x) == :(-1//4*x^-4*(a+b*arcsech(c*x))+1//16*b*x^-4*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+3//32*b*c^2*x^-2*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+3//32*b*c^4*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+c*x)^(1/2)*(1+-1*c*x)^(1/2)))
@test integrate(x^-6*(a+b*arcsech(c*x)), x) == :(-1//5*x^-5*(a+b*arcsech(c*x))+1//25*b*x^-5*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+4//75*b*c^2*x^-3*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+8//75*b*c^4*x^-1*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2))
@test integrate(x^-7*(a+b*arcsech(c*x)), x) == :(-1//6*x^-6*(a+b*arcsech(c*x))+1//36*b*x^-6*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+5//96*b*c^4*x^-2*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2)+5//96*b*c^6*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+c*x)^(1/2)*(1+-1*c*x)^(1/2))+5//144*b*c^2*x^-4*((1+c*x)^-1)^-1//2*(1+-1*c*x)^(1/2))
@test integrate(x^3*(a+b*arcsech(c*x))^2, x) == :(1//4*x^4*(a+b*arcsech(c*x))^2+-1//3*b^2*c^-4*log(x)+-1//12*b^2*c^-2*x^2+-1//3*b*c^-4*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)*(a+b*arcsech(c*x))+-1//6*b*c^-2*x^2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)*(a+b*arcsech(c*x)))
@test integrate(x^2*(a+b*arcsech(c*x))^2, x) == :(1//3*x^3*(a+b*arcsech(c*x))^2+-1//3*x*b^2*c^-2+-2//3*b*c^-3*(a+b*arcsech(c*x))*arctan(exp(arcsech(c*x)))+-1//3*im*b^2*c^-3*Polylogarithms.polylog(2,im*exp(arcsech(c*x)))+1//3*im*b^2*c^-3*Polylogarithms.polylog(2,-1*im*exp(arcsech(c*x)))+-1//3*b*x*c^-2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)*(a+b*arcsech(c*x)))
@test integrate(x*(a+b*arcsech(c*x))^2, x) == :((1/2)*x^2*(a+b*arcsech(c*x))^2+-1*b^2*c^-2*log(x)+-1*b*c^-2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)*(a+b*arcsech(c*x)))
@test integrate((a+b*arcsech(c*x))^2, x) == :(x*(a+b*arcsech(c*x))^2+-4*b*c^-1*(a+b*arcsech(c*x))*arctan(exp(arcsech(c*x)))+-2*im*b^2*c^-1*Polylogarithms.polylog(2,im*exp(arcsech(c*x)))+2*im*b^2*c^-1*Polylogarithms.polylog(2,-1*im*exp(arcsech(c*x))))
@test integrate(x^-1*(a+b*arcsech(c*x))^2, x) == :((1/2)*b^2*Polylogarithms.polylog(3,-1*exp(2*arcsech(c*x)))+-1*(a+b*arcsech(c*x))^2*log(1+exp(2*arcsech(c*x)))+1//3*b^-1*(a+b*arcsech(c*x))^3+-1*b*(a+b*arcsech(c*x))*Polylogarithms.polylog(2,-1*exp(2*arcsech(c*x))))
@test integrate(x^-2*(a+b*arcsech(c*x))^2, x) == :(-1*x^-1*(a+b*arcsech(c*x))^2+-2*b^2*x^-1+2*b*x^-1*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)*(a+b*arcsech(c*x)))
@test integrate(x^-3*(a+b*arcsech(c*x))^2, x) == :(-1//4*b^2*c^2*arcsech(c*x)^2+-1//2*a*b*c^2*arcsech(c*x)+-1//2*x^-2*(a+b*arcsech(c*x))^2*(1+c*x)*(1+-1*c*x)+-1//4*b^2*x^-2*(1+c*x)*(1+-1*c*x)+(1/2)*b*x^-2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)*(a+b*arcsech(c*x)))
@test integrate(x^-4*(a+b*arcsech(c*x))^2, x) == :(-2//27*b^2*x^-3+-1//3*x^-3*(a+b*arcsech(c*x))^2+-4//9*b^2*c^2*x^-1+2//9*b*x^-3*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)*(a+b*arcsech(c*x))+4//9*b*c^2*x^-1*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)*(a+b*arcsech(c*x)))
@test integrate(x^-5*(a+b*arcsech(c*x))^2, x) == :(-1//4*x^-4*(a+b*arcsech(c*x))^2+-1//32*b^2*x^-4+-3//32*b^2*c^2*x^-2+3//32*b^2*c^4*arcsech(c*x)^2+3//16*a*b*c^4*arcsech(c*x)+1//8*b*x^-4*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)*(a+b*arcsech(c*x))+3//16*b*c^2*x^-2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)*(a+b*arcsech(c*x)))
@test integrate(x^3*(a+b*arcsech(c*x))^3, x) == :(1//4*x^4*(a+b*arcsech(c*x))^3+(1/2)*b^3*c^-4*Polylogarithms.polylog(2,-1*exp(2*arcsech(c*x)))+-1//2*b*c^-4*(a+b*arcsech(c*x))^2+b^2*c^-4*(a+b*arcsech(c*x))*log(1+exp(2*arcsech(c*x)))+-1//4*b^2*c^-2*x^2*(a+b*arcsech(c*x))+1//4*b^3*c^-4*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)+-1//2*b*c^-4*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^2*(1+c*x)+-1//4*b*c^-2*x^2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^2*(1+c*x))
@test integrate(x^2*(a+b*arcsech(c*x))^3, x) == :(1//3*x^3*(a+b*arcsech(c*x))^3+b^3*c^-3*arctan(c^-1*x^-1*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x))+im*b^3*c^-3*Polylogarithms.polylog(3,im*exp(arcsech(c*x)))+-1*im*b^3*c^-3*Polylogarithms.polylog(3,-1*im*exp(arcsech(c*x)))+-1*b*c^-3*(a+b*arcsech(c*x))^2*arctan(exp(arcsech(c*x)))+-1*x*b^2*c^-2*(a+b*arcsech(c*x))+im*b^2*c^-3*(a+b*arcsech(c*x))*Polylogarithms.polylog(2,-1*im*exp(arcsech(c*x)))+-1*im*b^2*c^-3*(a+b*arcsech(c*x))*Polylogarithms.polylog(2,im*exp(arcsech(c*x)))+-1//2*b*x*c^-2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^2*(1+c*x))
@test integrate(x*(a+b*arcsech(c*x))^3, x) == :((1/2)*x^2*(a+b*arcsech(c*x))^3+-3//2*b*c^-2*(a+b*arcsech(c*x))^2+3//2*b^3*c^-2*Polylogarithms.polylog(2,-1*exp(2*arcsech(c*x)))+3*b^2*c^-2*(a+b*arcsech(c*x))*log(1+exp(2*arcsech(c*x)))+-3//2*b*c^-2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^2*(1+c*x))
@test integrate((a+b*arcsech(c*x))^3, x) == :(x*(a+b*arcsech(c*x))^3+-6*im*b^3*c^-1*Polylogarithms.polylog(3,-1*im*exp(arcsech(c*x)))+-6*b*c^-1*(a+b*arcsech(c*x))^2*arctan(exp(arcsech(c*x)))+6*im*b^3*c^-1*Polylogarithms.polylog(3,im*exp(arcsech(c*x)))+-6*im*b^2*c^-1*(a+b*arcsech(c*x))*Polylogarithms.polylog(2,im*exp(arcsech(c*x)))+6*im*b^2*c^-1*(a+b*arcsech(c*x))*Polylogarithms.polylog(2,-1*im*exp(arcsech(c*x))))
@test integrate(x^-1*(a+b*arcsech(c*x))^3, x) == :(-1*(a+b*arcsech(c*x))^3*log(1+exp(2*arcsech(c*x)))+-3//4*b^3*Polylogarithms.polylog(4,-1*exp(2*arcsech(c*x)))+1//4*b^-1*(a+b*arcsech(c*x))^4+-3//2*b*(a+b*arcsech(c*x))^2*Polylogarithms.polylog(2,-1*exp(2*arcsech(c*x)))+3//2*b^2*(a+b*arcsech(c*x))*Polylogarithms.polylog(3,-1*exp(2*arcsech(c*x))))
@test integrate(x^-2*(a+b*arcsech(c*x))^3, x) == :(-1*x^-1*(a+b*arcsech(c*x))^3+-6*b^2*x^-1*(a+b*arcsech(c*x))+6*b^3*x^-1*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)+3*b*x^-1*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^2*(1+c*x))
@test integrate(x^-3*(a+b*arcsech(c*x))^3, x) == :(-1//4*c^2*(a+b*arcsech(c*x))^3+-3//8*b^3*c^2*arcsech(c*x)+-1//2*x^-2*(a+b*arcsech(c*x))^3*(1+c*x)*(1+-1*c*x)+3//8*b^3*x^-2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)+-3//4*b^2*x^-2*(1+c*x)*(1+-1*c*x)*(a+b*arcsech(c*x))+3//4*b*x^-2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^2*(1+c*x))
@test integrate(x^-4*(a+b*arcsech(c*x))^3, x) == :(-1//3*x^-3*(a+b*arcsech(c*x))^3+-2//9*b^2*x^-3*(a+b*arcsech(c*x))+-4//3*b^2*c^2*x^-1*(a+b*arcsech(c*x))+2//27*b^3*x^-3*((1+c*x)^-1*(1+-1*c*x))^3//2*(1+c*x)^3+1//3*b*x^-3*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^2*(1+c*x)+14//9*b^3*c^2*x^-1*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)+2//3*b*c^2*x^-1*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^2*(1+c*x))
@test integrate(x^-5*(a+b*arcsech(c*x))^3, x) == :(-1//4*x^-4*(a+b*arcsech(c*x))^3+3//32*c^4*(a+b*arcsech(c*x))^3+-3//32*b^2*x^-4*(a+b*arcsech(c*x))+45//256*b^3*c^4*arcsech(c*x)+-9//32*b^2*c^2*x^-2*(a+b*arcsech(c*x))+3//128*b^3*x^-4*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)+3//16*b*x^-4*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^2*(1+c*x)+45//256*b^3*c^2*x^-2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(1+c*x)+9//32*b*c^2*x^-2*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^2*(1+c*x))
@test integrate(x^-2*(a+b*arcsech(c*x))^-1, x) == :(c*b^-1*coshintegral(a*b^-1+arcsech(c*x))*sinh(a*b^-1)+-1*c*b^-1*cosh(a*b^-1)*sinhintegral(a*b^-1+arcsech(c*x)))
@test integrate(x^-3*(a+b*arcsech(c*x))^-1, x) == :((1/2)*b^-1*c^2*coshintegral(2*arcsech(c*x)+2*a*b^-1)*sinh(2*a*b^-1)+-1//2*b^-1*c^2*cosh(2*a*b^-1)*sinhintegral(2*arcsech(c*x)+2*a*b^-1))
@test integrate(x^-4*(a+b*arcsech(c*x))^-1, x) == :(-1//4*b^-1*c^3*cosh(a*b^-1)*sinhintegral(a*b^-1+arcsech(c*x))+-1//4*b^-1*c^3*cosh(3*a*b^-1)*sinhintegral(3*arcsech(c*x)+3*a*b^-1)+1//4*b^-1*c^3*coshintegral(3*arcsech(c*x)+3*a*b^-1)*sinh(3*a*b^-1)+1//4*b^-1*c^3*coshintegral(a*b^-1+arcsech(c*x))*sinh(a*b^-1))
@test integrate(x^-2*(a+b*arcsech(c*x))^-2, x) == :(c*b^-2*sinh(a*b^-1)*sinhintegral(a*b^-1+arcsech(c*x))+-1*c*b^-2*cosh(a*b^-1)*coshintegral(a*b^-1+arcsech(c*x))+b^-1*x^-1*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^-1*(1+c*x))
@test integrate(x^-3*(a+b*arcsech(c*x))^-2, x) == :(b^-2*c^2*sinh(2*a*b^-1)*sinhintegral(2*arcsech(c*x)+2*a*b^-1)+(1/2)*b^-1*c^2*(a+b*arcsech(c*x))^-1*sinh(2*arcsech(c*x))+-1*b^-2*c^2*cosh(2*a*b^-1)*coshintegral(2*arcsech(c*x)+2*a*b^-1))
@test integrate(x^-4*(a+b*arcsech(c*x))^-2, x) == :(-3//4*b^-2*c^3*cosh(3*a*b^-1)*coshintegral(3*arcsech(c*x)+3*a*b^-1)+-1//4*b^-2*c^3*cosh(a*b^-1)*coshintegral(a*b^-1+arcsech(c*x))+1//4*b^-1*c^3*(a+b*arcsech(c*x))^-1*sinh(3*arcsech(c*x))+1//4*b^-2*c^3*sinh(a*b^-1)*sinhintegral(a*b^-1+arcsech(c*x))+3//4*b^-2*c^3*sinh(3*a*b^-1)*sinhintegral(3*arcsech(c*x)+3*a*b^-1)+1//4*b^-1*c^2*x^-1*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^-1*(1+c*x))
@test integrate(x^-2*(a+b*arcsech(c*x))^-3, x) == :((1/2)*b^-2*x^-1*(a+b*arcsech(c*x))^-1+(1/2)*c*b^-3*coshintegral(a*b^-1+arcsech(c*x))*sinh(a*b^-1)+-1//2*c*b^-3*cosh(a*b^-1)*sinhintegral(a*b^-1+arcsech(c*x))+(1/2)*b^-1*x^-1*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^-2*(1+c*x))
@test integrate(x^-3*(a+b*arcsech(c*x))^-3, x) == :(b^-3*c^2*coshintegral(2*arcsech(c*x)+2*a*b^-1)*sinh(2*a*b^-1)+(1/2)*b^-2*c^2*(a+b*arcsech(c*x))^-1*cosh(2*arcsech(c*x))+-1*b^-3*c^2*cosh(2*a*b^-1)*sinhintegral(2*arcsech(c*x)+2*a*b^-1)+1//4*b^-1*c^2*(a+b*arcsech(c*x))^-2*sinh(2*arcsech(c*x)))
@test integrate(x^-4*(a+b*arcsech(c*x))^-3, x) == :(-9//8*b^-3*c^3*cosh(3*a*b^-1)*sinhintegral(3*arcsech(c*x)+3*a*b^-1)+-1//8*b^-3*c^3*cosh(a*b^-1)*sinhintegral(a*b^-1+arcsech(c*x))+1//8*b^-1*c^3*(a+b*arcsech(c*x))^-2*sinh(3*arcsech(c*x))+1//8*b^-3*c^3*coshintegral(a*b^-1+arcsech(c*x))*sinh(a*b^-1)+1//8*b^-2*c^2*x^-1*(a+b*arcsech(c*x))^-1+3//8*b^-2*c^3*(a+b*arcsech(c*x))^-1*cosh(3*arcsech(c*x))+9//8*b^-3*c^3*coshintegral(3*arcsech(c*x)+3*a*b^-1)*sinh(3*a*b^-1)+1//8*b^-1*c^2*x^-1*((1+c*x)^-1*(1+-1*c*x))^(1/2)*(a+b*arcsech(c*x))^-2*(1+c*x))
@test integrate((d+e*x)^3*(a+b*arcsech(c*x)), x) == :(1//4*e^-1*(d+e*x)^4*(a+b*arcsech(c*x))+-1//4*b*d^4*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+-1*c^2*x^2)^(1/2))+(1/2)*b*d*c^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(e^2+2*c^2*d^2)*arcsin(c*x)+-1//6*b*e*c^-4*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(e^2+9*c^2*d^2)+-1//12*b*c^-2*e^3*x^2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+-1//2*b*d*x*c^-2*e^2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2))
@test integrate((d+e*x)^2*(a+b*arcsech(c*x)), x) == :(1//3*e^-1*(d+e*x)^3*(a+b*arcsech(c*x))+-1//3*b*d^3*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+-1*c^2*x^2)^(1/2))+1//6*b*c^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(e^2+6*c^2*d^2)*arcsin(c*x)+-1*b*d*e*c^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+-1//6*b*x*c^-2*e^2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2))
@test integrate((a+b*arcsech(c*x))*(d+e*x), x) == :((1/2)*e^-1*(d+e*x)^2*(a+b*arcsech(c*x))+b*d*c^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arcsin(c*x)+-1//2*b*e*c^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+-1//2*b*d^2*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+-1*c^2*x^2)^(1/2)))
@test integrate(a+b*arcsech(c*x), x) == :(a*x+b*x*arcsech(c*x)+b*c^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arcsin(c*x))
@test integrate((d+e*x)^-1*(a+b*arcsech(c*x)), x) == :(e^-1*(a+b*arcsech(c*x))*log(1+c^-1*d^-1*(e+(e^2+-1*c^2*d^2)^(1/2))*exp(-1*arcsech(c*x)))+e^-1*(a+b*arcsech(c*x))*log(1+c^-1*d^-1*(e+-1*(e^2+-1*c^2*d^2)^(1/2))*exp(-1*arcsech(c*x)))+(1/2)*b*e^-1*Polylogarithms.polylog(2,-1*exp(-2*arcsech(c*x)))+-1*b*e^-1*Polylogarithms.polylog(2,-1*c^-1*d^-1*(e+(e^2+-1*c^2*d^2)^(1/2))*exp(-1*arcsech(c*x)))+-1*b*e^-1*Polylogarithms.polylog(2,-1*c^-1*d^-1*(e+-1*(e^2+-1*c^2*d^2)^(1/2))*exp(-1*arcsech(c*x)))+-1*e^-1*(a+b*arcsech(c*x))*log(1+exp(-2*arcsech(c*x))))
@test integrate((d+e*x)^-2*(a+b*arcsech(c*x)), x) == :(-1*e^-1*(d+e*x)^-1*(a+b*arcsech(c*x))+b*d^-1*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+-1*c^2*x^2)^(1/2))+b*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(-1*e^2+c^2*d^2)^-1//2*arctan((1+-1*c^2*x^2)^-1//2*(-1*e^2+c^2*d^2)^-1//2*(e+d*x*c^2)))
@test integrate((d+e*x)^-3*(a+b*arcsech(c*x)), x) == :(-1//2*e^-1*(d+e*x)^-2*(a+b*arcsech(c*x))+(1/2)*b*c^2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(-1*e^2+c^2*d^2)^-3//2*arctan((1+-1*c^2*x^2)^-1//2*(-1*e^2+c^2*d^2)^-1//2*(e+d*x*c^2))+(1/2)*b*d^-2*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+-1*c^2*x^2)^(1/2))+(1/2)*b*d^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(-1*e^2+c^2*d^2)^-1//2*arctan((1+-1*c^2*x^2)^-1//2*(-1*e^2+c^2*d^2)^-1//2*(e+d*x*c^2))+(1/2)*b*e*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x)^-1*(-1*e^2+c^2*d^2)^-1)
@test integrate(x^4*(a+b*arcsech(c*x))*(d+e*x^2), x) == :(1//5*d*x^5*(a+b*arcsech(c*x))+1//7*e*x^7*(a+b*arcsech(c*x))+1//560*b*c^-7*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(25*e+42*d*c^2)*arcsin(c*x)+-1//42*b*e*c^-2*x^5*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+-1//560*b*x*c^-6*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(25*e+42*d*c^2)+-1//840*b*c^-4*x^3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(25*e+42*d*c^2))
@test integrate(x^2*(a+b*arcsech(c*x))*(d+e*x^2), x) == :(1//3*d*x^3*(a+b*arcsech(c*x))+1//5*e*x^5*(a+b*arcsech(c*x))+1//120*b*c^-5*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(9*e+20*d*c^2)*arcsin(c*x)+-1//20*b*e*c^-2*x^3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+-1//120*b*x*c^-4*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(9*e+20*d*c^2))
@test integrate((a+b*arcsech(c*x))*(d+e*x^2), x) == :(d*x*(a+b*arcsech(c*x))+1//3*e*x^3*(a+b*arcsech(c*x))+1//6*b*c^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(e+6*d*c^2)*arcsin(c*x)+-1//6*b*e*x*c^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2))
@test integrate(x^-2*(a+b*arcsech(c*x))*(d+e*x^2), x) == :(e*x*(a+b*arcsech(c*x))+-1*d*x^-1*(a+b*arcsech(c*x))+b*d*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+b*e*c^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arcsin(c*x))
@test integrate(x^-4*(a+b*arcsech(c*x))*(d+e*x^2), x) == :(-1*e*x^-1*(a+b*arcsech(c*x))+-1//3*d*x^-3*(a+b*arcsech(c*x))+1//9*b*d*x^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+1//9*b*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(9*e+2*d*c^2))
@test integrate(x^-6*(a+b*arcsech(c*x))*(d+e*x^2), x) == :(-1//3*e*x^-3*(a+b*arcsech(c*x))+-1//5*d*x^-5*(a+b*arcsech(c*x))+1//25*b*d*x^-5*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+1//225*b*x^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(25*e+12*d*c^2)+2//225*b*c^2*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(25*e+12*d*c^2))
@test integrate(x^-8*(a+b*arcsech(c*x))*(d+e*x^2), x) == :(-1//5*e*x^-5*(a+b*arcsech(c*x))+-1//7*d*x^-7*(a+b*arcsech(c*x))+1//49*b*d*x^-7*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+1//1225*b*x^-5*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(49*e+30*d*c^2)+4//3675*b*c^2*x^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(49*e+30*d*c^2)+8//3675*b*c^4*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(49*e+30*d*c^2))
@test integrate(x^5*(a+b*arcsech(c*x))*(d+e*x^2), x) == :(1//6*d*x^6*(a+b*arcsech(c*x))+1//8*e*x^8*(a+b*arcsech(c*x))+-1//24*b*c^-8*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(3*e+4*d*c^2)+-1//120*b*c^-8*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^5//2*(9*e+4*d*c^2)+1//56*b*e*c^-8*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^7//2+1//72*b*c^-8*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^3//2*(9*e+8*d*c^2))
@test integrate(x^3*(a+b*arcsech(c*x))*(d+e*x^2), x) == :(1//4*d*x^4*(a+b*arcsech(c*x))+1//6*e*x^6*(a+b*arcsech(c*x))+-1//12*b*c^-6*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(2*e+3*d*c^2)+-1//30*b*e*c^-6*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^5//2+1//36*b*c^-6*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^3//2*(4*e+3*d*c^2))
@test integrate(x*(a+b*arcsech(c*x))*(d+e*x^2), x) == :(1//4*e^-1*(d+e*x^2)^2*(a+b*arcsech(c*x))+-1//4*b*c^-4*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(e+2*d*c^2)+-1//4*b*d^2*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+-1*c^2*x^2)^(1/2))+1//12*b*e*c^-4*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^3//2)
@test integrate(x^-1*(a+b*arcsech(c*x))*(d+e*x^2), x) == :((1/2)*e*x^2*(a+b*arcsech(c*x))+-1*d*(a+b*arcsech(c*x))*log(x^-1)+-1//2*b*e*x*c^-1*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)+b*d*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)*log(x^-1)+(1/2)*im*b*d*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)^2+(1/2)*im*b*d*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*Polylogarithms.polylog(2,exp(2*im*arccsc(c*x)))+-1*b*d*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)*log(1+-1*exp(2*im*arccsc(c*x))))
@test integrate(x^-3*(a+b*arcsech(c*x))*(d+e*x^2), x) == :(-1*e*(a+b*arcsech(c*x))*log(x^-1)+-1//2*d*x^-2*(a+b*arcsech(c*x))+1//4*b*d*c^2*arcsech(c*x)+1//4*b*c*d*x^-1*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)+b*e*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)*log(x^-1)+(1/2)*im*b*e*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)^2+(1/2)*im*b*e*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*Polylogarithms.polylog(2,exp(2*im*arccsc(c*x)))+-1*b*e*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)*log(1+-1*exp(2*im*arccsc(c*x))))
@test integrate(x^2*(d+e*x^2)^2*(a+b*arcsech(c*x)), x) == :(1//3*d^2*x^3*(a+b*arcsech(c*x))+1//7*e^2*x^7*(a+b*arcsech(c*x))+2//5*d*e*x^5*(a+b*arcsech(c*x))+1//1680*b*c^-7*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(75*e^2+280*c^4*d^2+252*d*e*c^2)*arcsin(c*x)+-1//42*b*c^-2*e^2*x^5*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+-1//1680*b*x*c^-6*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(75*e^2+280*c^4*d^2+252*d*e*c^2)+-1//840*b*e*c^-4*x^3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(25*e+84*d*c^2))
@test integrate((d+e*x^2)^2*(a+b*arcsech(c*x)), x) == :(x*d^2*(a+b*arcsech(c*x))+1//5*e^2*x^5*(a+b*arcsech(c*x))+2//3*d*e*x^3*(a+b*arcsech(c*x))+1//120*b*c^-5*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(9*e^2+120*c^4*d^2+40*d*e*c^2)*arcsin(c*x)+-1//20*b*c^-2*e^2*x^3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+-1//120*b*e*x*c^-4*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(9*e+40*d*c^2))
@test integrate(x^-2*(d+e*x^2)^2*(a+b*arcsech(c*x)), x) == :(-1*d^2*x^-1*(a+b*arcsech(c*x))+1//3*e^2*x^3*(a+b*arcsech(c*x))+2*d*e*x*(a+b*arcsech(c*x))+b*d^2*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+-1//6*b*x*c^-2*e^2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+1//6*b*e*c^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(e+12*d*c^2)*arcsin(c*x))
@test integrate(x^-4*(d+e*x^2)^2*(a+b*arcsech(c*x)), x) == :(x*e^2*(a+b*arcsech(c*x))+-1//3*d^2*x^-3*(a+b*arcsech(c*x))+-2*d*e*x^-1*(a+b*arcsech(c*x))+b*c^-1*e^2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arcsin(c*x)+1//9*b*d^2*x^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+2//9*b*d*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(9*e+d*c^2))
@test integrate(x^-6*(d+e*x^2)^2*(a+b*arcsech(c*x)), x) == :(-1*e^2*x^-1*(a+b*arcsech(c*x))+-1//5*d^2*x^-5*(a+b*arcsech(c*x))+-2//3*d*e*x^-3*(a+b*arcsech(c*x))+1//25*b*d^2*x^-5*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+1//225*b*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(225*e^2+24*c^4*d^2+100*d*e*c^2)+2//225*b*d*x^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(25*e+6*d*c^2))
@test integrate(x^-8*(d+e*x^2)^2*(a+b*arcsech(c*x)), x) == :(-1//3*e^2*x^-3*(a+b*arcsech(c*x))+-1//7*d^2*x^-7*(a+b*arcsech(c*x))+-2//5*d*e*x^-5*(a+b*arcsech(c*x))+1//49*b*d^2*x^-7*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)+1//11025*b*x^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(1225*e^2+360*c^4*d^2+1176*d*e*c^2)+2//1225*b*d*x^-5*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(49*e+15*d*c^2)+2//11025*b*c^2*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(1225*e^2+360*c^4*d^2+1176*d*e*c^2))
@test integrate(x^3*(d+e*x^2)^2*(a+b*arcsech(c*x)), x) == :(1//4*d^2*x^4*(a+b*arcsech(c*x))+1//8*e^2*x^8*(a+b*arcsech(c*x))+1//3*d*e*x^6*(a+b*arcsech(c*x))+-1//24*b*c^-8*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(3*e^2+6*c^4*d^2+8*d*e*c^2)+1//56*b*c^-8*e^2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^7//2+1//72*b*c^-8*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^3//2*(9*e^2+6*c^4*d^2+16*d*e*c^2)+-1//120*b*e*c^-8*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^5//2*(9*e+8*d*c^2))
@test integrate(x*(d+e*x^2)^2*(a+b*arcsech(c*x)), x) == :(1//6*e^-1*(d+e*x^2)^3*(a+b*arcsech(c*x))+-1//6*b*c^-6*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(e^2+3*c^4*d^2+3*d*e*c^2)+-1//6*b*d^3*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+-1*c^2*x^2)^(1/2))+-1//30*b*c^-6*e^2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^5//2+1//18*b*e*c^-6*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^3//2*(2*e+3*d*c^2))
@test integrate(x^-1*(d+e*x^2)^2*(a+b*arcsech(c*x)), x) == :(-1*d^2*(a+b*arcsech(c*x))*log(x^-1)+1//4*e^2*x^4*(a+b*arcsech(c*x))+d*e*x^2*(a+b*arcsech(c*x))+-1//12*b*c^-1*e^2*x^3*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)+b*d^2*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)*log(x^-1)+(1/2)*im*b*d^2*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)^2+(1/2)*im*b*d^2*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*Polylogarithms.polylog(2,exp(2*im*arccsc(c*x)))+-1*b*d^2*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)*log(1+-1*exp(2*im*arccsc(c*x)))+-1//6*b*e*x*c^-3*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)*(e+6*d*c^2))
@test integrate(x^-3*(d+e*x^2)^2*(a+b*arcsech(c*x)), x) == :((1/2)*e^2*x^2*(a+b*arcsech(c*x))+-1//2*d^2*x^-2*(a+b*arcsech(c*x))+-2*d*e*(a+b*arcsech(c*x))*log(x^-1)+1//4*b*c^2*d^2*arcsech(c*x)+-1//2*b*x*c^-1*e^2*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)+1//4*b*c*d^2*x^-1*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)+im*b*d*e*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)^2+im*b*d*e*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*Polylogarithms.polylog(2,exp(2*im*arccsc(c*x)))+-2*b*d*e*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)*log(1+-1*exp(2*im*arccsc(c*x)))+2*b*d*e*(1+c^-1*x^-1)^-1//2*(1+-1*c^-2*x^-2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arccsc(c*x)*log(x^-1))
@test integrate(x^2*(d+e*x^2)^-1*(a+b*arcsech(c*x)), x) == :(x*e^-1*(a+b*arcsech(c*x))+(1/2)*b*e^-3//2*(-1d)^(1/2)*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^-3//2*(-1d)^(1/2)*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-3//2*(-1d)^(1/2)*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-3//2*(-1d)^(1/2)*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*b*c^-1*e^-1*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2))+-1//2*b*e^-3//2*(-1d)^(1/2)*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*e^-3//2*(-1d)^(1/2)*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*e^-3//2*(-1d)^(1/2)*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*e^-3//2*(-1d)^(1/2)*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x))))
@test integrate(x*(d+e*x^2)^-1*(a+b*arcsech(c*x)), x) == :((1/2)*b*e^-1*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^-1*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^-1*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^-1*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-1*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-1*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-1*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-1*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*e^-1*(a+b*arcsech(c*x))*log(1+exp(2*arcsech(c*x)))+-1//2*b*e^-1*Polylogarithms.polylog(2,-1*exp(2*arcsech(c*x))))
@test integrate((d+e*x^2)^-1*(a+b*arcsech(c*x)), x) == :((1/2)*b*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-1//2*(-1d)^-1//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-1//2*(-1d)^-1//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*e^-1//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*e^-1//2*(-1d)^-1//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*e^-1//2*(-1d)^-1//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x))))
@test integrate(x^-1*(d+e*x^2)^-1*(a+b*arcsech(c*x)), x) == :((1/2)*b^-1*d^-1*(a+b*arcsech(c*x))^2+-1//2*b*d^-1*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*d^-1*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*d^-1*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*d^-1*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-1*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-1*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-1*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-1*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x))))
@test integrate(x^-2*(d+e*x^2)^-1*(a+b*arcsech(c*x)), x) == :(-1*a*d^-1*x^-1+(1/2)*b*e^(1/2)*(-1d)^-3//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^(1/2)*(-1d)^-3//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^(1/2)*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^(1/2)*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*b*d^-1*x^-1*arcsech(c*x)+-1//2*b*e^(1/2)*(-1d)^-3//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*e^(1/2)*(-1d)^-3//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*e^(1/2)*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*e^(1/2)*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+b*c*d^-1*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2))
@test integrate(x^5*(d+e*x^2)^-2*(a+b*arcsech(c*x)), x) == :((1/2)*e^-2*x^2*(a+b*arcsech(c*x))+b*d*e^-3*Polylogarithms.polylog(2,-1*exp(2*arcsech(c*x)))+(1/2)*d*e^-2*(e+d*x^-2)^-1*(a+b*arcsech(c*x))+-1*b*d*e^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*b*d*e^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*b*d*e^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*b*d*e^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*d*e^-3*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*d*e^-3*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*d*e^-3*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*d*e^-3*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+2*d*e^-3*(a+b*arcsech(c*x))*log(1+exp(2*arcsech(c*x)))+-1//2*b*x*c^-1*e^-2*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)+-1//2*b*d*e^-5//2*(1+c^-1*x^-1)^-1//2*(-1+c^-1*x^-1)^-1//2*(-1+c^-2*x^-2)^(1/2)*(e+d*c^2)^-1//2*arctanh(c^-1*e^-1//2*x^-1*(-1+c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2)))
@test integrate(x^3*(d+e*x^2)^-2*(a+b*arcsech(c*x)), x) == :((1/2)*b*e^-2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^-2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^-2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^-2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*e^-2*(a+b*arcsech(c*x))*log(1+exp(2*arcsech(c*x)))+-1//2*b*e^-2*Polylogarithms.polylog(2,-1*exp(2*arcsech(c*x)))+-1//2*e^-1*(e+d*x^-2)^-1*(a+b*arcsech(c*x))+(1/2)*b*e^-3//2*(1+c^-1*x^-1)^-1//2*(-1+c^-1*x^-1)^-1//2*(-1+c^-2*x^-2)^(1/2)*(e+d*c^2)^-1//2*arctanh(c^-1*e^-1//2*x^-1*(-1+c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2)))
@test integrate(x*(d+e*x^2)^-2*(a+b*arcsech(c*x)), x) == :(-1//2*e^-1*(d+e*x^2)^-1*(a+b*arcsech(c*x))+(1/2)*b*d^-1*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+-1*c^2*x^2)^(1/2))+-1//2*b*d^-1*e^-1//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(e+d*c^2)^-1//2*arctanh(e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(e+d*c^2)^-1//2))
@test integrate(x^-1*(d+e*x^2)^-2*(a+b*arcsech(c*x)), x) == :((1/2)*b^-1*d^-2*(a+b*arcsech(c*x))^2+-1//2*b*d^-2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*d^-2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*d^-2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*d^-2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*e*d^-2*(e+d*x^-2)^-1*(a+b*arcsech(c*x))+(1/2)*b*d^-2*e^(1/2)*(1+c^-1*x^-1)^-1//2*(-1+c^-1*x^-1)^-1//2*(-1+c^-2*x^-2)^(1/2)*(e+d*c^2)^-1//2*arctanh(c^-1*e^-1//2*x^-1*(-1+c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2)))
@test integrate(x^4*(d+e*x^2)^-2*(a+b*arcsech(c*x)), x) == :(x*e^-2*(a+b*arcsech(c*x))+-1*b*c^-1*e^-2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2))+-3//4*b*e^-5//2*(-1d)^(1/2)*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-3//4*b*e^-5//2*(-1d)^(1/2)*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-3//4*e^-5//2*(-1d)^(1/2)*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-3//4*e^-5//2*(-1d)^(1/2)*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//4*d*e^-2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(a+b*arcsech(c*x))+1//4*d*e^-2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(a+b*arcsech(c*x))+3//4*b*e^-5//2*(-1d)^(1/2)*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+3//4*b*e^-5//2*(-1d)^(1/2)*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+3//4*e^-5//2*(-1d)^(1/2)*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+3//4*e^-5//2*(-1d)^(1/2)*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*d*e^-2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^(1/2)*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2)+(1/2)*b*d*e^-2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^(1/2)))
@test integrate(x^2*(d+e*x^2)^-2*(a+b*arcsech(c*x)), x) == :(-1//4*e^-1*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(a+b*arcsech(c*x))+1//4*e^-1*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(a+b*arcsech(c*x))+-1//4*b*e^-3//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//4*b*e^-3//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//4*e^-3//2*(-1d)^-1//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//4*e^-3//2*(-1d)^-1//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//4*b*e^-3//2*(-1d)^-1//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//4*b*e^-3//2*(-1d)^-1//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//4*e^-3//2*(-1d)^-1//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//4*e^-3//2*(-1d)^-1//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*e^-1*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^(1/2)*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2)+-1//2*b*e^-1*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^(1/2)))
@test integrate((d+e*x^2)^-2*(a+b*arcsech(c*x)), x) == :(-1//4*d^-1*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(a+b*arcsech(c*x))+1//4*d^-1*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(a+b*arcsech(c*x))+-1//4*b*e^-1//2*(-1d)^-3//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//4*b*e^-1//2*(-1d)^-3//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//4*e^-1//2*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//4*e^-1//2*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//4*b*e^-1//2*(-1d)^-3//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//4*b*e^-1//2*(-1d)^-3//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//4*e^-1//2*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//4*e^-1//2*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*d^-1*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^(1/2)*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2)+(1/2)*b*d^-1*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^(1/2)))
@test integrate(x^-2*(d+e*x^2)^-2*(a+b*arcsech(c*x)), x) == :(-1*a*d^-2*x^-1+-1*b*d^-2*x^-1*arcsech(c*x)+-3//4*b*e^(1/2)*(-1d)^-5//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-3//4*b*e^(1/2)*(-1d)^-5//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-3//4*e^(1/2)*(-1d)^-5//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-3//4*e^(1/2)*(-1d)^-5//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//4*e*d^-2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(a+b*arcsech(c*x))+1//4*e*d^-2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(a+b*arcsech(c*x))+3//4*b*e^(1/2)*(-1d)^-5//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+3//4*b*e^(1/2)*(-1d)^-5//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+3//4*e^(1/2)*(-1d)^-5//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+3//4*e^(1/2)*(-1d)^-5//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+b*c*d^-2*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)+-1//2*b*e*d^-2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^(1/2)*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2)+-1//2*b*e*d^-2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^(1/2)))
@test integrate(x^5*(d+e*x^2)^-3*(a+b*arcsech(c*x)), x) == :((1/2)*b*e^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*b*e^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-3*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-3*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-3*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+(1/2)*e^-3*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*e^-3*(a+b*arcsech(c*x))*log(1+exp(2*arcsech(c*x)))+-1//2*b*e^-3*Polylogarithms.polylog(2,-1*exp(2*arcsech(c*x)))+-1//2*e^-2*(e+d*x^-2)^-1*(a+b*arcsech(c*x))+-1//4*e^-1*(e+d*x^-2)^-2*(a+b*arcsech(c*x))+(1/2)*b*e^-5//2*(1+c^-1*x^-1)^-1//2*(-1+c^-1*x^-1)^-1//2*(-1+c^-2*x^-2)^(1/2)*(e+d*c^2)^-1//2*arctanh(c^-1*e^-1//2*x^-1*(-1+c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2))+1//8*b*e^-5//2*(1+c^-1*x^-1)^-1//2*(-1+c^-1*x^-1)^-1//2*(-1+c^-2*x^-2)^(1/2)*(e+d*c^2)^-3//2*(2*e+d*c^2)*arctanh(c^-1*e^-1//2*x^-1*(-1+c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2))+1//8*b*d*c^-1*e^-2*x^-1*(1+c^-1*x^-1)^-1//2*(-1+c^-1*x^-1)^-1//2*(e+d*c^2)^-1*(e+d*x^-2)^-1*(c^2+-1*x^-2))
@test integrate(x^3*(d+e*x^2)^-3*(a+b*arcsech(c*x)), x) == :(1//4*d^-1*x^4*(d+e*x^2)^-2*(a+b*arcsech(c*x))+1//8*b*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1*(e+d*c^2)^-1+-1//8*b*d^-1*e^-3//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(e+d*c^2)^-3//2*(2*e+d*c^2)*arctanh(e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(e+d*c^2)^-1//2))
@test integrate(x*(d+e*x^2)^-3*(a+b*arcsech(c*x)), x) == :(-1//4*e^-1*(d+e*x^2)^-2*(a+b*arcsech(c*x))+1//4*b*d^-2*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh((1+-1*c^2*x^2)^(1/2))+-1//8*b*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1*(e+d*c^2)^-1+-1//8*b*d^-2*e^-1//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(e+d*c^2)^-3//2*(2*e+3*d*c^2)*arctanh(e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(e+d*c^2)^-1//2))
@test integrate(x^-1*(d+e*x^2)^-3*(a+b*arcsech(c*x)), x) == :((1/2)*b^-1*d^-3*(a+b*arcsech(c*x))^2+-1//2*b*d^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*d^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*d^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*b*d^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-3*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-3*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-3*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//2*d^-3*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1*e*d^-3*(e+d*x^-2)^-1*(a+b*arcsech(c*x))+1//4*d^-3*e^2*(e+d*x^-2)^-2*(a+b*arcsech(c*x))+b*d^-3*e^(1/2)*(1+c^-1*x^-1)^-1//2*(-1+c^-1*x^-1)^-1//2*(-1+c^-2*x^-2)^(1/2)*(e+d*c^2)^-1//2*arctanh(c^-1*e^-1//2*x^-1*(-1+c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2))+-1//8*b*d^-3*e^(1/2)*(1+c^-1*x^-1)^-1//2*(-1+c^-1*x^-1)^-1//2*(-1+c^-2*x^-2)^(1/2)*(e+d*c^2)^-3//2*(2*e+d*c^2)*arctanh(c^-1*e^-1//2*x^-1*(-1+c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2))+-1//8*b*e*c^-1*d^-2*x^-1*(1+c^-1*x^-1)^-1//2*(-1+c^-1*x^-1)^-1//2*(e+d*c^2)^-1*(e+d*x^-2)^-1*(c^2+-1*x^-2))
@test integrate(x^4*(d+e*x^2)^-3*(a+b*arcsech(c*x)), x) == :(-1//16*e^-2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(3a+3*b*arcsech(c*x))+1//16*e^-2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(3a+3*b*arcsech(c*x))+-3//16*b*e^-5//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-3//16*b*e^-5//2*(-1d)^-1//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//16*e^-3//2*(-1d)^(1/2)*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-2*(a+b*arcsech(c*x))+1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//16*e^-3//2*(-1d)^(1/2)*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-2*(a+b*arcsech(c*x))+3//16*b*e^-5//2*(-1d)^-1//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+3//16*b*e^-5//2*(-1d)^-1//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-3//8*b*e^-2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^(1/2)*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2)+-3//8*b*e^-2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^(1/2))+-1//8*b*d*e^-1*(c*d+e^(1/2)*(-1d)^(1/2))^-3//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-3//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^(1/2)*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2)+-1//8*b*d*e^-1*(c*d+e^(1/2)*(-1d)^(1/2))^-3//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-3//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^(1/2))+1//16*b*c*e^-3//2*(-1d)^(1/2)*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)*(e+d*c^2)^-1*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1+1//16*b*c*e^-3//2*(-1d)^(1/2)*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)*(e+d*c^2)^-1*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1)
@test integrate(x^2*(d+e*x^2)^-3*(a+b*arcsech(c*x)), x) == :(-1//16*b*e^-3//2*(-1d)^-3//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//16*b*e^-3//2*(-1d)^-3//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//16*d^-1*e^-1*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(a+b*arcsech(c*x))+-1//16*e^-3//2*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//16*e^-3//2*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//16*e^-1//2*(-1d)^-1//2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-2*(a+b*arcsech(c*x))+1//8*b*(c*d+e^(1/2)*(-1d)^(1/2))^-3//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-3//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^(1/2)*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2)+1//8*b*(c*d+e^(1/2)*(-1d)^(1/2))^-3//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-3//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^(1/2))+1//16*b*e^-3//2*(-1d)^-3//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//16*b*e^-3//2*(-1d)^-3//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//16*d^-1*e^-1*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(a+b*arcsech(c*x))+1//16*e^-3//2*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//16*e^-3//2*(-1d)^-3//2*(a+b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//16*e^-1//2*(-1d)^-1//2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-2*(a+b*arcsech(c*x))+-1//8*b*d^-1*e^-1*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^(1/2)*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2)+-1//8*b*d^-1*e^-1*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^(1/2))+1//16*b*c*e^-1//2*(-1d)^-1//2*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)*(e+d*c^2)^-1*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1+1//16*b*c*e^-1//2*(-1d)^-1//2*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)*(e+d*c^2)^-1*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1)
@test integrate((d+e*x^2)^-3*(a+b*arcsech(c*x)), x) == :(-1//16*d^-2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(5a+5*b*arcsech(c*x))+1//16*d^-2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(5a+5*b*arcsech(c*x))+-3//16*b*e^-1//2*(-1d)^-5//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-3//16*b*e^-1//2*(-1d)^-5//2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//16*e^(1/2)*(-1d)^-3//2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-2*(a+b*arcsech(c*x))+-1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+-1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arcsech(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//16*e^(1/2)*(-1d)^-3//2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-2*(a+b*arcsech(c*x))+1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arcsech(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+3//16*b*e^-1//2*(-1d)^-5//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+3//16*b*e^-1//2*(-1d)^-5//2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(arcsech(c*x)))+5//8*b*d^-2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^(1/2)*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2)+5//8*b*d^-2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^(1/2))+-1//8*b*e*d^-1*(c*d+e^(1/2)*(-1d)^(1/2))^-3//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-3//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^(1/2)*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-1//2)+-1//8*b*e*d^-1*(c*d+e^(1/2)*(-1d)^(1/2))^-3//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^-3//2*arctan((1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^-1//2*(c*d+e^(1/2)*(-1d)^(1/2))^-1//2*(c*d+-1*e^(1/2)*(-1d)^(1/2))^(1/2))+1//16*b*c*e^(1/2)*(-1d)^-3//2*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)*(e+d*c^2)^-1*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1+1//16*b*c*e^(1/2)*(-1d)^-3//2*(1+c^-1*x^-1)^(1/2)*(-1+c^-1*x^-1)^(1/2)*(e+d*c^2)^-1*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1)
@test integrate(x^5*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x)), x) == :(1//7*e^-3*(d+e*x^2)^7//2*(a+b*arcsech(c*x))+-2//5*d*e^-3*(d+e*x^2)^5//2*(a+b*arcsech(c*x))+1//3*d^2*e^-3*(d+e*x^2)^3//2*(a+b*arcsech(c*x))+-8//105*b*d^7//2*e^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//42*b*c^-2*e^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^5//2+-1//1680*b*c^-7*e^-5//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(75*e^3+105*c^6*d^3+-35*e*c^4*d^2+63*d*c^2*e^2)*arctan(c^-1*e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+1//840*b*c^-4*e^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^3//2*(-25*e+29*d*c^2)+1//1680*b*c^-6*e^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(-75*e^2+23*c^4*d^2+12*d*e*c^2))
@test integrate(x*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x)), x) == :(1//3*e^-1*(d+e*x^2)^3//2*(a+b*arcsech(c*x))+-1//3*b*d^3//2*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//6*b*c^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+-1//6*b*c^-3*e^-1//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(e+3*d*c^2)*arctan(c^-1*e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2))
@test integrate(x^-4*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x)), x) == :(-1//3*d^-1*x^-3*(d+e*x^2)^3//2*(a+b*arcsech(c*x))+1//9*b*x^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+2//9*b*d^-1*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(2*e+d*c^2)+2//9*b*c*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^-1//2*(d+e*x^2)^(1/2)*(2*e+d*c^2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+-1//9*b*c^-1*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)*(3*e+2*d*c^2)*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate(x^3*(d+e*x^2)^3//2*(a+b*arcsech(c*x)), x) == :(1//7*e^-2*(d+e*x^2)^7//2*(a+b*arcsech(c*x))+-1//5*d*e^-2*(d+e*x^2)^5//2*(a+b*arcsech(c*x))+2//35*b*d^7//2*e^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//42*b*c^-2*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^5//2+1//560*b*c^-7*e^-3//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(-25*e^3+35*c^6*d^3+-63*d*c^2*e^2+-35*e*c^4*d^2)*arctan(c^-1*e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+-1//840*b*c^-4*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^3//2*(25*e+13*d*c^2)+1//560*b*c^-6*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(-25*e^2+3*c^4*d^2+-38*d*e*c^2))
@test integrate(x*(d+e*x^2)^3//2*(a+b*arcsech(c*x)), x) == :(1//5*e^-1*(d+e*x^2)^5//2*(a+b*arcsech(c*x))+-1//5*b*d^5//2*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//20*b*c^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^3//2+-1//40*b*c^-5*e^-1//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(3*e^2+15*c^4*d^2+10*d*e*c^2)*arctan(c^-1*e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+-1//40*b*c^-4*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(3*e+7*d*c^2))
@test integrate(x^-6*(d+e*x^2)^3//2*(a+b*arcsech(c*x)), x) == :(-1//5*d^-1*x^-5*(d+e*x^2)^5//2*(a+b*arcsech(c*x))+1//25*b*x^-5*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^3//2+4//75*b*x^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(2*e+d*c^2)+1//75*b*d^-1*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(23*e^2+8*c^4*d^2+23*d*e*c^2)+1//75*b*c*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^-1//2*(d+e*x^2)^(1/2)*(23*e^2+8*c^4*d^2+23*d*e*c^2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+-1//75*b*c^-1*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)*(15*e^2+8*c^4*d^2+19*d*e*c^2)*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate(x^-8*(d+e*x^2)^3//2*(a+b*arcsech(c*x)), x) == :(-1//7*d^-1*x^-7*(d+e*x^2)^5//2*(a+b*arcsech(c*x))+2//35*e*d^-2*x^-5*(d+e*x^2)^5//2*(a+b*arcsech(c*x))+1//49*b*d^-1*x^-7*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^5//2+1//1225*b*d^-1*x^-5*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^3//2*(11*e+30*d*c^2)+1//3675*b*d^-1*x^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(-37*e^2+120*c^4*d^2+159*d*e*c^2)+1//3675*b*d^-2*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(-247*e^3+240*c^6*d^3+193*d*c^2*e^2+528*e*c^4*d^2)+1//3675*b*c*d^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^-1//2*(d+e*x^2)^(1/2)*(-247*e^3+240*c^6*d^3+193*d*c^2*e^2+528*e*c^4*d^2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+-2//3675*b*c^-1*d^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)*(-105*e^3+120*c^6*d^3+17*d*c^2*e^2+204*e*c^4*d^2)*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate(x^5*(d+e*x^2)^-1//2*(a+b*arcsech(c*x)), x) == :(1//5*e^-3*(d+e*x^2)^5//2*(a+b*arcsech(c*x))+d^2*e^-3*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x))+-2//3*d*e^-3*(d+e*x^2)^3//2*(a+b*arcsech(c*x))+-8//15*b*d^5//2*e^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//20*b*c^-2*e^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^3//2+-1//120*b*c^-5*e^-5//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(9*e^2+45*c^4*d^2+-10*d*e*c^2)*arctan(c^-1*e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+1//120*b*c^-4*e^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(-9*e+19*d*c^2))
@test integrate(x^3*(d+e*x^2)^-1//2*(a+b*arcsech(c*x)), x) == :(1//3*e^-2*(d+e*x^2)^3//2*(a+b*arcsech(c*x))+-1*d*e^-2*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x))+2//3*b*d^3//2*e^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//6*b*c^-2*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+1//6*b*c^-3*e^-3//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(-1*e+3*d*c^2)*arctan(c^-1*e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2))
@test integrate(x*(d+e*x^2)^-1//2*(a+b*arcsech(c*x)), x) == :(e^-1*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x))+-1*b*c^-1*e^-1//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctan(c^-1*e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+-1*b*d^(1/2)*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2)))
@test integrate(x^-2*(d+e*x^2)^-1//2*(a+b*arcsech(c*x)), x) == :(-1*d^-1*x^-1*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x))+b*d^-1*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+b*c*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^-1//2*(d+e*x^2)^(1/2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+-1*b*c^-1*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate(x^-4*(d+e*x^2)^-1//2*(a+b*arcsech(c*x)), x) == :(-1//3*d^-1*x^-3*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x))+2//3*e*d^-2*x^-1*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x))+1//9*b*d^-1*x^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+1//9*b*d^-2*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(-5*e+2*d*c^2)+1//9*b*c*d^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^-1//2*(d+e*x^2)^(1/2)*(-5*e+2*d*c^2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+-2//9*b*c^-1*d^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)*(-3*e+d*c^2)*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate(x^5*(d+e*x^2)^-3//2*(a+b*arcsech(c*x)), x) == :(1//3*e^-3*(d+e*x^2)^3//2*(a+b*arcsech(c*x))+-1*d^2*e^-3*(d+e*x^2)^-1//2*(a+b*arcsech(c*x))+-2*d*e^-3*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x))+8//3*b*d^3//2*e^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//6*b*c^-2*e^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+1//6*b*c^-3*e^-5//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(-1*e+9*d*c^2)*arctan(c^-1*e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2))
@test integrate(x^3*(d+e*x^2)^-3//2*(a+b*arcsech(c*x)), x) == :(e^-2*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x))+d*e^-2*(d+e*x^2)^-1//2*(a+b*arcsech(c*x))+-1*b*c^-1*e^-3//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctan(c^-1*e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+-2*b*d^(1/2)*e^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2)))
@test integrate(x*(d+e*x^2)^-3//2*(a+b*arcsech(c*x)), x) == :(-1*e^-1*(d+e*x^2)^-1//2*(a+b*arcsech(c*x))+b*d^-1//2*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2)))
@test integrate((d+e*x^2)^-3//2*(a+b*arcsech(c*x)), x) == :(x*d^-1*(d+e*x^2)^-1//2*(a+b*arcsech(c*x))+b*c^-1*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate(x^-2*(d+e*x^2)^-3//2*(a+b*arcsech(c*x)), x) == :(-1*d^-1*x^-1*(d+e*x^2)^-1//2*(a+b*arcsech(c*x))+-2*e*x*d^-2*(d+e*x^2)^-1//2*(a+b*arcsech(c*x))+b*d^-2*x^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+b*c*d^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^-1//2*(d+e*x^2)^(1/2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+-1*b*c^-1*d^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*(2*e+d*c^2)*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate(x^5*(d+e*x^2)^-5//2*(a+b*arcsech(c*x)), x) == :(e^-3*(d+e*x^2)^(1/2)*(a+b*arcsech(c*x))+2*d*e^-3*(d+e*x^2)^-1//2*(a+b*arcsech(c*x))+-1//3*d^2*e^-3*(d+e*x^2)^-3//2*(a+b*arcsech(c*x))+-1*b*c^-1*e^-5//2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctan(c^-1*e^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+-8//3*b*d^(1/2)*e^-3*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//3*b*d*e^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)^-1)
@test integrate(x^3*(d+e*x^2)^-5//2*(a+b*arcsech(c*x)), x) == :(-1*e^-2*(d+e*x^2)^-1//2*(a+b*arcsech(c*x))+1//3*d*e^-2*(d+e*x^2)^-3//2*(a+b*arcsech(c*x))+2//3*b*d^-1//2*e^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+1//3*b*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)^-1)
@test integrate(x*(d+e*x^2)^-5//2*(a+b*arcsech(c*x)), x) == :(-1//3*e^-1*(d+e*x^2)^-3//2*(a+b*arcsech(c*x))+1//3*b*d^-3//2*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*arctanh(d^-1//2*(1+-1*c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//3*b*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)^-1)
@test integrate(x^2*(d+e*x^2)^-5//2*(a+b*arcsech(c*x)), x) == :(1//3*d^-1*x^3*(d+e*x^2)^-3//2*(a+b*arcsech(c*x))+-1//3*b*x*d^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)^-1+1//3*b*c^-1*d^-1*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1)+-1//3*b*c*d^-1*e^-1*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^-1//2*(d+e*x^2)^(1/2)*(e+d*c^2)^-1*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate((d+e*x^2)^-5//2*(a+b*arcsech(c*x)), x) == :(1//3*x*d^-1*(d+e*x^2)^-3//2*(a+b*arcsech(c*x))+2//3*x*d^-2*(d+e*x^2)^-1//2*(a+b*arcsech(c*x))+2//3*b*c^-1*d^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(d+e*x^2)^-1//2*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1)+1//3*b*c*d^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+e*d^-1*x^2)^-1//2*(d+e*x^2)^(1/2)*(e+d*c^2)^-1*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+1//3*b*e*x*d^-2*((1+c*x)^-1)^(1/2)*(1+c*x)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)^-1)
@test integrate(x^11*(1+-1*c^4*x^4)^-1//2*(a+b*arcsech(c*x)), x) == :(-1//2*c^-12*(1+-1*c^4*x^4)^(1/2)*(a+b*arcsech(c*x))+-1//10*c^-12*(1+-1*c^4*x^4)^5//2*(a+b*arcsech(c*x))+1//3*c^-12*(1+-1*c^4*x^4)^3//2*(a+b*arcsech(c*x))+-13//150*b*c^-13*x^-1*(1+c^-1*x^-1)^-1//2*(1+c^2*x^2)^5//2*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2+-4//15*b*c^-13*x^-1*(1+c^-1*x^-1)^-1//2*(1+c^2*x^2)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2+-1//90*b*c^-13*x^-1*(1+c^-1*x^-1)^-1//2*(1+c^2*x^2)^9//2*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2+3//70*b*c^-13*x^-1*(1+c^-1*x^-1)^-1//2*(1+c^2*x^2)^7//2*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2+4//15*b*c^-13*x^-1*(1+c^-1*x^-1)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arctanh((1+c^2*x^2)^(1/2))+7//90*b*c^-13*x^-1*(1+c^-1*x^-1)^-1//2*(1+c^2*x^2)^3//2*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2)
@test integrate(x^7*(1+-1*c^4*x^4)^-1//2*(a+b*arcsech(c*x)), x) == :(-1//2*c^-8*(1+-1*c^4*x^4)^(1/2)*(a+b*arcsech(c*x))+1//6*c^-8*(1+-1*c^4*x^4)^3//2*(a+b*arcsech(c*x))+-1//3*b*c^-9*x^-1*(1+c^-1*x^-1)^-1//2*(1+c^2*x^2)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2+-1//30*b*c^-9*x^-1*(1+c^-1*x^-1)^-1//2*(1+c^2*x^2)^5//2*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2+1//3*b*c^-9*x^-1*(1+c^-1*x^-1)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arctanh((1+c^2*x^2)^(1/2))+1//18*b*c^-9*x^-1*(1+c^-1*x^-1)^-1//2*(1+c^2*x^2)^3//2*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2)
@test integrate(x^3*(1+-1*c^4*x^4)^-1//2*(a+b*arcsech(c*x)), x) == :(-1//2*c^-4*(1+-1*c^4*x^4)^(1/2)*(a+b*arcsech(c*x))+(1/2)*b*c^-5*x^-1*(1+c^-1*x^-1)^-1//2*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2*arctanh((1+c^2*x^2)^(1/2))+-1//2*b*c^-5*x^-1*(1+c^-1*x^-1)^-1//2*(1+c^2*x^2)^(1/2)*(1+-1*c^2*x^2)^(1/2)*(-1+c^-1*x^-1)^-1//2)

max_stars_repo_path: test/7 Inverse hyperbolic functions/7.5 Inverse hyperbolic secant/7.5.1 u (a+b arcsech(c x))^n.jl


text:
# import TikzPictures

# """
# """
# function save_plot(filename::AbstractString, tp::TikzPictures.TikzPicture)
#     filename = strip(filename)
#     if length(filename) == 0
#         error("filename is an empty string")
#     end
#     extension = filename_extension(filename)
#     if extension == ".pdf"
#         save_result = save_plot_pdf(filename, tp)
#     elseif extension == ".tex"
#         save_result = save_plot_tex(filename, tp)
#     elseif extension == ".tikz"
#         save_result = save_plot_tikz(filename, tp)
#     elseif extension == ".svg"
#         save_result = save_plot_svg(filename, tp)
#     else
#         error("File extension must be one of: .pdf, .tex, .tikz, .svg")
#     end
#     return filename
# end

# """
# """
# function save_plot_pdf(
#         filename::AbstractString,
#         tp::TikzPictures.TikzPicture,
#         )
#     filename = strip(filename)
#     if length(filename) == 0
#         error("filename is an empty string")
#     end
#     extension = filename_extension(filename)
#     if extension != ".pdf"
#         error("filename must end in .pdf")
#     end
#     parent_directory = Base.Filesystem.dirname(filename)
#     try
#         Base.Filesystem.mkpath(parent_directory)
#     catch
#     end
#     save_result = try
#         TikzPictures.save(TikzPictures.PDF(filename), tp)
#     catch e
#         handle_plotting_error(e)
#     end
#     return filename
# end

# """
# """
# function save_plot_tex(
#         filename::AbstractString,
#         tp::TikzPictures.TikzPicture,
#         )
#     filename = strip(filename)
#     if length(filename) == 0
#         error("filename is an empty string")
#     end
#     extension = filename_extension(filename)
#     if extension != ".tex"
#         error("filename must end in .tex")
#     end
#     parent_directory = Base.Filesystem.dirname(filename)
#     try
#         Base.Filesystem.mkpath(parent_directory)
#     catch
#     end
#     save_result = try
#         TikzPictures.save(TikzPictures.TEX(filename), tp)
#     catch e
#         handle_plotting_error(e)
#     end
#     return filename
# end

# """
# """
# function save_plot_tikz(
#         filename::AbstractString,
#         tp::TikzPictures.TikzPicture,
#         )
#     filename = strip(filename)
#     if length(filename) == 0
#         error("filename is an empty string")
#     end
#     if extension != ".tikz"
#         error("filename must end in .tikz")
#     end
#     extension = filename_extension(filename)
#     parent_directory = Base.Filesystem.dirname(filename)
#     try
#         Base.Filesystem.mkpath(parent_directory)
#     catch
#     end
#     save_result = try
#         TikzPictures.save(TikzPictures.TIKZ(filename), tp)
#     catch e
#         handle_plotting_error(e)
#     end
#     return filename
# end

# """
# """
# function save_plot_svg(
#         filename::AbstractString,
#         tp::TikzPictures.TikzPicture,
#         )
#     filename = strip(filename)
#     if length(filename) == 0
#         error("filename is an empty string")
#     end
#     extension = filename_extension(filename)
#     if extension != ".svg"
#         error("filename must end in .svg")
#     end
#     parent_directory = Base.Filesystem.dirname(filename)
#     try
#         Base.Filesystem.mkpath(parent_directory)
#     catch
#     end
#     save_result = try
#         TikzPictures.save(TikzPictures.SVG(filename), tp)
#     catch e
#         handle_plotting_error(e)
#     end
#     return filename
# end

# """
# """
# function open_plot(tp::TikzPictures.TikzPicture)
#     temp_svg_filename = string(tempname(), ".svg")
#     save_result = open_plot(temp_svg_filename, tp)
#     return temp_svg_filename
# end

# """
# """
# function open_plot(
#         filename::AbstractString,
#         tp::TikzPictures.TikzPicture,
#         )
#     filename = strip(filename)
#     if length(filename) == 0
#         error("filename is an empty string")
#     end
#     saveresult = save_plot(filename, tp)
#     open_result = open_browser_window(filename)
#     return filename
# end

ext: jl


text:
using Parameters
using LightXML
using OrderedCollections
using SimpleTranslations
using Formatting

@enum QuestionType multiple=1 boolean=2 shorttext=3

@with_kw struct QuestionMultiple
    tag::String
    question::String
    options::Vector{String}
    rights::Vector{UInt8}
    shuffle::Bool
end

@with_kw struct QuestionTrueFalse
    tag::String
    question::String
    right::Bool
end

@with_kw struct QuestionEssay
    tag::String
    question::String
end

@with_kw struct QuestionText
    tag::String
    question::String
    answer::String
end

@with_kw struct Quiz
    multiples::Vector{QuestionMultiple}=QuestionMultiple[]
    booleans::Vector{QuestionTrueFalse}=QuestionTrueFalse[]
    essays::Vector{QuestionEssay}=QuestionEssay[]
    texts::Vector{QuestionText}=QuestionText[]
    categories::Vector{String}=String[]
end

"""
Replace the symbols in iso-9110 (Windows) to UTF-8.

    replace_utf(text::AbstractString)
"""
function replace_utf8(text::AbstractString)
    dict = Dict("¿"=>"¿", "+" => "+", "%" => "%",
                "Ã³" => "ó", "Ã¡" => "á", "Â¿" => "¿", "Ã" => "í", "Ã©" => "é", "Ãº" => "ú")

    for (orig, new) in dict
        text = replace(text, orig=>new)
    end

    return text
end

function replace_html(text::AbstractString)
    dict = Dict("")
end

"""

read_swad(fname::AbstractString)::Quiz

Read a XML documentation from SWAD and return a Quiz answer
"""
function read_swad(fname::AbstractString)::Quiz
    xdoc = parse_file(fname)
    xroot = root(xdoc)
    questions = xroot["question"]
    quiz = Quiz()
    categories = String[]

    for xquestion in questions
        typestr = attribute(xquestion, "type")
        type::QuestionType = multiple

        if typestr == "TF"
            type = boolean
        elseif typestr == "uniqueChoice"
            type = multiple
        elseif typestr == "text"
            type = shorttext
        else
            continue
        end

        tags = find_element(xquestion, "tags")
        tag = "Missing"

        if !isnothing(tags)
            tag_node = find_element(tags, "tag")

            if !isnothing(tag_node)
                tag = replace_utf8(content(tag_node))
            end
        end

        if !(tag in quiz.categories)
            push!(quiz.categories, tag)
        end

        text = find_element(xquestion, "stem")
        @assert !isnothing(text)
        question = replace_utf8(content(text))

        if type == boolean
            answer = parse(Bool, content(find_element(xquestion, "answer")))
            shuffle = true
            push!(quiz.booleans, QuestionTrueFalse(tag=tag, question=question, right=answer))
        elseif type == shorttext
            answer_root = find_element(xquestion, "answer")
            option = find_element(answer_root, "option")
            answer = content(find_element(option, "text"))
            push!(quiz.texts, QuestionText(tag=tag, question=question, answer=answer))
        elseif type == multiple
            answer = find_element(xquestion, "answer")
            shuffle = attribute(answer, "shuffle")=="yes"

            xoptions = answer["option"]
            options = String[]
            right = -1

            for xoption in xoptions
                push!(options, content(find_element(xoption, "text")))

                if attribute(xoption, "correct")=="yes"
                    right=length(options)
                end
            end

            options = replace_utf8.(options)
            push!(quiz.multiples, QuestionMultiple(tag=tag, question=question,
                                           options=options,
                                           rights=[right],
                                               shuffle=shuffle))
        end
    end

    return quiz
end

function get_moodle_type(question::QuestionMultiple)
    return "multichoice"
end

function get_moodle_type(question::QuestionTrueFalse)
    return "truefalse"
end

function get_moodle_type(question::QuestionEssay)
    return "essay"
end

function get_moodle_type(question::QuestionText)
    return "shortanswer"
end

function get_moodle_type(question)
    error("Error, type of question '$(type)' is unknown")
end

function save_question_moodle!(xquestion, question::QuestionMultiple, penalty)
    generalfeedback = new_child(xquestion, "generalfeedback")
    # generalfeedback empty
    set_attribute(generalfeedback, "format", "html")
    new_child(generalfeedback, "text")
    # parameters
    if length(question.rights)==1
        single = "true"
    else
        single = "false"
    end

    params = OrderedDict("generalfeedback" => "1", "hidden" => "0", "penalty"=>penalty,
                         "single" => single, "shuffleanswers" => (question.shuffle ? "true" : "false"),
                          "answernumbering" => "abc")

    for (key, value) in params
        node = new_child(xquestion, key)
        add_text(node, value)
    end

    feedbacks = OrderedDict("correctfeedback" => "Respuesta correcta",
                            "partiallycorrectfeedback" => "Respuesta parcialmente correcta",
                            "incorrectfeedback" => "Respuesta incorrecta")

    for (feedback, message) in feedbacks
        node = new_child(xquestion, feedback)
        set_attribute(node, "format", "html")
        text = new_child(node, "text")
        add_text(text, message)
    end
end

function save_question_moodle!(xquestion, question::QuestionTrueFalse, penalty)
end

function save_question_moodle!(xquestion, question::QuestionEssay, penalty)
    answer = new_child(xquestion, "answer")
    set_attribute(answer, "fraction", "100")
    text = new_child(answer, "text")
    add_text(text, question.answer)
    return
end

function save_question_moodle!(xquestion, question::QuestionText, penalty)
    answer = new_child(xquestion, "answer")
    set_attribute(answer, "fraction", "100")
    text = new_child(answer, "text")
    add_text(text, question.answer)
    return
end

"""
Create the header of a question for Moodle

create_header_question_moodle(xroot, tag, type)
"""
function create_header_question_moodle(xdoc, xroot, question, i, penalty=0)
    xquestion = new_child(xroot, "question")
    # Set the type
    set_attribute(xquestion, "type", get_moodle_type(question))

    # Get penalty
    if penalty == 0
        penalty_str = "0"
    else
        penalty_str = "-$(penalty)"
    end

    # Put the id of the question
    name = new_child(new_child(xquestion, "name"), "text")
    add_text(name, "Question_$(i)")

    # Put the question text
    questiontext = new_child(xquestion, "questiontext")
    set_attribute(questiontext, "format", "html")
    text = new_child(questiontext, "text")
    question_text = question.question

    if contains(question_text, "
")
        add_cdata(xdoc, text, question_text)
    else
        add_text(text, question_text)
    end

    save_question_moodle!(xquestion, question, penalty_str)

    return xquestion
end

function add_answer_moodle(xquestion, description::AbstractString; format="html",
      num_rights=1, penalty=0, right::Bool=true)
    answer=new_child(xquestion, "answer")

    if right
       if num_rights == 1
         fraction = "100"
      else
         if num_rights == 2
            fraction = "50"
         elseif num_rights == 3
            fraction = "33.33333"
         elseif num_rights == 4
            fraction = "25"
         elseif num_rights == 5
             fraction = "20"
         else
             println("Fraction not defined: $(num_rights)")
         end
      end
    elseif num_rights > 1
        fraction = "-100"
    elseif penalty == -33
        fraction = "-33.33333"
    else
        fraction = "$penalty"
    end

    set_attribute(answer, "fraction", fraction)
    set_attribute(answer, "format", format)
    text = new_child(answer, "text")
    add_text(text, "$(description)")
    feedback = new_child(answer, "feedback")
    set_attribute(feedback, "format", "html")
    text = new_child(feedback, "text")
    add_text(text, "")
end

function is_multiple_boolean(question::QuestionMultiple)
    if length(question.options) != 2
        return false
    else
        option = question.options[1]

        return option in [get_msg("true"), get_msg("false")];
    end
end

function is_also(questions, question_str::AbstractString)
    for question in questions
        if (question.question == question_str)
            return true
        end
    end
    return false
end

"""

Save the quiz into a group of categories.

    save_to_moodle(quiz::Quiz, category::AbstractString)
"""
function save_to_moodle_category(quiz::Quiz, category::AbstractString; penalty_options=0, penalty_boolean=0)
    xdoc = XMLDocument()
    # Create test
    xroot = create_root(xdoc, "quiz")
    categories = [""]
    append!(categories, quiz.categories)

    # Get all the categories
    question = new_child(xroot, "question")
    set_attribute(question, "type", "category")
    cat = new_child(question, "category")
    text = new_child(cat, "text")
    add_text(text, "\$course\$/top/$(category)")

    if (penalty_options > 0)
        penalty_options_answer = convert(Int, -100*penalty_options)
    else
        penalty_options_answer = 0
    end

    if (penalty_boolean > 0)
        penalty_boolean_answer = convert(Int, -100*penalty_boolean)
    else
        penalty_boolean_answer = 0
    end

    multiples = quiz.multiples
    essays = quiz.essays
    booleans = quiz.booleans
    texts = quiz.texts

    if (penalty_boolean != 0)
        options = [get_msg("true"), get_msg("false")]

        for question in booleans
            if !is_also(multiples, question.question)
                rights = [(question.right) ? 1 : 2]
                push!(multiples, QuestionMultiple(question.tag, question.question, options,
                                                  rights, true))
            end
        end
        booleans = QuestionTrueFalse[]
    end

    # Put all the questions
    for (i, question) in enumerate(multiples)
        if question.tag != category
            continue
        end

        penalty = 0
        if is_multiple_boolean(question)
            penalty = penalty_boolean_answer
        else
            penalty = penalty_options_answer
        end

        xquestion = create_header_question_moodle(xdoc, xroot, question, i)
        # Show the answers
        for (posi,option) in enumerate(question.options)
            add_answer_moodle(xquestion, option, right = (posi in question.rights),
                              penalty=penalty, num_rights = length(question.rights))
        end
    end

    for (i, question) in enumerate(texts)
        if question.tag != category
            continue
        end

        xquestion = create_header_question_moodle(xdoc, xroot, question, i)
    end

    for (i, question) in enumerate(essays)
        if question.tag != category
            continue
        end

        xquestion = create_header_question_moodle(xdoc, xroot, question, i)
    end

    # Put all the true/false questions
    for (i, question) in enumerate(booleans)
        if question.tag != category
            continue
        end

        xquestion = create_header_question_moodle(xdoc, xroot, question, i)

        # Show the answers
        add_answer_moodle(xquestion, "true", format="moodle_auto_format", right=(question.right==true))
        add_answer_moodle(xquestion, "false", format="moodle_auto_format", right=(question.right==false))
    end

    return xdoc
end

function save_to_moodle(quiz::Quiz, template::AbstractString; penalty_options=0, penalty_boolean=0)
    for category in quiz.categories
        fname = replace(template, ".xml" => "_$(category).xml")
        fname = replace(fname, " " => "_")
        xdoc = save_to_moodle_category(quiz, category, penalty_options=penalty_options,
                                       penalty_boolean=penalty_boolean)
        save_file(xdoc, fname)
    end
end

"""
Save the questions in a file as a XML Moodle Question

    txt_to_moodle(fname::AbstractString, template::AbstractString)

"""
function txt_to_moodle(fname::AbstractString, template::AbstractString, penalty=0)
    quiz = txt_to_quiz(fname)
    save_to_moodle(quiz, template, penalty)
    return nothing
end

"""
Read the text file to create the Quiz

    read_txt(fname)
"""
function read_txt(fname::AbstractString)::Quiz
    fmessages = joinpath(dirname(pathof(MoodleQuestions)), "messages.ini")
    loadmsgs!(fmessages, strict_mode=true)

    isfile(fname) || error(format(get_msg("reading_file"), fname))
    open(fname) do file
        return read_txt(file)
    end
end

function is_category(line)
    return startswith(line, r"\*\s*")
end

function get_category_name(line)
    mcat = match(r"^\*\s*(.*)$", line)
    @assert !isnothing(mcat)
    return mcat.captures[1]
end

function is_question_truefalse(line)
    return endswith(line, r"[–+-]")
end

function get_truefalse_question(line)
    return line[1:end-1]
end

function get_short_question(line)
    pos = findfirst('[', line)
    return strip(line[1:pos-1])
end

function get_short_answer(line)
    m=match(r"\[(.*)\]", line)
    answer = strip(m.captures[1])
    return answer
end

function get_essay_question(line)
    return line[2:end-1]
end

function is_question_essay(line)
    return startswith(line, "[") && endswith(line, "]")
end

function is_question_true(line)
    return line[end] == '+'
end

function is_question_options(line)
    return !endswith(line, r"[\]–+-]") && !startswith(line, r"[\[–+-]")
end

function is_question_short(line)
    return endswith(line, "]") && !startswith(line, r"[\[–+-]")
end

function is_start_multiple_question(line)
    return startswith(line, "`")
end

function is_end_multiple_question(line)
    return endswith(line, "`")
end

function remove_multiple_question_mark(line)
    return replace(line, "`"=>"")
end

function convert_multiple_question(line)
    line = replace(line, "<" => "<")
    line = replace(line, "\n" => "

")
    line = replace(line, "\t" => "    ")
    line = replace(line, " " => " ")
    return "
" * line * "
";
end

function is_option(line)
    return startswith(line, r"[–+-]")
end

function get_option(line)
    is_true = (line[1] == '+')
    option = strip(line[2:end])
    return option, is_true
end

function save_question!(questions, category, question, options::AbstractArray{String,1},
                       trues::AbstractArray{Int32,1}, shuffle::Bool)
    if isempty(trues)
        error(format(get_msg("noright_question"), question))
    end

    push!(questions, QuestionMultiple(tag=category,
                                      question=question, options=options, rights=trues,
                                      shuffle=shuffle))
end

"""
Read the text file to create the Quiz

    read_txt(io::IO)
"""
function read_txt(io::IO)::Quiz
    categories = String[]
    response_error = nothing
    category = "Default"
    question = ""
    shuffle = true
    trues = Int32[]
    options = String[]
    booleanQuestions = QuestionTrueFalse[]
    questions = QuestionMultiple[]
    essays = QuestionEssay[]
    texts = QuestionText[]
    multiple = false

    for line_orig in readlines(io)
        line = strip(line_orig)

        if (isempty(line))
            continue
        end

        if !is_category(line) && isempty(categories)
            push!(categories, category)
        end

        if is_category(line)
            oldcategory = category
            category = get_category_name(line)
            push!(categories, category)

            if !isempty(question)
                save_question!(questions, oldcategory, question, options, trues, shuffle)
                options = String[]
                trues = Int32[]
                shuffle = true
                question = ""
            end
        elseif multiple == true
            if is_option(line)
                error(format(get_msg("noquestion_line"), line))
            end
            if is_end_multiple_question(line)
                multiple = false
            end
            question *= "\n" *remove_multiple_question_mark(line_orig)

            if multiple == false
                question = convert_multiple_question(question)
            end
        elseif multiple == false && is_start_multiple_question(line)
            multiple = true

            if !isempty(options)
                save_question!(questions, category, question, options, trues, shuffle)
                options = String[]
                trues = Int32[]
                shuffle = true
                question = remove_multiple_question_mark(line)
            end
        elseif is_question_truefalse(line) || is_question_essay(line)

            if !isempty(options)
                save_question!(questions, category, question, options, trues, shuffle)
                options = String[]
                trues = Int32[]
                shuffle = true
                question = ""
            end

            if (is_question_truefalse(line))
                push!(booleanQuestions, QuestionTrueFalse(tag=category,
                                                      question=get_truefalse_question(line),
                                                          right=is_question_true(line)))
            else
                push!(essays, QuestionEssay(tag=category, question=get_essay_question(line)))
            end
            question = ""
        elseif is_option(line)
            # Check error
            if isempty(question)
                error(format(get_msg("noquestion_line"), line))
            end
            option, is_true = get_option(line)
            push!(options, option)

            if (is_true)
                push!(trues, length(options))
            end

            if occursin(r"\b[ABCDEF]\b", line)
                shuffle = false
            end
        elseif is_question_short(line)
            push!(texts, QuestionText(tag=category,
                                                      question=get_short_question(line),
                                                      answer=get_short_answer(line)))
        elseif is_question_options(line)
            if !isempty(options)
                save_question!(questions, category, question, options, trues, shuffle)
                options = String[]
                trues = Int32[]
                shuffle = true
                question = ""
            elseif !isempty(question)
                error(format(get_msg("nooption"), question))
            end

            if !isempty(question)
                question *= "\n$line"
            else
                question = line
            end
        end
   end

    if (question != "")
        save_question!(questions, category, question, options, trues, shuffle)
    end

    return Quiz(categories=categories, multiples=questions, essays=essays, booleans=booleanQuestions, texts=texts)
end

max_stars_repo_name: dmolina/MoodleQuestions

max_issues_repo_name: dmolina/MoodleQuestions

max_forks_repo_name: dmolina/MoodleQuestions


text:
#Continuous callback

#############################
#Callback 1: healthy → Infect
#############################

#Cells are infected after a certain viral load is met (with μ=800 virons, σ=200 virons)
const maxViralLoad = rand(Normal(m2c(800.0),m2c(200.0)),N,N)

function CheckInfect(u,t,integrator)
    #Reshape the array into 3D
    uReshaped =  reshape(u,N,N,species)

    #Check the whole virus grid for cells with viral conc. greater than 0.4 nM
    return any( @. (uReshaped[:,:,end] > maxViralLoad) & integrator.p.infectFirstAttempt)
end

#These don't need to be constructed every loop
    const Index = CartesianIndices(zeros(N,N))
    #Get the first and last index
    const Ifirst, Ilast = first(Index), last(Index)

function TryInfect(integrator)
    #Probability that an infected cell will spread infection
    chanceOfInfection = Bernoulli(0.5)
    cellsInfected = integrator.p.cellsInfected
    @show integrator.t

    #Sundials does not presereve problem shape...
    uReshaped = reshape(integrator.u,N,N,species)

    #Loop through all of the infectious cells
     for I in findall(uReshaped[:,:,end] .> maxViralLoad)
        #Loop through all neighbors to see if they get infected
        for J in max(Ifirst, I-Ifirst):min(Ilast, I+Ifirst)
            #If the cell is healthy and not the current cell try to infect
            @inbounds if isinf(cellsInfected[J]) && (I != J) && rand(chanceOfInfection)
                #Add Viral DNA to the cell
                uReshaped[J,2] = rand(Uniform(0.0,m2c(1e3)))
                #Mark that the cell was infected
                cellsInfected[J] = integrator.t
            end
        end
        #This cell has used its one attempt to infect neighboring cells
        integrator.p.infectFirstAttempt[I] = false
    end

    integrator.u = uReshaped[:]
end

cbInfect = DiscreteCallback(CheckInfect,TryInfect, save_positions=(false,false))

#############################
#Callback 2: Infect → Dead
#############################

#Cells die some time after infection (with μ=8.0 hours, σ=1.0 hours)
const time2Death = rand(Normal(8.0,1.0),N,N)

function DeathCheck(u,t,integrator)
    cellsInfected = integrator.p.cellsInfected
    #Loop through and check if a cell should die
    cellCounter = 1
    while cellCounter < length(cellsInfected)
        #If cell infected and cell past time of death
        pastTimeOfDeath = (t - cellsInfected[cellCounter]) > time2Death[cellCounter]
        isAlive = isinf(integrator.p.cellsDead[cellCounter])
        if pastTimeOfDeath & isAlive
            return true
        end
        cellCounter += 1
    end
    return false
end

function KillCell(integrator)
    cellsInfected = integrator.p.cellsInfected
    #Find all the cells to kill
    pastTimeOfDeath = (integrator.t .- cellsInfected) .> time2Death
    isAlive = isinf.(integrator.p.cellsDead)
    targets = findall(isAlive .& pastTimeOfDeath)
    #println(sum(integrator.p.deathParameter .== 0.0))
    #Set their deathParameter to stop all cell function
    integrator.p.deathParameter[targets] .= 0.0
    #Mark time of death
    integrator.p.cellsDead[targets] .= integrator.t
end

cbDead = DiscreteCallback(DeathCheck,KillCell,save_positions=(false,false))

cb =CallbackSet(cbInfect,cbDead)