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

@test integrate((c+-1*c*sec(e+f*x))^4*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(1//5*a*c^4*f^-1*tan(e+f*x)^5+4//3*a*c^4*f^-1*tan(e+f*x)^3+7//8*a*c^4*f^-1*arctanh(sin(e+f*x))+-3//4*a*c^4*f^-1*sec(e+f*x)^3*tan(e+f*x)+-1//8*a*c^4*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((c+-1*c*sec(e+f*x))^3*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(2//3*a*c^3*f^-1*tan(e+f*x)^3+5//8*a*c^3*f^-1*arctanh(sin(e+f*x))+-3//8*a*c^3*f^-1*sec(e+f*x)*tan(e+f*x)+-1//4*a*c^3*f^-1*sec(e+f*x)^3*tan(e+f*x))
@test integrate((c+-1*c*sec(e+f*x))^2*(a+a*sec(e+f*x))*sec(e+f*x), x) == :((1/2)*a*c^2*f^-1*arctanh(sin(e+f*x))+1//3*a*c^2*f^-1*tan(e+f*x)^3+-1//2*a*c^2*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))*(c+-1*c*sec(e+f*x))*sec(e+f*x), x) == :((1/2)*a*c*f^-1*arctanh(sin(e+f*x))+-1//2*a*c*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((c+-1*c*sec(e+f*x))^-1*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(-1*a*c^-1*f^-1*arctanh(sin(e+f*x))+-2*a*f^-1*(c+-1*c*sec(e+f*x))^-1*tan(e+f*x))
@test integrate((c+-1*c*sec(e+f*x))^-2*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(-1//3*f^-1*(c+-1*c*sec(e+f*x))^-2*(a+a*sec(e+f*x))*tan(e+f*x))
@test integrate((c+-1*c*sec(e+f*x))^-3*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(-1//5*f^-1*(c+-1*c*sec(e+f*x))^-3*(a+a*sec(e+f*x))*tan(e+f*x)+-1//15*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-2*(a+a*sec(e+f*x))*tan(e+f*x))
@test integrate((c+-1*c*sec(e+f*x))^-4*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(-1//7*f^-1*(c+-1*c*sec(e+f*x))^-4*(a+a*sec(e+f*x))*tan(e+f*x)+-1//105*f^-1*(c^2+-1*c^2*sec(e+f*x))^-2*(2a+2*a*sec(e+f*x))*tan(e+f*x)+-1//35*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-3*(2a+2*a*sec(e+f*x))*tan(e+f*x))
@test integrate((c+-1*c*sec(e+f*x))^-5*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(-1//9*f^-1*(c+-1*c*sec(e+f*x))^-5*(a+a*sec(e+f*x))*tan(e+f*x)+-1//21*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-4*(a+a*sec(e+f*x))*tan(e+f*x)+-1//105*c^-2*f^-1*(c+-1*c*sec(e+f*x))^-3*(2a+2*a*sec(e+f*x))*tan(e+f*x)+-1//315*c^-1*f^-1*(c^2+-1*c^2*sec(e+f*x))^-2*(2a+2*a*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^5*sec(e+f*x), x) == :(-4//5*a^2*c^5*f^-1*tan(e+f*x)^5+-1//7*a^2*c^5*f^-1*tan(e+f*x)^7+9//16*a^2*c^5*f^-1*arctanh(sin(e+f*x))+(1/2)*a^2*c^5*f^-1*sec(e+f*x)^3*tan(e+f*x)^3+-3//8*a^2*c^5*f^-1*sec(e+f*x)^3*tan(e+f*x)+-3//16*a^2*c^5*f^-1*sec(e+f*x)*tan(e+f*x)+1//4*a^2*c^5*f^-1*tan(e+f*x)^3*sec(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^4*sec(e+f*x), x) == :(-2//5*a^2*c^4*f^-1*tan(e+f*x)^5+7//16*a^2*c^4*f^-1*arctanh(sin(e+f*x))+-5//16*a^2*c^4*f^-1*sec(e+f*x)*tan(e+f*x)+-1//8*a^2*c^4*f^-1*sec(e+f*x)^3*tan(e+f*x)+1//4*a^2*c^4*f^-1*tan(e+f*x)^3*sec(e+f*x)+1//6*a^2*c^4*f^-1*sec(e+f*x)^3*tan(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^3*sec(e+f*x), x) == :(-1//5*a^2*c^3*f^-1*tan(e+f*x)^5+3//8*a^2*c^3*f^-1*arctanh(sin(e+f*x))+-3//8*a^2*c^3*f^-1*sec(e+f*x)*tan(e+f*x)+1//4*a^2*c^3*f^-1*tan(e+f*x)^3*sec(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^2*sec(e+f*x), x) == :(3//8*a^2*c^2*f^-1*arctanh(sin(e+f*x))+-3//8*a^2*c^2*f^-1*sec(e+f*x)*tan(e+f*x)+1//4*a^2*c^2*f^-1*tan(e+f*x)^3*sec(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))*sec(e+f*x), x) == :((1/2)*c*a^2*f^-1*arctanh(sin(e+f*x))+-1//3*c*a^2*f^-1*tan(e+f*x)^3+-1//2*c*a^2*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-1*sec(e+f*x), x) == :(-1*f^-1*(c+-1*c*sec(e+f*x))^-1*(2*a^2+2*a^2*sec(e+f*x))*tan(e+f*x)+-3*a^2*c^-1*f^-1*arctanh(sin(e+f*x))+-3*a^2*c^-1*f^-1*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-2*sec(e+f*x), x) == :(a^2*c^-2*f^-1*arctanh(sin(e+f*x))+2*a^2*f^-1*(c^2+-1*c^2*sec(e+f*x))^-1*tan(e+f*x)+-1//3*f^-1*(c+-1*c*sec(e+f*x))^-2*(2*a^2+2*a^2*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-3*sec(e+f*x), x) == :(-1//5*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-3*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-4*sec(e+f*x), x) == :(-1//7*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-4*tan(e+f*x)+-1//35*c^-1*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-3*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-5*sec(e+f*x), x) == :(-1//9*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-5*tan(e+f*x)+-2//63*c^-1*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-4*tan(e+f*x)+-2//315*c^-2*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-3*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-6*sec(e+f*x), x) == :(-2//1155*f^-1*(a+a*sec(e+f*x))^2*(c^2+-1*c^2*sec(e+f*x))^-3*tan(e+f*x)+-1//11*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-6*tan(e+f*x)+-2//231*c^-2*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-4*tan(e+f*x)+-1//33*c^-1*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-5*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^6*sec(e+f*x), x) == :(1//9*a^3*c^6*f^-1*tan(e+f*x)^9+4//7*a^3*c^6*f^-1*tan(e+f*x)^7+55//128*a^3*c^6*f^-1*arctanh(sin(e+f*x))+-25//128*a^3*c^6*f^-1*sec(e+f*x)*tan(e+f*x)+-15//64*a^3*c^6*f^-1*sec(e+f*x)^3*tan(e+f*x)+-3//8*a^3*c^6*f^-1*sec(e+f*x)^3*tan(e+f*x)^5+-1//6*a^3*c^6*f^-1*tan(e+f*x)^5*sec(e+f*x)+5//16*a^3*c^6*f^-1*sec(e+f*x)^3*tan(e+f*x)^3+5//24*a^3*c^6*f^-1*tan(e+f*x)^3*sec(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^5*sec(e+f*x), x) == :(2//7*a^3*c^5*f^-1*tan(e+f*x)^7+45//128*a^3*c^5*f^-1*arctanh(sin(e+f*x))+-35//128*a^3*c^5*f^-1*sec(e+f*x)*tan(e+f*x)+-5//64*a^3*c^5*f^-1*sec(e+f*x)^3*tan(e+f*x)+-1//6*a^3*c^5*f^-1*tan(e+f*x)^5*sec(e+f*x)+-1//8*a^3*c^5*f^-1*sec(e+f*x)^3*tan(e+f*x)^5+5//24*a^3*c^5*f^-1*tan(e+f*x)^3*sec(e+f*x)+5//48*a^3*c^5*f^-1*sec(e+f*x)^3*tan(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^4*sec(e+f*x), x) == :(1//7*a^3*c^4*f^-1*tan(e+f*x)^7+5//16*a^3*c^4*f^-1*arctanh(sin(e+f*x))+-5//16*a^3*c^4*f^-1*sec(e+f*x)*tan(e+f*x)+-1//6*a^3*c^4*f^-1*tan(e+f*x)^5*sec(e+f*x)+5//24*a^3*c^4*f^-1*tan(e+f*x)^3*sec(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^3*sec(e+f*x), x) == :(5//16*a^3*c^3*f^-1*arctanh(sin(e+f*x))+-5//16*a^3*c^3*f^-1*sec(e+f*x)*tan(e+f*x)+-1//6*a^3*c^3*f^-1*tan(e+f*x)^5*sec(e+f*x)+5//24*a^3*c^3*f^-1*tan(e+f*x)^3*sec(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^2*sec(e+f*x), x) == :(1//5*a^3*c^2*f^-1*tan(e+f*x)^5+3//8*a^3*c^2*f^-1*arctanh(sin(e+f*x))+-3//8*a^3*c^2*f^-1*sec(e+f*x)*tan(e+f*x)+1//4*a^3*c^2*f^-1*tan(e+f*x)^3*sec(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))*sec(e+f*x), x) == :(-2//3*c*a^3*f^-1*tan(e+f*x)^3+5//8*c*a^3*f^-1*arctanh(sin(e+f*x))+-3//8*c*a^3*f^-1*sec(e+f*x)*tan(e+f*x)+-1//4*c*a^3*f^-1*sec(e+f*x)^3*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-1*sec(e+f*x), x) == :(-10*a^3*c^-1*f^-1*tan(e+f*x)+-15//2*a^3*c^-1*f^-1*arctanh(sin(e+f*x))+-2*a*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-1*tan(e+f*x)+-5//2*a^3*c^-1*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-2*sec(e+f*x), x) == :(5*a^3*c^-2*f^-1*arctanh(sin(e+f*x))+5*a^3*c^-2*f^-1*tan(e+f*x)+1//3*f^-1*(c^2+-1*c^2*sec(e+f*x))^-1*(10*a^3+10*a^3*sec(e+f*x))*tan(e+f*x)+-2//3*a*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-3*sec(e+f*x), x) == :(-1*a^3*c^-3*f^-1*arctanh(sin(e+f*x))+-2*a^3*f^-1*(c^3+-1*c^3*sec(e+f*x))^-1*tan(e+f*x)+-2//5*a*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-3*tan(e+f*x)+1//3*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-2*(2*a^3+2*a^3*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-4*sec(e+f*x), x) == :(-1//7*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-4*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-5*sec(e+f*x), x) == :(-1//9*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-5*tan(e+f*x)+-1//63*c^-1*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-4*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-6*sec(e+f*x), x) == :(-1//11*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-6*tan(e+f*x)+-2//99*c^-1*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-5*tan(e+f*x)+-2//693*c^-2*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-4*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-7*sec(e+f*x), x) == :(-1//13*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-7*tan(e+f*x)+-3//143*c^-1*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-6*tan(e+f*x)+-2//429*c^-2*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-5*tan(e+f*x)+-2//3003*c^-3*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-4*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^4*sec(e+f*x), x) == :(28*a^-1*c^4*f^-1*tan(e+f*x)+-35//2*a^-1*c^4*f^-1*arctanh(sin(e+f*x))+7//3*a^-1*c^4*f^-1*tan(e+f*x)^3+2*c*f^-1*(a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^3*tan(e+f*x)+-21//2*a^-1*c^4*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^3*sec(e+f*x), x) == :(10*a^-1*c^3*f^-1*tan(e+f*x)+-15//2*a^-1*c^3*f^-1*arctanh(sin(e+f*x))+2*c*f^-1*(a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^2*tan(e+f*x)+-5//2*a^-1*c^3*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^2*sec(e+f*x), x) == :(f^-1*(a+a*sec(e+f*x))^-1*(2*c^2+-2*c^2*sec(e+f*x))*tan(e+f*x)+-3*a^-1*c^2*f^-1*arctanh(sin(e+f*x))+3*a^-1*c^2*f^-1*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))*sec(e+f*x), x) == :(-1*c*a^-1*f^-1*arctanh(sin(e+f*x))+2*c*f^-1*(a+a*sec(e+f*x))^-1*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^-1*sec(e+f*x), x) == :(a^-1*c^-1*f^-1*csc(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^-2*sec(e+f*x), x) == :(a^-1*c^-2*f^-1*csc(e+f*x)+-1//3*a^-1*c^-2*f^-1*cot(e+f*x)^3+-1//3*a^-1*c^-2*f^-1*csc(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^-3*sec(e+f*x), x) == :(a^-1*c^-3*f^-1*csc(e+f*x)+-1*a^-1*c^-3*f^-1*csc(e+f*x)^3+2//5*a^-1*c^-3*f^-1*cot(e+f*x)^5+2//5*a^-1*c^-3*f^-1*csc(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^-4*sec(e+f*x), x) == :(a^-1*c^-4*f^-1*csc(e+f*x)+-2*a^-1*c^-4*f^-1*csc(e+f*x)^3+-4//7*a^-1*c^-4*f^-1*cot(e+f*x)^7+-4//7*a^-1*c^-4*f^-1*csc(e+f*x)^7+-1//5*a^-1*c^-4*f^-1*cot(e+f*x)^5+9//5*a^-1*c^-4*f^-1*csc(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^5*sec(e+f*x), x) == :(-84*a^-2*c^5*f^-1*tan(e+f*x)+-7*a^-2*c^5*f^-1*tan(e+f*x)^3+105//2*a^-2*c^5*f^-1*arctanh(sin(e+f*x))+-6*c^2*f^-1*(c+-1*c*sec(e+f*x))^3*(a^2+a^2*sec(e+f*x))^-1*tan(e+f*x)+2//3*c*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^4*tan(e+f*x)+63//2*a^-2*c^5*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^4*sec(e+f*x), x) == :(-70//3*a^-2*c^4*f^-1*tan(e+f*x)+-14//3*f^-1*(a^2+a^2*sec(e+f*x))^-1*(c^2+-1*c^2*sec(e+f*x))^2*tan(e+f*x)+35//2*a^-2*c^4*f^-1*arctanh(sin(e+f*x))+2//3*c*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^3*tan(e+f*x)+35//6*a^-2*c^4*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^3*sec(e+f*x), x) == :(-5*a^-2*c^3*f^-1*tan(e+f*x)+5*a^-2*c^3*f^-1*arctanh(sin(e+f*x))+-1//3*f^-1*(a^2+a^2*sec(e+f*x))^-1*(10*c^3+-10*c^3*sec(e+f*x))*tan(e+f*x)+2//3*c*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^2*sec(e+f*x), x) == :(a^-2*c^2*f^-1*arctanh(sin(e+f*x))+-2*c^2*f^-1*(a^2+a^2*sec(e+f*x))^-1*tan(e+f*x)+1//3*f^-1*(a+a*sec(e+f*x))^-2*(2*c^2+-2*c^2*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))*sec(e+f*x), x) == :(1//3*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-1*sec(e+f*x), x) == :(a^-2*c^-1*f^-1*csc(e+f*x)+-1//3*a^-2*c^-1*f^-1*csc(e+f*x)^3+1//3*a^-2*c^-1*f^-1*cot(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-2*sec(e+f*x), x) == :(a^-2*c^-2*f^-1*csc(e+f*x)+-1//3*a^-2*c^-2*f^-1*csc(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-3*sec(e+f*x), x) == :(a^-2*c^-3*f^-1*csc(e+f*x)+-2//3*a^-2*c^-3*f^-1*csc(e+f*x)^3+1//5*a^-2*c^-3*f^-1*cot(e+f*x)^5+1//5*a^-2*c^-3*f^-1*csc(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-4*sec(e+f*x), x) == :(a^-2*c^-4*f^-1*csc(e+f*x)^5+a^-2*c^-4*f^-1*csc(e+f*x)+-4//3*a^-2*c^-4*f^-1*csc(e+f*x)^3+-2//7*a^-2*c^-4*f^-1*cot(e+f*x)^7+-2//7*a^-2*c^-4*f^-1*csc(e+f*x)^7)
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-5*sec(e+f*x), x) == :(a^-2*c^-5*f^-1*csc(e+f*x)+3*a^-2*c^-5*f^-1*csc(e+f*x)^5+-13//7*a^-2*c^-5*f^-1*csc(e+f*x)^7+-7//3*a^-2*c^-5*f^-1*csc(e+f*x)^3+1//7*a^-2*c^-5*f^-1*cot(e+f*x)^7+4//9*a^-2*c^-5*f^-1*cot(e+f*x)^9+4//9*a^-2*c^-5*f^-1*csc(e+f*x)^9)
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^6*sec(e+f*x), x) == :(-231//2*a^-3*c^6*f^-1*arctanh(sin(e+f*x))+66//5*f^-1*(a^3+a^3*sec(e+f*x))^-1*(c^2+-1*c^2*sec(e+f*x))^3*tan(e+f*x)+77//5*a^-3*c^6*f^-1*tan(e+f*x)^3+924//5*a^-3*c^6*f^-1*tan(e+f*x)+-693//10*a^-3*c^6*f^-1*sec(e+f*x)*tan(e+f*x)+2//5*c*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^5*tan(e+f*x)+-22//15*a^-1*c^2*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^4*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^5*sec(e+f*x), x) == :(42*a^-3*c^5*f^-1*tan(e+f*x)+-63//2*a^-3*c^5*f^-1*arctanh(sin(e+f*x))+-21//2*a^-3*c^5*f^-1*sec(e+f*x)*tan(e+f*x)+2//5*c*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^4*tan(e+f*x)+42//5*c*f^-1*(a^3+a^3*sec(e+f*x))^-1*(c^2+-1*c^2*sec(e+f*x))^2*tan(e+f*x)+-6//5*a^-1*c^2*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^3*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^4*sec(e+f*x), x) == :(-7*a^-3*c^4*f^-1*arctanh(sin(e+f*x))+7*a^-3*c^4*f^-1*tan(e+f*x)+1//3*f^-1*(a^3+a^3*sec(e+f*x))^-1*(14*c^4+-14*c^4*sec(e+f*x))*tan(e+f*x)+-14//15*a^-1*f^-1*(a+a*sec(e+f*x))^-2*(c^2+-1*c^2*sec(e+f*x))^2*tan(e+f*x)+2//5*c*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^3*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^3*sec(e+f*x), x) == :(-1*a^-3*c^3*f^-1*arctanh(sin(e+f*x))+2*c^3*f^-1*(a^3+a^3*sec(e+f*x))^-1*tan(e+f*x)+-1//3*a^-1*f^-1*(a+a*sec(e+f*x))^-2*(2*c^3+-2*c^3*sec(e+f*x))*tan(e+f*x)+2//5*c*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^2*sec(e+f*x), x) == :(1//5*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))*sec(e+f*x), x) == :(1//5*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))*tan(e+f*x)+1//15*a^-1*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-1*sec(e+f*x), x) == :(a^-3*c^-1*f^-1*csc(e+f*x)+-1*a^-3*c^-1*f^-1*csc(e+f*x)^3+-2//5*a^-3*c^-1*f^-1*cot(e+f*x)^5+2//5*a^-3*c^-1*f^-1*csc(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-2*sec(e+f*x), x) == :(a^-3*c^-2*f^-1*csc(e+f*x)+-2//3*a^-3*c^-2*f^-1*csc(e+f*x)^3+-1//5*a^-3*c^-2*f^-1*cot(e+f*x)^5+1//5*a^-3*c^-2*f^-1*csc(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-3*sec(e+f*x), x) == :(a^-3*c^-3*f^-1*csc(e+f*x)+-2//3*a^-3*c^-3*f^-1*csc(e+f*x)^3+1//5*a^-3*c^-3*f^-1*csc(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-4*sec(e+f*x), x) == :(a^-3*c^-4*f^-1*csc(e+f*x)+-1*a^-3*c^-4*f^-1*csc(e+f*x)^3+-1//7*a^-3*c^-4*f^-1*cot(e+f*x)^7+-1//7*a^-3*c^-4*f^-1*csc(e+f*x)^7+3//5*a^-3*c^-4*f^-1*csc(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-5*sec(e+f*x), x) == :(a^-3*c^-5*f^-1*csc(e+f*x)+-1*a^-3*c^-5*f^-1*csc(e+f*x)^7+-5//3*a^-3*c^-5*f^-1*csc(e+f*x)^3+2//9*a^-3*c^-5*f^-1*cot(e+f*x)^9+2//9*a^-3*c^-5*f^-1*csc(e+f*x)^9+9//5*a^-3*c^-5*f^-1*csc(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-6*sec(e+f*x), x) == :(a^-3*c^-6*f^-1*csc(e+f*x)+-4*a^-3*c^-6*f^-1*csc(e+f*x)^7+-8//3*a^-3*c^-6*f^-1*csc(e+f*x)^3+-4//11*a^-3*c^-6*f^-1*cot(e+f*x)^11+-4//11*a^-3*c^-6*f^-1*csc(e+f*x)^11+-1//9*a^-3*c^-6*f^-1*cot(e+f*x)^9+17//9*a^-3*c^-6*f^-1*csc(e+f*x)^9+22//5*a^-3*c^-6*f^-1*csc(e+f*x)^5)
@test integrate((c+-1*c*sec(e+f*x))^7//2*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(-256//315*c^4*f^-1*(c+-1*c*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))*tan(e+f*x)+-64//105*c^3*f^-1*(c+-1*c*sec(e+f*x))^(1/2)*(a+a*sec(e+f*x))*tan(e+f*x)+-8//21*c^2*f^-1*(c+-1*c*sec(e+f*x))^3//2*(a+a*sec(e+f*x))*tan(e+f*x)+-2//9*c*f^-1*(c+-1*c*sec(e+f*x))^5//2*(a+a*sec(e+f*x))*tan(e+f*x))
@test integrate((c+-1*c*sec(e+f*x))^5//2*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(-64//105*c^3*f^-1*(c+-1*c*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))*tan(e+f*x)+-16//35*c^2*f^-1*(c+-1*c*sec(e+f*x))^(1/2)*(a+a*sec(e+f*x))*tan(e+f*x)+-2//7*c*f^-1*(c+-1*c*sec(e+f*x))^3//2*(a+a*sec(e+f*x))*tan(e+f*x))
@test integrate((c+-1*c*sec(e+f*x))^3//2*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(-8//15*c^2*f^-1*(c+-1*c*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))*tan(e+f*x)+-2//5*c*f^-1*(c+-1*c*sec(e+f*x))^(1/2)*(a+a*sec(e+f*x))*tan(e+f*x))
@test integrate((c+-1*c*sec(e+f*x))^(1/2)*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(-2//3*c*f^-1*(c+-1*c*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))*tan(e+f*x))
@test integrate((c+-1*c*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(2*a*f^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-2*a*2^(1/2)*c^-1//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((c+-1*c*sec(e+f*x))^-3//2*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(-1*a*f^-1*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+(1/2)*a*2^(1/2)*c^-3//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((c+-1*c*sec(e+f*x))^-5//2*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(-1//2*a*f^-1*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+1//8*a*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+1//16*a*2^(1/2)*c^-5//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^7//2*sec(e+f*x), x) == :(-256//1155*c^4*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-64//231*c^3*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+-8//33*c^2*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+-2//11*c*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^5//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :(-64//315*c^3*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-16//63*c^2*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+-2//9*c*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :(-8//35*c^2*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-2//7*c*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :(-2//5*c*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-7//2*sec(e+f*x), x) == :(-1//3*f^-1*(c+-1*c*sec(e+f*x))^-7//2*(a^2+a^2*sec(e+f*x))*tan(e+f*x)+-1//16*a^2*c^-2*f^-1*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+-1//32*2^(1/2)*a^2*c^-7//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))+1//4*a^2*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^7//2*sec(e+f*x), x) == :(-256//3003*c^4*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-64//429*c^3*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+-24//143*c^2*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+-2//13*c*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^5//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :(-64//693*c^3*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-16//99*c^2*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+-2//11*c*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :(-8//63*c^2*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-2//9*c*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :(-2//7*c*f^-1*(a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(8*a^3*f^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+1//3*f^-1*(c+-1*c*sec(e+f*x))^-1//2*(4*a^3+4*a^3*sec(e+f*x))*tan(e+f*x)+-8*2^(1/2)*a^3*c^-1//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))+2//5*a*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-3//2*sec(e+f*x), x) == :(-1*a*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+-10*a^3*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+10*2^(1/2)*a^3*c^-3//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))+-1//3*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-1//2*(5*a^3+5*a^3*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-5//2*sec(e+f*x), x) == :(-15//4*2^(1/2)*a^3*c^-5//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))+-1//2*a*f^-1*(a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+1//4*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-3//2*(5*a^3+5*a^3*sec(e+f*x))*tan(e+f*x)+15//4*a^3*c^-2*f^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^7//2*sec(e+f*x), x) == :(2*c*f^-1*(a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^5//2*tan(e+f*x)+12//5*a^-1*c^2*f^-1*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+32//5*a^-1*c^3*f^-1*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+128//5*a^-1*c^4*f^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :(2*c*f^-1*(a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+8//3*a^-1*c^2*f^-1*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+32//3*a^-1*c^3*f^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :(2*c*f^-1*(a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+4*a^-1*c^2*f^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :(2*c*f^-1*(a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(f^-1*(a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//2*2^(1/2)*a^-1*c^-1//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^-3//2*sec(e+f*x), x) == :(f^-1*(a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+-3//4*a^-1*f^-1*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+-3//8*2^(1/2)*a^-1*c^-3//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^-5//2*sec(e+f*x), x) == :(f^-1*(a+a*sec(e+f*x))^-1*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+-5//8*a^-1*f^-1*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+-15//32*a^-1*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+-15//64*2^(1/2)*a^-1*c^-5//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^7//2*sec(e+f*x), x) == :(-4*c^2*f^-1*(c+-1*c*sec(e+f*x))^3//2*(a^2+a^2*sec(e+f*x))^-1*tan(e+f*x)+-64//3*a^-2*c^4*f^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-16//3*a^-2*c^3*f^-1*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+2//3*c*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^5//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :(-16//3*a^-2*c^3*f^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-8//3*c^2*f^-1*(c+-1*c*sec(e+f*x))^(1/2)*(a^2+a^2*sec(e+f*x))^-1*tan(e+f*x)+2//3*c*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :(-4//3*c^2*f^-1*(c+-1*c*sec(e+f*x))^-1//2*(a^2+a^2*sec(e+f*x))^-1*tan(e+f*x)+2//3*c*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :(2//3*c*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x), x) == :((1/2)*f^-1*(c+-1*c*sec(e+f*x))^-1//2*(a^2+a^2*sec(e+f*x))^-1*tan(e+f*x)+1//3*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//4*2^(1/2)*a^-2*c^-1//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-3//2*sec(e+f*x), x) == :(-5//8*a^-2*f^-1*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+1//3*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+5//6*f^-1*(c+-1*c*sec(e+f*x))^-3//2*(a^2+a^2*sec(e+f*x))^-1*tan(e+f*x)+-5//16*2^(1/2)*a^-2*c^-3//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-5//2*sec(e+f*x), x) == :(-35//48*a^-2*f^-1*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+1//3*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+7//6*f^-1*(c+-1*c*sec(e+f*x))^-5//2*(a^2+a^2*sec(e+f*x))^-1*tan(e+f*x)+-35//64*a^-2*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+-35//128*2^(1/2)*a^-2*c^-5//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^7//2*sec(e+f*x), x) == :(2//5*c*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^5//2*tan(e+f*x)+16//5*c^3*f^-1*(c+-1*c*sec(e+f*x))^(1/2)*(a^3+a^3*sec(e+f*x))^-1*tan(e+f*x)+32//5*a^-3*c^4*f^-1*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-4//5*a^-1*c^2*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :(2//5*c*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+16//15*c^3*f^-1*(c+-1*c*sec(e+f*x))^-1//2*(a^3+a^3*sec(e+f*x))^-1*tan(e+f*x)+-8//15*a^-1*c^2*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :(2//5*c*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+-4//15*a^-1*c^2*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :(2//5*c*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(1//4*f^-1*(c+-1*c*sec(e+f*x))^-1//2*(a^3+a^3*sec(e+f*x))^-1*tan(e+f*x)+1//5*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//8*2^(1/2)*a^-3*c^-1//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))+1//6*a^-1*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-3//2*sec(e+f*x), x) == :(-7//16*a^-3*f^-1*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+1//5*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+7//12*f^-1*(c+-1*c*sec(e+f*x))^-3//2*(a^3+a^3*sec(e+f*x))^-1*tan(e+f*x)+-7//32*2^(1/2)*a^-3*c^-3//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))+7//30*a^-1*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-5//2*sec(e+f*x), x) == :(-21//32*a^-3*f^-1*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+1//5*f^-1*(a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+21//20*f^-1*(c+-1*c*sec(e+f*x))^-5//2*(a^3+a^3*sec(e+f*x))^-1*tan(e+f*x)+-63//128*a^-3*c^-1*f^-1*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+-63//256*2^(1/2)*a^-3*c^-5//2*f^-1*arctan((1/2)*2^(1/2)*c^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))+3//10*a^-1*f^-1*(a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :(1//3*a*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^5//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :((1/2)*a*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :(-1*c*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(a*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-3//2*sec(e+f*x), x) == :(-1//2*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-5//2*sec(e+f*x), x) == :(-1//2*a*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^7//2*sec(e+f*x), x) == :(1//5*a*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^7//2*tan(e+f*x)+1//10*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^7//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :(1//4*a*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^5//2*tan(e+f*x)+1//6*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^5//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :(-1//3*c*f^-1*(a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+-1//3*c^2*f^-1*(a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :(-1//2*c*f^-1*(a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(a*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+2*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-3//2*sec(e+f*x), x) == :(-1*a*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+-1*a^2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-5//2*sec(e+f*x), x) == :(-1//4*f^-1*(a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-7//2*sec(e+f*x), x) == :(-1//6*f^-1*(a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-7//2*tan(e+f*x)+-1//24*c^-1*f^-1*(a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-9//2*sec(e+f*x), x) == :(-1//4*a*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-9//2*tan(e+f*x)+1//12*a^2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-7//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-11//2*sec(e+f*x), x) == :(-1//5*a*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-11//2*tan(e+f*x)+1//20*a^2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-9//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^7//2*sec(e+f*x), x) == :(1//6*a*f^-1*(a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^7//2*tan(e+f*x)+1//15*a^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^7//2*tan(e+f*x)+2//15*a^2*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^7//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :(-2//15*c^3*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//5*c*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+-1//5*c^2*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :(-1//4*c*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+-1//6*c^2*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :(-1//3*c*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x), x) == :((1/2)*a*f^-1*(a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+2*a^2*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+4*a^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-3//2*sec(e+f*x), x) == :(-1*a*f^-1*(a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+-2*a^2*c^-1*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-4*a^3*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-5//2*sec(e+f*x), x) == :(-1//2*a*f^-1*(a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+a^2*c^-1*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+a^3*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-7//2*sec(e+f*x), x) == :(-1//6*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-7//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-9//2*sec(e+f*x), x) == :(-1//8*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-9//2*tan(e+f*x)+-1//48*c^-1*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-7//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-11//2*sec(e+f*x), x) == :(-1//10*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-11//2*tan(e+f*x)+-1//40*c^-1*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-9//2*tan(e+f*x)+-1//240*c^-2*f^-1*(a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-7//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :(-2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+-1//2*c*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+-4*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :(-1*c*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+-2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :(-1*c*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*arctanh(cos(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-3//2*sec(e+f*x), x) == :(-1//2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+-1//2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*arctanh(cos(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-5//2*sec(e+f*x), x) == :(-1//4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+-1//4*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+-1//4*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*arctanh(cos(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :(c*f^-1*(a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+2*a^-1*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+4*a^-1*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :(c*f^-1*(a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+a^-1*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :((1/2)*f^-1*(a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x), x) == :((1/2)*f^-1*(a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//2*a^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*arctanh(cos(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^-3//2*sec(e+f*x), x) == :((1/2)*a^-1*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*csc(e+f*x)+-1//2*a^-1*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*arctanh(cos(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^-5//2*sec(e+f*x), x) == :(-1//4*f^-1*(a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+3//8*a^-1*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*csc(e+f*x)+-3//8*a^-1*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*arctanh(cos(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :((1/2)*c*f^-1*(a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+-1*a^-1*c^2*f^-1*(a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+-1*a^-2*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+sec(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :(1//4*f^-1*(a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :((1/2)*c*f^-1*(a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(1//4*f^-1*(a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+1//4*a^-1*f^-1*(a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//4*a^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*arctanh(cos(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^-3//2*sec(e+f*x), x) == :(1//4*f^-1*(a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^-3//2*tan(e+f*x)+3//8*a^-2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*csc(e+f*x)+-3//8*a^-2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*arctanh(cos(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^-5//2*sec(e+f*x), x) == :(3//8*a^-2*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*csc(e+f*x)+-3//8*a^-2*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*arctanh(cos(e+f*x))*tan(e+f*x)+-1//4*a^-2*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*cot(e+f*x)^2*csc(e+f*x))
@test integrate((a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^5//2*sec(e+f*x), x) == :(-16*c^2*f^-1*(a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^(1/2)*(15+4*m^2+16m)^-1*tan(e+f*x)+-2*c*f^-1*(5+2m)^-1*(a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+-64*c^3*f^-1*(5+2m)^-1*(a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^-1//2*(3+4*m^2+8m)^-1*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^3//2*sec(e+f*x), x) == :(-8*c^2*f^-1*(a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^-1//2*(3+4*m^2+8m)^-1*tan(e+f*x)+-2*c*f^-1*(3+2m)^-1*(a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :(-2*c*f^-1*(1+2m)^-1*(a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^(-3+-1m)*sec(e+f*x), x) == :(-1*f^-1*(1+2m)^-1*(a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^(-3+-1m)*tan(e+f*x)+2*a^-1*f^-1*(a+a*sec(e+f*x))^(1+m)*(c+-1*c*sec(e+f*x))^(-3+-1m)*(3+4*m^2+8m)^-1*tan(e+f*x)+-2*a^-2*f^-1*(1+2m)^-1*(a+a*sec(e+f*x))^(2+m)*(c+-1*c*sec(e+f*x))^(-3+-1m)*(15+4*m^2+16m)^-1*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^(-2+-1m)*sec(e+f*x), x) == :(-1*f^-1*(1+2m)^-1*(a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^(-2+-1m)*tan(e+f*x)+a^-1*f^-1*(a+a*sec(e+f*x))^(1+m)*(c+-1*c*sec(e+f*x))^(-2+-1m)*(3+4*m^2+8m)^-1*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^(-1+-1m)*sec(e+f*x), x) == :(-1*f^-1*(1+2m)^-1*(a+a*sec(e+f*x))^m*(c+-1*c*sec(e+f*x))^(-1+-1m)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*sec(e+f*x)^2*(c+-1*c*sec(e+f*x)), x) == :(-2//3*c*a^3*f^-1*tan(e+f*x)^3+-1//5*c*a^3*f^-1*tan(e+f*x)^5+1//4*c*a^3*f^-1*arctanh(sin(e+f*x))+-1//2*c*a^3*f^-1*sec(e+f*x)^3*tan(e+f*x)+1//4*c*a^3*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*sec(e+f*x)^2*(c+-1*c*sec(e+f*x)), x) == :(-1//3*c*a^2*f^-1*tan(e+f*x)^3+1//8*c*a^2*f^-1*arctanh(sin(e+f*x))+-1//4*c*a^2*f^-1*sec(e+f*x)^3*tan(e+f*x)+1//8*c*a^2*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate(sec(e+f*x)^2*(a+a*sec(e+f*x))*(c+-1*c*sec(e+f*x)), x) == :(-1//3*a*c*f^-1*tan(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^-1*sec(e+f*x)^2*(c+-1*c*sec(e+f*x)), x) == :(-1*c*a^-1*f^-1*tan(e+f*x)+-2*c*f^-1*(a+a*sec(e+f*x))^-1*tan(e+f*x)+2*c*a^-1*f^-1*arctanh(sin(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-2*sec(e+f*x)^2*(c+-1*c*sec(e+f*x)), x) == :(-1*c*a^-2*f^-1*arctanh(sin(e+f*x))+-2//3*c*f^-1*(a+a*sec(e+f*x))^-2*tan(e+f*x)+7//3*c*a^-2*f^-1*(1+sec(e+f*x))^-1*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*sec(e+f*x)^2*(c+-1*c*sec(e+f*x)), x) == :(-4//15*c*f^-1*(a^3+a^3*sec(e+f*x))^-1*tan(e+f*x)+-2//5*c*f^-1*(a+a*sec(e+f*x))^-3*tan(e+f*x)+11//15*c*a^-1*f^-1*(a+a*sec(e+f*x))^-2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x)^2, x) == :(f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(tan(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*d*sec(e+f*x))^-1*sec(e+f*x), x) == :(2*a^(1/2)*d^-1//2*f^-1*(c+-1d)^-1//2*arctanh(a^(1/2)*d^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-1//2*tan(e+f*x)))
@test integrate((c+d*sec(e+f*x))^4*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(1//5*a*f^-1*(c+d*sec(e+f*x))^4*tan(e+f*x)+1//8*a*f^-1*(3*d^4+8*c^4+12*c*d^3+16*d*c^3+24*c^2*d^2)*arctanh(sin(e+f*x))+1//30*a*f^-1*(12*c^4+16*d^4+80*c*d^3+95*d*c^3+112*c^2*d^2)*tan(e+f*x)+1//20*a*f^-1*(c+d*sec(e+f*x))^3*(4c+5d)*tan(e+f*x)+1//60*a*f^-1*(c+d*sec(e+f*x))^2*(12*c^2+16*d^2+35*c*d)*tan(e+f*x)+1//120*a*d*f^-1*(24*c^3+45*d^3+116*c*d^2+130*d*c^2)*sec(e+f*x)*tan(e+f*x))
@test integrate((c+d*sec(e+f*x))^3*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(1//4*a*f^-1*(c+d*sec(e+f*x))^3*tan(e+f*x)+1//6*a*f^-1*(3*c^3+4*d^3+12*c*d^2+16*d*c^2)*tan(e+f*x)+1//8*a*f^-1*(3*d^3+8*c^3+12*c*d^2+12*d*c^2)*arctanh(sin(e+f*x))+1//12*a*f^-1*(c+d*sec(e+f*x))^2*(3c+4d)*tan(e+f*x)+1//24*a*d*f^-1*(6*c^2+9*d^2+20*c*d)*sec(e+f*x)*tan(e+f*x))
@test integrate((c+d*sec(e+f*x))^2*(a+a*sec(e+f*x))*sec(e+f*x), x) == :((1/2)*a*f^-1*(d^2+2*c^2+2*c*d)*arctanh(sin(e+f*x))+1//3*a*f^-1*(c+d*sec(e+f*x))^2*tan(e+f*x)+2//3*a*f^-1*(c^2+d^2+3*c*d)*tan(e+f*x)+1//6*a*d*f^-1*(2c+3d)*sec(e+f*x)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))*(c+d*sec(e+f*x))*sec(e+f*x), x) == :(a*f^-1*(c+d)*tan(e+f*x)+(1/2)*a*f^-1*(d+2c)*arctanh(sin(e+f*x))+(1/2)*a*d*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((c+d*sec(e+f*x))^-1*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(a*d^-1*f^-1*arctanh(sin(e+f*x))+-2*a*d^-1*f^-1*(c+d)^-1//2*(c+-1d)^(1/2)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((c+d*sec(e+f*x))^-2*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(a*f^-1*(c+d)^-1*(c+d*sec(e+f*x))^-1*tan(e+f*x)+2*a*f^-1*(c+d)^-3//2*(c+-1d)^-1//2*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((c+d*sec(e+f*x))^-3*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(a*f^-1*(c+d*sec(e+f*x))^-2*(2c+2d)^-1*tan(e+f*x)+a*f^-1*(c+d)^-5//2*(c+-1d)^-3//2*(-1d+2c)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+a*f^-1*(c+d)^-2*(c+d*sec(e+f*x))^-1*(-2d+2c)^-1*(c+-2d)*tan(e+f*x))
@test integrate((c+d*sec(e+f*x))^-4*(a+a*sec(e+f*x))*sec(e+f*x), x) == :(a*f^-1*(c+d*sec(e+f*x))^-3*(3c+3d)^-1*tan(e+f*x)+a*f^-1*(c+d)^-7//2*(c+-1d)^-5//2*(d^2+2*c^2+-2*c*d)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+a*f^-1*(c+d)^-2*(c+d*sec(e+f*x))^-2*(-6d+6c)^-1*(-3d+2c)*tan(e+f*x)+1//6*a*f^-1*(c+d)^-3*(c+-1d)^-2*(c+d*sec(e+f*x))^-1*(c+-4d)*(-1d+2c)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+d*sec(e+f*x))*sec(e+f*x), x) == :((1/2)*a^2*f^-1*(2d+3c)*arctanh(sin(e+f*x))+1//3*d*f^-1*(a+a*sec(e+f*x))^2*tan(e+f*x)+2//3*a^2*f^-1*(2d+3c)*tan(e+f*x)+1//6*a^2*f^-1*(2d+3c)*sec(e+f*x)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+d*sec(e+f*x))*sec(e+f*x), x) == :(a^3*f^-1*(3d+4c)*tan(e+f*x)+1//4*d*f^-1*(a+a*sec(e+f*x))^3*tan(e+f*x)+1//12*a^3*f^-1*tan(e+f*x)^3*(3d+4c)+5//8*a^3*f^-1*(3d+4c)*arctanh(sin(e+f*x))+3//8*a^3*f^-1*(3d+4c)*sec(e+f*x)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1*(c+d*sec(e+f*x))*sec(e+f*x), x) == :(d*a^-1*f^-1*arctanh(sin(e+f*x))+f^-1*(a+a*sec(e+f*x))^-1*(c+-1d)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+d*sec(e+f*x))*sec(e+f*x), x) == :(1//3*f^-1*(a+a*sec(e+f*x))^-2*(c+-1d)*tan(e+f*x)+1//3*f^-1*(a^2+a^2*sec(e+f*x))^-1*(c+2d)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+d*sec(e+f*x))^2*sec(e+f*x), x) == :(1//5*f^-1*(a+a*sec(e+f*x))^-3*(c+-1d)^2*tan(e+f*x)+1//15*f^-1*(a^3+a^3*sec(e+f*x))^-1*(2*c^2+7*d^2+6*c*d)*tan(e+f*x)+1//15*a^-1*f^-1*(a+a*sec(e+f*x))^-2*(c+4d)*(-2d+2c)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+d*sec(e+f*x))*sec(e+f*x), x) == :(1//5*f^-1*(a+a*sec(e+f*x))^-3*(c+-1d)*tan(e+f*x)+1//15*f^-1*(a^3+a^3*sec(e+f*x))^-1*(2c+3d)*tan(e+f*x)+1//15*a^-1*f^-1*(a+a*sec(e+f*x))^-2*(2c+3d)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+d*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(2*a^(1/2)*d^-1//2*f^-1*arctanh(a^(1/2)*d^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^(1/2)*sec(e+f*x), x) == :(2*a^-1//2*d^(1/2)*f^-1*arctanh(a^(1/2)*d^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1//2*tan(e+f*x))+2^(1/2)*a^-1//2*f^-1*(c+-1d)^(1/2)*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+-1d)^(1/2)*(c+d*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(2^(1/2)*a^-1//2*f^-1*(c+-1d)^-1//2*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+-1d)^(1/2)*(c+d*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1//2*sec(e+f*x)^2, x) == :(2*a^-1//2*d^-1//2*f^-1*arctanh(a^(1/2)*d^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1//2*tan(e+f*x))+-1*2^(1/2)*a^-1//2*f^-1*(c+-1d)^-1//2*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+-1d)^(1/2)*(c+d*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+d*sec(e+f*x))^-1*sec(e+f*x), x) == :(2*a^(1/2)*d^-1//2*f^-1*(c+d)^-1//2*arctan(a^(1/2)*d^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+d)^-1//2*tan(e+f*x)))
@test integrate((g*sec(e+f*x))^3//2*(a+a*sec(e+f*x))^(1/2)*(c+d*sec(e+f*x))^-1, x) == :(2*a^(1/2)*d^-1*f^-1*g^3//2*arctanh(a^(1/2)*g^(1/2)*(g*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a^(1/2)*c^(1/2)*d^-1*f^-1*g^3//2*(c+d)^-1//2*arctanh(a^(1/2)*c^(1/2)*g^(1/2)*(g*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))^-1//2*(c+d)^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1*sec(e+f*x), x) == :(2^(1/2)*a^-1//2*f^-1*(c+-1d)^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a^-1//2*d^(1/2)*f^-1*(c+d)^-1//2*(c+-1d)^-1*arctan(a^(1/2)*d^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+d)^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1*sec(e+f*x)^2, x) == :(-1*2^(1/2)*a^-1//2*f^-1*(c+-1d)^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2*c*a^-1//2*d^-1//2*f^-1*(c+d)^-1//2*(c+-1d)^-1*arctan(a^(1/2)*d^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+d)^-1//2*tan(e+f*x)))
@test integrate((g*sec(e+f*x))^3//2*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1, x) == :(-1*2^(1/2)*a^-1//2*f^-1*g^3//2*(c+-1d)^-1*arctanh((1/2)*2^(1/2)*a^(1/2)*g^(1/2)*(g*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2*a^-1//2*c^(1/2)*f^-1*g^3//2*(c+d)^-1//2*(c+-1d)^-1*arctanh(a^(1/2)*c^(1/2)*g^(1/2)*(g*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))^-1//2*(c+d)^-1//2*tan(e+f*x)))
@test integrate((g*sec(e+f*x))^5//2*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1, x) == :(2*a^-1//2*d^-1*f^-1*g^5//2*arctanh(a^(1/2)*g^(1/2)*(g*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2^(1/2)*a^-1//2*f^-1*g^5//2*(c+-1d)^-1*arctanh((1/2)*2^(1/2)*a^(1/2)*g^(1/2)*(g*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a^-1//2*c^3//2*d^-1*f^-1*g^5//2*(c+d)^-1//2*(c+-1d)^-1*arctanh(a^(1/2)*c^(1/2)*g^(1/2)*(g*sec(e+f*x))^-1//2*(a+a*sec(e+f*x))^-1//2*(c+d)^-1//2*tan(e+f*x)))
@test integrate((c+d*sec(e+f*x))^4*(a+b*sec(e+f*x))*sec(e+f*x), x) == :(1//8*f^-1*(3*a*d^4+8*a*c^4+12*b*c*d^3+16*b*d*c^3+24*a*c^2*d^2)*arctanh(sin(e+f*x))+1//30*f^-1*(12*b*c^4+16*b*d^4+80*a*c*d^3+95*a*d*c^3+112*b*c^2*d^2)*tan(e+f*x)+1//5*b*f^-1*(c+d*sec(e+f*x))^4*tan(e+f*x)+1//20*f^-1*(c+d*sec(e+f*x))^3*(4*b*c+5*a*d)*tan(e+f*x)+1//60*f^-1*(c+d*sec(e+f*x))^2*(12*b*c^2+16*b*d^2+35*a*c*d)*tan(e+f*x)+1//120*d*f^-1*(24*b*c^3+45*a*d^3+116*b*c*d^2+130*a*d*c^2)*sec(e+f*x)*tan(e+f*x))
@test integrate((c+d*sec(e+f*x))^3*(a+b*sec(e+f*x))*sec(e+f*x), x) == :(1//6*f^-1*(3*b*(c^3+4*c*d^2)+4*a*d*(d^2+4*c^2))*tan(e+f*x)+1//8*f^-1*(3*b*d^3+8*a*c^3+12*a*c*d^2+12*b*d*c^2)*arctanh(sin(e+f*x))+1//4*b*f^-1*(c+d*sec(e+f*x))^3*tan(e+f*x)+1//12*f^-1*(c+d*sec(e+f*x))^2*(3*b*c+4*a*d)*tan(e+f*x)+1//24*d*f^-1*(6*b*c^2+9*b*d^2+20*a*c*d)*sec(e+f*x)*tan(e+f*x))
@test integrate((c+d*sec(e+f*x))^2*(a+b*sec(e+f*x))*sec(e+f*x), x) == :((1/2)*f^-1*(a*(d^2+2*c^2)+2*b*c*d)*arctanh(sin(e+f*x))+1//3*f^-1*(2*b*(c^2+d^2)+6*a*c*d)*tan(e+f*x)+1//3*b*f^-1*(c+d*sec(e+f*x))^2*tan(e+f*x)+1//6*d*f^-1*(2*b*c+3*a*d)*sec(e+f*x)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))*(c+d*sec(e+f*x))*sec(e+f*x), x) == :(f^-1*(a*d+b*c)*tan(e+f*x)+(1/2)*f^-1*(b*d+2*a*c)*arctanh(sin(e+f*x))+(1/2)*b*d*f^-1*sec(e+f*x)*tan(e+f*x))
@test integrate((c+d*sec(e+f*x))^-1*(a+b*sec(e+f*x))*sec(e+f*x), x) == :(b*d^-1*f^-1*arctanh(sin(e+f*x))+-1*d^-1*f^-1*(c+d)^-1//2*(c+-1d)^-1//2*(-2*a*d+2*b*c)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((c+d*sec(e+f*x))^-2*(a+b*sec(e+f*x))*sec(e+f*x), x) == :(f^-1*(c+d)^-3//2*(c+-1d)^-3//2*(-2*b*d+2*a*c)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+f^-1*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-1*(b*c+-1*a*d)*tan(e+f*x))
@test integrate((c+d*sec(e+f*x))^-3*(a+b*sec(e+f*x))*sec(e+f*x), x) == :(f^-1*(c+d*sec(e+f*x))^-2*(-2*d^2+2*c^2)^-1*(b*c+-1*a*d)*tan(e+f*x)+-1*f^-1*(c+d)^-5//2*(c+-1d)^-5//2*(-1*a*(d^2+2*c^2)+3*b*c*d)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//2*f^-1*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-2*(-1*b*(c^2+2*d^2)+3*a*c*d)*tan(e+f*x))
@test integrate((c+d*sec(e+f*x))^-4*(a+b*sec(e+f*x))*sec(e+f*x), x) == :(f^-1*(c+d)^-7//2*(c+-1d)^-7//2*(-1*b*d^3+2*a*c^3+-4*b*d*c^2+3*a*c*d^2)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+f^-1*(c+d*sec(e+f*x))^-3*(-3*d^2+3*c^2)^-1*(b*c+-1*a*d)*tan(e+f*x)+1//6*f^-1*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-3*(-4*a*d^3+2*b*c^3+-11*a*d*c^2+13*b*c*d^2)*tan(e+f*x)+1//6*f^-1*(c+d*sec(e+f*x))^-2*(c^2+-1*d^2)^-2*(2*b*c^2+3*b*d^2+-5*a*c*d)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^2*(c+d*sec(e+f*x))^3*sec(e+f*x), x) == :(1//8*f^-1*(4*a^2*(2*c^3+3*c*d^2)+c*b^2*(4*c^2+9*d^2)+6*a*b*d*(d^2+4*c^2))*arctanh(sin(e+f*x))+1//30*d^-1*f^-1*(-1*b^2*(-16*d^4+3*c^4+-52*c^2*d^2)+20*a^2*d^2*(d^2+4*c^2)+30*a*b*c*d*(c^2+4*d^2))*tan(e+f*x)+1//120*f^-1*(-1*b^2*(6*c^3+-71*c*d^2)+100*c*a^2*d^2+30*a*b*d*(2*c^2+3*d^2))*sec(e+f*x)*tan(e+f*x)+1//5*b^2*d^-1*f^-1*(c+d*sec(e+f*x))^4*tan(e+f*x)+1//60*d^-1*f^-1*(c+d*sec(e+f*x))^2*(d^2*(16*b^2+20*a^2)+-3*b*c*(b*c+-10*a*d))*tan(e+f*x)+-1//20*b*d^-1*f^-1*(c+d*sec(e+f*x))^3*(b*c+-10*a*d)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^2*(c+d*sec(e+f*x))^2*sec(e+f*x), x) == :(1//8*f^-1*(b^2*(3*d^2+4*c^2)+4*a^2*(d^2+2*c^2)+16*a*b*c*d)*arctanh(sin(e+f*x))+1//6*b^-1*f^-1*(-1*a^3*d^2+4*a*b^2*(2*d^2+3*c^2)+8*c*d*b^3+8*b*c*d*a^2)*tan(e+f*x)+1//24*f^-1*(3*b^2*(3*d^2+4*c^2)+2*a*d*(-1*a*d+8*b*c))*sec(e+f*x)*tan(e+f*x)+1//4*b^-1*d^2*f^-1*(a+b*sec(e+f*x))^3*tan(e+f*x)+1//12*d*b^-1*f^-1*(a+b*sec(e+f*x))^2*(-1*a*d+8*b*c)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^2*(c+d*sec(e+f*x))*sec(e+f*x), x) == :((1/2)*f^-1*(c*b^2+2*c*a^2+2*a*b*d)*arctanh(sin(e+f*x))+1//3*f^-1*(2*d*a^2+2*d*b^2+6*a*b*c)*tan(e+f*x)+1//3*d*f^-1*(a+b*sec(e+f*x))^2*tan(e+f*x)+1//6*b*f^-1*(2*a*d+3*b*c)*sec(e+f*x)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^2*(c+d*sec(e+f*x))^-1*sec(e+f*x), x) == :(b^2*d^-1*f^-1*tan(e+f*x)+-1*b*d^-2*f^-1*(b*c+-2*a*d)*arctanh(sin(e+f*x))+2*d^-2*f^-1*(c+d)^-1//2*(c+-1d)^-1//2*(b*c+-1*a*d)^2*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^2*(c+d*sec(e+f*x))^-2*sec(e+f*x), x) == :(b^2*d^-2*f^-1*arctanh(sin(e+f*x))+-1*d^-1*f^-1*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^2*tan(e+f*x)+-1*d^-2*f^-1*(c+d)^-3//2*(c+-1d)^-3//2*(-2*a*d+2*b*c)*(b*c^2+-2*b*d^2+a*c*d)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^2*(c+d*sec(e+f*x))^-3*sec(e+f*x), x) == :(-1*f^-1*(c+d)^-5//2*(c+-1d)^-5//2*(-1*a^2*(d^2+2*c^2)+-1*b^2*(c^2+2*d^2)+6*a*b*c*d)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//2*d^-1*f^-1*(c+d*sec(e+f*x))^-2*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^2*tan(e+f*x)+(1/2)*d^-1*f^-1*(c+d)^-2*(c+-1d)^-2*(c+d*sec(e+f*x))^-1*(b*c+-1*a*d)*(b*(c^2+-4*d^2)+3*a*c*d)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^2*(c+d*sec(e+f*x))^-4*sec(e+f*x), x) == :(-1*f^-1*(c+d)^-7//2*(c+-1d)^-7//2*(-1*a^2*(2*c^3+3*c*d^2)+-1*c*b^2*(c^2+4*d^2)+2*a*b*d*(d^2+4*c^2))*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//3*d^-1*f^-1*(c+d*sec(e+f*x))^-3*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^2*tan(e+f*x)+-1//6*d^-1*f^-1*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-3*(-1*b^2*(c^4+-6*d^4+-10*c^2*d^2)+a^2*d^2*(4*d^2+11*c^2)+-1*a*b*(4*d*c^3+26*c*d^3))*tan(e+f*x)+1//6*d^-1*f^-1*(c+d)^-2*(c+-1d)^-2*(c+d*sec(e+f*x))^-2*(b*c+-1*a*d)*(b*(c^2+-6*d^2)+5*a*c*d)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^2*(c+d*sec(e+f*x))^-5*sec(e+f*x), x) == :(-1//4*f^-1*(c+d)^-9//2*(c+-1d)^-9//2*(-1*a^2*(3*d^4+8*c^4+24*c^2*d^2)+-1*b^2*(4*c^4+4*d^4+27*c^2*d^2)+10*a*b*d*(4*c^3+3*c*d^2))*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//4*d^-1*f^-1*(c+d*sec(e+f*x))^-4*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^2*tan(e+f*x)+-1//24*d^-1*f^-1*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-4*(-1*b^2*(2*c^5+-68*c*d^4+-39*c^3*d^2)+-2*a*b*d*(6*c^4+16*d^4+83*c^2*d^2)+5*c*a^2*d^2*(10*c^2+11*d^2))*tan(e+f*x)+-1//24*d^-1*f^-1*(c+d*sec(e+f*x))^-2*(c^2+-1*d^2)^-3*(-1*b^2*(-12*d^4+2*c^4+-25*c^2*d^2)+a^2*d^2*(9*d^2+26*c^2)+-2*a*b*d*(6*c^3+29*c*d^2))*tan(e+f*x)+1//12*d^-1*f^-1*(c+d)^-2*(c+-1d)^-2*(c+d*sec(e+f*x))^-3*(b*c+-1*a*d)*(b*(c^2+-8*d^2)+7*a*c*d)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^3*(c+d*sec(e+f*x))^2*sec(e+f*x), x) == :(1//8*f^-1*(4*a^3*(d^2+2*c^2)+3*a*b^2*(3*d^2+4*c^2)+6*c*d*b^3+24*b*c*d*a^2)*arctanh(sin(e+f*x))+1//30*b^-1*f^-1*(-3*a^4*d^2+4*b^4*(4*d^2+5*c^2)+4*a^2*b^2*(13*d^2+20*c^2)+30*b*c*d*a^3+120*a*c*d*b^3)*tan(e+f*x)+1//120*f^-1*(-6*a^3*d^2+a*b^2*(71*d^2+100*c^2)+90*c*d*b^3+60*b*c*d*a^2)*sec(e+f*x)*tan(e+f*x)+1//5*b^-1*d^2*f^-1*(a+b*sec(e+f*x))^4*tan(e+f*x)+1//60*b^-1*f^-1*(a+b*sec(e+f*x))^2*(4*b^2*(4*d^2+5*c^2)+3*a*d*(-1*a*d+10*b*c))*tan(e+f*x)+1//20*d*b^-1*f^-1*(a+b*sec(e+f*x))^3*(-1*a*d+10*b*c)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^3*(c+d*sec(e+f*x))*sec(e+f*x), x) == :(1//6*f^-1*(3*d*a^3+4*c*b^3+12*a*d*b^2+16*b*c*a^2)*tan(e+f*x)+1//8*f^-1*(3*d*b^3+8*c*a^3+12*a*c*b^2+12*b*d*a^2)*arctanh(sin(e+f*x))+1//4*d*f^-1*(a+b*sec(e+f*x))^3*tan(e+f*x)+1//12*f^-1*(a+b*sec(e+f*x))^2*(3*a*d+4*b*c)*tan(e+f*x)+1//24*b*f^-1*(6*d*a^2+9*d*b^2+20*a*b*c)*sec(e+f*x)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^3*(c+d*sec(e+f*x))^-1*sec(e+f*x), x) == :((1/2)*b^2*d^-1*f^-1*(a+b*sec(e+f*x))*tan(e+f*x)+-1//2*b*d^-3*f^-1*(-1*b^2*(d^2+2*c^2)+-6*a^2*d^2+6*a*b*c*d)*arctanh(sin(e+f*x))+-1//2*b^2*d^-2*f^-1*(-5*a*d+2*b*c)*tan(e+f*x)+-2*d^-3*f^-1*(c+d)^-1//2*(c+-1d)^-1//2*(b*c+-1*a*d)^3*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^3*(c+d*sec(e+f*x))^-2*sec(e+f*x), x) == :(-1*b^2*d^-3*f^-1*(-3*a*d+2*b*c)*arctanh(sin(e+f*x))+-1*b*d^-2*f^-1*(c^2+-1*d^2)^-1*(-1*a^2*d^2+-1*b^2*(-1*d^2+2*c^2)+2*a*b*c*d)*tan(e+f*x)+-1*d^-1*f^-1*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^2*(a+b*sec(e+f*x))*tan(e+f*x)+2*d^-3*f^-1*(c+d)^-3//2*(c+-1d)^-3//2*(b*c+-1*a*d)^2*(-3*b*d^2+2*b*c^2+a*c*d)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^3*(c+d*sec(e+f*x))^-3*sec(e+f*x), x) == :(b^3*d^-3*f^-1*arctanh(sin(e+f*x))+-1*d^-3*f^-1*(c+d)^-5//2*(c+-1d)^-5//2*(b*c+-1*a*d)*(b^2*(2*c^4+6*d^4+-5*c^2*d^2)+a^2*d^2*(d^2+2*c^2)+2*a*b*c*d*(c^2+-4*d^2))*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//2*d^-1*f^-1*(c+d*sec(e+f*x))^-2*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^2*(a+b*sec(e+f*x))*tan(e+f*x)+-1//2*d^-2*f^-1*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-2*(b*c+-1*a*d)^2*(-5*b*d^2+2*b*c^2+3*a*c*d)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^3*(c+d*sec(e+f*x))^-4*sec(e+f*x), x) == :(-1*f^-1*(c+d)^-7//2*(c+-1d)^-7//2*(a*c+-1*b*d)*(-1*a^2*(2*c^2+3*d^2)+-1*b^2*(2*d^2+3*c^2)+10*a*b*c*d)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//3*d^-1*f^-1*(c+d*sec(e+f*x))^-3*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^2*(a+b*sec(e+f*x))*tan(e+f*x)+-1//6*d^-2*f^-1*(c+d*sec(e+f*x))^-2*(c^2+-1*d^2)^-2*(b*c+-1*a*d)^2*(-7*b*d^2+2*b*c^2+5*a*c*d)*tan(e+f*x)+1//6*d^-2*f^-1*(c+d)^-3*(c+-1d)^-3*(c+d*sec(e+f*x))^-1*(b*c+-1*a*d)*(b^2*(2*c^4+18*d^4+-5*c^2*d^2)+a^2*d^2*(4*d^2+11*c^2)+5*a*b*c*d*(c^2+-7*d^2))*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^3*(c+d*sec(e+f*x))^-5*sec(e+f*x), x) == :(-1//4*f^-1*(c+d)^-9//2*(c+-1d)^-9//2*(-1*a^3*(3*d^4+8*c^4+24*c^2*d^2)+-3*a*b^2*(4*c^4+4*d^4+27*c^2*d^2)+5*c*d*b^3*(3*c^2+4*d^2)+15*b*d*a^2*(4*c^3+3*c*d^2))*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//24*d^-2*f^-1*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-4*(-1*b^3*(2*c^6+24*d^6+-5*c^4*d^2+84*c^2*d^4)+-3*b*a^2*d^2*(6*c^4+16*d^4+83*c^2*d^2)+5*c*a^3*d^3*(10*c^2+11*d^2)+-3*a*c*d*b^2*(-68*d^4+2*c^4+-39*c^2*d^2))*tan(e+f*x)+-1//4*d^-1*f^-1*(c+d*sec(e+f*x))^-4*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^2*(a+b*sec(e+f*x))*tan(e+f*x)+-1//12*d^-2*f^-1*(c+d*sec(e+f*x))^-3*(c^2+-1*d^2)^-2*(b*c+-1*a*d)^2*(-9*b*d^2+2*b*c^2+7*a*c*d)*tan(e+f*x)+1//24*d^-2*f^-1*(c+d)^-3*(c+-1d)^-3*(c+d*sec(e+f*x))^-2*(b*c+-1*a*d)*(b^2*(2*c^4+36*d^4+-3*c^2*d^2)+a*b*(-78*c*d^3+8*d*c^3)+a^2*d^2*(9*d^2+26*c^2))*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^-1*(c+d*sec(e+f*x))^4*sec(e+f*x), x) == :(b^-1*d^4*f^-1*tan(e+f*x)+1//3*b^-1*d^4*f^-1*tan(e+f*x)^3+b^-3*d^2*f^-1*(a^2*d^2+6*b^2*c^2+-4*a*b*c*d)*tan(e+f*x)+(1/2)*b^-2*d^3*f^-1*(-1*a*d+4*b*c)*arctanh(sin(e+f*x))+d*b^-4*f^-1*(-1*a*d+2*b*c)*(a^2*d^2+2*b^2*c^2+-2*a*b*c*d)*arctanh(sin(e+f*x))+(1/2)*b^-2*d^3*f^-1*(-1*a*d+4*b*c)*sec(e+f*x)*tan(e+f*x)+2*b^-4*f^-1*(a+b)^-1//2*(a+-1b)^-1//2*(b*c+-1*a*d)^4*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^-1*(c+d*sec(e+f*x))^3*sec(e+f*x), x) == :((1/2)*b^-1*d^3*f^-1*arctanh(sin(e+f*x))+d*b^-3*f^-1*(a^2*d^2+3*b^2*c^2+-3*a*b*c*d)*arctanh(sin(e+f*x))+b^-2*d^2*f^-1*(-1*a*d+3*b*c)*tan(e+f*x)+(1/2)*b^-1*d^3*f^-1*sec(e+f*x)*tan(e+f*x)+2*b^-3*f^-1*(a+b)^-1//2*(a+-1b)^-1//2*(b*c+-1*a*d)^3*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^-1*(c+d*sec(e+f*x))^2*sec(e+f*x), x) == :(b^-1*d^2*f^-1*tan(e+f*x)+d*b^-2*f^-1*(-1*a*d+2*b*c)*arctanh(sin(e+f*x))+2*b^-2*f^-1*(a+b)^-1//2*(a+-1b)^-1//2*(b*c+-1*a*d)^2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^-1*(c+d*sec(e+f*x))*sec(e+f*x), x) == :(d*b^-1*f^-1*arctanh(sin(e+f*x))+b^-1*f^-1*(a+b)^-1//2*(a+-1b)^-1//2*(-2*a*d+2*b*c)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^-1*(c+d*sec(e+f*x))^-1*sec(e+f*x), x) == :(-2*d*f^-1*(c+d)^-1//2*(c+-1d)^-1//2*(b*c+-1*a*d)^-1*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+2*b*f^-1*(a+b)^-1//2*(a+-1b)^-1//2*(b*c+-1*a*d)^-1*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^-1*(c+d*sec(e+f*x))^-2*sec(e+f*x), x) == :(d^2*f^-1*(d+c*cos(e+f*x))^-1*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^-1*sin(e+f*x)+2*b^2*f^-1*(a+b)^-1//2*(a+-1b)^-1//2*(b*c+-1*a*d)^-2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-2*d*f^-1*(c+d)^-3//2*(c+-1d)^-3//2*(b*c+-1*a*d)^-2*(-1*b*d^2+2*b*c^2+-1*a*c*d)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^-2*(c+d*sec(e+f*x))^5*sec(e+f*x), x) == :(b^-2*d^5*f^-1*tan(e+f*x)+1//3*b^-2*d^5*f^-1*tan(e+f*x)^3+b^-5*d^2*f^-1*(-4*a^3*d^3+10*b^3*c^3+-20*a*d*b^2*c^2+15*b*c*a^2*d^2)*arctanh(sin(e+f*x))+b^-4*d^3*f^-1*(3*a^2*d^2+10*b^2*c^2+-10*a*b*c*d)*tan(e+f*x)+(1/2)*b^-3*d^4*f^-1*(-2*a*d+5*b*c)*arctanh(sin(e+f*x))+(1/2)*b^-3*d^4*f^-1*(-2*a*d+5*b*c)*sec(e+f*x)*tan(e+f*x)+-1*b^-4*f^-1*(b+a*cos(e+f*x))^-1*(a^2+-1*b^2)^-1*(b*c+-1*a*d)^5*sin(e+f*x)+2*a^-1*b^-3*f^-1*(a+b)^-3//2*(a+-1b)^-3//2*(b*c+-1*a*d)^5*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+2*a^-1*b^-5*f^-1*(a+b)^-1//2*(a+-1b)^-1//2*(b*c+-1*a*d)^4*(b*c+4*a*d)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^-2*(c+d*sec(e+f*x))^4*sec(e+f*x), x) == :((1/2)*b^-2*d^4*f^-1*arctanh(sin(e+f*x))+b^-4*d^2*f^-1*(3*a^2*d^2+6*b^2*c^2+-8*a*b*c*d)*arctanh(sin(e+f*x))+(1/2)*b^-2*d^4*f^-1*sec(e+f*x)*tan(e+f*x)+2*b^-3*d^3*f^-1*(-1*a*d+2*b*c)*tan(e+f*x)+-1*b^-3*f^-1*(b+a*cos(e+f*x))^-1*(a^2+-1*b^2)^-1*(b*c+-1*a*d)^4*sin(e+f*x)+2*a^-1*b^-2*f^-1*(a+b)^-3//2*(a+-1b)^-3//2*(b*c+-1*a*d)^4*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+2*a^-1*b^-4*f^-1*(a+b)^-1//2*(a+-1b)^-1//2*(b*c+-1*a*d)^3*(b*c+3*a*d)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^-2*(c+d*sec(e+f*x))^3*sec(e+f*x), x) == :(b^-2*d^3*f^-1*tan(e+f*x)+b^-3*d^2*f^-1*(-2*a*d+3*b*c)*arctanh(sin(e+f*x))+-1*b^-2*f^-1*(b+a*cos(e+f*x))^-1*(a^2+-1*b^2)^-1*(b*c+-1*a*d)^3*sin(e+f*x)+2*a^-1*b^-1*f^-1*(a+b)^-3//2*(a+-1b)^-3//2*(b*c+-1*a*d)^3*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+2*a^-1*b^-3*f^-1*(a+b)^-1//2*(a+-1b)^-1//2*(b*c+-1*a*d)^2*(b*c+2*a*d)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^-2*(c+d*sec(e+f*x))^2*sec(e+f*x), x) == :(b^-2*d^2*f^-1*arctanh(sin(e+f*x))+-1*b^-1*f^-1*(b+a*cos(e+f*x))^-1*(a^2+-1*b^2)^-1*(b*c+-1*a*d)^2*sin(e+f*x)+2*a^-1*f^-1*(a+b)^-3//2*(a+-1b)^-3//2*(b*c+-1*a*d)^2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+a^-1*b^-2*f^-1*(a+b)^-1//2*(a+-1b)^-1//2*(-2*a^2*d^2+2*b^2*c^2)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^-2*(c+d*sec(e+f*x))*sec(e+f*x), x) == :(f^-1*(a+b)^-3//2*(a+-1b)^-3//2*(-2*b*d+2*a*c)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1*f^-1*(a+b*sec(e+f*x))^-1*(a^2+-1*b^2)^-1*(b*c+-1*a*d)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^-2*(c+d*sec(e+f*x))^-1*sec(e+f*x), x) == :(-1*b^2*f^-1*(b+a*cos(e+f*x))^-1*(a^2+-1*b^2)^-1*(b*c+-1*a*d)^-1*sin(e+f*x)+2*d^2*f^-1*(c+d)^-1//2*(c+-1d)^-1//2*(b*c+-1*a*d)^-2*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+2*b*f^-1*(a+b)^-3//2*(a+-1b)^-3//2*(b*c+-1*a*d)^-2*(d*b^2+-2*d*a^2+a*b*c)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x)))
@test integrate((a+b*sec(e+f*x))^-2*(c+d*sec(e+f*x))^-3*sec(e+f*x), x) == :(-1*b^2*f^-1*(a+b*sec(e+f*x))^-1*(c+d*sec(e+f*x))^-2*(a^2+-1*b^2)^-1*(b*c+-1*a*d)^-1*tan(e+f*x)+-1*d^2*f^-1*(c+d)^-5//2*(c+-1d)^-5//2*(b*c+-1*a*d)^-4*(-3*b^2*(2*d^4+4*c^4+-5*c^2*d^2)+-1*a^2*d^2*(d^2+2*c^2)+2*a*b*c*d*(-1*d^2+4*c^2))*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+2*b^3*f^-1*(a+b)^-3//2*(a+-1b)^-3//2*(b*c+-1*a*d)^-4*(-4*d*a^2+3*d*b^2+a*b*c)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+d*f^-1*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-2*(-2*b^2+2*a^2)^-1*(b*c+-1*a*d)^-3*(-1*b^3*(2*c^4+6*d^4+-11*c^2*d^2)+3*c*a^3*d^3+-1*b*a^2*d^2*(-4*d^2+7*c^2)+-3*a*c*b^2*d^3)*tan(e+f*x)+-1*d*f^-1*(c+d*sec(e+f*x))^-2*(c^2+-1*d^2)^-1*(-2*b^2+2*a^2)^-1*(b*c+-1*a*d)^-2*(a^2*d^2+b^2*(-3*d^2+2*c^2))*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^-3*(c+d*sec(e+f*x))^5*sec(e+f*x), x) == :(-1//2*b^-5*d^3*f^-1*(-1*b^2*(d^2+20*c^2)+-12*a^2*d^2+30*a*b*c*d)*arctanh(sin(e+f*x))+(1/2)*d*b^-4*f^-1*(a^2+-1*b^2)^-2*(-12*a^5*d^4+a*b^4*(-6*d^4+6*c^4+43*c^2*d^2)+-1*c*d*b^5*(-10*d^2+17*c^2)+-1*a^3*b^2*d^2*(-21*d^2+16*c^2)+30*b*c*a^4*d^3+-1*c*d*a^2*b^3*(4*c^2+55*d^2))*tan(e+f*x)+b^-5*f^-1*(a+b)^-5//2*(a+-1b)^-5//2*(b*c+-1*a*d)^3*(b^4*(c^2+20*d^2)+12*a^4*d^2+a^2*b^2*(-29*d^2+2*c^2)+-12*a*c*d*b^3+6*b*c*d*a^3)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//2*b^-1*f^-1*(a+b*sec(e+f*x))^-2*(c+d*sec(e+f*x))^3*(a^2+-1*b^2)^-1*(b*c+-1*a*d)^2*tan(e+f*x)+-1//2*b^-3*d^2*f^-1*(a^2+-1*b^2)^-2*(-6*a^4*d^3+d*b^4*(-1*d^2+8*c^2)+d*a^2*b^2*(c^2+10*d^2)+-1*a*c*b^3*(3*c^2+16*d^2)+7*b*c*a^3*d^2)*sec(e+f*x)*tan(e+f*x)+-1//2*b^-2*f^-1*(a+b*sec(e+f*x))^-1*(c+d*sec(e+f*x))^2*(a^2+-1*b^2)^-2*(b*c+-1*a*d)^2*(-7*d*b^2+4*d*a^2+3*a*b*c)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^-3*(c+d*sec(e+f*x))^4*sec(e+f*x), x) == :(b^-4*d^3*f^-1*(-3*a*d+4*b*c)*arctanh(sin(e+f*x))+-1//2*b^-3*d^2*f^-1*(a^2+-1*b^2)^-1*(-1*b^2*(c^2+-2*d^2)+-3*a^2*d^2+2*a*b*c*d)*tan(e+f*x)+b^-4*f^-1*(a+b)^-5//2*(a+-1b)^-5//2*(b*c+-1*a*d)^2*(b^4*(c^2+12*d^2)+6*a^4*d^2+a^2*b^2*(-15*d^2+2*c^2)+-10*a*c*d*b^3+4*b*c*d*a^3)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-3//2*b^-3*f^-1*(a+b*sec(e+f*x))^-1*(a^2+-1*b^2)^-2*(b*c+-1*a*d)^3*(d*a^2+-2*d*b^2+a*b*c)*tan(e+f*x)+-1//2*b^-1*f^-1*(a+b*sec(e+f*x))^-2*(c+d*sec(e+f*x))^2*(a^2+-1*b^2)^-1*(b*c+-1*a*d)^2*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^-3*(c+d*sec(e+f*x))^3*sec(e+f*x), x) == :(b^-3*d^3*f^-1*arctanh(sin(e+f*x))+b^-3*f^-1*(a+b)^-5//2*(a+-1b)^-5//2*(b*c+-1*a*d)*(b^4*(c^2+6*d^2)+2*a^4*d^2+a^2*b^2*(-5*d^2+2*c^2)+-8*a*c*d*b^3+2*b*c*d*a^3)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//2*b^-1*f^-1*(a+b*sec(e+f*x))^-2*(a^2+-1*b^2)^-1*(b*c+-1*a*d)^2*(c+d*sec(e+f*x))*tan(e+f*x)+-1//2*b^-2*f^-1*(a+b*sec(e+f*x))^-1*(a^2+-1*b^2)^-2*(b*c+-1*a*d)^2*(-5*d*b^2+2*d*a^2+3*a*b*c)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^-3*(c+d*sec(e+f*x))^2*sec(e+f*x), x) == :(-1*f^-1*(a+b)^-5//2*(a+-1b)^-5//2*(-1*a^2*(d^2+2*c^2)+-1*b^2*(c^2+2*d^2)+6*a*b*c*d)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//2*b^-1*f^-1*(a+b*sec(e+f*x))^-2*(a^2+-1*b^2)^-1*(b*c+-1*a*d)^2*tan(e+f*x)+-1//2*b^-1*f^-1*(a+b*sec(e+f*x))^-1*(a^2+-1*b^2)^-2*(b*c+-1*a*d)*(d*a^2+-4*d*b^2+3*a*b*c)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^-3*(c+d*sec(e+f*x))*sec(e+f*x), x) == :(f^-1*(a+b)^-5//2*(a+-1b)^-5//2*(c*b^2+2*c*a^2+-3*a*b*d)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1*f^-1*(a+b*sec(e+f*x))^-2*(-2*b^2+2*a^2)^-1*(b*c+-1*a*d)*tan(e+f*x)+-1//2*f^-1*(a+b*sec(e+f*x))^-1*(a^2+-1*b^2)^-2*(-1*d*a^2+-2*d*b^2+3*a*b*c)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^-3*(c+d*sec(e+f*x))^-1*sec(e+f*x), x) == :(-1*b^2*f^-1*(a+b*sec(e+f*x))^-2*(-2*b^2+2*a^2)^-1*(b*c+-1*a*d)^-1*tan(e+f*x)+-2*d^3*f^-1*(c+d)^-1//2*(c+-1d)^-1//2*(b*c+-1*a*d)^-3*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1*b*f^-1*(a+b)^-5//2*(a+-1b)^-5//2*(b*c+-1*a*d)^-3*(-1*b^4*(c^2+2*d^2)+-6*a^4*d^2+-1*a^2*b^2*(-5*d^2+2*c^2)+6*b*c*d*a^3)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//2*b^2*f^-1*(a+b*sec(e+f*x))^-1*(a^2+-1*b^2)^-2*(b*c+-1*a*d)^-2*(-5*d*a^2+2*d*b^2+3*a*b*c)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^-3*(c+d*sec(e+f*x))^-2*sec(e+f*x), x) == :(-1*b^2*f^-1*(a+b)^-5//2*(a+-1b)^-5//2*(b*c+-1*a*d)^-4*(-1*b^4*(c^2+6*d^2)+-12*a^4*d^2+-1*a^2*b^2*(-15*d^2+2*c^2)+-2*a*c*d*b^3+8*b*c*d*a^3)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1*b^2*f^-1*(a+b*sec(e+f*x))^-2*(c+d*sec(e+f*x))^-1*(-2*b^2+2*a^2)^-1*(b*c+-1*a*d)^-1*tan(e+f*x)+-2*d^3*f^-1*(c+d)^-3//2*(c+-1d)^-3//2*(b*c+-1*a*d)^-4*(-3*b*d^2+4*b*c^2+-1*a*c*d)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+(1/2)*d*f^-1*(c+d*sec(e+f*x))^-1*(a^2+-1*b^2)^-2*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^-3*(2*a^4*d^3+-2*d*b^4*(-3*d^2+2*c^2)+d*a^2*b^2*(-11*d^2+7*c^2)+-3*a*c*b^3*(c^2+-1*d^2))*tan(e+f*x)+-3//2*b^2*f^-1*(a+b*sec(e+f*x))^-1*(c+d*sec(e+f*x))^-1*(a^2+-1*b^2)^-2*(b*c+-1*a*d)^-2*(d*b^2+-2*d*a^2+a*b*c)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^-3*(c+d*sec(e+f*x))^-3*sec(e+f*x), x) == :(-1*b^2*f^-1*(a+b*sec(e+f*x))^-2*(c+d*sec(e+f*x))^-2*(-2*b^2+2*a^2)^-1*(b*c+-1*a*d)^-1*tan(e+f*x)+-1*b^3*f^-1*(a+b)^-5//2*(a+-1b)^-5//2*(b*c+-1*a*d)^-5*(-1*b^4*(c^2+12*d^2)+-20*a^4*d^2+-1*a^2*b^2*(-29*d^2+2*c^2)+-4*a*c*d*b^3+10*b*c*d*a^3)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1*d^3*f^-1*(c+d)^-5//2*(c+-1d)^-5//2*(b*c+-1*a*d)^-5*(b^2*(12*d^4+20*c^4+-29*c^2*d^2)+a^2*d^2*(d^2+2*c^2)+-1*a*b*(-4*c*d^3+10*d*c^3))*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+(1/2)*d*f^-1*(c+d*sec(e+f*x))^-2*(a^2+-1*b^2)^-2*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^-3*(a^4*d^3+-1*d*b^4*(-6*d^2+5*c^2)+-3*a*c*b^3*(c^2+-1*d^2)+2*d*a^2*b^2*(-5*d^2+4*c^2))*tan(e+f*x)+-3//2*d*f^-1*(c+d*sec(e+f*x))^-1*(a^2+-1*b^2)^-2*(c^2+-1*d^2)^-2*(b*c+-1*a*d)^-4*(c*a^5*d^4+d*b^5*(2*c^4+4*d^4+-7*c^2*d^2)+-1*b*a^4*(-2*d^5+3*c^2*d^3)+a*c*b^4*(c^4+2*d^4+-2*c^2*d^2)+-1*d*a^2*b^3*(3*c^4+7*d^4+-12*c^2*d^2)+-2*c*a^3*b^2*d^4)*tan(e+f*x)+-1//2*b^2*f^-1*(a+b*sec(e+f*x))^-1*(c+d*sec(e+f*x))^-2*(a^2+-1*b^2)^-2*(b*c+-1*a*d)^-2*(-7*d*a^2+4*d*b^2+3*a*b*c)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(2*f^-1*((a+b)^-1*(c+d*sec(e+f*x))^-1*(1+-1*sec(e+f*x))*(b*c+-1*a*d))^(1/2)*(-1*(a+-1b)^-1*(c+d*sec(e+f*x))^-1*(1+sec(e+f*x))*(b*c+-1*a*d))^(1/2)*(a+b)^(1/2)*(c+d)^-1//2*(b*c+-1*a*d)^-1*(c+d*sec(e+f*x))*Elliptic.F(arcsin((a+b)^-1//2*(a+b*sec(e+f*x))^(1/2)*(c+d)^(1/2)*(c+d*sec(e+f*x))^-1//2),(a+-1b)^-1*(c+d)^-1*(a+b)*(c+-1d))*cot(e+f*x))
@test integrate((-4+5*sec(e+f*x))^-1//2*(2+3*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(2*f^-1*((4+-5*sec(e+f*x))^-1*(1+-1*sec(e+f*x)))^(1/2)*((4+-5*sec(e+f*x))^-1*(1+sec(e+f*x)))^(1/2)*(4+-5*sec(e+f*x))*Elliptic.F(arcsin(1//5*5^(1/2)*(-4+5*sec(e+f*x))^-1//2*(2+3*sec(e+f*x))^(1/2)),45)*cot(e+f*x))
@test integrate((2+3*sec(e+f*x))^-1//2*(4+-5*sec(e+f*x))^-1//2*sec(e+f*x), x) == :(2//15*im*5^(1/2)*f^-1*((2+3*sec(e+f*x))^-1*(1+-1*sec(e+f*x)))^(1/2)*((2+3*sec(e+f*x))^-1*(1+sec(e+f*x)))^(1/2)*(2+3*sec(e+f*x))*Elliptic.F(im*arcsinh(5^(1/2)*(2+3*sec(e+f*x))^-1//2*(4+-5*sec(e+f*x))^(1/2)),1//45)*cot(e+f*x))
@test integrate((a+b*sec(e+f*x))^(1/2)*(c+c*sec(e+f*x))^-1*sec(e+f*x), x) == :(c^-1*f^-1*((1+sec(e+f*x))^-1)^(1/2)*((1+sec(e+f*x))^-1*(a+b)^-1*(a+b*sec(e+f*x)))^-1//2*(a+b*sec(e+f*x))^(1/2)*Elliptic.E(arcsin((1+sec(e+f*x))^-1*tan(e+f*x)),(a+b)^-1*(a+-1b)))
@test integrate((a+b*sec(e+f*x))^-1//2*(c+c*sec(e+f*x))^-1*sec(e+f*x), x) == :(c^-1*f^-1*((1+sec(e+f*x))^-1)^(1/2)*((1+sec(e+f*x))^-1*(a+b)^-1*(a+b*sec(e+f*x)))^-1//2*(a+-1b)^-1*(a+b*sec(e+f*x))^(1/2)*Elliptic.E(arcsin((1+sec(e+f*x))^-1*tan(e+f*x)),(a+b)^-1*(a+-1b))+-2*c^-1*f^-1*(b*(a+b)^-1*(1+-1*sec(e+f*x)))^(1/2)*(-1*b*(a+-1b)^-1*(1+sec(e+f*x)))^(1/2)*(a+b)^(1/2)*(a+-1b)^-1*Elliptic.F(arcsin((a+b)^-1//2*(a+b*sec(e+f*x))^(1/2)),(a+-1b)^-1*(a+b))*cot(e+f*x))
@test integrate((a+b*sec(e+f*x))^-1//2*(c+c*sec(e+f*x))^-1*sec(e+f*x)^2, x) == :(-1*c^-1*f^-1*((1+sec(e+f*x))^-1)^(1/2)*((1+sec(e+f*x))^-1*(a+b)^-1*(a+b*sec(e+f*x)))^-1//2*(a+-1b)^-1*(a+b*sec(e+f*x))^(1/2)*Elliptic.E(arcsin((1+sec(e+f*x))^-1*tan(e+f*x)),(a+b)^-1*(a+-1b))+2*a*b^-1*c^-1*f^-1*(b*(a+b)^-1*(1+-1*sec(e+f*x)))^(1/2)*(-1*b*(a+-1b)^-1*(1+sec(e+f*x)))^(1/2)*(a+b)^(1/2)*(a+-1b)^-1*Elliptic.F(arcsin((a+b)^-1//2*(a+b*sec(e+f*x))^(1/2)),(a+-1b)^-1*(a+b))*cot(e+f*x))
@test integrate((g*sec(e+f*x))^3//2*(a+b*sec(e+f*x))^-1//2*(c+c*sec(e+f*x))^-1, x) == :(g*c^-1*f^-1*(g*sec(e+f*x))^(1/2)*((a+b)^-1*(b+a*cos(e+f*x)))^(1/2)*(a+b*sec(e+f*x))^-1//2*Elliptic.F((1/2)*e+(1/2)*f*x,2*a*(a+b)^-1)+-1*g*f^-1*(g*sec(e+f*x))^(1/2)*(a+-1b)^-1*(a+b*sec(e+f*x))^-1//2*(c+c*cos(e+f*x))^-1*(b+a*cos(e+f*x))*sin(e+f*x)+g*c^-1*f^-1*(g*sec(e+f*x))^(1/2)*((a+b)^-1*(b+a*cos(e+f*x)))^-1//2*(a+-1b)^-1*(a+b*sec(e+f*x))^-1//2*(b+a*cos(e+f*x))*Elliptic.E((1/2)*e+(1/2)*f*x,2*a*(a+b)^-1))
@test integrate((c+-1*c*sec(e+f*x))^-7*tan(e+f*x)^4*sec(e+f*x), x) == :(-1//14*c^-7*f^-1*cot((1/2)*e+(1/2)*f*x)^7+1//20*c^-7*f^-1*cot((1/2)*e+(1/2)*f*x)^5+1//36*c^-7*f^-1*cot((1/2)*e+(1/2)*f*x)^9)
@test integrate((c+-1*c*sec(e+f*x))^-8*tan(e+f*x)^4*sec(e+f*x), x) == :(-3//56*c^-8*f^-1*cot((1/2)*e+(1/2)*f*x)^7+-1//88*c^-8*f^-1*cot((1/2)*e+(1/2)*f*x)^11+1//24*c^-8*f^-1*cot((1/2)*e+(1/2)*f*x)^9+1//40*c^-8*f^-1*cot((1/2)*e+(1/2)*f*x)^5)

max_stars_repo_path: test/4 Trig functions/4.5 Secant/4.5.2.3 (g sec)^p (a+b sec)^m (c+d sec)^n.jl


text:
# Autogenerated wrapper script for FFMPEG_jll for aarch64-linux-musl
export ffmpeg, ffprobe, libavcodec, libavdevice, libavfilter, libavformat, libavresample, libavutil, libpostproc, libswresample, libswscale

using libass_jll
using libfdk_aac_jll
using FriBidi_jll
using FreeType2_jll
using LAME_jll
using libvorbis_jll
using Ogg_jll
using x264_jll
using x265_jll
using Bzip2_jll
using Zlib_jll
using OpenSSL_jll
using Opus_jll
JLLWrappers.@generate_wrapper_header("FFMPEG")
JLLWrappers.@declare_executable_product(ffmpeg)
JLLWrappers.@declare_executable_product(ffprobe)
JLLWrappers.@declare_library_product(libavcodec, "libavcodec.so.58")
JLLWrappers.@declare_library_product(libavdevice, "libavdevice.so.58")
JLLWrappers.@declare_library_product(libavfilter, "libavfilter.so.7")
JLLWrappers.@declare_library_product(libavformat, "libavformat.so.58")
JLLWrappers.@declare_library_product(libavresample, "libavresample.so.4")
JLLWrappers.@declare_library_product(libavutil, "libavutil.so.56")
JLLWrappers.@declare_library_product(libpostproc, "libpostproc.so.55")
JLLWrappers.@declare_library_product(libswresample, "libswresample.so.3")
JLLWrappers.@declare_library_product(libswscale, "libswscale.so.5")
function __init__()
    JLLWrappers.@generate_init_header(libass_jll, libfdk_aac_jll, FriBidi_jll, FreeType2_jll, LAME_jll, libvorbis_jll, Ogg_jll, x264_jll, x265_jll, Bzip2_jll, Zlib_jll, OpenSSL_jll, Opus_jll)
    JLLWrappers.@init_executable_product(
        ffmpeg,
        "bin/ffmpeg",
    )

    JLLWrappers.@init_executable_product(
        ffprobe,
        "bin/ffprobe",
    )

    JLLWrappers.@init_library_product(
        libavcodec,
        "lib/libavcodec.so",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libavdevice,
        "lib/libavdevice.so",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libavfilter,
        "lib/libavfilter.so",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libavformat,
        "lib/libavformat.so",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libavresample,
        "lib/libavresample.so",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libavutil,
        "lib/libavutil.so",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libpostproc,
        "lib/libpostproc.so",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libswresample,
        "lib/libswresample.so",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libswscale,
        "lib/libswscale.so",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@generate_init_footer()
end  # __init__()

ext: jl


text:
# adapted from https://github.com/SimonDanisch/JSServe.jl/blob/master/examples/editor.jl
struct Editor
    value::Observable{String}
    language::Observable{String}
    entries::SimpleList
    style::Observable{String}
end

function Editor(value::Observable, language′, entries=SimpleList())
    language::Observable{String} = language′
    style = Observable("width: 100%; height: 16rem;")
    return Editor(value, language, entries, style)
end

function jsrender(session::Session, editor::Editor)
    # FIXME: currently, not everything updates when changing observables
    ui = DOM.div(editor.value[]; editor.style)

    onload(session, ui, js"""
        function (element){
            const editor = $(ace).edit(element);
            const language = $(editor.language[])
            const langTools = $(ace).require("ace/ext/language_tools");
            const langMode = $(ace).require("ace/mode/" + language);
            const completers = $(editor.entries).map(function ({meta, words, score}) {
                return {
                    getCompletions: function (editor, session, pos, prefix, callback) {
                        let wordList = JSServe.get_observable(words);
                        callback(null, wordList.map(function(word) {
                            return {
                                caption: word,
                                value: word,
                                meta: meta || "",
                                score: score || 0
                            };
                        }));
                    }
                };
            });
            editor.session.setMode("ace/mode/" + language);
            editor.session.on("change", function () {
                const value = editor.getValue();
                JSServe.update_obs($(editor.value), value);
            });
            editor.setOptions({
                enableLiveAutocompletion: true,
                enableBasicAutocompletion: true,
                enableSnippets: true,
                fontSize: 18,
            });
            editor.completers.push(...completers);
            editor.renderer.setShowGutter(false);
            editor.setShowPrintMargin(false);
        }
    """)
    return jsrender(session, ui)
end

struct RichEditor
    name::String
    widget::Editor
    default::String
    confirmedvalue::Observable{String}
end

function RichEditor(name, language, default, entries::SimpleList=SimpleList())
    wdg = Editor(Observable(default), language, entries)
    return RichEditor(name, wdg, default, Observable(default))
end

function parse!(rtf::RichEditor)
    value = rtf.widget.value[]
    rtf.confirmedvalue[] = value
    return
end

function reset!(rtf::RichEditor)
    rtf.widget.value[] = rtf.default
    parse!(rtf)
end

function jsrender(session::Session, rtf::RichEditor)
    label = DOM.p(class="text-blue-800 text-xl font-semibold py-4 w-full text-left", rtf.name)
    ui = DOM.div(class="mb-4", label, rtf.widget)
    return jsrender(session, ui)
end


text:
"""
The `SIFTS` module of MIToS allows to obtain the
residue-level mapping between databases stored in the SIFTS XML files.
It makes easy to assign PDB residues to UniProt/Pfam positions.
Given the fact that pairwise alignments can lead to misleading association between residues in both sequences,
SIFTS offers  more reliable association between sequence and structure residue numbers.

**Features**

- Download and parse SIFTS XML files
- Store residue-level mapping in Julia
- Easy generation of `Dict`s between residues numbers

```julia
using MIToS.SIFTS
```
"""
module SIFTS

using LightXML
using AutoHashEquals
using MIToS.Utils

export  DataBase,
        dbPDBe,
        dbInterPro,
        dbUniProt,
        dbPfam,
        dbNCBI,
        dbPDB,
        dbCATH,
        dbSCOP,
        dbEnsembl,
        SIFTSResidue,
        downloadsifts,
        siftsmapping,
        SIFTSXML,
        # Mitos.Utils
        All,
        # Imported from Base (and exported for docs)
        parse

include("XMLParser.jl")
include("ResidueMapping.jl")

end


text:
# Imports
using Reduce
@force using Reduce.Algebra
using Calculus
using Revise

using Plots
gr();

import mna

# Netlist
Z₀ = 50;
Vₛ = 1;

testbench = Dict([ "Vs" => (:V, 1, 0, Vₛ)
                 , "Rs" => (:R, 1, 2, Z₀)
                 , "Rl" => (:R, 3, 0, Z₀)
                 ]);

lowPass = Dict([ "C1" => (:C, 2, 0, 15e-12)
               , "C2" => (:C, 3, 0, 15e-12)
               , "L1" => (:L, 2, 3, 82e-9)
               ]);

netlist = merge(testbench, lowPass);

# Modified Nodal Analysis
x = mna.analyze(netlist);
H = mna.transferFunction(x);
ϕ = (ω) -> angle.(H(ω));
τg = (ω) -> derivative(ϕ, ω);

# Sample over Frequency
samples = 201;
f = range(1, stop=2e9, length=samples);
ω = 2π .* f;
tf = hcat(H.(ω)...);

# Get S-Parameters
S₁₁ = ((tf[2,:] ./ -tf[4,:]) .- Z₀) ./ ((tf[2,:] ./ -tf[4,:]) .+ Z₀);
S₂₁ = (tf[3,:] ./ tf[2,:]) .* (1 .+ S₁₁);

S₁₁dB = 20 .* log10.(abs.(S₁₁));
S₂₁dB = 20 .* log10.(abs.(S₂₁));

S₂₁ps = rad2deg.(angle.(S₂₁));

plot( f, S₂₁dB, lab="S₂₁ [dB]", w=1, minorgrid=true
    , xaxis=("f", (1e7, 3e9), :log10)
    , yaxis=("gain [dB]", (-60, 10)) );
plot!( f, S₁₁dB, lab="S₁₁ [dB]", w=1)

plot( f, S₂₁ps
     , lab="Phase S₂₁ (deg)", w=1
     , yaxis=("Phase S₂₁ [deg]")
     , xaxis=("f", (1e7, 3e9), :log10))

# Get Group Delay
groupDelay = -hcat(τg.(ω)...)[3,:];

plot( f, groupDelay
    , lab="Group Delay [s]", w=1
    , yaxis=("Group Delay [s]")
    , xaxis=("f", (1e7, 3e9), :log10))


text:
# ------------------------------------------------------------------------------------------
# # Julia for Data Science
#
# * Data
# * Data processing
# * **Visualization**
#
# ### Data visualization: generating nice looking plots in Julia is straight forward
# In what's next, we will see some of the tools that Julia plotting provides to produce high
# quality figures for your data.
# ------------------------------------------------------------------------------------------

# ------------------------------------------------------------------------------------------
# ## Part 1: plot math (specifically latex equations) in our plots
# ------------------------------------------------------------------------------------------

using LaTeXStrings
using Plots
pyplot()
x = 1:0.2:4

# ------------------------------------------------------------------------------------------
# Let's declare some variables that store the functions we want to plot written in LaTex
# ------------------------------------------------------------------------------------------

x2 = L"x^2"
logx = L"log(x)"
sqrtx = L"\sqrt{x}"

# ------------------------------------------------------------------------------------------
# Create three functions and plot them all!
# ------------------------------------------------------------------------------------------

y1 = sqrt.(x)
y2 = log.(x)
y3 = x.^2

f1 = plot(x,y1,legend = false)
plot!(f1, x,y2) # "plot!" means "plot on the same canvas we just plotted on"
plot!(f1, x,y3)
title!("Plot $x2 vs. $logx vs. $sqrtx")

# ------------------------------------------------------------------------------------------
# Now we can annotate each of these curves using either text, or latex strings
# ------------------------------------------------------------------------------------------

annotate!(f1,[(x[6],y1[6],text(sqrtx,16,:center)),
          (x[11],y2[11],text(logx,:right,16)),
          (x[6],y3[6],text(x2,16))])

# ------------------------------------------------------------------------------------------
# Yay! Now you can convince a little child that x^2 grows much faster than sqrt(x)
# ------------------------------------------------------------------------------------------

# ------------------------------------------------------------------------------------------
# ## Part 2: Stat Plots.
#
# 2D histograms are really easy!
# ------------------------------------------------------------------------------------------

n = 1000
set1 = randn(n)
set2 = randn(n)
histogram2d(set1,set2,nbins=20,colorbar=true)

# ------------------------------------------------------------------------------------------
# **Let's go back to our houses dataset and learn even more things about it!**
# ------------------------------------------------------------------------------------------

using DataFrames
houses = readtable("houses.csv")
filter_houses = houses[houses[!, :sq__ft].>0,:]
x = filter_houses[!, :sq__ft]
y = filter_houses[!, :price]

gh = histogram2d(x,y,nbins=20,colorbar=true)
xaxis!(gh,"square feet")
yaxis!(gh,"price")

# ------------------------------------------------------------------------------------------
# Interesting!
#
# Most houses sold are in the range 1000-1500 and they cost approximately 150,000 dollars
# ------------------------------------------------------------------------------------------

# ------------------------------------------------------------------------------------------
# *Let's see more stats plots.*
#
# We can convince ourselves that random distrubutions are indeed very similar.
#
# Let's do that through **box plots** and **violin plots**.
# ------------------------------------------------------------------------------------------

using StatsPlots

y = rand(10000,6) # generate 6 random samples of size 1000 each
f2 = violin(["Series 1" "Series 2" "Series 3" "Series 4" "Series 5"], y, leg=false, color=:red)

boxplot!(["Series 1" "Series 2" "Series 3" "Series 4" "Series 5"],y,leg=false,color=:green)

# ------------------------------------------------------------------------------------------
# These plots look almost identical, so we do have the same distribution indeed.
#
# Let's study the price distributions in different cities in the houses dataset.
# ------------------------------------------------------------------------------------------

some_cities = ["SACRAMENTO","RANCHO CORDOVA","RIO LINDA","CITRUS HEIGHTS","NORTH HIGHLANDS","ANTELOPE","ELK GROVE","ELVERTA" ] # try picking pther cities!

fh = plot(xrotation=90)
for ucity in some_cities
    subs = filter_houses[filter_houses[!, :city].==ucity,:]
    city_prices = subs[!, :price]
    violin!(fh,[ucity],city_prices,leg=false)
end
display(fh)

# ------------------------------------------------------------------------------------------
# ## Part 3: Subplots are very easy!
#
# You can create your own layout as follows.
# ------------------------------------------------------------------------------------------

mylayout = @layout([a{0.5h};[b{0.7w} c]])
plot(fh,f2,gh,layout=mylayout,legend=false)

# this layout:
# 1
# 2 3

# ------------------------------------------------------------------------------------------
# ## Part 4: Bonus plot, XKCD kind of plots with PyPlot
#
# Let's load `PyPlot` and create some data.
# ------------------------------------------------------------------------------------------

using PyPlot
x = 1:100;
y = vcat(ones(Int,20),1:10,10*ones(70));

xkcd()
fig = figure()
ax = PyPlot.axes()
p = PyPlot.plot(x,y)
annotate("some \n caption",xy=[30;10],arrowprops=Dict("arrowstyle"=>"->"),xytext=[40;7])

# ------------------------------------------------------------------------------------------
# Modify the plot parameters:
# ------------------------------------------------------------------------------------------

xticks([])
yticks([])
xlabel("index")
ylabel("value")
title("our first xkcd plot")

ax.spines["top"].set_color("none")
ax.spines["right"].set_color("none")
ax.spines["left"].set_color("none")
ax.spines["bottom"].set_color("none")

fig.canvas.draw()

# ------------------------------------------------------------------------------------------
# And finally, display the figure!
# ------------------------------------------------------------------------------------------

display(fig)

# ------------------------------------------------------------------------------------------
# ### Please let us know how we're doing!
#
# https://tinyurl.com/JuliaDataScience
# ------------------------------------------------------------------------------------------

max_stars_repo_path: .nbexports/introductory-tutorials/broader-topics-and-ecosystem/intro-to-julia-for-data-science/3. Julia for Data Science - Plotting.jl

max_stars_repo_name: grenkoca/JuliaTutorials

max_issues_repo_name: grenkoca/JuliaTutorials

max_forks_repo_name: grenkoca/JuliaTutorials


text:
using JuMP, Ipopt, MathProgComplex, Ipopt

function main()
    WB2 = Problem()

    VOLT1_Im = MathProgComplex.Variable("VOLT1_Im", Real)
    VOLT1_Re = MathProgComplex.Variable("VOLT1_Re", Real)
    VOLT2_Im = MathProgComplex.Variable("VOLT2_Im", Real)
    VOLT2_Re = MathProgComplex.Variable("VOLT2_Re", Real)

    set_objective!(WB2, (192.3076923076923)*VOLT1_Im^2 + (-192.3076923076923)*VOLT1_Im * VOLT2_Im + (961.5384615384615)*VOLT1_Im * VOLT2_Re + (192.3076923076923)*VOLT1_Re^2 + (-961.5384615384615)*VOLT1_Re * VOLT2_Im + (-192.3076923076923)*VOLT1_Re * VOLT2_Re)

    add_constraint!(WB2, "BaseCase_1_BALANCE-UNIT_Im", -400.0 << ((480.7692307692308)*VOLT1_Im^2 + (-480.7692307692308)*VOLT1_Im * VOLT2_Im + (-96.15384615384615)*VOLT1_Im * VOLT2_Re + (480.7692307692308)*VOLT1_Re^2 + (96.15384615384615)*VOLT1_Re * VOLT2_Im + (-480.7692307692308)*VOLT1_Re * VOLT2_Re) << 400.0)
    add_constraint!(WB2, "BaseCase_1_BALANCE-UNIT_Re", 0.0 << ((96.15384615384615)*VOLT1_Im^2 + (-96.15384615384615)*VOLT1_Im * VOLT2_Im + (480.7692307692308)*VOLT1_Im * VOLT2_Re + (96.15384615384615)*VOLT1_Re^2 + (-480.7692307692308)*VOLT1_Re * VOLT2_Im + (-96.15384615384615)*VOLT1_Re * VOLT2_Re) << 600.0)
    add_constraint!(WB2, "BaseCase_1_Volt_VOLTM_Re", 0.9025 << (VOLT1_Im^2 + VOLT1_Re^2) << 1.1025)
    add_constraint!(WB2, "BaseCase_2_BALANCE-LOAD_Im", -350.0 + (-480.7692307692308)*VOLT1_Im * VOLT2_Im + (96.15384615384615)*VOLT1_Im * VOLT2_Re + (-96.15384615384615)*VOLT1_Re * VOLT2_Im + (-480.7692307692308)*VOLT1_Re * VOLT2_Re + (480.7692307692308)*VOLT2_Im^2 + (480.7692307692308)*VOLT2_Re^2 == 0.0)
    add_constraint!(WB2, "BaseCase_2_BALANCE-LOAD_Re", 350.0 + (-96.15384615384615)*VOLT1_Im * VOLT2_Im + (-480.7692307692308)*VOLT1_Im * VOLT2_Re + (480.7692307692308)*VOLT1_Re * VOLT2_Im + (-96.15384615384615)*VOLT1_Re * VOLT2_Re + (96.15384615384615)*VOLT2_Im^2 + (96.15384615384615)*VOLT2_Re^2 == 0.0)
    add_constraint!(WB2, "BaseCase_2_Volt_VOLTM_Re", 0.9025 << (VOLT2_Im^2 + VOLT2_Re^2) << 1.056784)

    print(WB2)

    # mysolver = KnitroSolver(KTR_PARAM_OUTLEV=3,
    #                       KTR_PARAM_MAXIT=600,
    #                       KTR_PARAM_SCALE=0,
    #                       KTR_PARAM_FEASTOL=1.0,
    #                       KTR_PARAM_OPTTOL=1.0,
    #                       KTR_PARAM_FEASTOLABS=1e-8,
    #                       KTR_PARAM_OPTTOLABS=1e-6)
    #                     #   KTR_PARAM_BAR_INITPT=2,
    #                     #   KTR_PARAM_PRESOLVE=0,
    #                     #   KTR_PARAM_HONORBNDS=0)

    mysolver = IpoptSolver()

    m, variables_jump, ctr_jump, ctr_exp = get_JuMP_cartesian_model(WB2, mysolver)

    solve(m)

end

main()


text:
using BenchmarkTools
using DelimitedFiles
import CUDAdrv

include("kernels.jl")

#########
# setup #
#########

# make sure we collect CuArrays from previous iterations
BenchmarkTools.DEFAULT_PARAMETERS.gcsample = true

function pretty_print_time(s)
    (unit, factor) = if s < 1e-6
        ("n", 1e9)
    elseif s < 1e-3
        ("u", 1e6)
    elseif s < 1
        ("m", 1e3)
    else
        ("", 1)
    end
    @sprintf("%.2f %ss", factor*s, unit)
end

#############
# execution #
#############

println("### Benchmarking HMLSTM Kernels")
hmlstm_rows = Any[["TF-style?", "on GPU?", "size", "time"]]
for tfstyle in (false, true)
    for usegpu in (false, true)
        for dims in (2^i for i in 9:11)
            println("benchmarking tfstyle=", tfstyle, "; usegpu=", usegpu, "; dims=", dims)
            kernel!, inputs, derivs, buffers = get_hmlstm_kernel(tfstyle, usegpu, dims)
            time = @belapsed ($kernel!($inputs, $derivs, $buffers); CUDAdrv.synchronize()) evals=1
            push!(hmlstm_rows, Any[tfstyle, usegpu, dims, time])
            println("\ttime:  ", pretty_print_time(time))
        end
    end
end

println("### Benchmarking Arity-Scaling Kernels")
arity_scaling_rows = Any[["on GPU?", "size", "arity", "time"]]
for usegpu in (false, true)
    for dims in (2^i for i in 9:11)
        for arity in 1:10
            println("benchmarking usegpu=", usegpu, "; dims=", dims, "; arity=", arity)
            kernel!, inputs, derivs, buffers = get_arity_scaling_kernel(usegpu, dims, arity)
            time = @belapsed ($kernel!($inputs, $derivs, $buffers); CUDAdrv.synchronize()) evals=1
            push!(arity_scaling_rows, Any[usegpu, dims, arity, time])
            println("\ttime:  ", pretty_print_time(time))
        end
    end
end

##################
# writing output #
##################

function generate_output!(filename, rows, ncols)
    writedlm(joinpath(@__DIR__, filename), rows, ',')
    for row in rows[2:end]
        row[end] = pretty_print_time(row[end])
    end
    format = [:c for i in 1:ncols]
    format[1] = :r
    return Markdown.MD(Markdown.Table(rows, format))
end

println(generate_output!("hmlstm_timings.csv", hmlstm_rows, 4))

println(generate_output!("arity_scaling_timings.csv", arity_scaling_rows, 4))


text:
# Example for basic 3D modeling:
# The receiver positions and the source wavelets are the same for each of the four experiments.
# Author: Philipp Witte, pwitte@eos.ubc.ca
# Date: January 2017
#

using Pkg; Pkg.activate("JUDI")
using JUDI.TimeModeling

## Set up model structure
n = (120, 100, 90)    # (x,y,z) or (x,z)
d = (10., 10., 10.)
o = (0., 0., 0.)

# Velocity [km/s]
v = ones(Float32,n) .* 1.4f0
v0 = ones(Float32,n) .* 1.4f0
v[:, :, Int(round(end/2)):end] .= 4.0f0
rho = ones(Float32, n)

# Slowness squared [s^2/km^2]
m = (1f0 ./ v).^2
m0 = (1f0 ./ v0).^2
dm = vec(m - m0)

# Setup info and model structure
nsrc = 4
model = Model(n, d, o, m)  # to include density call Model(n,d,o,m,rho)
model0 = Model(n, d, o, m0)

## Set up 3D receiver geometry by defining one receiver vector in each x and y direction
nxrec = 120
nyrec = 100
xrec = range(50f0, stop=1150f0, length=nxrec)
yrec = range(100f0, stop=900f0, length=nyrec)
zrec = 50f0

# Construct 3D grid from basis vectors
(xrec, yrec, zrec) = setup_3D_grid(xrec, yrec, zrec)

# receiver sampling and recording time
timeR = 100f0   # receiver recording time [ms]
dtR = 4f0    # receiver sampling interval

# Set up receiver structure
recGeometry = Geometry(xrec, yrec, zrec; dt=dtR, t=timeR, nsrc=nsrc)

## Set up source geometry (cell array with source locations for each shot)
xsrc = convertToCell([250f0, 500f0, 750f0, 1000f0])
ysrc = convertToCell([200f0, 400f0, 600f0, 800f0])
zsrc = convertToCell([50f0, 60f0, 70f0, 80f0])

# source sampling and number of time steps
timeS = 100f0   # source length in [ms]
dtS = 2f0    # source sampling interval

# Set up source structure
srcGeometry = Geometry(xsrc, ysrc, zsrc; dt=dtS, t=timeS)

# setup wavelet
f0 = 0.01f0
wavelet = ricker_wavelet(timeS, dtS, f0)

# Info structure for linear operators
ntComp = get_computational_nt(srcGeometry, recGeometry, model)    # no. of computational time steps
info = Info(prod(n), nsrc, ntComp)

###################################################################################################

# Enable optimal checkpointing
opt = Options(optimal_checkpointing=true)

# Setup operators
Pr = judiProjection(info, recGeometry)
F = judiModeling(info, model)
Ps = judiProjection(info, srcGeometry)
q = judiVector(srcGeometry, wavelet)

# Nonlinear modeling
dobs = Pr*F*adjoint(Ps)*q
qad = Ps*F*adjoint(Pr)*dobs

# Linearied modeling
F0 = judiModeling(info, model0) # modeling operator for background model
J = judiJacobian(Pr*F0*adjoint(Ps), q)
dD = J*dm
rtm = adjoint(J)*dD

# evaluate FWI objective function
f, g = fwi_objective(model0, q, dobs; options=opt)


text:
function Base.tryparse(::Type{InfExtendedTime{T}}, str::AbstractString) where T
  val = tryparse(Infinite, str)
  if val === nothing
    val = tryparse(T, str)
  end
  return val !== nothing ? InfExtendedTime{T}(val) : nothing
end

function Base.parse(::Type{InfExtendedTime{T}}, str::AbstractString) where T
  val = tryparse(InfExtendedTime{T}, str)
  if val === nothing
    throw(ArgumentError("Unable to parse \"$str\" as $(InfExtendedTime{T})"))
  end
  return val
end


text:
using KernelRidgeRegression
using Plots
using BenchmarkTools
# using Gadfly
# @everywhere using ParallelDataTransfer

N = 5000
x = rand(1, N) * 4π .- 2π
yy = sinc.(x) # vec(sinc.(4 .* x) .+ 0.2 .* sin.(30 .* x))
y = dropdims(yy + 0.1 * randn(1, N), dims=1)
# xnew = collect(-2.5π:0.01:2.5π)'
xnew = reshape(collect(-2.5π:0.01:2.5π), 1, :)
# xnew = reshape(collect(-2.5π:π / 1000:2.5π), 1, :)
# sendto(workers(), x = x, y = y)

println("KRR")
# BLAS.set_num_threads(2)
mykrr = KernelRidgeRegression.fit(KernelRidgeRegression.KRR, x, y, 1e-3 / 5000, KernelFunctions.GaussianKernel())
ynew = KernelRidgeRegression.predict(mykrr, xnew)
@btime mykrr = KernelRidgeRegression.fit(KernelRidgeRegression.KRR, x, y, 1e-3 / 5000, KernelFunctions.GaussianKernel())
@btime ynew = KernelRidgeRegression.predict(mykrr, xnew)

println("fastKRR")
myfastkrr = KernelRidgeRegression.fit(KernelRidgeRegression.FastKRR, x, y, 4 / 5000, 10, KernelFunctions.GaussianKernel())
yfastnew = KernelRidgeRegression.predict(myfastkrr, xnew)
@btime myfastkrr = KernelRidgeRegression.fit(KernelRidgeRegression.FastKRR, x, y, 4 / 5000, 10, KernelFunctions.GaussianKernel())
@btime yfastnew = KernelRidgeRegression.predict(myfastkrr, xnew)

println("ParFastKRR")
# BLAS.set_num_threads(1)
myparfastkrr = KernelRidgeRegression.fitPar(
    KernelRidgeRegression.FastKRR,
    N,
    i->x[:,i], i->y[i],
    4 / 5000, 10,
    KernelFunctions.GaussianKernel()
)
yparfastnew = KernelRidgeRegression.predict(myfastkrr, xnew)
@btime myparfastkrr = KernelRidgeRegression.fitPar(
    KernelRidgeRegression.FastKRR, N,
    i->x[:,i], i->y[i],
    4 / 5000, 10,
    KernelFunctions.GaussianKernel()
)
@btime yparfastnew = KernelRidgeRegression.predict(myfastkrr, xnew)

# draw(SVG("test.svg", 20cm, 20cm), plot(
#     layer(x=xnew, y=yparfastnew, Geom.line, Theme(default_color=colorant"red")),
#     layer(x=xnew, y=yfastnew,    Geom.line, Theme(default_color=colorant"purple")),
#     layer(x=xnew, y=ynew,        Geom.line, Theme(default_color=colorant"green")),
#     layer(x=x,    y=y,           Geom.line, Theme(default_color=colorant"blue")),
#     Coord.cartesian(ymin=-1.5, ymax=1.5),
#     Guide.manual_color_key(
#         "Method",
#         ["Data",         "KRR",           "FastKRR",        "ParFastKRR" ],
#         [colorant"blue", colorant"green", colorant"purple", colorant"red"]
#     )
# ))

scatter(x', y)
scatter!(xnew', ynew)
scatter!(xnew', yfastnew)
scatter!(xnew', yparfastnew)


text:
# Initialization

"""
Initialize the CUDA driver API.

This function is automatically called upon loading the package. You should not have to call
this manually.
"""
function init(flags::Int=0)
    @apicall(:cuInit, (Cint,), flags)
end

function __init__()
    configured || return

    if !ispath(libcuda) || version() != libcuda_version
        error("CUDA driver library has changed. Please run Pkg.build(\"CUDAdrv\") and restart Julia.")
    end

    if haskey(ENV, "_") && basename(ENV["_"]) == "rr"
        @warn "Running under rr, which is incompatible with CUDA; disabling initialization."
    else
        init()
    end
end


text:
@testset "" begin
    rng = StableRNG(123)
    env = GraphShortestPathEnv(rng)

    RLBase.test_interfaces!(env)
    RLBase.test_runnable!(env)

end