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

@test integrate(x^6*(a+b*arcsec(c*x)), x) == :(1//7*x^7*(a+b*arcsec(c*x))+-5//112*b*c^-7*arctanh((1+-1*c^-2*x^-2)^(1/2))+-5//112*b*c^-5*x^2*(1+-1*c^-2*x^-2)^(1/2)+-5//168*b*c^-3*x^4*(1+-1*c^-2*x^-2)^(1/2)+-1//42*b*c^-1*x^6*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^5*(a+b*arcsec(c*x)), x) == :(1//6*x^6*(a+b*arcsec(c*x))+-4//45*b*x*c^-5*(1+-1*c^-2*x^-2)^(1/2)+-2//45*b*c^-3*x^3*(1+-1*c^-2*x^-2)^(1/2)+-1//30*b*c^-1*x^5*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^4*(a+b*arcsec(c*x)), x) == :(1//5*x^5*(a+b*arcsec(c*x))+-3//40*b*c^-5*arctanh((1+-1*c^-2*x^-2)^(1/2))+-3//40*b*c^-3*x^2*(1+-1*c^-2*x^-2)^(1/2)+-1//20*b*c^-1*x^4*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^3*(a+b*arcsec(c*x)), x) == :(1//4*x^4*(a+b*arcsec(c*x))+-1//6*b*x*c^-3*(1+-1*c^-2*x^-2)^(1/2)+-1//12*b*c^-1*x^3*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^2*(a+b*arcsec(c*x)), x) == :(1//3*x^3*(a+b*arcsec(c*x))+-1//6*b*c^-3*arctanh((1+-1*c^-2*x^-2)^(1/2))+-1//6*b*c^-1*x^2*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x*(a+b*arcsec(c*x)), x) == :((1/2)*x^2*(a+b*arcsec(c*x))+-1//2*b*x*c^-1*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(a+b*arcsec(c*x), x) == :(a*x+b*x*arcsec(c*x)+-1*b*c^-1*arctanh((1+-1*c^-2*x^-2)^(1/2)))
@test integrate(x^-1*(a+b*arcsec(c*x)), x) == :(-1*(a+b*arcsec(c*x))*log(1+exp(2*im*arcsec(c*x)))+(1/2)*im*b*Polylogarithms.polylog(2,-1*exp(2*im*arcsec(c*x)))+(1/2)*im*b^-1*(a+b*arcsec(c*x))^2)
@test integrate(x^-2*(a+b*arcsec(c*x)), x) == :(-1*x^-1*(a+b*arcsec(c*x))+b*c*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^-3*(a+b*arcsec(c*x)), x) == :(-1//2*x^-2*(a+b*arcsec(c*x))+-1//4*b*c^2*arccsc(c*x)+1//4*b*c*x^-1*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^-4*(a+b*arcsec(c*x)), x) == :(-1//3*x^-3*(a+b*arcsec(c*x))+-1//9*b*c^3*(1+-1*c^-2*x^-2)^3//2+1//3*b*c^3*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^-5*(a+b*arcsec(c*x)), x) == :(-1//4*x^-4*(a+b*arcsec(c*x))+-3//32*b*c^4*arccsc(c*x)+1//16*b*c*x^-3*(1+-1*c^-2*x^-2)^(1/2)+3//32*b*c^3*x^-1*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^-6*(a+b*arcsec(c*x)), x) == :(-1//5*x^-5*(a+b*arcsec(c*x))+-2//15*b*c^5*(1+-1*c^-2*x^-2)^3//2+1//5*b*c^5*(1+-1*c^-2*x^-2)^(1/2)+1//25*b*c^5*(1+-1*c^-2*x^-2)^5//2)
@test integrate(x^-7*(a+b*arcsec(c*x)), x) == :(-1//6*x^-6*(a+b*arcsec(c*x))+-5//96*b*c^6*arccsc(c*x)+1//36*b*c*x^-5*(1+-1*c^-2*x^-2)^(1/2)+5//96*b*c^5*x^-1*(1+-1*c^-2*x^-2)^(1/2)+5//144*b*c^3*x^-3*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^3*(a+b*arcsec(c*x))^2, x) == :(1//4*x^4*(a+b*arcsec(c*x))^2+1//3*b^2*c^-4*log(x)+1//12*b^2*c^-2*x^2+-1//3*b*x*c^-3*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))+-1//6*b*c^-1*x^3*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x)))
@test integrate(x^2*(a+b*arcsec(c*x))^2, x) == :(1//3*x^3*(a+b*arcsec(c*x))^2+1//3*x*b^2*c^-2+-1//3*im*b^2*c^-3*Polylogarithms.polylog(2,-1*im*exp(im*arcsec(c*x)))+1//3*im*b^2*c^-3*Polylogarithms.polylog(2,im*exp(im*arcsec(c*x)))+-1//3*b*c^-1*x^2*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))+2//3*im*b*c^-3*(a+b*arcsec(c*x))*arctan(exp(im*arcsec(c*x))))
@test integrate(x*(a+b*arcsec(c*x))^2, x) == :((1/2)*x^2*(a+b*arcsec(c*x))^2+b^2*c^-2*log(x)+-1*b*x*c^-1*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x)))
@test integrate((a+b*arcsec(c*x))^2, x) == :(x*(a+b*arcsec(c*x))^2+-2*im*b^2*c^-1*Polylogarithms.polylog(2,-1*im*exp(im*arcsec(c*x)))+2*im*b^2*c^-1*Polylogarithms.polylog(2,im*exp(im*arcsec(c*x)))+4*im*b*c^-1*(a+b*arcsec(c*x))*arctan(exp(im*arcsec(c*x))))
@test integrate(x^-1*(a+b*arcsec(c*x))^2, x) == :(-1*(a+b*arcsec(c*x))^2*log(1+exp(2*im*arcsec(c*x)))+-1//2*b^2*Polylogarithms.polylog(3,-1*exp(2*im*arcsec(c*x)))+1//3*im*b^-1*(a+b*arcsec(c*x))^3+im*b*(a+b*arcsec(c*x))*Polylogarithms.polylog(2,-1*exp(2*im*arcsec(c*x))))
@test integrate(x^-2*(a+b*arcsec(c*x))^2, x) == :(-1*x^-1*(a+b*arcsec(c*x))^2+2*b^2*x^-1+2*b*c*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x)))
@test integrate(x^-3*(a+b*arcsec(c*x))^2, x) == :((a+b*arcsec(c*x))^2*((1/2)*c^2+-1//2*x^-2)+1//4*b^2*x^-2+-1//4*b^2*c^2*arcsec(c*x)^2+-1//2*a*b*c^2*arcsec(c*x)+(1/2)*b*c*x^-1*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x)))
@test integrate(x^-4*(a+b*arcsec(c*x))^2, x) == :(-1//3*x^-3*(a+b*arcsec(c*x))^2+2//27*b^2*x^-3+4//9*b^2*c^2*x^-1+4//9*b*c^3*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))+2//9*b*c*x^-2*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x)))
@test integrate(x^-5*(a+b*arcsec(c*x))^2, x) == :(-1//4*x^-4*(a+b*arcsec(c*x))^2+1//32*b^2*x^-4+3//32*b^2*c^2*x^-2+3//32*b^2*c^4*arcsec(c*x)^2+3//16*a*b*c^4*arcsec(c*x)+1//8*b*c*x^-3*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))+3//16*b*c^3*x^-1*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x)))
@test integrate(x^3*(a+b*arcsec(c*x))^3, x) == :(1//4*x^4*(a+b*arcsec(c*x))^3+(1/2)*im*b*c^-4*(a+b*arcsec(c*x))^2+(1/2)*im*b^3*c^-4*Polylogarithms.polylog(2,-1*exp(2*im*arcsec(c*x)))+-1*b^2*c^-4*(a+b*arcsec(c*x))*log(1+exp(2*im*arcsec(c*x)))+-1//4*x*b^3*c^-3*(1+-1*c^-2*x^-2)^(1/2)+1//4*b^2*c^-2*x^2*(a+b*arcsec(c*x))+-1//2*b*x*c^-3*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^2+-1//4*b*c^-1*x^3*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^2)
@test integrate(x^2*(a+b*arcsec(c*x))^3, x) == :(1//3*x^3*(a+b*arcsec(c*x))^3+b^3*c^-3*Polylogarithms.polylog(3,-1*im*exp(im*arcsec(c*x)))+-1*b^3*c^-3*Polylogarithms.polylog(3,im*exp(im*arcsec(c*x)))+-1*b^3*c^-3*arctanh((1+-1*c^-2*x^-2)^(1/2))+x*b^2*c^-2*(a+b*arcsec(c*x))+im*b*c^-3*(a+b*arcsec(c*x))^2*arctan(exp(im*arcsec(c*x)))+im*b^2*c^-3*(a+b*arcsec(c*x))*Polylogarithms.polylog(2,im*exp(im*arcsec(c*x)))+-1*im*b^2*c^-3*(a+b*arcsec(c*x))*Polylogarithms.polylog(2,-1*im*exp(im*arcsec(c*x)))+-1//2*b*c^-1*x^2*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^2)
@test integrate(x*(a+b*arcsec(c*x))^3, x) == :((1/2)*x^2*(a+b*arcsec(c*x))^3+-3*b^2*c^-2*(a+b*arcsec(c*x))*log(1+exp(2*im*arcsec(c*x)))+3//2*im*b*c^-2*(a+b*arcsec(c*x))^2+3//2*im*b^3*c^-2*Polylogarithms.polylog(2,-1*exp(2*im*arcsec(c*x)))+-3//2*b*x*c^-1*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^2)
@test integrate((a+b*arcsec(c*x))^3, x) == :(x*(a+b*arcsec(c*x))^3+-6*b^3*c^-1*Polylogarithms.polylog(3,im*exp(im*arcsec(c*x)))+6*b^3*c^-1*Polylogarithms.polylog(3,-1*im*exp(im*arcsec(c*x)))+-6*im*b^2*c^-1*(a+b*arcsec(c*x))*Polylogarithms.polylog(2,-1*im*exp(im*arcsec(c*x)))+6*im*b*c^-1*(a+b*arcsec(c*x))^2*arctan(exp(im*arcsec(c*x)))+6*im*b^2*c^-1*(a+b*arcsec(c*x))*Polylogarithms.polylog(2,im*exp(im*arcsec(c*x))))
@test integrate(x^-1*(a+b*arcsec(c*x))^3, x) == :(-1*(a+b*arcsec(c*x))^3*log(1+exp(2*im*arcsec(c*x)))+-3//2*b^2*(a+b*arcsec(c*x))*Polylogarithms.polylog(3,-1*exp(2*im*arcsec(c*x)))+-3//4*im*b^3*Polylogarithms.polylog(4,-1*exp(2*im*arcsec(c*x)))+1//4*im*b^-1*(a+b*arcsec(c*x))^4+3//2*im*b*(a+b*arcsec(c*x))^2*Polylogarithms.polylog(2,-1*exp(2*im*arcsec(c*x))))
@test integrate(x^-2*(a+b*arcsec(c*x))^3, x) == :(-1*x^-1*(a+b*arcsec(c*x))^3+-6*c*b^3*(1+-1*c^-2*x^-2)^(1/2)+6*b^2*x^-1*(a+b*arcsec(c*x))+3*b*c*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^2)
@test integrate(x^-3*(a+b*arcsec(c*x))^3, x) == :((a+b*arcsec(c*x))^3*((1/2)*c^2+-1//2*x^-2)+-1//4*c^2*(a+b*arcsec(c*x))^3+-3//4*b^2*(a+b*arcsec(c*x))*(c^2+-1*x^-2)+3//8*b^3*c^2*arcsec(c*x)+-3//8*c*b^3*x^-1*(1+-1*c^-2*x^-2)^(1/2)+3//4*b*c*x^-1*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^2)
@test integrate(x^-4*(a+b*arcsec(c*x))^3, x) == :(-1//3*x^-3*(a+b*arcsec(c*x))^3+-14//9*b^3*c^3*(1+-1*c^-2*x^-2)^(1/2)+2//9*b^2*x^-3*(a+b*arcsec(c*x))+2//27*b^3*c^3*(1+-1*c^-2*x^-2)^3//2+2//3*b*c^3*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^2+4//3*b^2*c^2*x^-1*(a+b*arcsec(c*x))+1//3*b*c*x^-2*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^2)
@test integrate(x^-5*(a+b*arcsec(c*x))^3, x) == :(-1//4*x^-4*(a+b*arcsec(c*x))^3+3//32*c^4*(a+b*arcsec(c*x))^3+-45//256*b^3*c^4*arcsec(c*x)+3//32*b^2*x^-4*(a+b*arcsec(c*x))+-45//256*b^3*c^3*x^-1*(1+-1*c^-2*x^-2)^(1/2)+-3//128*c*b^3*x^-3*(1+-1*c^-2*x^-2)^(1/2)+9//32*b^2*c^2*x^-2*(a+b*arcsec(c*x))+3//16*b*c*x^-3*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^2+9//32*b*c^3*x^-1*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^2)
@test integrate(x^-2*(a+b*arcsec(c*x))^-1, x) == :(c*b^-1*cos(a*b^-1)*sinintegral(a*b^-1+arcsec(c*x))+-1*c*b^-1*cosintegral(a*b^-1+arcsec(c*x))*sin(a*b^-1))
@test integrate(x^-3*(a+b*arcsec(c*x))^-1, x) == :((1/2)*b^-1*c^2*cos(2*a*b^-1)*sinintegral(2*arcsec(c*x)+2*a*b^-1)+-1//2*b^-1*c^2*cosintegral(2*arcsec(c*x)+2*a*b^-1)*sin(2*a*b^-1))
@test integrate(x^-4*(a+b*arcsec(c*x))^-1, x) == :(-1//4*b^-1*c^3*cosintegral(3*arcsec(c*x)+3*a*b^-1)*sin(3*a*b^-1)+-1//4*b^-1*c^3*cosintegral(a*b^-1+arcsec(c*x))*sin(a*b^-1)+1//4*b^-1*c^3*cos(a*b^-1)*sinintegral(a*b^-1+arcsec(c*x))+1//4*b^-1*c^3*cos(3*a*b^-1)*sinintegral(3*arcsec(c*x)+3*a*b^-1))
@test integrate(x^-2*(a+b*arcsec(c*x))^-2, x) == :(c*b^-2*cos(a*b^-1)*cosintegral(a*b^-1+arcsec(c*x))+c*b^-2*sin(a*b^-1)*sinintegral(a*b^-1+arcsec(c*x))+-1*c*b^-1*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^-1)
@test integrate(x^-3*(a+b*arcsec(c*x))^-2, x) == :(b^-2*c^2*cos(2*a*b^-1)*cosintegral(2*arcsec(c*x)+2*a*b^-1)+b^-2*c^2*sin(2*a*b^-1)*sinintegral(2*arcsec(c*x)+2*a*b^-1)+-1//2*b^-1*c^2*(a+b*arcsec(c*x))^-1*sin(2*arcsec(c*x)))
@test integrate(x^-4*(a+b*arcsec(c*x))^-2, x) == :(-1//4*b^-1*c^3*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^-1+-1//4*b^-1*c^3*(a+b*arcsec(c*x))^-1*sin(3*arcsec(c*x))+1//4*b^-2*c^3*cos(a*b^-1)*cosintegral(a*b^-1+arcsec(c*x))+1//4*b^-2*c^3*sin(a*b^-1)*sinintegral(a*b^-1+arcsec(c*x))+3//4*b^-2*c^3*cos(3*a*b^-1)*cosintegral(3*arcsec(c*x)+3*a*b^-1)+3//4*b^-2*c^3*sin(3*a*b^-1)*sinintegral(3*arcsec(c*x)+3*a*b^-1))
@test integrate(x^-2*(a+b*arcsec(c*x))^-3, x) == :(-1//2*b^-2*x^-1*(a+b*arcsec(c*x))^-1+(1/2)*c*b^-3*cosintegral(a*b^-1+arcsec(c*x))*sin(a*b^-1)+-1//2*c*b^-1*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^-2+-1//2*c*b^-3*cos(a*b^-1)*sinintegral(a*b^-1+arcsec(c*x)))
@test integrate(x^-3*(a+b*arcsec(c*x))^-3, x) == :(b^-3*c^2*cosintegral(2*arcsec(c*x)+2*a*b^-1)*sin(2*a*b^-1)+-1*b^-3*c^2*cos(2*a*b^-1)*sinintegral(2*arcsec(c*x)+2*a*b^-1)+-1//2*b^-2*c^2*(a+b*arcsec(c*x))^-1*cos(2*arcsec(c*x))+-1//4*b^-1*c^2*(a+b*arcsec(c*x))^-2*sin(2*arcsec(c*x)))
@test integrate(x^-4*(a+b*arcsec(c*x))^-3, x) == :(-9//8*b^-3*c^3*cos(3*a*b^-1)*sinintegral(3*arcsec(c*x)+3*a*b^-1)+-3//8*b^-2*c^3*(a+b*arcsec(c*x))^-1*cos(3*arcsec(c*x))+-1//8*b^-1*c^3*(1+-1*c^-2*x^-2)^(1/2)*(a+b*arcsec(c*x))^-2+-1//8*b^-1*c^3*(a+b*arcsec(c*x))^-2*sin(3*arcsec(c*x))+-1//8*b^-3*c^3*cos(a*b^-1)*sinintegral(a*b^-1+arcsec(c*x))+-1//8*b^-2*c^2*x^-1*(a+b*arcsec(c*x))^-1+1//8*b^-3*c^3*cosintegral(a*b^-1+arcsec(c*x))*sin(a*b^-1)+9//8*b^-3*c^3*cosintegral(3*arcsec(c*x)+3*a*b^-1)*sin(3*a*b^-1))
@test integrate((d+e*x)^3*(a+b*arcsec(c*x)), x) == :(1//4*e^-1*(d+e*x)^4*(a+b*arcsec(c*x))+1//4*b*d^4*e^-1*arccsc(c*x)+-1//2*b*d*c^-3*(e^2+2*c^2*d^2)*arctanh((1+-1*c^-2*x^-2)^(1/2))+-1//12*b*c^-1*e^3*x^3*(1+-1*c^-2*x^-2)^(1/2)+-1//2*b*d*c^-1*e^2*x^2*(1+-1*c^-2*x^-2)^(1/2)+-1//6*b*e*x*c^-3*(1+-1*c^-2*x^-2)^(1/2)*(e^2+9*c^2*d^2))
@test integrate((d+e*x)^2*(a+b*arcsec(c*x)), x) == :(1//3*e^-1*(d+e*x)^3*(a+b*arcsec(c*x))+-1//6*b*c^-3*(e^2+6*c^2*d^2)*arctanh((1+-1*c^-2*x^-2)^(1/2))+1//3*b*d^3*e^-1*arccsc(c*x)+-1//6*b*c^-1*e^2*x^2*(1+-1*c^-2*x^-2)^(1/2)+-1*b*d*e*x*c^-1*(1+-1*c^-2*x^-2)^(1/2))
@test integrate((a+b*arcsec(c*x))*(d+e*x), x) == :((1/2)*e^-1*(d+e*x)^2*(a+b*arcsec(c*x))+(1/2)*b*d^2*e^-1*arccsc(c*x)+-1*b*d*c^-1*arctanh((1+-1*c^-2*x^-2)^(1/2))+-1//2*b*e*x*c^-1*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(a+b*arcsec(c*x), x) == :(a*x+b*x*arcsec(c*x)+-1*b*c^-1*arctanh((1+-1*c^-2*x^-2)^(1/2)))
@test integrate((d+e*x)^-1*(a+b*arcsec(c*x)), x) == :(e^-1*(a+b*arcsec(c*x))*log(1+c^-1*d^-1*(e+(e^2+-1*c^2*d^2)^(1/2))*exp(im*arcsec(c*x)))+e^-1*(a+b*arcsec(c*x))*log(1+c^-1*d^-1*(e+-1*(e^2+-1*c^2*d^2)^(1/2))*exp(im*arcsec(c*x)))+-1*e^-1*(a+b*arcsec(c*x))*log(1+exp(2*im*arcsec(c*x)))+(1/2)*im*b*e^-1*Polylogarithms.polylog(2,-1*exp(2*im*arcsec(c*x)))+-1*im*b*e^-1*Polylogarithms.polylog(2,-1*c^-1*d^-1*(e+(e^2+-1*c^2*d^2)^(1/2))*exp(im*arcsec(c*x)))+-1*im*b*e^-1*Polylogarithms.polylog(2,-1*c^-1*d^-1*(e+-1*(e^2+-1*c^2*d^2)^(1/2))*exp(im*arcsec(c*x))))
@test integrate((d+e*x)^-2*(a+b*arcsec(c*x)), x) == :(-1*e^-1*(d+e*x)^-1*(a+b*arcsec(c*x))+-1*b*d^-1*e^-1*arccsc(c*x)+-1*b*d^-1*(-1*e^2+c^2*d^2)^-1//2*arctanh(c^-1*(1+-1*c^-2*x^-2)^-1//2*(-1*e^2+c^2*d^2)^-1//2*(d*c^2+e*x^-1)))
@test integrate((d+e*x)^-3*(a+b*arcsec(c*x)), x) == :(-1//2*e^-1*(d+e*x)^-2*(a+b*arcsec(c*x))+-1//2*b*d^-2*e^-1*arccsc(c*x)+-1//2*b*d^-2*(-1*e^2+c^2*d^2)^-3//2*(-1*e^2+2*c^2*d^2)*arctanh(c^-1*(1+-1*c^-2*x^-2)^-1//2*(-1*e^2+c^2*d^2)^-1//2*(d*c^2+e*x^-1))+(1/2)*b*c*e*d^-1*(1+-1*c^-2*x^-2)^(1/2)*(e+d*x^-1)^-1*(-1*e^2+c^2*d^2)^-1)
@test integrate(x^4*(a+b*arcsec(c*x))*(d+e*x^2), x) == :(1//5*d*x^5*(a+b*arcsec(c*x))+1//7*e*x^7*(a+b*arcsec(c*x))+-1//42*b*e*c^-1*x^6*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+-1//560*b*x*c^-6*(c^2*x^2)^-1//2*(25*e+42*d*c^2)*arctanh(c*x*(-1+c^2*x^2)^-1//2)+-1//560*b*c^-5*x^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(25*e+42*d*c^2)+-1//840*b*c^-3*x^4*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(25*e+42*d*c^2))
@test integrate(x^2*(a+b*arcsec(c*x))*(d+e*x^2), x) == :(1//3*d*x^3*(a+b*arcsec(c*x))+1//5*e*x^5*(a+b*arcsec(c*x))+-1//20*b*e*c^-1*x^4*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+-1//120*b*x*c^-4*(c^2*x^2)^-1//2*(9*e+20*d*c^2)*arctanh(c*x*(-1+c^2*x^2)^-1//2)+-1//120*b*c^-3*x^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(9*e+20*d*c^2))
@test integrate((a+b*arcsec(c*x))*(d+e*x^2), x) == :(d*x*(a+b*arcsec(c*x))+1//3*e*x^3*(a+b*arcsec(c*x))+-1//6*b*e*c^-1*x^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+-1//6*b*x*c^-2*(c^2*x^2)^-1//2*(e+6*d*c^2)*arctanh(c*x*(-1+c^2*x^2)^-1//2))
@test integrate(x^-2*(a+b*arcsec(c*x))*(d+e*x^2), x) == :(e*x*(a+b*arcsec(c*x))+-1*d*x^-1*(a+b*arcsec(c*x))+b*c*d*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+-1*b*e*x*(c^2*x^2)^-1//2*arctanh(c*x*(-1+c^2*x^2)^-1//2))
@test integrate(x^-4*(a+b*arcsec(c*x))*(d+e*x^2), x) == :(-1*e*x^-1*(a+b*arcsec(c*x))+-1//3*d*x^-3*(a+b*arcsec(c*x))+1//9*b*c*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(9*e+2*d*c^2)+1//9*b*c*d*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2))
@test integrate(x^-6*(a+b*arcsec(c*x))*(d+e*x^2), x) == :(-1//3*e*x^-3*(a+b*arcsec(c*x))+-1//5*d*x^-5*(a+b*arcsec(c*x))+2//225*b*c^3*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(25*e+12*d*c^2)+1//25*b*c*d*x^-4*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+1//225*b*c*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(25*e+12*d*c^2))
@test integrate(x^-8*(a+b*arcsec(c*x))*(d+e*x^2), x) == :(-1//5*e*x^-5*(a+b*arcsec(c*x))+-1//7*d*x^-7*(a+b*arcsec(c*x))+8//3675*b*c^5*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(49*e+30*d*c^2)+1//49*b*c*d*x^-6*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+1//1225*b*c*x^-4*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(49*e+30*d*c^2)+4//3675*b*c^3*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(49*e+30*d*c^2))
@test integrate(x^5*(a+b*arcsec(c*x))*(d+e*x^2), x) == :(1//6*d*x^6*(a+b*arcsec(c*x))+1//8*e*x^8*(a+b*arcsec(c*x))+-1//24*b*x*c^-7*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(3*e+4*d*c^2)+-1//56*b*e*x*c^-7*(c^2*x^2)^-1//2*(-1+c^2*x^2)^7//2+-1//72*b*x*c^-7*(c^2*x^2)^-1//2*(-1+c^2*x^2)^3//2*(9*e+8*d*c^2)+-1//120*b*x*c^-7*(c^2*x^2)^-1//2*(-1+c^2*x^2)^5//2*(9*e+4*d*c^2))
@test integrate(x^3*(a+b*arcsec(c*x))*(d+e*x^2), x) == :(1//4*d*x^4*(a+b*arcsec(c*x))+1//6*e*x^6*(a+b*arcsec(c*x))+-1//12*b*x*c^-5*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(2*e+3*d*c^2)+-1//30*b*e*x*c^-5*(c^2*x^2)^-1//2*(-1+c^2*x^2)^5//2+-1//36*b*x*c^-5*(c^2*x^2)^-1//2*(-1+c^2*x^2)^3//2*(4*e+3*d*c^2))
@test integrate(x*(a+b*arcsec(c*x))*(d+e*x^2), x) == :(1//4*e^-1*(d+e*x^2)^2*(a+b*arcsec(c*x))+-1//4*b*x*c^-3*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(e+2*d*c^2)+-1//12*b*e*x*c^-3*(c^2*x^2)^-1//2*(-1+c^2*x^2)^3//2+-1//4*b*c*x*d^2*e^-1*(c^2*x^2)^-1//2*arctan((-1+c^2*x^2)^(1/2)))
@test integrate(x^-1*(a+b*arcsec(c*x))*(d+e*x^2), x) == :((1/2)*e*x^2*(a+b*arcsec(c*x))+-1*d*(a+b*arcsec(c*x))*log(x^-1)+b*d*arccsc(c*x)*log(1+-1*exp(2*im*arccsc(c*x)))+-1*b*d*arccsc(c*x)*log(x^-1)+-1//2*im*b*d*arccsc(c*x)^2+-1//2*im*b*d*Polylogarithms.polylog(2,exp(2*im*arccsc(c*x)))+-1//2*b*e*x*c^-1*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^-3*(a+b*arcsec(c*x))*(d+e*x^2), x) == :(-1*e*(a+b*arcsec(c*x))*log(x^-1)+-1//2*d*x^-2*(a+b*arcsec(c*x))+b*e*arccsc(c*x)*log(1+-1*exp(2*im*arccsc(c*x)))+-1*b*e*arccsc(c*x)*log(x^-1)+-1//2*im*b*e*arccsc(c*x)^2+-1//2*im*b*e*Polylogarithms.polylog(2,exp(2*im*arccsc(c*x)))+-1//4*b*d*c^2*arccsc(c*x)+1//4*b*c*d*x^-1*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^2*(d+e*x^2)^2*(a+b*arcsec(c*x)), x) == :(1//3*d^2*x^3*(a+b*arcsec(c*x))+1//7*e^2*x^7*(a+b*arcsec(c*x))+2//5*d*e*x^5*(a+b*arcsec(c*x))+-1//42*b*c^-1*e^2*x^6*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+-1//1680*b*x*c^-6*(c^2*x^2)^-1//2*(75*e^2+280*c^4*d^2+252*d*e*c^2)*arctanh(c*x*(-1+c^2*x^2)^-1//2)+-1//1680*b*c^-5*x^2*(c^2*x^2)^-1//2*(-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^-3*x^4*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(25*e+84*d*c^2))
@test integrate((d+e*x^2)^2*(a+b*arcsec(c*x)), x) == :(x*d^2*(a+b*arcsec(c*x))+1//5*e^2*x^5*(a+b*arcsec(c*x))+2//3*d*e*x^3*(a+b*arcsec(c*x))+-1//20*b*c^-1*e^2*x^4*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+-1//120*b*x*c^-4*(c^2*x^2)^-1//2*(9*e^2+120*c^4*d^2+40*d*e*c^2)*arctanh(c*x*(-1+c^2*x^2)^-1//2)+-1//120*b*e*c^-3*x^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(9*e+40*d*c^2))
@test integrate(x^-2*(d+e*x^2)^2*(a+b*arcsec(c*x)), x) == :(-1*d^2*x^-1*(a+b*arcsec(c*x))+1//3*e^2*x^3*(a+b*arcsec(c*x))+2*d*e*x*(a+b*arcsec(c*x))+b*c*d^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+-1//6*b*c^-1*e^2*x^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+-1//6*b*e*x*c^-2*(c^2*x^2)^-1//2*(e+12*d*c^2)*arctanh(c*x*(-1+c^2*x^2)^-1//2))
@test integrate(x^-4*(d+e*x^2)^2*(a+b*arcsec(c*x)), x) == :(x*e^2*(a+b*arcsec(c*x))+-1//3*d^2*x^-3*(a+b*arcsec(c*x))+-2*d*e*x^-1*(a+b*arcsec(c*x))+-1*b*x*e^2*(c^2*x^2)^-1//2*arctanh(c*x*(-1+c^2*x^2)^-1//2)+1//9*b*c*d^2*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+2//9*b*c*d*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(9*e+d*c^2))
@test integrate(x^-6*(d+e*x^2)^2*(a+b*arcsec(c*x)), x) == :(-1*e^2*x^-1*(a+b*arcsec(c*x))+-1//5*d^2*x^-5*(a+b*arcsec(c*x))+-2//3*d*e*x^-3*(a+b*arcsec(c*x))+1//225*b*c*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(225*e^2+24*c^4*d^2+100*d*e*c^2)+1//25*b*c*d^2*x^-4*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+2//225*b*c*d*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(25*e+6*d*c^2))
@test integrate(x^-8*(d+e*x^2)^2*(a+b*arcsec(c*x)), x) == :(-1//3*e^2*x^-3*(a+b*arcsec(c*x))+-1//7*d^2*x^-7*(a+b*arcsec(c*x))+-2//5*d*e*x^-5*(a+b*arcsec(c*x))+2//11025*b*c^3*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(1225*e^2+360*c^4*d^2+1176*d*e*c^2)+1//49*b*c*d^2*x^-6*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)+1//11025*b*c*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(1225*e^2+360*c^4*d^2+1176*d*e*c^2)+2//1225*b*c*d*x^-4*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(49*e+15*d*c^2))
@test integrate(x^3*(d+e*x^2)^2*(a+b*arcsec(c*x)), x) == :(1//4*d^2*x^4*(a+b*arcsec(c*x))+1//8*e^2*x^8*(a+b*arcsec(c*x))+1//3*d*e*x^6*(a+b*arcsec(c*x))+-1//24*b*x*c^-7*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(3*e^2+6*c^4*d^2+8*d*e*c^2)+-1//56*b*x*c^-7*e^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^7//2+-1//72*b*x*c^-7*(c^2*x^2)^-1//2*(-1+c^2*x^2)^3//2*(9*e^2+6*c^4*d^2+16*d*e*c^2)+-1//120*b*e*x*c^-7*(c^2*x^2)^-1//2*(-1+c^2*x^2)^5//2*(9*e+8*d*c^2))
@test integrate(x*(d+e*x^2)^2*(a+b*arcsec(c*x)), x) == :(1//6*e^-1*(d+e*x^2)^3*(a+b*arcsec(c*x))+-1//6*b*x*c^-5*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(e^2+3*c^4*d^2+3*d*e*c^2)+-1//30*b*x*c^-5*e^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^5//2+-1//6*b*c*x*d^3*e^-1*(c^2*x^2)^-1//2*arctan((-1+c^2*x^2)^(1/2))+-1//18*b*e*x*c^-5*(c^2*x^2)^-1//2*(-1+c^2*x^2)^3//2*(2*e+3*d*c^2))
@test integrate(x^-1*(d+e*x^2)^2*(a+b*arcsec(c*x)), x) == :(-1*d^2*(a+b*arcsec(c*x))*log(x^-1)+1//4*e^2*x^4*(a+b*arcsec(c*x))+b*d^2*arccsc(c*x)*log(1+-1*exp(2*im*arccsc(c*x)))+d*e*x^2*(a+b*arcsec(c*x))+-1*b*d^2*arccsc(c*x)*log(x^-1)+-1//2*im*b*d^2*arccsc(c*x)^2+-1//2*im*b*d^2*Polylogarithms.polylog(2,exp(2*im*arccsc(c*x)))+-1//12*b*c^-1*e^2*x^3*(1+-1*c^-2*x^-2)^(1/2)+-1//6*b*e*x*c^-3*(1+-1*c^-2*x^-2)^(1/2)*(e+6*d*c^2))
@test integrate(x^-3*(d+e*x^2)^2*(a+b*arcsec(c*x)), x) == :((1/2)*e^2*x^2*(a+b*arcsec(c*x))+-1//2*d^2*x^-2*(a+b*arcsec(c*x))+-2*d*e*(a+b*arcsec(c*x))*log(x^-1)+-1//4*b*c^2*d^2*arccsc(c*x)+-1*im*b*d*e*arccsc(c*x)^2+-1*im*b*d*e*Polylogarithms.polylog(2,exp(2*im*arccsc(c*x)))+-2*b*d*e*arccsc(c*x)*log(x^-1)+2*b*d*e*arccsc(c*x)*log(1+-1*exp(2*im*arccsc(c*x)))+-1//2*b*x*c^-1*e^2*(1+-1*c^-2*x^-2)^(1/2)+1//4*b*c*d^2*x^-1*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^2*(d+e*x^2)^-1*(a+b*arcsec(c*x)), x) == :(x*e^-1*(a+b*arcsec(c*x))+(1/2)*e^-3//2*(-1d)^(1/2)*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^-3//2*(-1d)^(1/2)*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1*b*c^-1*e^-1*arctanh((1+-1*c^-2*x^-2)^(1/2))+-1//2*e^-3//2*(-1d)^(1/2)*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*e^-3//2*(-1d)^(1/2)*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*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(im*arcsec(c*x)))+(1/2)*im*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(im*arcsec(c*x)))+-1//2*im*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(im*arcsec(c*x)))+-1//2*im*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(im*arcsec(c*x))))
@test integrate(x*(d+e*x^2)^-1*(a+b*arcsec(c*x)), x) == :((1/2)*e^-1*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^-1*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^-1*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^-1*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1*e^-1*(a+b*arcsec(c*x))*log(1+exp(2*im*arcsec(c*x)))+(1/2)*im*b*e^-1*Polylogarithms.polylog(2,-1*exp(2*im*arcsec(c*x)))+-1//2*im*b*e^-1*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*im*b*e^-1*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*im*b*e^-1*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*im*b*e^-1*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x))))
@test integrate((d+e*x^2)^-1*(a+b*arcsec(c*x)), x) == :((1/2)*e^-1//2*(-1d)^-1//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^-1//2*(-1d)^-1//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*e^-1//2*(-1d)^-1//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*e^-1//2*(-1d)^-1//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*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(im*arcsec(c*x)))+(1/2)*im*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(im*arcsec(c*x)))+-1//2*im*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(im*arcsec(c*x)))+-1//2*im*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(im*arcsec(c*x))))
@test integrate(x^-1*(d+e*x^2)^-1*(a+b*arcsec(c*x)), x) == :(-1//2*d^-1*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*d^-1*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*d^-1*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*d^-1*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-1*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-1*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-1*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-1*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b^-1*d^-1*(a+b*arcsec(c*x))^2)
@test integrate(x^-2*(d+e*x^2)^-1*(a+b*arcsec(c*x)), x) == :(-1*a*d^-1*x^-1+b*c*d^-1*(1+-1*c^-2*x^-2)^(1/2)+(1/2)*e^(1/2)*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^(1/2)*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1*b*d^-1*x^-1*arcsec(c*x)+-1//2*e^(1/2)*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*e^(1/2)*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*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(im*arcsec(c*x)))+(1/2)*im*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(im*arcsec(c*x)))+-1//2*im*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(im*arcsec(c*x)))+-1//2*im*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(im*arcsec(c*x))))
@test integrate(x^5*(d+e*x^2)^-2*(a+b*arcsec(c*x)), x) == :((1/2)*e^-2*x^2*(a+b*arcsec(c*x))+(1/2)*d*e^-2*(e+d*x^-2)^-1*(a+b*arcsec(c*x))+-1*d*e^-3*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1*d*e^-3*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1*d*e^-3*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1*d*e^-3*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+2*d*e^-3*(a+b*arcsec(c*x))*log(1+exp(2*im*arcsec(c*x)))+im*b*d*e^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+im*b*d*e^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+im*b*d*e^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+im*b*d*e^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*b*d*e^-5//2*(e+d*c^2)^-1//2*arctan(c^-1*e^-1//2*x^-1*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2))+-1*im*b*d*e^-3*Polylogarithms.polylog(2,-1*exp(2*im*arcsec(c*x)))+-1//2*b*x*c^-1*e^-2*(1+-1*c^-2*x^-2)^(1/2))
@test integrate(x^3*(d+e*x^2)^-2*(a+b*arcsec(c*x)), x) == :((1/2)*e^-2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^-2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^-2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^-2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1*e^-2*(a+b*arcsec(c*x))*log(1+exp(2*im*arcsec(c*x)))+-1//2*e^-1*(e+d*x^-2)^-1*(a+b*arcsec(c*x))+(1/2)*im*b*e^-2*Polylogarithms.polylog(2,-1*exp(2*im*arcsec(c*x)))+-1//2*im*b*e^-2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*im*b*e^-2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*im*b*e^-2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*im*b*e^-2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*b*e^-3//2*(e+d*c^2)^-1//2*arctan(c^-1*e^-1//2*x^-1*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2)))
@test integrate(x*(d+e*x^2)^-2*(a+b*arcsec(c*x)), x) == :(-1//2*e^-1*(d+e*x^2)^-1*(a+b*arcsec(c*x))+(1/2)*b*c*x*d^-1*e^-1*(c^2*x^2)^-1//2*arctan((-1+c^2*x^2)^(1/2))+-1//2*b*c*x*d^-1*e^-1//2*(c^2*x^2)^-1//2*(e+d*c^2)^-1//2*arctan(e^(1/2)*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-1//2))
@test integrate(x^-1*(d+e*x^2)^-2*(a+b*arcsec(c*x)), x) == :(-1//2*d^-2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*d^-2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*d^-2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*d^-2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-2*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-2*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b^-1*d^-2*(a+b*arcsec(c*x))^2+-1//2*e*d^-2*(e+d*x^-2)^-1*(a+b*arcsec(c*x))+-1//2*b*d^-2*e^(1/2)*(e+d*c^2)^-1//2*arctan(c^-1*e^-1//2*x^-1*(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*arcsec(c*x)), x) == :(x*e^-2*(a+b*arcsec(c*x))+-1*b*c^-1*e^-2*arctanh((1+-1*c^-2*x^-2)^(1/2))+-3//4*e^-5//2*(-1d)^(1/2)*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-3//4*e^-5//2*(-1d)^(1/2)*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//4*d*e^-2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(a+b*arcsec(c*x))+1//4*d*e^-2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(a+b*arcsec(c*x))+3//4*e^-5//2*(-1d)^(1/2)*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+3//4*e^-5//2*(-1d)^(1/2)*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-3//4*im*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(im*arcsec(c*x)))+-3//4*im*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(im*arcsec(c*x)))+-1//4*b*d^(1/2)*e^-2*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+e^(1/2)*x^-1*(-1d)^(1/2)))+-1//4*b*d^(1/2)*e^-2*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+-1*e^(1/2)*x^-1*(-1d)^(1/2)))+3//4*im*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(im*arcsec(c*x)))+3//4*im*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(im*arcsec(c*x))))
@test integrate(x^2*(d+e*x^2)^-2*(a+b*arcsec(c*x)), x) == :(-1//4*e^-1*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(a+b*arcsec(c*x))+1//4*e^-1*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(a+b*arcsec(c*x))+-1//4*e^-3//2*(-1d)^-1//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//4*e^-3//2*(-1d)^-1//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+1//4*e^-3//2*(-1d)^-1//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+1//4*e^-3//2*(-1d)^-1//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//4*im*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(im*arcsec(c*x)))+-1//4*im*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(im*arcsec(c*x)))+1//4*im*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(im*arcsec(c*x)))+1//4*im*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(im*arcsec(c*x)))+1//4*b*d^-1//2*e^-1*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+e^(1/2)*x^-1*(-1d)^(1/2)))+1//4*b*d^-1//2*e^-1*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+-1*e^(1/2)*x^-1*(-1d)^(1/2))))
@test integrate((d+e*x^2)^-2*(a+b*arcsec(c*x)), x) == :(-1//4*d^-1*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(a+b*arcsec(c*x))+1//4*d^-1*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(a+b*arcsec(c*x))+-1//4*b*d^-3//2*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+e^(1/2)*x^-1*(-1d)^(1/2)))+-1//4*b*d^-3//2*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+-1*e^(1/2)*x^-1*(-1d)^(1/2)))+-1//4*e^-1//2*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//4*e^-1//2*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+1//4*e^-1//2*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+1//4*e^-1//2*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//4*im*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(im*arcsec(c*x)))+-1//4*im*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(im*arcsec(c*x)))+1//4*im*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(im*arcsec(c*x)))+1//4*im*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(im*arcsec(c*x))))
@test integrate(x^-2*(d+e*x^2)^-2*(a+b*arcsec(c*x)), x) == :(-1*a*d^-2*x^-1+b*c*d^-2*(1+-1*c^-2*x^-2)^(1/2)+-1*b*d^-2*x^-1*arcsec(c*x)+-3//4*e^(1/2)*(-1d)^-5//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-3//4*e^(1/2)*(-1d)^-5//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//4*e*d^-2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(a+b*arcsec(c*x))+1//4*e*d^-2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(a+b*arcsec(c*x))+3//4*e^(1/2)*(-1d)^-5//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+3//4*e^(1/2)*(-1d)^-5//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-3//4*im*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(im*arcsec(c*x)))+-3//4*im*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(im*arcsec(c*x)))+1//4*b*e*d^-5//2*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+e^(1/2)*x^-1*(-1d)^(1/2)))+1//4*b*e*d^-5//2*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+-1*e^(1/2)*x^-1*(-1d)^(1/2)))+3//4*im*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(im*arcsec(c*x)))+3//4*im*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(im*arcsec(c*x))))
@test integrate(x^5*(d+e*x^2)^-3*(a+b*arcsec(c*x)), x) == :((1/2)*e^-3*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^-3*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^-3*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*e^-3*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1*e^-3*(a+b*arcsec(c*x))*log(1+exp(2*im*arcsec(c*x)))+-1//2*e^-2*(e+d*x^-2)^-1*(a+b*arcsec(c*x))+-1//4*e^-1*(e+d*x^-2)^-2*(a+b*arcsec(c*x))+(1/2)*im*b*e^-3*Polylogarithms.polylog(2,-1*exp(2*im*arcsec(c*x)))+-1//2*im*b*e^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*im*b*e^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*im*b*e^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*im*b*e^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*b*e^-5//2*(e+d*c^2)^-1//2*arctan(c^-1*e^-1//2*x^-1*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2))+-1//8*b*e^-5//2*(e+d*c^2)^-3//2*(2*e+d*c^2)*arctan(c^-1*e^-1//2*x^-1*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2))+-1//8*b*c*d*e^-2*x^-1*(1+-1*c^-2*x^-2)^(1/2)*(e+d*c^2)^-1*(e+d*x^-2)^-1)
@test integrate(x^3*(d+e*x^2)^-3*(a+b*arcsec(c*x)), x) == :(1//4*d^-1*x^4*(d+e*x^2)^-2*(a+b*arcsec(c*x))+1//8*b*c*x*e^-1*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1*(e+d*c^2)^-1+-1//8*b*c*x*d^-1*e^-3//2*(c^2*x^2)^-1//2*(e+d*c^2)^-3//2*(2*e+d*c^2)*arctan(e^(1/2)*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-1//2))
@test integrate(x*(d+e*x^2)^-3*(a+b*arcsec(c*x)), x) == :(-1//4*e^-1*(d+e*x^2)^-2*(a+b*arcsec(c*x))+1//4*b*c*x*d^-2*e^-1*(c^2*x^2)^-1//2*arctan((-1+c^2*x^2)^(1/2))+-1//8*b*c*x*d^-1*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1*(e+d*c^2)^-1+-1//8*b*c*x*d^-2*e^-1//2*(c^2*x^2)^-1//2*(e+d*c^2)^-3//2*(2*e+3*d*c^2)*arctan(e^(1/2)*(-1+c^2*x^2)^(1/2)*(e+d*c^2)^-1//2))
@test integrate(x^-1*(d+e*x^2)^-3*(a+b*arcsec(c*x)), x) == :(-1//2*d^-3*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*d^-3*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*d^-3*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//2*d^-3*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-3*Polylogarithms.polylog(2,c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b*d^-3*Polylogarithms.polylog(2,-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+(1/2)*im*b^-1*d^-3*(a+b*arcsec(c*x))^2+-1*e*d^-3*(e+d*x^-2)^-1*(a+b*arcsec(c*x))+1//4*d^-3*e^2*(e+d*x^-2)^-2*(a+b*arcsec(c*x))+-1*b*d^-3*e^(1/2)*(e+d*c^2)^-1//2*arctan(c^-1*e^-1//2*x^-1*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2))+1//8*b*d^-3*e^(1/2)*(e+d*c^2)^-3//2*(2*e+d*c^2)*arctan(c^-1*e^-1//2*x^-1*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^(1/2))+1//8*b*c*e*d^-2*x^-1*(1+-1*c^-2*x^-2)^(1/2)*(e+d*c^2)^-1*(e+d*x^-2)^-1)
@test integrate(x^4*(d+e*x^2)^-3*(a+b*arcsec(c*x)), x) == :(-1//16*e^-2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(3a+3*b*arcsec(c*x))+1//16*e^-2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(3a+3*b*arcsec(c*x))+-1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//16*e^-3//2*(-1d)^(1/2)*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-2*(a+b*arcsec(c*x))+1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+1//16*e^-5//2*(-1d)^-1//2*(3a+3*b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+1//16*e^-3//2*(-1d)^(1/2)*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-2*(a+b*arcsec(c*x))+-3//16*im*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(im*arcsec(c*x)))+-3//16*im*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(im*arcsec(c*x)))+1//16*b*d^-1//2*e^-1*(e+d*c^2)^-3//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+e^(1/2)*x^-1*(-1d)^(1/2)))+1//16*b*d^-1//2*e^-1*(e+d*c^2)^-3//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+-1*e^(1/2)*x^-1*(-1d)^(1/2)))+3//16*im*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(im*arcsec(c*x)))+3//16*im*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(im*arcsec(c*x)))+3//16*b*d^-1//2*e^-2*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+e^(1/2)*x^-1*(-1d)^(1/2)))+3//16*b*d^-1//2*e^-2*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+-1*e^(1/2)*x^-1*(-1d)^(1/2)))+1//16*b*c*e^-3//2*(-1d)^(1/2)*(1+-1*c^-2*x^-2)^(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+-1*c^-2*x^-2)^(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*arcsec(c*x)), x) == :(-1//16*b*d^-3//2*(e+d*c^2)^-3//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+e^(1/2)*x^-1*(-1d)^(1/2)))+-1//16*b*d^-3//2*(e+d*c^2)^-3//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+-1*e^(1/2)*x^-1*(-1d)^(1/2)))+-1//16*d^-1*e^-1*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(a+b*arcsec(c*x))+-1//16*e^-3//2*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//16*e^-3//2*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//16*e^-1//2*(-1d)^-1//2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-2*(a+b*arcsec(c*x))+1//16*d^-1*e^-1*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(a+b*arcsec(c*x))+1//16*e^-3//2*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+1//16*e^-3//2*(-1d)^-3//2*(a+b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+1//16*e^-1//2*(-1d)^-1//2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-2*(a+b*arcsec(c*x))+-1//16*im*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(im*arcsec(c*x)))+-1//16*im*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(im*arcsec(c*x)))+1//16*im*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(im*arcsec(c*x)))+1//16*im*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(im*arcsec(c*x)))+1//16*b*d^-3//2*e^-1*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+e^(1/2)*x^-1*(-1d)^(1/2)))+1//16*b*d^-3//2*e^-1*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+-1*e^(1/2)*x^-1*(-1d)^(1/2)))+1//16*b*c*e^-1//2*(-1d)^-1//2*(1+-1*c^-2*x^-2)^(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+-1*c^-2*x^-2)^(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*arcsec(c*x)), x) == :(-1//16*d^-2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-1*(5a+5*b*arcsec(c*x))+1//16*d^-2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-1*(5a+5*b*arcsec(c*x))+-5//16*b*d^-5//2*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+e^(1/2)*x^-1*(-1d)^(1/2)))+-5//16*b*d^-5//2*(e+d*c^2)^-1//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+-1*e^(1/2)*x^-1*(-1d)^(1/2)))+-1//16*e^(1/2)*(-1d)^-3//2*(d*x^-1+e^(1/2)*(-1d)^(1/2))^-2*(a+b*arcsec(c*x))+-1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arcsec(c*x))*log(1+c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+1//16*e^(1/2)*(-1d)^-3//2*(e^(1/2)*(-1d)^(1/2)+-1*d*x^-1)^-2*(a+b*arcsec(c*x))+1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+1//16*e^-1//2*(-1d)^-5//2*(3a+3*b*arcsec(c*x))*log(1+-1*c*(-1d)^(1/2)*(e^(1/2)+-1*(e+d*c^2)^(1/2))^-1*exp(im*arcsec(c*x)))+-3//16*im*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(im*arcsec(c*x)))+-3//16*im*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(im*arcsec(c*x)))+1//16*b*e*d^-5//2*(e+d*c^2)^-3//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+e^(1/2)*x^-1*(-1d)^(1/2)))+1//16*b*e*d^-5//2*(e+d*c^2)^-3//2*arctanh(c^-1*d^-1//2*(1+-1*c^-2*x^-2)^-1//2*(e+d*c^2)^-1//2*(d*c^2+-1*e^(1/2)*x^-1*(-1d)^(1/2)))+3//16*im*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(im*arcsec(c*x)))+3//16*im*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(im*arcsec(c*x)))+1//16*b*c*e^(1/2)*(-1d)^-3//2*(1+-1*c^-2*x^-2)^(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+-1*c^-2*x^-2)^(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*arcsec(c*x)), x) == :(1//7*e^-3*(d+e*x^2)^7//2*(a+b*arcsec(c*x))+-2//5*d*e^-3*(d+e*x^2)^5//2*(a+b*arcsec(c*x))+1//3*d^2*e^-3*(d+e*x^2)^3//2*(a+b*arcsec(c*x))+-1//42*b*x*c^-1*e^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^5//2+-1//1680*b*x*c^-6*e^-5//2*(c^2*x^2)^-1//2*(75*e^3+105*c^6*d^3+-35*e*c^4*d^2+63*d*c^2*e^2)*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+8//105*b*c*x*d^7//2*e^-3*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+1//840*b*x*c^-3*e^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^3//2*(-25*e+29*d*c^2)+1//1680*b*x*c^-5*e^-2*(c^2*x^2)^-1//2*(-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^3*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x)), x) == :(1//5*e^-2*(d+e*x^2)^5//2*(a+b*arcsec(c*x))+-1//3*d*e^-2*(d+e*x^2)^3//2*(a+b*arcsec(c*x))+-2//15*b*c*x*d^5//2*e^-2*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//20*b*x*c^-1*e^-1*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^3//2+1//120*b*x*c^-4*e^-3//2*(c^2*x^2)^-1//2*(-9*e^2+15*c^4*d^2+-10*d*e*c^2)*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+-1//120*b*x*c^-3*e^-1*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(9*e+d*c^2))
@test integrate(x*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x)), x) == :(1//3*e^-1*(d+e*x^2)^3//2*(a+b*arcsec(c*x))+-1//6*b*x*c^-1*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+-1//6*b*x*c^-2*e^-1//2*(c^2*x^2)^-1//2*(e+3*d*c^2)*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+1//3*b*c*x*d^3//2*e^-1*(c^2*x^2)^-1//2*arctan(d^-1//2*(-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*arcsec(c*x)), x) == :(-1//3*d^-1*x^-3*(d+e*x^2)^3//2*(a+b*arcsec(c*x))+1//9*b*c*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+2//9*b*c*d^-1*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(2*e+d*c^2)+-2//9*b*x*c^2*d^-1*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*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*x*d^-1*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*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*arcsec(c*x)), x) == :(1//7*e^-2*(d+e*x^2)^7//2*(a+b*arcsec(c*x))+-1//5*d*e^-2*(d+e*x^2)^5//2*(a+b*arcsec(c*x))+-2//35*b*c*x*d^7//2*e^-2*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//42*b*x*c^-1*e^-1*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^5//2+1//560*b*x*c^-6*e^-3//2*(c^2*x^2)^-1//2*(-25*e^3+35*c^6*d^3+-63*d*c^2*e^2+-35*e*c^4*d^2)*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+-1//840*b*x*c^-3*e^-1*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^3//2*(25*e+13*d*c^2)+1//560*b*x*c^-5*e^-1*(c^2*x^2)^-1//2*(-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*arcsec(c*x)), x) == :(1//5*e^-1*(d+e*x^2)^5//2*(a+b*arcsec(c*x))+-1//20*b*x*c^-1*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^3//2+-1//40*b*x*c^-4*e^-1//2*(c^2*x^2)^-1//2*(3*e^2+15*c^4*d^2+10*d*e*c^2)*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+-1//40*b*x*c^-3*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(3*e+7*d*c^2)+1//5*b*c*x*d^5//2*e^-1*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2)))
@test integrate(x^-6*(d+e*x^2)^3//2*(a+b*arcsec(c*x)), x) == :(-1//5*d^-1*x^-5*(d+e*x^2)^5//2*(a+b*arcsec(c*x))+1//25*b*c*x^-4*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^3//2+1//75*b*c*d^-1*(c^2*x^2)^-1//2*(-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)+4//75*b*c*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(2*e+d*c^2)+-1//75*b*x*c^2*d^-1*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-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)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+1//75*b*x*d^-1*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*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*arcsec(c*x)), x) == :(-1//7*d^-1*x^-7*(d+e*x^2)^5//2*(a+b*arcsec(c*x))+2//35*e*d^-2*x^-5*(d+e*x^2)^5//2*(a+b*arcsec(c*x))+1//49*b*c*d^-1*x^-6*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^5//2+1//3675*b*c*d^-2*(c^2*x^2)^-1//2*(-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//1225*b*c*d^-1*x^-4*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^3//2*(11*e+30*d*c^2)+1//3675*b*c*d^-1*x^-2*(c^2*x^2)^-1//2*(-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*x*c^2*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-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)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+2//3675*b*x*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*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*arcsec(c*x)), x) == :(1//5*e^-3*(d+e*x^2)^5//2*(a+b*arcsec(c*x))+d^2*e^-3*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+-2//3*d*e^-3*(d+e*x^2)^3//2*(a+b*arcsec(c*x))+-1//20*b*x*c^-1*e^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^3//2+-1//120*b*x*c^-4*e^-5//2*(c^2*x^2)^-1//2*(9*e^2+45*c^4*d^2+-10*d*e*c^2)*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+8//15*b*c*x*d^5//2*e^-3*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+1//120*b*x*c^-3*e^-2*(c^2*x^2)^-1//2*(-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*arcsec(c*x)), x) == :(1//3*e^-2*(d+e*x^2)^3//2*(a+b*arcsec(c*x))+-1*d*e^-2*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+-2//3*b*c*x*d^3//2*e^-2*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//6*b*x*c^-1*e^-1*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+1//6*b*x*c^-2*e^-3//2*(c^2*x^2)^-1//2*(-1*e+3*d*c^2)*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2))
@test integrate(x*(d+e*x^2)^-1//2*(a+b*arcsec(c*x)), x) == :(e^-1*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+-1*b*x*e^-1//2*(c^2*x^2)^-1//2*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+b*c*x*d^(1/2)*e^-1*(c^2*x^2)^-1//2*arctan(d^-1//2*(-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*arcsec(c*x)), x) == :(-1*d^-1*x^-1*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+b*c*d^-1*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+b*x*d^-1*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*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)+-1*b*x*c^2*d^-1*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate(x^-4*(d+e*x^2)^-1//2*(a+b*arcsec(c*x)), x) == :(-1//3*d^-1*x^-3*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+2//3*e*d^-2*x^-1*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+1//9*b*c*d^-1*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+1//9*b*c*d^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(-5*e+2*d*c^2)+-1//9*b*x*c^2*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*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*x*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*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^-6*(d+e*x^2)^-1//2*(a+b*arcsec(c*x)), x) == :(-1//5*d^-1*x^-5*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+-8//15*d^-3*e^2*x^-1*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+4//15*e*d^-2*x^-3*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+1//25*b*c*d^-1*x^-4*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+1//75*b*c*d^-3*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(-2*e^2+8*c^4*d^2+3*d*e*c^2)+8//15*b*c*d^-3*e^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+-4//45*b*c*e*d^-3*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(e+2*d*c^2)+-4//45*b*c*e*d^-2*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+1//75*b*c*d^-2*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(e+4*d*c^2)+-8//15*b*x*c^2*d^-3*e^2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+-1//75*b*x*c^2*d^-3*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2)*(-2*e^2+8*c^4*d^2+3*d*e*c^2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+8//15*b*x*d^-3*e^2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*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)+-8//45*b*e*x*c^2*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*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)+1//75*b*x*c^2*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*x^2)^-1//2*(d+e*x^2)^-1//2*(e+d*c^2)*(-1*e+8*d*c^2)*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1)+4//45*b*e*x*c^2*d^-3*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2)*(e+2*d*c^2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate(x^5*(d+e*x^2)^-3//2*(a+b*arcsec(c*x)), x) == :(1//3*e^-3*(d+e*x^2)^3//2*(a+b*arcsec(c*x))+-1*d^2*e^-3*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+-2*d*e^-3*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+-8//3*b*c*x*d^3//2*e^-3*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//6*b*x*c^-1*e^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+1//6*b*x*c^-2*e^-5//2*(c^2*x^2)^-1//2*(-1*e+9*d*c^2)*arctanh(c^-1*e^(1/2)*(-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*arcsec(c*x)), x) == :(e^-2*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+d*e^-2*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+-1*b*x*e^-3//2*(c^2*x^2)^-1//2*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+2*b*c*x*d^(1/2)*e^-2*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2)))
@test integrate(x*(d+e*x^2)^-3//2*(a+b*arcsec(c*x)), x) == :(-1*e^-1*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+-1*b*c*x*d^-1//2*e^-1*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2)))
@test integrate((d+e*x^2)^-3//2*(a+b*arcsec(c*x)), x) == :(x*d^-1*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+-1*b*x*d^-1*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*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*arcsec(c*x)), x) == :(-1*d^-1*x^-1*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+-2*e*x*d^-2*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+b*c*d^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+b*x*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*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)+-1*b*x*c^2*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate(x^-4*(d+e*x^2)^-3//2*(a+b*arcsec(c*x)), x) == :(-1//3*d^-1*x^-3*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+4//3*e*d^-2*x^-1*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+8//3*x*d^-3*e^2*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+-4//3*b*c*e*d^-3*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+1//9*b*c*d^-2*x^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)+2//9*b*c*d^-3*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(-1*e+d*c^2)+-8//3*b*x*d^-3*e^2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*x^2)^-1//2*(d+e*x^2)^-1//2*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1)+-4//3*b*e*x*c^2*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*x^2)^-1//2*(d+e*x^2)^-1//2*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1)+-2//9*b*x*c^2*d^-3*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2)*(-1*e+d*c^2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+1//9*b*x*c^2*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*x^2)^-1//2*(d+e*x^2)^-1//2*(-1*e+2*d*c^2)*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1)+4//3*b*e*x*c^2*d^-3*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1))
@test integrate(x^5*(d+e*x^2)^-5//2*(a+b*arcsec(c*x)), x) == :(e^-3*(d+e*x^2)^(1/2)*(a+b*arcsec(c*x))+2*d*e^-3*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+-1//3*d^2*e^-3*(d+e*x^2)^-3//2*(a+b*arcsec(c*x))+-1*b*x*e^-5//2*(c^2*x^2)^-1//2*arctanh(c^-1*e^(1/2)*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2)+8//3*b*c*x*d^(1/2)*e^-3*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//3*b*c*d*x*e^-2*(c^2*x^2)^-1//2*(-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*arcsec(c*x)), x) == :(-1*e^-2*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+1//3*d*e^-2*(d+e*x^2)^-3//2*(a+b*arcsec(c*x))+-2//3*b*c*x*d^-1//2*e^-2*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+1//3*b*c*x*e^-1*(c^2*x^2)^-1//2*(-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*arcsec(c*x)), x) == :(-1//3*e^-1*(d+e*x^2)^-3//2*(a+b*arcsec(c*x))+-1//3*b*c*x*d^-3//2*e^-1*(c^2*x^2)^-1//2*arctan(d^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2))+-1//3*b*c*x*d^-1*(c^2*x^2)^-1//2*(-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*arcsec(c*x)), x) == :(1//3*d^-1*x^3*(d+e*x^2)^-3//2*(a+b*arcsec(c*x))+-1//3*b*c*d^-1*x^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)^-1+-1//3*b*x*d^-1*e^-1*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*x^2)^-1//2*(d+e*x^2)^-1//2*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1)+1//3*b*x*c^2*d^-1*e^-1*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*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*arcsec(c*x)), x) == :(1//3*x*d^-1*(d+e*x^2)^-3//2*(a+b*arcsec(c*x))+2//3*x*d^-2*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+-2//3*b*x*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*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*e*d^-2*x^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)^-1+-1//3*b*x*c^2*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*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(x^-2*(d+e*x^2)^-5//2*(a+b*arcsec(c*x)), x) == :(-1*d^-1*x^-1*(d+e*x^2)^-3//2*(a+b*arcsec(c*x))+-8//3*e*x*d^-3*(d+e*x^2)^-1//2*(a+b*arcsec(c*x))+-4//3*e*x*d^-2*(d+e*x^2)^-3//2*(a+b*arcsec(c*x))+b*c*d^-3*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^(1/2)*(e+d*c^2)^-1*(2*e+d*c^2)+-1*b*c*e*d^-2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)^-1+-4//3*b*c*d^-3*e^2*x^2*(c^2*x^2)^-1//2*(-1+c^2*x^2)^(1/2)*(d+e*x^2)^-1//2*(e+d*c^2)^-1+b*x*c^2*d^-2*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*x^2)^-1//2*(d+e*x^2)^-1//2*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1)+8//3*b*e*x*d^-3*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^(1/2)*(-1+c^2*x^2)^-1//2*(d+e*x^2)^-1//2*Elliptic.F(arcsin(c*x),-1*e*c^-2*d^-1)+-1*b*x*c^2*d^-3*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*x^2)^-1//2*(d+e*x^2)^(1/2)*(e+d*c^2)^-1*(2*e+d*c^2)*Elliptic.E(arcsin(c*x),-1*e*c^-2*d^-1)+4//3*b*e*x*c^2*d^-3*(c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2)*(1+e*d^-1*x^2)^-1//2*(-1+c^2*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(x^11*(1+-1*c^4*x^4)^-1//2*(a+b*arcsec(c*x)), x) == :(-1//2*c^-12*(1+-1*c^4*x^4)^(1/2)*(a+b*arcsec(c*x))+-1//10*c^-12*(1+-1*c^4*x^4)^5//2*(a+b*arcsec(c*x))+1//3*c^-12*(1+-1*c^4*x^4)^3//2*(a+b*arcsec(c*x))+-7//90*b*c^-13*x^-1*(1+c^2*x^2)^3//2*(1+-1*c^-2*x^-2)^-1//2*(1+-1*c^2*x^2)^(1/2)+-4//15*b*c^-13*x^-1*(1+-1*c^-2*x^-2)^-1//2*(1+-1*c^2*x^2)^(1/2)*arctanh((1+c^2*x^2)^(1/2))+-3//70*b*c^-13*x^-1*(1+c^2*x^2)^7//2*(1+-1*c^-2*x^-2)^-1//2*(1+-1*c^2*x^2)^(1/2)+1//90*b*c^-13*x^-1*(1+c^2*x^2)^9//2*(1+-1*c^-2*x^-2)^-1//2*(1+-1*c^2*x^2)^(1/2)+4//15*b*c^-13*x^-1*(1+c^2*x^2)^(1/2)*(1+-1*c^-2*x^-2)^-1//2*(1+-1*c^2*x^2)^(1/2)+13//150*b*c^-13*x^-1*(1+c^2*x^2)^5//2*(1+-1*c^-2*x^-2)^-1//2*(1+-1*c^2*x^2)^(1/2))
@test integrate(x^7*(1+-1*c^4*x^4)^-1//2*(a+b*arcsec(c*x)), x) == :(-1//2*c^-8*(1+-1*c^4*x^4)^(1/2)*(a+b*arcsec(c*x))+1//6*c^-8*(1+-1*c^4*x^4)^3//2*(a+b*arcsec(c*x))+-1//3*b*c^-9*x^-1*(1+-1*c^-2*x^-2)^-1//2*(1+-1*c^2*x^2)^(1/2)*arctanh((1+c^2*x^2)^(1/2))+-1//18*b*c^-9*x^-1*(1+c^2*x^2)^3//2*(1+-1*c^-2*x^-2)^-1//2*(1+-1*c^2*x^2)^(1/2)+1//3*b*c^-9*x^-1*(1+c^2*x^2)^(1/2)*(1+-1*c^-2*x^-2)^-1//2*(1+-1*c^2*x^2)^(1/2)+1//30*b*c^-9*x^-1*(1+c^2*x^2)^5//2*(1+-1*c^-2*x^-2)^-1//2*(1+-1*c^2*x^2)^(1/2))

max_stars_repo_path: test/5 Inverse trig functions/5.5 Inverse secant/5.5.1 u (a+b arcsec(c x))^n.jl


text:
export publish
export publish_behavior
export publish_replay
export publish_recent

"""
    publish(; scheduler::H = AsapScheduler()) where { H <: AbstractScheduler }

`publish()` is a shortcut for `multicast(SubjectFactory())`

See also: [`AbstractOperator`](@ref), [`multicast`](@ref), [`SubjectFactory`](@ref)
"""
publish(; scheduler::H = AsapScheduler()) where { H <: AbstractScheduler } = multicast(SubjectFactory(scheduler))

"""
    publish_behavior(default; scheduler::H = AsapScheduler()) where { H <: AbstractScheduler }

`publish_behavior(default)` is a shortcut for `multicast(BehaviorSubjectFactory(default))`

See also: [`AbstractOperator`](@ref), [`multicast`](@ref), [`BehaviorSubjectFactory`](@ref)
"""
publish_behavior(default; scheduler::H = AsapScheduler()) where { H <: AbstractScheduler } = multicast(BehaviorSubjectFactory(default, scheduler = scheduler))

"""
    publish_replay(size::Int; scheduler::H = AsapScheduler()) where { H <: AbstractScheduler }

`publish_replay(size)` is a shortcut for `multicast(ReplaySubjectFactory(size))`

See also: [`AbstractOperator`](@ref), [`multicast`](@ref), [`ReplaySubjectFactory`](@ref)
"""
publish_replay(size::Int; scheduler::H = AsapScheduler()) where { H <: AbstractScheduler } = multicast(ReplaySubjectFactory(size, scheduler = scheduler))

"""
    publish_recent(; scheduler::H = AsapScheduler()) where { H <: AbstractScheduler }

`publish_recent(size)` is a shortcut for `multicast(RecentSubjectFactory())`

See also: [`AbstractOperator`](@ref), [`multicast`](@ref), [`RecentSubjectFactory`](@ref)
"""
publish_recent(; scheduler::H = AsapScheduler()) where { H <: AbstractScheduler } = multicast(RecentSubjectFactory(scheduler = scheduler))

ext: jl


text:
using AxisKeys
using Distributions
using Distributions: GenericMvTDist
using KeyedDistributions
using LinearAlgebra
using PDMats: PDMat
using StableRNGs
using Statistics
using Test

@testset "KeyedDistributions.jl" begin
    @testset "Common" begin
        X = rand(StableRNG(1234), 10, 3)
        m = vec(mean(X; dims=1))
        s = cov(X; dims=1)
        d = MvNormal(m, s)
        keys = ([:a, :b, :c], )

        @testset "subtyping" begin
            @test KeyedDistribution <: Distribution
            @test KeyedDistribution <: Sampleable
            @test <:(KeyedDistribution{F, S} where {F, S}, Distribution{F, S} where {F, S})
            @test <:(KeyedDistribution{F, S} where {F, S}, Sampleable{F, S} where {F, S})

            @test !(KeyedSampleable <: Distribution)
            @test KeyedSampleable <: Sampleable
            @test <:(KeyedSampleable{F, S} where {F, S}, Sampleable{F, S} where {F, S})

            @test KeyedDistribution(d, keys) isa Distribution{Multivariate}
            @test KeyedSampleable(d, keys) isa Sampleable{Multivariate}

            # Input not a Distribution
            @test_throws MethodError KeyedDistribution(X, keys)

            @test MvNormal <: MvNormalLike
            @test KeyedMvNormal <: MvNormalLike
            @test GenericMvTDist <: MvTLike
            @test KeyedGenericMvTDist <: MvTLike
            @test MvNormalLike <: MultivariateDistribution
            @test MvTLike <: MultivariateDistribution

        end

        @testset "1-dimensional constructor" begin
            @test KeyedDistribution(d, keys[1]) isa KeyedDistribution
            @test KeyedSampleable(d, keys[1]) isa KeyedSampleable

            # Input not a Distribution
            @test_throws MethodError KeyedDistribution(X, keys[1])
        end

        @testset "$T" for T in (KeyedDistribution, KeyedSampleable)
            kd = T(d, keys)

            @testset "base functions" begin
                @test kd isa Sampleable
                @test distribution(kd) == d
                @test axiskeys(kd) == keys
                @test length(kd) == length(d) == 3
                @test isequal(kd, T(d, [:a, :b, :c]))
                @test params(kd) == params(d) == (m, s)
                @test ==(kd, T(d, keys))
            end

            @testset "sampling" begin
                # Samples from the distribution both wrapped and unwrapped are the same
                @test rand(StableRNG(1), d) == rand(StableRNG(1), kd)
                @test rand(StableRNG(1), d, 3) == rand(StableRNG(1), kd, 3)

                rng = StableRNG(1)

                @testset "_rand!" begin
                    expected = [0.4209843517343097, 0.40546557072031986, 0.5573596971895245]
                    observed = Distributions._rand!(rng, kd, zeros(Float64, 3))
                    @test observed isa KeyedArray
                    @test isapprox(observed, expected)
                    @test isapprox(observed(:a), expected[1])
                    @test axiskeys(observed) == axiskeys(kd)
                end

                @testset "one-sample method" begin
                    expected = [0.3308452209411066, -0.1078587452687392, 0.3177486760818843]
                    observed = rand(rng, kd)
                    @test observed isa KeyedArray
                    @test isapprox(observed, expected)
                    @test isapprox(observed(:a), expected[1])
                    @test axiskeys(observed) == axiskeys(kd)
                end

                @testset "multi-sample method" begin
                    expected = [
                        0.8744990592397803 0.6468838205306433;
                        0.5919869675852324 0.04861847876961256;
                        0.24068367188141987 0.3277215089605162
                    ]
                    observed = rand(rng, kd, 2)
                    @test observed isa KeyedArray
                    @test isapprox(observed, expected)
                    @test isapprox(observed(:a), expected[1, :])
                    @test axiskeys(observed) == (first(axiskeys(kd)), Base.OneTo(2))
                end
            end
        end
    end

    @testset "KeyedDistribution only" begin
        X = rand(StableRNG(1234), 10, 3)
        m = vec(mean(X; dims=1))
        s = cov(X; dims=1)
        keys = ([:a, :b, :c], )

        _make_dist(::Type{MvNormal}, m, s) = MvNormal(m, s)
        _make_dist(::Type{GenericMvTDist}, m, s) = GenericMvTDist(3, m, PDMat(s))

        @testset "$D" for D in (MvNormal, GenericMvTDist)

            d = _make_dist(D, m, s)
            d_keyed = _make_dist(D, KeyedArray(m, keys), s)

            kd_keys = KeyedDistribution(d, keys)
            kd_no_keys = KeyedDistribution(d_keyed)
            kds = (keys=kd_keys, no_keys=kd_no_keys)

            @testset "$case" for case in (:keys, :no_keys)
                kd = kds[case]

                @testset "base functions" begin
                    @test kd isa Distribution
                    @test distribution(kd) == d
                    @test axiskeys(kd) == keys
                    @test sampler(kd) == sampler(d)
                    @test eltype(kd) == eltype(d) == Float64
                end

                @testset "statistical functions" begin
                    @test mean(kd) isa KeyedArray{Float64, 1}
                    @test parent(mean(kd)) == mean(d) == m

                    @test var(kd) isa KeyedArray{Float64, 1}
                    @test parent(var(kd)) == var(d)

                    @test cov(kd) isa KeyedArray{Float64, 2}
                    @test parent(cov(kd)) == cov(d)

                    @test entropy(kd) == entropy(d)
                    @test entropy(kd, 2) == entropy(d, 2)

                    @test Distributions._logpdf(kd, m) == Distributions._logpdf(d, m)

                    # statistical functions commute with accessor methods
                    for f in (mean, var, cov)
                        @test f(distribution(kd)) == parent(f(kd))
                    end
                end
            end
        end

        @testset "default keys" begin
            kd = KeyedDistribution(MvNormal(m, s))
            @test axiskeys(kd) == (Base.OneTo(3), )
        end
    end

    @testset "Distributions types" begin
        @testset "Univariate" begin
            d = Normal(0.5, 0.2)
            kd = KeyedDistribution(d, ["variate"])
            rng = StableRNG(1)

            @test kd isa UnivariateDistribution
            @test axiskeys(kd) == (["variate"], )
            @test length(kd) == length(d) == 1

            @test logpdf(kd, 1) == logpdf(d, 1) ≈ -2.4345006207705726
            @test cdf(kd, 1) == cdf(d, 1) ≈ 0.9937903346742238
            @test quantile(kd, 0.5) == quantile(d, 0.5) == 0.5
            @test insupport(kd, 1) == insupport(d, 1) == true
            @test mgf(kd, 1) == mgf(d, 1) ≈ 1.6820276496988864
            @test cf(kd, 0) == cf(d, 0) == 1.0 + 0.0im
            @test entropy(kd) == entropy(d) ≈ -0.1904993792294276
            @test entropy(kd, 2) == entropy(d, 2) ≈ -0.27483250970672124

            @test minimum(kd) == minimum(d) == -Inf
            @test maximum(kd) == maximum(d) == Inf
            @test modes(kd) == modes(d) == [0.5]
            @test mode(kd) == mode(d) == 0.5
            @test skewness(kd) == skewness(d) == 0.0
            @test kurtosis(kd) == kurtosis(d) == 0.0
            @test kurtosis(kd, false) == kurtosis(d, false) == 3.0

            @test isapprox(rand(rng, kd), 0.39349598502717537)
            @test isapprox(rand(rng, kd, 2), [0.519693102856957, 0.6505773044249047])
        end

        @testset "Matrix-variate" begin
            d = Wishart(7.0, Matrix(1.0I, 2, 2))
            md = KeyedDistribution(d, (["x1", "x2"], ["y1", "y2"]))
            rng = StableRNG(1)

            @test md isa MatrixDistribution
            @test length(md) == length(d) == 4
            @test size(md) == size(d) == (2, 2)
            @test axiskeys(md) == (["x1", "x2"], ["y1", "y2"])

            @testset "sample" begin
                expected = [
                    4.297085163636559 -1.7486034270372186;
                    -1.7486034270372186 8.375810638889545
                ]
                observed = rand(rng, md)
                @test observed isa KeyedArray
                @test isapprox(observed, expected)
                @test isapprox(observed("x1", :), expected[1, :])
                @test axiskeys(observed) == axiskeys(md)
            end

            @testset "multi-sample" begin
                expected = [
                    [
                        16.39083916144797 4.884197412188479;
                        4.884197412188479 12.95839907390519
                    ],
                    [
                        4.0427728985772635 -1.3588065996380645;
                        -1.3588065996380645 11.285037150960932
                    ]
                ]
                observed = rand(rng, md, 2)
                @test observed isa KeyedArray
                @test isapprox(observed, expected)
                @test axiskeys(observed) == (Base.OneTo(2),)

                @test observed[1] isa KeyedArray
                @test isapprox(observed(1), expected[1])
                @test axiskeys(observed[1]) == axiskeys(md)
            end
        end

        @testset "Sampleable not <:Distribution" begin
            samp = Distributions.MultinomialSampler(5, [0.5, 0.5])
            ksamp = KeyedSampleable(samp, ["number1", "number2"])
            rng = StableRNG(1)

            @test ksamp isa Sampleable
            @test !(ksamp isa Distribution)
            @test axiskeys(ksamp) == (["number1", "number2"], )
            @test length(ksamp) == length(samp) == 2

            @test rand(rng, ksamp) == [3, 2]
            @test rand(rng, ksamp, 2) == [1 1; 4 4]
        end
    end

    @testset "Invalid keys $T" for T in (KeyedDistribution, KeyedSampleable)
        # Wrong number of keys
        @test_throws ArgumentError T(MvNormal(ones(3)), ["foo"])
        # Wrong key lengths
        @test_throws ArgumentError T(MvNormal(ones(3)), ([:a, :b, :c], [:x]))
        @test_throws ArgumentError T(Wishart(7.0, Matrix(1.0I, 2, 2)), (["foo"], ["bar"]))
        # AxisKeys requires key vectors to be AbstractVector
        @test_throws MethodError T(MvNormal(ones(3)), (:a, :b, :c))
    end

    @testset "marginalising" begin

        X = rand(StableRNG(1234), 10, 3)
        m = vec(mean(X; dims=1))
        s = cov(X; dims=1)
        keys = ([:a, :b, :c], )

        @testset "KeyedMvNormal constructed with keys" begin
            d = KeyedDistribution(MvNormal(m, s), keys)
            @test d([:a, :b, :c]) == d[[1, 2, 3]] == d

            d13 = KeyedDistribution(MvNormal(m[[1, 3]], s[[1, 3], [1, 3]]), [:a, :c])
            @test d([:a, :c]) == d[[1, 3]] == d13

            @test d([:a]) == d[[1]] == KeyedDistribution(MvNormal(m[[1]], s[[1], [1]]), [:a])
            @test d(:a) == d[1] == KeyedDistribution(Normal(m[1], s[1, 1]), [:a])
        end

        @testset "KeyedMvNormal constructed without keys" begin
            d = KeyedDistribution(MvNormal(m, s))
            @test d([1, 2, 3]) == d[[1, 2, 3]] == d

            d13 = KeyedDistribution(MvNormal(m[[1, 3]], s[[1, 3], [1, 3]]), [1, 3])
            @test d([1, 3]) == d[[1, 3]] == d13

            @test d([1]) == d[[1]] == KeyedDistribution(MvNormal(m[[1]], s[[1], [1]]), [1])
            @test d(1) == d[1] == KeyedDistribution(Normal(m[1], s[1, 1]), [1])
        end

        @testset "KeyedMvTDist constructed with keys" begin
            d = KeyedDistribution(MvTDist(3, m, s), keys)
            @test d([:a, :b, :c]) == d[[1, 2, 3]] == d

            d13 = KeyedDistribution(MvTDist(3, m[[1, 3]], s[[1, 3], [1, 3]]), [:a, :c])
            @test d([:a, :c]) == d[[1, 3]] == d13

            @test d([:a]) == d[[1]] == KeyedDistribution(MvTDist(3, m[[1]], s[[1], [1]]), [:a])
        end

        @testset "KeyedMvTDist constructed without keys" begin
            d = KeyedDistribution(MvTDist(3, m, s))
            @test d([1, 2, 3]) == d[[1, 2, 3]] == d

            d13 = KeyedDistribution(MvTDist(3, m[[1, 3]], s[[1, 3], [1, 3]]), [1, 3])
            @test d([1, 3]) == d[[1, 3]] == d13

            @test d([1]) == d[[1]] == KeyedDistribution(MvTDist(3, m[[1]], s[[1], [1]]), [1])
        end

    end
end

max_stars_repo_name: invenia/KeyedDistributions

max_issues_repo_name: invenia/KeyedDistributions

max_forks_repo_name: invenia/KeyedDistributions


text:
# scatterlines

# Makie
using CairoMakie

f = Figure()
Axis(f[1, 1])

xs = LinRange(0, 10, 20)
ys = 0.5 .* sin.(xs)

CairoMakie.scatterlines!(xs, ys, color = :red)
CairoMakie.scatterlines!(xs, ys .- 1, color = xs, markercolor = :olive)
CairoMakie.scatterlines!(xs, ys .- 2, color= xs, markercolor = :mediumorchid, markersize = LinRange(5, 30, 20))
CairoMakie.scatterlines!(xs, ys .- 3, marker = :cross, strokewidth = 1,
    markersize = 20, color = :orange, strokecolor = :black)

max_stars_repo_name: Ellon-M/visualizations

max_issues_repo_name: Ellon-M/visualizations

max_forks_repo_name: Ellon-M/visualizations


text:
module FreeFermionsOEE

using Printf

export
    operational_entanglement
include("operational_entanglement.jl")

end


text:
# Autogenerated wrapper script for libfdk_aac_jll for i686-linux-musl
export libfdk

JLLWrappers.@generate_wrapper_header("libfdk_aac")
JLLWrappers.@declare_library_product(libfdk, "libfdk-aac.so.2")
function __init__()
    JLLWrappers.@generate_init_header()
    JLLWrappers.@init_library_product(
        libfdk,
        "lib/libfdk-aac.so",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@generate_init_footer()
end  # __init__()


text:
export initSpeedWav
export speedWav

"""
    y = speedWav(wav, k)
change wav's speed. Speedup value ∈ [0.8,1.2] is normal and recommended.
"""
function speedWav(wav::Array, k)
    @assert 1.5>=k>=0.5
    N = veclen(wav);
    O = N>>1;
    X = fft(wav);
    D = floor(Int, k * O);
    L = D+1+D;
    Z = zeros(Complex{eltype(wav)}, L,1);
    Z[1: 1:  O  ] = X[1: 1:  O  ];
    Z[L:-1:L-O+1] = X[N:-1:N-O+1];
    return real(ifft(Z))
end

"""
    initSpeedWav(speedSpan::NTuple{2,Number}) -> speedwav(wav::Array)
init speed perturbation effect function
+ `speedSpan` e.g. (0.8, 1.2)
"""
function initSpeedWav(speedSpan::NTuple{2,Number})
    MinSpeed, MaxSpeed = speedSpan
    @assert MinSpeed <= MaxSpeed
    function speedwav(wav::Array)
        return speedWav(wav, rand()*(MaxSpeed - MinSpeed) + MinSpeed)
    end
    return speedwav
end

max_stars_repo_name: sonosole/SpeechAugment

max_issues_repo_name: sonosole/SpeechAugment

max_forks_repo_name: sonosole/SpeechAugment


text:
using DataDeps

register(DataDep("Senseval 3",
    """
    Website: http://web.eecs.umich.edu/~mihalcea/senseval/senseval3/index.html
    Data Website: http://web.eecs.umich.edu/~mihalcea/downloads.html#sensevalsemcor
    Prepared by: Rada Mihalcea, Timothy Chklovski, Adam Kilgarriff
    Current Maintainer: Rada Mihalcea

    Senseval-3 took place in March-April 2004, followed by a workshop held in July 2004 in Barcelona, in conjunction with ACL 2004.
    This is corpus was updated by Rada Mihalcea with the word senses according to WordNet 1.7.1, 2.0, 2.1, 3.0.

    The details of the task are in the following paper, please cite the following publication if you are using the corpora.

    Mihalcea, Rada, Timothy Chklovski, and Adam Kilgarriff. "The Senseval-3 English lexical sample task." In Proceedings of SENSEVAL-3, the third international workshop on the evaluation of systems for the semantic analysis of text. 2004.
    http://www.aclweb.org/anthology/W04-0807
    """,
    "http://web.eecs.umich.edu/~mihalcea/downloads/senseval.semcor/senseval3.semcor.tar.gz",
    "ab5a1230d1109ac7847b86babf442b2006276d73e6ee47d67f7f7c372c50d9eb";
    post_fetch_method = fn -> begin
        unpack(fn)
        innerdir = "senseval3.semcor"
        innerfiles = readdir(innerdir)
        # Move everything to current directory, under same name
        mv.(joinpath.(innerdir, innerfiles), innerfiles)
        rm(innerdir)
    end
))


text:
module EchogramPlots

using Plots
using Measures

export EK500_COLOURS, echogram

const EK500_COLOURS = cgrad([RGB(1, 1, 1),
                             RGB(159/255, 159/255, 159/255),
                             RGB(95/255, 95/255, 95/255),
                             RGB(0, 0, 1),
                             RGB(0, 0, 127/255),
                             RGB(0, 191/255, 0),
                             RGB(0, 127/255, 0),
                             RGB(1, 1, 0),
                             RGB(1, 127/255, 0),
                             RGB(1, 0, 191/255),
                             RGB(1, 0, 0),
                             RGB(166/255, 83/255, 60/255),
                             RGB(120/255, 60/255, 40/255)])

"""
    echogram(a; xlabel="Time / samples", ylabel=nothing,
                  title="Echogram",
                  vmin = nothing,
                  vmax = nothing,
                  leg=true,
                  color=EK500_COLOURS,
                  size=(640,480),
                  colorbar_title = "",
                  range=nothing)

Uses Plots to plot an echogram of a.

range can be a `Number` n, in which case 0 to n is assumed, a `Tuple`
or a `Vector`.

"""
function echogram(a; xlabel="Time / samples", ylabel=nothing,
                  title="Echogram",
                  vmin = nothing,
                  vmax = nothing,
                  leg=true,
                  color=EK500_COLOURS,
                  size=(640,480),
                  colorbar_title = "",
                  range=nothing)

    if ylabel==nothing
        if range == nothing
            ylabel="Range / samples"
        else
            ylabel="Range / m"
        end
    end

    # TODO From Julia 0.7 consider using missing?

    if vmax != nothing
        a[a .> vmax] .= vmax
    end

    if vmin != nothing
        a[a .< vmin] .= vmin
    end

    y, x = Base.size(a)

    if isa(range, Number)
        top = 0.0
        bottom = range
    elseif isa(range, Tuple)
        top, bottom = range
    elseif isa(range, Vector)
        top = range[1]
        bottom = range[end]
    else
        top = 0.0
        bottom = y
    end

    stepr = 10^floor(log10(bottom-top))

    stepy = y * stepr / (bottom-top)

    yticks = 0:stepy:y
    yticklabels = top:stepr:bottom

    if length(yticks) < 3
        yticks = 0:stepy/5:y
        yticklabels = top:stepr/5:bottom
    end

    yticks = floor.(Int, yticks)
    yticklabels = floor.(Int, yticklabels)
    yt = (yticks, yticklabels)

    p = plot(layout=1, leg=leg, size=size,
             title=title, xaxis=xlabel, yaxis=ylabel,
             yticks=yt, left_margin=10mm,
             colorbar_title=colorbar_title)
    Plots.heatmap!(a, yflip=true, color=color)
    return p

end

end # module

max_stars_repo_name: RobBlackwell/EchogramPlots

max_issues_repo_name: RobBlackwell/EchogramPlots

max_forks_repo_name: RobBlackwell/EchogramPlots


text:
abstract type NaturalSatellite <: CelestialBody end

export deimos, Deimos, phobos, Phobos, luna, Luna, moon, charon, Charon

# Earth

struct Luna <: NaturalSatellite end
const luna = Luna()
const moon = luna
parent(::Luna) = earth_barycenter
naifid(::Luna) = 301
from_naifid(::Val{301}) = luna

# Mars

struct Phobos <: NaturalSatellite end
const phobos = Phobos()
parent(::Phobos) = mars_barycenter
naifid(::Phobos) = 401
from_naifid(::Val{401}) = phobos

struct Deimos <: NaturalSatellite end
const deimos = Deimos()
parent(::Deimos) = mars_barycenter
naifid(::Deimos) = 402
from_naifid(::Val{402}) = deimos

# Jupiter

const JUPITER_SATELLITE_NAMES = (
    "Io",
    "Europa",
    "Ganymede",
    "Callisto",
    "Amalthea",
    "Himalia",
    "Elara",
    "Pasiphae",
    "Sinope",
    "Lysithea",
    "Carme",
    "Ananke",
    "Leda",
    "Thebe",
    "Adrastea",
    "Metis",
    "Callirrhoe",
    "Themisto",
    "Magaclite",
    "Taygete",
    "Chaldene",
    "Harpalyke",
    "Kalyke",
    "Iocaste",
    "Erinome",
    "Isonoe",
    "Praxidike",
    "Autonoe",
    "Thyone",
    "Hermippe",
    "Aitne",
    "Eurydome",
    "Euanthe",
    "Euporie",
    "Orthosie",
    "Sponde",
    "Kale",
    "Pasithee",
    "Hegemone",
    "Mneme",
    "Aoede",
    "Thelxinoe",
    "Arche",
    "Kallichore",
    "Helike",
    "Carpo",
    "Eukelade",
    "Cyllene",
    "Kore",
    "Herse",
    "Dia",
)

for (i, body) in enumerate(JUPITER_SATELLITE_NAMES[1:end-1])
    typ = Symbol(body)
    sym = Symbol(lowercase(body))
    id = 500 + i
    @eval begin
        struct $typ <: NaturalSatellite end
        const $sym = $typ()
        parent(::$typ) = jupiter_barycenter
        naifid(::$typ) = $id
        from_naifid(::Val{$id}) = $sym
        export $sym, $typ
    end
end

struct Dia <: NaturalSatellite end
const dia = Dia()
parent(::Dia) = jupiter_barycenter
naifid(::Dia) = 553
from_naifid(::Val{553}) = dia
export dia, Dia

# Saturn

const SATURN_SATELLITE_NAMES = (
    "Mimas",
    "Enceladus",
    "Tethys",
    "Dione",
    "Rhea",
    "Titan",
    "Hyperion",
    "Iapetus",
    "Phoebe",
    "Janus",
    "Epimetheus",
    "Helene",
    "Telesto",
    "Calypso",
    "Atlas",
    "Prometheus",
    "Pandora",
    "Pan",
    "Ymir",
    "Paaliaq",
    "Tarvos",
    "Ijiraq",
    "Suttungr",
    "Kiviuq",
    "Mundilfari",
    "Albiorix",
    "Skathi",
    "Erriapus",
    "Siarnaq",
    "Thrymr",
    "Narvi",
    "Methone",
    "Pallene",
    "Polydeuces",
    "Daphnis",
    "Aegir",
    "Bebhionn",
    "Bergelmir",
    "Bestla",
    "Farbauti",
    "Fenrir",
    "Fornjot",
    "Hati",
    "Hyrrokkin",
    "Kari",
    "Loge",
    "Skoll",
    "Surtur",
    "Anthe",
    "Jarnsaxa",
    "Greip",
    "Tarqeq",
    "Aegaeon",
)

for (i, body) in enumerate(SATURN_SATELLITE_NAMES)
    typ = Symbol(body)
    sym = Symbol(lowercase(body))
    id = 600 + i
    @eval begin
        struct $typ <: NaturalSatellite end
        const $sym = $typ()
        parent(::$typ) = saturn_barycenter
        naifid(::$typ) = $id
        from_naifid(::Val{$id}) = $sym
        export $sym, $typ
    end
end

const URANUS_SATELLITE_NAMES = (
    "Ariel",
    "Umbriel",
    "Titania",
    "Oberon",
    "Miranda",
    "Cordelia",
    "Ophelia",
    "Bianca",
    "Cressida",
    "Desdemona",
    "Juliet",
    "Portia",
    "Rosalind",
    "Belinda",
    "Puck",
    "Caliban",
    "Sycorax",
    "Prospero",
    "Setebos",
    "Stephano",
    "Trinculo",
    "Francisco",
    "Margaret",
    "Ferdinand",
    "Perdita",
    "Mab",
    "Cupid",
)

for (i, body) in enumerate(URANUS_SATELLITE_NAMES)
    typ = Symbol(body)
    sym = Symbol(lowercase(body))
    id = 700 + i
    @eval begin
        struct $typ <: NaturalSatellite end
        const $sym = $typ()
        parent(::$typ) = uranus_barycenter
        naifid(::$typ) = $id
        from_naifid(::Val{$id}) = $sym
        export $sym, $typ
    end
end

# Neptune

const NEPTUNE_SATELLITE_NAMES = (
    "Triton",
    "Nereid",
    "Naiad",
    "Thalassa",
    "Despina",
    "Galatea",
    "Larissa",
    "Proteus",
    "Halimede",
    "Psamathe",
    "Sao",
    "Laomedeia",
    "Neso",
)

for (i, body) in enumerate(NEPTUNE_SATELLITE_NAMES)
    typ = Symbol(body)
    sym = Symbol(lowercase(body))
    id = 800 + i
    @eval begin
        struct $typ <: NaturalSatellite end
        const $sym = $typ()
        parent(::$typ) = neptune_barycenter
        naifid(::$typ) = $id
        from_naifid(::Val{$id}) = $sym
        export $sym, $typ
    end
end

# Pluto

const PLUTO_SATELLITE_NAMES = (
    "Charon",
    "Nix",
    "Hydra",
    "Kerberos",
    "Styx",
)

for (i, body) in enumerate(PLUTO_SATELLITE_NAMES)
    typ = Symbol(body)
    sym = Symbol(lowercase(body))
    id = 900 + i
    @eval begin
        struct $typ <: NaturalSatellite end
        const $sym = $typ()
        parent(::$typ) = pluto_barycenter
        naifid(::$typ) = $id
        from_naifid(::Val{$id}) = $sym
        export $sym, $typ
    end
end


text:
# calculate pairwise distance between every point in a vector

using CUDAdrv, CUDAnative
const CuArray = CUDAnative.CuHostArray  # real applications: use CuArrays.jl

function haversine_cpu(lat1::Float32, lon1::Float32, lat2::Float32, lon2::Float32, radius::Float32)
    c1 = cospi(lat1 / 180.0f0)
    c2 = cospi(lat2 / 180.0f0)
    dlat = lat2 - lat1
    dlon = lon2 - lon1
    d1 = sinpi(dlat / 360.0f0)
    d2 = sinpi(dlon / 360.0f0)
    t = d2 * d2 * c1 * c2
    a = d1 * d1 + t
    c = 2.0f0 * asin(min(1.0f0, sqrt(a)))
    return radius * c
end

function pairwise_dist_cpu(lat::Vector{Float32}, lon::Vector{Float32})
    # allocate
    n = length(lat)
    rowresult = Array{Float32}(undef, n, n)

    # brute force fill in each cell
    for i in 1:n, j in 1:n
        @inbounds rowresult[i, j] = haversine_cpu(lat[i], lon[i], lat[j], lon[j] , 6372.8f0)
    end

    return rowresult
end

# from https://devblogs.nvidia.com/parallelforall/fast-great-circle-distance-calculation-cuda-c/
function haversine_gpu(lat1::Float32, lon1::Float32, lat2::Float32, lon2::Float32, radius::Float32)
    # XXX: need to prefix math intrinsics with CUDAnative
    c1 = CUDAnative.cospi(lat1 / 180.0f0)
    c2 = CUDAnative.cospi(lat2 / 180.0f0)
    dlat = lat2 - lat1
    dlon = lon2 - lon1
    d1 = CUDAnative.sinpi(dlat / 360.0f0)
    d2 = CUDAnative.sinpi(dlon / 360.0f0)
    t = d2 * d2 * c1 * c2
    a = d1 * d1 + t
    c = 2.0f0 * CUDAnative.asin(CUDAnative.min(1.0f0, CUDAnative.sqrt(a)))
    return radius * c
end

# pairwise distance calculation kernel
function pairwise_dist_kernel(lat::CuDeviceVector{Float32}, lon::CuDeviceVector{Float32},
                              rowresult::CuDeviceMatrix{Float32}, n)
    i = (blockIdx().x-1) * blockDim().x + threadIdx().x
    j = (blockIdx().y-1) * blockDim().y + threadIdx().y

    if i <= n && j <= n
        # store to shared memory
        shmem = @cuDynamicSharedMem(Float32, 2*blockDim().x + 2*blockDim().y)
        if threadIdx().y == 1
            shmem[threadIdx().x] = lat[i]
            shmem[blockDim().x + threadIdx().x] = lon[i]
        end
        if threadIdx().x == 1
            shmem[2*blockDim().x + threadIdx().y] = lat[j]
            shmem[2*blockDim().x + blockDim().y + threadIdx().y] = lon[j]
        end
        sync_threads()

        # load from shared memory
        lat_i = shmem[threadIdx().x]
        lon_i = shmem[blockDim().x + threadIdx().x]
        lat_j = shmem[2*blockDim().x + threadIdx().y]
        lon_j = shmem[2*blockDim().x + blockDim().y + threadIdx().y]

        @inbounds rowresult[i, j] = haversine_gpu(lat_i, lon_i, lat_j, lon_j, 6372.8f0)
    end

    return
end

function pairwise_dist_gpu(lat::Vector{Float32}, lon::Vector{Float32})
    # upload
    lat_gpu = CuArray(lat)
    lon_gpu = CuArray(lon)

    # allocate
    n = length(lat)
    rowresult_gpu = CuArray(zeros(Float32, n, n))

    # calculate launch configuration
    function get_config(kernel)
        # calculate a 2D block size from the suggested 1D configuration
        # NOTE: we want our launch configuration to be as square as possible,
        #       because that minimizes shared memory usage
        function get_threads(threads)
            threads_x = floor(Int, sqrt(threads))
            threads_y = threads ÷ threads_x
            return (threads_x, threads_y)
        end

        # calculate the amount of dynamic shared memory for a 2D block size
        get_shmem(threads) = 2 * sum(threads) * sizeof(Float32)

        fun = kernel.fun
        config = launch_configuration(fun, shmem=threads->get_shmem(get_threads(threads)))

        # convert to 2D block size and figure out appropriate grid size
        threads = get_threads(config.threads)
        blocks = ceil.(Int, n ./ threads)
        shmem = get_shmem(threads)

        return (threads=threads, blocks=blocks, shmem=shmem)
    end

    @cuda config=get_config pairwise_dist_kernel(lat_gpu, lon_gpu, rowresult_gpu, n)

    return Array(rowresult_gpu)
end

using Test

# generate reasonable data
function main(n = 1000)
    lat = rand(Float32, n) .* 45
    lon = rand(Float32, n) .* -120

    @test pairwise_dist_cpu(lat, lon) ≈ pairwise_dist_gpu(lat, lon) rtol=1e-2
end
main()


text:
using Plots

function booth(x)
    return (x[1] + 2x[2] - 7)^2 + (2x[1] + x[2] - 5)^2;
end

# plot

contour(-30:0.1:30, -30:0.1:30, (x, y)->booth([x, y]))


text:
# The implementations are inspired by MatrixMarket.jl
# https://github.com/JuliaSparse/MatrixMarket.jl
# The MatrixMarket.jl package is licensed under the MIT Expat License:
# Copyright (c) 2013: Viral B. Shah.

# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:

# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#####################################################
# Download data from UF Sparse Matrix Collection
#####################################################
const UF_URL = "http://www.cise.ufl.edu/research/sparse/"
const MM_URL = "http://math.nist.gov/MatrixMarket/matrices.html"
const DATA_DIR = joinpath(dirname(@__FILE__),"..", "data")

# download html files and store matrix data as a list of tuples
function downloaddata(; generate_list::Bool = true)
    # UF Sparse matrix collection
    dlurl = string(UF_URL, "matrices/list_by_id.html")
    matrices = string(DATA_DIR, "/uf_matrices.html")
    mm_matrices = string(DATA_DIR, "/mm_matrices.html")

    isfile(matrices) || download(dlurl, matrices)
    isfile(mm_matrices) || download(MM_URL, mm_matrices)

    if generate_list
        uf_matrixdata = Tuple[]
        mm_matrixdata = Tuple[]
        open(matrices) do f
            for line in readlines(f)
                if contains(line, """MAT""")
                    collectionname, matrixname = split(split(line, '"')[2], '/')[end-1:end]
                    matrixname = split(matrixname, '.')[1]
                    push!(uf_matrixdata, (collectionname, matrixname))
                end
            end
        end

        open(mm_matrices) do f
            for line in readlines(f)
                if contains(line, """<A HREF="/MatrixMarket/data/""")
                    collectionname, setname, matrixname = split(split(line, '"')[2], '/')[4:6]
                    matrixname = split(matrixname, '.')[1]
                    push!(mm_matrixdata, (collectionname, setname, matrixname))
                end
            end
        end
        return uf_matrixdata, mm_matrixdata
    end

end

# given a matrix name,
function search(matrixname::AbstractString)
    uf_matrixdata, mm_matrixdata = downloaddata()
    uf_matrices = AbstractString[]
    mm_matrices = AbstractString[]
    [push!(uf_matrices, m[2]) for m in uf_matrixdata]
    [push!(mm_matrices, m[3]) for m in mm_matrixdata]

    datalist = AbstractString[]
    if (matrixname in uf_matrices) || (matrixname in mm_matrices)
        uf_index = findin(uf_matrices, [matrixname])
        mm_index = findin(mm_matrices, [matrixname])
        if uf_index != 0
            for i in uf_index
                collectionname, matrixname = uf_matrixdata[i]
                push!(datalist, string(collectionname, '/', matrixname))
            end
        end
        if mm_index != 0
            for i in mm_index
                collectionname, setname, matrixname = mm_matrixdata[i]
                push!(datalist, string(collectionname, '/', setname, '/', matrixname))
            end
        end
        return datalist
    else
        error("can not find $matrixname in the database.")
    end
end

# update database from the websites
function update()
    uf_matrices = string(DATA_DIR, "/uf_matrices.html")
    mm_matrices = string(DATA_DIR, "/mm_matrices.html")
    if isfile(uf_matrices)
        rm(uf_matrices)
    end
    if isfile(mm_matrices)
        rm(mm_matrices)
    end
    downloaddata(generate_list = false)
end

function gunzip(fname)
    endswith(fname, ".gz") || error("gunzip: $fname: unknown suffix")

    destname = split(fname, ".gz")[1]

    open(destname, "w") do f
        GZip.open(fname) do g
            write(f, readall(g))
        end
    end
    destname
end

# get
# --------------
# get(NAME) download a matrix from UF sparse matrix collection
# where NAME is a string of collection name + '/' + matrix name.
#
# Example
# -------
# MatrixDepot.get("HB/1138_bus") # uf sparse matrix
# MatrixDepot.get("1138_bus") # Matrix Market
#
function get(name::AbstractString)

    isdir(string(DATA_DIR,'/', "uf")) || mkdir(string(DATA_DIR, '/', "uf"))
    isdir(string(DATA_DIR,'/', "mm")) || mkdir(string(DATA_DIR, '/', "mm"))

    uf_matrixdata, mm_matrixdata = downloaddata()

    namelist = split(name, '/')
    collectionname = namelist[1]
    if length(namelist) == 2 # UF sparse matrix collection
        matrixnames = AbstractString[]
        if namelist[2] == "*"
            println("Downloading all matrices in group $(collectionname)...")
            for uf in uf_matrixdata
                if uf[1] == collectionname
                    push!(matrixnames, uf[2])
                end
            end
        else
            push!(matrixnames, namelist[2])
        end
        for matrixname in matrixnames
            (collectionname, matrixname) in uf_matrixdata ||
                       error("can not find $collectionname/$matrixname in UF sparse matrix collection")
            fn = string(matrixname, ".tar.gz")
            uzfn = string(matrixname, ".mtx")
            url = string(UF_URL, "MM", '/', collectionname, '/', matrixname, ".tar.gz")

            dir = string(DATA_DIR, '/', "uf", '/', collectionname)
            if !isdir(dir)
                mkdir(dir)
            end

            dirfn = string(dir, '/', fn)
            diruzfn = string(dir, '/', matrixname, '/', uzfn)

            if isfile(diruzfn)
                error("$(collectionname)/$(matrixname) exits, no need to download")
            end

            try
                download(url, dirfn)
                println("download:", dirfn)
            catch
                error("fail to download $fn")
            end

            if !isfile(diruzfn)
                gunzip(dirfn)
            end
            rm(dirfn)
            run(`tar -vxf $(dir)/$(matrixname).tar -C $(dir)`)
            rm(string(dir,'/', matrixname, ".tar"))
        end
    elseif length(namelist) == 3 # Matrix Market collection

        collectionname, setname, matrixname = namelist
        mtxfname = string(matrixname, ".mtx")
        uzfn = string(matrixname, ".mtx.gz")

        dir = string(DATA_DIR, '/', "mm", '/', collectionname)
        isdir(dir) || mkdir(string(DATA_DIR, '/', "mm", '/', collectionname))

        dir = string(DATA_DIR, '/', "mm", '/', collectionname, '/', setname)
        isdir(dir) || mkdir(string(DATA_DIR, '/', "mm", '/', collectionname, '/', setname))

        dirfn = string(dir, '/', mtxfname)
        diruzfn = string(dir, '/', uzfn)

        !isfile(dirfn) || error("file $(mtxfname) exits, no need to download")
        url =  "ftp://math.nist.gov/pub/MatrixMarket2/$(collectionname)/$(setname)/$(matrixname).mtx.gz"

        try
            download(url, diruzfn)
            println("download:", diruzfn)
        catch
            error("fail to download $uzfn")
        end
        gunzip(diruzfn)
        rm(diruzfn)

    elseif length(namelist) == 1
        stringvec = search(name)
        if length(stringvec) == 1
            return matrixdepot(stringvec[1], :get)
        else
            println("Try MatrixDepot.get(`name`), where `name` is one of the elements in the following Array:")
            return stringvec
        end
    else
        error("can not find $name")
    end
end


text:
using Pkg
Pkg.activate(".")
using ChemometricsData

z = ChemometricsData.load("Penicillin_Monitoring")

using CSV, DataFrames
p = "/home/caseykneale/.julia/dev/ChemometricsData/data/Penicillin_Monitoring/100_Batches_IndPenSim_V3.csv"
z = CSV.read(p; threaded = false)

CSV.File(Base.joinpath(sug_path, f); threaded=false )

ChemometricsData.describe("Penicillin_Monitoring")

ChemometricsData.fetchdata("Penicillin_Monitoring")

#using DataFrames