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

@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^5, x) == :(x*a^2*c^5+-1*a^2*c^5*f^-1*tan(e+f*x)+-19//16*a^2*c^5*f^-1*arctanh(sin(e+f*x))+1//3*a^2*c^5*f^-1*tan(e+f*x)^3+3//5*a^2*c^5*f^-1*tan(e+f*x)^5+-3//4*a^2*c^5*f^-1*tan(e+f*x)^3*sec(e+f*x)+-1//6*a^2*c^5*f^-1*sec(e+f*x)^3*tan(e+f*x)^3+1//8*a^2*c^5*f^-1*sec(e+f*x)^3*tan(e+f*x)+17//16*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, x) == :(x*a^2*c^4+-1*a^2*c^4*f^-1*tan(e+f*x)+-3//4*a^2*c^4*f^-1*arctanh(sin(e+f*x))+1//3*a^2*c^4*f^-1*tan(e+f*x)^3+1//5*a^2*c^4*f^-1*tan(e+f*x)^5+-1//2*a^2*c^4*f^-1*tan(e+f*x)^3*sec(e+f*x)+3//4*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, x) == :(x*a^2*c^3+-3//8*a^2*c^3*f^-1*arctanh(sin(e+f*x))+-1//8*a^2*f^-1*(8*c^3+-3*c^3*sec(e+f*x))*tan(e+f*x)+1//12*a^2*f^-1*tan(e+f*x)^3*(4*c^3+-3*c^3*sec(e+f*x)))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^2, x) == :(x*a^2*c^2+-1*a^2*c^2*f^-1*tan(e+f*x)+1//3*a^2*c^2*f^-1*tan(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x)), x) == :(c*x*a^2+(1/2)*c*a^2*f^-1*arctanh(sin(e+f*x))+-1//2*c*f^-1*(2*a^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))^-1, x) == :(x*a^2*c^-1+-1*a^2*c^-1*f^-1*arctanh(sin(e+f*x))+-4*a^2*c^-1*f^-1*(1+-1*sec(e+f*x))^-1*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-2, x) == :(x*a^2*c^-2+-4//3*a^2*c^-2*f^-1*(1+-1*sec(e+f*x))^-1*tan(e+f*x)+-4//3*a^2*c^-2*f^-1*(1+-1*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))^-3, x) == :(x*a^2*c^-3+-23//15*a^2*c^-3*f^-1*(1+-1*sec(e+f*x))^-1*tan(e+f*x)+-8//15*a^2*c^-3*f^-1*(1+-1*sec(e+f*x))^-2*tan(e+f*x)+-4//5*a^2*c^-3*f^-1*(1+-1*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, x) == :(x*a^2*c^-4+-164//105*a^2*c^-4*f^-1*(1+-1*sec(e+f*x))^-1*tan(e+f*x)+-59//105*a^2*c^-4*f^-1*(1+-1*sec(e+f*x))^-2*tan(e+f*x)+-12//35*a^2*c^-4*f^-1*(1+-1*sec(e+f*x))^-3*tan(e+f*x)+-4//7*a^2*c^-4*f^-1*(1+-1*sec(e+f*x))^-4*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^2*(c+-1*c*sec(e+f*x))^-5, x) == :(x*a^2*c^-5+-494//315*a^2*c^-5*f^-1*(1+-1*sec(e+f*x))^-1*tan(e+f*x)+-179//315*a^2*c^-5*f^-1*(1+-1*sec(e+f*x))^-2*tan(e+f*x)+-37//105*a^2*c^-5*f^-1*(1+-1*sec(e+f*x))^-3*tan(e+f*x)+-16//63*a^2*c^-5*f^-1*(1+-1*sec(e+f*x))^-4*tan(e+f*x)+-4//9*a^2*c^-5*f^-1*(1+-1*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))^5, x) == :(x*a^3*c^5+-1*a^3*c^5*f^-1*tan(e+f*x)+-5//8*a^3*c^5*f^-1*arctanh(sin(e+f*x))+-1//5*a^3*c^5*f^-1*tan(e+f*x)^5+-1//7*a^3*c^5*f^-1*tan(e+f*x)^7+1//3*a^3*c^5*f^-1*tan(e+f*x)^3+-5//12*a^3*c^5*f^-1*tan(e+f*x)^3*sec(e+f*x)+1//3*a^3*c^5*f^-1*tan(e+f*x)^5*sec(e+f*x)+5//8*a^3*c^5*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))^4, x) == :(x*a^3*c^4+-5//16*a^3*c^4*f^-1*arctanh(sin(e+f*x))+-1//16*a^3*f^-1*(16*c^4+-5*c^4*sec(e+f*x))*tan(e+f*x)+-1//30*a^3*f^-1*tan(e+f*x)^5*(6*c^4+-5*c^4*sec(e+f*x))+1//24*a^3*f^-1*tan(e+f*x)^3*(8*c^4+-5*c^4*sec(e+f*x)))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^3, x) == :(x*a^3*c^3+-1*a^3*c^3*f^-1*tan(e+f*x)+-1//5*a^3*c^3*f^-1*tan(e+f*x)^5+1//3*a^3*c^3*f^-1*tan(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^2, x) == :(x*a^3*c^2+-1//8*c^2*f^-1*(8*a^3+3*a^3*sec(e+f*x))*tan(e+f*x)+1//12*c^2*f^-1*tan(e+f*x)^3*(4*a^3+3*a^3*sec(e+f*x))+3//8*a^3*c^2*f^-1*arctanh(sin(e+f*x)))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x)), x) == :(c*x*a^3+c*a^3*f^-1*arctanh(sin(e+f*x))+-1*c*a^3*f^-1*tan(e+f*x)+-1//3*c*a^3*f^-1*tan(e+f*x)^3+-1*c*a^3*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))^-1, x) == :(x*a^3*c^-1+-1*a^3*c^-1*f^-1*tan(e+f*x)+-4*a^3*c^-1*f^-1*arctanh(sin(e+f*x))+8*a^3*c^-1*f^-1*cot(e+f*x)+8*a^3*c^-1*f^-1*csc(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-2, x) == :(x*a^3*c^-2+a^3*c^-2*f^-1*arctanh(sin(e+f*x))+-8//3*a^3*c^-2*f^-1*(1+-1*sec(e+f*x))^-2*tan(e+f*x)+4//3*a^3*c^-2*f^-1*(1+-1*sec(e+f*x))^-1*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3*(c+-1*c*sec(e+f*x))^-3, x) == :(x*a^3*c^-3+-26//15*a^3*c^-3*f^-1*(1+-1*sec(e+f*x))^-1*tan(e+f*x)+-8//5*a^3*c^-3*f^-1*(1+-1*sec(e+f*x))^-3*tan(e+f*x)+4//15*a^3*c^-3*f^-1*(1+-1*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))^-4, x) == :(x*a^3*c^-4+-167//105*a^3*c^-4*f^-1*(1+-1*sec(e+f*x))^-1*tan(e+f*x)+-62//105*a^3*c^-4*f^-1*(1+-1*sec(e+f*x))^-2*tan(e+f*x)+-8//7*a^3*c^-4*f^-1*(1+-1*sec(e+f*x))^-4*tan(e+f*x)+4//35*a^3*c^-4*f^-1*(1+-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))^-5, x) == :(x*a^3*c^-5+-496//315*a^3*c^-5*f^-1*(1+-1*sec(e+f*x))^-1*tan(e+f*x)+-181//315*a^3*c^-5*f^-1*(1+-1*sec(e+f*x))^-2*tan(e+f*x)+-38//105*a^3*c^-5*f^-1*(1+-1*sec(e+f*x))^-3*tan(e+f*x)+-8//9*a^3*c^-5*f^-1*(1+-1*sec(e+f*x))^-5*tan(e+f*x)+4//63*a^3*c^-5*f^-1*(1+-1*sec(e+f*x))^-4*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^4, x) == :(x*a^-2*c^4+a^-2*c^4*f^-1*tan(e+f*x)+-16*a^-2*c^4*f^-1*cot(e+f*x)+-6*a^-2*c^4*f^-1*arctanh(sin(e+f*x))+-32//3*a^-2*c^4*f^-1*cot(e+f*x)^3+32//3*a^-2*c^4*f^-1*csc(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^3, x) == :(x*a^-2*c^3+-1*a^-2*c^3*f^-1*arctanh(sin(e+f*x))+-8//3*a^-2*c^3*f^-1*(1+sec(e+f*x))^-2*tan(e+f*x)+4//3*a^-2*c^3*f^-1*(1+sec(e+f*x))^-1*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^2, x) == :(x*a^-2*c^2+-4//3*a^-2*c^2*f^-1*(1+sec(e+f*x))^-1*tan(e+f*x)+-4//3*a^-2*c^2*f^-1*(1+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)), x) == :(c*x*a^-2+-5//3*c*a^-2*f^-1*(1+sec(e+f*x))^-1*tan(e+f*x)+-2//3*c*a^-2*f^-1*(1+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))^-1, x) == :(x*a^-2*c^-1+-1//3*a^-2*c^-1*f^-1*cot(e+f*x)^3*(1+-1*sec(e+f*x))+1//3*a^-2*c^-1*f^-1*(3+-2*sec(e+f*x))*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-2, x) == :(x*a^-2*c^-2+a^-2*c^-2*f^-1*cot(e+f*x)+-1//3*a^-2*c^-2*f^-1*cot(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-3, x) == :(x*a^-2*c^-3+-1//15*a^-2*c^-3*f^-1*cot(e+f*x)^3*(5+4*sec(e+f*x))+1//5*a^-2*c^-3*f^-1*cot(e+f*x)^5*(1+sec(e+f*x))+1//15*a^-2*c^-3*f^-1*(15+8*sec(e+f*x))*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^-2*(c+-1*c*sec(e+f*x))^-4, x) == :(x*a^-2*c^-4+a^-2*c^-4*f^-1*cot(e+f*x)+-2*a^-2*c^-4*f^-1*csc(e+f*x)^3+2*a^-2*c^-4*f^-1*csc(e+f*x)+-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+-1//3*a^-2*c^-4*f^-1*cot(e+f*x)^3+1//5*a^-2*c^-4*f^-1*cot(e+f*x)^5+6//5*a^-2*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, x) == :(x*a^-2*c^-5+a^-2*c^-5*f^-1*cot(e+f*x)+3*a^-2*c^-5*f^-1*csc(e+f*x)+-15//7*a^-2*c^-5*f^-1*csc(e+f*x)^7+-13//3*a^-2*c^-5*f^-1*csc(e+f*x)^3+-1//3*a^-2*c^-5*f^-1*cot(e+f*x)^3+-1//7*a^-2*c^-5*f^-1*cot(e+f*x)^7+1//5*a^-2*c^-5*f^-1*cot(e+f*x)^5+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+21//5*a^-2*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))^5, x) == :(x*a^-3*c^5+-1*a^-3*c^5*f^-1*tan(e+f*x)+-16*a^-3*c^5*f^-1*csc(e+f*x)+8*a^-3*c^5*f^-1*arctanh(sin(e+f*x))+32*a^-3*c^5*f^-1*cot(e+f*x)+-128//5*a^-3*c^5*f^-1*csc(e+f*x)^5+64//3*a^-3*c^5*f^-1*csc(e+f*x)^3+128//3*a^-3*c^5*f^-1*cot(e+f*x)^3+128//5*a^-3*c^5*f^-1*cot(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^4, x) == :(x*a^-3*c^4+a^-3*c^4*f^-1*arctanh(sin(e+f*x))+-3*a^-3*c^4*f^-1*(1+sec(e+f*x))^-3*tan(e+f*x)+-23//5*a^-3*c^4*f^-1*(1+sec(e+f*x))^-1*tan(e+f*x)+14//5*a^-3*c^4*f^-1*(1+sec(e+f*x))^-2*tan(e+f*x)+-1//5*a^-3*c^4*f^-1*(1+sec(e+f*x))^-3*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, x) == :(x*a^-3*c^3+-26//15*a^-3*c^3*f^-1*(1+sec(e+f*x))^-1*tan(e+f*x)+-8//5*a^-3*c^3*f^-1*(1+sec(e+f*x))^-3*tan(e+f*x)+4//15*a^-3*c^3*f^-1*(1+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, x) == :(x*a^-3*c^2+-23//15*a^-3*c^2*f^-1*(1+sec(e+f*x))^-1*tan(e+f*x)+-8//15*a^-3*c^2*f^-1*(1+sec(e+f*x))^-2*tan(e+f*x)+-4//5*a^-3*c^2*f^-1*(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)), x) == :(c*x*a^-3+-8//5*c*a^-3*f^-1*(1+sec(e+f*x))^-1*tan(e+f*x)+-3//5*c*a^-3*f^-1*(1+sec(e+f*x))^-2*tan(e+f*x)+-2//5*c*a^-3*f^-1*(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, x) == :(x*a^-3*c^-1+a^-3*c^-1*f^-1*cot(e+f*x)+-2*a^-3*c^-1*f^-1*csc(e+f*x)+-2//5*a^-3*c^-1*f^-1*csc(e+f*x)^5+-1//3*a^-3*c^-1*f^-1*cot(e+f*x)^3+2//5*a^-3*c^-1*f^-1*cot(e+f*x)^5+4//3*a^-3*c^-1*f^-1*csc(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-2, x) == :(x*a^-3*c^-2+-1//15*a^-3*c^-2*f^-1*cot(e+f*x)^3*(5+-4*sec(e+f*x))+1//5*a^-3*c^-2*f^-1*cot(e+f*x)^5*(1+-1*sec(e+f*x))+1//15*a^-3*c^-2*f^-1*(15+-8*sec(e+f*x))*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-3, x) == :(x*a^-3*c^-3+a^-3*c^-3*f^-1*cot(e+f*x)+-1//3*a^-3*c^-3*f^-1*cot(e+f*x)^3+1//5*a^-3*c^-3*f^-1*cot(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-4, x) == :(x*a^-3*c^-4+-1//7*a^-3*c^-4*f^-1*cot(e+f*x)^7*(1+sec(e+f*x))+-1//105*a^-3*c^-4*f^-1*cot(e+f*x)^3*(35+24*sec(e+f*x))+1//35*a^-3*c^-4*f^-1*cot(e+f*x)^5*(7+6*sec(e+f*x))+1//35*a^-3*c^-4*f^-1*(35+16*sec(e+f*x))*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3*(c+-1*c*sec(e+f*x))^-5, x) == :(x*a^-3*c^-5+a^-3*c^-5*f^-1*cot(e+f*x)+2*a^-3*c^-5*f^-1*csc(e+f*x)+-8//3*a^-3*c^-5*f^-1*csc(e+f*x)^3+-8//7*a^-3*c^-5*f^-1*csc(e+f*x)^7+-1//3*a^-3*c^-5*f^-1*cot(e+f*x)^3+-1//7*a^-3*c^-5*f^-1*cot(e+f*x)^7+1//5*a^-3*c^-5*f^-1*cot(e+f*x)^5+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+12//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, x) == :(x*a^-3*c^-6+a^-3*c^-6*f^-1*cot(e+f*x)+3*a^-3*c^-6*f^-1*csc(e+f*x)+-36//7*a^-3*c^-6*f^-1*csc(e+f*x)^7+-16//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//3*a^-3*c^-6*f^-1*cot(e+f*x)^3+-1//7*a^-3*c^-6*f^-1*cot(e+f*x)^7+1//5*a^-3*c^-6*f^-1*cot(e+f*x)^5+1//9*a^-3*c^-6*f^-1*cot(e+f*x)^9+19//9*a^-3*c^-6*f^-1*csc(e+f*x)^9+34//5*a^-3*c^-6*f^-1*csc(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^4, x) == :(2*a^(1/2)*c^4*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a*c^4*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-2//5*a^3*c^4*f^-1*(a+a*sec(e+f*x))^-5//2*tan(e+f*x)^5+2//3*a^2*c^4*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3+2//7*a^4*c^4*f^-1*(a+a*sec(e+f*x))^-7//2*tan(e+f*x)^7)
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^3, x) == :(2*a^(1/2)*c^3*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-2//5*a^3*c^3*f^-1*(a+a*sec(e+f*x))^-5//2*tan(e+f*x)^5+2//3*a^2*c^3*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^2, x) == :(2*a^(1/2)*c^2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+2//3*a^2*c^2*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x)), x) == :(2*c*a^(1/2)*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a*c*f^-1*(a+a*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, x) == :(2*a^(1/2)*c^-1*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2*c^-1*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-2, x) == :(2*a^(1/2)*c^-2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2*c^-2*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+-2//3*a^-1*c^-2*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-3, x) == :(2*a^(1/2)*c^-3*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2*c^-3*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+-2//3*a^-1*c^-3*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3+2//5*a^-2*c^-3*f^-1*(a+a*sec(e+f*x))^5//2*cot(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-4, x) == :(2*a^(1/2)*c^-4*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2*c^-4*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+-2//3*a^-1*c^-4*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3+-2//7*a^-3*c^-4*f^-1*(a+a*sec(e+f*x))^7//2*cot(e+f*x)^7+2//5*a^-2*c^-4*f^-1*(a+a*sec(e+f*x))^5//2*cot(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^3, x) == :(2*a^3//2*c^3*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a^2*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-2//5*a^4*c^3*f^-1*(a+a*sec(e+f*x))^-5//2*tan(e+f*x)^5+-2//7*a^5*c^3*f^-1*(a+a*sec(e+f*x))^-7//2*tan(e+f*x)^7+2//3*a^3*c^3*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^2, x) == :(2*a^3//2*c^2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a^2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+2//3*a^3*c^2*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3+2//5*a^4*c^2*f^-1*(a+a*sec(e+f*x))^-5//2*tan(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x)), x) == :(2*c*a^3//2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*c*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-2//3*c*a^3*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-1, x) == :(2*a^3//2*c^-1*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+4*a*c^-1*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-2, x) == :(2*a^3//2*c^-2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-4//3*c^-2*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3+2*a*c^-2*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-3, x) == :(2*a^3//2*c^-3*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2//3*c^-3*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3+2*a*c^-3*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+4//5*a^-1*c^-3*f^-1*(a+a*sec(e+f*x))^5//2*cot(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-4, x) == :(2*a^3//2*c^-4*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2//3*c^-4*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3+2*a*c^-4*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+-4//7*a^-2*c^-4*f^-1*(a+a*sec(e+f*x))^7//2*cot(e+f*x)^7+2//5*a^-1*c^-4*f^-1*(a+a*sec(e+f*x))^5//2*cot(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^3, x) == :(2*a^5//2*c^3*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a^3*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-6//7*a^6*c^3*f^-1*(a+a*sec(e+f*x))^-7//2*tan(e+f*x)^7+-2//5*a^5*c^3*f^-1*(a+a*sec(e+f*x))^-5//2*tan(e+f*x)^5+-2//9*a^7*c^3*f^-1*(a+a*sec(e+f*x))^-9//2*tan(e+f*x)^9+2//3*a^4*c^3*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^2, x) == :(2*a^5//2*c^2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a^3*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+2//3*a^4*c^2*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3+2//7*a^6*c^2*f^-1*(a+a*sec(e+f*x))^-7//2*tan(e+f*x)^7+6//5*a^5*c^2*f^-1*(a+a*sec(e+f*x))^-5//2*tan(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x)), x) == :(2*c*a^5//2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*c*a^3*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-2*c*a^4*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3+-2//5*c*a^5*f^-1*(a+a*sec(e+f*x))^-5//2*tan(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-1, x) == :(2*a^5//2*c^-1*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a^3*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+8*a^2*c^-1*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-2, x) == :(2*a^5//2*c^-2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-8//3*a*c^-2*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-3, x) == :(2*a^5//2*c^-3*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+8//5*c^-3*f^-1*(a+a*sec(e+f*x))^5//2*cot(e+f*x)^5+2*a^2*c^-3*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-4, x) == :(2*a^5//2*c^-4*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2*a^2*c^-4*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+-8//7*a^-1*c^-4*f^-1*(a+a*sec(e+f*x))^7//2*cot(e+f*x)^7+-2//3*a*c^-4*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^5//2*(c+-1*c*sec(e+f*x))^-5, x) == :(2*a^5//2*c^-5*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2//5*c^-5*f^-1*(a+a*sec(e+f*x))^5//2*cot(e+f*x)^5+2*a^2*c^-5*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+-2//3*a*c^-5*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3+8//9*a^-2*c^-5*f^-1*(a+a*sec(e+f*x))^9//2*cot(e+f*x)^9)
@test integrate((a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^4, x) == :(2*a^-1//2*c^4*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+14*c^4*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-16*2^(1/2)*a^-1//2*c^4*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a*c^4*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3+2//5*a^2*c^4*f^-1*(a+a*sec(e+f*x))^-5//2*tan(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^3, x) == :(2*a^-1//2*c^3*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+6*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-8*2^(1/2)*a^-1//2*c^3*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2//3*a*c^3*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3)
@test integrate((a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^2, x) == :(2*a^-1//2*c^2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-4*2^(1/2)*a^-1//2*c^2*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*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)), x) == :(2*c*a^-1//2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*c*2^(1/2)*a^-1//2*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*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, x) == :(2*a^-1//2*c^-1*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+a^-1*c^-1*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+-1//2*2^(1/2)*a^-1//2*c^-1*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*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))^-2, x) == :(2*a^-1//2*c^-2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-1//3*a^-2*c^-2*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3+-1//4*2^(1/2)*a^-1//2*c^-2*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+3//2*a^-1*c^-2*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-3, x) == :(2*a^-1//2*c^-3*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-1//2*a^-2*c^-3*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3+-1//8*2^(1/2)*a^-1//2*c^-3*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+1//5*a^-3*c^-3*f^-1*(a+a*sec(e+f*x))^5//2*cot(e+f*x)^5+7//4*a^-1*c^-3*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^4, x) == :(2*a^-3//2*c^4*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+8//3*c^4*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3+-14*a^-1*c^4*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+12*2^(1/2)*a^-3//2*c^4*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-1*a*c^4*f^-1*(a+a*sec(e+f*x))^-5//2*sec((1/2)*e+(1/2)*f*x)^2*tan(e+f*x)^4*sin(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^3, x) == :(2*a^-3//2*c^3*f^-1*arctan(a^(1/2)*(a+a*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*tan(e+f*x)+2*2^(1/2)*a^-3//2*c^3*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+c^3*f^-1*(a+a*sec(e+f*x))^-3//2*sec((1/2)*e+(1/2)*f*x)^2*tan(e+f*x)^2*sin(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^-1, x) == :(2*a^-3//2*c^-1*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-7//8*2^(1/2)*a^-3//2*c^-1*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+1//4*a^-2*c^-1*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+1//4*a^-2*c^-1*f^-1*(a+a*sec(e+f*x))^(1/2)*sec((1/2)*e+(1/2)*f*x)^2*cos(e+f*x)*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^-2, x) == :(2*a^-3//2*c^-2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-9//16*2^(1/2)*a^-3//2*c^-2*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+1//12*a^-3*c^-2*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3+7//8*a^-2*c^-2*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+-1//4*a^-3*c^-2*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3*sec((1/2)*e+(1/2)*f*x)^2*cos(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^-3, x) == :(2*a^-3//2*c^-3*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-11//32*2^(1/2)*a^-3//2*c^-3*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-5//24*a^-3*c^-3*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3+-3//20*a^-4*c^-3*f^-1*(a+a*sec(e+f*x))^5//2*cot(e+f*x)^5+21//16*a^-2*c^-3*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+1//4*a^-4*c^-3*f^-1*(a+a*sec(e+f*x))^5//2*cot(e+f*x)^5*sec((1/2)*e+(1/2)*f*x)^2*cos(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^5, x) == :(2*a^-5//2*c^5*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-23*2^(1/2)*a^-5//2*c^5*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+21*a^-2*c^5*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-19//6*a^-1*c^5*f^-1*(a+a*sec(e+f*x))^-3//2*tan(e+f*x)^3+3//4*c^5*f^-1*(a+a*sec(e+f*x))^-5//2*sec((1/2)*e+(1/2)*f*x)^2*tan(e+f*x)^4*sin(e+f*x)+1//4*a*c^5*f^-1*(a+a*sec(e+f*x))^-7//2*sec((1/2)*e+(1/2)*f*x)^4*sin(e+f*x)^2*tan(e+f*x)^5)
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^4, x) == :(2*a^-5//2*c^4*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-11//2*2^(1/2)*a^-5//2*c^4*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+7//2*a^-2*c^4*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-1//4*c^4*f^-1*(a+a*sec(e+f*x))^-5//2*sec((1/2)*e+(1/2)*f*x)^4*sin(e+f*x)^2*tan(e+f*x)^3+-1//4*a^-1*c^4*f^-1*(a+a*sec(e+f*x))^-3//2*sec((1/2)*e+(1/2)*f*x)^2*tan(e+f*x)^2*sin(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^3, x) == :(2*a^-5//2*c^3*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-7//4*2^(1/2)*a^-5//2*c^3*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-1//4*a^-2*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*sec((1/2)*e+(1/2)*f*x)^2*sin(e+f*x)+1//4*a^-1*c^3*f^-1*(a+a*sec(e+f*x))^-3//2*sec((1/2)*e+(1/2)*f*x)^4*sin(e+f*x)^2*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^2, x) == :(2*a^-5//2*c^2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-11//8*2^(1/2)*a^-5//2*c^2*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-3//8*a^-2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*sec((1/2)*e+(1/2)*f*x)^2*sin(e+f*x)+-1//4*a^-2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*sec((1/2)*e+(1/2)*f*x)^4*cos(e+f*x)*sin(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^-1, x) == :(2*a^-5//2*c^-1*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-71//64*2^(1/2)*a^-5//2*c^-1*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-7//32*a^-3*c^-1*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+1//16*a^-3*c^-1*f^-1*(a+a*sec(e+f*x))^(1/2)*cos(e+f*x)^2*sec((1/2)*e+(1/2)*f*x)^4*cot(e+f*x)+13//32*a^-3*c^-1*f^-1*(a+a*sec(e+f*x))^(1/2)*sec((1/2)*e+(1/2)*f*x)^2*cos(e+f*x)*cot(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+-1*c*sec(e+f*x))^-2, x) == :(2*a^-5//2*c^-2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-107//128*2^(1/2)*a^-5//2*c^-2*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+21//64*a^-3*c^-2*f^-1*(a+a*sec(e+f*x))^(1/2)*cot(e+f*x)+43//96*a^-4*c^-2*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3+-15//32*a^-4*c^-2*f^-1*(a+a*sec(e+f*x))^3//2*cot(e+f*x)^3*sec((1/2)*e+(1/2)*f*x)^2*cos(e+f*x)+-1//16*a^-4*c^-2*f^-1*(a+a*sec(e+f*x))^3//2*cos(e+f*x)^2*cot(e+f*x)^3*sec((1/2)*e+(1/2)*f*x)^4)
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^7//2, x) == :(-1*a*c^3*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*a*c^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//3*a*c*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^5//2*tan(e+f*x)+a*c^4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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, x) == :(-1*a*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*a*c*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+a*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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, x) == :(-1*a*c*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^(1/2)*tan(e+f*x)+a*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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))^(1/2), x) == :(a*c*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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))^-1//2, x) == :(a*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*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, 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)+a*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*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, 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)+-1*a*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*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*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))^-7//2, x) == :(-1//3*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*a*c^-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*a*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+a*c^-3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*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, x) == :(1//3*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)+-1*a^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*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^3//2*tan(e+f*x)+a^2*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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, x) == :((1/2)*a^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)^3+a^2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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))^(1/2), x) == :(-1*a*c*f^-1*(a+a*sec(e+f*x))^(1/2)*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+c*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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))^-1//2, x) == :(a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(cos(e+f*x))*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, x) == :(-2*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-3//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))^-1//2*log(1+-1*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, x) == :(-1*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)+-1*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^2*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*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))^-7//2, x) == :(-2//3*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)+-1*a^2*c^-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*a^2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+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+-1*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, x) == :((1/2)*a^3*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)^3+-1//4*a^3*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)^5+a^3*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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, x) == :(1//3*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)+-1*a^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*a*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)+a^3*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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))^(1/2), x) == :(-1*c*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)+-1//2*a*c*f^-1*(a+a*sec(e+f*x))^3//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+c*a^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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))^-1//2, x) == :(a^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(cos(e+f*x))*tan(e+f*x)+a^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x)*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, x) == :(-4*a^3*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^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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, x) == :(-2*a^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-5//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*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))^-7//2, x) == :(-4//3*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)+-1*a^3*c^-2*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^-3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*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))^-9//2, x) == :(-1*a^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-9//2*tan(e+f*x)+-1*a^3*c^-3*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*a^3*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+a^3*c^-4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*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))^-11//2, x) == :(-4//5*a^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-11//2*tan(e+f*x)+-1*a^3*c^-4*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*a^3*c^-3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-5//2*tan(e+f*x)+-1//3*a^3*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-7//2*tan(e+f*x)+a^3*c^-5*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*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))^7//2, x) == :(c^4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(cos(e+f*x))*tan(e+f*x)+(1/2)*c^4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x)^2*tan(e+f*x)+-4*c^4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x)*tan(e+f*x)+8*c^4*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))^5//2, x) == :(c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(cos(e+f*x))*tan(e+f*x)+-1*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x)*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, x) == :(c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(cos(e+f*x))*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), x) == :(c*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+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))^-1//2, x) == :(f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(sin(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, x) == :(c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(cos(e+f*x))*tan(e+f*x)+-3//4*c^-2*f^-1*(1+-1*sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//4*c^-2*f^-1*(1+-1*sec(e+f*x))^-2*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+1//8*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)+7//8*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))^-3//2*(c+-1*c*sec(e+f*x))^7//2, x) == :(a^-1*c^4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(cos(e+f*x))*tan(e+f*x)+a^-1*c^4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*sec(e+f*x)*tan(e+f*x)+-8*a^-1*c^4*f^-1*(1+sec(e+f*x))^-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^4*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))^5//2, x) == :(-4*c^3*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^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(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, x) == :(-2*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)+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+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))^(1/2), x) == :(-1*c*f^-1*(a+a*sec(e+f*x))^-3//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+c*a^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+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))^-1//2, x) == :(a^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(cos(e+f*x))*tan(e+f*x)+-1//2*a^-1*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//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))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+-1*sec(e+f*x))*tan(e+f*x)+3//4*a^-1*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, 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*cot(e+f*x)+a^-1*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(sin(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, 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(cos(e+f*x))*tan(e+f*x)+-1//2*a^-1*c^-2*f^-1*(1+-1*sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//8*a^-1*c^-2*f^-1*(1+-1*sec(e+f*x))^-2*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//8*a^-1*c^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+5//16*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)+11//16*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+-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, x) == :(a^-2*c^4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(cos(e+f*x))*tan(e+f*x)+-4*a^-2*c^4*f^-1*(1+sec(e+f*x))^-2*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+2*a^-2*c^4*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)+4*a^-2*c^4*f^-1*(1+sec(e+f*x))^-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))^-5//2*(c+-1*c*sec(e+f*x))^5//2, x) == :(-2*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)+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+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, x) == :(-1*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)+-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)+a^-2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+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))^(1/2), 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)+-1*c*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)+c*a^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(1+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))^-1//2, x) == :(a^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(cos(e+f*x))*tan(e+f*x)+-3//4*a^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//4*a^-2*f^-1*(1+sec(e+f*x))^-2*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+1//8*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)+7//8*a^-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))^-5//2*(c+-1*c*sec(e+f*x))^-3//2, x) == :(a^-2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(cos(e+f*x))*tan(e+f*x)+-1//2*a^-2*c^-1*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//8*a^-2*c^-1*f^-1*(1+-1*sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+-1//8*a^-2*c^-1*f^-1*(1+sec(e+f*x))^-2*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*tan(e+f*x)+5//16*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)+11//16*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+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, x) == :((1/2)*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)+-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)^3+a^-2*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+-1*c*sec(e+f*x))^-1//2*log(sin(e+f*x))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+c*sec(e+f*x))^-1, x) == :(2*a^(1/2)*c^-1*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-1*2^(1/2)*a^(1/2)*c^-1*f^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*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))^4, x) == :(-2//3*d^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))*(3*d^2+6*c^2+8*c*d)*tan(e+f*x)+-2//7*a^-2*d^4*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^3*tan(e+f*x)+2*a*d*f^-1*(a+a*sec(e+f*x))^-1//2*(d+2c)*(d^2+2*c^2+2*c*d)*tan(e+f*x)+2*a^3//2*c^4*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+2//5*a^-1*d^3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^2*(3d+4c)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^(1/2)*(c+d*sec(e+f*x))^3, x) == :(2*a*d*f^-1*(a+a*sec(e+f*x))^-1//2*(d^2+3*c^2+3*c*d)*tan(e+f*x)+-2//3*d^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))*(2d+3c)*tan(e+f*x)+2//5*a^-1*d^3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^2*tan(e+f*x)+2*a^3//2*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*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))^2, x) == :(-2//3*d^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))*tan(e+f*x)+2*a*d*f^-1*(a+a*sec(e+f*x))^-1//2*(d+2c)*tan(e+f*x)+2*a^3//2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*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)), x) == :(2*c*a^(1/2)*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2*a*d*f^-1*(a+a*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, x) == :(2*a^(1/2)*c^-1*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a^(1/2)*c^-1*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((a+a*sec(e+f*x))^(1/2)*(c+d*sec(e+f*x))^-2, x) == :(2*a^3//2*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*a*d*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(c+d*sec(e+f*x))^-1*tan(e+f*x)+-1*a^3//2*c^-2*d^(1/2)*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-3//2*(2d+3c)*arctanh(a^-1//2*d^(1/2)*(a+-1*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))^-3, x) == :(2*a^3//2*c^-3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//2*a*d*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(c+d*sec(e+f*x))^-2*tan(e+f*x)+-1//4*a*d*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-2*(c+d*sec(e+f*x))^-1*(4d+7c)*tan(e+f*x)+-1//4*a^3//2*c^-3*d^(1/2)*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-5//2*(8*d^2+15*c^2+20*c*d)*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+d*sec(e+f*x))^3, x) == :(2//7*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^3*tan(e+f*x)+2//105*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(72*c^3+104*d^3+378*c*d^2+486*d*c^2+d*(24*c^2+52*d^2+111*c*d)*sec(e+f*x))*tan(e+f*x)+2//35*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^2*(6c+13d)*tan(e+f*x)+2*a^5//2*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+d*sec(e+f*x))^2, x) == :(2//5*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^2*tan(e+f*x)+2//15*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(12*c^2+18*d^2+50*c*d+d*(4c+9d)*sec(e+f*x))*tan(e+f*x)+2*a^5//2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+d*sec(e+f*x)), x) == :(2*c*a^3//2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2//3*a*d*f^-1*(a+a*sec(e+f*x))^(1/2)*tan(e+f*x)+2//3*a^2*f^-1*(a+a*sec(e+f*x))^-1//2*(3c+4d)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+d*sec(e+f*x))^-1, x) == :(2*a^3//2*c^-1*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2*a^3//2*c^-1*d^-1//2*f^-1*(c+d)^-1//2*(c+-1d)*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))^3//2*(c+d*sec(e+f*x))^-2, x) == :(2*a^5//2*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+a^2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(c+d*sec(e+f*x))^-1*(c+-1d)*tan(e+f*x)+a^5//2*c^-2*d^-1//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-3//2*(c^2+-2*d^2+-3*c*d)*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^3//2*(c+d*sec(e+f*x))^-3, x) == :(2*a^5//2*c^-3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+(1/2)*a^2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(c+d*sec(e+f*x))^-2*(c+-1d)*tan(e+f*x)+1//4*a^2*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-2*(c+d*sec(e+f*x))^-1*(-4*d^2+3*c^2+-7*c*d)*tan(e+f*x)+1//4*a^5//2*c^-3*d^-1//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-5//2*(-8*d^3+3*c^3+-20*c*d^2+-15*d*c^2)*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+d*sec(e+f*x))^3, x) == :(2*a^3*f^-1*(a+a*sec(e+f*x))^-1//2*(3*c^3+4*d^3+12*c*d^2+12*d*c^2)*tan(e+f*x)+-1//3*f^-1*(a+a*sec(e+f*x))^-1//2*(a^3+-1*a^3*sec(e+f*x))*(2*c^3+24*d^3+24*d*c^2+48*c*d^2)*tan(e+f*x)+-6//7*d^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^3*(c+2d)*tan(e+f*x)+2//9*a^-1*d^3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^4*tan(e+f*x)+2*a^7//2*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+2//5*a*d*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^2*(3*c^2+13*d^2+15*c*d)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+d*sec(e+f*x))^2, x) == :(-2//7*d^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^3*tan(e+f*x)+-1//3*f^-1*(a+a*sec(e+f*x))^-1//2*(a^3+-1*a^3*sec(e+f*x))*(2*c^2+16*d^2+16*c*d)*tan(e+f*x)+2*a^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+2d)*(2d+3c)*tan(e+f*x)+2*a^7//2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+2//5*a*d*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^2*(2c+5d)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+d*sec(e+f*x)), x) == :(2*c*a^5//2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+2//5*a*d*f^-1*(a+a*sec(e+f*x))^3//2*tan(e+f*x)+2//15*a^2*f^-1*(a+a*sec(e+f*x))^(1/2)*(5c+8d)*tan(e+f*x)+2//15*a^3*f^-1*(a+a*sec(e+f*x))^-1//2*(32d+35c)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+d*sec(e+f*x))^-1, x) == :(2*a^3*d^-1*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+2*a^7//2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-2*a^7//2*c^-1*d^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-1//2*(c+-1d)^2*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+d*sec(e+f*x))^-2, x) == :(2*a^7//2*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*a^3*c^-1*d^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(c+-1d)^2*(c+d*sec(e+f*x))^-1*tan(e+f*x)+-1*a^7//2*c^-1*d^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-3//2*(c+-1d)^2*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x)+2*a^7//2*c^-2*d^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^(1/2)*(c+-1d)*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^5//2*(c+d*sec(e+f*x))^-3, x) == :(2*a^7//2*c^-3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+a^3*c^-2*d^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1*(c+-1d)*tan(e+f*x)+-2*a^7//2*c^-3*d^(1/2)*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-1//2*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x)+-3//4*a^3*c^-1*d^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-2*(c+-1d)^2*(c+d*sec(e+f*x))^-1*tan(e+f*x)+-1//2*a^3*c^-1*d^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(c+-1d)^2*(c+d*sec(e+f*x))^-2*tan(e+f*x)+a^7//2*c^-2*d^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-1//2*(c+-1d)*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x)+-3//4*a^7//2*c^-1*d^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-5//2*(c+-1d)^2*arctanh(a^-1//2*d^(1/2)*(a+-1*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))^3, x) == :(2*d^3*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+d^2*f^-1*(a+a*sec(e+f*x))^-1//2*(-2d+6c)*tan(e+f*x)+-2//3*d^3*f^-1*(a+a*sec(e+f*x))^-1//2*(1+-1*sec(e+f*x))*tan(e+f*x)+2*a^(1/2)*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*2^(1/2)*a^(1/2)*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^3*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*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))^2, x) == :(2*d^2*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+2*a^(1/2)*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*2^(1/2)*a^(1/2)*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^2*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*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)), x) == :(2*c*a^-1//2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-1*2^(1/2)*a^-1//2*f^-1*(c+-1d)*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*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, x) == :(2*a^-1//2*c^-1*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*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*a^-1//2*c^-1*d^3//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))^-2, x) == :(c^-1*d^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-1*tan(e+f*x)+2*a^(1/2)*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*2^(1/2)*a^(1/2)*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-2*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+a^(1/2)*c^-1*d^3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-3//2*(c+-1d)^-1*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x)+2*a^(1/2)*c^-2*d^3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-1//2*(c+-1d)^-2*(-1d+2c)*arctanh(a^-1//2*d^(1/2)*(a+-1*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))^-3, x) == :((1/2)*c^-1*d^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-2*(c^2+-1*d^2)^-1*tan(e+f*x)+2*a^(1/2)*c^-3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*2^(1/2)*a^(1/2)*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-3*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+3//4*c^-1*d^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-2*(c+-1d)^-1*(c+d*sec(e+f*x))^-1*tan(e+f*x)+c^-2*d^2*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(c+-1d)^-2*(c+d*sec(e+f*x))^-1*(-1d+2c)*tan(e+f*x)+3//4*a^(1/2)*c^-1*d^3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-5//2*(c+-1d)^-1*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x)+a^(1/2)*c^-2*d^3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-3//2*(c+-1d)^-2*(-1d+2c)*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x)+2*a^(1/2)*c^-3*d^3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-1//2*(c+-1d)^-3*(d^2+3*c^2+-3*c*d)*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+d*sec(e+f*x))^3, x) == :(2*a^-1*d^3*f^-1*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)+-1//2*a^-1*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^3*tan(e+f*x)+2*a^-1//2*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//4*2^(1/2)*a^-1//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^3*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*2^(1/2)*a^-1//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^2*(c+2d)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+d*sec(e+f*x))^2, x) == :(-1//2*a^-1*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^2*tan(e+f*x)+2*a^-1//2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*2^(1/2)*a^-1//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c^2+-1*d^2)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//4*2^(1/2)*a^-1//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^2*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+d*sec(e+f*x)), x) == :(2*c*a^-3//2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-1//2*f^-1*(a+a*sec(e+f*x))^-3//2*(c+-1d)*tan(e+f*x)+-1//4*2^(1/2)*a^-3//2*f^-1*(-1d+5c)*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+d*sec(e+f*x))^-1, x) == :(-1//2*a^-1*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-1*tan(e+f*x)+2*a^-1//2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//4*2^(1/2)*a^-1//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-1*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*2^(1/2)*a^-1//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-2*(c+-2d)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-2*a^-1//2*c^-1*d^5//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-1//2*(c+-1d)^-2*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-3//2*(c+d*sec(e+f*x))^-2, x) == :(-1//2*a^-1*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-2*tan(e+f*x)+2*a^-1//2*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//4*2^(1/2)*a^-1//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-2*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*2^(1/2)*a^-1//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-3*(c+-3d)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*a^-1*c^-1*d^3*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(c+-1d)^-2*(c+d*sec(e+f*x))^-1*tan(e+f*x)+-1*a^-1//2*c^-1*d^5//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-3//2*(c+-1d)^-2*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x)+-1*a^-1//2*c^-2*d^5//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-1//2*(c+-1d)^-3*(-2d+6c)*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+d*sec(e+f*x))^3, x) == :(-3//16*a^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^3*tan(e+f*x)+-1//4*a^-2*f^-1*(1+sec(e+f*x))^-2*(a+a*sec(e+f*x))^-1//2*(c+-1d)^3*tan(e+f*x)+2*a^-3//2*c^3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//2*a^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^2*(c+2d)*tan(e+f*x)+-1*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c^3+-1*d^3)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-3//32*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^3*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//4*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^2*(c+2d)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+d*sec(e+f*x))^2, x) == :(-3//16*a^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^2*tan(e+f*x)+-1//2*a^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c^2+-1*d^2)*tan(e+f*x)+-1//4*a^-2*f^-1*(1+sec(e+f*x))^-2*(a+a*sec(e+f*x))^-1//2*(c+-1d)^2*tan(e+f*x)+2*a^-3//2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*2^(1/2)*a^-3//2*c^2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-3//32*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^2*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//4*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c^2+-1*d^2)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+d*sec(e+f*x)), x) == :(2*c*a^-5//2*f^-1*arctan(a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x))+-1//4*f^-1*(a+a*sec(e+f*x))^-5//2*(c+-1d)*tan(e+f*x)+-1//16*a^-1*f^-1*(a+a*sec(e+f*x))^-3//2*(-3d+11c)*tan(e+f*x)+-1//32*2^(1/2)*a^-5//2*f^-1*(-3d+43c)*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*sec(e+f*x))^-1//2*tan(e+f*x)))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+d*sec(e+f*x))^-1, x) == :(-3//16*a^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-1*tan(e+f*x)+-1//4*a^-2*f^-1*(1+sec(e+f*x))^-2*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-1*tan(e+f*x)+2*a^-3//2*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//2*a^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-2*(c+-2d)*tan(e+f*x)+-3//32*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-1*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-3*(c^2+3*d^2+-3*c*d)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//4*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-2*(c+-2d)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+2*a^-3//2*c^-1*d^7//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-1//2*(c+-1d)^-3*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+d*sec(e+f*x))^-2, x) == :(-3//16*a^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-2*tan(e+f*x)+-1//4*a^-2*f^-1*(1+sec(e+f*x))^-2*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-2*tan(e+f*x)+2*a^-3//2*c^-2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//2*a^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-3*(c+-3d)*tan(e+f*x)+-3//32*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-2*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+a^-2*c^-1*d^4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(c+-1d)^-3*(c+d*sec(e+f*x))^-1*tan(e+f*x)+-1*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-4*(c^2+6*d^2+-4*c*d)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//4*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-3*(c+-3d)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+a^-3//2*c^-1*d^7//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-3//2*(c+-1d)^-3*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x)+a^-3//2*c^-2*d^7//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-1//2*(c+-1d)^-4*(-2d+8c)*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x))
@test integrate((a+a*sec(e+f*x))^-5//2*(c+d*sec(e+f*x))^-3, x) == :(-3//16*a^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-3*tan(e+f*x)+-1//4*a^-2*f^-1*(1+sec(e+f*x))^-2*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-3*tan(e+f*x)+2*a^-3//2*c^-3*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*arctanh(a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//2*a^-2*f^-1*(1+sec(e+f*x))^-1*(a+a*sec(e+f*x))^-1//2*(c+-1d)^-4*(c+-4d)*tan(e+f*x)+-3//32*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-3*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+(1/2)*a^-2*c^-1*d^4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(c+-1d)^-3*(c+d*sec(e+f*x))^-2*tan(e+f*x)+-1*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-5*(c^2+10*d^2+-5*c*d)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+-1//4*2^(1/2)*a^-3//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+-1d)^-4*(c+-4d)*arctanh((1/2)*2^(1/2)*a^-1//2*(a+-1*a*sec(e+f*x))^(1/2))*tan(e+f*x)+3//4*a^-2*c^-1*d^4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-2*(c+-1d)^-3*(c+d*sec(e+f*x))^-1*tan(e+f*x)+a^-2*c^-2*d^4*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(c+-1d)^-4*(c+d*sec(e+f*x))^-1*(-1d+4c)*tan(e+f*x)+3//4*a^-3//2*c^-1*d^7//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-5//2*(c+-1d)^-3*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x)+a^-3//2*c^-2*d^7//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-3//2*(c+-1d)^-4*(-1d+4c)*arctanh(a^-1//2*d^(1/2)*(a+-1*a*sec(e+f*x))^(1/2)*(c+d)^-1//2)*tan(e+f*x)+2*a^-3//2*c^-3*d^7//2*f^-1*(a+a*sec(e+f*x))^-1//2*(a+-1*a*sec(e+f*x))^-1//2*(c+d)^-1//2*(c+-1d)^-5*(d^2+10*c^2+-5*c*d)*arctanh(a^-1//2*d^(1/2)*(a+-1*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/2), x) == :(2*a^(1/2)*c^(1/2)*f^-1*arctan(a^(1/2)*c^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1//2*tan(e+f*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, x) == :(2*a^(1/2)*c^-1//2*f^-1*arctan(a^(1/2)*c^(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))^-3//2, x) == :(2*a^(1/2)*c^-3//2*f^-1*arctan(a^(1/2)*c^(1/2)*(a+a*sec(e+f*x))^-1//2*(c+d*sec(e+f*x))^-1//2*tan(e+f*x))+-2*a*d*c^-1*f^-1*(a+a*sec(e+f*x))^-1//2*(c+d)^-1*(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), x) == :(2*a^-1//2*c^(1/2)*f^-1*arctan(a^(1/2)*c^(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//2, x) == :(2*a^-1//2*c^-1//2*f^-1*arctan(a^(1/2)*c^(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((c+d*sec(e+f*x))^-1*(a+b*sec(e+f*x)), x) == :(a*x*c^-1+c^-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)), x) == :(a*x*c^-2+c^-2*f^-1*(c+d)^-3//2*(c+-1d)^-3//2*(2*a*d^3+2*b*c^3+-4*a*d*c^2)*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1*d*c^-1*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)), x) == :(a*x*c^-3+c^-3*f^-1*(c+d)^-5//2*(c+-1d)^-5//2*(b*c^3*(d^2+2*c^2)+-1*a*d*(2*d^4+6*c^4+-5*c^2*d^2))*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//2*d*c^-1*f^-1*(c+d*sec(e+f*x))^-2*(c^2+-1*d^2)^-1*(b*c+-1*a*d)*tan(e+f*x)+-1//2*d*c^-2*f^-1*(c+d*sec(e+f*x))^-1*(c^2+-1*d^2)^-2*(2*a*d^3+3*b*c^3+-5*a*d*c^2)*tan(e+f*x))
@test integrate((a+b*sec(e+f*x))^2*(c+d*sec(e+f*x))^-2, x) == :(x*a^2*c^-2+c^-1*f^-1*(d+c*cos(e+f*x))^-1*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^2*sin(e+f*x)+c^-2*f^-1*(c+d)^-3//2*(c+-1d)^-3//2*(-2*a*d+2*b*c)*(-1*a*d^2+2*a*c^2+-1*b*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, x) == :(x*a^2*c^-3+-1*c^-3*f^-1*(c+d)^-5//2*(c+-1d)^-5//2*(a^2*(2*d^5+-5*c^2*d^3+6*d*c^4)+3*d*b^2*c^4+-2*a*b*c^3*(d^2+2*c^2))*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//2*d*c^-2*f^-1*(d+c*cos(e+f*x))^-2*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^2*sin(e+f*x)+-1//2*c^-2*f^-1*(d+c*cos(e+f*x))^-1*(c^2+-1*d^2)^-2*(b*c+-1*a*d)*(-1*b*c*(d^2+2*c^2)+3*a*d*(-1*d^2+2*c^2))*sin(e+f*x))
@test integrate((a+b*sec(e+f*x))^2*(c+d*sec(e+f*x))^-4, x) == :(x*a^2*c^-4+-1*c^-4*f^-1*(c+d)^-7//2*(c+-1d)^-7//2*(a^2*(-2*d^7+-8*c^4*d^3+7*c^2*d^5+8*d*c^6)+-1*a*b*(4*c^7+6*c^5*d^2)+d*b^2*c^4*(d^2+4*c^2))*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//6*c^-3*f^-1*(d+c*cos(e+f*x))^-1*(c^2+-1*d^2)^-3*(-1*b^2*(6*c^6+-1*c^2*d^4+10*c^4*d^2)+-1*a^2*d^2*(9*d^4+34*c^4+-28*c^2*d^2)+2*a*b*c*d*(2*d^4+18*c^4+-5*c^2*d^2))*sin(e+f*x)+1//3*c^-1*d^2*f^-1*(b+a*cos(e+f*x))^2*(d+c*cos(e+f*x))^-3*(c^2+-1*d^2)^-1*sin(e+f*x)+-1//6*d*c^-3*f^-1*(d+c*cos(e+f*x))^-2*(c^2+-1*d^2)^-2*(b*c+-1*a*d)*(3*a*d^3+6*b*c^3+-1*b*c*d^2+-8*a*d*c^2)*sin(e+f*x))
@test integrate((a+b*sec(e+f*x))^3*(c+d*sec(e+f*x))^-3, x) == :(x*a^3*c^-3+(1/2)*c^-1*f^-1*(d+c*cos(e+f*x))^-2*(c^2+-1*d^2)^-1*(b*c+-1*a*d)^2*(b+a*cos(e+f*x))*sin(e+f*x)+(1/2)*c^-2*f^-1*(d+c*cos(e+f*x))^-1*(c^2+-1*d^2)^-2*(b*c+-1*a*d)^2*(-2*a*d^2+5*a*c^2+-3*b*c*d)*sin(e+f*x)+-1*c^-3*f^-1*(c+d)^-5//2*(c+-1d)^-5//2*(b*c+-1*a*d)*(-1*a^2*(2*d^4+6*c^4+-5*c^2*d^2)+-1*b^2*c^2*(c^2+2*d^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)))
@test integrate((a+b*sec(e+f*x))^3*(c+d*sec(e+f*x))^-5, x) == :(x*a^3*c^-5+-1//24*c^-4*f^-1*(d+c*cos(e+f*x))^-1*(c^2+-1*d^2)^-4*(-1*a^3*(-36*d^8+-210*c^4*d^4+139*c^2*d^6+212*c^6*d^2)+d*b^3*c^3*(-2*d^4+68*c^4+39*c^2*d^2)+-3*a*b^2*c^2*(2*d^6+24*c^6+-5*c^2*d^4+84*c^4*d^2)+b*c*d*a^2*(-16*d^6+272*c^6+10*c^4*d^2+49*c^2*d^4))*sin(e+f*x)+-1//4*c^-5*f^-1*(c+d)^-1//2*(c+-1d)^-1//2*(c^2+-1*d^2)^-4*(a^3*(8*d^9+-40*c^6*d^3+-36*c^2*d^7+40*d*c^8+63*c^4*d^5)+-1*b^3*c^5*(4*c^4+4*d^4+27*c^2*d^2)+-3*b*a^2*c^5*(3*d^4+8*c^4+24*c^2*d^2)+15*a*d*b^2*c^6*(3*d^2+4*c^2))*arctanh((c+d)^-1//2*(c+-1d)^(1/2)*tan((1/2)*e+(1/2)*f*x))+-1//24*c^-4*f^-1*(d+c*cos(e+f*x))^-2*(c^2+-1*d^2)^-3*(b*c+-1*a*d)*(-1*b^2*(12*c^6+-2*c^2*d^4+25*c^4*d^2)+-1*a^2*d^2*(12*d^4+58*c^4+-35*c^2*d^2)+2*a*b*c*d*(2*d^4+32*c^4+c^2*d^2))*sin(e+f*x)+1//4*c^-1*d^2*f^-1*(b+a*cos(e+f*x))^3*(d+c*cos(e+f*x))^-4*(c^2+-1*d^2)^-1*sin(e+f*x)+-1//12*d*c^-2*f^-1*(b+a*cos(e+f*x))^2*(d+c*cos(e+f*x))^-3*(c^2+-1*d^2)^-2*(4*a*d^3+8*b*c^3+-1*b*c*d^2+-11*a*d*c^2)*sin(e+f*x))

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


text:
module Numbers

using Random

export halfrand

const MY_NAME = "Numbers"

function rand()
  Random.rand(1:1_000)
end

function halfrand()
  floor(rand() / 2)
end

include("module_name.jl")

end

ext: jl

max_stars_repo_name: PacktPublishing/Julia-Projects

max_issues_repo_name: PacktPublishing/Julia-Projects

max_forks_repo_name: PacktPublishing/Julia-Projects


text:
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

"""
    Data

A domain implementing the [`Domain`](@ref) trait together with tables
of values for geometries of the domain.

See also [`meshdata`](@ref).
"""
abstract type Data end

"""
    domain(data)

Return underlying domain of the `data`.
"""
function domain end

"""
    values(data, [rank])

Return the values of `data` for a given `rank` as a table.

The rank is a non-negative integer that specifies the
parametric dimension of the geometries of interest:

* 0 - points
* 1 - segments
* 2 - triangles, quadrangles, ...
* 3 - tetrahedrons, hexahedrons, ...

If the rank is not specified, it is assumed to be the rank
of the elements of the domain.
"""
function values end

"""
    constructor(D)

Return the constructor of the data type `D` as a function.
The function takes a domain and a dictionary of tables as
inputs and combines them into an instance of the data type.
"""
function constructor end

# ----------
# FALLBACKS
# ----------

function (D::Type{<:Data})(stable)
  # build domain from geometry column
  ctable = Tables.columns(stable)
  elms   = Tables.getcolumn(ctable, :geometry)
  domain = Collection(elms)

  # build table from remaining columns
  vars = setdiff(Tables.columnnames(ctable), (:geometry,))
  cols = [var => Tables.getcolumn(ctable, var) for var in vars]
  table = (; cols...)

  # data table for elements
  values = Dict(paramdim(domain) => table)

  # combine the two with constructor
  constructor(D)(domain, values)
end

function ==(data₁::Data, data₂::Data)
  # must have the same domain
  if domain(data₁) != domain(data₂)
    return false
  end

  # must have the same data tables
  for rank in 0:paramdim(domain(data₁))
    if values(data₁, rank) != values(data₂, rank)
      return false
    end
  end

  return true
end

# implement Domain traits for convenience
embeddim(data::Data) = embeddim(domain(data))
coordtype(data::Data) = coordtype(domain(data))
nelements(data::Data) = nelements(domain(data))
centroid(data::Data, ind) = centroid(domain(data), ind)

# -----------------
# TABLES INTERFACE
# -----------------

Tables.istable(::Type{<:Data}) = true

Tables.rowaccess(::Type{<:Data}) = true

Tables.rows(data::Data) = DataRows(domain(data), Tables.rows(values(data)))

# wrapper type for rows of the data table
# so that we can easily inform the schema
struct DataRows{𝒟,𝒯}
  domain::𝒟
  rtable::𝒯
end

function Base.iterate(rows::DataRows, state=1)
  if state > nelements(rows.domain)
    nothing
  else
    row, _ = iterate(rows.rtable, state)
    elm, _ = iterate(rows.domain, state)
    (; NamedTuple(row)..., geometry=elm), state + 1
  end
end

Base.length(rows::DataRows) = nelements(rows.domain)

function Tables.schema(rows::DataRows)
  geomtype = eltype(rows.domain)
  schema = Tables.schema(rows.rtable)
  names, types = schema.names, schema.types
  Tables.Schema((names..., :geometry), (types..., geomtype))
end

# data table is compatible with the Queryverse
TableTraits.isiterabletable(data::Data) = true
IIE.getiterator(data::Data) = Tables.datavaluerows(Tables.rows(data))
IIE.isiterable(data::Data) = true

Tables.materializer(D::Type{<:Data}) = D

# -----------------
# COLUMN INTERFACE
# -----------------

function Base.getindex(data::Data, col::Symbol)
  if col == :geometry
    collect(domain(data))
  else
    cols = Tables.columns(values(data))
    Tables.getcolumn(cols, col)
  end
end

Base.getindex(data::Data, col::String) =
  getindex(data, Symbol(col))

Base.getproperty(data::Data, col::Symbol) =
  getindex(data, col)

# -------------------
# VARIABLE INTERFACE
# -------------------

"""
    variables(data)

Returns the variables stored in `data` as a vector of
[`Variable`](@ref).
"""
function variables(data::Data)
  s = Tables.schema(values(data))
  @. Variable(s.names, nonmissingtype(s.types))
end

"""
    asarray(data, var)

Returns the data for the variable `var` in `data` as a Julia array
with size equal to the size of the underlying domain if the size is
defined, otherwise returns a vector.
"""
function asarray(data::Data, var::Symbol)
  D = domain(data)
  hassize = hasmethod(size, (typeof(D),))
  hassize ? reshape(data[var], size(D)) : data[var]
end

asarray(data::Data, var::String) =
  asarray(data, Symbol(var))

# -----------
# IO METHODS
# -----------

function Base.show(io::IO, data::Data)
  name = nameof(typeof(data))
  𝒟    = domain(data)
  n    = nelements(𝒟)
  Dim  = embeddim(𝒟)
  T    = coordtype(𝒟)
  print(io, "$n $name{$Dim,$T}")
end

function Base.show(io::IO, ::MIME"text/plain", data::Data)
  name = nameof(typeof(data))
  𝒟    = domain(data)
  n    = nelements(𝒟)
  Dim  = embeddim(𝒟)
  T    = coordtype(𝒟)
  println(io, "$n $name{$Dim,$T}")
  for rank in 0:paramdim(𝒟)
    𝒯 = values(data, rank)
    if !isnothing(𝒯)
      sche = Tables.schema(Tables.rows(𝒯))
      vars = zip(sche.names, sche.types)
      println(io, "  variables (rank $rank)")
      varlines = ["    └─$var ($V)" for (var,V) in vars]
      println(io, join(sort(varlines), "\n"))
    end
  end
  print(io, "  domain: ", 𝒟)
end


text:
module OptimTensorBoard

# Use README as the docstring of the module:
@doc read(joinpath(dirname(@__DIR__), "README.md"), String) OptimTensorBoard

export optimcallback

using Logging
using TensorBoardLogger

"""
    optimcallback(logger; [callback, savearrays])
    optimcallback(tblogger_args...; [callback, savearrays], [tblogger_kwargs...])

Create a callable object that is suitable for passing it to `Optim.Options`.
`callback` is a callable that is called after this callback is called.
"""
optimcallback(logger::AbstractLogger; callback=returnfalse, savearrays=true) =
    OptimCallback(logger, callback, savearrays)

optimcallback(args...; callback=returnfalse, savearrays=true, kwargs...) =
    OptimCallback(TBLogger(args...; kwargs...), callback, savearrays)

returnfalse(_) = false

@enum ArrayHandler DONTSAVE HISTOGRAM IMAGE

# Is it a good idea?
Base.convert(::Type{ArrayHandler}, yes::Bool) = yes ? HISTOGRAM : DONTSAVE
function Base.convert(::Type{ArrayHandler}, name::Symbol)
    name == :histogram && return HISTOGRAM
    name == :image && return IMAGE
    throw(ArgumentError("Unknown array handler: $name"))
end

struct OptimCallback
    logger::AbstractLogger
    callback
    savearrays::ArrayHandler
end

function (cb::OptimCallback)(tr)
    logger = cb.logger

    if tr isa AbstractArray
        os = tr[end]
    else
        os = tr
    end
    # os :: OptimizationState

    with_logger(logger) do
        @info "optim" iteration=os.iteration value=os.value g_norm=os.g_norm
    end
    if logger isa TBLogger
        for (key, value) in os.metadata
            if value isa Union{Real, Complex}
                log_value(logger, "optim/metadata/$key", value)
            elseif cb.savearrays === HISTOGRAM && value isa AbstractArray{<:Real}
                log_histogram(logger, "optim/metadata/$key", vec(collect(value)))
            elseif (
                cb.savearrays === IMAGE &&
                value isa AbstractArray{<:Real} &&
                ndims(value) in (1, 2, 3)
            )
                fmt = (L, HW, HWC)[ndims(value)]
                minval, maxval = extrema(value)
                if minval != maxval
                    image = (value .- minval) ./ (maxval - minval)
                    log_image(logger, "optim/metadata/image/$key", image, fmt)
                end
                log_value(logger, "optim/metadata/min/$key", minval)
                log_value(logger, "optim/metadata/max/$key", maxval)
            end
        end
    end

    return cb.callback(tr)
end
# For definition of `OptimizationState`, see:
# https://github.com/JuliaNLSolvers/Optim.jl/blob/v0.19.3/src/types.jl#L155-L160

end # module


text:
mutable struct LinkedListNode{T}
    data::T
    prev::Union{LinkedListNode,Nothing}
    next::Union{LinkedListNode,Nothing}
end

mutable struct LinkedList{T}
    head::LinkedListNode{T}
    tail::LinkedListNode{T}
    length::Int64
end

import Base.push!
function push!(xs::LinkedList, x)
    newnode = LinkedListNode(x, xs.tail, nothing)
    xs.tail.next = newnode
    xs.tail = newnode
    xs.length += 1
end

function check_length(a::LinkedList)::Bool
    length = 1
    h = a.head
    nums = [h.data]
    while h.next != nothing
        h = h.next
        length += 1
        push!(nums, h.data)
    end
    if a.length > 21
        println(nums)
    end
    if a.length != length
        println("Something broke")
        return false
    end
    return true
end

import Base.insert!
function insert!(a::LinkedList, idx, obj)
    node = a.head
    for i in 1:idx
        node = node.next
    end
    p = node.prev
    newnode = LinkedListNode(obj, p, node)
    p.next = newnode
    node.prev = newnode
    a.length += 1
    #check_length(a)
end

import Base.circshift!
function circshift!(a::LinkedList, num::Int64)
    lastnode = a.tail
    if num < 0
        lastnode = a.head
        for i in 1:(-1*num)
            lastnode = lastnode.next
        end
    else
        for i in 1:num-1
            lastnode = lastnode.prev
        end
    end
    new_front = lastnode
    new_back = lastnode.prev
    a.tail.next = a.head
    a.head.prev = a.tail
    a.head = new_front
    a.tail = new_back
    new_front.prev = nothing
    new_back.next = nothing
    #check_length(a)
end

import Base.length
function length(a::LinkedList)::Int64
    return a.length
end

import Base.getindex
function getindex(a::LinkedList, idx::Int64)
    if idx > 0
        h = a.head
        for i in 1:idx-1
            h = h.next
        end
        return h.data
    else
        h = a.tail
        for i in 2:(abs(idx))
            h = h.prev
        end
        return h.data
    end
end

function getindex(a::LinkedList, idxs::UnitRange{Int64})
    result = []
    for idx in idxs.start:idxs.stop
        push!(result, a[idx])
    end
    return result
end

import Base.deleteat!
function deleteat!(a::LinkedList, idx::Int64)
    if idx > 0
        h = a.head
        for i in 1:idx-1
            h = h.next
            if h == nothing
                return
            end
        end
        h.prev.next = h.next
        h.next.prev = h.prev
        a.length -= 1
    else
        h = a.tail
        for i in 1:abs(idx)
            h = h.prev
            if h == nothing
                return
            end
        end
        h.prev.next = h.next
        h.next.prev = h.prev
        a.length -= 1
    end
    #check_length(a)
end

function getlines(path)::Array{String}
    retval = []
    open(path) do file
        for line in eachline(file)
            push!(retval, line)
        end
    end
    return retval
end

import Base.setindex!

mutable struct TapeDict{T}
    data::Dict{Int64,T}
    default::T
    min::Int64
    max::Int64
end

function getindex(t::TapeDict, i::Int64)
    try
        return t.data[i]
    catch err
        if isa(err, KeyError)
            if i < t.min
                t.min = i
            elseif i > t.max
                t.max = i
            end
            t.data[i] = t.default
            return t.default
        end
    end
end

function getindex(t::TapeDict, is::UnitRange{Int64})
    return [t[i] for i in is]
end

function setindex!(t::TapeDict, x, i::Int64)
    t.data[i] = x
    if i < t.min
        t.min = i
    elseif i > t.max
        t.max = i
    end
end

mutable struct InfiniteBitArray
    pos::BitArray{1}
    neg::BitArray{1}
    zero::Bool
    default::Bool
    min::Int64
    max::Int64
end

function extend(t::InfiniteBitArray, min::Int64, max::Int64)
    if max > t.max
        for _ in t.max:(2*max)
            push!(t.pos, t.default)
        end
        t.max = 2*max
    end
    if min < t.min
        for _ in t.min:-1:(2*min)
            push!(t.neg, t.default)
        end
        t.min = 2*min
    end
end

function getindex(t::InfiniteBitArray, idx::Int64)
    extend(t, idx, idx)
    if idx == 0
        return t.zero
    elseif idx > 0
        return t.pos[idx]
    else
        return t.neg[abs(idx)]
    end
end

function getindex(t::InfiniteBitArray, is::UnitRange{Int64})
    extend(t,is.start,is.stop)
    if is.start < 0
        if is.stop < 0
            return t.neg[abs(is.start):-1:abs(is.stop)]
        elseif is.stop == 0
            part_a = t.neg[abs(is.start):-1:1]
            push!(part_a, t.zero)
            return part_a
        else # is.stop > 0
            part_a = t.neg[abs(is.start):-1:1]
            push!(part_a, t.zero)
            part_c = t.pos[1:is.stop]
            return vcat(part_a, part_c)
        end
    elseif is.start == 0
        part_a = [t.zero]
        part_b = t.pos[1:is.stop]
        return vcat(part_a, part_b)
    else
        return t.pos[is.start:is.stop]
    end
end

function setindex!(t::InfiniteBitArray, v::Bool, idx::Int64)
    extend(t,idx,idx)
    if idx == 0
        t.zero = v
    elseif idx > 0
        t.pos[idx] = v
    else #idx < 0
        t.neg[abs(idx)] = v
    end
end

mutable struct Tape
    current::InfiniteBitArray
    next::InfiniteBitArray
    min::Int64
    max::Int64
end

function getindex(t::Tape, idx::Int64)::Bool
    return t.current[idx]
end

function getindex(t::Tape, is::UnitRange{Int64})::Bool
    return t.current[is]
end

function setindex!(t::Tape, v::Bool, idx::Int64)
    t.current[idx] = v
end

function Tape()
    current = InfiniteBitArray([], [], false, false, 0, 0)
    next = InfiniteBitArray([], [], false, false, 0, 0)
    return Tape(current, next, 0, 0)
end


text:
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

"""
    PointwiseLearn(model)

A learning solver that converts geospatial data to a tabular format
with features (and possibly labels) for each point, and then solves
the problem with classical statistical learning `model`.

## Parameters

* `model` - Learning model implementing the `MLJModelInterface.jl`.

## References

* Hoffimann et al. 2020. [Geostatistical Learning: Challenges and Opportunities]
  (https://arxiv.org/abs/2102.08791)
"""
struct PointwiseLearn{M} <: LearningSolver
  model::M
end

function solve(problem::LearningProblem, solver::PointwiseLearn)
  sdata = sourcedata(problem)
  tdata = targetdata(problem)
  ptask = task(problem)
  model = solver.model

  # assert model is compatible with task
  @assert iscompatible(model, ptask) "$model is not compatible with $ptask"

  # learn model on source data
  lmodel = learn(ptask, sdata, model)

  # apply model to target data
  perform(ptask, tdata, lmodel)
end

# -----------
# IO METHODS
# -----------

function Base.show(io::IO, ::PointwiseLearn)
  print(io, "PointwiseLearn")
end

function Base.show(io::IO, ::MIME"text/plain", solver::PointwiseLearn)
  println(io, solver)
  print(io, "  └─model ⇨ ")
  show(IOContext(io, :compact => true), solver.model)
end