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

@test integrate(tan(c+d*x), x) == :(-1*d^-1*log(cos(c+d*x)))
@test integrate(tan(c+d*x)^2, x) == :(-1x+d^-1*tan(c+d*x))
@test integrate(tan(c+d*x)^3, x) == :(d^-1*log(cos(c+d*x))+(1/2)*d^-1*tan(c+d*x)^2)
@test integrate(tan(c+d*x)^4, x) == :(x+-1*d^-1*tan(c+d*x)+1//3*d^-1*tan(c+d*x)^3)
@test integrate(tan(c+d*x)^5, x) == :(-1*d^-1*log(cos(c+d*x))+-1//2*d^-1*tan(c+d*x)^2+1//4*d^-1*tan(c+d*x)^4)
@test integrate(tan(c+d*x)^6, x) == :(-1x+d^-1*tan(c+d*x)+-1//3*d^-1*tan(c+d*x)^3+1//5*d^-1*tan(c+d*x)^5)
@test integrate(tan(c+d*x)^7, x) == :(d^-1*log(cos(c+d*x))+(1/2)*d^-1*tan(c+d*x)^2+-1//4*d^-1*tan(c+d*x)^4+1//6*d^-1*tan(c+d*x)^6)
@test integrate(tan(c+d*x)^8, x) == :(x+-1*d^-1*tan(c+d*x)+-1//5*d^-1*tan(c+d*x)^5+1//3*d^-1*tan(c+d*x)^3+1//7*d^-1*tan(c+d*x)^7)
@test integrate((b*tan(c+d*x))^7//2, x) == :(-2*b^3*d^-1*(b*tan(c+d*x))^(1/2)+2//5*b*d^-1*(b*tan(c+d*x))^5//2+(1/2)*2^(1/2)*b^7//2*d^-1*arctan(1+2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//2*2^(1/2)*b^7//2*d^-1*arctan(1+-1*2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//4*2^(1/2)*b^7//2*d^-1*log(b^(1/2)+b^(1/2)*tan(c+d*x)+-1*2^(1/2)*(b*tan(c+d*x))^(1/2))+1//4*2^(1/2)*b^7//2*d^-1*log(b^(1/2)+2^(1/2)*(b*tan(c+d*x))^(1/2)+b^(1/2)*tan(c+d*x)))
@test integrate((b*tan(c+d*x))^5//2, x) == :(2//3*b*d^-1*(b*tan(c+d*x))^3//2+(1/2)*2^(1/2)*b^5//2*d^-1*arctan(1+-1*2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//2*2^(1/2)*b^5//2*d^-1*arctan(1+2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//4*2^(1/2)*b^5//2*d^-1*log(b^(1/2)+b^(1/2)*tan(c+d*x)+-1*2^(1/2)*(b*tan(c+d*x))^(1/2))+1//4*2^(1/2)*b^5//2*d^-1*log(b^(1/2)+2^(1/2)*(b*tan(c+d*x))^(1/2)+b^(1/2)*tan(c+d*x)))
@test integrate((b*tan(c+d*x))^3//2, x) == :(2*b*d^-1*(b*tan(c+d*x))^(1/2)+(1/2)*2^(1/2)*b^3//2*d^-1*arctan(1+-1*2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//2*2^(1/2)*b^3//2*d^-1*arctan(1+2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//4*2^(1/2)*b^3//2*d^-1*log(b^(1/2)+2^(1/2)*(b*tan(c+d*x))^(1/2)+b^(1/2)*tan(c+d*x))+1//4*2^(1/2)*b^3//2*d^-1*log(b^(1/2)+b^(1/2)*tan(c+d*x)+-1*2^(1/2)*(b*tan(c+d*x))^(1/2)))
@test integrate((b*tan(c+d*x))^(1/2), x) == :((1/2)*2^(1/2)*b^(1/2)*d^-1*arctan(1+2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//2*2^(1/2)*b^(1/2)*d^-1*arctan(1+-1*2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//4*2^(1/2)*b^(1/2)*d^-1*log(b^(1/2)+2^(1/2)*(b*tan(c+d*x))^(1/2)+b^(1/2)*tan(c+d*x))+1//4*2^(1/2)*b^(1/2)*d^-1*log(b^(1/2)+b^(1/2)*tan(c+d*x)+-1*2^(1/2)*(b*tan(c+d*x))^(1/2)))
@test integrate((b*tan(c+d*x))^-1//2, x) == :((1/2)*2^(1/2)*b^-1//2*d^-1*arctan(1+2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//2*2^(1/2)*b^-1//2*d^-1*arctan(1+-1*2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//4*2^(1/2)*b^-1//2*d^-1*log(b^(1/2)+b^(1/2)*tan(c+d*x)+-1*2^(1/2)*(b*tan(c+d*x))^(1/2))+1//4*2^(1/2)*b^-1//2*d^-1*log(b^(1/2)+2^(1/2)*(b*tan(c+d*x))^(1/2)+b^(1/2)*tan(c+d*x)))
@test integrate((b*tan(c+d*x))^-3//2, x) == :(-2*b^-1*d^-1*(b*tan(c+d*x))^-1//2+(1/2)*2^(1/2)*b^-3//2*d^-1*arctan(1+-1*2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//2*2^(1/2)*b^-3//2*d^-1*arctan(1+2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//4*2^(1/2)*b^-3//2*d^-1*log(b^(1/2)+b^(1/2)*tan(c+d*x)+-1*2^(1/2)*(b*tan(c+d*x))^(1/2))+1//4*2^(1/2)*b^-3//2*d^-1*log(b^(1/2)+2^(1/2)*(b*tan(c+d*x))^(1/2)+b^(1/2)*tan(c+d*x)))
@test integrate((b*tan(c+d*x))^-5//2, x) == :(-2//3*b^-1*d^-1*(b*tan(c+d*x))^-3//2+(1/2)*2^(1/2)*b^-5//2*d^-1*arctan(1+-1*2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//2*2^(1/2)*b^-5//2*d^-1*arctan(1+2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//4*2^(1/2)*b^-5//2*d^-1*log(b^(1/2)+2^(1/2)*(b*tan(c+d*x))^(1/2)+b^(1/2)*tan(c+d*x))+1//4*2^(1/2)*b^-5//2*d^-1*log(b^(1/2)+b^(1/2)*tan(c+d*x)+-1*2^(1/2)*(b*tan(c+d*x))^(1/2)))
@test integrate((b*tan(c+d*x))^-7//2, x) == :(2*b^-3*d^-1*(b*tan(c+d*x))^-1//2+-2//5*b^-1*d^-1*(b*tan(c+d*x))^-5//2+(1/2)*2^(1/2)*b^-7//2*d^-1*arctan(1+2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//2*2^(1/2)*b^-7//2*d^-1*arctan(1+-1*2^(1/2)*b^-1//2*(b*tan(c+d*x))^(1/2))+-1//4*2^(1/2)*b^-7//2*d^-1*log(b^(1/2)+2^(1/2)*(b*tan(c+d*x))^(1/2)+b^(1/2)*tan(c+d*x))+1//4*2^(1/2)*b^-7//2*d^-1*log(b^(1/2)+b^(1/2)*tan(c+d*x)+-1*2^(1/2)*(b*tan(c+d*x))^(1/2)))
@test integrate((b*tan(c+d*x))^4//3, x) == :((1/2)*b^4//3*d^-1*arctan(3^(1/2)+-2*b^-1//3*(b*tan(c+d*x))^1//3)+-1*b^4//3*d^-1*arctan(b^-1//3*(b*tan(c+d*x))^1//3)+3*b*d^-1*(b*tan(c+d*x))^1//3+-1//2*b^4//3*d^-1*arctan(3^(1/2)+2*b^-1//3*(b*tan(c+d*x))^1//3)+-1//4*3^(1/2)*b^4//3*d^-1*log(b^2//3+(b*tan(c+d*x))^2//3+3^(1/2)*b^1//3*(b*tan(c+d*x))^1//3)+1//4*3^(1/2)*b^4//3*d^-1*log(b^2//3+(b*tan(c+d*x))^2//3+-1*3^(1/2)*b^1//3*(b*tan(c+d*x))^1//3))
@test integrate((b*tan(c+d*x))^2//3, x) == :(b^2//3*d^-1*arctan(b^-1//3*(b*tan(c+d*x))^1//3)+(1/2)*b^2//3*d^-1*arctan(3^(1/2)+2*b^-1//3*(b*tan(c+d*x))^1//3)+-1//2*b^2//3*d^-1*arctan(3^(1/2)+-2*b^-1//3*(b*tan(c+d*x))^1//3)+-1//4*3^(1/2)*b^2//3*d^-1*log(b^2//3+(b*tan(c+d*x))^2//3+3^(1/2)*b^1//3*(b*tan(c+d*x))^1//3)+1//4*3^(1/2)*b^2//3*d^-1*log(b^2//3+(b*tan(c+d*x))^2//3+-1*3^(1/2)*b^1//3*(b*tan(c+d*x))^1//3))
@test integrate((b*tan(c+d*x))^1//3, x) == :(-1//2*b^1//3*d^-1*log(b^2//3+(b*tan(c+d*x))^2//3)+1//4*b^1//3*d^-1*log(b^4//3+(b*tan(c+d*x))^4//3+-1*b^2//3*(b*tan(c+d*x))^2//3)+-1//2*3^(1/2)*b^1//3*d^-1*arctan(1//3*3^(1/2)*b^-2//3*(b^2//3+-2*(b*tan(c+d*x))^2//3)))
@test integrate((b*tan(c+d*x))^-1//3, x) == :((1/2)*b^-1//3*d^-1*log(b^2//3+(b*tan(c+d*x))^2//3)+-1//4*b^-1//3*d^-1*log(b^4//3+(b*tan(c+d*x))^4//3+-1*b^2//3*(b*tan(c+d*x))^2//3)+-1//2*3^(1/2)*b^-1//3*d^-1*arctan(1//3*3^(1/2)*b^-2//3*(b^2//3+-2*(b*tan(c+d*x))^2//3)))
@test integrate((b*tan(c+d*x))^-2//3, x) == :(b^-2//3*d^-1*arctan(b^-1//3*(b*tan(c+d*x))^1//3)+(1/2)*b^-2//3*d^-1*arctan(3^(1/2)+2*b^-1//3*(b*tan(c+d*x))^1//3)+-1//2*b^-2//3*d^-1*arctan(3^(1/2)+-2*b^-1//3*(b*tan(c+d*x))^1//3)+-1//4*3^(1/2)*b^-2//3*d^-1*log(b^2//3+(b*tan(c+d*x))^2//3+-1*3^(1/2)*b^1//3*(b*tan(c+d*x))^1//3)+1//4*3^(1/2)*b^-2//3*d^-1*log(b^2//3+(b*tan(c+d*x))^2//3+3^(1/2)*b^1//3*(b*tan(c+d*x))^1//3))
@test integrate((b*tan(c+d*x))^-4//3, x) == :((1/2)*b^-4//3*d^-1*arctan(3^(1/2)+-2*b^-1//3*(b*tan(c+d*x))^1//3)+-1*b^-4//3*d^-1*arctan(b^-1//3*(b*tan(c+d*x))^1//3)+-3*b^-1*d^-1*(b*tan(c+d*x))^-1//3+-1//2*b^-4//3*d^-1*arctan(3^(1/2)+2*b^-1//3*(b*tan(c+d*x))^1//3)+-1//4*3^(1/2)*b^-4//3*d^-1*log(b^2//3+(b*tan(c+d*x))^2//3+-1*3^(1/2)*b^1//3*(b*tan(c+d*x))^1//3)+1//4*3^(1/2)*b^-4//3*d^-1*log(b^2//3+(b*tan(c+d*x))^2//3+3^(1/2)*b^1//3*(b*tan(c+d*x))^1//3))
@test integrate((b*tan(c+d*x)^2)^5//2, x) == :(-1//2*b^2*d^-1*(b*tan(c+d*x)^2)^(1/2)*tan(c+d*x)+1//4*b^2*d^-1*(b*tan(c+d*x)^2)^(1/2)*tan(c+d*x)^3+-1*b^2*d^-1*(b*tan(c+d*x)^2)^(1/2)*cot(c+d*x)*log(cos(c+d*x)))
@test integrate((b*tan(c+d*x)^2)^3//2, x) == :((1/2)*b*d^-1*(b*tan(c+d*x)^2)^(1/2)*tan(c+d*x)+b*d^-1*(b*tan(c+d*x)^2)^(1/2)*cot(c+d*x)*log(cos(c+d*x)))
@test integrate((b*tan(c+d*x)^2)^(1/2), x) == :(-1*d^-1*(b*tan(c+d*x)^2)^(1/2)*cot(c+d*x)*log(cos(c+d*x)))
@test integrate((b*tan(c+d*x)^2)^-1//2, x) == :(d^-1*(b*tan(c+d*x)^2)^-1//2*log(sin(c+d*x))*tan(c+d*x))
@test integrate((b*tan(c+d*x)^2)^-3//2, x) == :(-1//2*b^-1*d^-1*(b*tan(c+d*x)^2)^-1//2*cot(c+d*x)+-1*b^-1*d^-1*(b*tan(c+d*x)^2)^-1//2*log(sin(c+d*x))*tan(c+d*x))
@test integrate((b*tan(c+d*x)^2)^-5//2, x) == :((1/2)*b^-2*d^-1*(b*tan(c+d*x)^2)^-1//2*cot(c+d*x)+-1//4*b^-2*d^-1*(b*tan(c+d*x)^2)^-1//2*cot(c+d*x)^3+b^-2*d^-1*(b*tan(c+d*x)^2)^-1//2*log(sin(c+d*x))*tan(c+d*x))
@test integrate((b*tan(c+d*x)^3)^5//2, x) == :(-2*b^2*d^-1*(b*tan(c+d*x)^3)^(1/2)*cot(c+d*x)+-2//9*b^2*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^3+2//5*b^2*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)+2//13*b^2*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^5+(1/2)*2^(1/2)*b^2*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*arctan(1+2^(1/2)*tan(c+d*x)^(1/2))+-1//2*2^(1/2)*b^2*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*arctan(1+-1*2^(1/2)*tan(c+d*x)^(1/2))+-1//4*2^(1/2)*b^2*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*log(1+-1*2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x))+1//4*2^(1/2)*b^2*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*log(1+2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x)))
@test integrate((b*tan(c+d*x)^3)^3//2, x) == :(-2//3*b*d^-1*(b*tan(c+d*x)^3)^(1/2)+2//7*b*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^2+(1/2)*b*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*arctan(1+2^(1/2)*tan(c+d*x)^(1/2))+-1//2*b*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*arctan(1+-1*2^(1/2)*tan(c+d*x)^(1/2))+-1//4*b*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*log(1+2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x))+1//4*b*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*log(1+-1*2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x)))
@test integrate((b*tan(c+d*x)^3)^(1/2), x) == :(2*d^-1*(b*tan(c+d*x)^3)^(1/2)*cot(c+d*x)+(1/2)*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*arctan(1+-1*2^(1/2)*tan(c+d*x)^(1/2))+-1//2*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*arctan(1+2^(1/2)*tan(c+d*x)^(1/2))+-1//4*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*log(1+2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x))+1//4*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^(1/2)*tan(c+d*x)^-3//2*log(1+-1*2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x)))
@test integrate((b*tan(c+d*x)^3)^-1//2, x) == :(-2*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)+(1/2)*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*arctan(1+-1*2^(1/2)*tan(c+d*x)^(1/2))+-1//2*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*arctan(1+2^(1/2)*tan(c+d*x)^(1/2))+-1//4*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*log(1+-1*2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x))+1//4*2^(1/2)*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*log(1+2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x)))
@test integrate((b*tan(c+d*x)^3)^-3//2, x) == :(2//3*b^-1*d^-1*(b*tan(c+d*x)^3)^-1//2+-2//7*b^-1*d^-1*(b*tan(c+d*x)^3)^-1//2*cot(c+d*x)^2+(1/2)*2^(1/2)*b^-1*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*arctan(1+2^(1/2)*tan(c+d*x)^(1/2))+-1//2*2^(1/2)*b^-1*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*arctan(1+-1*2^(1/2)*tan(c+d*x)^(1/2))+-1//4*2^(1/2)*b^-1*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*log(1+-1*2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x))+1//4*2^(1/2)*b^-1*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*log(1+2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x)))
@test integrate((b*tan(c+d*x)^3)^-5//2, x) == :(2*b^-2*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)+-2//5*b^-2*d^-1*(b*tan(c+d*x)^3)^-1//2*cot(c+d*x)+-2//13*b^-2*d^-1*(b*tan(c+d*x)^3)^-1//2*cot(c+d*x)^5+2//9*b^-2*d^-1*(b*tan(c+d*x)^3)^-1//2*cot(c+d*x)^3+(1/2)*2^(1/2)*b^-2*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*arctan(1+2^(1/2)*tan(c+d*x)^(1/2))+-1//2*2^(1/2)*b^-2*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*arctan(1+-1*2^(1/2)*tan(c+d*x)^(1/2))+-1//4*2^(1/2)*b^-2*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*log(1+2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x))+1//4*2^(1/2)*b^-2*d^-1*(b*tan(c+d*x)^3)^-1//2*tan(c+d*x)^3//2*log(1+-1*2^(1/2)*tan(c+d*x)^(1/2)+tan(c+d*x)))
@test integrate((b*tan(c+d*x)^4)^5//2, x) == :(b^2*d^-1*(b*tan(c+d*x)^4)^(1/2)*cot(c+d*x)+-1*x*b^2*(b*tan(c+d*x)^4)^(1/2)*cot(c+d*x)^2+-1//3*b^2*d^-1*(b*tan(c+d*x)^4)^(1/2)*tan(c+d*x)+-1//7*b^2*d^-1*(b*tan(c+d*x)^4)^(1/2)*tan(c+d*x)^5+1//5*b^2*d^-1*(b*tan(c+d*x)^4)^(1/2)*tan(c+d*x)^3+1//9*b^2*d^-1*(b*tan(c+d*x)^4)^(1/2)*tan(c+d*x)^7)
@test integrate((b*tan(c+d*x)^4)^3//2, x) == :(b*d^-1*(b*tan(c+d*x)^4)^(1/2)*cot(c+d*x)+-1*b*x*(b*tan(c+d*x)^4)^(1/2)*cot(c+d*x)^2+-1//3*b*d^-1*(b*tan(c+d*x)^4)^(1/2)*tan(c+d*x)+1//5*b*d^-1*(b*tan(c+d*x)^4)^(1/2)*tan(c+d*x)^3)
@test integrate((b*tan(c+d*x)^4)^(1/2), x) == :(d^-1*(b*tan(c+d*x)^4)^(1/2)*cot(c+d*x)+-1*x*(b*tan(c+d*x)^4)^(1/2)*cot(c+d*x)^2)
@test integrate((b*tan(c+d*x)^4)^-1//2, x) == :(-1*x*(b*tan(c+d*x)^4)^-1//2*tan(c+d*x)^2+-1*d^-1*(b*tan(c+d*x)^4)^-1//2*tan(c+d*x))
@test integrate((b*tan(c+d*x)^4)^-3//2, x) == :(-1*x*b^-1*(b*tan(c+d*x)^4)^-1//2*tan(c+d*x)^2+-1*b^-1*d^-1*(b*tan(c+d*x)^4)^-1//2*tan(c+d*x)+-1//5*b^-1*d^-1*(b*tan(c+d*x)^4)^-1//2*cot(c+d*x)^3+1//3*b^-1*d^-1*(b*tan(c+d*x)^4)^-1//2*cot(c+d*x))
@test integrate((b*tan(c+d*x)^4)^-5//2, x) == :(-1*x*b^-2*(b*tan(c+d*x)^4)^-1//2*tan(c+d*x)^2+-1*b^-2*d^-1*(b*tan(c+d*x)^4)^-1//2*tan(c+d*x)+-1//5*b^-2*d^-1*(b*tan(c+d*x)^4)^-1//2*cot(c+d*x)^3+-1//9*b^-2*d^-1*(b*tan(c+d*x)^4)^-1//2*cot(c+d*x)^7+1//3*b^-2*d^-1*(b*tan(c+d*x)^4)^-1//2*cot(c+d*x)+1//7*b^-2*d^-1*(b*tan(c+d*x)^4)^-1//2*cot(c+d*x)^5)
@test integrate((b*tan(c+d*x)^p)^(p^-1), x) == :(-1*d^-1*(b*tan(c+d*x)^p)^(p^-1)*cot(c+d*x)*log(cos(c+d*x)))
@test integrate((d*tan(a+b*x))^(1/2)*sin(a+b*x)^4, x) == :(-21//64*2^(1/2)*b^-1*d^(1/2)*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-21//128*2^(1/2)*b^-1*d^(1/2)*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x))+-7//16*b^-1*d^-1*(d*tan(a+b*x))^3//2*cos(a+b*x)^2+-1//4*b^-1*d^-3*(d*tan(a+b*x))^7//2*cos(a+b*x)^4+21//64*2^(1/2)*b^-1*d^(1/2)*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+21//128*2^(1/2)*b^-1*d^(1/2)*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2)))
@test integrate((d*tan(a+b*x))^(1/2)*sin(a+b*x)^2, x) == :(-3//8*2^(1/2)*b^-1*d^(1/2)*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-3//16*2^(1/2)*b^-1*d^(1/2)*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x))+-1//2*b^-1*d^-1*(d*tan(a+b*x))^3//2*cos(a+b*x)^2+3//8*2^(1/2)*b^-1*d^(1/2)*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+3//16*2^(1/2)*b^-1*d^(1/2)*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2)))
@test integrate((d*tan(a+b*x))^(1/2)*csc(a+b*x)^2, x) == :(-2*d*b^-1*(d*tan(a+b*x))^-1//2)
@test integrate((d*tan(a+b*x))^(1/2)*csc(a+b*x)^4, x) == :(-2*d*b^-1*(d*tan(a+b*x))^-1//2+-2//5*b^-1*d^3*(d*tan(a+b*x))^-5//2)
@test integrate((d*tan(a+b*x))^(1/2)*csc(a+b*x)^6, x) == :(-2*d*b^-1*(d*tan(a+b*x))^-1//2+-4//5*b^-1*d^3*(d*tan(a+b*x))^-5//2+-2//9*b^-1*d^5*(d*tan(a+b*x))^-9//2)
@test integrate((d*tan(a+b*x))^(1/2)*sin(a+b*x)^3, x) == :(-5//6*d*b^-1*(d*tan(a+b*x))^-1//2*sin(a+b*x)+-1//3*d*b^-1*(d*tan(a+b*x))^-1//2*sin(a+b*x)^3+5//12*b^-1*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^(1/2)*sin(a+b*x), x) == :(-1*d*b^-1*(d*tan(a+b*x))^-1//2*sin(a+b*x)+(1/2)*b^-1*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^(1/2)*csc(a+b*x), x) == :(b^-1*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^(1/2)*csc(a+b*x)^3, x) == :(-2//3*d*b^-1*(d*tan(a+b*x))^-1//2*csc(a+b*x)+2//3*b^-1*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^(1/2)*csc(a+b*x)^5, x) == :(-4//7*d*b^-1*(d*tan(a+b*x))^-1//2*csc(a+b*x)+-2//7*d*b^-1*(d*tan(a+b*x))^-1//2*csc(a+b*x)^3+4//7*b^-1*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^3//2*sin(a+b*x)^4, x) == :(45//16*d*b^-1*(d*tan(a+b*x))^(1/2)+-45//64*2^(1/2)*b^-1*d^3//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-45//128*2^(1/2)*b^-1*d^3//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x))+-9//16*b^-1*d^-1*(d*tan(a+b*x))^5//2*cos(a+b*x)^2+-1//4*b^-1*d^-3*(d*tan(a+b*x))^9//2*cos(a+b*x)^4+45//64*2^(1/2)*b^-1*d^3//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+45//128*2^(1/2)*b^-1*d^3//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2)))
@test integrate((d*tan(a+b*x))^3//2*sin(a+b*x)^2, x) == :(5//2*d*b^-1*(d*tan(a+b*x))^(1/2)+-5//8*2^(1/2)*b^-1*d^3//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-5//16*2^(1/2)*b^-1*d^3//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x))+-1//2*b^-1*d^-1*(d*tan(a+b*x))^5//2*cos(a+b*x)^2+5//8*2^(1/2)*b^-1*d^3//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+5//16*2^(1/2)*b^-1*d^3//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2)))
@test integrate((d*tan(a+b*x))^3//2*csc(a+b*x)^2, x) == :(2*d*b^-1*(d*tan(a+b*x))^(1/2))
@test integrate((d*tan(a+b*x))^3//2*csc(a+b*x)^4, x) == :(2*d*b^-1*(d*tan(a+b*x))^(1/2)+-2//3*b^-1*d^3*(d*tan(a+b*x))^-3//2)
@test integrate((d*tan(a+b*x))^3//2*csc(a+b*x)^6, x) == :(2*d*b^-1*(d*tan(a+b*x))^(1/2)+-4//3*b^-1*d^3*(d*tan(a+b*x))^-3//2+-2//7*b^-1*d^5*(d*tan(a+b*x))^-7//2)
@test integrate((d*tan(a+b*x))^3//2*sin(a+b*x)^3, x) == :(2*d*b^-1*(d*tan(a+b*x))^(1/2)*sin(a+b*x)^3+7//3*b^-1*d^3*(d*tan(a+b*x))^-3//2*sin(a+b*x)^3+-7//2*b^-1*d^2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^3//2*sin(a+b*x), x) == :(2*d*b^-1*(d*tan(a+b*x))^(1/2)*sin(a+b*x)+-3*b^-1*d^2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^3//2*csc(a+b*x), x) == :(2*d*b^-1*(d*tan(a+b*x))^(1/2)*sin(a+b*x)+-2*b^-1*d^2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^3//2*csc(a+b*x)^3, x) == :(-4*b^-1*d^2*(d*tan(a+b*x))^-1//2*cos(a+b*x)+2*d*b^-1*(d*tan(a+b*x))^(1/2)*csc(a+b*x)+-4*b^-1*d^2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^5//2*sin(a+b*x)^4, x) == :(77//48*d*b^-1*(d*tan(a+b*x))^3//2+-77//64*2^(1/2)*b^-1*d^5//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-77//128*2^(1/2)*b^-1*d^5//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2))+-11//16*b^-1*d^-1*(d*tan(a+b*x))^7//2*cos(a+b*x)^2+-1//4*b^-1*d^-3*(d*tan(a+b*x))^11//2*cos(a+b*x)^4+77//64*2^(1/2)*b^-1*d^5//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+77//128*2^(1/2)*b^-1*d^5//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x)))
@test integrate((d*tan(a+b*x))^5//2*sin(a+b*x)^2, x) == :(7//6*d*b^-1*(d*tan(a+b*x))^3//2+-7//8*2^(1/2)*b^-1*d^5//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-7//16*2^(1/2)*b^-1*d^5//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2))+-1//2*b^-1*d^-1*(d*tan(a+b*x))^7//2*cos(a+b*x)^2+7//8*2^(1/2)*b^-1*d^5//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+7//16*2^(1/2)*b^-1*d^5//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x)))
@test integrate((d*tan(a+b*x))^5//2*csc(a+b*x)^2, x) == :(2//3*d*b^-1*(d*tan(a+b*x))^3//2)
@test integrate((d*tan(a+b*x))^5//2*csc(a+b*x)^4, x) == :(-2*b^-1*d^3*(d*tan(a+b*x))^-1//2+2//3*d*b^-1*(d*tan(a+b*x))^3//2)
@test integrate((d*tan(a+b*x))^5//2*csc(a+b*x)^6, x) == :(-4*b^-1*d^3*(d*tan(a+b*x))^-1//2+-2//5*b^-1*d^5*(d*tan(a+b*x))^-5//2+2//3*d*b^-1*(d*tan(a+b*x))^3//2)
@test integrate((d*tan(a+b*x))^5//2*sin(a+b*x)^3, x) == :(b^-1*d^3*(d*tan(a+b*x))^-1//2*sin(a+b*x)^3+2//3*d*b^-1*(d*tan(a+b*x))^3//2*sin(a+b*x)^3+5//2*b^-1*d^3*(d*tan(a+b*x))^-1//2*sin(a+b*x)+-5//4*b^-1*d^2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^5//2*sin(a+b*x), x) == :(2//3*d*b^-1*(d*tan(a+b*x))^3//2*sin(a+b*x)+5//3*b^-1*d^3*(d*tan(a+b*x))^-1//2*sin(a+b*x)+-5//6*b^-1*d^2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^5//2*csc(a+b*x), x) == :(2//3*d*b^-1*(d*tan(a+b*x))^3//2*csc(a+b*x)+-1//3*b^-1*d^2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^5//2*csc(a+b*x)^3, x) == :(2//3*d*b^-1*(d*tan(a+b*x))^3//2*csc(a+b*x)+2//3*b^-1*d^2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^5//2*csc(a+b*x)^5, x) == :(-4//3*b^-1*d^3*(d*tan(a+b*x))^-1//2*csc(a+b*x)+2//3*d*b^-1*(d*tan(a+b*x))^3//2*csc(a+b*x)^3+4//3*b^-1*d^2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^5//2*csc(a+b*x)^7, x) == :(-40//21*b^-1*d^3*(d*tan(a+b*x))^-1//2*csc(a+b*x)+-20//21*b^-1*d^3*(d*tan(a+b*x))^-1//2*csc(a+b*x)^3+2//3*d*b^-1*(d*tan(a+b*x))^3//2*csc(a+b*x)^5+40//21*b^-1*d^2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^-1//2*sin(a+b*x)^4, x) == :(-5//16*b^-1*d^-1*(d*tan(a+b*x))^(1/2)*cos(a+b*x)^2+-5//64*2^(1/2)*b^-1*d^-1//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-5//128*2^(1/2)*b^-1*d^-1//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2))+-1//4*b^-1*d^-3*(d*tan(a+b*x))^5//2*cos(a+b*x)^4+5//64*2^(1/2)*b^-1*d^-1//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+5//128*2^(1/2)*b^-1*d^-1//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x)))
@test integrate((d*tan(a+b*x))^-1//2*sin(a+b*x)^2, x) == :(-1//2*b^-1*d^-1*(d*tan(a+b*x))^(1/2)*cos(a+b*x)^2+-1//8*2^(1/2)*b^-1*d^-1//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-1//16*2^(1/2)*b^-1*d^-1//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2))+1//8*2^(1/2)*b^-1*d^-1//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+1//16*2^(1/2)*b^-1*d^-1//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x)))
@test integrate((d*tan(a+b*x))^-1//2*csc(a+b*x)^2, x) == :(-2//3*d*b^-1*(d*tan(a+b*x))^-3//2)
@test integrate((d*tan(a+b*x))^-1//2*csc(a+b*x)^4, x) == :(-2//3*d*b^-1*(d*tan(a+b*x))^-3//2+-2//7*b^-1*d^3*(d*tan(a+b*x))^-7//2)
@test integrate((d*tan(a+b*x))^-1//2*csc(a+b*x)^6, x) == :(-4//7*b^-1*d^3*(d*tan(a+b*x))^-7//2+-2//3*d*b^-1*(d*tan(a+b*x))^-3//2+-2//11*b^-1*d^5*(d*tan(a+b*x))^-11//2)
@test integrate((d*tan(a+b*x))^-1//2*sin(a+b*x)^5, x) == :(-7//30*d*b^-1*(d*tan(a+b*x))^-3//2*sin(a+b*x)^3+-1//5*d*b^-1*(d*tan(a+b*x))^-3//2*sin(a+b*x)^5+7//20*b^-1*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^-1//2*sin(a+b*x)^3, x) == :(-1//3*d*b^-1*(d*tan(a+b*x))^-3//2*sin(a+b*x)^3+(1/2)*b^-1*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^-1//2*sin(a+b*x), x) == :(b^-1*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^-1//2*csc(a+b*x), x) == :(-2*b^-1*(d*tan(a+b*x))^-1//2*cos(a+b*x)+-2*b^-1*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^-1//2*csc(a+b*x)^3, x) == :(-4//5*b^-1*(d*tan(a+b*x))^-1//2*cos(a+b*x)+-2//5*d*b^-1*(d*tan(a+b*x))^-3//2*csc(a+b*x)+-4//5*b^-1*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^-3//2*sin(a+b*x)^4, x) == :(-3//64*2^(1/2)*b^-1*d^-3//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-3//128*2^(1/2)*b^-1*d^-3//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x))+-1//4*b^-1*d^-3*(d*tan(a+b*x))^3//2*cos(a+b*x)^4+3//16*b^-1*d^-3*(d*tan(a+b*x))^3//2*cos(a+b*x)^2+3//64*2^(1/2)*b^-1*d^-3//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+3//128*2^(1/2)*b^-1*d^-3//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2)))
@test integrate((d*tan(a+b*x))^-3//2*sin(a+b*x)^2, x) == :((1/2)*b^-1*d^-3*(d*tan(a+b*x))^3//2*cos(a+b*x)^2+-1//8*2^(1/2)*b^-1*d^-3//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-1//16*2^(1/2)*b^-1*d^-3//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x))+1//8*2^(1/2)*b^-1*d^-3//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+1//16*2^(1/2)*b^-1*d^-3//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2)))
@test integrate((d*tan(a+b*x))^-3//2*csc(a+b*x)^2, x) == :(-2//5*d*b^-1*(d*tan(a+b*x))^-5//2)
@test integrate((d*tan(a+b*x))^-3//2*csc(a+b*x)^4, x) == :(-2//5*d*b^-1*(d*tan(a+b*x))^-5//2+-2//9*b^-1*d^3*(d*tan(a+b*x))^-9//2)
@test integrate((d*tan(a+b*x))^-3//2*csc(a+b*x)^6, x) == :(-4//9*b^-1*d^3*(d*tan(a+b*x))^-9//2+-2//5*d*b^-1*(d*tan(a+b*x))^-5//2+-2//13*b^-1*d^5*(d*tan(a+b*x))^-13//2)
@test integrate((d*tan(a+b*x))^-3//2*sin(a+b*x)^3, x) == :(-1//6*b^-1*d^-1*(d*tan(a+b*x))^-1//2*sin(a+b*x)+1//3*b^-1*d^-1*(d*tan(a+b*x))^-1//2*sin(a+b*x)^3+1//12*b^-1*d^-2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^-3//2*sin(a+b*x), x) == :(b^-1*d^-1*(d*tan(a+b*x))^-1//2*sin(a+b*x)+(1/2)*b^-1*d^-1*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*sec(a+b*x))
@test integrate((d*tan(a+b*x))^-3//2*csc(a+b*x), x) == :(-2//3*b^-1*d^-1*(d*tan(a+b*x))^-1//2*csc(a+b*x)+-1//3*b^-1*d^-2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^-3//2*csc(a+b*x)^3, x) == :(-2//7*b^-1*d^-1*(d*tan(a+b*x))^-1//2*csc(a+b*x)^3+2//21*b^-1*d^-1*(d*tan(a+b*x))^-1//2*csc(a+b*x)+-2//21*b^-1*d^-2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*csc(a+b*x))
@test integrate((d*tan(a+b*x))^-5//2*sin(a+b*x)^4, x) == :(-3//64*2^(1/2)*b^-1*d^-5//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-3//128*2^(1/2)*b^-1*d^-5//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2))+-1//4*b^-1*d^-3*(d*tan(a+b*x))^(1/2)*cos(a+b*x)^4+1//16*b^-1*d^-3*(d*tan(a+b*x))^(1/2)*cos(a+b*x)^2+3//64*2^(1/2)*b^-1*d^-5//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+3//128*2^(1/2)*b^-1*d^-5//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x)))
@test integrate((d*tan(a+b*x))^-5//2*sin(a+b*x)^2, x) == :((1/2)*b^-1*d^-3*(d*tan(a+b*x))^(1/2)*cos(a+b*x)^2+-3//8*2^(1/2)*b^-1*d^-5//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-3//16*2^(1/2)*b^-1*d^-5//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2))+3//8*2^(1/2)*b^-1*d^-5//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+3//16*2^(1/2)*b^-1*d^-5//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x)))
@test integrate((d*tan(a+b*x))^-5//2*csc(a+b*x)^2, x) == :(-2//7*d*b^-1*(d*tan(a+b*x))^-7//2)
@test integrate((d*tan(a+b*x))^-5//2*csc(a+b*x)^4, x) == :(-2//7*d*b^-1*(d*tan(a+b*x))^-7//2+-2//11*b^-1*d^3*(d*tan(a+b*x))^-11//2)
@test integrate((d*tan(a+b*x))^-5//2*csc(a+b*x)^6, x) == :(-4//11*b^-1*d^3*(d*tan(a+b*x))^-11//2+-2//7*d*b^-1*(d*tan(a+b*x))^-7//2+-2//15*b^-1*d^5*(d*tan(a+b*x))^-15//2)
@test integrate((d*tan(a+b*x))^-5//2*sin(a+b*x)^7, x) == :(-3//70*b^-1*d^-1*(d*tan(a+b*x))^-3//2*sin(a+b*x)^5+-1//20*b^-1*d^-1*(d*tan(a+b*x))^-3//2*sin(a+b*x)^3+1//7*b^-1*d^-1*(d*tan(a+b*x))^-3//2*sin(a+b*x)^7+3//40*b^-1*d^-2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^-5//2*sin(a+b*x)^5, x) == :(-1//10*b^-1*d^-1*(d*tan(a+b*x))^-3//2*sin(a+b*x)^3+1//5*b^-1*d^-1*(d*tan(a+b*x))^-3//2*sin(a+b*x)^5+3//20*b^-1*d^-2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^-5//2*sin(a+b*x)^3, x) == :(1//3*b^-1*d^-1*(d*tan(a+b*x))^-3//2*sin(a+b*x)^3+(1/2)*b^-1*d^-2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^-5//2*sin(a+b*x), x) == :(-2*b^-1*d^-1*(d*tan(a+b*x))^-3//2*sin(a+b*x)+-3*b^-1*d^-2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^-5//2*csc(a+b*x), x) == :(-2//5*b^-1*d^-1*(d*tan(a+b*x))^-3//2*csc(a+b*x)+6//5*b^-1*d^-2*(d*tan(a+b*x))^-1//2*cos(a+b*x)+6//5*b^-1*d^-2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((d*tan(a+b*x))^-5//2*csc(a+b*x)^3, x) == :(-2//9*b^-1*d^-1*(d*tan(a+b*x))^-3//2*csc(a+b*x)^3+2//15*b^-1*d^-1*(d*tan(a+b*x))^-3//2*csc(a+b*x)+4//15*b^-1*d^-2*(d*tan(a+b*x))^-1//2*cos(a+b*x)+4//15*b^-1*d^-2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*sin(a+b*x))
@test integrate((a*sin(e+f*x))^5//2*(b*tan(e+f*x))^(1/2), x) == :(-2//5*b*f^-1*(a*sin(e+f*x))^5//2*(b*tan(e+f*x))^-1//2+-8//5*b*a^2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2)
@test integrate((a*sin(e+f*x))^3//2*(b*tan(e+f*x))^(1/2), x) == :(-2//3*b*f^-1*(a*sin(e+f*x))^3//2*(b*tan(e+f*x))^-1//2+4//3*a^2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*Elliptic.F((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^(1/2), x) == :(-2*b*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2)
@test integrate((a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2), x) == :(2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*Elliptic.F((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^-3//2*(b*tan(e+f*x))^(1/2), x) == :(-1*a^-1*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*arctan(cos(e+f*x)^(1/2))+-1*a^-1*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*arctanh(cos(e+f*x)^(1/2)))
@test integrate((a*sin(e+f*x))^-5//2*(b*tan(e+f*x))^(1/2), x) == :(-1*b*a^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^-1//2+a^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*Elliptic.F((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^5//2*(b*tan(e+f*x))^3//2, x) == :(-2//5*b*f^-1*(a*sin(e+f*x))^5//2*(b*tan(e+f*x))^(1/2)+12//5*b*a^2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^(1/2)+-24//5*a^2*b^2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*Elliptic.E((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^3//2*(b*tan(e+f*x))^3//2, x) == :(-2//3*b*f^-1*(a*sin(e+f*x))^3//2*(b*tan(e+f*x))^(1/2)+8//3*b*a^2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2))
@test integrate((a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^3//2, x) == :(2*b*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^(1/2)+-4*b^2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*Elliptic.E((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^3//2, x) == :(2*b*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2))
@test integrate((a*sin(e+f*x))^-3//2*(b*tan(e+f*x))^3//2, x) == :(2*b*a^-2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^(1/2)+-2*a^-2*b^2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*Elliptic.E((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^-5//2*(b*tan(e+f*x))^3//2, x) == :(2*b*a^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)+a^-3*b^2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*arctan(cos(e+f*x)^(1/2))+-1*a^-3*b^2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*arctanh(cos(e+f*x)^(1/2)))
@test integrate((a*sin(e+f*x))^9//2*(b*tan(e+f*x))^-1//2, x) == :(-2//9*b*f^-1*(a*sin(e+f*x))^9//2*(b*tan(e+f*x))^-3//2+-4//15*b*a^2*f^-1*(a*sin(e+f*x))^5//2*(b*tan(e+f*x))^-3//2+8//15*a^4*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*Elliptic.E((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^7//2*(b*tan(e+f*x))^-1//2, x) == :(-2//7*b*f^-1*(a*sin(e+f*x))^7//2*(b*tan(e+f*x))^-3//2+-8//21*b*a^2*f^-1*(a*sin(e+f*x))^3//2*(b*tan(e+f*x))^-3//2)
@test integrate((a*sin(e+f*x))^5//2*(b*tan(e+f*x))^-1//2, x) == :(-2//5*b*f^-1*(a*sin(e+f*x))^5//2*(b*tan(e+f*x))^-3//2+4//5*a^2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*Elliptic.E((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^3//2*(b*tan(e+f*x))^-1//2, x) == :(-2//3*b*f^-1*(a*sin(e+f*x))^3//2*(b*tan(e+f*x))^-3//2)
@test integrate((a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2, x) == :(2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*Elliptic.E((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^-1//2, x) == :(a^-1*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*arctan(cos(e+f*x)^(1/2))+-1*a^-1*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*arctanh(cos(e+f*x)^(1/2)))
@test integrate((a*sin(e+f*x))^-3//2*(b*tan(e+f*x))^-1//2, x) == :(-1*b*a^-2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-3//2+-1*a^-2*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*Elliptic.E((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^-5//2*(b*tan(e+f*x))^-1//2, x) == :(-1//2*b*a^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^-3//2+-1//4*a^-3*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*arctanh(cos(e+f*x)^(1/2))+1//4*a^-3*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*cos(e+f*x)^-1//2*arctan(cos(e+f*x)^(1/2)))
@test integrate((a*sin(e+f*x))^13//2*(b*tan(e+f*x))^-3//2, x) == :(2//13*b^-1*f^-1*(a*sin(e+f*x))^13//2*(b*tan(e+f*x))^-1//2+-64//585*a^6*b^-1*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2+-16//585*a^4*b^-1*f^-1*(a*sin(e+f*x))^5//2*(b*tan(e+f*x))^-1//2+-2//117*a^2*b^-1*f^-1*(a*sin(e+f*x))^9//2*(b*tan(e+f*x))^-1//2)
@test integrate((a*sin(e+f*x))^9//2*(b*tan(e+f*x))^-3//2, x) == :(2//9*b^-1*f^-1*(a*sin(e+f*x))^9//2*(b*tan(e+f*x))^-1//2+-8//45*a^4*b^-1*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2+-2//45*a^2*b^-1*f^-1*(a*sin(e+f*x))^5//2*(b*tan(e+f*x))^-1//2)
@test integrate((a*sin(e+f*x))^5//2*(b*tan(e+f*x))^-3//2, x) == :(-2//5*b*f^-1*(a*sin(e+f*x))^5//2*(b*tan(e+f*x))^-5//2)
@test integrate((a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-3//2, x) == :(2*b^-1*f^-1*(a*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2+-1*a*b^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*arctan(cos(e+f*x)^(1/2))+-1*a*b^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*arctanh(cos(e+f*x)^(1/2)))
@test integrate((a*sin(e+f*x))^-3//2*(b*tan(e+f*x))^-3//2, x) == :(-1//2*b^-1*f^-1*(a*sin(e+f*x))^-3//2*(b*tan(e+f*x))^-1//2+1//4*a^-1*b^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*arctan(cos(e+f*x)^(1/2))+1//4*a^-1*b^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*arctanh(cos(e+f*x)^(1/2)))
@test integrate((a*sin(e+f*x))^11//2*(b*tan(e+f*x))^-3//2, x) == :(2//11*b^-1*f^-1*(a*sin(e+f*x))^11//2*(b*tan(e+f*x))^-1//2+-4//77*a^4*b^-1*f^-1*(a*sin(e+f*x))^3//2*(b*tan(e+f*x))^-1//2+-2//77*a^2*b^-1*f^-1*(a*sin(e+f*x))^7//2*(b*tan(e+f*x))^-1//2+8//77*a^6*b^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*Elliptic.F((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^7//2*(b*tan(e+f*x))^-3//2, x) == :(2//7*b^-1*f^-1*(a*sin(e+f*x))^7//2*(b*tan(e+f*x))^-1//2+-2//21*a^2*b^-1*f^-1*(a*sin(e+f*x))^3//2*(b*tan(e+f*x))^-1//2+4//21*a^4*b^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*Elliptic.F((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^3//2*(b*tan(e+f*x))^-3//2, x) == :(2//3*b^-1*f^-1*(a*sin(e+f*x))^3//2*(b*tan(e+f*x))^-1//2+2//3*a^2*b^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*Elliptic.F((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^-3//2, x) == :(-1*b^-1*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^-1//2+-1*b^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*Elliptic.F((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^-5//2*(b*tan(e+f*x))^-3//2, x) == :(-1//3*b^-1*f^-1*(a*sin(e+f*x))^-5//2*(b*tan(e+f*x))^-1//2+1//6*a^-2*b^-1*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^-1//2+-1//6*a^-2*b^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*Elliptic.F((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^-9//2*(b*tan(e+f*x))^-3//2, x) == :(-1//5*b^-1*f^-1*(a*sin(e+f*x))^-9//2*(b*tan(e+f*x))^-1//2+1//12*a^-4*b^-1*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^-1//2+1//30*a^-2*b^-1*f^-1*(a*sin(e+f*x))^-5//2*(b*tan(e+f*x))^-1//2+-1//12*a^-4*b^-2*f^-1*(a*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*cos(e+f*x)^(1/2)*Elliptic.F((1/2)*e+(1/2)*f*x,2))
@test integrate((a*sin(e+f*x))^m*cot(e+f*x), x) == :(f^-1*m^-1*(a*sin(e+f*x))^m)
@test integrate((a*sin(e+f*x))^m*cot(e+f*x)^3, x) == :(-1*f^-1*m^-1*(a*sin(e+f*x))^m+-1*a^2*f^-1*(a*sin(e+f*x))^(-2+m)*(2+-1m)^-1)
@test integrate((a*sin(e+f*x))^m*cot(e+f*x)^5, x) == :(f^-1*m^-1*(a*sin(e+f*x))^m+-1*a^4*f^-1*(a*sin(e+f*x))^(-4+m)*(4+-1m)^-1+2*a^2*f^-1*(a*sin(e+f*x))^(-2+m)*(2+-1m)^-1)
@test integrate((b*tan(e+f*x))^n*csc(e+f*x)^2, x) == :(-1*b*f^-1*(b*tan(e+f*x))^(-1+n)*(1+-1n)^-1)
@test integrate((b*tan(e+f*x))^n*csc(e+f*x)^4, x) == :(-1*b*f^-1*(b*tan(e+f*x))^(-1+n)*(1+-1n)^-1+-1*b^3*f^-1*(b*tan(e+f*x))^(-3+n)*(3+-1n)^-1)
@test integrate((b*tan(e+f*x))^n*csc(e+f*x)^6, x) == :(-1*b*f^-1*(b*tan(e+f*x))^(-1+n)*(1+-1n)^-1+-1*b^5*f^-1*(b*tan(e+f*x))^(-5+n)*(5+-1n)^-1+-2*b^3*f^-1*(b*tan(e+f*x))^(-3+n)*(3+-1n)^-1)
@test integrate((d*cot(e+f*x))^(1/2)*tan(e+f*x)^4, x) == :(-2*d*f^-1*(d*cot(e+f*x))^-1//2+2//5*d^3*f^-1*(d*cot(e+f*x))^-5//2+(1/2)*2^(1/2)*d^(1/2)*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^(1/2)*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^(1/2)*tan(e+f*x)^3, x) == :(2//3*d^2*f^-1*(d*cot(e+f*x))^-3//2+(1/2)*2^(1/2)*d^(1/2)*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^(1/2)*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^(1/2)*tan(e+f*x)^2, x) == :(2*d*f^-1*(d*cot(e+f*x))^-1//2+(1/2)*2^(1/2)*d^(1/2)*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^(1/2)*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^(1/2)*tan(e+f*x), x) == :((1/2)*2^(1/2)*d^(1/2)*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^(1/2)*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^(1/2), x) == :((1/2)*2^(1/2)*d^(1/2)*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^(1/2)*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^(1/2)*cot(e+f*x), x) == :(-2*f^-1*(d*cot(e+f*x))^(1/2)+(1/2)*2^(1/2)*d^(1/2)*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^(1/2)*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^(1/2)*cot(e+f*x)^2, x) == :(-2//3*d^-1*f^-1*(d*cot(e+f*x))^3//2+(1/2)*2^(1/2)*d^(1/2)*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^(1/2)*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^(1/2)*cot(e+f*x)^3, x) == :(2*f^-1*(d*cot(e+f*x))^(1/2)+-2//5*d^-2*f^-1*(d*cot(e+f*x))^5//2+(1/2)*2^(1/2)*d^(1/2)*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^(1/2)*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^3//2*tan(e+f*x)^5, x) == :(-2*d^2*f^-1*(d*cot(e+f*x))^-1//2+2//5*d^4*f^-1*(d*cot(e+f*x))^-5//2+(1/2)*2^(1/2)*d^3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^3//2*tan(e+f*x)^4, x) == :(2//3*d^3*f^-1*(d*cot(e+f*x))^-3//2+(1/2)*2^(1/2)*d^3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^3//2*tan(e+f*x)^3, x) == :(2*d^2*f^-1*(d*cot(e+f*x))^-1//2+(1/2)*2^(1/2)*d^3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^3//2*tan(e+f*x)^2, x) == :((1/2)*2^(1/2)*d^3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^3//2*tan(e+f*x), x) == :((1/2)*2^(1/2)*d^3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^3//2, x) == :(-2*d*f^-1*(d*cot(e+f*x))^(1/2)+(1/2)*2^(1/2)*d^3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^3//2*cot(e+f*x), x) == :(-2//3*f^-1*(d*cot(e+f*x))^3//2+(1/2)*2^(1/2)*d^3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^3//2*cot(e+f*x)^2, x) == :(2*d*f^-1*(d*cot(e+f*x))^(1/2)+-2//5*d^-1*f^-1*(d*cot(e+f*x))^5//2+(1/2)*2^(1/2)*d^3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^-1//2*tan(e+f*x)^3, x) == :(-2*f^-1*(d*cot(e+f*x))^-1//2+2//5*d^2*f^-1*(d*cot(e+f*x))^-5//2+(1/2)*2^(1/2)*d^-1//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-1//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^-1//2*tan(e+f*x)^2, x) == :(2//3*d*f^-1*(d*cot(e+f*x))^-3//2+(1/2)*2^(1/2)*d^-1//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-1//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^-1//2*tan(e+f*x), x) == :(2*f^-1*(d*cot(e+f*x))^-1//2+(1/2)*2^(1/2)*d^-1//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-1//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^-1//2, x) == :((1/2)*2^(1/2)*d^-1//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-1//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^-1//2*cot(e+f*x), x) == :((1/2)*2^(1/2)*d^-1//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-1//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^-1//2*cot(e+f*x)^2, x) == :(-2*d^-1*f^-1*(d*cot(e+f*x))^(1/2)+(1/2)*2^(1/2)*d^-1//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-1//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^-1//2*cot(e+f*x)^3, x) == :(-2//3*d^-2*f^-1*(d*cot(e+f*x))^3//2+(1/2)*2^(1/2)*d^-1//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-1//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^-1//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^-3//2*tan(e+f*x)^2, x) == :(-2*d^-1*f^-1*(d*cot(e+f*x))^-1//2+2//5*d*f^-1*(d*cot(e+f*x))^-5//2+(1/2)*2^(1/2)*d^-3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^-3//2*tan(e+f*x), x) == :(2//3*f^-1*(d*cot(e+f*x))^-3//2+(1/2)*2^(1/2)*d^-3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^-3//2, x) == :(2*d^-1*f^-1*(d*cot(e+f*x))^-1//2+(1/2)*2^(1/2)*d^-3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^-3//2*cot(e+f*x), x) == :((1/2)*2^(1/2)*d^-3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^-3//2*cot(e+f*x)^2, x) == :((1/2)*2^(1/2)*d^-3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^-3//2*cot(e+f*x)^3, x) == :(-2*d^-2*f^-1*(d*cot(e+f*x))^(1/2)+(1/2)*2^(1/2)*d^-3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2))+1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x)))
@test integrate((d*cot(e+f*x))^-3//2*cot(e+f*x)^4, x) == :(-2//3*d^-3*f^-1*(d*cot(e+f*x))^3//2+(1/2)*2^(1/2)*d^-3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*cot(e+f*x))^-3//2*cot(e+f*x)^5, x) == :(2*d^-2*f^-1*(d*cot(e+f*x))^(1/2)+-2//5*d^-4*f^-1*(d*cot(e+f*x))^5//2+(1/2)*2^(1/2)*d^-3//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//2*2^(1/2)*d^-3//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*cot(e+f*x))^(1/2))+-1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+2^(1/2)*(d*cot(e+f*x))^(1/2)+d^(1/2)*cot(e+f*x))+1//4*2^(1/2)*d^-3//2*f^-1*log(d^(1/2)+d^(1/2)*cot(e+f*x)+-1*2^(1/2)*(d*cot(e+f*x))^(1/2)))
@test integrate((d*tan(e+f*x))^(1/2)*sec(e+f*x)^6, x) == :(2//3*d^-1*f^-1*(d*tan(e+f*x))^3//2+2//11*d^-5*f^-1*(d*tan(e+f*x))^11//2+4//7*d^-3*f^-1*(d*tan(e+f*x))^7//2)
@test integrate((d*tan(e+f*x))^(1/2)*sec(e+f*x)^4, x) == :(2//3*d^-1*f^-1*(d*tan(e+f*x))^3//2+2//7*d^-3*f^-1*(d*tan(e+f*x))^7//2)
@test integrate((d*tan(e+f*x))^(1/2)*sec(e+f*x)^2, x) == :(2//3*d^-1*f^-1*(d*tan(e+f*x))^3//2)
@test integrate((d*tan(e+f*x))^(1/2), x) == :((1/2)*2^(1/2)*d^(1/2)*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*tan(e+f*x))^(1/2))+-1//2*2^(1/2)*d^(1/2)*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(e+f*x))^(1/2))+-1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+2^(1/2)*(d*tan(e+f*x))^(1/2)+d^(1/2)*tan(e+f*x))+1//4*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+d^(1/2)*tan(e+f*x)+-1*2^(1/2)*(d*tan(e+f*x))^(1/2)))
@test integrate((d*tan(e+f*x))^(1/2)*cos(e+f*x)^2, x) == :((1/2)*d^-1*f^-1*(d*tan(e+f*x))^3//2*cos(e+f*x)^2+-1//8*2^(1/2)*d^(1/2)*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(e+f*x))^(1/2))+-1//16*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+2^(1/2)*(d*tan(e+f*x))^(1/2)+d^(1/2)*tan(e+f*x))+1//8*2^(1/2)*d^(1/2)*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*tan(e+f*x))^(1/2))+1//16*2^(1/2)*d^(1/2)*f^-1*log(d^(1/2)+d^(1/2)*tan(e+f*x)+-1*2^(1/2)*(d*tan(e+f*x))^(1/2)))
@test integrate((d*tan(e+f*x))^(1/2)*sec(e+f*x)^3, x) == :(2//5*d^-1*f^-1*(d*tan(e+f*x))^3//2*sec(e+f*x)+4//5*d^-1*f^-1*(d*tan(e+f*x))^3//2*cos(e+f*x)+-4//5*f^-1*(d*tan(e+f*x))^(1/2)*sin(2*e+2*f*x)^-1//2*Elliptic.E(e+-1//4*pi+f*x,2)*cos(e+f*x))
@test integrate((d*tan(e+f*x))^(1/2)*sec(e+f*x), x) == :(2*d^-1*f^-1*(d*tan(e+f*x))^3//2*cos(e+f*x)+-2*f^-1*(d*tan(e+f*x))^(1/2)*sin(2*e+2*f*x)^-1//2*Elliptic.E(e+-1//4*pi+f*x,2)*cos(e+f*x))
@test integrate((d*tan(e+f*x))^(1/2)*cos(e+f*x), x) == :(f^-1*(d*tan(e+f*x))^(1/2)*sin(2*e+2*f*x)^-1//2*Elliptic.E(e+-1//4*pi+f*x,2)*cos(e+f*x))
@test integrate((d*tan(e+f*x))^(1/2)*cos(e+f*x)^3, x) == :(1//3*d^-1*f^-1*(d*tan(e+f*x))^3//2*cos(e+f*x)^3+(1/2)*f^-1*(d*tan(e+f*x))^(1/2)*sin(2*e+2*f*x)^-1//2*Elliptic.E(e+-1//4*pi+f*x,2)*cos(e+f*x))
@test integrate((d*tan(e+f*x))^(1/2)*cos(e+f*x)^5, x) == :(1//5*d^-1*f^-1*(d*tan(e+f*x))^3//2*cos(e+f*x)^5+7//30*d^-1*f^-1*(d*tan(e+f*x))^3//2*cos(e+f*x)^3+7//20*f^-1*(d*tan(e+f*x))^(1/2)*sin(2*e+2*f*x)^-1//2*Elliptic.E(e+-1//4*pi+f*x,2)*cos(e+f*x))
@test integrate((d*tan(a+b*x))^3//2*sec(a+b*x)^6, x) == :(2//5*b^-1*d^-1*(d*tan(a+b*x))^5//2+2//13*b^-1*d^-5*(d*tan(a+b*x))^13//2+4//9*b^-1*d^-3*(d*tan(a+b*x))^9//2)
@test integrate((d*tan(a+b*x))^3//2*sec(a+b*x)^4, x) == :(2//5*b^-1*d^-1*(d*tan(a+b*x))^5//2+2//9*b^-1*d^-3*(d*tan(a+b*x))^9//2)
@test integrate((d*tan(a+b*x))^3//2*sec(a+b*x)^2, x) == :(2//5*b^-1*d^-1*(d*tan(a+b*x))^5//2)
@test integrate((d*tan(a+b*x))^3//2, x) == :(2*d*b^-1*(d*tan(a+b*x))^(1/2)+(1/2)*2^(1/2)*b^-1*d^3//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-1//2*2^(1/2)*b^-1*d^3//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-1//4*2^(1/2)*b^-1*d^3//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x))+1//4*2^(1/2)*b^-1*d^3//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2)))
@test integrate((d*tan(a+b*x))^3//2*cos(a+b*x)^2, x) == :(-1//2*d*b^-1*(d*tan(a+b*x))^(1/2)*cos(a+b*x)^2+-1//8*2^(1/2)*b^-1*d^3//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-1//16*2^(1/2)*b^-1*d^3//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2))+1//8*2^(1/2)*b^-1*d^3//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+1//16*2^(1/2)*b^-1*d^3//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x)))
@test integrate((d*tan(a+b*x))^3//2*sec(a+b*x)^5, x) == :(-4//77*d*b^-1*(d*tan(a+b*x))^(1/2)*sec(a+b*x)+-2//77*d*b^-1*(d*tan(a+b*x))^(1/2)*sec(a+b*x)^3+2//11*d*b^-1*(d*tan(a+b*x))^(1/2)*sec(a+b*x)^5+-4//77*b^-1*d^2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*sec(a+b*x))
@test integrate((d*tan(a+b*x))^3//2*sec(a+b*x)^3, x) == :(-2//21*d*b^-1*(d*tan(a+b*x))^(1/2)*sec(a+b*x)+2//7*d*b^-1*(d*tan(a+b*x))^(1/2)*sec(a+b*x)^3+-2//21*b^-1*d^2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*sec(a+b*x))
@test integrate((d*tan(a+b*x))^3//2*sec(a+b*x), x) == :(2//3*d*b^-1*(d*tan(a+b*x))^(1/2)*sec(a+b*x)+-1//3*b^-1*d^2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*sec(a+b*x))
@test integrate((d*tan(a+b*x))^3//2*cos(a+b*x), x) == :(-1*d*b^-1*(d*tan(a+b*x))^(1/2)*cos(a+b*x)+(1/2)*b^-1*d^2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*sec(a+b*x))
@test integrate((d*tan(a+b*x))^3//2*cos(a+b*x)^3, x) == :(-1//3*d*b^-1*(d*tan(a+b*x))^(1/2)*cos(a+b*x)^3+1//6*d*b^-1*(d*tan(a+b*x))^(1/2)*cos(a+b*x)+1//12*b^-1*d^2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*sec(a+b*x))
@test integrate((d*tan(a+b*x))^3//2*cos(a+b*x)^5, x) == :(-1//5*d*b^-1*(d*tan(a+b*x))^(1/2)*cos(a+b*x)^5+1//12*d*b^-1*(d*tan(a+b*x))^(1/2)*cos(a+b*x)+1//30*d*b^-1*(d*tan(a+b*x))^(1/2)*cos(a+b*x)^3+1//24*b^-1*d^2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*sec(a+b*x))
@test integrate((d*tan(e+f*x))^5//2*sec(e+f*x)^6, x) == :(2//7*d^-1*f^-1*(d*tan(e+f*x))^7//2+2//15*d^-5*f^-1*(d*tan(e+f*x))^15//2+4//11*d^-3*f^-1*(d*tan(e+f*x))^11//2)
@test integrate((d*tan(e+f*x))^5//2*sec(e+f*x)^4, x) == :(2//7*d^-1*f^-1*(d*tan(e+f*x))^7//2+2//11*d^-3*f^-1*(d*tan(e+f*x))^11//2)
@test integrate((d*tan(e+f*x))^5//2*sec(e+f*x)^2, x) == :(2//7*d^-1*f^-1*(d*tan(e+f*x))^7//2)
@test integrate((d*tan(e+f*x))^5//2, x) == :(2//3*d*f^-1*(d*tan(e+f*x))^3//2+(1/2)*2^(1/2)*d^5//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(e+f*x))^(1/2))+-1//2*2^(1/2)*d^5//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*tan(e+f*x))^(1/2))+-1//4*2^(1/2)*d^5//2*f^-1*log(d^(1/2)+d^(1/2)*tan(e+f*x)+-1*2^(1/2)*(d*tan(e+f*x))^(1/2))+1//4*2^(1/2)*d^5//2*f^-1*log(d^(1/2)+2^(1/2)*(d*tan(e+f*x))^(1/2)+d^(1/2)*tan(e+f*x)))
@test integrate((d*tan(e+f*x))^5//2*cos(e+f*x)^2, x) == :(-3//8*2^(1/2)*d^5//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(e+f*x))^(1/2))+-3//16*2^(1/2)*d^5//2*f^-1*log(d^(1/2)+2^(1/2)*(d*tan(e+f*x))^(1/2)+d^(1/2)*tan(e+f*x))+-1//2*d*f^-1*(d*tan(e+f*x))^3//2*cos(e+f*x)^2+3//8*2^(1/2)*d^5//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*tan(e+f*x))^(1/2))+3//16*2^(1/2)*d^5//2*f^-1*log(d^(1/2)+d^(1/2)*tan(e+f*x)+-1*2^(1/2)*(d*tan(e+f*x))^(1/2)))
@test integrate((d*tan(e+f*x))^5//2*cos(e+f*x)^4, x) == :(-3//64*2^(1/2)*d^5//2*f^-1*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(e+f*x))^(1/2))+-3//128*2^(1/2)*d^5//2*f^-1*log(d^(1/2)+2^(1/2)*(d*tan(e+f*x))^(1/2)+d^(1/2)*tan(e+f*x))+-1//4*d*f^-1*(d*tan(e+f*x))^3//2*cos(e+f*x)^4+3//16*d*f^-1*(d*tan(e+f*x))^3//2*cos(e+f*x)^2+3//64*2^(1/2)*d^5//2*f^-1*arctan(1+2^(1/2)*d^-1//2*(d*tan(e+f*x))^(1/2))+3//128*2^(1/2)*d^5//2*f^-1*log(d^(1/2)+d^(1/2)*tan(e+f*x)+-1*2^(1/2)*(d*tan(e+f*x))^(1/2)))
@test integrate((d*tan(e+f*x))^-1//2*sec(e+f*x)^5, x) == :(2//7*d^-1*f^-1*(d*tan(e+f*x))^(1/2)*sec(e+f*x)^3+4//7*d^-1*f^-1*(d*tan(e+f*x))^(1/2)*sec(e+f*x)+4//7*f^-1*(d*tan(e+f*x))^-1//2*sin(2*e+2*f*x)^(1/2)*Elliptic.F(e+-1//4*pi+f*x,2)*sec(e+f*x))
@test integrate((d*tan(e+f*x))^-1//2*sec(e+f*x)^3, x) == :(2//3*d^-1*f^-1*(d*tan(e+f*x))^(1/2)*sec(e+f*x)+2//3*f^-1*(d*tan(e+f*x))^-1//2*sin(2*e+2*f*x)^(1/2)*Elliptic.F(e+-1//4*pi+f*x,2)*sec(e+f*x))
@test integrate((d*tan(e+f*x))^-1//2*sec(e+f*x), x) == :(f^-1*(d*tan(e+f*x))^-1//2*sin(2*e+2*f*x)^(1/2)*Elliptic.F(e+-1//4*pi+f*x,2)*sec(e+f*x))
@test integrate((d*tan(e+f*x))^-1//2*cos(e+f*x), x) == :(d^-1*f^-1*(d*tan(e+f*x))^(1/2)*cos(e+f*x)+(1/2)*f^-1*(d*tan(e+f*x))^-1//2*sin(2*e+2*f*x)^(1/2)*Elliptic.F(e+-1//4*pi+f*x,2)*sec(e+f*x))
@test integrate((d*tan(e+f*x))^-1//2*cos(e+f*x)^3, x) == :(1//3*d^-1*f^-1*(d*tan(e+f*x))^(1/2)*cos(e+f*x)^3+5//6*d^-1*f^-1*(d*tan(e+f*x))^(1/2)*cos(e+f*x)+5//12*f^-1*(d*tan(e+f*x))^-1//2*sin(2*e+2*f*x)^(1/2)*Elliptic.F(e+-1//4*pi+f*x,2)*sec(e+f*x))
@test integrate((d*tan(a+b*x))^-3//2*sec(a+b*x)^6, x) == :(-2*b^-1*d^-1*(d*tan(a+b*x))^-1//2+2//7*b^-1*d^-5*(d*tan(a+b*x))^7//2+4//3*b^-1*d^-3*(d*tan(a+b*x))^3//2)
@test integrate((d*tan(a+b*x))^-3//2*sec(a+b*x)^4, x) == :(-2*b^-1*d^-1*(d*tan(a+b*x))^-1//2+2//3*b^-1*d^-3*(d*tan(a+b*x))^3//2)
@test integrate((d*tan(a+b*x))^-3//2*sec(a+b*x)^2, x) == :(-2*b^-1*d^-1*(d*tan(a+b*x))^-1//2)
@test integrate((d*tan(a+b*x))^-3//2, x) == :(-2*b^-1*d^-1*(d*tan(a+b*x))^-1//2+(1/2)*2^(1/2)*b^-1*d^-3//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-1//2*2^(1/2)*b^-1*d^-3//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-1//4*2^(1/2)*b^-1*d^-3//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2))+1//4*2^(1/2)*b^-1*d^-3//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x)))
@test integrate((d*tan(a+b*x))^-3//2*cos(a+b*x)^2, x) == :(-5//2*b^-1*d^-1*(d*tan(a+b*x))^-1//2+(1/2)*b^-1*d^-1*(d*tan(a+b*x))^-1//2*cos(a+b*x)^2+-5//8*2^(1/2)*b^-1*d^-3//2*arctan(1+2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+-5//16*2^(1/2)*b^-1*d^-3//2*log(d^(1/2)+d^(1/2)*tan(a+b*x)+-1*2^(1/2)*(d*tan(a+b*x))^(1/2))+5//8*2^(1/2)*b^-1*d^-3//2*arctan(1+-1*2^(1/2)*d^-1//2*(d*tan(a+b*x))^(1/2))+5//16*2^(1/2)*b^-1*d^-3//2*log(d^(1/2)+2^(1/2)*(d*tan(a+b*x))^(1/2)+d^(1/2)*tan(a+b*x)))
@test integrate((d*tan(a+b*x))^-3//2*sec(a+b*x)^5, x) == :(-2*b^-1*d^-1*(d*tan(a+b*x))^-1//2*sec(a+b*x)^3+12//5*b^-1*d^-3*(d*tan(a+b*x))^3//2*sec(a+b*x)+24//5*b^-1*d^-3*(d*tan(a+b*x))^3//2*cos(a+b*x)+-24//5*b^-1*d^-2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*cos(a+b*x))
@test integrate((d*tan(a+b*x))^-3//2*sec(a+b*x)^3, x) == :(-2*b^-1*d^-1*(d*tan(a+b*x))^-1//2*sec(a+b*x)+4*b^-1*d^-3*(d*tan(a+b*x))^3//2*cos(a+b*x)+-4*b^-1*d^-2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*cos(a+b*x))
@test integrate((d*tan(a+b*x))^-3//2*sec(a+b*x), x) == :(-2*b^-1*d^-1*(d*tan(a+b*x))^-1//2*cos(a+b*x)+-2*b^-1*d^-2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*cos(a+b*x))
@test integrate((d*tan(a+b*x))^-3//2*cos(a+b*x), x) == :(-2*b^-1*d^-1*(d*tan(a+b*x))^-1//2*cos(a+b*x)+-3*b^-1*d^-2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*cos(a+b*x))
@test integrate((d*tan(a+b*x))^-3//2*cos(a+b*x)^3, x) == :(-2*b^-1*d^-1*(d*tan(a+b*x))^-1//2*cos(a+b*x)^3+-7//3*b^-1*d^-3*(d*tan(a+b*x))^3//2*cos(a+b*x)^3+-7//2*b^-1*d^-2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*cos(a+b*x))
@test integrate((d*tan(a+b*x))^-3//2*cos(a+b*x)^5, x) == :(-2*b^-1*d^-1*(d*tan(a+b*x))^-1//2*cos(a+b*x)^5+-77//30*b^-1*d^-3*(d*tan(a+b*x))^3//2*cos(a+b*x)^3+-11//5*b^-1*d^-3*(d*tan(a+b*x))^3//2*cos(a+b*x)^5+-77//20*b^-1*d^-2*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*cos(a+b*x))
@test integrate((d*tan(a+b*x))^-5//2*sec(a+b*x), x) == :(-2//3*b^-1*d^-1*(d*tan(a+b*x))^-3//2*sec(a+b*x)+-1//3*b^-1*d^-2*(d*tan(a+b*x))^-1//2*sin(2a+2*b*x)^(1/2)*Elliptic.F(a+-1//4*pi+b*x,2)*sec(a+b*x))
@test integrate((d*tan(a+b*x))^-7//2*sec(a+b*x)^3, x) == :(-4//5*b^-1*d^-3*(d*tan(a+b*x))^-1//2*cos(a+b*x)+-2//5*b^-1*d^-1*(d*tan(a+b*x))^-5//2*sec(a+b*x)+-4//5*b^-1*d^-4*(d*tan(a+b*x))^(1/2)*sin(2a+2*b*x)^-1//2*Elliptic.E(a+-1//4*pi+b*x,2)*cos(a+b*x))
@test integrate((b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^5//2, x) == :((1/2)*b^-1*d^2*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^(1/2)+-1//4*b^(1/2)*d^3*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctan(b^-1//2*(b*sin(e+f*x))^(1/2))+1//4*b^(1/2)*d^3*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctanh(b^-1//2*(b*sin(e+f*x))^(1/2)))
@test integrate((b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^3//2, x) == :(b^-1*d^2*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-1//2+-1*d^2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*sin(e+f*x)^-1//2*Elliptic.E((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^(1/2), x) == :(d*b^(1/2)*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctanh(b^-1//2*(b*sin(e+f*x))^(1/2))+-1*d*b^(1/2)*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctan(b^-1//2*(b*sin(e+f*x))^(1/2)))
@test integrate((b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2, x) == :(2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*sin(e+f*x)^-1//2*Elliptic.E((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-3//2, x) == :(2//3*b^-1*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-3//2)
@test integrate((b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-5//2, x) == :(2//5*b^-1*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-5//2+4//5*d^-2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*sin(e+f*x)^-1//2*Elliptic.E((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-7//2, x) == :(2//7*b^-1*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-7//2+8//21*b^-1*d^-2*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-3//2)
@test integrate((b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-9//2, x) == :(2//9*b^-1*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-9//2+4//15*b^-1*d^-2*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-5//2+8//15*d^-4*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*sin(e+f*x)^-1//2*Elliptic.E((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^3//2*(d*sec(e+f*x))^5//2, x) == :(1//3*b*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^5//2+-1//6*b*d^2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^(1/2)+-1//6*b^2*d^2*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*sin(e+f*x)^(1/2)*Elliptic.F((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^3//2*(d*sec(e+f*x))^3//2, x) == :((1/2)*b*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^3//2+-1//4*d*b^3//2*f^-1*(b*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*arctan(b^-1//2*(b*sin(e+f*x))^(1/2))+-1//4*d*b^3//2*f^-1*(b*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*arctanh(b^-1//2*(b*sin(e+f*x))^(1/2)))
@test integrate((b*tan(e+f*x))^3//2*(d*sec(e+f*x))^(1/2), x) == :(b*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^(1/2)+-1*b^2*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*sin(e+f*x)^(1/2)*Elliptic.F((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-1//2, x) == :(-2*d*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-3//2*csc(e+f*x)+d*b^3//2*f^-1*(b*sin(e+f*x))^-3//2*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-3//2*arctan(b^-1//2*(b*sin(e+f*x))^(1/2))+d*b^3//2*f^-1*(b*sin(e+f*x))^-3//2*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-3//2*arctanh(b^-1//2*(b*sin(e+f*x))^(1/2)))
@test integrate((b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-3//2, x) == :(-2//3*b*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-3//2+2//3*b^2*d^-2*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*sin(e+f*x)^(1/2)*Elliptic.F((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-5//2, x) == :(2//5*b^-1*f^-1*(b*tan(e+f*x))^5//2*(d*sec(e+f*x))^-5//2)
@test integrate((b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-7//2, x) == :(-2//7*b*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-7//2+2//21*b*d^-2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-3//2+4//21*b^2*d^-4*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*sin(e+f*x)^(1/2)*Elliptic.F((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-9//2, x) == :(-2//9*b*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-9//2+2//45*b*d^-2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-5//2+8//45*b*d^-4*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2)
@test integrate((b*tan(e+f*x))^5//2*(d*sec(e+f*x))^5//2, x) == :(1//4*b*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^5//2+-3//16*b*d^2*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^(1/2)+-3//32*b^5//2*d^3*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctanh(b^-1//2*(b*sin(e+f*x))^(1/2))+3//32*b^5//2*d^3*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctan(b^-1//2*(b*sin(e+f*x))^(1/2)))
@test integrate((b*tan(e+f*x))^5//2*(d*sec(e+f*x))^3//2, x) == :(1//3*b*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^3//2+-1//2*b*d^2*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-1//2+(1/2)*b^2*d^2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*sin(e+f*x)^-1//2*Elliptic.E((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^5//2*(d*sec(e+f*x))^(1/2), x) == :((1/2)*b*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^(1/2)+-3//4*d*b^5//2*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctanh(b^-1//2*(b*sin(e+f*x))^(1/2))+3//4*d*b^5//2*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctan(b^-1//2*(b*sin(e+f*x))^(1/2)))
@test integrate((b*tan(e+f*x))^5//2*(d*sec(e+f*x))^-1//2, x) == :(b*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-1//2+-3*b^2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*sin(e+f*x)^-1//2*Elliptic.E((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^5//2*(d*sec(e+f*x))^-3//2, x) == :(-2//3*b*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-3//2+b^5//2*d^-1*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctanh(b^-1//2*(b*sin(e+f*x))^(1/2))+-1*b^5//2*d^-1*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctan(b^-1//2*(b*sin(e+f*x))^(1/2)))
@test integrate((b*tan(e+f*x))^5//2*(d*sec(e+f*x))^-5//2, x) == :(-2//5*b*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-5//2+6//5*b^2*d^-2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*sin(e+f*x)^-1//2*Elliptic.E((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^5//2*(d*sec(e+f*x))^-7//2, x) == :(2//7*b^-1*f^-1*(b*tan(e+f*x))^7//2*(d*sec(e+f*x))^-7//2)
@test integrate((b*tan(e+f*x))^5//2*(d*sec(e+f*x))^-9//2, x) == :(-2//9*b*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-9//2+2//15*b*d^-2*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-5//2+4//15*b^2*d^-4*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*sin(e+f*x)^-1//2*Elliptic.E((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^7//2, x) == :((1/2)*b^-1*d^2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^3//2+3//4*b^-1//2*d^3*f^-1*(b*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*arctan(b^-1//2*(b*sin(e+f*x))^(1/2))+3//4*b^-1//2*d^3*f^-1*(b*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*arctanh(b^-1//2*(b*sin(e+f*x))^(1/2)))
@test integrate((b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^5//2, x) == :(b^-1*d^2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^(1/2)+d^2*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*sin(e+f*x)^(1/2)*Elliptic.F((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^3//2, x) == :(d*b^-1//2*f^-1*(b*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*arctan(b^-1//2*(b*sin(e+f*x))^(1/2))+d*b^-1//2*f^-1*(b*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*arctanh(b^-1//2*(b*sin(e+f*x))^(1/2)))
@test integrate((b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2), x) == :(2*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*sin(e+f*x)^(1/2)*Elliptic.F((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^-1//2, x) == :(2*b^-1*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2)
@test integrate((b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^-3//2, x) == :(2//3*b^-1*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-3//2+4//3*d^-2*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*sin(e+f*x)^(1/2)*Elliptic.F((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^-5//2, x) == :(2//5*b^-1*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-5//2+8//5*b^-1*d^-2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2)
@test integrate((b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^5//2, x) == :(-2*b^-1*d^2*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)+b^-3//2*d^3*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctanh(b^-1//2*(b*sin(e+f*x))^(1/2))+-1*b^-3//2*d^3*f^-1*(b*sin(e+f*x))^-1//2*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*arctan(b^-1//2*(b*sin(e+f*x))^(1/2)))
@test integrate((b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^3//2, x) == :(-2*b^-1*d^2*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^-1//2+-2*b^-2*d^2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*sin(e+f*x)^-1//2*Elliptic.E((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^(1/2), x) == :(-2*b^-1*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2))
@test integrate((b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^-1//2, x) == :(-2*b^-1*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^-1//2+-4*b^-2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*sin(e+f*x)^-1//2*Elliptic.E((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^-5//2, x) == :(-2*b^-1*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^-5//2+-12//5*b^-3*f^-1*(b*tan(e+f*x))^3//2*(d*sec(e+f*x))^-5//2+-24//5*b^-2*d^-2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2*sin(e+f*x)^-1//2*Elliptic.E((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^-5//2*(d*sec(e+f*x))^7//2, x) == :(-2//3*b^-1*d^2*f^-1*(b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^3//2+b^-5//2*d^3*f^-1*(b*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*arctan(b^-1//2*(b*sin(e+f*x))^(1/2))+b^-5//2*d^3*f^-1*(b*sin(e+f*x))^(1/2)*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*arctanh(b^-1//2*(b*sin(e+f*x))^(1/2)))
@test integrate((b*tan(e+f*x))^-5//2*(d*sec(e+f*x))^5//2, x) == :(-2//3*b^-1*d^2*f^-1*(b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^(1/2)+2//3*b^-2*d^2*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*sin(e+f*x)^(1/2)*Elliptic.F((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^-5//2*(d*sec(e+f*x))^3//2, x) == :(-2//3*b^-1*f^-1*(b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^3//2)
@test integrate((b*tan(e+f*x))^-5//2*(d*sec(e+f*x))^(1/2), x) == :(-2//3*b^-1*f^-1*(b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^(1/2)+-4//3*b^-2*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*sin(e+f*x)^(1/2)*Elliptic.F((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^-5//2*(d*sec(e+f*x))^-1//2, x) == :(-8//3*b^-3*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2+-2//3*b^-1*f^-1*(b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^-1//2)
@test integrate((b*tan(e+f*x))^-5//2*(d*sec(e+f*x))^-3//2, x) == :(-4//3*b^-3*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-3//2+-2//3*b^-1*f^-1*(b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^-3//2+-8//3*b^-2*d^-2*f^-1*(b*tan(e+f*x))^-1//2*(d*sec(e+f*x))^(1/2)*sin(e+f*x)^(1/2)*Elliptic.F((1/2)*e+-1//4*pi+(1/2)*f*x,2))
@test integrate((b*tan(e+f*x))^-5//2*(d*sec(e+f*x))^-5//2, x) == :(-16//15*b^-3*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-5//2+-2//3*b^-1*f^-1*(b*tan(e+f*x))^-3//2*(d*sec(e+f*x))^-5//2+-64//15*b^-3*d^-2*f^-1*(b*tan(e+f*x))^(1/2)*(d*sec(e+f*x))^-1//2)
@test integrate((b*sec(e+f*x))^m*tan(e+f*x)^5, x) == :(f^-1*m^-1*(b*sec(e+f*x))^m+b^-4*f^-1*(b*sec(e+f*x))^(4+m)*(4+m)^-1+-2*b^-2*f^-1*(b*sec(e+f*x))^(2+m)*(2+m)^-1)
@test integrate((b*sec(e+f*x))^m*tan(e+f*x)^3, x) == :(-1*f^-1*m^-1*(b*sec(e+f*x))^m+b^-2*f^-1*(b*sec(e+f*x))^(2+m)*(2+m)^-1)
@test integrate((b*sec(e+f*x))^m*tan(e+f*x), x) == :(f^-1*m^-1*(b*sec(e+f*x))^m)
@test integrate((d*tan(a+b*x))^n*sec(a+b*x)^6, x) == :(b^-1*d^-1*(d*tan(a+b*x))^(1+n)*(1+n)^-1+b^-1*d^-5*(d*tan(a+b*x))^(5+n)*(5+n)^-1+2*b^-1*d^-3*(d*tan(a+b*x))^(3+n)*(3+n)^-1)
@test integrate((d*tan(a+b*x))^n*sec(a+b*x)^4, x) == :(b^-1*d^-1*(d*tan(a+b*x))^(1+n)*(1+n)^-1+b^-1*d^-3*(d*tan(a+b*x))^(3+n)*(3+n)^-1)
@test integrate((d*tan(a+b*x))^n*sec(a+b*x)^2, x) == :(b^-1*d^-1*(d*tan(a+b*x))^(1+n)*(1+n)^-1)
@test integrate((b*csc(e+f*x))^m*cot(e+f*x), x) == :(-1*f^-1*m^-1*(b*csc(e+f*x))^m)
@test integrate((b*csc(e+f*x))^m*cot(e+f*x)^3, x) == :(f^-1*m^-1*(b*csc(e+f*x))^m+-1*b^-2*f^-1*(b*csc(e+f*x))^(2+m)*(2+m)^-1)
@test integrate((b*csc(e+f*x))^m*cot(e+f*x)^5, x) == :(-1*f^-1*m^-1*(b*csc(e+f*x))^m+-1*b^-4*f^-1*(b*csc(e+f*x))^(4+m)*(4+m)^-1+2*b^-2*f^-1*(b*csc(e+f*x))^(2+m)*(2+m)^-1)

max_stars_repo_path: test/4 Trig functions/4.3 Tangent/4.3.0 (a trg)^m (b tan)^n.jl


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

using Markdown
using InteractiveUtils

# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
    quote
        local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
        local el = $(esc(element))
        global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el)
        el
    end
end

# ╔═╡ 5d51f08a-f167-45cc-b189-50f441c75a69
begin
	using PlutoUI
	using HypertextLiteral
	using DataFrames
	using Unitful
	using UUIDs
	using PowerSystemsUnits
end

# ╔═╡ 6869fd78-3129-412f-9f34-4ae5e9ab5330
import PlutoUI: combine

# ╔═╡ b182116d-72c4-4483-869a-b9d1101391f3
function DataFrameInput(data_frame_input, combine_funct; title="")
	table_header = []
	table_body = []
	col_names = [@htl("$(col_name)	") for col_name in names(data_frame_input)]

	function cell_element(row, cell)
		if isa(cell, Slider) | isa(cell, Scrubbable) | isa(cell, TextField) | isa(cell, RangeSlider)
			@htl("$(combine_funct(row, cell))	")
		else
			@htl("$(cell)	")
		end
	end

	table_header = @htl("$(col_names)")
	for df_row in eachrow(data_frame_input)
		row_output = [cell_element(string(UUIDs.uuid4()), cell) for cell in df_row]
		table_body = [table_body..., @htl("
$(row_output)
")]
	end

	@htl("""

$(title)

	$(table_header)

	$(table_body)

	""")
end

# ╔═╡ 18206255-6e79-4fe2-b5f6-ac5a0116fc19
begin
	car_param_df = DataFrame(
		:Parameter => ["Weight", "Battery Size", "Model Name", "Price Range"],
		:Units => ["kg", "kWh", "Model Name", "1k EUR"],
		Symbol("Data Input") => [Slider(2000u"kg":1u"kg":10000u"kg", show_value=true), Scrubbable(10:100), TextField(default="Fancy fancy car"), RangeSlider(22:1:120)],
	)

	@bind df_values combine() do Child
		DataFrameInput(car_param_df, Child; title="Input Dataframe")
	end
end

# ╔═╡ ae267745-0921-48d6-b24a-fe5161cfab6a
df_values

# ╔═╡ b1ea55ec-abf4-499e-ac3e-2a10343ad301
begin
	car_param_df[:, :values] = [df_values[i] for i in 1:length(df_values)]
	car_param_df[:, [:Parameter, :values]]
end

# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
PowerSystemsUnits = "c279aad7-7dc9-58d3-995b-109d3f5deb94"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[compat]
DataFrames = "~1.3.1"
HypertextLiteral = "~0.9.3"
PlutoUI = "~0.7.27"
PowerSystemsUnits = "~0.2.0"
Unitful = "~0.15.0"
"""

# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised

julia_version = "1.8.0-DEV.1144"
manifest_format = "2.0"
project_hash = "b91b1e144a033e6c239499fc11408462cef5bbc7"

[[deps.AbstractPlutoDingetjes]]
deps = ["Pkg"]
git-tree-sha1 = "8eaf9f1b4921132a4cff3f36a1d9ba923b14a481"
uuid = "6e696c72-6542-2067-7265-42206c756150"
version = "1.1.4"

[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
version = "1.1.1"

[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"

[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[deps.ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "024fe24d83e4a5bf5fc80501a314ce0d1aa35597"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.11.0"

[[deps.Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "44c37b4636bc54afac5c574d2d02b625349d6582"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.41.0"

[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "0.5.0+0"

[[deps.Crayons]]
git-tree-sha1 = "3f71217b538d7aaee0b69ab47d9b7724ca8afa0d"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.0.4"

[[deps.DataAPI]]
git-tree-sha1 = "cc70b17275652eb47bc9e5f81635981f13cea5c8"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.9.0"

[[deps.DataFrames]]
deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
git-tree-sha1 = "cfdfef912b7f93e4b848e80b9befdf9e331bc05a"
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
version = "1.3.1"

[[deps.DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "3daef5523dd2e769dad2365274f760ff5f282c7d"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.11"

[[deps.DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"

[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[deps.DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"

[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[deps.Downloads]]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
version = "1.5.1"

[[deps.FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"

[[deps.FixedPointNumbers]]
deps = ["Statistics"]
git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc"
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
version = "0.8.4"

[[deps.Formatting]]
deps = ["Printf"]
git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8"
uuid = "59287772-0a20-5a39-b81b-1366585eb4c0"
version = "0.4.2"

[[deps.Future]]
deps = ["Random"]
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"

[[deps.Hyperscript]]
deps = ["Test"]
git-tree-sha1 = "8d511d5b81240fc8e6802386302675bdf47737b9"
uuid = "47d2ed2b-36de-50cf-bf87-49c2cf4b8b91"
version = "0.0.4"

[[deps.HypertextLiteral]]
git-tree-sha1 = "2b078b5a615c6c0396c77810d92ee8c6f470d238"
uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"
version = "0.9.3"

[[deps.IOCapture]]
deps = ["Logging", "Random"]
git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a"
uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
version = "0.2.2"

[[deps.InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[deps.InvertedIndices]]
git-tree-sha1 = "bee5f1ef5bf65df56bdd2e40447590b272a5471f"
uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
version = "1.1.0"

[[deps.IteratorInterfaceExtensions]]
git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
uuid = "82899510-4779-5014-852e-03e436cf321d"
version = "1.0.0"

[[deps.JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "8076680b162ada2a031f707ac7b4953e30667a37"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.2"

[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
version = "0.6.3"

[[deps.LibCURL_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
version = "7.73.0+4"

[[deps.LibGit2]]
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[deps.LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
version = "1.9.1+2"

[[deps.Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[deps.LinearAlgebra]]
deps = ["Libdl", "libblastrampoline_jll"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[deps.Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[deps.Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[deps.MbedTLS_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.24.0+2"

[[deps.Missings]]
deps = ["DataAPI"]
git-tree-sha1 = "bf210ce90b6c9eed32d25dbcae1ebc565df2687f"
uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
version = "1.0.2"

[[deps.Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[deps.MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
version = "2020.7.22"

[[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
version = "1.2.0"

[[deps.OpenBLAS_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
version = "0.3.17+2"

[[deps.OrderedCollections]]
git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.4.1"

[[deps.Parsers]]
deps = ["Dates"]
git-tree-sha1 = "d7fa6237da8004be601e19bd6666083056649918"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "2.1.3"

[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
version = "1.8.0"

[[deps.PlutoUI]]
deps = ["AbstractPlutoDingetjes", "Base64", "ColorTypes", "Dates", "Hyperscript", "HypertextLiteral", "IOCapture", "InteractiveUtils", "JSON", "Logging", "Markdown", "Random", "Reexport", "UUIDs"]
git-tree-sha1 = "fed057115644d04fba7f4d768faeeeff6ad11a60"
uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
version = "0.7.27"

[[deps.PooledArrays]]
deps = ["DataAPI", "Future"]
git-tree-sha1 = "db3a23166af8aebf4db5ef87ac5b00d36eb771e2"
uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
version = "1.4.0"

[[deps.PowerSystemsUnits]]
deps = ["Dates", "Statistics", "Unitful"]
git-tree-sha1 = "aa9d83c87359c6d913e27fd893aba69941b012fe"
uuid = "c279aad7-7dc9-58d3-995b-109d3f5deb94"
version = "0.2.0"

[[deps.PrettyTables]]
deps = ["Crayons", "Formatting", "Markdown", "Reexport", "Tables"]
git-tree-sha1 = "dfb54c4e414caa595a1f2ed759b160f5a3ddcba5"
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
version = "1.3.1"

[[deps.Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[deps.REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[deps.Random]]
deps = ["SHA", "Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[deps.Reexport]]
git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "1.2.2"

[[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"

[[deps.Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[deps.SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[deps.Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[deps.SortingAlgorithms]]
deps = ["DataStructures"]
git-tree-sha1 = "b3363d7460f7d098ca0912c69b082f75625d7508"
uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
version = "1.0.1"

[[deps.SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[deps.Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[deps.TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
version = "1.0.0"

[[deps.TableTraits]]
deps = ["IteratorInterfaceExtensions"]
git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39"
uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
version = "1.0.1"

[[deps.Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"]
git-tree-sha1 = "bb1064c9a84c52e277f1096cf41434b675cd368b"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "1.6.1"

[[deps.Tar]]
deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
version = "1.10.0"

[[deps.Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[deps.UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[deps.Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[deps.Unitful]]
deps = ["LinearAlgebra", "Random", "Test"]
git-tree-sha1 = "94736a38908c6b43d22e1abffc4f72ab19dabbc1"
uuid = "1986cc42-f94f-5a68-af5c-568840ba703d"
version = "0.15.0"

[[deps.Zlib_jll]]
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
version = "1.2.12+1"

[[deps.libblastrampoline_jll]]
deps = ["Artifacts", "Libdl", "OpenBLAS_jll"]
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
version = "3.1.0+0"

[[deps.nghttp2_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
version = "1.41.0+1"

[[deps.p7zip_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
version = "16.2.1+1"
"""

# ╔═╡ Cell order:
# ╠═5d51f08a-f167-45cc-b189-50f441c75a69
# ╠═6869fd78-3129-412f-9f34-4ae5e9ab5330
# ╠═b182116d-72c4-4483-869a-b9d1101391f3
# ╠═18206255-6e79-4fe2-b5f6-ac5a0116fc19
# ╠═ae267745-0921-48d6-b24a-fe5161cfab6a
# ╠═b1ea55ec-abf4-499e-ac3e-2a10343ad301
# ╟─00000000-0000-0000-0000-000000000001
# ╟─00000000-0000-0000-0000-000000000002

ext: jl

max_stars_repo_name: jeremiahpslewis/PlutoMiscellany


text:
"""
    wrap(x::CombinedParser; log = nothing, trace = false)

transform a parser by wrapping sub-parsers in logging and tracing parser types.
"""
function wrap(x::CombinedParser; log = nothing, trace = false)
    1
    p = if log === nothing || log == false
        x
    else
        log_names(x,log)
    end
    if trace
        CombinedParsers.trace(p)
    else
        p
    end
end

export MatchesIterator, ParseMatch

"""
    MatchesIterator(parser::P, sequence::S[, start=firstindex(sequence)[, stop=lastindex(sequence), [till=lastindex(sequence)]]])

Iterator type for [`match_all`](@ref) and [`parse_all`](@ref) with `eltype` [`ParseMatch`](@ref)`{P,S,state_type(P)}`.

Iteration looks for matches beginning between `start` and `stop` and ending at most at `till`.
"""
@auto_hash_equals struct MatchesIterator{P<:CombinedParser,S}
    "parser"
    parser::P
    "sequence"
    sequence::S
    "First index for searching [`match`](@ref)."
    start::Int
    "Last index for searching [`match`](@ref)."
    stop::Int
    "Last index for end of [`match`](@ref)."
    till::Int
end
result_type(::Type{<:MatchesIterator{P}}) where P =
    result_type(P)
Base.eltype(T::Type{<:MatchesIterator{P,S}}) where {P,S} =
    ParseMatch{P,S,state_type(P)}
Base.IteratorSize(::Type{<:MatchesIterator}) =
    Base.SizeUnknown()

@inline iterate_state(mi::MatchesIterator, posi, a...) =
    iterate_state(mi.parser, mi.sequence, mi.till, posi, a...)

Base.get(x::MatchesIterator, a...)=
    get(x.parser,x.sequence,x.till, a...)

"""
    MatchesIterator(parser::CombinedParser, sequence, start=firstindex(sequence),stop=lastindex(sequence),till=lastindex(sequence))

`MatchesIterator` dispatch can be used for parsers that require a special sequence type.
"""
MatchesIterator(parser, sequence, start::Int=firstindex(sequence),stop::Int=lastindex(sequence),till::Int=lastindex(sequence)) =
    MatchesIterator{typeof(parser),typeof(sequence)}(parser,sequence,start,stop,till)

export match_all

"""
    match_all(parser::CombinedParser, sequence, a...; kw...)

Returns an iterator over all matches of [`CombinedParsers.wrap`](@ref)`(parser; kw...)`.
Constructs a [`MatchesIterator`](@ref) defining match index range with with `a...`.
"""
function match_all(parser, sequence, a...; kw...)
    MatchesIterator(wrap(parser; kw...), sequence, a...)
end

export ParseMatch
"""
    ParseMatch(p::MatchesIterator{P,S}, offset::Integer, after::Integer, state::ST) where {P,S,ST}

You can extract the following info from a `m::ParseMatch` object
(like [Julia RegexMatch](https://docs.julialang.org/en/v1/manual/strings/#Regular-Expressions),
):

- the entire substring matched: `m.match`
- the offset at which the whole match begins: `m.offset`

If `P<:`[`CombinedParsers.Regexp.ParserWithCaptures`](@ref) and `S<:`[`CombinedParsers.Regexp.SequenceWithCaptures`](@ref)

- the captured substrings as an array of strings: `m.captures`
- the offsets of the captured substrings as a vector: `m.offsets`
"""
@auto_hash_equals struct ParseMatch{P,S,State}
    parsings::MatchesIterator{P,S}
    offset::Int
    after::Int
    state::State
    function ParseMatch(p::MatchesIterator{P,S}, offset=p.start, after=p.start, state=nothing) where {P,S}
        new{P,S,typeof(state)}(p, offset, after, _copy(state))
    end
end

_getproperty(x::ParseMatch,key) =
    if key == :parsings
        getfield(x,1)
    elseif key == :offset
        getfield(x,2)
    elseif key == :after
        getfield(x,3)
    elseif key == :state
        getfield(x,4)
    else
        error("no property $key")
    end

function Base.getproperty(x::ParseMatch{<:Any,<:AbstractString,<:Any},key::Symbol)
    if key==:captures
        AbstractString[ ]
    elseif key==:match
        SubString(x.parsings.sequence,
                  x.offset,
                  _prevind(x.parsings.sequence,x.after))
    else
        _getproperty(x,key)
    end
end

Base.getproperty(x::ParseMatch{<:Any,<:AbstractString,Nothing},key::Symbol) =
    if key==:captures
        AbstractString[ ]
    elseif key==:match
        ""
    else
        _getproperty(x,key)
    end

# ParseMatch(parser,s,offset=1,after=offset,state=nothing) =
#     ParseMatch(match_all(parser,s,offset), offset, after, state)

export parse_all
"""
    parse_all(parser::CombinedParser, sequence, idx=1)

Returns an iterator over all parsings of the sequence offset at `idx`.
"""
function parse_all(parser::CombinedParser, sequence, idx=firstindex(sequence); kw...)
    ( get(p) for p=ParseMatch(MatchesIterator(parser,sequence, idx, idx)) )
end

# """
#     iterate(m::CombinedParser,s::AbstractString)

# Returns `iterate(ParseMatch(m,s,1,1,nothing))`.

result_type(::Type{<:ParseMatch{P}}) where P = result_type(P)
@inline iterate_state(m::ParseMatch) =
    iterate_state(m.parsings,m.offset,m.after,m.state)

"""
    Base.get(x::ParseMatch{<:MatchTuple})

Get the result of a match result.

```jldoctest
julia> m = match(re"(?<a>so)+ (or)", "soso or")
ParseMatch("soso or", a="so", 2="or")

julia> get(m)
([('s', 'o'), ('s', 'o')], ' ', ('o', 'r'))

julia> m[2]
"or"

julia> m.match, m.captures
("soso or", SubString{String}["so", "or"])
```
"""
Base.get(x::ParseMatch)=
    get(x.parsings,x.after,x.offset,x.state)

Base.eltype(T::Type{<:ParseMatch}) = ParseMatch
Base.IteratorSize(::Type{<:ParseMatch}) = Base.SizeUnknown()

"""
    Base.iterate(x::ParseMatch[, m::ParseMatch=x])

Returns next [`ParseMatch`](@ref) at `m.offset` after `m.state`, see [`iterate_state`](@ref)(m).
"""
function Base.iterate(x::ParseMatch, m=x)
    i = iterate_state(m)
    parsematch_tuple(m.parsings,m.offset,i)
end

"""
    parsematch_tuple(m,offset,state)

ParseMatch iteration has the first match as iterator, the last match as a state.
(Turned out to be fastest.)
"""
parsematch_tuple(m,offset,state) =
    let r = ParseMatch(m,offset,tuple_pos(state),tuple_state(state))
        return tuple(r,r)
    end
parsematch_tuple(m,offset,state::Nothing) = nothing

import Base: iterate
"""
    Base.iterate(x::MatchesIterator[, s::ParseMatch=ParseMatch(x)])

Iterate match `s` at current position.
While no match is found and `s.offset<=x.stop`, `s.offset` is incremented to search.

Return first next [`ParseMatch`](@ref) (as return value and state) or `nothing` when at `x.stop`.
"""
@inline Base.iterate(x::MatchesIterator) =
    iterate(x,ParseMatch(x))

@inline function Base.iterate(m::MatchesIterator, s::ParseMatch)
    offset,after = s.offset, s.after
    stop = m.stop
    state = iterate_state(m,offset,after,s.state)
    while offset <= stop+1 && state===nothing
        # state = iterate(m.parsings,(offset,nothing))
        offset > stop && break
        offset = _nextind(m.sequence,offset)
        state = iterate_state(m,offset,offset,nothing)
    end
    parsematch_tuple(m,offset,state)
end

function Base.show(io::IO,m::ParseMatch{<:Any,<:AbstractString,<:Any})
    print(io,"ParseMatch(\"",
          m.state === nothing ? "no match" : escape_string(m.match),
          "\"")
    print(io,")")
end

"""
    Base.match(parser::CombinedParser,sequence::AbstractString[, idx::Integer]; log=nothing)

Search for the first match of `parser` in `sequence` and return a [`ParseMatch`](@ref) object containing the match,
or `nothing` if the match failed.

The optional `idx` argument specifies an index at which to start the search.

If `log!==nothing`, parser is transformed with [`log_names`](@ref)`(p, log)`.

The matching substring can be retrieved by accessing m.match.

!!! note
    If `parser isa CombinedParsers.Regexp.ParserWithCaptures`,
    `match` behaves like a plug-in replacement for equivalent `match(::Regex,sequence)`:

    ```jldoctest
    julia> m = match(re"(?<a>so)+ (or)", "soso or")
    ParseMatch("soso or", a="so", 2="or")

    julia> m[:a]
    "so"

    julia> m[2]
    "or"

    julia> m.match, m.captures
    ("soso or", SubString{String}["so", "or"])

    ```

"""
function Base.match(parser::CombinedParser, sequence, pos...; kw...)
    i = iterate(MatchesIterator(wrap(parser;kw...), sequence, pos...))
    i === nothing && return nothing
    i[1]
end

import Base: tryparse, parse
export tryparse_pos
function Base.parse(p::AbstractToken, s, pos...; kw...)
    i = tryparse_pos(p, s, pos...; kw...)
    i === nothing && throw(ArgumentError("no successfull parsing."))
    i[1]
end

function Base.tryparse(p::AbstractToken, s, pos...; kw...)
    i = tryparse_pos(p, s, pos...; kw...)
    i === nothing && return nothing
    i[1]
end

function tryparse_pos(p,s, idx=firstindex(s), till=lastindex(s); kw...)
    i = iterate_state(wrap(p; kw...),s,till,idx,idx,nothing)
    i === nothing && return nothing
    get(p,s,till,tuple_pos(i),1,tuple_state(i)), tuple_pos(i)
end

"""
    parse(parser::CombinedParser, sequence[, idx=firstindex(sequence)[, till=lastindex(sequence)]]; log=nothing)

Parse `sequence` with `parser` at start and produce an instance of `result_type(parser)`.
If `log!==nothing`, parser is transformed with [`log_names`](@ref)`(p, log)` before matching.

    tryparse(parser::CombinedParser, sequence[, idx=firstindex(sequence)[, till=lastindex(sequence)]]; log=nothing)

returns either a result value or `nothing` if sequence does not start with with a match.

    tryparse_pos(parser::CombinedParser, str::AbstractString[, idx=firstindex(sequence)[, till=lastindex(s)]]; log=nothing)
returns either a tuple of result value and the position after the match, or `nothing` if sequence does not start with with a match.

# Example

```jldoctest
julia> using TextParse

julia> p = ("Number: "*TextParse.Numeric(Int))[2]
🗄 Sequence[2]
├─ Number\\:\\
└─ <Int64>
::Int64

julia> parse(p,"Number: 42")
42

```

"""
parse, tryparse, tryparse_pos