text:
@testset "4.2.3.1 (a+b cos)^m (c+d cos)^n (A+B cos)" begin
    (A, B, a, b, c, d, e, f, m, n, x, ) = @variables A B a b c d e f m n x

    #= ::Package:: =#

    #= ::Title::Closed:: =#
    #=Integrands*of*the*form*(c*cos(e+f*x))^m*(a+b*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*(c*cos(e+f*x))^m*(a+a*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*cos(e+f*x)^m*(a+a*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))*(a + a*cos(c + d*x)), x, 8, (3/8)*a*(A + B)*x + (a*(5*A + 4*B)*sin(c + d*x))/(5*d) + (3*a*(A + B)*cos(c + d*x)*sin(c + d*x))/(8*d) + (a*(A + B)*cos(c + d*x)^3*sin(c + d*x))/(4*d) + (a*B*cos(c + d*x)^4*sin(c + d*x))/(5*d) - (a*(5*A + 4*B)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x)), x, 7, (1/8)*a*(4*A + 3*B)*x + (a*(A + B)*sin(c + d*x))/d + (a*(4*A + 3*B)*cos(c + d*x)*sin(c + d*x))/(8*d) + (a*B*cos(c + d*x)^3*sin(c + d*x))/(4*d) - (a*(A + B)*sin(c + d*x)^3)/(3*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x)), x, 3, (1/2)*a*(A + B)*x + (a*(3*A + 2*B)*sin(c + d*x))/(3*d) + (a*(A + B)*cos(c + d*x)*sin(c + d*x))/(2*d) + (a*B*cos(c + d*x)^2*sin(c + d*x))/(3*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + a*cos(c + d*x)), x, 1, (1/2)*a*(2*A + B)*x + (a*(A + B)*sin(c + d*x))/d + (a*B*cos(c + d*x)*sin(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x)), x, 4, a*(A + B)*x + (a*A*atanh(sin(c + d*x)))/d + (a*B*sin(c + d*x))/d]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x)), x, 4, a*B*x + (a*(A + B)*atanh(sin(c + d*x)))/d + (a*A*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + a*cos(c + d*x)), x, 6, (a*(A + 2*B)*atanh(sin(c + d*x)))/(2*d) + (a*(A + B)*tan(c + d*x))/d + (a*A*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + a*cos(c + d*x)), x, 7, (a*(A + B)*atanh(sin(c + d*x)))/(2*d) + (a*(2*A + 3*B)*tan(c + d*x))/(3*d) + (a*(A + B)*sec(c + d*x)*tan(c + d*x))/(2*d) + (a*A*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x))*(a + a*cos(c + d*x)), x, 7, (a*(3*A + 4*B)*atanh(sin(c + d*x)))/(8*d) + (a*(A + B)*tan(c + d*x))/d + (a*(3*A + 4*B)*sec(c + d*x)*tan(c + d*x))/(8*d) + (a*A*sec(c + d*x)^3*tan(c + d*x))/(4*d) + (a*(A + B)*tan(c + d*x)^3)/(3*d)]

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^2, x, 9, (1/16)*a^2*(12*A + 11*B)*x + (a^2*(9*A + 8*B)*sin(c + d*x))/(5*d) + (a^2*(12*A + 11*B)*cos(c + d*x)*sin(c + d*x))/(16*d) + (a^2*(12*A + 11*B)*cos(c + d*x)^3*sin(c + d*x))/(24*d) + (a^2*(6*A + 7*B)*cos(c + d*x)^4*sin(c + d*x))/(30*d) + (B*cos(c + d*x)^4*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(6*d) - (a^2*(9*A + 8*B)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^2, x, 8, (1/8)*a^2*(7*A + 6*B)*x + (a^2*(10*A + 9*B)*sin(c + d*x))/(5*d) + (a^2*(7*A + 6*B)*cos(c + d*x)*sin(c + d*x))/(8*d) + (a^2*(5*A + 6*B)*cos(c + d*x)^3*sin(c + d*x))/(20*d) + (B*cos(c + d*x)^3*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(5*d) - (a^2*(10*A + 9*B)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^2, x, 4, (1/8)*a^2*(8*A + 7*B)*x + (a^2*(8*A + 7*B)*sin(c + d*x))/(6*d) + (a^2*(8*A + 7*B)*cos(c + d*x)*sin(c + d*x))/(24*d) + ((4*A - B)*(a + a*cos(c + d*x))^2*sin(c + d*x))/(12*d) + (B*(a + a*cos(c + d*x))^3*sin(c + d*x))/(4*a*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^2, x, 2, (1/2)*a^2*(3*A + 2*B)*x + (2*a^2*(3*A + 2*B)*sin(c + d*x))/(3*d) + (a^2*(3*A + 2*B)*cos(c + d*x)*sin(c + d*x))/(6*d) + (B*(a + a*cos(c + d*x))^2*sin(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^2, x, 5, (1/2)*a^2*(4*A + 3*B)*x + (a^2*A*atanh(sin(c + d*x)))/d + (a^2*(2*A + 3*B)*sin(c + d*x))/(2*d) + (B*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^2, x, 5, a^2*(A + 2*B)*x + (a^2*(2*A + B)*atanh(sin(c + d*x)))/d - (a^2*(A - B)*sin(c + d*x))/d + (A*(a^2 + a^2*cos(c + d*x))*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^2, x, 5, a^2*B*x + (a^2*(3*A + 4*B)*atanh(sin(c + d*x)))/(2*d) + (a^2*(3*A + 2*B)*tan(c + d*x))/(2*d) + (A*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^2, x, 7, (a^2*(2*A + 3*B)*atanh(sin(c + d*x)))/(2*d) + (a^2*(5*A + 6*B)*tan(c + d*x))/(3*d) + (a^2*(4*A + 3*B)*sec(c + d*x)*tan(c + d*x))/(6*d) + (A*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^2, x, 8, (a^2*(7*A + 8*B)*atanh(sin(c + d*x)))/(8*d) + (a^2*(4*A + 5*B)*tan(c + d*x))/(3*d) + (a^2*(7*A + 8*B)*sec(c + d*x)*tan(c + d*x))/(8*d) + (a^2*(5*A + 4*B)*sec(c + d*x)^2*tan(c + d*x))/(12*d) + (A*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(4*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^3, x, 9, (1/16)*a^3*(26*A + 23*B)*x + (a^3*(19*A + 17*B)*sin(c + d*x))/(5*d) + (a^3*(26*A + 23*B)*cos(c + d*x)*sin(c + d*x))/(16*d) + (a^3*(22*A + 21*B)*cos(c + d*x)^3*sin(c + d*x))/(40*d) + (a*B*cos(c + d*x)^3*(a + a*cos(c + d*x))^2*sin(c + d*x))/(6*d) + ((3*A + 4*B)*cos(c + d*x)^3*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(15*d) - (a^3*(19*A + 17*B)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^3, x, 10, (1/8)*a^3*(15*A + 13*B)*x + (a^3*(15*A + 13*B)*sin(c + d*x))/(5*d) + (3*a^3*(15*A + 13*B)*cos(c + d*x)*sin(c + d*x))/(40*d) + ((5*A - B)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(20*d) + (B*(a + a*cos(c + d*x))^4*sin(c + d*x))/(5*a*d) - (a^3*(15*A + 13*B)*sin(c + d*x)^3)/(60*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^3, x, 8, (5/8)*a^3*(4*A + 3*B)*x + (a^3*(4*A + 3*B)*sin(c + d*x))/d + (3*a^3*(4*A + 3*B)*cos(c + d*x)*sin(c + d*x))/(8*d) + (B*(a + a*cos(c + d*x))^3*sin(c + d*x))/(4*d) - (a^3*(4*A + 3*B)*sin(c + d*x)^3)/(12*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^3, x, 6, (1/2)*a^3*(7*A + 5*B)*x + (a^3*A*atanh(sin(c + d*x)))/d + (5*a^3*(A + B)*sin(c + d*x))/(2*d) + (a*B*(a + a*cos(c + d*x))^2*sin(c + d*x))/(3*d) + ((3*A + 5*B)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(6*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^3, x, 6, (1/2)*a^3*(6*A + 7*B)*x + (a^3*(3*A + B)*atanh(sin(c + d*x)))/d + (5*a^3*B*sin(c + d*x))/(2*d) - ((2*A - B)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(2*d) + (a*A*(a + a*cos(c + d*x))^2*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^3, x, 6, a^3*(A + 3*B)*x + (a^3*(7*A + 6*B)*atanh(sin(c + d*x)))/(2*d) - (5*a^3*A*sin(c + d*x))/(2*d) + ((2*A + B)*(a^3 + a^3*cos(c + d*x))*tan(c + d*x))/d + (a*A*(a + a*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^3, x, 6, a^3*B*x + (a^3*(5*A + 7*B)*atanh(sin(c + d*x)))/(2*d) + (5*a^3*(A + B)*tan(c + d*x))/(2*d) + ((5*A + 3*B)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(6*d) + (a*A*(a + a*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^3, x, 8, (5*a^3*(3*A + 4*B)*atanh(sin(c + d*x)))/(8*d) + (a^3*(9*A + 11*B)*tan(c + d*x))/(3*d) + (a^3*(27*A + 28*B)*sec(c + d*x)*tan(c + d*x))/(24*d) + ((3*A + 2*B)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(6*d) + (a*A*(a + a*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [sec(c + d*x)^6*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^3, x, 9, (a^3*(13*A + 15*B)*atanh(sin(c + d*x)))/(8*d) + (a^3*(38*A + 45*B)*tan(c + d*x))/(15*d) + (a^3*(13*A + 15*B)*sec(c + d*x)*tan(c + d*x))/(8*d) + (a^3*(43*A + 45*B)*sec(c + d*x)^2*tan(c + d*x))/(60*d) + ((7*A + 5*B)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(20*d) + (a*A*(a + a*cos(c + d*x))^2*sec(c + d*x)^4*tan(c + d*x))/(5*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^4, x, 10, (1/16)*a^4*(49*A + 44*B)*x + (a^4*(252*A + 227*B)*sin(c + d*x))/(35*d) + (a^4*(49*A + 44*B)*cos(c + d*x)*sin(c + d*x))/(16*d) + (a^4*(301*A + 276*B)*cos(c + d*x)^3*sin(c + d*x))/(280*d) + (a*B*cos(c + d*x)^3*(a + a*cos(c + d*x))^3*sin(c + d*x))/(7*d) + ((7*A + 10*B)*cos(c + d*x)^3*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(42*d) + (7*(A + B)*cos(c + d*x)^3*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(15*d) - (a^4*(252*A + 227*B)*sin(c + d*x)^3)/(105*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^4, x, 13, (7/16)*a^4*(8*A + 7*B)*x + (4*a^4*(8*A + 7*B)*sin(c + d*x))/(5*d) + (27*a^4*(8*A + 7*B)*cos(c + d*x)*sin(c + d*x))/(80*d) + (a^4*(8*A + 7*B)*cos(c + d*x)^3*sin(c + d*x))/(40*d) + ((6*A - B)*(a + a*cos(c + d*x))^4*sin(c + d*x))/(30*d) + (B*(a + a*cos(c + d*x))^5*sin(c + d*x))/(6*a*d) - (2*a^4*(8*A + 7*B)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^4, x, 11, (7/8)*a^4*(5*A + 4*B)*x + (8*a^4*(5*A + 4*B)*sin(c + d*x))/(5*d) + (27*a^4*(5*A + 4*B)*cos(c + d*x)*sin(c + d*x))/(40*d) + (a^4*(5*A + 4*B)*cos(c + d*x)^3*sin(c + d*x))/(20*d) + (B*(a + a*cos(c + d*x))^4*sin(c + d*x))/(5*d) - (4*a^4*(5*A + 4*B)*sin(c + d*x)^3)/(15*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^4, x, 7, (1/8)*a^4*(48*A + 35*B)*x + (a^4*A*atanh(sin(c + d*x)))/d + (5*a^4*(8*A + 7*B)*sin(c + d*x))/(8*d) + (a*B*(a + a*cos(c + d*x))^3*sin(c + d*x))/(4*d) + ((4*A + 7*B)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(12*d) + ((32*A + 35*B)*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(24*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^4, x, 7, (1/2)*a^4*(13*A + 12*B)*x + (a^4*(4*A + B)*atanh(sin(c + d*x)))/d + (5*a^4*(A + 2*B)*sin(c + d*x))/(2*d) - ((3*A - B)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(3*d) - ((3*A - 8*B)*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(6*d) + (a*A*(a + a*cos(c + d*x))^3*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^4, x, 7, (1/2)*a^4*(8*A + 13*B)*x + (a^4*(13*A + 8*B)*atanh(sin(c + d*x)))/(2*d) - (5*a^4*(A - B)*sin(c + d*x))/(2*d) - ((6*A + B)*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(2*d) + ((5*A + 2*B)*(a^2 + a^2*cos(c + d*x))^2*tan(c + d*x))/(2*d) + (a*A*(a + a*cos(c + d*x))^3*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^4, x, 7, a^4*(A + 4*B)*x + (a^4*(12*A + 13*B)*atanh(sin(c + d*x)))/(2*d) - (5*a^4*(2*A + B)*sin(c + d*x))/(2*d) + ((11*A + 9*B)*(a^4 + a^4*cos(c + d*x))*tan(c + d*x))/(3*d) + ((2*A + B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(2*d) + (a*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^4, x, 7, a^4*B*x + (a^4*(35*A + 48*B)*atanh(sin(c + d*x)))/(8*d) + (5*a^4*(7*A + 8*B)*tan(c + d*x))/(8*d) + ((35*A + 32*B)*(a^4 + a^4*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(24*d) + ((7*A + 4*B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(12*d) + (a*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [sec(c + d*x)^6*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^4, x, 9, (7*a^4*(4*A + 5*B)*atanh(sin(c + d*x)))/(8*d) + (a^4*(83*A + 100*B)*tan(c + d*x))/(15*d) + (a^4*(244*A + 275*B)*sec(c + d*x)*tan(c + d*x))/(120*d) + ((26*A + 25*B)*(a^4 + a^4*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(30*d) + ((8*A + 5*B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(20*d) + (a*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^4*tan(c + d*x))/(5*d)]
    @test_int [sec(c + d*x)^7*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^4, x, 10, (7*a^4*(7*A + 8*B)*atanh(sin(c + d*x)))/(16*d) + (a^4*(72*A + 83*B)*tan(c + d*x))/(15*d) + (7*a^4*(7*A + 8*B)*sec(c + d*x)*tan(c + d*x))/(16*d) + (a^4*(159*A + 176*B)*sec(c + d*x)^2*tan(c + d*x))/(120*d) + ((73*A + 72*B)*(a^4 + a^4*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(120*d) + ((3*A + 2*B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^4*tan(c + d*x))/(10*d) + (a*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^5*tan(c + d*x))/(6*d)]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [cos(c + d*x)^4*(A + B*cos(c + d*x))/(a + a*cos(c + d*x)), x, 7, -((3*(4*A - 5*B)*x)/(8*a)) + (4*(A - B)*sin(c + d*x))/(a*d) - (3*(4*A - 5*B)*cos(c + d*x)*sin(c + d*x))/(8*a*d) - ((4*A - 5*B)*cos(c + d*x)^3*sin(c + d*x))/(4*a*d) + ((A - B)*cos(c + d*x)^4*sin(c + d*x))/(d*(a + a*cos(c + d*x))) - (4*(A - B)*sin(c + d*x)^3)/(3*a*d)]
    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x)), x, 6, (3*(A - B)*x)/(2*a) - ((3*A - 4*B)*sin(c + d*x))/(a*d) + (3*(A - B)*cos(c + d*x)*sin(c + d*x))/(2*a*d) + ((A - B)*cos(c + d*x)^3*sin(c + d*x))/(d*(a + a*cos(c + d*x))) + ((3*A - 4*B)*sin(c + d*x)^3)/(3*a*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x)), x, 2, -(((A - B)*x)/a) + (B*x)/(2*a) + ((A - B)*sin(c + d*x))/(a*d) + (B*cos(c + d*x)*sin(c + d*x))/(2*a*d) + ((A - B)*sin(c + d*x))/(a*d*(1 + cos(c + d*x))), -(((2*A - 3*B)*x)/(2*a)) + (2*(A - B)*sin(c + d*x))/(a*d) - ((2*A - 3*B)*cos(c + d*x)*sin(c + d*x))/(2*a*d) + ((A - B)*cos(c + d*x)^2*sin(c + d*x))/(d*(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x)), x, 5, ((A - B)*x)/a + (B*sin(c + d*x))/(a*d) - ((A - B)*sin(c + d*x))/(a*d*(1 + cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + a*cos(c + d*x)), x, 2, (B*x)/a + ((A - B)*sin(c + d*x))/(d*(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x)), x, 3, (A*atanh(sin(c + d*x)))/(a*d) - ((A - B)*sin(c + d*x))/(d*(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x)), x, 5, -(((A - B)*atanh(sin(c + d*x)))/(a*d)) + ((2*A - B)*tan(c + d*x))/(a*d) - ((A - B)*tan(c + d*x))/(d*(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x)), x, 6, ((3*A - 2*B)*atanh(sin(c + d*x)))/(2*a*d) - (2*(A - B)*tan(c + d*x))/(a*d) + ((3*A - 2*B)*sec(c + d*x)*tan(c + d*x))/(2*a*d) - ((A - B)*sec(c + d*x)*tan(c + d*x))/(d*(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))/(a + a*cos(c + d*x)), x, 6, -((3*(A - B)*atanh(sin(c + d*x)))/(2*a*d)) + ((4*A - 3*B)*tan(c + d*x))/(a*d) - (3*(A - B)*sec(c + d*x)*tan(c + d*x))/(2*a*d) - ((A - B)*sec(c + d*x)^2*tan(c + d*x))/(d*(a + a*cos(c + d*x))) + ((4*A - 3*B)*tan(c + d*x)^3)/(3*a*d)]

    @test_int [cos(c + d*x)^4*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^2, x, 7, ((7*A - 10*B)*x)/(2*a^2) - (4*(2*A - 3*B)*sin(c + d*x))/(a^2*d) + ((7*A - 10*B)*cos(c + d*x)*sin(c + d*x))/(2*a^2*d) + ((7*A - 10*B)*cos(c + d*x)^3*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) + ((A - B)*cos(c + d*x)^4*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2) + (4*(2*A - 3*B)*sin(c + d*x)^3)/(3*a^2*d)]
    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^2, x, 3, -(((4*A - 7*B)*x)/(2*a^2)) + (2*(5*A - 8*B)*sin(c + d*x))/(3*a^2*d) - ((4*A - 7*B)*cos(c + d*x)*sin(c + d*x))/(2*a^2*d) + ((5*A - 8*B)*cos(c + d*x)^2*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) + ((A - B)*cos(c + d*x)^3*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^2, x, 6, ((A - 2*B)*x)/a^2 - ((A - 4*B)*sin(c + d*x))/(3*a^2*d) - ((A - 2*B)*sin(c + d*x))/(a^2*d*(1 + cos(c + d*x))) + ((A - B)*cos(c + d*x)^2*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^2, x, 4, (B*x)/a^2 + ((2*A - 5*B)*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^2, x, 2, ((A - B)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2) + ((A + 2*B)*sin(c + d*x))/(3*d*(a^2 + a^2*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^2, x, 4, (A*atanh(sin(c + d*x)))/(a^2*d) - ((4*A - B)*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^2, x, 6, -(((2*A - B)*atanh(sin(c + d*x)))/(a^2*d)) + (2*(5*A - 2*B)*tan(c + d*x))/(3*a^2*d) - ((2*A - B)*tan(c + d*x))/(a^2*d*(1 + cos(c + d*x))) - ((A - B)*tan(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^2, x, 7, ((7*A - 4*B)*atanh(sin(c + d*x)))/(2*a^2*d) - (2*(8*A - 5*B)*tan(c + d*x))/(3*a^2*d) + ((7*A - 4*B)*sec(c + d*x)*tan(c + d*x))/(2*a^2*d) - ((8*A - 5*B)*sec(c + d*x)*tan(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B)*sec(c + d*x)*tan(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^2, x, 7, -(((10*A - 7*B)*atanh(sin(c + d*x)))/(2*a^2*d)) + (4*(3*A - 2*B)*tan(c + d*x))/(a^2*d) - ((10*A - 7*B)*sec(c + d*x)*tan(c + d*x))/(2*a^2*d) - ((10*A - 7*B)*sec(c + d*x)^2*tan(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B)*sec(c + d*x)^2*tan(c + d*x))/(3*d*(a + a*cos(c + d*x))^2) + (4*(3*A - 2*B)*tan(c + d*x)^3)/(3*a^2*d)]

    @test_int [cos(c + d*x)^5*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^3, x, 8, ((13*A - 23*B)*x)/(2*a^3) - (4*(19*A - 34*B)*sin(c + d*x))/(5*a^3*d) + ((13*A - 23*B)*cos(c + d*x)*sin(c + d*x))/(2*a^3*d) + ((A - B)*cos(c + d*x)^5*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((8*A - 13*B)*cos(c + d*x)^4*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((13*A - 23*B)*cos(c + d*x)^3*sin(c + d*x))/(3*d*(a^3 + a^3*cos(c + d*x))) + (4*(19*A - 34*B)*sin(c + d*x)^3)/(15*a^3*d)]
    @test_int [cos(c + d*x)^4*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^3, x, 4, -(((6*A - 13*B)*x)/(2*a^3)) + (8*(9*A - 19*B)*sin(c + d*x))/(15*a^3*d) - ((6*A - 13*B)*cos(c + d*x)*sin(c + d*x))/(2*a^3*d) + ((A - B)*cos(c + d*x)^4*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((6*A - 11*B)*cos(c + d*x)^3*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + (4*(9*A - 19*B)*cos(c + d*x)^2*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^3, x, 7, ((A - 3*B)*x)/a^3 - ((7*A - 27*B)*sin(c + d*x))/(15*a^3*d) + ((A - B)*cos(c + d*x)^3*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((4*A - 9*B)*cos(c + d*x)^2*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((A - 3*B)*sin(c + d*x))/(d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^3, x, 5, (B*x)/a^3 + ((A - B)*cos(c + d*x)^2*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((2*A - 7*B)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((4*A - 29*B)*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^3, x, 4, -(((A - B)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3)) + ((3*A - 8*B)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((3*A + 7*B)*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^3, x, 3, ((A - B)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((2*A + 3*B)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((2*A + 3*B)*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^3, x, 5, (A*atanh(sin(c + d*x)))/(a^3*d) - ((A - B)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((7*A - 2*B)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - (2*(11*A - B)*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^3, x, 7, -(((3*A - B)*atanh(sin(c + d*x)))/(a^3*d)) + (2*(36*A - 11*B)*tan(c + d*x))/(15*a^3*d) - ((A - B)*tan(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((9*A - 4*B)*tan(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((3*A - B)*tan(c + d*x))/(d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^3, x, 8, ((13*A - 6*B)*atanh(sin(c + d*x)))/(2*a^3*d) - (8*(19*A - 9*B)*tan(c + d*x))/(15*a^3*d) + ((13*A - 6*B)*sec(c + d*x)*tan(c + d*x))/(2*a^3*d) - ((A - B)*sec(c + d*x)*tan(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((11*A - 6*B)*sec(c + d*x)*tan(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - (4*(19*A - 9*B)*sec(c + d*x)*tan(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]

    @test_int [cos(c + d*x)^5*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^4, x, 5, -(((8*A - 21*B)*x)/(2*a^4)) + (8*(83*A - 216*B)*sin(c + d*x))/(105*a^4*d) - ((8*A - 21*B)*cos(c + d*x)*sin(c + d*x))/(2*a^4*d) + ((52*A - 129*B)*cos(c + d*x)^3*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) + (4*(83*A - 216*B)*cos(c + d*x)^2*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) + ((A - B)*cos(c + d*x)^5*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) + ((A - 2*B)*cos(c + d*x)^4*sin(c + d*x))/(5*a*d*(a + a*cos(c + d*x))^3)]
    @test_int [cos(c + d*x)^4*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^4, x, 8, ((A - 4*B)*x)/a^4 - ((55*A - 244*B)*sin(c + d*x))/(105*a^4*d) + ((25*A - 88*B)*cos(c + d*x)^2*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - ((A - 4*B)*sin(c + d*x))/(a^4*d*(1 + cos(c + d*x))) + ((A - B)*cos(c + d*x)^4*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) + ((5*A - 12*B)*cos(c + d*x)^3*sin(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3)]
    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^4, x, 6, (B*x)/a^4 - ((6*A - 55*B)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) + ((12*A - 215*B)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) + ((A - B)*cos(c + d*x)^3*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) + ((3*A - 10*B)*cos(c + d*x)^2*sin(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^4, x, 5, -((2*(A + 27*B)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2)) + ((13*A + 36*B)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) + ((A - B)*cos(c + d*x)^2*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - ((A - 8*B)*sin(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^4, x, 5, -(((A - B)*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4)) + ((4*A - 11*B)*sin(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3) + ((8*A + 13*B)*sin(c + d*x))/(105*d*(a^2 + a^2*cos(c + d*x))^2) + ((8*A + 13*B)*sin(c + d*x))/(105*d*(a^4 + a^4*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^4, x, 4, ((A - B)*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) + ((3*A + 4*B)*sin(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3) + (2*(3*A + 4*B)*sin(c + d*x))/(105*d*(a^2 + a^2*cos(c + d*x))^2) + (2*(3*A + 4*B)*sin(c + d*x))/(105*d*(a^4 + a^4*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^4, x, 6, (A*atanh(sin(c + d*x)))/(a^4*d) - ((55*A - 6*B)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - (2*(80*A - 3*B)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A - B)*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - ((10*A - 3*B)*sin(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^4, x, 8, -(((4*A - B)*atanh(sin(c + d*x)))/(a^4*d)) + (8*(83*A - 20*B)*tan(c + d*x))/(105*a^4*d) - ((88*A - 25*B)*tan(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - ((4*A - B)*tan(c + d*x))/(a^4*d*(1 + cos(c + d*x))) - ((A - B)*tan(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - ((12*A - 5*B)*tan(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3)]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^4, x, 9, ((21*A - 8*B)*atanh(sin(c + d*x)))/(2*a^4*d) - (8*(216*A - 83*B)*tan(c + d*x))/(105*a^4*d) + ((21*A - 8*B)*sec(c + d*x)*tan(c + d*x))/(2*a^4*d) - ((129*A - 52*B)*sec(c + d*x)*tan(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - (4*(216*A - 83*B)*sec(c + d*x)*tan(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A - B)*sec(c + d*x)*tan(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - ((2*A - B)*sec(c + d*x)*tan(c + d*x))/(5*a*d*(a + a*cos(c + d*x))^3)]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*cos(e+f*x)^m*(a+a*cos(e+f*x))^(n/2)*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 5, (4*a*(9*A + 8*B)*sin(c + d*x))/(45*d*sqrt(a + a*cos(c + d*x))) + (2*a*(9*A + 8*B)*cos(c + d*x)^3*sin(c + d*x))/(63*d*sqrt(a + a*cos(c + d*x))) + (2*a*B*cos(c + d*x)^4*sin(c + d*x))/(9*d*sqrt(a + a*cos(c + d*x))) - (8*(9*A + 8*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d) + (4*(9*A + 8*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(105*a*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 4, (2*a*(7*A + 6*B)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a*B*cos(c + d*x)^3*sin(c + d*x))/(7*d*sqrt(a + a*cos(c + d*x))) - (4*(7*A + 6*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*d) + (2*(7*A + 6*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*a*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 4, (2*a*(5*A + 7*B)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*(5*A - 2*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*d) + (2*B*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*a*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 2, (2*a*(3*A + B)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*B*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 3, (2*sqrt(a)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a*B*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 3, (sqrt(a)*(A + 2*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (a*A*tan(c + d*x))/(d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 4, (sqrt(a)*(3*A + 4*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) + (a*(3*A + 4*B)*tan(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (a*A*sec(c + d*x)*tan(c + d*x))/(2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 5, (sqrt(a)*(5*A + 6*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a*(5*A + 6*B)*tan(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) + (a*(5*A + 6*B)*sec(c + d*x)*tan(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (a*A*sec(c + d*x)^2*tan(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x)))]

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 6, (4*a^2*(187*A + 168*B)*sin(c + d*x))/(495*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(187*A + 168*B)*cos(c + d*x)^3*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(11*A + 12*B)*cos(c + d*x)^4*sin(c + d*x))/(99*d*sqrt(a + a*cos(c + d*x))) - (8*a*(187*A + 168*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3465*d) + (2*a*B*cos(c + d*x)^4*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(11*d) + (4*(187*A + 168*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(1155*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 5, (2*a^2*(39*A + 34*B)*sin(c + d*x))/(45*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(9*A + 10*B)*cos(c + d*x)^3*sin(c + d*x))/(63*d*sqrt(a + a*cos(c + d*x))) - (4*a*(39*A + 34*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d) + (2*a*B*cos(c + d*x)^3*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(9*d) + (2*(39*A + 34*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(105*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 5, (8*a^2*(21*A + 19*B)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*(21*A + 19*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*d) + (2*(7*A - 2*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*d) + (2*B*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*a*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 3, (8*a^2*(5*A + 3*B)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a*(5*A + 3*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*d) + (2*B*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 4, (2*a^(3/2)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^2*(3*A + 4*B)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*a*B*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 4, (a^(3/2)*(3*A + 2*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a^2*(A - 2*B)*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))) + (a*A*sqrt(a + a*cos(c + d*x))*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 4, (a^(3/2)*(7*A + 12*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) + (a^2*(5*A + 4*B)*tan(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (a*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 5, (a^(3/2)*(11*A + 14*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a^2*(11*A + 14*B)*tan(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) + (a^2*(7*A + 6*B)*sec(c + d*x)*tan(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (a*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 6, (a^(3/2)*(75*A + 88*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^2*(75*A + 88*B)*tan(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a^2*(75*A + 88*B)*sec(c + d*x)*tan(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) + (a^2*(9*A + 8*B)*sec(c + d*x)^2*tan(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (a*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(4*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 6, (2*a^3*(803*A + 710*B)*sin(c + d*x))/(495*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(209*A + 194*B)*cos(c + d*x)^3*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) - (4*a^2*(803*A + 710*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3465*d) + (2*a^2*(11*A + 14*B)*cos(c + d*x)^3*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(99*d) + (2*a*(803*A + 710*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(1155*d) + (2*a*B*cos(c + d*x)^3*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(11*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 6, (64*a^3*(15*A + 13*B)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (16*a^2*(15*A + 13*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d) + (2*a*(15*A + 13*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(105*d) + (2*(9*A - 2*B)*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(63*d) + (2*B*(a + a*cos(c + d*x))^(7/2)*sin(c + d*x))/(9*a*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 4, (64*a^3*(7*A + 5*B)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (16*a^2*(7*A + 5*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*d) + (2*a*(7*A + 5*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*d) + (2*B*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 5, (2*a^(5/2)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^3*(35*A + 32*B)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(5*A + 8*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*d) + (2*a*B*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 5, (a^(5/2)*(5*A + 2*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (a^3*(3*A + 14*B)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) - (a^2*(3*A - 2*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d) + (a*A*(a + a*cos(c + d*x))^(3/2)*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 5, (a^(5/2)*(19*A + 20*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) - (a^3*(9*A - 4*B)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (a^2*(7*A + 4*B)*sqrt(a + a*cos(c + d*x))*tan(c + d*x))/(4*d) + (a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 5, (a^(5/2)*(25*A + 38*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a^3*(49*A + 54*B)*tan(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (a^2*(3*A + 2*B)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(4*d) + (a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 6, (a^(5/2)*(163*A + 200*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^3*(163*A + 200*B)*tan(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a^3*(95*A + 104*B)*sec(c + d*x)*tan(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) + (a^2*(11*A + 8*B)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(24*d) + (a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [sec(c + d*x)^6*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 7, (a^(5/2)*(283*A + 326*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(128*d) + (a^3*(283*A + 326*B)*tan(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))) + (a^3*(283*A + 326*B)*sec(c + d*x)*tan(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^3*(157*A + 170*B)*sec(c + d*x)^2*tan(c + d*x))/(240*d*sqrt(a + a*cos(c + d*x))) + (a^2*(13*A + 10*B)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(40*d) + (a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^4*tan(c + d*x))/(5*d)]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 7, -((sqrt(2)*(A - B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d)) + (4*(49*A - 37*B)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*(7*A - B)*cos(c + d*x)^2*sin(c + d*x))/(35*d*sqrt(a + a*cos(c + d*x))) + (2*B*cos(c + d*x)^3*sin(c + d*x))/(7*d*sqrt(a + a*cos(c + d*x))) - (2*(7*A - 31*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*a*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 6, (sqrt(2)*(A - B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) - (4*(5*A - 7*B)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*B*cos(c + d*x)^2*sin(c + d*x))/(5*d*sqrt(a + a*cos(c + d*x))) + (2*(5*A - B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*a*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 5, -((sqrt(2)*(A - B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d)) + (2*(3*A - 2*B)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*B*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*a*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 3, (sqrt(2)*(A - B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + (2*B*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 5, (2*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(sqrt(a)*d) - (sqrt(2)*(A - B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 6, -(((A - 2*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(sqrt(a)*d)) + (sqrt(2)*(A - B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + (A*tan(c + d*x))/(d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 7, ((7*A - 4*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*sqrt(a)*d) - (sqrt(2)*(A - B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) - ((A - 4*B)*tan(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (A*sec(c + d*x)*tan(c + d*x))/(2*d*sqrt(a + a*cos(c + d*x)))]

    @test_int [cos(c + d*x)^4*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 8, -(((15*A - 19*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d)) + ((A - B)*cos(c + d*x)^4*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((651*A - 799*B)*sin(c + d*x))/(105*a*d*sqrt(a + a*cos(c + d*x))) + ((63*A - 67*B)*cos(c + d*x)^2*sin(c + d*x))/(70*a*d*sqrt(a + a*cos(c + d*x))) - ((7*A - 11*B)*cos(c + d*x)^3*sin(c + d*x))/(14*a*d*sqrt(a + a*cos(c + d*x))) - ((273*A - 397*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(210*a^2*d)]
    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 7, ((11*A - 15*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) + ((A - B)*cos(c + d*x)^3*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) - ((65*A - 93*B)*sin(c + d*x))/(15*a*d*sqrt(a + a*cos(c + d*x))) - ((5*A - 9*B)*cos(c + d*x)^2*sin(c + d*x))/(10*a*d*sqrt(a + a*cos(c + d*x))) + ((35*A - 39*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(30*a^2*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 6, -(((7*A - 11*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d)) + ((A - B)*cos(c + d*x)^2*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((9*A - 13*B)*sin(c + d*x))/(3*a*d*sqrt(a + a*cos(c + d*x))) - ((3*A - 7*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(6*a^2*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 5, ((3*A - 7*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) - ((A - B)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + (2*B*sin(c + d*x))/(a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 3, ((A + 3*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) + ((A - B)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 6, (2*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(3/2)*d) - ((5*A - B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) - ((A - B)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 7, -(((3*A - 2*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(3/2)*d)) + ((9*A - 5*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) - ((A - B)*tan(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((3*A - B)*tan(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 8, ((19*A - 12*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*a^(3/2)*d) - ((13*A - 9*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) - ((7*A - 6*B)*tan(c + d*x))/(4*a*d*sqrt(a + a*cos(c + d*x))) - ((A - B)*sec(c + d*x)*tan(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((2*A - B)*sec(c + d*x)*tan(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x)))]

    @test_int [cos(c + d*x)^4*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 8, ((163*A - 283*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) + ((A - B)*cos(c + d*x)^4*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((13*A - 21*B)*cos(c + d*x)^3*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) - ((985*A - 1729*B)*sin(c + d*x))/(120*a^2*d*sqrt(a + a*cos(c + d*x))) - ((85*A - 157*B)*cos(c + d*x)^2*sin(c + d*x))/(80*a^2*d*sqrt(a + a*cos(c + d*x))) + ((475*A - 787*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(240*a^3*d)]
    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 7, -(((75*A - 163*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d)) + ((A - B)*cos(c + d*x)^3*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((9*A - 17*B)*cos(c + d*x)^2*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((93*A - 197*B)*sin(c + d*x))/(24*a^2*d*sqrt(a + a*cos(c + d*x))) - ((39*A - 95*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(48*a^3*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 6, ((19*A - 75*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) + ((A - B)*cos(c + d*x)^2*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((5*A - 13*B)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) - ((A - 9*B)*sin(c + d*x))/(4*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 5, ((5*A + 19*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - ((A - B)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((5*A - 13*B)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 4, ((3*A + 5*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) + ((A - B)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((3*A + 5*B)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 7, (2*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(5/2)*d) - ((43*A - 3*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - ((A - B)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((11*A - 3*B)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 8, -(((5*A - 2*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(5/2)*d)) + ((115*A - 43*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - ((A - B)*tan(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((15*A - 7*B)*tan(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((35*A - 11*B)*tan(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 9, ((39*A - 20*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*a^(5/2)*d) - ((219*A - 115*B)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - (7*(9*A - 5*B)*tan(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x))) - ((A - B)*sec(c + d*x)*tan(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((19*A - 11*B)*sec(c + d*x)*tan(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((31*A - 15*B)*sec(c + d*x)*tan(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x)))]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*cos(e+f*x)^(m/2)*(a+a*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))*(A + B*cos(c + d*x)), x, 8, (2*a*(9*A + 7*B)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (10*a*(A + B)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (10*a*(A + B)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a*(9*A + 7*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*a*(A + B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d) + (2*a*B*cos(c + d*x)^(7/2)*sin(c + d*x))/(9*d)]
    @test_int [cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))*(A + B*cos(c + d*x)), x, 7, (6*a*(A + B)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*a*(7*A + 5*B)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a*(7*A + 5*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a*(A + B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*a*B*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [sqrt(cos(c + d*x))*(a + a*cos(c + d*x))*(A + B*cos(c + d*x)), x, 6, (2*a*(5*A + 3*B)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*a*(A + B)*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a*(A + B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*a*B*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [((a + a*cos(c + d*x))*(A + B*cos(c + d*x)))/sqrt(cos(c + d*x)), x, 5, (2*a*(A + B)*Elliptic.E((c + d*x)/2, 2))/d + (2*a*(3*A + B)*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a*B*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [((a + a*cos(c + d*x))*(A + B*cos(c + d*x)))/cos(c + d*x)^(3/2), x, 5, (-2*a*(A - B)*Elliptic.E((c + d*x)/2, 2))/d + (2*a*(A + B)*Elliptic.F((c + d*x)/2, 2))/d + (2*a*A*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))*(A + B*cos(c + d*x)))/cos(c + d*x)^(5/2), x, 6, (-2*a*(A + B)*Elliptic.E((c + d*x)/2, 2))/d + (2*a*(A + 3*B)*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a*A*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*a*(A + B)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))*(A + B*cos(c + d*x)))/cos(c + d*x)^(7/2), x, 7, (-2*a*(3*A + 5*B)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*a*(A + B)*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a*A*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*a*(A + B)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*a*(3*A + 5*B)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x)))]

    @test_int [cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x)), x, 8, (4*a^2*(9*A + 8*B)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^2*(6*A + 5*B)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (4*a^2*(6*A + 5*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (4*a^2*(9*A + 8*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*a^2*(9*A + 11*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(63*d) + (2*B*cos(c + d*x)^(5/2)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(9*d)]
    @test_int [sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x)), x, 7, (4*a^2*(4*A + 3*B)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^2*(7*A + 6*B)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (4*a^2*(7*A + 6*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a^2*(7*A + 9*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(35*d) + (2*B*cos(c + d*x)^(3/2)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(7*d)]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x)))/sqrt(cos(c + d*x)), x, 6, (4*a^2*(5*A + 4*B)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^2*(2*A + B)*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a^2*(5*A + 7*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) + (2*B*sqrt(cos(c + d*x))*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(5*d)]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x)))/cos(c + d*x)^(3/2), x, 6, (4*a^2*B*Elliptic.E((c + d*x)/2, 2))/d + (4*a^2*(3*A + 2*B)*Elliptic.F((c + d*x)/2, 2))/(3*d) - (2*a^2*(3*A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x)))/cos(c + d*x)^(5/2), x, 6, (-4*a^2*A*Elliptic.E((c + d*x)/2, 2))/d + (4*a^2*(2*A + 3*B)*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a^2*(5*A + 3*B)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) + (2*A*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x)))/cos(c + d*x)^(7/2), x, 7, (-4*a^2*(4*A + 5*B)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^2*(A + 2*B)*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a^2*(7*A + 5*B)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)) + (4*a^2*(4*A + 5*B)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*A*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x)))/cos(c + d*x)^(9/2), x, 8, (-4*a^2*(3*A + 4*B)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^2*(6*A + 7*B)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a^2*(9*A + 7*B)*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (4*a^2*(6*A + 7*B)*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (4*a^2*(3*A + 4*B)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*A*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]

    @test_int [cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x)), x, 9, (4*a^3*(17*A + 15*B)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^3*(121*A + 105*B)*Elliptic.F((c + d*x)/2, 2))/(231*d) + (4*a^3*(121*A + 105*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (4*a^3*(17*A + 15*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (20*a^3*(22*A + 21*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(693*d) + (2*a*B*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^2*sin(c + d*x))/(11*d) + (2*(11*A + 15*B)*cos(c + d*x)^(5/2)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(99*d)]
    @test_int [sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x)), x, 8, (4*a^3*(21*A + 17*B)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^3*(13*A + 11*B)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (4*a^3*(13*A + 11*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (4*a^3*(24*A + 23*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*a*B*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^2*sin(c + d*x))/(9*d) + (2*(9*A + 13*B)*cos(c + d*x)^(3/2)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(63*d)]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x)))/sqrt(cos(c + d*x)), x, 7, (4*a^3*(9*A + 7*B)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(21*A + 13*B)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (4*a^3*(42*A + 41*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(105*d) + (2*a*B*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2*sin(c + d*x))/(7*d) + (2*(7*A + 11*B)*sqrt(cos(c + d*x))*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(35*d)]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x)))/cos(c + d*x)^(3/2), x, 7, (4*a^3*(5*A + 9*B)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(5*A + 3*B)*Elliptic.F((c + d*x)/2, 2))/(3*d) - (4*a^3*(5*A - 6*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) + (2*a*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - (2*(5*A - B)*sqrt(cos(c + d*x))*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(5*d)]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x)))/cos(c + d*x)^(5/2), x, 7, (-4*a^3*(A - B)*Elliptic.E((c + d*x)/2, 2))/d + (20*a^3*(A + B)*Elliptic.F((c + d*x)/2, 2))/(3*d) - (4*a^3*(4*A + B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*a*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*(7*A + 3*B)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(3*d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x)))/cos(c + d*x)^(7/2), x, 7, (-4*a^3*(9*A + 5*B)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(3*A + 5*B)*Elliptic.F((c + d*x)/2, 2))/(3*d) + (4*a^3*(21*A + 20*B)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*a*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*(9*A + 5*B)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2))]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x)))/cos(c + d*x)^(9/2), x, 8, (-4*a^3*(7*A + 9*B)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(13*A + 21*B)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (4*a^3*(41*A + 42*B)*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (4*a^3*(7*A + 9*B)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*a*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (2*(11*A + 7*B)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2))]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x)))/cos(c + d*x)^(11/2), x, 9, (-4*a^3*(17*A + 21*B)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^3*(11*A + 13*B)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (4*a^3*(23*A + 24*B)*sin(c + d*x))/(105*d*cos(c + d*x)^(5/2)) + (4*a^3*(11*A + 13*B)*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (4*a^3*(17*A + 21*B)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*a*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2)) + (2*(13*A + 9*B)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2))]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [(cos(c + d*x)^(5/2)*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x)), x, 6, (-3*(5*A - 7*B)*Elliptic.E((c + d*x)/2, 2))/(5*a*d) + (5*(A - B)*Elliptic.F((c + d*x)/2, 2))/(3*a*d) + (5*(A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a*d) - ((5*A - 7*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*a*d) + ((A - B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(d*(a + a*cos(c + d*x)))]
    @test_int [(cos(c + d*x)^(3/2)*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x)), x, 5, (3*(A - B)*Elliptic.E((c + d*x)/2, 2))/(a*d) - ((3*A - 5*B)*Elliptic.F((c + d*x)/2, 2))/(3*a*d) - ((3*A - 5*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a*d) + ((A - B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(d*(a + a*cos(c + d*x)))]
    @test_int [(sqrt(cos(c + d*x))*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x)), x, 4, -(((A - 3*B)*Elliptic.E((c + d*x)/2, 2))/(a*d)) + ((A - B)*Elliptic.F((c + d*x)/2, 2))/(a*d) + ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(d*(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/(sqrt(cos(c + d*x))*(a + a*cos(c + d*x))), x, 4, ((A - B)*Elliptic.E((c + d*x)/2, 2))/(a*d) + ((A + B)*Elliptic.F((c + d*x)/2, 2))/(a*d) - ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(d*(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/(cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))), x, 5, -(((3*A - B)*Elliptic.E((c + d*x)/2, 2))/(a*d)) - ((A - B)*Elliptic.F((c + d*x)/2, 2))/(a*d) + ((3*A - B)*sin(c + d*x))/(a*d*sqrt(cos(c + d*x))) - ((A - B)*sin(c + d*x))/(d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))), x, 6, (3*(A - B)*Elliptic.E((c + d*x)/2, 2))/(a*d) + ((5*A - 3*B)*Elliptic.F((c + d*x)/2, 2))/(3*a*d) + ((5*A - 3*B)*sin(c + d*x))/(3*a*d*cos(c + d*x)^(3/2)) - (3*(A - B)*sin(c + d*x))/(a*d*sqrt(cos(c + d*x))) - ((A - B)*sin(c + d*x))/(d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x)))]

    @test_int [(cos(c + d*x)^(7/2)*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x))^2, x, 7, (-7*(5*A - 8*B)*Elliptic.E((c + d*x)/2, 2))/(5*a^2*d) + (5*(2*A - 3*B)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + (5*(2*A - 3*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a^2*d) - (7*(5*A - 8*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(15*a^2*d) + ((2*A - 3*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(a^2*d*(1 + cos(c + d*x))) + ((A - B)*cos(c + d*x)^(7/2)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [(cos(c + d*x)^(5/2)*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x))^2, x, 6, ((4*A - 7*B)*Elliptic.E((c + d*x)/2, 2))/(a^2*d) - (5*(A - 2*B)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) - (5*(A - 2*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a^2*d) + ((4*A - 7*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) + ((A - B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [(cos(c + d*x)^(3/2)*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x))^2, x, 5, -(((A - 4*B)*Elliptic.E((c + d*x)/2, 2))/(a^2*d)) + ((2*A - 5*B)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + ((2*A - 5*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) + ((A - B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [(sqrt(cos(c + d*x))*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x))^2, x, 5, -((B*Elliptic.E((c + d*x)/2, 2))/(a^2*d)) + ((A + 2*B)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + (B*sqrt(cos(c + d*x))*sin(c + d*x))/(a^2*d*(1 + cos(c + d*x))) + ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [(A + B*cos(c + d*x))/(sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2), x, 5, (A*Elliptic.E((c + d*x)/2, 2))/(a^2*d) + ((2*A + B)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) - (A*sqrt(cos(c + d*x))*sin(c + d*x))/(a^2*d*(1 + cos(c + d*x))) - ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [(A + B*cos(c + d*x))/(cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^2), x, 6, -(((4*A - B)*Elliptic.E((c + d*x)/2, 2))/(a^2*d)) - ((5*A - 2*B)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + ((4*A - B)*sin(c + d*x))/(a^2*d*sqrt(cos(c + d*x))) - ((5*A - 2*B)*sin(c + d*x))/(3*a^2*d*sqrt(cos(c + d*x))*(1 + cos(c + d*x))) - ((A - B)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2)]
    @test_int [(A + B*cos(c + d*x))/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^2), x, 7, ((7*A - 4*B)*Elliptic.E((c + d*x)/2, 2))/(a^2*d) + (5*(2*A - B)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + (5*(2*A - B)*sin(c + d*x))/(3*a^2*d*cos(c + d*x)^(3/2)) - ((7*A - 4*B)*sin(c + d*x))/(a^2*d*sqrt(cos(c + d*x))) - ((7*A - 4*B)*sin(c + d*x))/(3*a^2*d*cos(c + d*x)^(3/2)*(1 + cos(c + d*x))) - ((A - B)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^2)]

    @test_int [(cos(c + d*x)^(9/2)*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x))^3, x, 8, (-7*(17*A - 33*B)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((11*A - 21*B)*Elliptic.F((c + d*x)/2, 2))/(2*a^3*d) + ((11*A - 21*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*a^3*d) - (7*(17*A - 33*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(30*a^3*d) + ((A - B)*cos(c + d*x)^(9/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((7*A - 12*B)*cos(c + d*x)^(7/2)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + (3*(11*A - 21*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(10*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(cos(c + d*x)^(7/2)*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x))^3, x, 7, (7*(7*A - 17*B)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) - ((13*A - 33*B)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) - ((13*A - 33*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(6*a^3*d) + ((A - B)*cos(c + d*x)^(7/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((A - 2*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(3*a*d*(a + a*cos(c + d*x))^2) + (7*(7*A - 17*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(30*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(cos(c + d*x)^(5/2)*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x))^3, x, 6, -((9*A - 49*B)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((3*A - 13*B)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) + ((A - B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((3*A - 8*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((3*A - 13*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(6*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(cos(c + d*x)^(3/2)*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x))^3, x, 6, -((A + 9*B)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((A + 3*B)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) + ((A - B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((A - 6*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((A + 9*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(10*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(sqrt(cos(c + d*x))*(A + B*cos(c + d*x)))/(a + a*cos(c + d*x))^3, x, 6, ((A - B)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((A + B)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) + ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((A + 4*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(10*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/(sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^3), x, 6, ((9*A + B)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((3*A + B)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) - ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((6*A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((9*A + B)*sqrt(cos(c + d*x))*sin(c + d*x))/(10*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/(cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^3), x, 7, -((49*A - 9*B)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) - ((13*A - 3*B)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) + ((49*A - 9*B)*sin(c + d*x))/(10*a^3*d*sqrt(cos(c + d*x))) - ((A - B)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^3) - ((8*A - 3*B)*sin(c + d*x))/(15*a*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2) - ((13*A - 3*B)*sin(c + d*x))/(6*d*sqrt(cos(c + d*x))*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^3), x, 8, (7*(17*A - 7*B)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((33*A - 13*B)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) + ((33*A - 13*B)*sin(c + d*x))/(6*a^3*d*cos(c + d*x)^(3/2)) - (7*(17*A - 7*B)*sin(c + d*x))/(10*a^3*d*sqrt(cos(c + d*x))) - ((A - B)*sin(c + d*x))/(5*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^3) - ((2*A - B)*sin(c + d*x))/(3*a*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^2) - (7*(17*A - 7*B)*sin(c + d*x))/(30*d*cos(c + d*x)^(3/2)*(a^3 + a^3*cos(c + d*x)))]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*cos(e+f*x)^(m/2)*(a+a*cos(e+f*x))^(n/2)*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [cos(c + d*x)^(5/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 6, (5*sqrt(a)*(8*A + 7*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (5*a*(8*A + 7*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (5*a*(8*A + 7*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) + (a*(8*A + 7*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (a*B*cos(c + d*x)^(7/2)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 5, (sqrt(a)*(6*A + 5*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a*(6*A + 5*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) + (a*(6*A + 5*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (a*B*cos(c + d*x)^(5/2)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 4, (sqrt(a)*(4*A + 3*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) + (a*(4*A + 3*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (a*B*cos(c + d*x)^(3/2)*sin(c + d*x))/(2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 3, (sqrt(a)*(2*A + B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (a*B*sqrt(cos(c + d*x))*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 3, (2*sqrt(a)*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a*A*sin(c + d*x))/(d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 2, (2*a*A*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (2*a*(2*A + 3*B)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-7/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 3, (2*a*A*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (2*a*(4*A + 5*B)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (4*a*(4*A + 5*B)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-9/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2), x, 4, (2*a*A*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))) + (2*a*(6*A + 7*B)*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (8*a*(6*A + 7*B)*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (16*a*(6*A + 7*B)*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]

    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 6, (a^(3/2)*(88*A + 75*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^2*(88*A + 75*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a^2*(88*A + 75*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) + (a^2*(8*A + 9*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (a*B*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d)]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 5, (a^(3/2)*(14*A + 11*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a^2*(14*A + 11*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) + (a^2*(6*A + 7*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (a*B*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 4, (a^(3/2)*(12*A + 7*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) + (a^2*(4*A + 5*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (a*B*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d)]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 4, (a^(3/2)*(2*A + 3*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a^2*(2*A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 4, (2*a^(3/2)*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^2*(4*A + 3*B)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [cos(c + d*x)^(-7/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 3, (2*a^2*(6*A + 5*B)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (2*a^2*(18*A + 25*B)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [cos(c + d*x)^(-9/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 4, (2*a^2*(8*A + 7*B)*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (2*a^2*(52*A + 63*B)*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (4*a^2*(52*A + 63*B)*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [cos(c + d*x)^(-11/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(3/2), x, 5, (2*a^2*(10*A + 9*B)*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))) + (2*a^2*(34*A + 39*B)*sin(c + d*x))/(105*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (8*a^2*(34*A + 39*B)*sin(c + d*x))/(315*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (16*a^2*(34*A + 39*B)*sin(c + d*x))/(315*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]

    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 7, (a^(5/2)*(326*A + 283*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(128*d) + (a^3*(326*A + 283*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))) + (a^3*(326*A + 283*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^3*(170*A + 157*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(240*d*sqrt(a + a*cos(c + d*x))) + (a^2*(10*A + 13*B)*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(40*d) + (a*B*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 6, (a^(5/2)*(200*A + 163*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^3*(200*A + 163*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a^3*(104*A + 95*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) + (a^2*(8*A + 11*B)*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(24*d) + (a*B*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(4*d)]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 5, (a^(5/2)*(38*A + 25*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a^3*(54*A + 49*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (a^2*(2*A + 3*B)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d) + (a*B*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 5, (a^(5/2)*(20*A + 19*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) - (a^3*(4*A - 9*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) - (a^2*(4*A - B)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 5, (a^(5/2)*(2*A + 5*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a^3*(14*A + 3*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(2*A + B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x))) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [cos(c + d*x)^(-7/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 5, (2*a^(5/2)*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^3*(32*A + 35*B)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(8*A + 5*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [cos(c + d*x)^(-9/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 4, (2*a^3*(10*A + 11*B)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (2*a^3*(230*A + 301*B)*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(10*A + 7*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [cos(c + d*x)^(-11/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 5, (2*a^3*(124*A + 135*B)*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (2*a^3*(292*A + 345*B)*sin(c + d*x))/(315*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (4*a^3*(292*A + 345*B)*sin(c + d*x))/(315*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(4*A + 3*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(21*d*cos(c + d*x)^(7/2)) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]
    @test_int [cos(c + d*x)^(-13/2)*(A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(5/2), x, 6, (2*a^3*(194*A + 209*B)*sin(c + d*x))/(693*d*cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))) + (2*a^3*(710*A + 803*B)*sin(c + d*x))/(1155*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (8*a^3*(710*A + 803*B)*sin(c + d*x))/(3465*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (16*a^3*(710*A + 803*B)*sin(c + d*x))/(3465*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(14*A + 11*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(99*d*cos(c + d*x)^(9/2)) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(11*d*cos(c + d*x)^(11/2))]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 7, -(((4*A - 7*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*sqrt(a)*d)) + (sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + ((4*A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (B*cos(c + d*x)^(3/2)*sin(c + d*x))/(2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 6, ((2*A - B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(sqrt(a)*d) - (sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + (B*sqrt(cos(c + d*x))*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 5, (2*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(sqrt(a)*d) + (sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d)]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 4, -((sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d)) + (2*A*sin(c + d*x))/(d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 5, (sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + (2*A*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) - (2*(A - 3*B)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-7/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(1/2), x, 6, -((sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d)) + (2*A*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) - (2*(A - 5*B)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (2*(13*A - 5*B)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]

    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 7, ((2*A - 3*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(3/2)*d) - ((5*A - 9*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) + ((A - B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) - ((A - 3*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 6, (2*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(3/2)*d) + ((A - 5*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) + ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 4, ((3*A + B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) - ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 5, -(((7*A - 3*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d)) - ((A - B)*sin(c + d*x))/(2*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)) + ((5*A - B)*sin(c + d*x))/(2*a*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(3/2), x, 6, ((11*A - 7*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) - ((A - B)*sin(c + d*x))/(2*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)) + ((7*A - 3*B)*sin(c + d*x))/(6*a*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) - ((19*A - 15*B)*sin(c + d*x))/(6*a*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]

    @test_int [cos(c + d*x)^(5/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 8, ((2*A - 5*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(5/2)*d) - ((43*A - 115*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) + ((A - B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((7*A - 15*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) - ((11*A - 35*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 7, (2*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(5/2)*d) + ((3*A - 43*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) + ((A - B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((3*A - 11*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 5, ((5*A + 3*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) + ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((A + 7*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 5, ((19*A + 5*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((9*A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 6, -(((75*A - 19*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d)) - ((A - B)*sin(c + d*x))/(4*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(5/2)) - ((13*A - 5*B)*sin(c + d*x))/(16*a*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)) + ((49*A - 9*B)*sin(c + d*x))/(16*a^2*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(5/2), x, 7, ((163*A - 75*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - ((A - B)*sin(c + d*x))/(4*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(5/2)) - ((17*A - 9*B)*sin(c + d*x))/(16*a*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)) + ((95*A - 39*B)*sin(c + d*x))/(48*a^2*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) - ((299*A - 147*B)*sin(c + d*x))/(48*a^2*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]

    @test_int [cos(c + d*x)^(7/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(7/2), x, 9, ((2*A - 7*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(7/2)*d) - ((177*A - 637*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(64*sqrt(2)*a^(7/2)*d) + ((A - B)*cos(c + d*x)^(7/2)*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)) + ((3*A - 7*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(5/2)) + ((79*A - 259*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(192*a^2*d*(a + a*cos(c + d*x))^(3/2)) - (7*(7*A - 27*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(64*a^3*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(5/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(7/2), x, 8, (2*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(7/2)*d) + ((5*A - 177*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(64*sqrt(2)*a^(7/2)*d) + ((A - B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)) + ((5*A - 17*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(48*a*d*(a + a*cos(c + d*x))^(5/2)) + ((5*A - 49*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(64*a^2*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(7/2), x, 6, ((7*A + 5*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(64*sqrt(2)*a^(7/2)*d) + ((A - B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)) + ((A - 13*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(48*a*d*(a + a*cos(c + d*x))^(5/2)) + ((17*A + 67*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(192*a^2*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(7/2), x, 6, ((13*A + 7*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(64*sqrt(2)*a^(7/2)*d) + ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)) + ((A + 3*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(5/2)) - ((5*A - 17*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(192*a^2*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(7/2), x, 6, ((63*A + 13*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(64*sqrt(2)*a^(7/2)*d) - ((A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)) - ((5*A - B)*sqrt(cos(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(5/2)) - ((103*A + 5*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(192*a^2*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(7/2), x, 7, -((3*(121*A - 21*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(64*sqrt(2)*a^(7/2)*d)) - ((A - B)*sin(c + d*x))/(6*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(7/2)) - ((19*A - 7*B)*sin(c + d*x))/(48*a*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(5/2)) - ((199*A - 43*B)*sin(c + d*x))/(192*a^2*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)) + ((691*A - 103*B)*sin(c + d*x))/(192*a^3*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))/(a + a*cos(c + d*x))^(7/2), x, 8, ((1015*A - 363*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(64*sqrt(2)*a^(7/2)*d) - ((A - B)*sin(c + d*x))/(6*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(7/2)) - ((23*A - 11*B)*sin(c + d*x))/(48*a*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(5/2)) - ((109*A - 41*B)*sin(c + d*x))/(64*a^2*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)) + ((579*A - 199*B)*sin(c + d*x))/(192*a^3*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) - ((1887*A - 691*B)*sin(c + d*x))/(192*a^3*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*(c*cos(e+f*x))^m*(a+b*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*cos(e+f*x)^m*(a+b*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 7, (1/8)*(4*a*A + 3*b*B)*x + ((A*b + a*B)*sin(c + d*x))/d + ((4*a*A + 3*b*B)*cos(c + d*x)*sin(c + d*x))/(8*d) + (b*B*cos(c + d*x)^3*sin(c + d*x))/(4*d) - ((A*b + a*B)*sin(c + d*x)^3)/(3*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 3, (1/2)*(A*b + a*B)*x + ((3*a*A + 2*b*B)*sin(c + d*x))/(3*d) + ((A*b + a*B)*cos(c + d*x)*sin(c + d*x))/(2*d) + (b*B*cos(c + d*x)^2*sin(c + d*x))/(3*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 1, (1/2)*(2*a*A + b*B)*x + ((A*b + a*B)*sin(c + d*x))/d + (b*B*cos(c + d*x)*sin(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 4, (A*b + a*B)*x + (a*A*atanh(sin(c + d*x)))/d + (b*B*sin(c + d*x))/d]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 4, b*B*x + ((A*b + a*B)*atanh(sin(c + d*x)))/d + (a*A*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 6, ((a*A + 2*b*B)*atanh(sin(c + d*x)))/(2*d) + ((A*b + a*B)*tan(c + d*x))/d + (a*A*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 7, ((A*b + a*B)*atanh(sin(c + d*x)))/(2*d) + ((2*a*A + 3*b*B)*tan(c + d*x))/(3*d) + ((A*b + a*B)*sec(c + d*x)*tan(c + d*x))/(2*d) + (a*A*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 7, ((3*a*A + 4*b*B)*atanh(sin(c + d*x)))/(8*d) + ((A*b + a*B)*tan(c + d*x))/d + ((3*a*A + 4*b*B)*sec(c + d*x)*tan(c + d*x))/(8*d) + (a*A*sec(c + d*x)^3*tan(c + d*x))/(4*d) + ((A*b + a*B)*tan(c + d*x)^3)/(3*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 7, (1/8)*(4*a^2*A + 3*A*b^2 + 6*a*b*B)*x + ((4*b^2*B + 5*a*(2*A*b + a*B))*sin(c + d*x))/(5*d) + ((4*a^2*A + 3*A*b^2 + 6*a*b*B)*cos(c + d*x)*sin(c + d*x))/(8*d) + (b*(5*A*b + 6*a*B)*cos(c + d*x)^3*sin(c + d*x))/(20*d) + (b*B*cos(c + d*x)^3*(a + b*cos(c + d*x))*sin(c + d*x))/(5*d) - ((4*b^2*B + 5*a*(2*A*b + a*B))*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 4, (1/8)*(8*a*A*b + 4*a^2*B + 3*b^2*B)*x + ((4*a^2*A*b + 4*A*b^3 - a^3*B + 8*a*b^2*B)*sin(c + d*x))/(6*b*d) + ((8*a*A*b - 2*a^2*B + 9*b^2*B)*cos(c + d*x)*sin(c + d*x))/(24*d) + ((4*A*b - a*B)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(12*b*d) + (B*(a + b*cos(c + d*x))^3*sin(c + d*x))/(4*b*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 2, (1/2)*(2*a^2*A + A*b^2 + 2*a*b*B)*x + (2*(3*a*A*b + a^2*B + b^2*B)*sin(c + d*x))/(3*d) + (b*(3*A*b + 2*a*B)*cos(c + d*x)*sin(c + d*x))/(6*d) + (B*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 4, ((4*a*A*b + 2*a^2*B + b^2*B)*x)/2 + (a^2*A*atanh(sin(c + d*x)))/d + (b*(2*A*b + 3*a*B)*sin(c + d*x))/(2*d) + (b*B*(a + b*cos(c + d*x))*sin(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 4, b*(A*b + 2*a*B)*x + (a*(2*A*b + a*B)*atanh(sin(c + d*x)))/d + (b^2*B*sin(c + d*x))/d + (a^2*A*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 4, b^2*B*x + ((a^2*A + 2*A*b^2 + 4*a*b*B)*atanh(sin(c + d*x)))/(2*d) + (a*(2*A*b + a*B)*tan(c + d*x))/d + (a^2*A*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 6, ((2*a*A*b + a^2*B + 2*b^2*B)*atanh(sin(c + d*x)))/(2*d) + ((2*a^2*A + 3*A*b^2 + 6*a*b*B)*tan(c + d*x))/(3*d) + (a*(2*A*b + a*B)*sec(c + d*x)*tan(c + d*x))/(2*d) + (a^2*A*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 7, ((3*a^2*A + 4*A*b^2 + 8*a*b*B)*atanh(sin(c + d*x)))/(8*d) + ((4*a*A*b + 2*a^2*B + 3*b^2*B)*tan(c + d*x))/(3*d) + ((3*a^2*A + 4*A*b^2 + 8*a*b*B)*sec(c + d*x)*tan(c + d*x))/(8*d) + (a*(2*A*b + a*B)*sec(c + d*x)^2*tan(c + d*x))/(3*d) + (a^2*A*sec(c + d*x)^3*tan(c + d*x))/(4*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 8, (1/16)*(8*a^3*A + 18*a*A*b^2 + 18*a^2*b*B + 5*b^3*B)*x + ((15*a^2*A*b + 4*A*b^3 + 5*a^3*B + 12*a*b^2*B)*sin(c + d*x))/(5*d) + ((8*a^3*A + 18*a*A*b^2 + 18*a^2*b*B + 5*b^3*B)*cos(c + d*x)*sin(c + d*x))/(16*d) + (b*(18*a*A*b + 14*a^2*B + 5*b^2*B)*cos(c + d*x)^3*sin(c + d*x))/(24*d) + (b^2*(3*A*b + 4*a*B)*cos(c + d*x)^4*sin(c + d*x))/(15*d) + (b*B*cos(c + d*x)^3*(a + b*cos(c + d*x))^2*sin(c + d*x))/(6*d) - ((15*a^2*A*b + 4*A*b^3 + 5*a^3*B + 12*a*b^2*B)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 5, (1/8)*(12*a^2*A*b + 3*A*b^3 + 4*a^3*B + 9*a*b^2*B)*x + ((15*a^3*A*b + 60*a*A*b^3 - 3*a^4*B + 52*a^2*b^2*B + 16*b^4*B)*sin(c + d*x))/(30*b*d) + ((30*a^2*A*b + 45*A*b^3 - 6*a^3*B + 71*a*b^2*B)*cos(c + d*x)*sin(c + d*x))/(120*d) + ((15*a*A*b - 3*a^2*B + 16*b^2*B)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(60*b*d) + ((5*A*b - a*B)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(20*b*d) + (B*(a + b*cos(c + d*x))^4*sin(c + d*x))/(5*b*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 3, (1/8)*(8*a^3*A + 12*a*A*b^2 + 12*a^2*b*B + 3*b^3*B)*x + ((16*a^2*A*b + 4*A*b^3 + 3*a^3*B + 12*a*b^2*B)*sin(c + d*x))/(6*d) + (b*(20*a*A*b + 6*a^2*B + 9*b^2*B)*cos(c + d*x)*sin(c + d*x))/(24*d) + ((4*A*b + 3*a*B)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(12*d) + (B*(a + b*cos(c + d*x))^3*sin(c + d*x))/(4*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 5, (1/2)*(6*a^2*A*b + A*b^3 + 2*a^3*B + 3*a*b^2*B)*x + (a^3*A*atanh(sin(c + d*x)))/d + (b*(9*a*A*b + 8*a^2*B + 2*b^2*B)*sin(c + d*x))/(3*d) + (b^2*(3*A*b + 5*a*B)*cos(c + d*x)*sin(c + d*x))/(6*d) + (b*B*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 5, (1/2)*b*(6*a*A*b + 6*a^2*B + b^2*B)*x + (a^2*(3*A*b + a*B)*atanh(sin(c + d*x)))/d - (b*(2*a^2*A - A*b^2 - 3*a*b*B)*sin(c + d*x))/d - (b^2*(2*a*A - b*B)*cos(c + d*x)*sin(c + d*x))/(2*d) + (a*A*(a + b*cos(c + d*x))^2*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 5, b^2*(A*b + 3*a*B)*x + (a*(a^2*A + 6*A*b^2 + 6*a*b*B)*atanh(sin(c + d*x)))/(2*d) - (b^2*(a*A - 2*b*B)*sin(c + d*x))/(2*d) + (a^2*(2*A*b + a*B)*tan(c + d*x))/d + (a*A*(a + b*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 5, b^3*B*x + ((3*a^2*A*b + 2*A*b^3 + a^3*B + 6*a*b^2*B)*atanh(sin(c + d*x)))/(2*d) + (a*(2*a^2*A + 8*A*b^2 + 9*a*b*B)*tan(c + d*x))/(3*d) + (a^2*(5*A*b + 3*a*B)*sec(c + d*x)*tan(c + d*x))/(6*d) + (a*A*(a + b*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 7, ((3*a^3*A + 12*a*A*b^2 + 12*a^2*b*B + 8*b^3*B)*atanh(sin(c + d*x)))/(8*d) + ((6*a^2*A*b + 3*A*b^3 + 2*a^3*B + 9*a*b^2*B)*tan(c + d*x))/(3*d) + (a*(3*a^2*A + 10*A*b^2 + 12*a*b*B)*sec(c + d*x)*tan(c + d*x))/(8*d) + (a^2*(3*A*b + 2*a*B)*sec(c + d*x)^2*tan(c + d*x))/(6*d) + (a*A*(a + b*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [sec(c + d*x)^6*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 8, ((9*a^2*A*b + 4*A*b^3 + 3*a^3*B + 12*a*b^2*B)*atanh(sin(c + d*x)))/(8*d) + ((8*a^3*A + 30*a*A*b^2 + 30*a^2*b*B + 15*b^3*B)*tan(c + d*x))/(15*d) + ((9*a^2*A*b + 4*A*b^3 + 3*a^3*B + 12*a*b^2*B)*sec(c + d*x)*tan(c + d*x))/(8*d) + (a*(4*a^2*A + 12*A*b^2 + 15*a*b*B)*sec(c + d*x)^2*tan(c + d*x))/(15*d) + (a^2*(7*A*b + 5*a*B)*sec(c + d*x)^3*tan(c + d*x))/(20*d) + (a*A*(a + b*cos(c + d*x))^2*sec(c + d*x)^4*tan(c + d*x))/(5*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^4, x, 9, (1/16)*(8*a^4*A + 36*a^2*A*b^2 + 5*A*b^4 + 24*a^3*b*B + 20*a*b^3*B)*x + ((140*a^3*A*b + 112*a*A*b^3 + 35*a^4*B + 168*a^2*b^2*B + 24*b^4*B)*sin(c + d*x))/(35*d) + ((8*a^4*A + 36*a^2*A*b^2 + 5*A*b^4 + 24*a^3*b*B + 20*a*b^3*B)*cos(c + d*x)*sin(c + d*x))/(16*d) + (b*(224*a^2*A*b + 35*A*b^3 + 104*a^3*B + 140*a*b^2*B)*cos(c + d*x)^3*sin(c + d*x))/(168*d) + (b^2*(49*a*A*b + 31*a^2*B + 18*b^2*B)*cos(c + d*x)^4*sin(c + d*x))/(105*d) + (b*(7*A*b + 10*a*B)*cos(c + d*x)^3*(a + b*cos(c + d*x))^2*sin(c + d*x))/(42*d) + (b*B*cos(c + d*x)^3*(a + b*cos(c + d*x))^3*sin(c + d*x))/(7*d) - ((140*a^3*A*b + 112*a*A*b^3 + 35*a^4*B + 168*a^2*b^2*B + 24*b^4*B)*sin(c + d*x)^3)/(105*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^4, x, 6, (1/16)*(32*a^3*A*b + 24*a*A*b^3 + 8*a^4*B + 36*a^2*b^2*B + 5*b^4*B)*x + ((24*a^4*A*b + 224*a^2*A*b^3 + 32*A*b^5 - 4*a^5*B + 121*a^3*b^2*B + 128*a*b^4*B)*sin(c + d*x))/(60*b*d) + ((48*a^3*A*b + 232*a*A*b^3 - 8*a^4*B + 178*a^2*b^2*B + 75*b^4*B)*cos(c + d*x)*sin(c + d*x))/(240*d) + ((24*a^2*A*b + 32*A*b^3 - 4*a^3*B + 53*a*b^2*B)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(120*b*d) + ((24*a*A*b - 4*a^2*B + 25*b^2*B)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(120*b*d) + ((6*A*b - a*B)*(a + b*cos(c + d*x))^4*sin(c + d*x))/(30*b*d) + (B*(a + b*cos(c + d*x))^5*sin(c + d*x))/(6*b*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^4, x, 4, (1/8)*(8*a^4*A + 24*a^2*A*b^2 + 3*A*b^4 + 16*a^3*b*B + 12*a*b^3*B)*x + ((95*a^3*A*b + 80*a*A*b^3 + 12*a^4*B + 112*a^2*b^2*B + 16*b^4*B)*sin(c + d*x))/(30*d) + (b*(130*a^2*A*b + 45*A*b^3 + 24*a^3*B + 116*a*b^2*B)*cos(c + d*x)*sin(c + d*x))/(120*d) + ((35*a*A*b + 12*a^2*B + 16*b^2*B)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(60*d) + ((5*A*b + 4*a*B)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(20*d) + (B*(a + b*cos(c + d*x))^4*sin(c + d*x))/(5*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^4, x, 6, (1/8)*(32*a^3*A*b + 16*a*A*b^3 + 8*a^4*B + 24*a^2*b^2*B + 3*b^4*B)*x + (a^4*A*atanh(sin(c + d*x)))/d + (b*(34*a^2*A*b + 4*A*b^3 + 19*a^3*B + 16*a*b^2*B)*sin(c + d*x))/(6*d) + (b^2*(32*a*A*b + 26*a^2*B + 9*b^2*B)*cos(c + d*x)*sin(c + d*x))/(24*d) + (b*(4*A*b + 7*a*B)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(12*d) + (b*B*(a + b*cos(c + d*x))^3*sin(c + d*x))/(4*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^4, x, 6, (1/2)*b*(12*a^2*A*b + A*b^3 + 8*a^3*B + 4*a*b^2*B)*x + (a^3*(4*A*b + a*B)*atanh(sin(c + d*x)))/d - (b*(6*a^3*A - 12*a*A*b^2 - 17*a^2*b*B - 2*b^3*B)*sin(c + d*x))/(3*d) - (b^2*(6*a^2*A - 3*A*b^2 - 8*a*b*B)*cos(c + d*x)*sin(c + d*x))/(6*d) - (b*(3*a*A - b*B)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*d) + (a*A*(a + b*cos(c + d*x))^3*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^4, x, 6, (1/2)*b^2*(8*a*A*b + 12*a^2*B + b^2*B)*x + (a^2*(a^2*A + 12*A*b^2 + 8*a*b*B)*atanh(sin(c + d*x)))/(2*d) - (b*(13*a^2*A*b - 2*A*b^3 + 4*a^3*B - 8*a*b^2*B)*sin(c + d*x))/(2*d) - (b^2*(6*a*A*b + 2*a^2*B - b^2*B)*cos(c + d*x)*sin(c + d*x))/(2*d) + (a*(5*A*b + 2*a*B)*(a + b*cos(c + d*x))^2*tan(c + d*x))/(2*d) + (a*A*(a + b*cos(c + d*x))^3*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^4, x, 6, b^3*(A*b + 4*a*B)*x + (a*(4*a^2*A*b + 8*A*b^3 + a^3*B + 12*a*b^2*B)*atanh(sin(c + d*x)))/(2*d) - (b^2*(8*a*A*b + 3*a^2*B - 6*b^2*B)*sin(c + d*x))/(6*d) + (a^2*(2*a^2*A + 9*A*b^2 + 9*a*b*B)*tan(c + d*x))/(3*d) + (a*(2*A*b + a*B)*(a + b*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(2*d) + (a*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^4, x, 6, b^4*B*x + ((3*a^4*A + 24*a^2*A*b^2 + 8*A*b^4 + 16*a^3*b*B + 32*a*b^3*B)*atanh(sin(c + d*x)))/(8*d) + (a*(16*a^2*A*b + 19*A*b^3 + 4*a^3*B + 34*a*b^2*B)*tan(c + d*x))/(6*d) + (a^2*(9*a^2*A + 26*A*b^2 + 32*a*b*B)*sec(c + d*x)*tan(c + d*x))/(24*d) + (a*(7*A*b + 4*a*B)*(a + b*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(12*d) + (a*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [sec(c + d*x)^6*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^4, x, 8, ((12*a^3*A*b + 16*a*A*b^3 + 3*a^4*B + 24*a^2*b^2*B + 8*b^4*B)*atanh(sin(c + d*x)))/(8*d) + ((8*a^4*A + 60*a^2*A*b^2 + 15*A*b^4 + 40*a^3*b*B + 60*a*b^3*B)*tan(c + d*x))/(15*d) + (a*(60*a^2*A*b + 56*A*b^3 + 15*a^3*B + 110*a*b^2*B)*sec(c + d*x)*tan(c + d*x))/(40*d) + (a^2*(8*a^2*A + 18*A*b^2 + 25*a*b*B)*sec(c + d*x)^2*tan(c + d*x))/(30*d) + (a*(8*A*b + 5*a*B)*(a + b*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(20*d) + (a*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^4*tan(c + d*x))/(5*d)]
    @test_int [sec(c + d*x)^7*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^4, x, 9, ((5*a^4*A + 36*a^2*A*b^2 + 8*A*b^4 + 24*a^3*b*B + 32*a*b^3*B)*atanh(sin(c + d*x)))/(16*d) + ((32*a^3*A*b + 40*a*A*b^3 + 8*a^4*B + 60*a^2*b^2*B + 15*b^4*B)*tan(c + d*x))/(15*d) + ((5*a^4*A + 36*a^2*A*b^2 + 8*A*b^4 + 24*a^3*b*B + 32*a*b^3*B)*sec(c + d*x)*tan(c + d*x))/(16*d) + (a*(16*a^2*A*b + 13*A*b^3 + 4*a^3*B + 27*a*b^2*B)*sec(c + d*x)^2*tan(c + d*x))/(15*d) + (a^2*(25*a^2*A + 48*A*b^2 + 72*a*b*B)*sec(c + d*x)^3*tan(c + d*x))/(120*d) + (a*(3*A*b + 2*a*B)*(a + b*cos(c + d*x))^2*sec(c + d*x)^4*tan(c + d*x))/(10*d) + (a*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^5*tan(c + d*x))/(6*d)]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 6, ((2*a^2 + b^2)*(A*b - a*B)*x)/(2*b^4) - (2*a^3*(A*b - a*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b^4*sqrt(a + b)*d) - ((3*a*A*b - 3*a^2*B - 2*b^2*B)*sin(c + d*x))/(3*b^3*d) + ((A*b - a*B)*cos(c + d*x)*sin(c + d*x))/(2*b^2*d) + (B*cos(c + d*x)^2*sin(c + d*x))/(3*b*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 5, -(((2*a*A*b - 2*a^2*B - b^2*B)*x)/(2*b^3)) + (2*a^2*(A*b - a*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b^3*sqrt(a + b)*d) + ((A*b - a*B)*sin(c + d*x))/(b^2*d) + (B*cos(c + d*x)*sin(c + d*x))/(2*b*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 6, ((A*b - a*B)*x)/b^2 - (2*a*(A*b - a*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b^2*sqrt(a + b)*d) + (B*sin(c + d*x))/(b*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 3, (B*x)/b + (2*(A*b - a*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b*sqrt(a + b)*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 4, -((2*(A*b - a*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a*sqrt(a - b)*sqrt(a + b)*d)) + (A*atanh(sin(c + d*x)))/(a*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 6, (2*b*(A*b - a*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^2*sqrt(a - b)*sqrt(a + b)*d) - ((A*b - a*B)*atanh(sin(c + d*x)))/(a^2*d) + (A*tan(c + d*x))/(a*d)]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 6, -((2*b^2*(A*b - a*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^3*sqrt(a - b)*sqrt(a + b)*d)) + ((a^2*A + 2*A*b^2 - 2*a*b*B)*atanh(sin(c + d*x)))/(2*a^3*d) - ((A*b - a*B)*tan(c + d*x))/(a^2*d) + (A*sec(c + d*x)*tan(c + d*x))/(2*a*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 7, (2*b^3*(A*b - a*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^4*sqrt(a - b)*sqrt(a + b)*d) - ((a^2 + 2*b^2)*(A*b - a*B)*atanh(sin(c + d*x)))/(2*a^4*d) + ((2*a^2*A + 3*A*b^2 - 3*a*b*B)*tan(c + d*x))/(3*a^3*d) - ((A*b - a*B)*sec(c + d*x)*tan(c + d*x))/(2*a^2*d) + (A*sec(c + d*x)^2*tan(c + d*x))/(3*a*d)]

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 6, -(((4*a*A*b - 6*a^2*B - b^2*B)*x)/(2*b^4)) + (2*a^2*(2*a^2*A*b - 3*A*b^3 - 3*a^3*B + 4*a*b^2*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^4*(a + b)^(3/2)*d) + ((2*a^2*A*b - A*b^3 - 3*a^3*B + 2*a*b^2*B)*sin(c + d*x))/(b^3*(a^2 - b^2)*d) - ((2*a*A*b - 3*a^2*B + b^2*B)*cos(c + d*x)*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d) + (a*(A*b - a*B)*cos(c + d*x)^2*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 5, ((A*b - 2*a*B)*x)/b^3 - (2*a*(a^2*A*b - 2*A*b^3 - 2*a^3*B + 3*a*b^2*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^3*(a + b)^(3/2)*d) + (B*sin(c + d*x))/(b^2*d) - (a^2*(A*b - a*B)*sin(c + d*x))/(b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 5, (B*x)/b^2 - (2*(A*b^3 + a^3*B - 2*a*b^2*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^2*(a + b)^(3/2)*d) + (a*(A*b - a*B)*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 4, (2*(a*A - b*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*(a + b)^(3/2)*d) - ((A*b - a*B)*sin(c + d*x))/((a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 5, -((2*(2*a^2*A*b - A*b^3 - a^3*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^2*(a - b)^(3/2)*(a + b)^(3/2)*d)) + (A*atanh(sin(c + d*x)))/(a^2*d) + (b*(A*b - a*B)*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 6, (2*b*(3*a^2*A*b - 2*A*b^3 - 2*a^3*B + a*b^2*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^3*(a - b)^(3/2)*(a + b)^(3/2)*d) - ((2*A*b - a*B)*atanh(sin(c + d*x)))/(a^3*d) + ((a^2*A - 2*A*b^2 + a*b*B)*tan(c + d*x))/(a^2*(a^2 - b^2)*d) + (b*(A*b - a*B)*tan(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 7, -((2*b^2*(4*a^2*A*b - 3*A*b^3 - 3*a^3*B + 2*a*b^2*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^4*(a - b)^(3/2)*(a + b)^(3/2)*d)) + ((a^2*A + 6*A*b^2 - 4*a*b*B)*atanh(sin(c + d*x)))/(2*a^4*d) - ((2*a^2*A*b - 3*A*b^3 - a^3*B + 2*a*b^2*B)*tan(c + d*x))/(a^3*(a^2 - b^2)*d) + ((a^2*A - 3*A*b^2 + 2*a*b*B)*sec(c + d*x)*tan(c + d*x))/(2*a^2*(a^2 - b^2)*d) + (b*(A*b - a*B)*sec(c + d*x)*tan(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]

    @test_int [cos(c + d*x)^4*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 7, -(((6*a*A*b - 12*a^2*B - b^2*B)*x)/(2*b^5)) + (a^2*(6*a^4*A*b - 15*a^2*A*b^3 + 12*A*b^5 - 12*a^5*B + 29*a^3*b^2*B - 20*a*b^4*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(5/2)*b^5*(a + b)^(5/2)*d) + ((6*a^4*A*b - 11*a^2*A*b^3 + 2*A*b^5 - 12*a^5*B + 21*a^3*b^2*B - 6*a*b^4*B)*sin(c + d*x))/(2*b^4*(a^2 - b^2)^2*d) - ((3*a^3*A*b - 6*a*A*b^3 - 6*a^4*B + 10*a^2*b^2*B - b^4*B)*cos(c + d*x)*sin(c + d*x))/(2*b^3*(a^2 - b^2)^2*d) + (a*(A*b - a*B)*cos(c + d*x)^3*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + (a*(2*a^2*A*b - 5*A*b^3 - 4*a^3*B + 7*a*b^2*B)*cos(c + d*x)^2*sin(c + d*x))/(2*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 6, ((A*b - 3*a*B)*x)/b^4 - (a*(2*a^4*A*b - 5*a^2*A*b^3 + 6*A*b^5 - 6*a^5*B + 15*a^3*b^2*B - 12*a*b^4*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(5/2)*b^4*(a + b)^(5/2)*d) - ((a*A*b - 3*a^2*B + 2*b^2*B)*sin(c + d*x))/(2*b^3*(a^2 - b^2)*d) + (a*(A*b - a*B)*cos(c + d*x)^2*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - (a^2*(a^2*A*b - 4*A*b^3 - 3*a^3*B + 6*a*b^2*B)*sin(c + d*x))/(2*b^3*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 5, (B*x)/b^3 + ((a^2*A*b^3 + 2*A*b^5 - 2*a^5*B + 5*a^3*b^2*B - 6*a*b^4*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(5/2)*b^3*(a + b)^(5/2)*d) - (a^2*(A*b - a*B)*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + (a*(a^2*A*b - 4*A*b^3 - 3*a^3*B + 6*a*b^2*B)*sin(c + d*x))/(2*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 6, -(((3*a*A*b - a^2*B - 2*b^2*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(5/2)*(a + b)^(5/2)*d)) + (a*(A*b - a*B)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + ((a^2*A*b + 2*A*b^3 + a^3*B - 4*a*b^2*B)*sin(c + d*x))/(2*b*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 5, ((2*a^2*A + A*b^2 - 3*a*b*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(5/2)*(a + b)^(5/2)*d) - ((A*b - a*B)*sin(c + d*x))/(2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((3*a*A*b - a^2*B - 2*b^2*B)*sin(c + d*x))/(2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 6, -(((6*a^4*A*b - 5*a^2*A*b^3 + 2*A*b^5 - 2*a^5*B - a^3*b^2*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^3*(a - b)^(5/2)*(a + b)^(5/2)*d)) + (A*atanh(sin(c + d*x)))/(a^3*d) + (b*(A*b - a*B)*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + (b*(5*a^2*A*b - 2*A*b^3 - 3*a^3*B)*sin(c + d*x))/(2*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 7, (b*(12*a^4*A*b - 15*a^2*A*b^3 + 6*A*b^5 - 6*a^5*B + 5*a^3*b^2*B - 2*a*b^4*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^4*(a - b)^(5/2)*(a + b)^(5/2)*d) - ((3*A*b - a*B)*atanh(sin(c + d*x)))/(a^4*d) + ((2*a^4*A - 11*a^2*A*b^2 + 6*A*b^4 + 5*a^3*b*B - 2*a*b^3*B)*tan(c + d*x))/(2*a^3*(a^2 - b^2)^2*d) + (b*(A*b - a*B)*tan(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + (b*(6*a^2*A*b - 3*A*b^3 - 4*a^3*B + a*b^2*B)*tan(c + d*x))/(2*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 8, -((b^2*(20*a^4*A*b - 29*a^2*A*b^3 + 12*A*b^5 - 12*a^5*B + 15*a^3*b^2*B - 6*a*b^4*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^5*(a - b)^(5/2)*(a + b)^(5/2)*d)) + ((a^2*A + 12*A*b^2 - 6*a*b*B)*atanh(sin(c + d*x)))/(2*a^5*d) - ((6*a^4*A*b - 21*a^2*A*b^3 + 12*A*b^5 - 2*a^5*B + 11*a^3*b^2*B - 6*a*b^4*B)*tan(c + d*x))/(2*a^4*(a^2 - b^2)^2*d) + ((a^4*A - 10*a^2*A*b^2 + 6*A*b^4 + 6*a^3*b*B - 3*a*b^3*B)*sec(c + d*x)*tan(c + d*x))/(2*a^3*(a^2 - b^2)^2*d) + (b*(A*b - a*B)*sec(c + d*x)*tan(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + (b*(7*a^2*A*b - 4*A*b^3 - 5*a^3*B + 2*a*b^2*B)*sec(c + d*x)*tan(c + d*x))/(2*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]

    @test_int [cos(c + d*x)^4*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^4, x, 7, ((A*b - 4*a*B)*x)/b^5 - (a*(2*a^6*A*b - 7*a^4*A*b^3 + 8*a^2*A*b^5 - 8*A*b^7 - 8*a^7*B + 28*a^5*b^2*B - 35*a^3*b^4*B + 20*a*b^6*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(7/2)*b^5*(a + b)^(7/2)*d) - ((3*a^3*A*b - 8*a*A*b^3 - 12*a^4*B + 23*a^2*b^2*B - 6*b^4*B)*sin(c + d*x))/(6*b^4*(a^2 - b^2)^2*d) + (a*(A*b - a*B)*cos(c + d*x)^3*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) + (a*(a^2*A*b - 6*A*b^3 - 4*a^3*B + 9*a*b^2*B)*cos(c + d*x)^2*sin(c + d*x))/(6*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) - (a^2*(a^4*A*b - 2*a^2*A*b^3 + 6*A*b^5 - 4*a^5*B + 11*a^3*b^2*B - 12*a*b^4*B)*sin(c + d*x))/(2*b^4*(a^2 - b^2)^3*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^4, x, 6, (B*x)/b^4 - ((3*a^2*A*b^5 + 2*A*b^7 + 2*a^7*B - 7*a^5*b^2*B + 8*a^3*b^4*B - 8*a*b^6*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(7/2)*b^4*(a + b)^(7/2)*d) + (a*(A*b - a*B)*cos(c + d*x)^2*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) + (a^2*(5*A*b^3 + 3*a^3*B - 8*a*b^2*B)*sin(c + d*x))/(6*b^3*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) - (a*(a^2*A*b^3 - 16*A*b^5 + 9*a^5*B - 28*a^3*b^2*B + 34*a*b^4*B)*sin(c + d*x))/(6*b^3*(a^2 - b^2)^3*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^4, x, 6, ((a^3*A + 4*a*A*b^2 - 3*a^2*b*B - 2*b^3*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(7/2)*(a + b)^(7/2)*d) - (a^2*(A*b - a*B)*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) + (a*(a^2*A*b - 6*A*b^3 - 4*a^3*B + 9*a*b^2*B)*sin(c + d*x))/(6*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) + ((a^4*A*b - 10*a^2*A*b^3 - 6*A*b^5 + 2*a^5*B - 5*a^3*b^2*B + 18*a*b^4*B)*sin(c + d*x))/(6*b^2*(a^2 - b^2)^3*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^4, x, 7, -(((4*a^2*A*b + A*b^3 - a^3*B - 4*a*b^2*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(7/2)*(a + b)^(7/2)*d)) + (a*(A*b - a*B)*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) + ((2*a^2*A*b + 3*A*b^3 + a^3*B - 6*a*b^2*B)*sin(c + d*x))/(6*b*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) + ((2*a^3*A*b + 13*a*A*b^3 + a^4*B - 10*a^2*b^2*B - 6*b^4*B)*sin(c + d*x))/(6*b*(a^2 - b^2)^3*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^4, x, 6, ((2*a^3*A + 3*a*A*b^2 - 4*a^2*b*B - b^3*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(7/2)*(a + b)^(7/2)*d) - ((A*b - a*B)*sin(c + d*x))/(3*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) - ((5*a*A*b - 2*a^2*B - 3*b^2*B)*sin(c + d*x))/(6*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) - ((11*a^2*A*b + 4*A*b^3 - 2*a^3*B - 13*a*b^2*B)*sin(c + d*x))/(6*(a^2 - b^2)^3*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^4, x, 7, -(((8*a^6*A*b - 8*a^4*A*b^3 + 7*a^2*A*b^5 - 2*A*b^7 - 2*a^7*B - 3*a^5*b^2*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^4*(a - b)^(7/2)*(a + b)^(7/2)*d)) + (A*atanh(sin(c + d*x)))/(a^4*d) + (b*(A*b - a*B)*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) + (b*(8*a^2*A*b - 3*A*b^3 - 5*a^3*B)*sin(c + d*x))/(6*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) + (b*(26*a^4*A*b - 17*a^2*A*b^3 + 6*A*b^5 - 11*a^5*B - 4*a^3*b^2*B)*sin(c + d*x))/(6*a^3*(a^2 - b^2)^3*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^4, x, 8, (b*(20*a^6*A*b - 35*a^4*A*b^3 + 28*a^2*A*b^5 - 8*A*b^7 - 8*a^7*B + 8*a^5*b^2*B - 7*a^3*b^4*B + 2*a*b^6*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^5*(a - b)^(7/2)*(a + b)^(7/2)*d) - ((4*A*b - a*B)*atanh(sin(c + d*x)))/(a^5*d) + ((6*a^6*A - 65*a^4*A*b^2 + 68*a^2*A*b^4 - 24*A*b^6 + 26*a^5*b*B - 17*a^3*b^3*B + 6*a*b^5*B)*tan(c + d*x))/(6*a^4*(a^2 - b^2)^3*d) + (b*(A*b - a*B)*tan(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) + (b*(9*a^2*A*b - 4*A*b^3 - 6*a^3*B + a*b^2*B)*tan(c + d*x))/(6*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) + (b*(12*a^4*A*b - 11*a^2*A*b^3 + 4*A*b^5 - 6*a^5*B + 2*a^3*b^2*B - a*b^4*B)*tan(c + d*x))/(2*a^3*(a^2 - b^2)^3*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^4, x, 9, -((b^2*(40*a^6*A*b - 84*a^4*A*b^3 + 69*a^2*A*b^5 - 20*A*b^7 - 20*a^7*B + 35*a^5*b^2*B - 28*a^3*b^4*B + 8*a*b^6*B)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^6*(a - b)^(7/2)*(a + b)^(7/2)*d)) + ((a^2*A + 20*A*b^2 - 8*a*b*B)*atanh(sin(c + d*x)))/(2*a^6*d) - ((24*a^6*A*b - 146*a^4*A*b^3 + 167*a^2*A*b^5 - 60*A*b^7 - 6*a^7*B + 65*a^5*b^2*B - 68*a^3*b^4*B + 24*a*b^6*B)*tan(c + d*x))/(6*a^5*(a^2 - b^2)^3*d) + ((a^6*A - 23*a^4*A*b^2 + 27*a^2*A*b^4 - 10*A*b^6 + 12*a^5*b*B - 11*a^3*b^3*B + 4*a*b^5*B)*sec(c + d*x)*tan(c + d*x))/(2*a^4*(a^2 - b^2)^3*d) + (b*(A*b - a*B)*sec(c + d*x)*tan(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) + (b*(10*a^2*A*b - 5*A*b^3 - 7*a^3*B + 2*a*b^2*B)*sec(c + d*x)*tan(c + d*x))/(6*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) + (b*(48*a^4*A*b - 53*a^2*A*b^3 + 20*A*b^5 - 27*a^5*B + 20*a^3*b^2*B - 8*a*b^4*B)*sec(c + d*x)*tan(c + d*x))/(6*a^3*(a^2 - b^2)^3*d*(a + b*cos(c + d*x)))]

    @test_int [cos(c + d*x)^3*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 3, (B*sin(c + d*x))/d - (B*sin(c + d*x)^3)/(3*d)]
    @test_int [cos(c + d*x)^2*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 3, (B*x)/2 + (B*cos(c + d*x)*sin(c + d*x))/(2*d)]
    @test_int [cos(c + d*x)^1*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 2, (B*sin(c + d*x))/d]
    @test_int [cos(c + d*x)^0*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 2, B*x]
    @test_int [sec(c + d*x)^1*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 2, (B*atanh(sin(c + d*x)))/d]
    @test_int [sec(c + d*x)^2*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 3, (B*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 3, (B*atanh(sin(c + d*x)))/(2*d) + (B*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 3, (B*tan(c + d*x))/d + (B*tan(c + d*x)^3)/(3*d)]

    @test_int [cos(c + d*x)^3*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 6, ((2*a^2 + b^2)*B*x)/(2*b^3) - (2*a^3*B*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b^3*sqrt(a + b)*d) - (a*B*sin(c + d*x))/(b^2*d) + (B*cos(c + d*x)*sin(c + d*x))/(2*b*d)]
    @test_int [cos(c + d*x)^2*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 6, -((a*B*x)/b^2) + (2*a^2*B*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b^2*sqrt(a + b)*d) + (B*sin(c + d*x))/(b*d)]
    @test_int [cos(c + d*x)^1*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 4, (B*x)/b - (2*a*B*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b*sqrt(a + b)*d)]
    @test_int [cos(c + d*x)^0*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 3, (2*B*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*sqrt(a + b)*d)]
    @test_int [sec(c + d*x)^1*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 5, -((2*b*B*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a*sqrt(a - b)*sqrt(a + b)*d)) + (B*atanh(sin(c + d*x)))/(a*d)]
    @test_int [sec(c + d*x)^2*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 7, (2*b^2*B*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^2*sqrt(a - b)*sqrt(a + b)*d) - (b*B*atanh(sin(c + d*x)))/(a^2*d) + (B*tan(c + d*x))/(a*d)]
    @test_int [sec(c + d*x)^3*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 7, -((2*b^3*B*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^3*sqrt(a - b)*sqrt(a + b)*d)) + ((a^2 + 2*b^2)*B*atanh(sin(c + d*x)))/(2*a^3*d) - (b*B*tan(c + d*x))/(a^2*d) + (B*sec(c + d*x)*tan(c + d*x))/(2*a*d)]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*cos(e+f*x)^m*(a+b*cos(e+f*x))^(n/2)*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 9, (2*(24*a^3*A*b + 57*a*A*b^3 - 16*a^4*B - 24*a^2*b^2*B + 147*b^4*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(315*b^4*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2 - b^2)*(24*a^2*A*b + 75*A*b^3 - 16*a^3*B - 36*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(315*b^4*d*sqrt(a + b*cos(c + d*x))) + (2*(24*a^2*A*b + 75*A*b^3 - 16*a^3*B - 36*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*b^3*d) - (2*(36*a*A*b - 24*a^2*B - 49*b^2*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(315*b^3*d) + (2*(3*A*b - 2*a*B)*cos(c + d*x)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(21*b^2*d) + (2*B*cos(c + d*x)^2*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(9*b*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 8, -((2*(14*a^2*A*b - 63*A*b^3 - 8*a^3*B - 19*a*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(105*b^3*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(a^2 - b^2)*(14*a*A*b - 8*a^2*B - 25*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(105*b^3*d*sqrt(a + b*cos(c + d*x))) - (2*(14*a*A*b - 8*a^2*B - 25*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*b^2*d) + (2*(7*A*b - 4*a*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*b^2*d) + (2*B*cos(c + d*x)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*b*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 8, (2*(5*a*A*b - 2*a^2*B + 9*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2 - b^2)*(5*A*b - 2*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^2*d*sqrt(a + b*cos(c + d*x))) + (2*(5*A*b - 2*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b*d) + (2*B*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*b*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 6, (2*(3*A*b + a*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2 - b^2)*B*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b*d*sqrt(a + b*cos(c + d*x))) + (2*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 8, (2*B*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt((a + b*cos(c + d*x))/(a + b))) + (2*A*b*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x))) + (2*a*A*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 9, -((A*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((a*A + 2*b*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x))) + ((A*b + 2*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x))) + (A*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 10, -(((A*b + 4*a*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(4*a*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((3*A*b + 4*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(4*d*sqrt(a + b*cos(c + d*x))) + ((4*a^2*A - A*b^2 + 4*a*b*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(4*a*d*sqrt(a + b*cos(c + d*x))) + ((A*b + 4*a*B)*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(4*a*d) + (A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 11, -(((16*a^2*A - 3*A*b^2 + 6*a*b*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(24*a^2*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((16*a^2*A - A*b^2 + 18*a*b*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(24*a*d*sqrt(a + b*cos(c + d*x))) + ((4*a^2*A*b + A*b^3 + 8*a^3*B - 2*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(8*a^2*d*sqrt(a + b*cos(c + d*x))) + ((16*a^2*A - 3*A*b^2 + 6*a*b*B)*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(24*a^2*d) + ((A*b + 6*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(12*a*d) + (A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(3*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 9, -((2*(18*a^3*A*b - 246*a*A*b^3 - 8*a^4*B - 33*a^2*b^2*B - 147*b^4*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(315*b^3*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(a^2 - b^2)*(18*a^2*A*b - 75*A*b^3 - 8*a^3*B - 39*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(315*b^3*d*sqrt(a + b*cos(c + d*x))) - (2*(18*a^2*A*b - 75*A*b^3 - 8*a^3*B - 39*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*b^2*d) - (2*(18*a*A*b - 8*a^2*B - 49*b^2*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(315*b^2*d) + (2*(9*A*b - 4*a*B)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(63*b^2*d) + (2*B*cos(c + d*x)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(9*b*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 9, (2*(21*a^2*A*b + 63*A*b^3 - 6*a^3*B + 82*a*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(105*b^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2 - b^2)*(21*a*A*b - 6*a^2*B + 25*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(105*b^2*d*sqrt(a + b*cos(c + d*x))) + (2*(21*a*A*b - 6*a^2*B + 25*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*b*d) + (2*(7*A*b - 2*a*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*b*d) + (2*B*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*b*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 7, (2*(20*a*A*b + 3*a^2*B + 9*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2 - b^2)*(5*A*b + 3*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b*d*sqrt(a + b*cos(c + d*x))) + (2*(5*A*b + 3*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*d) + (2*B*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 9, (2*(3*A*b + 4*a*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (2*(3*a*A*b - a^2*B + b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*d*sqrt(a + b*cos(c + d*x))) + (2*a^2*A*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x))) + (2*b*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 9, -(((a*A - 2*b*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((a^2*A + 2*A*b^2 + 2*a*b*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x))) + (a*(3*A*b + 2*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x))) + (a*A*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 10, -(((5*A*b + 4*a*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(4*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((7*a*A*b + 4*a^2*B + 8*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(4*d*sqrt(a + b*cos(c + d*x))) + ((4*a^2*A + 3*A*b^2 + 12*a*b*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(4*d*sqrt(a + b*cos(c + d*x))) + ((5*A*b + 4*a*B)*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(4*d) + (a*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 11, -(((16*a^2*A + 3*A*b^2 + 30*a*b*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(24*a*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((16*a^2*A + 17*A*b^2 + 42*a*b*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(24*d*sqrt(a + b*cos(c + d*x))) + ((12*a^2*A*b - A*b^3 + 8*a^3*B + 6*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(8*a*d*sqrt(a + b*cos(c + d*x))) + ((16*a^2*A + 3*A*b^2 + 30*a*b*B)*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(24*a*d) + ((7*A*b + 6*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(12*d) + (a*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(3*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 10, -((2*(110*a^4*A*b - 3069*a^2*A*b^3 - 1617*A*b^5 - 40*a^5*B - 255*a^3*b^2*B - 3705*a*b^4*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3465*b^3*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(a^2 - b^2)*(110*a^3*A*b - 1254*a*A*b^3 - 40*a^4*B - 285*a^2*b^2*B - 675*b^4*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3465*b^3*d*sqrt(a + b*cos(c + d*x))) - (2*(110*a^3*A*b - 1254*a*A*b^3 - 40*a^4*B - 285*a^2*b^2*B - 675*b^4*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3465*b^2*d) - (2*(110*a^2*A*b - 539*A*b^3 - 40*a^3*B - 335*a*b^2*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3465*b^2*d) - (2*(22*a*A*b - 8*a^2*B - 81*b^2*B)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(693*b^2*d) + (2*(11*A*b - 4*a*B)*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(99*b^2*d) + (2*B*cos(c + d*x)*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(11*b*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 10, (2*(45*a^3*A*b + 435*a*A*b^3 - 10*a^4*B + 279*a^2*b^2*B + 147*b^4*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(315*b^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2 - b^2)*(45*a^2*A*b + 75*A*b^3 - 10*a^3*B + 114*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(315*b^2*d*sqrt(a + b*cos(c + d*x))) + (2*(45*a^2*A*b + 75*A*b^3 - 10*a^3*B + 114*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*b*d) + (2*(45*a*A*b - 10*a^2*B + 49*b^2*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(315*b*d) + (2*(9*A*b - 2*a*B)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(63*b*d) + (2*B*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(9*b*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 8, (2*(161*a^2*A*b + 63*A*b^3 + 15*a^3*B + 145*a*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(105*b*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2 - b^2)*(56*a*A*b + 15*a^2*B + 25*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(105*b*d*sqrt(a + b*cos(c + d*x))) + (2*(56*a*A*b + 15*a^2*B + 25*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*d) + (2*(7*A*b + 5*a*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*d) + (2*B*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 10, (2*(35*a*A*b + 23*a^2*B + 9*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(15*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (2*(10*a^2*A*b + 5*A*b^3 - 8*a^3*B + 8*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(15*d*sqrt(a + b*cos(c + d*x))) + (2*a^3*A*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x))) + (2*b*(5*A*b + 8*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*d) + (2*b*B*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 10, -(((3*a^2*A - 6*A*b^2 - 14*a*b*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((3*a^3*A + 12*a*A*b^2 + 4*a^2*b*B + 2*b^3*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*d*sqrt(a + b*cos(c + d*x))) + (a^2*(5*A*b + 2*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x))) - (b*(3*a*A - 2*b*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d) + (a*A*(a + b*cos(c + d*x))^(3/2)*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 10, -(((9*a*A*b + 4*a^2*B - 8*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(4*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((11*a^2*A*b + 8*A*b^3 + 4*a^3*B + 16*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(4*d*sqrt(a + b*cos(c + d*x))) + (a*(4*a^2*A + 15*A*b^2 + 20*a*b*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(4*d*sqrt(a + b*cos(c + d*x))) + (a*(7*A*b + 4*a*B)*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(4*d) + (a*A*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 11, -(((16*a^2*A + 33*A*b^2 + 54*a*b*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(24*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((16*a^3*A + 59*a*A*b^2 + 66*a^2*b*B + 48*b^3*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(24*d*sqrt(a + b*cos(c + d*x))) + ((20*a^2*A*b + 5*A*b^3 + 8*a^3*B + 30*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(8*d*sqrt(a + b*cos(c + d*x))) + ((16*a^2*A + 33*A*b^2 + 54*a*b*B)*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(24*d) + (a*(3*A*b + 2*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(4*d) + (a*A*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 12, -(((284*a^2*A*b + 15*A*b^3 + 128*a^3*B + 264*a*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(192*a*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((356*a^2*A*b + 133*A*b^3 + 128*a^3*B + 472*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(192*d*sqrt(a + b*cos(c + d*x))) + ((48*a^4*A + 120*a^2*A*b^2 - 5*A*b^4 + 160*a^3*b*B + 40*a*b^3*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(64*a*d*sqrt(a + b*cos(c + d*x))) + ((284*a^2*A*b + 15*A*b^3 + 128*a^3*B + 264*a*b^2*B)*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(192*a*d) + ((36*a^2*A + 59*A*b^2 + 104*a*b*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(96*d) + (a*(11*A*b + 8*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(24*d) + (a*A*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^3*tan(c + d*x))/(4*d)]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 8, (2*(56*a^2*A*b + 63*A*b^3 - 48*a^3*B - 44*a*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(105*b^4*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(56*a^3*A*b + 49*a*A*b^3 - 48*a^4*B - 32*a^2*b^2*B - 25*b^4*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(105*b^4*d*sqrt(a + b*cos(c + d*x))) - (2*(28*a*A*b - 24*a^2*B - 25*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*b^3*d) + (2*(7*A*b - 6*a*B)*cos(c + d*x)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*b^2*d) + (2*B*cos(c + d*x)^2*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(7*b*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 7, -((2*(10*a*A*b - 8*a^2*B - 9*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^3*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(10*a^2*A*b + 5*A*b^3 - 8*a^3*B - 7*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^3*d*sqrt(a + b*cos(c + d*x))) + (2*(5*A*b - 4*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b^2*d) + (2*B*cos(c + d*x)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*b*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 7, (2*(3*A*b - 2*a*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(3*a*A*b - 2*a^2*B - b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b^2*d*sqrt(a + b*cos(c + d*x))) + (2*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 5, (2*B*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(b*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (2*(A*b - a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(b*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 5, (2*B*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x))) + (2*A*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 9, -((A*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(a*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (A*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x))) - ((A*b - 2*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(a*d*sqrt(a + b*cos(c + d*x))) + (A*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(a*d)]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 10, ((3*A*b - 4*a*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(4*a^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - ((A*b - 4*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(4*a*d*sqrt(a + b*cos(c + d*x))) + ((4*a^2*A + 3*A*b^2 - 4*a*b*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(4*a^2*d*sqrt(a + b*cos(c + d*x))) - ((3*A*b - 4*a*B)*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(4*a^2*d) + (A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(2*a*d)]

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 8, -((2*(40*a^3*A*b - 25*a*A*b^3 - 48*a^4*B + 24*a^2*b^2*B + 9*b^4*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^4*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(40*a^2*A*b + 5*A*b^3 - 48*a^3*B - 12*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^4*d*sqrt(a + b*cos(c + d*x))) + (2*a*(A*b - a*B)*cos(c + d*x)^2*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (2*(20*a^2*A*b - 5*A*b^3 - 24*a^3*B + 9*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b^3*(a^2 - b^2)*d) - (2*(5*a*A*b - 6*a^2*B + b^2*B)*cos(c + d*x)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*b^2*(a^2 - b^2)*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 7, (2*(6*a^2*A*b - 3*A*b^3 - 8*a^3*B + 5*a*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b^3*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(6*a*A*b - 8*a^2*B - b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b^3*d*sqrt(a + b*cos(c + d*x))) - (2*a^2*(A*b - a*B)*sin(c + d*x))/(b^2*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (2*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b^2*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 7, -((2*(a*A*b - 2*a^2*B + b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(b^2*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(A*b - 2*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(b^2*d*sqrt(a + b*cos(c + d*x))) + (2*a*(A*b - a*B)*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 6, (2*(A*b - a*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(b*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (2*B*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(b*d*sqrt(a + b*cos(c + d*x))) - (2*(A*b - a*B)*sin(c + d*x))/((a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 7, -((2*(A*b - a*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(a*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*A*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(a*d*sqrt(a + b*cos(c + d*x))) + (2*b*(A*b - a*B)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 10, -(((a^2*A - 3*A*b^2 + 2*a*b*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(a^2*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (A*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(a*d*sqrt(a + b*cos(c + d*x))) - ((3*A*b - 2*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(a^2*d*sqrt(a + b*cos(c + d*x))) + (b*(a^2*A - 3*A*b^2 + 2*a*b*B)*sin(c + d*x))/(a^2*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (A*tan(c + d*x))/(a*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 11, ((7*a^2*A*b - 15*A*b^3 - 4*a^3*B + 12*a*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(4*a^3*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b))) - ((5*A*b - 4*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(4*a^2*d*sqrt(a + b*cos(c + d*x))) + ((4*a^2*A + 15*A*b^2 - 12*a*b*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(4*a^3*d*sqrt(a + b*cos(c + d*x))) - (b*(7*a^2*A*b - 15*A*b^3 - 4*a^3*B + 12*a*b^2*B)*sin(c + d*x))/(4*a^3*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - ((5*A*b - 4*a*B)*tan(c + d*x))/(4*a^2*d*sqrt(a + b*cos(c + d*x))) + (A*sec(c + d*x)*tan(c + d*x))/(2*a*d*sqrt(a + b*cos(c + d*x)))]

    @test_int [cos(c + d*x)^4*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 9, -((2*(80*a^5*A*b - 140*a^3*A*b^3 + 40*a*A*b^5 - 128*a^6*B + 212*a^4*b^2*B - 55*a^2*b^4*B - 9*b^6*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^5*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(80*a^4*A*b - 80*a^2*A*b^3 - 5*A*b^5 - 128*a^5*B + 116*a^3*b^2*B + 17*a*b^4*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^5*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (2*a*(A*b - a*B)*cos(c + d*x)^3*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*a*(5*a^2*A*b - 9*A*b^3 - 8*a^3*B + 12*a*b^2*B)*cos(c + d*x)^2*sin(c + d*x))/(3*b^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) + (2*(40*a^4*A*b - 65*a^2*A*b^3 + 5*A*b^5 - 64*a^5*B + 98*a^3*b^2*B - 14*a*b^4*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b^4*(a^2 - b^2)^2*d) - (2*(30*a^3*A*b - 50*a*A*b^3 - 48*a^4*B + 71*a^2*b^2*B - 3*b^4*B)*cos(c + d*x)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b^3*(a^2 - b^2)^2*d)]
    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 8, (2*(8*a^4*A*b - 15*a^2*A*b^3 + 3*A*b^5 - 16*a^5*B + 28*a^3*b^2*B - 8*a*b^4*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b^4*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(8*a^3*A*b - 9*a*A*b^3 - 16*a^4*B + 16*a^2*b^2*B + b^4*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b^4*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (2*a*(A*b - a*B)*cos(c + d*x)^2*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (2*a^2*(3*a^2*A*b - 7*A*b^3 - 6*a^3*B + 10*a*b^2*B)*sin(c + d*x))/(3*b^3*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) - (2*(a*A*b - 2*a^2*B + b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b^3*(a^2 - b^2)*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 7, -((2*(2*a^3*A*b - 6*a*A*b^3 - 8*a^4*B + 15*a^2*b^2*B - 3*b^4*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b^3*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(2*a^2*A*b - 3*A*b^3 - 8*a^3*B + 9*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b^3*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (2*a^2*(A*b - a*B)*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*a*(2*a^2*A*b - 6*A*b^3 - 5*a^3*B + 9*a*b^2*B)*sin(c + d*x))/(3*b^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 8, -((2*(a^2*A*b + 3*A*b^3 + 2*a^3*B - 6*a*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b^2*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(a*A*b + 2*a^2*B - 3*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b^2*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (2*a*(A*b - a*B)*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*(a^2*A*b + 3*A*b^3 + 2*a^3*B - 6*a*b^2*B)*sin(c + d*x))/(3*b*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 7, (2*(4*a*A*b - a^2*B - 3*b^2*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(A*b - a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (2*(A*b - a*B)*sin(c + d*x))/(3*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (2*(4*a*A*b - a^2*B - 3*b^2*B)*sin(c + d*x))/(3*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 10, -((2*(7*a^2*A*b - 3*A*b^3 - 4*a^3*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*a^2*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(A*b - a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*a*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (2*A*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(a^2*d*sqrt(a + b*cos(c + d*x))) + (2*b*(A*b - a*B)*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*b*(7*a^2*A*b - 3*A*b^3 - 4*a^3*B)*sin(c + d*x))/(3*a^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 11, -(((3*a^4*A - 26*a^2*A*b^2 + 15*A*b^4 + 14*a^3*b*B - 6*a*b^3*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*a^3*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((3*a^2*A - 5*A*b^2 + 2*a*b*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*a^2*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - ((5*A*b - 2*a*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(a^3*d*sqrt(a + b*cos(c + d*x))) + (b*(3*a^2*A - 5*A*b^2 + 2*a*b*B)*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (b*(3*a^4*A - 26*a^2*A*b^2 + 15*A*b^4 + 14*a^3*b*B - 6*a*b^3*B)*sin(c + d*x))/(3*a^3*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) + (A*tan(c + d*x))/(a*d*(a + b*cos(c + d*x))^(3/2))]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 12, ((33*a^4*A*b - 170*a^2*A*b^3 + 105*A*b^5 - 12*a^5*B + 104*a^3*b^2*B - 60*a*b^4*B)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(12*a^4*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - ((27*a^2*A*b - 35*A*b^3 - 12*a^3*B + 20*a*b^2*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(12*a^3*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + ((4*a^2*A + 35*A*b^2 - 20*a*b*B)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(4*a^4*d*sqrt(a + b*cos(c + d*x))) - (b*(27*a^2*A*b - 35*A*b^3 - 12*a^3*B + 20*a*b^2*B)*sin(c + d*x))/(12*a^3*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (b*(33*a^4*A*b - 170*a^2*A*b^3 + 105*A*b^5 - 12*a^5*B + 104*a^3*b^2*B - 60*a*b^4*B)*sin(c + d*x))/(12*a^4*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) - ((7*A*b - 4*a*B)*tan(c + d*x))/(4*a^2*d*(a + b*cos(c + d*x))^(3/2)) + (A*sec(c + d*x)*tan(c + d*x))/(2*a*d*(a + b*cos(c + d*x))^(3/2))]

    @test_int [cos(c + d*x)^0*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 3, (2*B*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 3, (2*B*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(d*sqrt(a + b*cos(c + d*x)))]

    @test_int [cos(c + d*x)^0*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 5, (2*B*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/((a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*b*B*sin(c + d*x))/((a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 8, -((2*b*B*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(a*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*B*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(a*d*sqrt(a + b*cos(c + d*x))) + (2*b^2*B*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(c*cos(e+f*x))^(m/2)*(a+b*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [cos(c + d*x)^(5/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 8, (2*(9*a*A + 7*b*B)*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (10*(A*b + a*B)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (10*(A*b + a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*(9*a*A + 7*b*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*(A*b + a*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d) + (2*b*B*cos(c + d*x)^(7/2)*sin(c + d*x))/(9*d)]
    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 7, (6*(A*b + a*B)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*(7*a*A + 5*b*B)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*(7*a*A + 5*b*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*(A*b + a*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*b*B*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 6, (2*(5*a*A + 3*b*B)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*(A*b + a*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*(A*b + a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*b*B*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 5, (2*(A*b + a*B)*Elliptic.E((1/2)*(c + d*x), 2))/d + (2*(3*a*A + b*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*b*B*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 5, -((2*(a*A - b*B)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*(A*b + a*B)*Elliptic.F((1/2)*(c + d*x), 2))/d + (2*a*A*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 6, -((2*(A*b + a*B)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*(a*A + 3*b*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a*A*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*(A*b + a*B)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-7/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x)), x, 7, -((2*(3*a*A + 5*b*B)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*(A*b + a*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a*A*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*(A*b + a*B)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*(3*a*A + 5*b*B)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x)))]

    @test_int [cos(c + d*x)^(5/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 8, (2*(9*a^2*A + 7*A*b^2 + 14*a*b*B)*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (10*(9*b^2*B + 11*a*(2*A*b + a*B))*Elliptic.F((1/2)*(c + d*x), 2))/(231*d) + (10*(9*b^2*B + 11*a*(2*A*b + a*B))*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (2*(9*a^2*A + 7*A*b^2 + 14*a*b*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*(9*b^2*B + 11*a*(2*A*b + a*B))*cos(c + d*x)^(5/2)*sin(c + d*x))/(77*d) + (2*b*(11*A*b + 13*a*B)*cos(c + d*x)^(7/2)*sin(c + d*x))/(99*d) + (2*b*B*cos(c + d*x)^(7/2)*(a + b*cos(c + d*x))*sin(c + d*x))/(11*d)]
    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 7, (2*(7*b^2*B + 9*a*(2*A*b + a*B))*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (2*(7*a^2*A + 5*A*b^2 + 10*a*b*B)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*(7*a^2*A + 5*A*b^2 + 10*a*b*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*(7*b^2*B + 9*a*(2*A*b + a*B))*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*b*(9*A*b + 11*a*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(63*d) + (2*b*B*cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))*sin(c + d*x))/(9*d)]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 6, (2*(5*a^2*A + 3*A*b^2 + 6*a*b*B)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*(5*b^2*B + 7*a*(2*A*b + a*B))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*(5*b^2*B + 7*a*(2*A*b + a*B))*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*b*(7*A*b + 9*a*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(35*d) + (2*b*B*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))*sin(c + d*x))/(7*d)]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 5, (2*(3*b^2*B + 5*a*(2*A*b + a*B))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*(3*a^2*A + A*b^2 + 2*a*b*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*b*(5*A*b + 7*a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) + (2*b*B*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))*sin(c + d*x))/(5*d)]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 5, -((2*(a^2*A - A*b^2 - 2*a*b*B)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*(6*a*A*b + 3*a^2*B + b^2*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a^2*A*sin(c + d*x))/(d*sqrt(cos(c + d*x))) + (2*b^2*B*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 5, -((2*(2*a*A*b + a^2*B - b^2*B)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*(a^2*A + 3*A*b^2 + 6*a*b*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a^2*A*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*a*(2*A*b + a*B)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-7/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^2, x, 6, -((2*(3*a^2*A + 5*A*b^2 + 10*a*b*B)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*(2*a*A*b + a^2*B + 3*b^2*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a^2*A*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*a*(2*A*b + a*B)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*(3*a^2*A + 5*A*b^2 + 10*a*b*B)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x)))]

    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 8, (2*(27*a^2*A*b + 7*A*b^3 + 9*a^3*B + 21*a*b^2*B)*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (2*(77*a^3*A + 165*a*A*b^2 + 165*a^2*b*B + 45*b^3*B)*Elliptic.F((1/2)*(c + d*x), 2))/(231*d) + (2*(77*a^3*A + 165*a*A*b^2 + 165*a^2*b*B + 45*b^3*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (2*(27*a^2*A*b + 7*A*b^3 + 9*a^3*B + 21*a*b^2*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*b*(33*a*A*b + 26*a^2*B + 9*b^2*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(77*d) + (2*b^2*(11*A*b + 15*a*B)*cos(c + d*x)^(7/2)*sin(c + d*x))/(99*d) + (2*b*B*cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(11*d)]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 7, (2*(15*a^3*A + 27*a*A*b^2 + 27*a^2*b*B + 7*b^3*B)*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (2*(21*a^2*A*b + 5*A*b^3 + 7*a^3*B + 15*a*b^2*B)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*(21*a^2*A*b + 5*A*b^3 + 7*a^3*B + 15*a*b^2*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*b*(27*a*A*b + 22*a^2*B + 7*b^2*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*b^2*(9*A*b + 13*a*B)*cos(c + d*x)^(5/2)*sin(c + d*x))/(63*d) + (2*b*B*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(9*d)]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 6, (2*(15*a^2*A*b + 3*A*b^3 + 5*a^3*B + 9*a*b^2*B)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*(21*a^3*A + 21*a*A*b^2 + 21*a^2*b*B + 5*b^3*B)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*b*(21*a*A*b + 18*a^2*B + 5*b^2*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*b^2*(7*A*b + 11*a*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(35*d) + (2*b*B*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d)]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 6, -((2*(5*a^3*A - 15*a*A*b^2 - 15*a^2*b*B - 3*b^3*B)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*(9*a^2*A*b + A*b^3 + 3*a^3*B + 3*a*b^2*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) - (2*b*(6*a^2*A - A*b^2 - 3*a*b*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) - (2*b^2*(5*a*A - b*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*a*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 6, -((2*(3*a^2*A*b - A*b^3 + a^3*B - 3*a*b^2*B)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*(a^3*A + 9*a*A*b^2 + 9*a^2*b*B + b^3*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a^2*(7*A*b + 3*a*B)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) - (2*b^2*(a*A - b*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*a*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [cos(c + d*x)^(-7/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^3, x, 6, -((2*(3*a^3*A + 15*a*A*b^2 + 15*a^2*b*B - 5*b^3*B)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*(3*a^2*A*b + 3*A*b^3 + a^3*B + 9*a*b^2*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a^2*(9*A*b + 5*a*B)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)) + (2*a*(3*a^2*A + 14*A*b^2 + 15*a*b*B)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*a*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [cos(c + d*x)^(5/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 7, -((2*(5*a*A*b - 5*a^2*B - 3*b^2*B)*Elliptic.E((1/2)*(c + d*x), 2))/(5*b^3*d)) + (2*(3*a^2 + b^2)*(A*b - a*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^4*d) - (2*a^3*(A*b - a*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^4*(a + b)*d) + (2*(A*b - a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b^2*d) + (2*B*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*b*d)]
    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 6, (2*(A*b - a*B)*Elliptic.E((1/2)*(c + d*x), 2))/(b^2*d) - (2*(3*a*A*b - 3*a^2*B - b^2*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^3*d) + (2*a^2*(A*b - a*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^3*(a + b)*d) + (2*B*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b*d)]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 5, (2*B*Elliptic.E((1/2)*(c + d*x), 2))/(b*d) + (2*(A*b - a*B)*Elliptic.F((1/2)*(c + d*x), 2))/(b^2*d) - (2*a*(A*b - a*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^2*(a + b)*d)]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 3, (2*B*Elliptic.F((1/2)*(c + d*x), 2))/(b*d) + (2*(A*b - a*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b*(a + b)*d)]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 5, -((2*A*Elliptic.E((1/2)*(c + d*x), 2))/(a*d)) - (2*(A*b - a*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a*(a + b)*d) + (2*A*sin(c + d*x))/(a*d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 7, (2*(A*b - a*B)*Elliptic.E((1/2)*(c + d*x), 2))/(a^2*d) + (2*A*Elliptic.F((1/2)*(c + d*x), 2))/(3*a*d) + (2*b*(A*b - a*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^2*(a + b)*d) + (2*A*sin(c + d*x))/(3*a*d*cos(c + d*x)^(3/2)) - (2*(A*b - a*B)*sin(c + d*x))/(a^2*d*sqrt(cos(c + d*x)))]

    @test_int [cos(c + d*x)^(5/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 7, ((3*a^2*A*b - 2*A*b^3 - 5*a^3*B + 4*a*b^2*B)*Elliptic.E((1/2)*(c + d*x), 2))/(b^3*(a^2 - b^2)*d) - ((9*a^3*A*b - 12*a*A*b^3 - 15*a^4*B + 16*a^2*b^2*B + 2*b^4*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^4*(a^2 - b^2)*d) + (a^2*(3*a^2*A*b - 5*A*b^3 - 5*a^3*B + 7*a*b^2*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/((a - b)*b^4*(a + b)^2*d) - ((3*a*A*b - 5*a^2*B + 2*b^2*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d) + (a*(A*b - a*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 6, -(((a*A*b - 3*a^2*B + 2*b^2*B)*Elliptic.E((1/2)*(c + d*x), 2))/(b^2*(a^2 - b^2)*d)) + ((a^2*A*b - 2*A*b^3 - 3*a^3*B + 4*a*b^2*B)*Elliptic.F((1/2)*(c + d*x), 2))/(b^3*(a^2 - b^2)*d) - (a*(a^2*A*b - 3*A*b^3 - 3*a^3*B + 5*a*b^2*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/((a - b)*b^3*(a + b)^2*d) + (a*(A*b - a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 6, ((A*b - a*B)*Elliptic.E((1/2)*(c + d*x), 2))/(b*(a^2 - b^2)*d) + ((a*A*b + a^2*B - 2*b^2*B)*Elliptic.F((1/2)*(c + d*x), 2))/(b^2*(a^2 - b^2)*d) - ((a^2*A*b + A*b^3 + a^3*B - 3*a*b^2*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/((a - b)*b^2*(a + b)^2*d) - ((A*b - a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/((a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 6, -(((A*b - a*B)*Elliptic.E((1/2)*(c + d*x), 2))/(a*(a^2 - b^2)*d)) - ((A*b - a*B)*Elliptic.F((1/2)*(c + d*x), 2))/(b*(a^2 - b^2)*d) + ((3*a^2*A*b - A*b^3 - a^3*B - a*b^2*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a*(a - b)*b*(a + b)^2*d) + (b*(A*b - a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 7, -(((2*a^2*A - 3*A*b^2 + a*b*B)*Elliptic.E((1/2)*(c + d*x), 2))/(a^2*(a^2 - b^2)*d)) + ((A*b - a*B)*Elliptic.F((1/2)*(c + d*x), 2))/(a*(a^2 - b^2)*d) - ((5*a^2*A*b - 3*A*b^3 - 3*a^3*B + a*b^2*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^2*(a - b)*(a + b)^2*d) + ((2*a^2*A - 3*A*b^2 + a*b*B)*sin(c + d*x))/(a^2*(a^2 - b^2)*d*sqrt(cos(c + d*x))) + (b*(A*b - a*B)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(cos(c + d*x))*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 8, ((4*a^2*A*b - 5*A*b^3 - 2*a^3*B + 3*a*b^2*B)*Elliptic.E((1/2)*(c + d*x), 2))/(a^3*(a^2 - b^2)*d) + ((2*a^2*A - 5*A*b^2 + 3*a*b*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*a^2*(a^2 - b^2)*d) + (b*(7*a^2*A*b - 5*A*b^3 - 5*a^3*B + 3*a*b^2*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^3*(a - b)*(a + b)^2*d) + ((2*a^2*A - 5*A*b^2 + 3*a*b*B)*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d*cos(c + d*x)^(3/2)) - ((4*a^2*A*b - 5*A*b^3 - 2*a^3*B + 3*a*b^2*B)*sin(c + d*x))/(a^3*(a^2 - b^2)*d*sqrt(cos(c + d*x))) + (b*(A*b - a*B)*sin(c + d*x))/(a*(a^2 - b^2)*d*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x)))]

    @test_int [cos(c + d*x)^(5/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 7, -(((3*a^3*A*b - 9*a*A*b^3 - 15*a^4*B + 29*a^2*b^2*B - 8*b^4*B)*Elliptic.E((1/2)*(c + d*x), 2))/(4*b^3*(a^2 - b^2)^2*d)) + ((3*a^4*A*b - 5*a^2*A*b^3 + 8*A*b^5 - 15*a^5*B + 33*a^3*b^2*B - 24*a*b^4*B)*Elliptic.F((1/2)*(c + d*x), 2))/(4*b^4*(a^2 - b^2)^2*d) - (a*(3*a^4*A*b - 6*a^2*A*b^3 + 15*A*b^5 - 15*a^5*B + 38*a^3*b^2*B - 35*a*b^4*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*(a - b)^2*b^4*(a + b)^3*d) + (a*(A*b - a*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + (a*(a^2*A*b - 7*A*b^3 - 5*a^3*B + 11*a*b^2*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 7, -(((a^2*A*b + 5*A*b^3 + 3*a^3*B - 9*a*b^2*B)*Elliptic.E((1/2)*(c + d*x), 2))/(4*b^2*(a^2 - b^2)^2*d)) + ((a^3*A*b - 7*a*A*b^3 + 3*a^4*B - 5*a^2*b^2*B + 8*b^4*B)*Elliptic.F((1/2)*(c + d*x), 2))/(4*b^3*(a^2 - b^2)^2*d) - ((a^4*A*b - 10*a^2*A*b^3 - 3*A*b^5 + 3*a^5*B - 6*a^3*b^2*B + 15*a*b^4*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*(a - b)^2*b^3*(a + b)^3*d) + (a*(A*b - a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + ((a^2*A*b + 5*A*b^3 + 3*a^3*B - 9*a*b^2*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*b*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 7, ((5*a^2*A*b + A*b^3 - a^3*B - 5*a*b^2*B)*Elliptic.E((1/2)*(c + d*x), 2))/(4*a*b*(a^2 - b^2)^2*d) + ((3*a^2*A*b + 3*A*b^3 + a^3*B - 7*a*b^2*B)*Elliptic.F((1/2)*(c + d*x), 2))/(4*b^2*(a^2 - b^2)^2*d) - ((3*a^4*A*b + 10*a^2*A*b^3 - A*b^5 + a^5*B - 10*a^3*b^2*B - 3*a*b^4*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a*(a - b)^2*b^2*(a + b)^3*d) - ((A*b - a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((5*a^2*A*b + A*b^3 - a^3*B - 5*a*b^2*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*a*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 7, -(((9*a^2*A*b - 3*A*b^3 - 5*a^3*B - a*b^2*B)*Elliptic.E((1/2)*(c + d*x), 2))/(4*a^2*(a^2 - b^2)^2*d)) - ((7*a^2*A*b - A*b^3 - 3*a^3*B - 3*a*b^2*B)*Elliptic.F((1/2)*(c + d*x), 2))/(4*a*b*(a^2 - b^2)^2*d) + ((15*a^4*A*b - 6*a^2*A*b^3 + 3*A*b^5 - 3*a^5*B - 10*a^3*b^2*B + a*b^4*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a^2*(a - b)^2*b*(a + b)^3*d) + (b*(A*b - a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + (b*(9*a^2*A*b - 3*A*b^3 - 5*a^3*B - a*b^2*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 8, -(((8*a^4*A - 29*a^2*A*b^2 + 15*A*b^4 + 9*a^3*b*B - 3*a*b^3*B)*Elliptic.E((1/2)*(c + d*x), 2))/(4*a^3*(a^2 - b^2)^2*d)) + ((11*a^2*A*b - 5*A*b^3 - 7*a^3*B + a*b^2*B)*Elliptic.F((1/2)*(c + d*x), 2))/(4*a^2*(a^2 - b^2)^2*d) - ((35*a^4*A*b - 38*a^2*A*b^3 + 15*A*b^5 - 15*a^5*B + 6*a^3*b^2*B - 3*a*b^4*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a^3*(a - b)^2*(a + b)^3*d) + ((8*a^4*A - 29*a^2*A*b^2 + 15*A*b^4 + 9*a^3*b*B - 3*a*b^3*B)*sin(c + d*x))/(4*a^3*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))) + (b*(A*b - a*B)*sin(c + d*x))/(2*a*(a^2 - b^2)*d*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2) + (b*(11*a^2*A*b - 5*A*b^3 - 7*a^3*B + a*b^2*B)*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^3, x, 9, ((24*a^4*A*b - 65*a^2*A*b^3 + 35*A*b^5 - 8*a^5*B + 29*a^3*b^2*B - 15*a*b^4*B)*Elliptic.E((1/2)*(c + d*x), 2))/(4*a^4*(a^2 - b^2)^2*d) + ((8*a^4*A - 61*a^2*A*b^2 + 35*A*b^4 + 33*a^3*b*B - 15*a*b^3*B)*Elliptic.F((1/2)*(c + d*x), 2))/(12*a^3*(a^2 - b^2)^2*d) + (b*(63*a^4*A*b - 86*a^2*A*b^3 + 35*A*b^5 - 35*a^5*B + 38*a^3*b^2*B - 15*a*b^4*B)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a^4*(a - b)^2*(a + b)^3*d) + ((8*a^4*A - 61*a^2*A*b^2 + 35*A*b^4 + 33*a^3*b*B - 15*a*b^3*B)*sin(c + d*x))/(12*a^3*(a^2 - b^2)^2*d*cos(c + d*x)^(3/2)) - ((24*a^4*A*b - 65*a^2*A*b^3 + 35*A*b^5 - 8*a^5*B + 29*a^3*b^2*B - 15*a*b^4*B)*sin(c + d*x))/(4*a^4*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))) + (b*(A*b - a*B)*sin(c + d*x))/(2*a*(a^2 - b^2)*d*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2) + (b*(13*a^2*A*b - 7*A*b^3 - 9*a^3*B + 3*a*b^2*B)*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x)))]

    @test_int [cos(c + d*x)^(5/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 3, (6*B*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*B*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [cos(c + d*x)^(3/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 3, (2*B*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*B*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [cos(c + d*x)^(1/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 2, (2*B*Elliptic.E((1/2)*(c + d*x), 2))/d]
    @test_int [cos(c + d*x)^(-1/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 2, (2*B*Elliptic.F((1/2)*(c + d*x), 2))/d]
    @test_int [cos(c + d*x)^(-3/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 3, -((2*B*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*B*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x)), x, 3, (2*B*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*B*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]

    @test_int [cos(c + d*x)^(5/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 7, -((2*a*B*Elliptic.E((1/2)*(c + d*x), 2))/(b^2*d)) + (2*(3*a^2 + b^2)*B*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^3*d) - (2*a^3*B*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^3*(a + b)*d) + (2*B*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b*d)]
    @test_int [cos(c + d*x)^(3/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 6, (2*B*Elliptic.E((1/2)*(c + d*x), 2))/(b*d) - (2*a*B*Elliptic.F((1/2)*(c + d*x), 2))/(b^2*d) + (2*a^2*B*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^2*(a + b)*d)]
    @test_int [cos(c + d*x)^(1/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 4, (2*B*Elliptic.F((1/2)*(c + d*x), 2))/(b*d) - (2*a*B*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b*(a + b)*d)]
    @test_int [cos(c + d*x)^(-1/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 2, (2*B*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/((a + b)*d)]
    @test_int [cos(c + d*x)^(-3/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 6, -((2*B*Elliptic.E((1/2)*(c + d*x), 2))/(a*d)) - (2*b*B*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a*(a + b)*d) + (2*B*sin(c + d*x))/(a*d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^2, x, 8, (2*b*B*Elliptic.E((1/2)*(c + d*x), 2))/(a^2*d) + (2*B*Elliptic.F((1/2)*(c + d*x), 2))/(3*a*d) + (2*b^2*B*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^2*(a + b)*d) + (2*B*sin(c + d*x))/(3*a*d*cos(c + d*x)^(3/2)) - (2*b*B*sin(c + d*x))/(a^2*d*sqrt(cos(c + d*x)))]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(c*cos(e+f*x))^(m/2)*(a+b*cos(e+f*x))^(n/2)*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 8, -(((a - b)*sqrt(a + b)*(6*a*A*b - 3*a^2*B + 16*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*a*b^2*d)) + (sqrt(a + b)*(a + 2*b)*(6*A*b - 3*a*B + 8*b*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*b^2*d) + (sqrt(a + b)*(2*a^2*A*b - 8*A*b^3 - a^3*B - 4*a*b^2*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(8*b^3*d) + ((6*a*A*b - 3*a^2*B + 16*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*b^2*d*sqrt(cos(c + d*x))) + ((2*A*b - a*B)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b*d) + (B*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*b*d)]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 7, -(((a - b)*sqrt(a + b)*(4*A*b + a*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*a*b*d)) + (sqrt(a + b)*(4*A*b + (a + 2*b)*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*b*d) - (sqrt(a + b)*(4*a*A*b - a^2*B + 4*b^2*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*b^2*d) + ((4*A*b + a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b*d*sqrt(cos(c + d*x))) + (B*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d)]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 6, -(((a - b)*sqrt(a + b)*B*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d)) + (sqrt(a + b)*(2*A + B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/d - (sqrt(a + b)*(2*A*b + a*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b*d) + (B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 5, (2*A*(a - b)*sqrt(a + b)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d) + (2*sqrt(a + b)*(A*b - a*(A - B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d) - (2*sqrt(a + b)*B*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/d]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 4, (2*(a - b)*sqrt(a + b)*(A*b + 3*a*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^2*d) + (2*(a - b)*sqrt(a + b)*(A - 3*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*d) + (2*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [cos(c + d*x)^(-7/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 5, (2*(a - b)*sqrt(a + b)*(9*a^2*A - 2*A*b^2 + 5*a*b*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a^3*d) - (2*(a - b)*sqrt(a + b)*(9*a*A + 2*A*b - 5*a*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a^2*d) + (2*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*(A*b + 5*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*a*d*cos(c + d*x)^(3/2))]
    @test_int [cos(c + d*x)^(-9/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(1/2), x, 6, (2*(a - b)*sqrt(a + b)*(19*a^2*A*b + 8*A*b^3 + 63*a^3*B - 14*a*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a^4*d) + (2*(a - b)*sqrt(a + b)*(8*A*b^2 + a^2*(25*A - 63*B) + 2*a*b*(3*A - 7*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a^3*d) + (2*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (2*(A*b + 7*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*a*d*cos(c + d*x)^(5/2)) + (2*(25*a^2*A - 4*A*b^2 + 7*a*b*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*a^2*d*cos(c + d*x)^(3/2))]

    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 9, -(((a - b)*sqrt(a + b)*(24*a^2*A*b + 128*A*b^3 - 9*a^3*B + 156*a*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(192*a*b^2*d)) - (sqrt(a + b)*(9*a^3*B - 6*a^2*b*(4*A + B) - 8*b^3*(16*A + 9*B) - 4*a*b^2*(28*A + 39*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(192*b^2*d) + (sqrt(a + b)*(8*a^3*A*b - 96*a*A*b^3 - 3*a^4*B - 24*a^2*b^2*B - 48*b^4*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(64*b^3*d) + ((24*a^2*A*b + 128*A*b^3 - 9*a^3*B + 156*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(192*b^2*d*sqrt(cos(c + d*x))) + ((8*a*A*b - 3*a^2*B + 12*b^2*B)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*b*d) + ((8*A*b - 3*a*B)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*b*d) + (B*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*b*d)]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 8, -(((a - b)*sqrt(a + b)*(30*a*A*b + 3*a^2*B + 16*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*a*b*d)) + (sqrt(a + b)*(30*a*A*b + 12*A*b^2 + 3*a^2*B + 14*a*b*B + 16*b^2*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*b*d) - (sqrt(a + b)*(6*a^2*A*b + 8*A*b^3 - a^3*B + 12*a*b^2*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(8*b^2*d) + ((30*a*A*b + 3*a^2*B + 16*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*b*d*sqrt(cos(c + d*x))) + ((6*A*b + 7*a*B)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(12*d) + (b*B*cos(c + d*x)^(3/2)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 7, -(((a - b)*sqrt(a + b)*(4*A*b + 5*a*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*a*d)) + (sqrt(a + b)*(8*a*A + 4*A*b + 5*a*B + 2*b*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*d) - (sqrt(a + b)*(12*a*A*b + 3*a^2*B + 4*b^2*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*b*d) + ((4*A*b + 5*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(cos(c + d*x))) + (b*B*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d)]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 7, ((a - b)*sqrt(a + b)*(2*a*A - b*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d) - (sqrt(a + b)*(2*a*(A - B) - b*(4*A + B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/d - (sqrt(a + b)*(2*A*b + 3*a*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/d + (2*a*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - ((2*a*A - b*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 6, (2*(a - b)*sqrt(a + b)*(4*A*b + 3*a*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*d) + (2*sqrt(a + b)*(3*A*b^2 + a^2*(A - 3*B) - a*(4*A*b - 6*b*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*d) - (2*b*sqrt(a + b)*B*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/d + (2*a*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [cos(c + d*x)^(-7/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 5, (2*(a - b)*sqrt(a + b)*(9*a^2*A + 3*A*b^2 + 20*a*b*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a^2*d) - (2*(a - b)*sqrt(a + b)*(9*a*A - 3*A*b - 5*a*B + 15*b*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a*d) + (2*a*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*(6*A*b + 5*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2))]
    @test_int [cos(c + d*x)^(-9/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 6, (2*(a - b)*sqrt(a + b)*(82*a^2*A*b - 6*A*b^3 + 63*a^3*B + 21*a*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a^3*d) - (2*(a - b)*sqrt(a + b)*(6*A*b^2 - a^2*(25*A - 63*B) + 3*a*b*(19*A - 7*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a^2*d) + (2*a*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (2*(8*A*b + 7*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*(25*a^2*A + 3*A*b^2 + 42*a*b*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*a*d*cos(c + d*x)^(3/2))]
    @test_int [cos(c + d*x)^(-11/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(3/2), x, 7, (2*(a - b)*sqrt(a + b)*(147*a^4*A + 33*a^2*A*b^2 + 8*A*b^4 + 246*a^3*b*B - 18*a*b^3*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(315*a^4*d) + (2*(a - b)*sqrt(a + b)*(8*A*b^3 - a^3*(147*A - 75*B) + 3*a^2*b*(13*A - 57*B) + 6*a*b^2*(A - 3*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(315*a^3*d) + (2*a*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2)) + (2*(10*A*b + 9*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2)) + (2*(49*a^2*A + 3*A*b^2 + 72*a*b*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*a*d*cos(c + d*x)^(5/2)) + (2*(88*a^2*A*b - 4*A*b^3 + 75*a^3*B + 9*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*a^2*d*cos(c + d*x)^(3/2))]

    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 10, -(((a - b)*sqrt(a + b)*(150*a^3*A*b + 2840*a*A*b^3 - 45*a^4*B + 1692*a^2*b^2*B + 1024*b^4*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(1920*a*b^2*d)) - (sqrt(a + b)*(45*a^4*B - 30*a^3*b*(5*A + B) - 16*b^4*(45*A + 64*B) - 8*a*b^3*(355*A + 193*B) - 4*a^2*b^2*(295*A + 423*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(1920*b^2*d) + (sqrt(a + b)*(10*a^4*A*b - 240*a^2*A*b^3 - 96*A*b^5 - 3*a^5*B - 40*a^3*b^2*B - 240*a*b^4*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(128*b^3*d) + ((150*a^3*A*b + 2840*a*A*b^3 - 45*a^4*B + 1692*a^2*b^2*B + 1024*b^4*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(1920*b^2*d*sqrt(cos(c + d*x))) + ((50*a^2*A*b + 120*A*b^3 - 15*a^3*B + 172*a*b^2*B)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(320*b*d) + ((50*a*A*b - 15*a^2*B + 64*b^2*B)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(240*b*d) + ((10*A*b - 3*a*B)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(40*b*d) + (B*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(5*b*d)]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 9, -(((a - b)*sqrt(a + b)*(264*a^2*A*b + 128*A*b^3 + 15*a^3*B + 284*a*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(192*a*b*d)) + (sqrt(a + b)*(15*a^3*B + 8*b^3*(16*A + 9*B) + 2*a^2*b*(132*A + 59*B) + 4*a*b^2*(52*A + 71*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(192*b*d) - (sqrt(a + b)*(40*a^3*A*b + 160*a*A*b^3 - 5*a^4*B + 120*a^2*b^2*B + 48*b^4*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(64*b^2*d) + ((264*a^2*A*b + 128*A*b^3 + 15*a^3*B + 284*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(192*b*d*sqrt(cos(c + d*x))) + ((24*a*A*b + 5*a^2*B + 12*b^2*B)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*d) + ((8*A*b + 11*a*B)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*d) + (b*B*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(4*d)]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 8, -(((a - b)*sqrt(a + b)*(54*a*A*b + 33*a^2*B + 16*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*a*d)) + (sqrt(a + b)*(4*b^2*(3*A + 4*B) + a^2*(48*A + 33*B) + a*(54*A*b + 26*b*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*d) - (sqrt(a + b)*(30*a^2*A*b + 8*A*b^3 + 5*a^3*B + 20*a*b^2*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(8*b*d) + ((54*a*A*b + 33*a^2*B + 16*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*d*sqrt(cos(c + d*x))) + (b*(2*A*b + 3*a*B)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d) + (b*B*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 8, ((a - b)*sqrt(a + b)*(8*a^2*A - 4*A*b^2 - 9*a*b*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*a*d) - (sqrt(a + b)*(8*a^2*(A - B) - 2*b^2*(2*A + B) - 3*a*b*(8*A + 3*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*d) - (sqrt(a + b)*(20*a*A*b + 15*a^2*B + 4*b^2*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*d) - ((8*a^2*A - 4*A*b^2 - 9*a*b*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(cos(c + d*x))) - (b*(4*a*A - b*B)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 8, ((a - b)*sqrt(a + b)*(14*a*A*b + 6*a^2*B - 3*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*d) - (sqrt(a + b)*(2*a*b*(7*A - 9*B) - 2*a^2*(A - 3*B) - 3*b^2*(6*A + B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*d) - (b*sqrt(a + b)*(2*A*b + 5*a*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/d + (2*a*(2*A*b + a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - ((14*a*A*b + 6*a^2*B - 3*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [cos(c + d*x)^(-7/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 7, (2*(a - b)*sqrt(a + b)*(9*a^2*A + 23*A*b^2 + 35*a*b*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a*d) + (2*sqrt(a + b)*(15*A*b^3 - a*b^2*(23*A - 45*B) + a^2*b*(17*A - 35*B) - a^3*(9*A - 5*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a*d) - (2*b^2*sqrt(a + b)*B*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/d + (2*a*(8*A*b + 5*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [cos(c + d*x)^(-9/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 6, (2*(a - b)*sqrt(a + b)*(145*a^2*A*b + 15*A*b^3 + 63*a^3*B + 161*a*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a^2*d) + (2*(a - b)*sqrt(a + b)*(a^2*(25*A - 63*B) + 15*b^2*(A - 7*B) - 8*a*b*(15*A - 7*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a*d) + (2*a*(10*A*b + 7*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*(25*a^2*A + 45*A*b^2 + 77*a*b*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [cos(c + d*x)^(-11/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 7, (2*(a - b)*sqrt(a + b)*(147*a^4*A + 279*a^2*A*b^2 - 10*A*b^4 + 435*a^3*b*B + 45*a*b^3*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(315*a^3*d) - (2*(a - b)*sqrt(a + b)*(10*A*b^3 - 6*a^2*b*(19*A - 60*B) + 3*a^3*(49*A - 25*B) + 15*a*b^2*(11*A - 3*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(315*a^2*d) + (2*a*(4*A*b + 3*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(21*d*cos(c + d*x)^(7/2)) + (2*(49*a^2*A + 75*A*b^2 + 135*a*b*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)) + (2*(163*a^2*A*b + 5*A*b^3 + 75*a^3*B + 135*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*a*d*cos(c + d*x)^(3/2)) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]
    @test_int [cos(c + d*x)^(-13/2)*(A + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 8, (2*(a - b)*sqrt(a + b)*(3705*a^4*A*b + 255*a^2*A*b^3 + 40*A*b^5 + 1617*a^5*B + 3069*a^3*b^2*B - 110*a*b^4*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3465*a^4*d) + (1/(3465*a^3*d))*(2*(a - b)*sqrt(a + b)*(40*A*b^4 + 3*a^4*(225*A - 539*B) - 6*a^3*b*(505*A - 209*B) + 15*a^2*b^2*(19*A - 121*B) + 10*a*b^3*(3*A - 11*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b))) + (2*a*(14*A*b + 11*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(99*d*cos(c + d*x)^(9/2)) + (2*(81*a^2*A + 113*A*b^2 + 209*a*b*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(693*d*cos(c + d*x)^(7/2)) + (2*(1145*a^2*A*b + 15*A*b^3 + 539*a^3*B + 825*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3465*a*d*cos(c + d*x)^(5/2)) + (2*(675*a^4*A + 1025*a^2*A*b^2 - 20*A*b^4 + 1793*a^3*b*B + 55*a*b^3*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3465*a^2*d*cos(c + d*x)^(3/2)) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(11*d*cos(c + d*x)^(11/2))]

    @test_int [cos(c + d*x)^(-5/2)*(3*b*(B/(2*a)) + B*cos(c + d*x))*(a + b*cos(c + d*x))^(5/2), x, 6, (2*(a - b)*sqrt(a + b)*(a^2 + 3*b^2)*B*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d) - ((a - 3*b)*sqrt(a + b)*(2*a^2 - a*b + 3*b^2)*B*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d) - (b*sqrt(a + b)*(5*a + (3*b^2)/a)*B*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/d + (b*B*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(d*cos(c + d*x)^(3/2))]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 7, -(((a - b)*sqrt(a + b)*(4*A*b - 3*a*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*a*b^2*d)) + (sqrt(a + b)*(4*A*b - 3*a*B + 2*b*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*b^2*d) + (sqrt(a + b)*(4*a*A*b - 3*a^2*B - 4*b^2*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*b^3*d) + ((4*A*b - 3*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b^2*d*sqrt(cos(c + d*x))) + (B*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*b*d)]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 7, -(((a - b)*sqrt(a + b)*B*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*b*d)) + (sqrt(a + b)*B*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b*d) - (sqrt(a + b)*(2*A*b - a*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^2*d) + (a*B*sin(c + d*x))/(b*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))) + (B*sqrt(cos(c + d*x))*sin(c + d*x))/(d*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 3, (2*A*sqrt(a + b)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d) - (2*sqrt(a + b)*B*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b*d)]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 3, (2*A*(a - b)*sqrt(a + b)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a^2*d) - (2*sqrt(a + b)*(A - B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d)]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 4, -((2*(a - b)*sqrt(a + b)*(2*A*b - 3*a*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^3*d)) + (2*sqrt(a + b)*(2*A*b + a*(A - 3*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^2*d) + (2*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*a*d*cos(c + d*x)^(3/2))]
    @test_int [cos(c + d*x)^(-7/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(1/2), x, 5, (2*(a - b)*sqrt(a + b)*(9*a^2*A + 8*A*b^2 - 10*a*b*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a^4*d) - (2*sqrt(a + b)*(8*A*b^2 + a^2*(9*A - 5*B) - 2*a*b*(A + 5*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a^3*d) + (2*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*a*d*cos(c + d*x)^(5/2)) - (2*(4*A*b - 5*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*a^2*d*cos(c + d*x)^(3/2))]

    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 7, ((2*a*A*b - 3*a^2*B + b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*b^2*sqrt(a + b)*d) - ((2*A*b - (3*a + b)*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^2*sqrt(a + b)*d) - (sqrt(a + b)*(2*A*b - 3*a*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^3*d) + (2*a*(A*b - a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - ((2*a*A*b - 3*a^2*B + b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(b^2*(a^2 - b^2)*d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 6, -((2*(A*b - a*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*b*sqrt(a + b)*d)) + (2*(A*b - a*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*b*sqrt(a + b)*d) - (2*sqrt(a + b)*B*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^2*d) + (2*a*(A*b - a*B)*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 4, (2*(A*b - a*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a^2*sqrt(a + b)*d) + (2*(A + B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*sqrt(a + b)*d) - (2*(A*b - a*B)*sin(c + d*x))/((a^2 - b^2)*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 4, (2*(a^2*A - 2*A*b^2 + a*b*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a^3*sqrt(a + b)*d) - (2*(2*A*b + a*(A - B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a^2*sqrt(a + b)*d) + (2*b*(A*b - a*B)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 5, -((2*(5*a^2*A*b - 8*A*b^3 - 3*a^3*B + 6*a*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^4*sqrt(a + b)*d)) + (2*(a + 2*b)*(4*A*b + a*(A - 3*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^3*sqrt(a + b)*d) + (2*b*(A*b - a*B)*sin(c + d*x))/(a*(a^2 - b^2)*d*cos(c + d*x)^(3/2)*sqrt(a + b*cos(c + d*x))) + (2*(a^2*A - 4*A*b^2 + 3*a*b*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d*cos(c + d*x)^(3/2))]

    @test_int [cos(c + d*x)^(5/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 8, ((6*a^3*A*b - 14*a*A*b^3 - 15*a^4*B + 26*a^2*b^2*B - 3*b^4*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*(a - b)*b^3*(a + b)^(3/2)*d) - ((6*a^2*A*b + 2*a*A*b^2 - 12*A*b^3 - 15*a^3*B - 5*a^2*b*B + 21*a*b^2*B + 3*b^3*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*(a - b)*b^3*(a + b)^(3/2)*d) - (sqrt(a + b)*(2*A*b - 5*a*B)*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^4*d) + (2*a*(A*b - a*B)*cos(c + d*x)^(3/2)*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*a*(2*a^2*A*b - 6*A*b^3 - 5*a^3*B + 9*a*b^2*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) - ((6*a^3*A*b - 14*a*A*b^3 - 15*a^4*B + 26*a^2*b^2*B - 3*b^4*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b^3*(a^2 - b^2)^2*d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 7, (2*(4*A*b^3 + 3*a^3*B - 7*a*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*(a - b)*b^2*(a + b)^(3/2)*d) + (2*(a*A*b^2 - 3*A*b^3 - 3*a^3*B - a^2*b*B + 6*a*b^2*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*(a - b)*b^2*(a + b)^(3/2)*d) - (2*sqrt(a + b)*B*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^3*d) + (2*a*(A*b - a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (2*a*(4*A*b^3 + 3*a^3*B - 7*a*b^2*B)*sin(c + d*x))/(3*b^2*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 5, -((2*(3*a^2*A + A*b^2 - 4*a*b*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^2*(a - b)*(a + b)^(3/2)*d)) + (2*(3*a*A - A*b + a*B - 3*b*B)*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*(a - b)*(a + b)^(3/2)*d) - (2*(A*b - a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*(3*a^2*A + A*b^2 - 4*a*b*B)*sin(c + d*x))/(3*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-1/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 5, (2*(6*a^2*A*b - 2*A*b^3 - 3*a^3*B - a*b^2*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^3*(a - b)*(a + b)^(3/2)*d) - (2*(2*A*b^2 - 3*a^2*(A + B) + a*b*(3*A + B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^2*sqrt(a + b)*(a^2 - b^2)*d) + (2*b*(A*b - a*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (2*(6*a^2*A*b - 2*A*b^3 - 3*a^3*B - a*b^2*B)*sin(c + d*x))/(3*a*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 5, (2*(3*a^4*A - 15*a^2*A*b^2 + 8*A*b^4 + 6*a^3*b*B - 2*a*b^3*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^4*(a - b)*(a + b)^(3/2)*d) + (2*(8*A*b^3 - 3*a^3*(A - B) + 2*a*b^2*(3*A - B) - 3*a^2*b*(3*A + B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^3*sqrt(a + b)*(a^2 - b^2)*d) + (2*b*(A*b - a*B)*sin(c + d*x))/(3*a*(a^2 - b^2)*d*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)) + (2*b*(8*a^2*A*b - 4*A*b^3 - 5*a^3*B + a*b^2*B)*sin(c + d*x))/(3*a^2*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-5/2)*(A + B*cos(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 6, -((2*(8*a^4*A*b - 28*a^2*A*b^3 + 16*A*b^5 - 3*a^5*B + 15*a^3*b^2*B - 8*a*b^4*B)*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^5*(a - b)*(a + b)^(3/2)*d)) - (2*(16*A*b^4 - a^4*(A - 3*B) + 4*a*b^3*(3*A - 2*B) - 9*a^3*b*(A - B) - 2*a^2*b^2*(8*A + 3*B))*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^4*sqrt(a + b)*(a^2 - b^2)*d) + (2*b*(A*b - a*B)*sin(c + d*x))/(3*a*(a^2 - b^2)*d*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^(3/2)) + (2*b*(10*a^2*A*b - 6*A*b^3 - 7*a^3*B + 3*a*b^2*B)*sin(c + d*x))/(3*a^2*(a^2 - b^2)^2*d*cos(c + d*x)^(3/2)*sqrt(a + b*cos(c + d*x))) + (2*(a^4*A - 13*a^2*A*b^2 + 8*A*b^4 + 8*a^3*b*B - 4*a*b^3*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*a^3*(a^2 - b^2)^2*d*cos(c + d*x)^(3/2))]

    @test_int [cos(c + d*x)^(3/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 9, -(((a - b)*sqrt(a + b)*B*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*b*d)) + (sqrt(a + b)*B*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b*d) + (a*sqrt(a + b)*B*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^2*d) + (a*B*sin(c + d*x))/(b*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))) + (B*sqrt(cos(c + d*x))*sin(c + d*x))/(d*sqrt(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^(1/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 2, -((2*sqrt(a + b)*B*cot(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b*d))]
    @test_int [cos(c + d*x)^(-1/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 2, (2*sqrt(a + b)*B*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d)]
    @test_int [cos(c + d*x)^(-3/2)*(a*B + b*B*cos(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 4, (2*(a - b)*sqrt(a + b)*B*cot(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a^2*d) - (2*sqrt(a + b)*B*cot(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d)]

    @test_int [(1 + cos(c + d*x))/(cos(c + d*x)^(3/2)*sqrt(2 + 3*cos(c + d*x))), x, 1, -((cot(c + d*x)*Elliptic.E(asin(sqrt(2 + 3*cos(c + d*x))/(sqrt(5)*sqrt(cos(c + d*x)))), 5)*sqrt(-1 - sec(c + d*x))*sqrt(1 - sec(c + d*x)))/d)]
    @test_int [(1 + cos(c + d*x))/(cos(c + d*x)^(3/2)*sqrt(-2 + 3*cos(c + d*x))), x, 1, -((sqrt(5)*cot(c + d*x)*Elliptic.E(asin(sqrt(-2 + 3*cos(c + d*x))/sqrt(cos(c + d*x))), 1/5)*sqrt(-1 + sec(c + d*x))*sqrt(1 + sec(c + d*x)))/d)]

    @test_int [(1 + cos(c + d*x))/(cos(c + d*x)^(3/2)*sqrt(2 - 3*cos(c + d*x))), x, 2, (sqrt(5)*sqrt(-cos(c + d*x))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(2 - 3*cos(c + d*x))/sqrt(-cos(c + d*x))), 1/5)*sqrt(-1 + sec(c + d*x))*sqrt(1 + sec(c + d*x)))/d]
    @test_int [(1 + cos(c + d*x))/(cos(c + d*x)^(3/2)*sqrt(-2 - 3*cos(c + d*x))), x, 2, (sqrt(-cos(c + d*x))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(-2 - 3*cos(c + d*x))/(sqrt(5)*sqrt(-cos(c + d*x)))), 5)*sqrt(-1 - sec(c + d*x))*sqrt(1 - sec(c + d*x)))/d]

    @test_int [(1 + cos(c + d*x))/(cos(c + d*x)^(3/2)*sqrt(3 + 2*cos(c + d*x))), x, 1, (2*cot(c + d*x)*Elliptic.E(asin(sqrt(3 + 2*cos(c + d*x))/(sqrt(5)*sqrt(cos(c + d*x)))), -5)*sqrt(1 - sec(c + d*x))*sqrt(1 + sec(c + d*x)))/(3*d)]
    @test_int [(1 + cos(c + d*x))/(cos(c + d*x)^(3/2)*sqrt(3 - 2*cos(c + d*x))), x, 1, (2*sqrt(5)*cot(c + d*x)*Elliptic.E(asin(sqrt(3 - 2*cos(c + d*x))/sqrt(cos(c + d*x))), -(1/5))*sqrt(1 - sec(c + d*x))*sqrt(1 + sec(c + d*x)))/(3*d)]

    @test_int [(1 + cos(c + d*x))/(cos(c + d*x)^(3/2)*sqrt(-3 + 2*cos(c + d*x))), x, 2, -((2*sqrt(5)*sqrt(-cos(c + d*x))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(-3 + 2*cos(c + d*x))/sqrt(-cos(c + d*x))), -(1/5))*sqrt(1 - sec(c + d*x))*sqrt(1 + sec(c + d*x)))/(3*d))]
    @test_int [(1 + cos(c + d*x))/(cos(c + d*x)^(3/2)*sqrt(-3 - 2*cos(c + d*x))), x, 2, -((2*sqrt(-cos(c + d*x))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(-3 - 2*cos(c + d*x))/(sqrt(5)*sqrt(-cos(c + d*x)))), -5)*sqrt(1 - sec(c + d*x))*sqrt(1 + sec(c + d*x)))/(3*d))]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(c*cos(e+f*x))^m*(a+b*cos(e+f*x))^n*(A+B*cos(e+f*x))*with*m*and/or*n*symbolic=#

    @test_int [(c*cos(e + f*x))^m*(a + b*cos(e + f*x))^n*(A + B*cos(e + f*x)), x, 0, Unintegrable((c*cos(e + f*x))^m*(a + b*cos(e + f*x))^n*(A + B*cos(e + f*x)), x)]

    @test_int [(c*cos(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^4, x, 7, If(13>=8, (b*(A*b^3*(15 + 8*m + m^2) + 4*a*b^2*B*(15 + 8*m + m^2) + 2*a^3*B*(28 + 10*m + m^2) + a^2*A*b*(110 + 47*m + 5*m^2))*(c*cos(e + f*x))^(1 + m)*sin(e + f*x))/(c*f*(2 + m)*(4 + m)*(5 + m)) + (b^2*(b^2*B*(4 + m)^2 + 2*a*A*b*(5 + m)^2 + a^2*B*(36 + 11*m + m^2))*cos(e + f*x)*(c*cos(e + f*x))^(1 + m)*sin(e + f*x))/(c*f*(3 + m)*(4 + m)*(5 + m)) + (b*(A*b*(5 + m) + a*B*(8 + m))*(c*cos(e + f*x))^(1 + m)*(a + b*cos(e + f*x))^2*sin(e + f*x))/(c*f*(4 + m)*(5 + m)) + (b*B*(c*cos(e + f*x))^(1 + m)*(a + b*cos(e + f*x))^3*sin(e + f*x))/(c*f*(5 + m)) - ((A*b^4*(3 + 4*m + m^2) + 4*a*b^3*B*(3 + 4*m + m^2) + 6*a^2*A*b^2*(4 + 5*m + m^2) + 4*a^3*b*B*(4 + 5*m + m^2) + a^4*A*(8 + 6*m + m^2))*(c*cos(e + f*x))^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(e + f*x)^2)*sin(e + f*x))/(c*f*(1 + m)*(2 + m)*(4 + m)*sqrt(sin(e + f*x)^2)) - ((b^4*B*(8 + 6*m + m^2) + 4*a*A*b^3*(10 + 7*m + m^2) + 6*a^2*b^2*B*(10 + 7*m + m^2) + 4*a^3*A*b*(15 + 8*m + m^2) + a^4*B*(15 + 8*m + m^2))*(c*cos(e + f*x))^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(e + f*x)^2)*sin(e + f*x))/(c^2*f*(2 + m)*(3 + m)*(5 + m)*sqrt(sin(e + f*x)^2)), (b*(A*b^3*(15 + 8*m + m^2) + 4*a*b^2*B*(15 + 8*m + m^2) + 2*a^3*B*(28 + 10*m + m^2) + a^2*A*b*(110 + 47*m + 5*m^2))*(c*cos(e + f*x))^(1 + m)*sin(e + f*x))/(c*f*(5 + m)*(8 + 6*m + m^2)) + (b^2*(b^2*B*(4 + m)^2 + 2*a*A*b*(5 + m)^2 + a^2*B*(36 + 11*m + m^2))*cos(e + f*x)*(c*cos(e + f*x))^(1 + m)*sin(e + f*x))/(c*f*(3 + m)*(4 + m)*(5 + m)) + (b*(A*b*(5 + m) + a*B*(8 + m))*(c*cos(e + f*x))^(1 + m)*(a + b*cos(e + f*x))^2*sin(e + f*x))/(c*f*(4 + m)*(5 + m)) + (b*B*(c*cos(e + f*x))^(1 + m)*(a + b*cos(e + f*x))^3*sin(e + f*x))/(c*f*(5 + m)) - ((A*b^4*(3 + 4*m + m^2) + 4*a*b^3*B*(3 + 4*m + m^2) + 6*a^2*A*b^2*(4 + 5*m + m^2) + 4*a^3*b*B*(4 + 5*m + m^2) + a^4*A*(8 + 6*m + m^2))*(c*cos(e + f*x))^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(e + f*x)^2)*sin(e + f*x))/(c*f*(4 + m)*(2 + 3*m + m^2)*sqrt(sin(e + f*x)^2)) - ((b^4*B*(8 + 6*m + m^2) + 4*a*A*b^3*(10 + 7*m + m^2) + 6*a^2*b^2*B*(10 + 7*m + m^2) + 4*a^3*A*b*(15 + 8*m + m^2) + a^4*B*(15 + 8*m + m^2))*(c*cos(e + f*x))^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(e + f*x)^2)*sin(e + f*x))/(c^2*f*(2 + m)*(3 + m)*(5 + m)*sqrt(sin(e + f*x)^2)))]
    @test_int [(c*cos(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^3, x, 6, (b*(b^2*B*(3 + m) + 3*a*A*b*(4 + m) + 2*a^2*B*(5 + m))*(c*cos(e + f*x))^(1 + m)*sin(e + f*x))/(c*f*(2 + m)*(4 + m)) + (b^2*(A*b*(4 + m) + a*B*(6 + m))*cos(e + f*x)*(c*cos(e + f*x))^(1 + m)*sin(e + f*x))/(c*f*(3 + m)*(4 + m)) + (b*B*(c*cos(e + f*x))^(1 + m)*(a + b*cos(e + f*x))^2*sin(e + f*x))/(c*f*(4 + m)) - ((a^2*(2 + m)*(b*B*(1 + m) + a*A*(4 + m)) + b*(1 + m)*(b^2*B*(3 + m) + 3*a*A*b*(4 + m) + 2*a^2*B*(5 + m)))*(c*cos(e + f*x))^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(e + f*x)^2)*sin(e + f*x))/(c*f*(1 + m)*(2 + m)*(4 + m)*sqrt(sin(e + f*x)^2)) - ((A*b^3*(2 + m) + 3*a*b^2*B*(2 + m) + 3*a^2*A*b*(3 + m) + a^3*B*(3 + m))*(c*cos(e + f*x))^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(e + f*x)^2)*sin(e + f*x))/(c^2*f*(2 + m)*(3 + m)*sqrt(sin(e + f*x)^2))]
    @test_int [(c*cos(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^2, x, 5, (b*(A*b*(3 + m) + a*B*(4 + m))*(c*cos(e + f*x))^(1 + m)*sin(e + f*x))/(c*f*(2 + m)*(3 + m)) + (b*B*(c*cos(e + f*x))^(1 + m)*(a + b*cos(e + f*x))*sin(e + f*x))/(c*f*(3 + m)) - ((A*b^2*(1 + m) + 2*a*b*B*(1 + m) + a^2*A*(2 + m))*(c*cos(e + f*x))^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(e + f*x)^2)*sin(e + f*x))/(c*f*(1 + m)*(2 + m)*sqrt(sin(e + f*x)^2)) - ((b^2*B*(2 + m) + a*(2*A*b + a*B)*(3 + m))*(c*cos(e + f*x))^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(e + f*x)^2)*sin(e + f*x))/(c^2*f*(2 + m)*(3 + m)*sqrt(sin(e + f*x)^2))]
    @test_int [(c*cos(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^1, x, 5, (b*B*(c*cos(e + f*x))^(1 + m)*sin(e + f*x))/(c*f*(2 + m)) - ((b*B*(1 + m) + a*A*(2 + m))*(c*cos(e + f*x))^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(e + f*x)^2)*sin(e + f*x))/(c*f*(1 + m)*(2 + m)*sqrt(sin(e + f*x)^2)) - ((A*b + a*B)*(c*cos(e + f*x))^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(e + f*x)^2)*sin(e + f*x))/(c^2*f*(2 + m)*sqrt(sin(e + f*x)^2))]
    @test_int [(c*cos(e + f*x))^m*(A + B*cos(e + f*x))/(a + b*cos(e + f*x))^1, x, 7, (a*(A*b - a*B)*c*AppellF1(1/2, (1 - m)/2, 1, 3/2, sin(e + f*x)^2, -((b^2*sin(e + f*x)^2)/(a^2 - b^2)))*(c*cos(e + f*x))^(-1 + m)*(cos(e + f*x)^2)^((1 - m)/2)*sin(e + f*x))/(b*(a^2 - b^2)*f) - ((A*b - a*B)*AppellF1(1/2, -(m/2), 1, 3/2, sin(e + f*x)^2, -((b^2*sin(e + f*x)^2)/(a^2 - b^2)))*(c*cos(e + f*x))^m*sin(e + f*x))/((cos(e + f*x)^2)^(m/2)*((a^2 - b^2)*f)) - (B*(c*cos(e + f*x))^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(e + f*x)^2)*sin(e + f*x))/(b*c*f*(1 + m)*sqrt(sin(e + f*x)^2))]

    @test_int [(c*cos(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^(3/2), x, 1, (2*b*B*(c*cos(e + f*x))^(1 + m)*sqrt(a + b*cos(e + f*x))*sin(e + f*x))/(c*f*(5 + 2*m)) + (2*Unintegrable(((c*cos(e + f*x))^m*((1/2)*a*c*(2*b*B*(1 + m) + 2*a*A*(5/2 + m)) + (1/2)*c*(b^2*B*(3 + 2*m) + a*(2*A*b + a*B)*(5 + 2*m))*cos(e + f*x) + (1/2)*b*c*(2*a*B*(3 + m) + A*b*(5 + 2*m))*cos(e + f*x)^2))/sqrt(a + b*cos(e + f*x)), x))/(c*(5 + 2*m))]
    @test_int [(c*cos(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^(1/2), x, 0, Unintegrable((c*cos(e + f*x))^m*sqrt(a + b*cos(e + f*x))*(A + B*cos(e + f*x)), x)]
    @test_int [(c*cos(e + f*x))^m*(A + B*cos(e + f*x))/(a + b*cos(e + f*x))^(1/2), x, 0, Unintegrable(((c*cos(e + f*x))^m*(A + B*cos(e + f*x)))/sqrt(a + b*cos(e + f*x)), x)]
    @test_int [(c*cos(e + f*x))^m*(A + B*cos(e + f*x))/(a + b*cos(e + f*x))^(3/2), x, 1, (2*b*(A*b - a*B)*(c*cos(e + f*x))^(1 + m)*sin(e + f*x))/(a*(a^2 - b^2)*c*f*sqrt(a + b*cos(e + f*x))) + (2*Unintegrable(((c*cos(e + f*x))^m*((1/2)*c*(a*(a*A - b*B) + 2*b*(A*b - a*B)*(1/2 + m)) - (1/2)*a*(A*b - a*B)*c*cos(e + f*x) - (1/2)*b*(A*b - a*B)*c*(3 + 2*m)*cos(e + f*x)^2))/sqrt(a + b*cos(e + f*x)), x))/(a*(a^2 - b^2)*c)]

    #= ::Title::Closed:: =#
    #=Integrands*of*the*form*(c*sec(e+f*x))^m*(a+b*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*(c*sec(e+f*x))^m*(a+a*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*sec(e+f*x)^(m/2)*(a+a*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [(a + a*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 9, (-2*a*(3*A + 5*B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*a*(A + B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*(3*A + 5*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a*(A + B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d) + (2*a*A*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 8, (-2*a*(A + B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*a*(A + 3*B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*(A + B)*sqrt(sec(c + d*x))*sin(c + d*x))/d + (2*a*A*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 7, (-2*a*(A - B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*a*(A + B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*a*A*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))*(A + B*cos(c + d*x))*sqrt(sec(c + d*x)), x, 7, (2*a*(A + B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*a*(3*A + B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*B*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))*(A + B*cos(c + d*x)))/sqrt(sec(c + d*x)), x, 8, (2*a*(5*A + 3*B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*a*(A + B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*B*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*a*(A + B)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))*(A + B*cos(c + d*x)))/sec(c + d*x)^(3/2), x, 9, (6*a*(A + B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*a*(7*A + 5*B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a*B*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*a*(A + B)*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*a*(7*A + 5*B)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]

    @test_int [(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 9, -((4*a^2*(4*A + 5*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (4*a^2*(A + 2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (4*a^2*(4*A + 5*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a^2*(7*A + 5*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*A*sec(c + d*x)^(3/2)*(a^2 + a^2*sec(c + d*x))*sin(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 8, -((4*a^2*A*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (4*a^2*(2*A + 3*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a^2*(5*A + 3*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*A*sqrt(sec(c + d*x))*(a^2 + a^2*sec(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 8, (4*a^2*B*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d + (4*a^2*(3*A + 2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a^2*(3*A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*B*(a^2 + a^2*sec(c + d*x))*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x))*sqrt(sec(c + d*x)), x, 8, (4*a^2*(5*A + 4*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^2*(2*A + B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a^2*(5*A + 7*B)*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) + (2*B*(a^2 + a^2*sec(c + d*x))*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2))]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x)))/sqrt(sec(c + d*x)), x, 9, (4*a^2*(4*A + 3*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^2*(7*A + 6*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a^2*(7*A + 9*B)*sin(c + d*x))/(35*d*sec(c + d*x)^(3/2)) + (4*a^2*(7*A + 6*B)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) + (2*B*(a^2 + a^2*sec(c + d*x))*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2))]

    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x))*sec(c + d*x)^(9/2), x, 10, -((4*a^3*(7*A + 9*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (4*a^3*(13*A + 21*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (4*a^3*(7*A + 9*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (4*a^3*(41*A + 42*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*a*A*sec(c + d*x)^(3/2)*(a + a*sec(c + d*x))^2*sin(c + d*x))/(7*d) + (2*(11*A + 7*B)*sec(c + d*x)^(3/2)*(a^3 + a^3*sec(c + d*x))*sin(c + d*x))/(35*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 9, -((4*a^3*(9*A + 5*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (4*a^3*(3*A + 5*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (4*a^3*(21*A + 20*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*a*A*sqrt(sec(c + d*x))*(a + a*sec(c + d*x))^2*sin(c + d*x))/(5*d) + (2*(9*A + 5*B)*sqrt(sec(c + d*x))*(a^3 + a^3*sec(c + d*x))*sin(c + d*x))/(15*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 9, -((4*a^3*(A - B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (20*a^3*(A + B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (4*a^3*(4*A + B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*a*B*(a + a*sec(c + d*x))^2*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (2*(A - B)*sqrt(sec(c + d*x))*(a^3 + a^3*sec(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 9, (4*a^3*(5*A + 9*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(5*A + 3*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (4*a^3*(5*A - 6*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*a*B*(a + a*sec(c + d*x))^2*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*(5*A + 9*B)*(a^3 + a^3*sec(c + d*x))*sin(c + d*x))/(15*d*sqrt(sec(c + d*x)))]
    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x))*sqrt(sec(c + d*x)), x, 9, (4*a^3*(9*A + 7*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(21*A + 13*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (4*a^3*(42*A + 41*B)*sin(c + d*x))/(105*d*sqrt(sec(c + d*x))) + (2*a*B*(a + a*sec(c + d*x))^2*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*(7*A + 11*B)*(a^3 + a^3*sec(c + d*x))*sin(c + d*x))/(35*d*sec(c + d*x)^(3/2))]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x)))/sqrt(sec(c + d*x)), x, 10, (4*a^3*(21*A + 17*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^3*(13*A + 11*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (4*a^3*(24*A + 23*B)*sin(c + d*x))/(105*d*sec(c + d*x)^(3/2)) + (4*a^3*(13*A + 11*B)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) + (2*a*B*(a + a*sec(c + d*x))^2*sin(c + d*x))/(9*d*sec(c + d*x)^(7/2)) + (2*(9*A + 13*B)*(a^3 + a^3*sec(c + d*x))*sin(c + d*x))/(63*d*sec(c + d*x)^(5/2))]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(5/2))/(a + a*cos(c + d*x)), x, 9, (3*(A - B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a*d) + ((5*A - 3*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*a*d) - (3*(A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(a*d) + ((5*A - 3*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a*d) - ((A - B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(d*(a + a*sec(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(3/2))/(a + a*cos(c + d*x)), x, 8, -(((3*A - B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a*d)) - ((A - B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a*d) + ((3*A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(a*d) - ((A - B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(d*(a + a*sec(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sqrt(sec(c + d*x)))/(a + a*cos(c + d*x)), x, 7, ((A - B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a*d) + ((A + B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a*d) - ((A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(d*(a + a*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))*sqrt(sec(c + d*x))), x, 7, -(((A - 3*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a*d)) + ((A - B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a*d) + ((A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(d*(a + a*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))*sec(c + d*x)^(3/2)), x, 8, (3*(A - B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a*d) - ((3*A - 5*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*a*d) - ((3*A - 5*B)*sin(c + d*x))/(3*a*d*sqrt(sec(c + d*x))) + ((A - B)*sin(c + d*x))/(d*sqrt(sec(c + d*x))*(a + a*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))*sec(c + d*x)^(5/2)), x, 9, -((3*(5*A - 7*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*a*d)) + (5*(A - B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*a*d) - ((5*A - 7*B)*sin(c + d*x))/(5*a*d*sec(c + d*x)^(3/2)) + (5*(A - B)*sin(c + d*x))/(3*a*d*sqrt(sec(c + d*x))) + ((A - B)*sin(c + d*x))/(d*sec(c + d*x)^(3/2)*(a + a*sec(c + d*x)))]

    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(3/2))/(a + a*cos(c + d*x))^2, x, 9, -(((4*A - B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a^2*d)) - ((5*A - 2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*a^2*d) + ((4*A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(a^2*d) - ((5*A - 2*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*d*(1 + sec(c + d*x))) - ((A - B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(3*d*(a + a*sec(c + d*x))^2)]
    @test_int [((A + B*cos(c + d*x))*sqrt(sec(c + d*x)))/(a + a*cos(c + d*x))^2, x, 8, (A*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a^2*d) + ((2*A + B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*a^2*d) - (A*sqrt(sec(c + d*x))*sin(c + d*x))/(a^2*d*(1 + sec(c + d*x))) - ((A - B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d*(a + a*sec(c + d*x))^2)]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^2*sqrt(sec(c + d*x))), x, 8, -((B*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a^2*d)) + ((A + 2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*a^2*d) + ((A + 2*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*a^2*d*(1 + sec(c + d*x))) - ((A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d*(a + a*sec(c + d*x))^2)]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^2*sec(c + d*x)^(3/2)), x, 8, -(((A - 4*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a^2*d)) + ((2*A - 5*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*a^2*d) + ((2*A - 5*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*a^2*d*(1 + sec(c + d*x))) + ((A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d*(a + a*sec(c + d*x))^2)]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^2*sec(c + d*x)^(5/2)), x, 9, ((4*A - 7*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a^2*d) - (5*(A - 2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*a^2*d) - (5*(A - 2*B)*sin(c + d*x))/(3*a^2*d*sqrt(sec(c + d*x))) + ((4*A - 7*B)*sin(c + d*x))/(3*a^2*d*sqrt(sec(c + d*x))*(1 + sec(c + d*x))) + ((A - B)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))*(a + a*sec(c + d*x))^2)]

    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(3/2))/(a + a*cos(c + d*x))^3, x, 10, -(((49*A - 9*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(10*a^3*d)) - ((13*A - 3*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(6*a^3*d) + ((49*A - 9*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(10*a^3*d) - ((A - B)*sec(c + d*x)^(7/2)*sin(c + d*x))/(5*d*(a + a*sec(c + d*x))^3) - ((8*A - 3*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(15*a*d*(a + a*sec(c + d*x))^2) - ((13*A - 3*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(6*d*(a^3 + a^3*sec(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sqrt(sec(c + d*x)))/(a + a*cos(c + d*x))^3, x, 9, ((9*A + B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(10*a^3*d) + ((3*A + B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(6*a^3*d) - ((A - B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d*(a + a*sec(c + d*x))^3) - ((6*A - B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*a*d*(a + a*sec(c + d*x))^2) - ((9*A + B)*sqrt(sec(c + d*x))*sin(c + d*x))/(10*d*(a^3 + a^3*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^3*sqrt(sec(c + d*x))), x, 9, ((A - B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(10*a^3*d) + ((A + B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(6*a^3*d) - ((A - B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(5*d*(a + a*sec(c + d*x))^3) - ((4*A + B)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*a*d*(a + a*sec(c + d*x))^2) + ((A + B)*sqrt(sec(c + d*x))*sin(c + d*x))/(6*d*(a^3 + a^3*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^3*sec(c + d*x)^(3/2)), x, 9, -(((A + 9*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(10*a^3*d)) + ((A + 3*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(6*a^3*d) - ((A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d*(a + a*sec(c + d*x))^3) + ((2*A + 3*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*a*d*(a + a*sec(c + d*x))^2) + ((A + 3*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(6*d*(a^3 + a^3*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^3*sec(c + d*x)^(5/2)), x, 9, -(((9*A - 49*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(10*a^3*d)) + ((3*A - 13*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(6*a^3*d) + ((A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d*(a + a*sec(c + d*x))^3) + ((3*A - 8*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*a*d*(a + a*sec(c + d*x))^2) + ((3*A - 13*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(6*d*(a^3 + a^3*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^3*sec(c + d*x)^(7/2)), x, 10, (7*(7*A - 17*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(10*a^3*d) - ((13*A - 33*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(6*a^3*d) - ((13*A - 33*B)*sin(c + d*x))/(6*a^3*d*sqrt(sec(c + d*x))) + ((A - B)*sin(c + d*x))/(5*d*sqrt(sec(c + d*x))*(a + a*sec(c + d*x))^3) + ((A - 2*B)*sin(c + d*x))/(3*a*d*sqrt(sec(c + d*x))*(a + a*sec(c + d*x))^2) + (7*(7*A - 17*B)*sin(c + d*x))/(30*d*sqrt(sec(c + d*x))*(a^3 + a^3*sec(c + d*x)))]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*sec(e+f*x)^(m/2)*(a+a*cos(e+f*x))^(n/2)*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(11/2), x, 6, (32*a*(8*A + 9*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (16*a*(8*A + 9*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (4*a*(8*A + 9*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*(8*A + 9*B)*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(9/2), x, 5, (16*a*(6*A + 7*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (8*a*(6*A + 7*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*(6*A + 7*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 4, (4*a*(4*A + 5*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a*(4*A + 5*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 3, (2*a*(2*A + 3*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 4, (2*sqrt(a)*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/d + (2*a*A*sqrt(sec(c + d*x))*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x))*sqrt(sec(c + d*x)), x, 4, (sqrt(a)*(2*A + B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/d + (a*B*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x)))/sqrt(sec(c + d*x)), x, 5, (sqrt(a)*(4*A + 3*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(4*d) + (a*B*sin(c + d*x))/(2*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a*(4*A + 3*B)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x)))/sec(c + d*x)^(3/2), x, 6, (sqrt(a)*(6*A + 5*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(8*d) + (a*B*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)) + (a*(6*A + 5*B)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a*(6*A + 5*B)*sin(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(13/2), x, 7, (32*a^2*(168*A + 187*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3465*d*sqrt(a + a*cos(c + d*x))) + (16*a^2*(168*A + 187*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3465*d*sqrt(a + a*cos(c + d*x))) + (4*a^2*(168*A + 187*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(1155*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(168*A + 187*B)*sec(c + d*x)^(7/2)*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(12*A + 11*B)*sec(c + d*x)^(9/2)*sin(c + d*x))/(99*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(11/2)*sin(c + d*x))/(11*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(11/2), x, 6, (16*a^2*(34*A + 39*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (8*a^2*(34*A + 39*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(34*A + 39*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(10*A + 9*B)*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(9/2), x, 5, (4*a^2*(52*A + 63*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(52*A + 63*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(8*A + 7*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 4, (2*a^2*(18*A + 25*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(6*A + 5*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 5, (2*a^(3/2)*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/d + (2*a^2*(4*A + 3*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 5, (a^(3/2)*(2*A + 3*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/d - (a^2*(2*A - B)*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (2*a*A*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sqrt(sec(c + d*x)), x, 5, (a^(3/2)*(12*A + 7*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(4*d) + (a^2*(4*A + 5*B)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (a*B*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x)))/sqrt(sec(c + d*x)), x, 6, (a^(3/2)*(14*A + 11*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(8*d) + (a^2*(6*A + 7*B)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a*B*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d*sec(c + d*x)^(3/2)) + (a^2*(14*A + 11*B)*sin(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x)))/sec(c + d*x)^(3/2), x, 7, (a^(3/2)*(88*A + 75*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(64*d) + (a^2*(8*A + 9*B)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)) + (a*B*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d*sec(c + d*x)^(5/2)) + (a^2*(88*A + 75*B)*sin(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a^2*(88*A + 75*B)*sin(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(15/2), x, 8, (32*a^3*(4184*A + 4615*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(45045*d*sqrt(a + a*cos(c + d*x))) + (16*a^3*(4184*A + 4615*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(45045*d*sqrt(a + a*cos(c + d*x))) + (4*a^3*(4184*A + 4615*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(15015*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(4184*A + 4615*B)*sec(c + d*x)^(7/2)*sin(c + d*x))/(9009*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(280*A + 299*B)*sec(c + d*x)^(9/2)*sin(c + d*x))/(1287*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(16*A + 13*B)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(11/2)*sin(c + d*x))/(143*d) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(13/2)*sin(c + d*x))/(13*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(13/2), x, 7, (16*a^3*(710*A + 803*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3465*d*sqrt(a + a*cos(c + d*x))) + (8*a^3*(710*A + 803*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3465*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(710*A + 803*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(1155*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(194*A + 209*B)*sec(c + d*x)^(7/2)*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(14*A + 11*B)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(9/2)*sin(c + d*x))/(99*d) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(11/2)*sin(c + d*x))/(11*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(11/2), x, 6, (4*a^3*(292*A + 345*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(292*A + 345*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(124*A + 135*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(4*A + 3*B)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(21*d) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(9/2), x, 5, (2*a^3*(230*A + 301*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(10*A + 11*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(10*A + 7*B)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 6, (2*a^(5/2)*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/d + (2*a^3*(32*A + 35*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(8*A + 5*B)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 6, (a^(5/2)*(2*A + 5*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/d - (a^3*(14*A + 3*B)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (2*a^2*(2*A + B)*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 6, (a^(5/2)*(20*A + 19*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(4*d) - (a^3*(4*A - 9*B)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) - (a^2*(4*A - B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sqrt(sec(c + d*x)), x, 6, (a^(5/2)*(38*A + 25*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(8*d) + (a^3*(54*A + 49*B)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (a^2*(2*A + 3*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) + (a*B*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x)))/sqrt(sec(c + d*x)), x, 7, (a^(5/2)*(200*A + 163*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(64*d) + (a^3*(104*A + 95*B)*sin(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a^2*(8*A + 11*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(24*d*sec(c + d*x)^(3/2)) + (a*B*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(4*d*sec(c + d*x)^(3/2)) + (a^3*(200*A + 163*B)*sin(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x)))/sec(c + d*x)^(3/2), x, 8, (a^(5/2)*(326*A + 283*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(128*d) + (a^3*(170*A + 157*B)*sin(c + d*x))/(240*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)) + (a^2*(10*A + 13*B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(40*d*sec(c + d*x)^(5/2)) + (a*B*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d*sec(c + d*x)^(5/2)) + (a^3*(326*A + 283*B)*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a^3*(326*A + 283*B)*sin(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(11/2))/sqrt(a + a*cos(c + d*x)), x, 9, -((sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d)) + (2*(257*A - 129*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) - (2*(29*A - 93*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*(19*A - 3*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) - (2*(A - 9*B)*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d*sqrt(a + a*cos(c + d*x))) + (2*A*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(9/2))/sqrt(a + a*cos(c + d*x)), x, 8, (sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d) - (2*(43*A - 91*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*(31*A - 7*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) - (2*(A - 7*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d*sqrt(a + a*cos(c + d*x))) + (2*A*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(7/2))/sqrt(a + a*cos(c + d*x)), x, 7, -((sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d)) + (2*(13*A - 5*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) - (2*(A - 5*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*A*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(5/2))/sqrt(a + a*cos(c + d*x)), x, 6, (sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d) - (2*(A - 3*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*A*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(3/2))/sqrt(a + a*cos(c + d*x)), x, 5, -((sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d)) + (2*A*sqrt(sec(c + d*x))*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(1/2))/sqrt(a + a*cos(c + d*x)), x, 6, (2*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d) + (sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d)]
    @test_int [(A + B*cos(c + d*x))/(sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(1/2)), x, 7, ((2*A - B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d) - (sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d) + (B*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/(sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)), x, 8, -(((4*A - 7*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(4*sqrt(a)*d)) + (sqrt(2)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d) + (B*sin(c + d*x))/(2*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + ((4*A - B)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    @test_int [((a*A + (A*b + a*B)*cos(c + d*x) + b*B*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/sqrt(a + a*cos(c + d*x)), x, 7, ((2*A*b + 2*a*B - b*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d) + (sqrt(2)*(a - b)*(A - B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(sqrt(a)*d) + (b*B*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(9/2))/(a + a*cos(c + d*x))^(3/2), x, 9, ((19*A - 15*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(2*sqrt(2)*a^(3/2)*d) - ((1201*A - 1029*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(210*a*d*sqrt(a + a*cos(c + d*x))) + ((397*A - 273*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(210*a*d*sqrt(a + a*cos(c + d*x))) - ((67*A - 63*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(70*a*d*sqrt(a + a*cos(c + d*x))) - ((A - B)*sec(c + d*x)^(7/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((11*A - 7*B)*sec(c + d*x)^(7/2)*sin(c + d*x))/(14*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(7/2))/(a + a*cos(c + d*x))^(3/2), x, 8, -((15*A - 11*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(2*sqrt(2)*a^(3/2)*d) + ((147*A - 95*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(30*a*d*sqrt(a + a*cos(c + d*x))) - ((39*A - 35*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(30*a*d*sqrt(a + a*cos(c + d*x))) - ((A - B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((9*A - 5*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(10*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(5/2))/(a + a*cos(c + d*x))^(3/2), x, 7, ((11*A - 7*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(2*sqrt(2)*a^(3/2)*d) - ((19*A - 15*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(6*a*d*sqrt(a + a*cos(c + d*x))) - ((A - B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((7*A - 3*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(6*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(3/2))/(a + a*cos(c + d*x))^(3/2), x, 6, -((7*A - 3*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(2*sqrt(2)*a^(3/2)*d) - ((A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((5*A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(1/2))/(a + a*cos(c + d*x))^(3/2), x, 5, ((3*A + B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(2*sqrt(2)*a^(3/2)*d) - ((A - B)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(1/2)), x, 7, (2*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(a^(3/2)*d) + ((A - 5*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(2*sqrt(2)*a^(3/2)*d) + ((A - B)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)), x, 8, ((2*A - 3*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(a^(3/2)*d) - ((5*A - 9*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(2*sqrt(2)*a^(3/2)*d) + ((A - B)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)) - ((A - 3*B)*sin(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(7/2))/(a + a*cos(c + d*x))^(5/2), x, 9, -((283*A - 163*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(16*sqrt(2)*a^(5/2)*d) + ((2671*A - 1495*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(240*a^2*d*sqrt(a + a*cos(c + d*x))) - ((787*A - 475*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(240*a^2*d*sqrt(a + a*cos(c + d*x))) - ((A - B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((21*A - 13*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((157*A - 85*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(80*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(5/2))/(a + a*cos(c + d*x))^(5/2), x, 8, ((163*A - 75*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(16*sqrt(2)*a^(5/2)*d) - ((299*A - 147*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(48*a^2*d*sqrt(a + a*cos(c + d*x))) - ((A - B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((17*A - 9*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((95*A - 39*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(48*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(3/2))/(a + a*cos(c + d*x))^(5/2), x, 7, -((75*A - 19*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(16*sqrt(2)*a^(5/2)*d) - ((A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((13*A - 5*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((49*A - 9*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(1/2))/(a + a*cos(c + d*x))^(5/2), x, 6, ((19*A + 5*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(16*sqrt(2)*a^(5/2)*d) - ((A - B)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sqrt(sec(c + d*x))) - ((9*A - B)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(1/2)), x, 6, ((5*A + 3*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(16*sqrt(2)*a^(5/2)*d) + ((A - B)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sqrt(sec(c + d*x))) + ((A + 7*B)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)), x, 8, (2*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(a^(5/2)*d) + ((3*A - 43*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(16*sqrt(2)*a^(5/2)*d) + ((A - B)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)) + ((3*A - 11*B)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(5/2)), x, 9, ((2*A - 5*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(a^(5/2)*d) - ((43*A - 115*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(16*sqrt(2)*a^(5/2)*d) + ((A - B)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(5/2)) + ((7*A - 15*B)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)) - ((11*A - 35*B)*sin(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(5/2))/(a + a*cos(c + d*x))^(7/2), x, 9, ((1015*A - 363*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(64*sqrt(2)*a^(7/2)*d) - ((1887*A - 691*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(192*a^3*d*sqrt(a + a*cos(c + d*x))) - ((A - B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)) - ((23*A - 11*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(48*a*d*(a + a*cos(c + d*x))^(5/2)) - ((109*A - 41*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(64*a^2*d*(a + a*cos(c + d*x))^(3/2)) + ((579*A - 199*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(192*a^3*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(3/2))/(a + a*cos(c + d*x))^(7/2), x, 8, -((3*(121*A - 21*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(64*sqrt(2)*a^(7/2)*d)) - ((A - B)*sqrt(sec(c + d*x))*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)) - ((19*A - 7*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(48*a*d*(a + a*cos(c + d*x))^(5/2)) - ((199*A - 43*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(192*a^2*d*(a + a*cos(c + d*x))^(3/2)) + ((691*A - 103*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(192*a^3*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(1/2))/(a + a*cos(c + d*x))^(7/2), x, 7, ((63*A + 13*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(64*sqrt(2)*a^(7/2)*d) - ((A - B)*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)*sqrt(sec(c + d*x))) - ((5*A - B)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(5/2)*sqrt(sec(c + d*x))) - ((103*A + 5*B)*sin(c + d*x))/(192*a^2*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^(7/2)*sec(c + d*x)^(1/2)), x, 7, ((13*A + 7*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(64*sqrt(2)*a^(7/2)*d) + ((A - B)*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)*sqrt(sec(c + d*x))) + ((A + 3*B)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(5/2)*sqrt(sec(c + d*x))) - ((5*A - 17*B)*sin(c + d*x))/(192*a^2*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^(7/2)*sec(c + d*x)^(3/2)), x, 7, ((7*A + 5*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(64*sqrt(2)*a^(7/2)*d) + ((A - B)*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)*sec(c + d*x)^(3/2)) + ((A - 13*B)*sin(c + d*x))/(48*a*d*(a + a*cos(c + d*x))^(5/2)*sqrt(sec(c + d*x))) + ((17*A + 67*B)*sin(c + d*x))/(192*a^2*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^(7/2)*sec(c + d*x)^(5/2)), x, 9, (2*B*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(a^(7/2)*d) + ((5*A - 177*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(64*sqrt(2)*a^(7/2)*d) + ((A - B)*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)*sec(c + d*x)^(5/2)) + ((5*A - 17*B)*sin(c + d*x))/(48*a*d*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)) + ((5*A - 49*B)*sin(c + d*x))/(64*a^2*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + a*cos(c + d*x))^(7/2)*sec(c + d*x)^(7/2)), x, 10, ((2*A - 7*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(a^(7/2)*d) - ((177*A - 637*B)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(64*sqrt(2)*a^(7/2)*d) + ((A - B)*sin(c + d*x))/(6*d*(a + a*cos(c + d*x))^(7/2)*sec(c + d*x)^(7/2)) + ((3*A - 7*B)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(5/2)) + ((79*A - 259*B)*sin(c + d*x))/(192*a^2*d*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)) - (7*(7*A - 27*B)*sin(c + d*x))/(64*a^3*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*(c*sec(e+f*x))^m*(a+b*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(c*sec(e+f*x))^(m/2)*(a+b*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [(a + b*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 9, -((2*(3*a*A + 5*b*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (2*(A*b + a*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*(3*a*A + 5*b*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*(A*b + a*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d) + (2*a*A*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 8, (-2*(A*b + a*B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*(a*A + 3*b*B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*(A*b + a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/d + (2*a*A*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 7, (-2*(a*A - b*B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*(A*b + a*B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*a*A*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))*(A + B*cos(c + d*x))*sqrt(sec(c + d*x)), x, 7, (2*(A*b + a*B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*(3*a*A + b*B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*b*B*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))*(A + B*cos(c + d*x)))/sqrt(sec(c + d*x)), x, 8, (2*(5*a*A + 3*b*B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(A*b + a*B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*b*B*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*(A*b + a*B)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))*(A + B*cos(c + d*x)))/sec(c + d*x)^(3/2), x, 9, (6*(A*b + a*B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(7*a*A + 5*b*B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b*B*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*(A*b + a*B)*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*(7*a*A + 5*b*B)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]

    @test_int [(a + b*cos(c + d*x))^2*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 9, -((2*(3*a^2*A + 5*b*(A*b + 2*a*B))*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (2*(2*a*A*b + a^2*B + 3*b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*(3*a^2*A + 5*b*(A*b + 2*a*B))*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a*(7*A*b + 5*a*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*a*A*sec(c + d*x)^(3/2)*(b + a*sec(c + d*x))*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^2*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 8, -((2*(2*a*A*b + a^2*B - b^2*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (2*(a^2*A + 3*A*b^2 + 6*a*b*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*(5*A*b + 3*a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*a*A*sqrt(sec(c + d*x))*(b + a*sec(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^2*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 8, -((2*(a^2*A - b*(A*b + 2*a*B))*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (2*(6*a*A*b + 3*a^2*B + b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*b^2*B*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (2*a^2*A*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^2*(A + B*cos(c + d*x))*sqrt(sec(c + d*x)), x, 8, (2*(10*a*A*b + 5*a^2*B + 3*b^2*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(3*a^2*A + A*b^2 + 2*a*b*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*b^2*B*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*b*(A*b + 2*a*B)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^2*(A + B*cos(c + d*x)))/sqrt(sec(c + d*x)), x, 9, (2*(5*a^2*A + 3*A*b^2 + 6*a*b*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(14*a*A*b + 7*a^2*B + 5*b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b^2*B*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*b*(A*b + 2*a*B)*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*(14*a*A*b + 7*a^2*B + 5*b^2*B)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]

    @test_int [(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x))*sec(c + d*x)^(9/2), x, 10, -((2*(9*a^2*A*b + 5*A*b^3 + 3*a^3*B + 15*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (2*(5*a^3*A + 21*a*A*b^2 + 21*a^2*b*B + 21*b^3*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*(9*a^2*A*b + 5*A*b^3 + 3*a^3*B + 15*a*b^2*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a*(5*a^2*A + 18*A*b^2 + 21*a*b*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(21*d) + (2*a^2*(11*A*b + 7*a*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*a*A*sec(c + d*x)^(3/2)*(b + a*sec(c + d*x))^2*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 9, -((2*(3*a^3*A + 15*a*A*b^2 + 15*a^2*b*B - 5*b^3*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (2*(3*a^2*A*b + 3*A*b^3 + a^3*B + 9*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*(3*a^2*A + 14*A*b^2 + 15*a*b*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a^2*(9*A*b + 5*a*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*a*A*sqrt(sec(c + d*x))*(b + a*sec(c + d*x))^2*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 9, -((2*(3*a^2*A*b - A*b^3 + a^3*B - 3*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (2*(a^3*A + 9*a*A*b^2 + 9*a^2*b*B + b^3*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*(9*a*A*b + 3*a^2*B - 2*b^2*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*a^2*(a*A - b*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d) + (2*b*B*(b + a*sec(c + d*x))^2*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 9, -((2*(5*a^3*A - 15*a*A*b^2 - 15*a^2*b*B - 3*b^3*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (2*(9*a^2*A*b + A*b^3 + 3*a^3*B + 3*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*b^2*(5*A*b + 9*a*B)*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) + (2*a^2*(5*a*A - b*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*b*B*(b + a*sec(c + d*x))^2*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2))]
    @test_int [(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x))*sqrt(sec(c + d*x)), x, 9, (2*(15*a^2*A*b + 3*A*b^3 + 5*a^3*B + 9*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(21*a^3*A + 21*a*A*b^2 + 21*a^2*b*B + 5*b^3*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b^2*(7*A*b + 11*a*B)*sin(c + d*x))/(35*d*sec(c + d*x)^(3/2)) + (2*b*(21*a*A*b + 18*a^2*B + 5*b^2*B)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) + (2*b*B*(b + a*sec(c + d*x))^2*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2))]
    @test_int [((a + b*cos(c + d*x))^3*(A + B*cos(c + d*x)))/sqrt(sec(c + d*x)), x, 10, (2*(15*a^3*A + 27*a*A*b^2 + 27*a^2*b*B + 7*b^3*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(21*a^2*A*b + 5*A*b^3 + 7*a^3*B + 15*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b^2*(9*A*b + 13*a*B)*sin(c + d*x))/(63*d*sec(c + d*x)^(5/2)) + (2*b*(27*a*A*b + 22*a^2*B + 7*b^2*B)*sin(c + d*x))/(45*d*sec(c + d*x)^(3/2)) + (2*(21*a^2*A*b + 5*A*b^3 + 7*a^3*B + 15*a*b^2*B)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) + (2*b*B*(b + a*sec(c + d*x))^2*sin(c + d*x))/(9*d*sec(c + d*x)^(7/2))]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x)), x, 11, (2*(A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^2*d) + (2*A*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*a*d) + (2*b*(A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^2*(a + b)*d) - (2*(A*b - a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(a^2*d) + (2*A*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a*d)]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x)), x, 8, (-2*A*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*d) - (2*(A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*(a + b)*d) + (2*A*sqrt(sec(c + d*x))*sin(c + d*x))/(a*d)]
    @test_int [((A + B*cos(c + d*x))*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x)), x, 6, (2*B*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b*d) + (2*(A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b*(a + b)*d)]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))*sqrt(sec(c + d*x))), x, 8, (2*B*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b*d) + (2*(A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^2*d) - (2*a*(A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^2*(a + b)*d)]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))*sec(c + d*x)^(3/2)), x, 10, (2*(A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^2*d) - (2*(3*a*A*b - 3*a^2*B - b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*b^3*d) + (2*a^2*(A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^3*(a + b)*d) + (2*B*sin(c + d*x))/(3*b*d*sqrt(sec(c + d*x)))]

    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x))^2, x, 12, ((4*a^2*A*b - 5*A*b^3 - 2*a^3*B + 3*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a^3*(a^2 - b^2)*d) + ((2*a^2*A - 5*A*b^2 + 3*a*b*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*a^2*(a^2 - b^2)*d) + (b*(7*a^2*A*b - 5*A*b^3 - 5*a^3*B + 3*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a^3*(a - b)*(a + b)^2*d) - ((4*a^2*A*b - 5*A*b^3 - 2*a^3*B + 3*a*b^2*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(a^3*(a^2 - b^2)*d) + ((2*a^2*A - 5*A*b^2 + 3*a*b*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d) + (b*(A*b - a*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(a*(a^2 - b^2)*d*(b + a*sec(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x))^2, x, 11, -(((2*a^2*A - 3*A*b^2 + a*b*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a^2*(a^2 - b^2)*d)) + ((A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a*(a^2 - b^2)*d) - ((5*a^2*A*b - 3*A*b^3 - 3*a^3*B + a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a^2*(a - b)*(a + b)^2*d) + ((2*a^2*A - 3*A*b^2 + a*b*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(a^2*(a^2 - b^2)*d) + (b*(A*b - a*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(a*(a^2 - b^2)*d*(b + a*sec(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x))^2, x, 10, -(((A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a*(a^2 - b^2)*d)) - ((A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(b*(a^2 - b^2)*d) + ((3*a^2*A*b - A*b^3 - a^3*B - a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(a*(a - b)*b*(a + b)^2*d) + (b*(A*b - a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(a*(a^2 - b^2)*d*(b + a*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))^2*sqrt(sec(c + d*x))), x, 10, ((A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(b*(a^2 - b^2)*d) + ((a*A*b + a^2*B - 2*b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(b^2*(a^2 - b^2)*d) - ((a^2*A*b + A*b^3 + a^3*B - 3*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/((a - b)*b^2*(a + b)^2*d) - ((A*b - a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/((a^2 - b^2)*d*(b + a*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))^2*sec(c + d*x)^(3/2)), x, 10, -(((a*A*b - 3*a^2*B + 2*b^2*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(b^2*(a^2 - b^2)*d)) + ((a^2*A*b - 2*A*b^3 - 3*a^3*B + 4*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(b^3*(a^2 - b^2)*d) - (a*(a^2*A*b - 3*A*b^3 - 3*a^3*B + 5*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/((a - b)*b^3*(a + b)^2*d) + (a*(A*b - a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(b*(a^2 - b^2)*d*(b + a*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))^2*sec(c + d*x)^(5/2)), x, 11, ((3*a^2*A*b - 2*A*b^3 - 5*a^3*B + 4*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(b^3*(a^2 - b^2)*d) - ((9*a^3*A*b - 12*a*A*b^3 - 15*a^4*B + 16*a^2*b^2*B + 2*b^4*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*b^4*(a^2 - b^2)*d) + (a^2*(3*a^2*A*b - 5*A*b^3 - 5*a^3*B + 7*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/((a - b)*b^4*(a + b)^2*d) - ((3*a*A*b - 5*a^2*B + 2*b^2*B)*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d*sqrt(sec(c + d*x))) + (a*(A*b - a*B)*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(sec(c + d*x))*(b + a*sec(c + d*x)))]

    @test_int [((A + B*cos(c + d*x))*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x))^3, x, 12, -(((8*a^4*A - 29*a^2*A*b^2 + 15*A*b^4 + 9*a^3*b*B - 3*a*b^3*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*a^3*(a^2 - b^2)^2*d)) + ((11*a^2*A*b - 5*A*b^3 - 7*a^3*B + a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*a^2*(a^2 - b^2)^2*d) - ((35*a^4*A*b - 38*a^2*A*b^3 + 15*A*b^5 - 15*a^5*B + 6*a^3*b^2*B - 3*a*b^4*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*a^3*(a - b)^2*(a + b)^3*d) + ((8*a^4*A - 29*a^2*A*b^2 + 15*A*b^4 + 9*a^3*b*B - 3*a*b^3*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(4*a^3*(a^2 - b^2)^2*d) + (b*(A*b - a*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(b + a*sec(c + d*x))^2) + (b*(11*a^2*A*b - 5*A*b^3 - 7*a^3*B + a*b^2*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*(b + a*sec(c + d*x)))]
    @test_int [((A + B*cos(c + d*x))*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x))^3, x, 11, -(((9*a^2*A*b - 3*A*b^3 - 5*a^3*B - a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*a^2*(a^2 - b^2)^2*d)) - ((7*a^2*A*b - A*b^3 - 3*a^3*B - 3*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*a*b*(a^2 - b^2)^2*d) + ((15*a^4*A*b - 6*a^2*A*b^3 + 3*A*b^5 - 3*a^5*B - 10*a^3*b^2*B + a*b^4*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*a^2*(a - b)^2*b*(a + b)^3*d) + (b*(A*b - a*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(b + a*sec(c + d*x))^2) + (b*(9*a^2*A*b - 3*A*b^3 - 5*a^3*B - a*b^2*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*(b + a*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))^3*sqrt(sec(c + d*x))), x, 11, ((5*a^2*A*b + A*b^3 - a^3*B - 5*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*a*b*(a^2 - b^2)^2*d) + ((3*a^2*A*b + 3*A*b^3 + a^3*B - 7*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*b^2*(a^2 - b^2)^2*d) - ((3*a^4*A*b + 10*a^2*A*b^3 - A*b^5 + a^5*B - 10*a^3*b^2*B - 3*a*b^4*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*a*(a - b)^2*b^2*(a + b)^3*d) + (b*(A*b - a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(b + a*sec(c + d*x))^2) - ((7*a^2*A*b - A*b^3 - 3*a^3*B - 3*a*b^2*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(4*a*(a^2 - b^2)^2*d*(b + a*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))^3*sec(c + d*x)^(3/2)), x, 11, -(((a^2*A*b + 5*A*b^3 + 3*a^3*B - 9*a*b^2*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*b^2*(a^2 - b^2)^2*d)) + ((a^3*A*b - 7*a*A*b^3 + 3*a^4*B - 5*a^2*b^2*B + 8*b^4*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*b^3*(a^2 - b^2)^2*d) - ((a^4*A*b - 10*a^2*A*b^3 - 3*A*b^5 + 3*a^5*B - 6*a^3*b^2*B + 15*a*b^4*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*(a - b)^2*b^3*(a + b)^3*d) - ((A*b - a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(2*(a^2 - b^2)*d*(b + a*sec(c + d*x))^2) + ((3*a^2*A*b + 3*A*b^3 + a^3*B - 7*a*b^2*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(4*b*(a^2 - b^2)^2*d*(b + a*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))^3*sec(c + d*x)^(5/2)), x, 11, -(((3*a^3*A*b - 9*a*A*b^3 - 15*a^4*B + 29*a^2*b^2*B - 8*b^4*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*b^3*(a^2 - b^2)^2*d)) + ((3*a^4*A*b - 5*a^2*A*b^3 + 8*A*b^5 - 15*a^5*B + 33*a^3*b^2*B - 24*a*b^4*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*b^4*(a^2 - b^2)^2*d) - (a*(3*a^4*A*b - 6*a^2*A*b^3 + 15*A*b^5 - 15*a^5*B + 38*a^3*b^2*B - 35*a*b^4*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*(a - b)^2*b^4*(a + b)^3*d) + (a*(A*b - a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(b + a*sec(c + d*x))^2) + (a*(a^2*A*b - 7*A*b^3 - 5*a^3*B + 11*a*b^2*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(4*b^2*(a^2 - b^2)^2*d*(b + a*sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))^3*sec(c + d*x)^(7/2)), x, 12, ((15*a^4*A*b - 29*a^2*A*b^3 + 8*A*b^5 - 35*a^5*B + 65*a^3*b^2*B - 24*a*b^4*B)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*b^4*(a^2 - b^2)^2*d) - ((45*a^5*A*b - 99*a^3*A*b^3 + 72*a*A*b^5 - 105*a^6*B + 223*a^4*b^2*B - 128*a^2*b^4*B - 8*b^6*B)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(12*b^5*(a^2 - b^2)^2*d) + (a^2*(15*a^4*A*b - 38*a^2*A*b^3 + 35*A*b^5 - 35*a^5*B + 86*a^3*b^2*B - 63*a*b^4*B)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(4*(a - b)^2*b^5*(a + b)^3*d) - ((15*a^3*A*b - 33*a*A*b^3 - 35*a^4*B + 61*a^2*b^2*B - 8*b^4*B)*sin(c + d*x))/(12*b^3*(a^2 - b^2)^2*d*sqrt(sec(c + d*x))) + (a*(A*b - a*B)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*sqrt(sec(c + d*x))*(b + a*sec(c + d*x))^2) + (a*(3*a^2*A*b - 9*A*b^3 - 7*a^3*B + 13*a*b^2*B)*sin(c + d*x))/(4*b^2*(a^2 - b^2)^2*d*sqrt(sec(c + d*x))*(b + a*sec(c + d*x)))]

    @test_int [((a*B + b*B*cos(c + d*x))*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x)), x, 4, (2*B*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*B*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [((a*B + b*B*cos(c + d*x))*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x)), x, 4, -((2*B*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (2*B*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [((a*B + b*B*cos(c + d*x))*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x)), x, 3, (2*B*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d]
    @test_int [(a*B + b*B*cos(c + d*x))/((a + b*cos(c + d*x))*sqrt(sec(c + d*x))), x, 3, (2*B*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d]
    @test_int [(a*B + b*B*cos(c + d*x))/((a + b*cos(c + d*x))*sec(c + d*x)^(3/2)), x, 4, (2*B*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*B*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [(a*B + b*B*cos(c + d*x))/((a + b*cos(c + d*x))*sec(c + d*x)^(5/2)), x, 4, (6*B*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (2*B*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2))]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(c*sec(e+f*x))^(m/2)*(a+b*cos(e+f*x))^(n/2)*(A+B*cos(e+f*x))=#

    #= ::Subsubsection::Closed:: =#
    #=n>0=#

    @test_int [sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(9/2), x, 7, (2*(a - b)*sqrt(a + b)*(19*a^2*A*b + 8*A*b^3 + 63*a^3*B - 14*a*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a^4*d*sqrt(sec(c + d*x))) + (2*(a - b)*sqrt(a + b)*(8*A*b^2 + a^2*(25*A - 63*B) + 2*a*b*(3*A - 7*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a^3*d*sqrt(sec(c + d*x))) + (2*(25*a^2*A - 4*A*b^2 + 7*a*b*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*a^2*d) + (2*(A*b + 7*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*a*d) + (2*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 6, (2*(a - b)*sqrt(a + b)*(9*a^2*A - 2*A*b^2 + 5*a*b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a^3*d*sqrt(sec(c + d*x))) - (2*(a - b)*sqrt(a + b)*(9*a*A + 2*A*b - 5*a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a^2*d*sqrt(sec(c + d*x))) + (2*(A*b + 5*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*a*d) + (2*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 5, (2*(a - b)*sqrt(a + b)*(A*b + 3*a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^2*d*sqrt(sec(c + d*x))) + (2*(a - b)*sqrt(a + b)*(A - 3*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*d*sqrt(sec(c + d*x))) + (2*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 6, (2*A*(a - b)*sqrt(a + b)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d*sqrt(sec(c + d*x))) + (2*sqrt(a + b)*(A*b - a*(A - B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d*sqrt(sec(c + d*x))) - (2*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(d*sqrt(sec(c + d*x)))]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x))*sec(c + d*x)^(1/2), x, 7, -(((a - b)*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d*sqrt(sec(c + d*x)))) + (sqrt(a + b)*(2*A + B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(2*A*b + a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b*d*sqrt(sec(c + d*x))) + (B*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x))/sec(c + d*x)^(1/2), x, 8, -(((a - b)*sqrt(a + b)*(4*A*b + a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*a*b*d*sqrt(sec(c + d*x)))) + (sqrt(a + b)*(4*A*b + (a + 2*b)*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*b*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(4*a*A*b - a^2*B + 4*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*b^2*d*sqrt(sec(c + d*x))) + (B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) + ((4*A*b + a*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*b*d)]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x))/sec(c + d*x)^(3/2), x, 9, -(((a - b)*sqrt(a + b)*(6*a*A*b - 3*a^2*B + 16*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*a*b^2*d*sqrt(sec(c + d*x)))) + (sqrt(a + b)*(a + 2*b)*(6*A*b - 3*a*B + 8*b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*b^2*d*sqrt(sec(c + d*x))) + (sqrt(a + b)*(2*a^2*A*b - 8*A*b^3 - a^3*B - 4*a*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(8*b^3*d*sqrt(sec(c + d*x))) + ((2*A*b - a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b*d*sqrt(sec(c + d*x))) + (B*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*b*d*sqrt(sec(c + d*x))) + ((6*a*A*b - 3*a^2*B + 16*b^2*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(24*b^2*d)]

    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(11/2), x, 8, (2*(a - b)*sqrt(a + b)*(147*a^4*A + 33*a^2*A*b^2 + 8*A*b^4 + 246*a^3*b*B - 18*a*b^3*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(315*a^4*d*sqrt(sec(c + d*x))) + (2*(a - b)*sqrt(a + b)*(8*A*b^3 - a^3*(147*A - 75*B) + 3*a^2*b*(13*A - 57*B) + 6*a*b^2*(A - 3*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(315*a^3*d*sqrt(sec(c + d*x))) + (2*(88*a^2*A*b - 4*A*b^3 + 75*a^3*B + 9*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*a^2*d) + (2*(49*a^2*A + 3*A*b^2 + 72*a*b*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*a*d) + (2*(10*A*b + 9*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d) + (2*a*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(9/2), x, 7, (2*(a - b)*sqrt(a + b)*(82*a^2*A*b - 6*A*b^3 + 63*a^3*B + 21*a*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a^3*d*sqrt(sec(c + d*x))) - (2*(a - b)*sqrt(a + b)*(6*A*b^2 - a^2*(25*A - 63*B) + 3*a*b*(19*A - 7*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a^2*d*sqrt(sec(c + d*x))) + (2*(25*a^2*A + 3*A*b^2 + 42*a*b*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*a*d) + (2*(8*A*b + 7*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*a*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 6, (2*(a - b)*sqrt(a + b)*(9*a^2*A + 3*A*b^2 + 20*a*b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a^2*d*sqrt(sec(c + d*x))) - (2*(a - b)*sqrt(a + b)*(9*a*A - 3*A*b - 5*a*B + 15*b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a*d*sqrt(sec(c + d*x))) + (2*(6*A*b + 5*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*a*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 7, (2*(a - b)*sqrt(a + b)*(4*A*b + 3*a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*d*sqrt(sec(c + d*x))) + (2*sqrt(a + b)*(3*A*b^2 + a^2*(A - 3*B) - a*(4*A*b - 6*b*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*d*sqrt(sec(c + d*x))) - (2*b*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(d*sqrt(sec(c + d*x))) + (2*a*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 8, ((a - b)*sqrt(a + b)*(2*a*A - b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(2*a*(A - B) - b*(4*A + B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(2*A*b + 3*a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(d*sqrt(sec(c + d*x))) + (2*a*A*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d - ((2*a*A - b*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(1/2), x, 8, -(((a - b)*sqrt(a + b)*(4*A*b + 5*a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*a*d*sqrt(sec(c + d*x)))) + (sqrt(a + b)*(8*a*A + 4*A*b + 5*a*B + 2*b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(12*a*A*b + 3*a^2*B + 4*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*b*d*sqrt(sec(c + d*x))) + (b*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) + ((4*A*b + 5*a*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*d)]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))/sec(c + d*x)^(1/2), x, 9, -(((a - b)*sqrt(a + b)*(30*a*A*b + 3*a^2*B + 16*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*a*b*d*sqrt(sec(c + d*x)))) + (sqrt(a + b)*(30*a*A*b + 12*A*b^2 + 3*a^2*B + 14*a*b*B + 16*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*b*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(6*a^2*A*b + 8*A*b^3 - a^3*B + 12*a*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(8*b^2*d*sqrt(sec(c + d*x))) + (b*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d*sec(c + d*x)^(3/2)) + ((6*A*b + 7*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(12*d*sqrt(sec(c + d*x))) + ((30*a*A*b + 3*a^2*B + 16*b^2*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(24*b*d)]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x))/sec(c + d*x)^(3/2), x, 10, -(((a - b)*sqrt(a + b)*(24*a^2*A*b + 128*A*b^3 - 9*a^3*B + 156*a*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(192*a*b^2*d*sqrt(sec(c + d*x)))) - (sqrt(a + b)*(9*a^3*B - 6*a^2*b*(4*A + B) - 8*b^3*(16*A + 9*B) - 4*a*b^2*(28*A + 39*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(192*b^2*d*sqrt(sec(c + d*x))) + (sqrt(a + b)*(8*a^3*A*b - 96*a*A*b^3 - 3*a^4*B - 24*a^2*b^2*B - 48*b^4*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(64*b^3*d*sqrt(sec(c + d*x))) + ((8*a*A*b - 3*a^2*B + 12*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*b*d*sqrt(sec(c + d*x))) + ((8*A*b - 3*a*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*b*d*sqrt(sec(c + d*x))) + (B*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*b*d*sqrt(sec(c + d*x))) + ((24*a^2*A*b + 128*A*b^3 - 9*a^3*B + 156*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(192*b^2*d)]

    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(13/2), x, 9, (2*(a - b)*sqrt(a + b)*(3705*a^4*A*b + 255*a^2*A*b^3 + 40*A*b^5 + 1617*a^5*B + 3069*a^3*b^2*B - 110*a*b^4*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3465*a^4*d*sqrt(sec(c + d*x))) + (1/(3465*a^3*d*sqrt(sec(c + d*x))))*(2*(a - b)*sqrt(a + b)*(40*A*b^4 + 3*a^4*(225*A - 539*B) - 6*a^3*b*(505*A - 209*B) + 15*a^2*b^2*(19*A - 121*B) + 10*a*b^3*(3*A - 11*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b))) + (2*(675*a^4*A + 1025*a^2*A*b^2 - 20*A*b^4 + 1793*a^3*b*B + 55*a*b^3*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3465*a^2*d) + (2*(1145*a^2*A*b + 15*A*b^3 + 539*a^3*B + 825*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(3465*a*d) + (2*(81*a^2*A + 113*A*b^2 + 209*a*b*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(693*d) + (2*a*(14*A*b + 11*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(9/2)*sin(c + d*x))/(99*d) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(11/2)*sin(c + d*x))/(11*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(11/2), x, 8, (2*(a - b)*sqrt(a + b)*(147*a^4*A + 279*a^2*A*b^2 - 10*A*b^4 + 435*a^3*b*B + 45*a*b^3*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(315*a^3*d*sqrt(sec(c + d*x))) - (2*(a - b)*sqrt(a + b)*(10*A*b^3 - 6*a^2*b*(19*A - 60*B) + 3*a^3*(49*A - 25*B) + 15*a*b^2*(11*A - 3*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(315*a^2*d*sqrt(sec(c + d*x))) + (2*(163*a^2*A*b + 5*A*b^3 + 75*a^3*B + 135*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*a*d) + (2*(49*a^2*A + 75*A*b^2 + 135*a*b*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d) + (2*a*(4*A*b + 3*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(21*d) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(9/2), x, 7, (2*(a - b)*sqrt(a + b)*(145*a^2*A*b + 15*A*b^3 + 63*a^3*B + 161*a*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a^2*d*sqrt(sec(c + d*x))) + (2*(a - b)*sqrt(a + b)*(a^2*(25*A - 63*B) + 15*b^2*(A - 7*B) - 8*a*b*(15*A - 7*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(105*a*d*sqrt(sec(c + d*x))) + (2*(25*a^2*A + 45*A*b^2 + 77*a*b*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*a*(10*A*b + 7*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(7/2), x, 8, (2*(a - b)*sqrt(a + b)*(9*a^2*A + 23*A*b^2 + 35*a*b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a*d*sqrt(sec(c + d*x))) + (2*sqrt(a + b)*(15*A*b^3 - a*b^2*(23*A - 45*B) + a^2*b*(17*A - 35*B) - a^3*(9*A - 5*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a*d*sqrt(sec(c + d*x))) - (2*b^2*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(d*sqrt(sec(c + d*x))) + (2*a*(8*A*b + 5*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(5/2), x, 9, ((a - b)*sqrt(a + b)*(14*a*A*b + 6*a^2*B - 3*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(2*a*b*(7*A - 9*B) - 2*a^2*(A - 3*B) - 3*b^2*(6*A + B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*d*sqrt(sec(c + d*x))) - (b*sqrt(a + b)*(2*A*b + 5*a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(d*sqrt(sec(c + d*x))) + (2*a*(2*A*b + a*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d - ((14*a*A*b + 6*a^2*B - 3*b^2*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(3/2), x, 9, ((a - b)*sqrt(a + b)*(8*a^2*A - 4*A*b^2 - 9*a*b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*a*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(8*a^2*(A - B) - 2*b^2*(2*A + B) - 3*a*b*(8*A + 3*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(20*a*A*b + 15*a^2*B + 4*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*d*sqrt(sec(c + d*x))) - (b*(4*a*A - b*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) - ((8*a^2*A - 4*A*b^2 - 9*a*b*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*d) + (2*a*A*(a + b*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))*sec(c + d*x)^(1/2), x, 9, -(((a - b)*sqrt(a + b)*(54*a*A*b + 33*a^2*B + 16*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*a*d*sqrt(sec(c + d*x)))) + (sqrt(a + b)*(4*b^2*(3*A + 4*B) + a^2*(48*A + 33*B) + a*(54*A*b + 26*b*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(24*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(30*a^2*A*b + 8*A*b^3 + 5*a^3*B + 20*a*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(8*b*d*sqrt(sec(c + d*x))) + (b*(2*A*b + 3*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) + (b*B*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + ((54*a*A*b + 33*a^2*B + 16*b^2*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(24*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))/sec(c + d*x)^(1/2), x, 10, -(((a - b)*sqrt(a + b)*(264*a^2*A*b + 128*A*b^3 + 15*a^3*B + 284*a*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(192*a*b*d*sqrt(sec(c + d*x)))) + (sqrt(a + b)*(15*a^3*B + 8*b^3*(16*A + 9*B) + 2*a^2*b*(132*A + 59*B) + 4*a*b^2*(52*A + 71*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(192*b*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(40*a^3*A*b + 160*a*A*b^3 - 5*a^4*B + 120*a^2*b^2*B + 48*b^4*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(64*b^2*d*sqrt(sec(c + d*x))) + (b*B*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(4*d*sec(c + d*x)^(3/2)) + ((24*a*A*b + 5*a^2*B + 12*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*d*sqrt(sec(c + d*x))) + ((8*A*b + 11*a*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*d*sqrt(sec(c + d*x))) + ((264*a^2*A*b + 128*A*b^3 + 15*a^3*B + 284*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(192*b*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x))/sec(c + d*x)^(3/2), x, 11, -(((a - b)*sqrt(a + b)*(150*a^3*A*b + 2840*a*A*b^3 - 45*a^4*B + 1692*a^2*b^2*B + 1024*b^4*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(1920*a*b^2*d*sqrt(sec(c + d*x)))) - (1/(1920*b^2*d*sqrt(sec(c + d*x))))*(sqrt(a + b)*(45*a^4*B - 30*a^3*b*(5*A + B) - 16*b^4*(45*A + 64*B) - 8*a*b^3*(355*A + 193*B) - 4*a^2*b^2*(295*A + 423*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b))) + (sqrt(a + b)*(10*a^4*A*b - 240*a^2*A*b^3 - 96*A*b^5 - 3*a^5*B - 40*a^3*b^2*B - 240*a*b^4*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(128*b^3*d*sqrt(sec(c + d*x))) + ((50*a^2*A*b + 120*A*b^3 - 15*a^3*B + 172*a*b^2*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(320*b*d*sqrt(sec(c + d*x))) + ((50*a*A*b - 15*a^2*B + 64*b^2*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(240*b*d*sqrt(sec(c + d*x))) + ((10*A*b - 3*a*B)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(40*b*d*sqrt(sec(c + d*x))) + (B*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(5*b*d*sqrt(sec(c + d*x))) + ((150*a^3*A*b + 2840*a*A*b^3 - 45*a^4*B + 1692*a^2*b^2*B + 1024*b^4*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(1920*b^2*d)]

    #= ::Subsubsection::Closed:: =#
    #=n<0=#

    @test_int [sec(c + d*x)^(7/2)*(A + B*cos(c + d*x))/sqrt(a + b*cos(c + d*x)), x, 6, (2*(a - b)*sqrt(a + b)*(9*a^2*A + 8*A*b^2 - 10*a*b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a^4*d*sqrt(sec(c + d*x))) - (2*sqrt(a + b)*(8*A*b^2 + a^2*(9*A - 5*B) - 2*a*b*(A + 5*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(15*a^3*d*sqrt(sec(c + d*x))) - (2*(4*A*b - 5*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*a^2*d) + (2*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*a*d)]
    @test_int [sec(c + d*x)^(5/2)*(A + B*cos(c + d*x))/sqrt(a + b*cos(c + d*x)), x, 5, -((2*(a - b)*sqrt(a + b)*(2*A*b - 3*a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^3*d*sqrt(sec(c + d*x)))) + (2*sqrt(a + b)*(2*A*b + a*(A - 3*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^2*d*sqrt(sec(c + d*x))) + (2*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a*d)]
    @test_int [sec(c + d*x)^(3/2)*(A + B*cos(c + d*x))/sqrt(a + b*cos(c + d*x)), x, 4, (2*A*(a - b)*sqrt(a + b)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a^2*d*sqrt(sec(c + d*x))) - (2*sqrt(a + b)*(A - B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d*sqrt(sec(c + d*x)))]
    @test_int [sec(c + d*x)^(1/2)*(A + B*cos(c + d*x))/sqrt(a + b*cos(c + d*x)), x, 4, (1/(a*d*sqrt(sec(c + d*x))))*(2*A*sqrt(a + b)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b))) - (1/(b*d*sqrt(sec(c + d*x))))*(2*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))]
    @test_int [sec(c + d*x)^(-1/2)*(A + B*cos(c + d*x))/sqrt(a + b*cos(c + d*x)), x, 8, -(((a - b)*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*b*d*sqrt(sec(c + d*x)))) + (sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(2*A*b - a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^2*d*sqrt(sec(c + d*x))) + (B*sin(c + d*x))/(d*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))) + (a*B*sqrt(sec(c + d*x))*sin(c + d*x))/(b*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^(-3/2)*(A + B*cos(c + d*x))/sqrt(a + b*cos(c + d*x)), x, 8, -(((a - b)*sqrt(a + b)*(4*A*b - 3*a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*a*b^2*d*sqrt(sec(c + d*x)))) + (sqrt(a + b)*(4*A*b - 3*a*B + 2*b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*b^2*d*sqrt(sec(c + d*x))) + (sqrt(a + b)*(4*a*A*b - 3*a^2*B - 4*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(4*b^3*d*sqrt(sec(c + d*x))) + (B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*b*d*sqrt(sec(c + d*x))) + ((4*A*b - 3*a*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*b^2*d)]

    @test_int [(A + B*cos(c + d*x))*sec(c + d*x)^(5/2)/(a + b*cos(c + d*x))^(3/2), x, 6, -((2*(5*a^2*A*b - 8*A*b^3 - 3*a^3*B + 6*a*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^4*sqrt(a + b)*d*sqrt(sec(c + d*x)))) + (2*(a + 2*b)*(4*A*b + a*(A - 3*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^3*sqrt(a + b)*d*sqrt(sec(c + d*x))) + (2*b*(A*b - a*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (2*(a^2*A - 4*A*b^2 + 3*a*b*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d)]
    @test_int [(A + B*cos(c + d*x))*sec(c + d*x)^(3/2)/(a + b*cos(c + d*x))^(3/2), x, 5, (2*(a^2*A - 2*A*b^2 + a*b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a^3*sqrt(a + b)*d*sqrt(sec(c + d*x))) - (2*(2*A*b + a*(A - B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a^2*sqrt(a + b)*d*sqrt(sec(c + d*x))) + (2*b*(A*b - a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))*sec(c + d*x)^(1/2)/(a + b*cos(c + d*x))^(3/2), x, 5, (2*(A*b - a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a^2*sqrt(a + b)*d*sqrt(sec(c + d*x))) + (2*(A + B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*sqrt(a + b)*d*sqrt(sec(c + d*x))) - (2*(A*b - a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/((a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/(sec(c + d*x)^(1/2)*(a + b*cos(c + d*x))^(3/2)), x, 7, -((2*(A*b - a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*b*sqrt(a + b)*d*sqrt(sec(c + d*x)))) + (2*(A*b - a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*b*sqrt(a + b)*d*sqrt(sec(c + d*x))) - (2*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^2*d*sqrt(sec(c + d*x))) + (2*a*(A*b - a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/(sec(c + d*x)^(3/2)*(a + b*cos(c + d*x))^(3/2)), x, 8, ((2*a*A*b - 3*a^2*B + b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*b^2*sqrt(a + b)*d*sqrt(sec(c + d*x))) - ((2*A*b - (3*a + b)*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^2*sqrt(a + b)*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(2*A*b - 3*a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^3*d*sqrt(sec(c + d*x))) + (2*a*(A*b - a*B)*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))) - ((2*a*A*b - 3*a^2*B + b^2*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(b^2*(a^2 - b^2)*d)]

    @test_int [(A + B*cos(c + d*x))*sec(c + d*x)^(5/2)/(a + b*cos(c + d*x))^(5/2), x, 7, -((2*(8*a^4*A*b - 28*a^2*A*b^3 + 16*A*b^5 - 3*a^5*B + 15*a^3*b^2*B - 8*a*b^4*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^5*(a - b)*(a + b)^(3/2)*d*sqrt(sec(c + d*x)))) - (2*(16*A*b^4 - a^4*(A - 3*B) + 4*a*b^3*(3*A - 2*B) - 9*a^3*b*(A - B) - 2*a^2*b^2*(8*A + 3*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^4*sqrt(a + b)*(a^2 - b^2)*d*sqrt(sec(c + d*x))) + (2*b*(A*b - a*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*b*(10*a^2*A*b - 6*A*b^3 - 7*a^3*B + 3*a*b^2*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) + (2*(a^4*A - 13*a^2*A*b^2 + 8*A*b^4 + 8*a^3*b*B - 4*a*b^3*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a^3*(a^2 - b^2)^2*d)]
    @test_int [(A + B*cos(c + d*x))*sec(c + d*x)^(3/2)/(a + b*cos(c + d*x))^(5/2), x, 6, (2*(3*a^4*A - 15*a^2*A*b^2 + 8*A*b^4 + 6*a^3*b*B - 2*a*b^3*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^4*(a - b)*(a + b)^(3/2)*d*sqrt(sec(c + d*x))) + (2*(8*A*b^3 - 3*a^3*(A - B) + 2*a*b^2*(3*A - B) - 3*a^2*b*(3*A + B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^3*sqrt(a + b)*(a^2 - b^2)*d*sqrt(sec(c + d*x))) + (2*b*(A*b - a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*b*(8*a^2*A*b - 4*A*b^3 - 5*a^3*B + a*b^2*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*a^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))*sec(c + d*x)^(1/2)/(a + b*cos(c + d*x))^(5/2), x, 6, (2*(6*a^2*A*b - 2*A*b^3 - 3*a^3*B - a*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^3*(a - b)*(a + b)^(3/2)*d*sqrt(sec(c + d*x))) - (2*(2*A*b^2 - 3*a^2*(A + B) + a*b*(3*A + B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^2*sqrt(a + b)*(a^2 - b^2)*d*sqrt(sec(c + d*x))) + (2*b*(A*b - a*B)*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))) - (2*(6*a^2*A*b - 2*A*b^3 - 3*a^3*B - a*b^2*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*a*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^(1/2)), x, 6, -((2*(3*a^2*A + A*b^2 - 4*a*b*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a^2*(a - b)*(a + b)^(3/2)*d*sqrt(sec(c + d*x)))) + (2*(a*(3*A + B) - b*(A + 3*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*(a - b)*(a + b)^(3/2)*d*sqrt(sec(c + d*x))) - (2*(A*b - a*B)*sin(c + d*x))/(3*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))) + (2*(3*a^2*A + A*b^2 - 4*a*b*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)), x, 8, (2*(4*A*b^3 + 3*a^3*B - 7*a*b^2*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*(a - b)*b^2*(a + b)^(3/2)*d*sqrt(sec(c + d*x))) - (2*(3*A*b^3 + 3*a^3*B + a^2*b*B - a*b^2*(A + 6*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*(a - b)*b^2*(a + b)^(3/2)*d*sqrt(sec(c + d*x))) - (2*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^3*d*sqrt(sec(c + d*x))) + (2*a*(A*b - a*B)*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))) - (2*a*(4*A*b^3 + 3*a^3*B - 7*a*b^2*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*b^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x))/((a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^(5/2)), x, 9, ((6*a^3*A*b - 14*a*A*b^3 - 15*a^4*B + 26*a^2*b^2*B - 3*b^4*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*a*(a - b)*b^3*(a + b)^(3/2)*d*sqrt(sec(c + d*x))) + ((3*b^3*(4*A - B) + 15*a^3*B - a*b^2*(2*A + 21*B) - a^2*(6*A*b - 5*b*B))*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(3*(a - b)*b^3*(a + b)^(3/2)*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(2*A*b - 5*a*B)*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^4*d*sqrt(sec(c + d*x))) + (2*a*(A*b - a*B)*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)) + (2*a*(2*a^2*A*b - 6*A*b^3 - 5*a^3*B + 9*a*b^2*B)*sin(c + d*x))/(3*b^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))) - ((6*a^3*A*b - 14*a*A*b^3 - 15*a^4*B + 26*a^2*b^2*B - 3*b^4*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(3*b^3*(a^2 - b^2)^2*d)]

    @test_int [(a*B + b*B*cos(c + d*x))*sec(c + d*x)^(3/2)/(a + b*cos(c + d*x))^(3/2), x, 5, (2*(a - b)*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a^2*d*sqrt(sec(c + d*x))) - (2*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d*sqrt(sec(c + d*x)))]
    @test_int [(a*B + b*B*cos(c + d*x))*sec(c + d*x)^(1/2)/(a + b*cos(c + d*x))^(3/2), x, 3, (2*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*d*sqrt(sec(c + d*x)))]
    @test_int [(a*B + b*B*cos(c + d*x))/(sec(c + d*x)^(1/2)*(a + b*cos(c + d*x))^(3/2)), x, 3, -((2*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b*d*sqrt(sec(c + d*x))))]
    @test_int [(a*B + b*B*cos(c + d*x))/(sec(c + d*x)^(3/2)*(a + b*cos(c + d*x))^(3/2)), x, 10, -(((a - b)*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.E(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(a*b*d*sqrt(sec(c + d*x)))) + (sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.F(asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b*d*sqrt(sec(c + d*x))) + (a*sqrt(a + b)*B*sqrt(cos(c + d*x))*csc(c + d*x)*Elliptic.Pi((a + b)/b, asin(sqrt(a + b*cos(c + d*x))/(sqrt(a + b)*sqrt(cos(c + d*x)))), -((a + b)/(a - b)))*sqrt((a*(1 - sec(c + d*x)))/(a + b))*sqrt((a*(1 + sec(c + d*x)))/(a - b)))/(b^2*d*sqrt(sec(c + d*x))) + (B*sin(c + d*x))/(d*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))) + (a*B*sqrt(sec(c + d*x))*sin(c + d*x))/(b*d*sqrt(a + b*cos(c + d*x)))]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(c*sec(e+f*x))^m*(a+b*cos(e+f*x))^n*(A+B*cos(e+f*x))*with*m*and/or*n*symbolic=#

    @test_int [(c*sec(e + f*x))^m*(a + b*cos(e + f*x))^n*(A + B*cos(e + f*x)), x, 1, (c*cos(e + f*x))^m*(c*sec(e + f*x))^m*Unintegrable(((a + b*cos(e + f*x))^n*(A + B*cos(e + f*x)))/(c*cos(e + f*x))^m, x)]

    @test_int [(c*sec(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^4, x, 10, If(13>=8, -((c^6*(4*a^3*A*b*(15 - 8*m + m^2) + a^4*B*(15 - 8*m + m^2) + 4*a*A*b^3*(10 - 7*m + m^2) + 6*a^2*b^2*B*(10 - 7*m + m^2) + b^4*B*(8 - 6*m + m^2))*HypergeometricFunctions._₂F₁(1/2, (6 - m)/2, (8 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-6 + m)*sin(e + f*x))/(f*(2 - m)*(4 - m)*(6 - m)*sqrt(sin(e + f*x)^2))) - (c^5*(a^4*A*(8 - 6*m + m^2) + 6*a^2*A*b^2*(4 - 5*m + m^2) + 4*a^3*b*B*(4 - 5*m + m^2) + A*b^4*(3 - 4*m + m^2) + 4*a*b^3*B*(3 - 4*m + m^2))*HypergeometricFunctions._₂F₁(1/2, (5 - m)/2, (7 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-5 + m)*sin(e + f*x))/(f*(1 - m)*(3 - m)*(5 - m)*sqrt(sin(e + f*x)^2)) - (a*c^5*(4*a^2*A*b*(3 - 4*m + m^2) + a^3*B*(3 - 4*m + m^2) + 2*A*b^3*(4 - 2*m + m^2) + a*b^2*B*(8 - 13*m + 5*m^2))*(c*sec(e + f*x))^(-5 + m)*tan(e + f*x))/(f*(1 - m)*(2 - m)*(4 - m)) - (a^2*c^5*(2*a*b*B*(1 - m)^2 + a^2*A*(2 - m)^2 + A*b^2*(6 - m + m^2))*sec(e + f*x)*(c*sec(e + f*x))^(-5 + m)*tan(e + f*x))/(f*(1 - m)*(2 - m)*(3 - m)) - (a*c^5*(a*B*(1 - m) - A*b*(2 + m))*(c*sec(e + f*x))^(-5 + m)*(b + a*sec(e + f*x))^2*tan(e + f*x))/(f*(1 - m)*(2 - m)) - (a*A*c^5*(c*sec(e + f*x))^(-5 + m)*(b + a*sec(e + f*x))^3*tan(e + f*x))/(f*(1 - m)), -((c^6*(4*a^3*A*b*(15 - 8*m + m^2) + a^4*B*(15 - 8*m + m^2) + 4*a*A*b^3*(10 - 7*m + m^2) + 6*a^2*b^2*B*(10 - 7*m + m^2) + b^4*B*(8 - 6*m + m^2))*HypergeometricFunctions._₂F₁(1/2, (6 - m)/2, (8 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-6 + m)*sin(e + f*x))/(f*(48 - 44*m + 12*m^2 - m^3)*sqrt(sin(e + f*x)^2))) - (c^5*(a^4*A*(8 - 6*m + m^2) + 6*a^2*A*b^2*(4 - 5*m + m^2) + 4*a^3*b*B*(4 - 5*m + m^2) + A*b^4*(3 - 4*m + m^2) + 4*a*b^3*B*(3 - 4*m + m^2))*HypergeometricFunctions._₂F₁(1/2, (5 - m)/2, (7 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-5 + m)*sin(e + f*x))/(f*(1 - m)*(15 - 8*m + m^2)*sqrt(sin(e + f*x)^2)) - (a*c^5*(4*a^2*A*b*(3 - 4*m + m^2) + a^3*B*(3 - 4*m + m^2) + 2*A*b^3*(4 - 2*m + m^2) + a*b^2*B*(8 - 13*m + 5*m^2))*(c*sec(e + f*x))^(-5 + m)*tan(e + f*x))/(f*(1 - m)*(8 - 6*m + m^2)) - (a^2*c^5*(2*a*b*B*(1 - m)^2 + a^2*A*(2 - m)^2 + A*b^2*(6 - m + m^2))*sec(e + f*x)*(c*sec(e + f*x))^(-5 + m)*tan(e + f*x))/(f*(6 - 11*m + 6*m^2 - m^3)) - (a*c^5*(a*B*(1 - m) - A*b*(2 + m))*(c*sec(e + f*x))^(-5 + m)*(b + a*sec(e + f*x))^2*tan(e + f*x))/(f*(2 - 3*m + m^2)) - (a*A*c^5*(c*sec(e + f*x))^(-5 + m)*(b + a*sec(e + f*x))^3*tan(e + f*x))/(f*(1 - m)))]
    @test_int [(c*sec(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^3, x, 9, If(13>=8, -((c^5*(a^3*A*(8 - 6*m + m^2) + 3*a*A*b^2*(4 - 5*m + m^2) + 3*a^2*b*B*(4 - 5*m + m^2) + b^3*B*(3 - 4*m + m^2))*HypergeometricFunctions._₂F₁(1/2, (5 - m)/2, (7 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-5 + m)*sin(e + f*x))/(f*(1 - m)*(3 - m)*(5 - m)*sqrt(sin(e + f*x)^2))) - (c^4*(A*b^3*(2 - m) + 3*a*b^2*B*(2 - m) + 3*a^2*A*b*(3 - m) + a^3*B*(3 - m))*HypergeometricFunctions._₂F₁(1/2, (4 - m)/2, (6 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-4 + m)*sin(e + f*x))/(f*(2 - m)*(4 - m)*sqrt(sin(e + f*x)^2)) - (a*c^4*(3*a*b*B*(1 - m) + a^2*A*(2 - m) - 2*A*b^2*m)*(c*sec(e + f*x))^(-4 + m)*tan(e + f*x))/(f*(1 - m)*(3 - m)) - (a^2*c^4*(a*B*(1 - m) - A*b*(1 + m))*sec(e + f*x)*(c*sec(e + f*x))^(-4 + m)*tan(e + f*x))/(f*(1 - m)*(2 - m)) - (a*A*c^4*(c*sec(e + f*x))^(-4 + m)*(b + a*sec(e + f*x))^2*tan(e + f*x))/(f*(1 - m)), -((c^5*(a^3*A*(8 - 6*m + m^2) + 3*a*A*b^2*(4 - 5*m + m^2) + 3*a^2*b*B*(4 - 5*m + m^2) + b^3*B*(3 - 4*m + m^2))*HypergeometricFunctions._₂F₁(1/2, (5 - m)/2, (7 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-5 + m)*sin(e + f*x))/(f*(1 - m)*(15 - 8*m + m^2)*sqrt(sin(e + f*x)^2))) - (c^4*(A*b^3*(2 - m) + 3*a*b^2*B*(2 - m) + 3*a^2*A*b*(3 - m) + a^3*B*(3 - m))*HypergeometricFunctions._₂F₁(1/2, (4 - m)/2, (6 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-4 + m)*sin(e + f*x))/(f*(8 - 6*m + m^2)*sqrt(sin(e + f*x)^2)) - (a*c^4*(3*a*b*B*(1 - m) + a^2*A*(2 - m) - 2*A*b^2*m)*(c*sec(e + f*x))^(-4 + m)*tan(e + f*x))/(f*(3 - 4*m + m^2)) - (a^2*c^4*(a*B*(1 - m) - A*b*(1 + m))*sec(e + f*x)*(c*sec(e + f*x))^(-4 + m)*tan(e + f*x))/(f*(2 - 3*m + m^2)) - (a*A*c^4*(c*sec(e + f*x))^(-4 + m)*(b + a*sec(e + f*x))^2*tan(e + f*x))/(f*(1 - m)))]
    @test_int [(c*sec(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^2, x, 8, If(13>=8, -((c^4*(b^2*B*(2 - m) + 2*a*A*b*(3 - m) + a^2*B*(3 - m))*HypergeometricFunctions._₂F₁(1/2, (4 - m)/2, (6 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-4 + m)*sin(e + f*x))/(f*(2 - m)*(4 - m)*sqrt(sin(e + f*x)^2))) - (c^3*(A*b^2*(1 - m) + 2*a*b*B*(1 - m) + a^2*A*(2 - m))*HypergeometricFunctions._₂F₁(1/2, (3 - m)/2, (5 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-3 + m)*sin(e + f*x))/(f*(1 - m)*(3 - m)*sqrt(sin(e + f*x)^2)) - (a*c^3*(a*B*(1 - m) - A*b*m)*(c*sec(e + f*x))^(-3 + m)*tan(e + f*x))/(f*(1 - m)*(2 - m)) - (a*A*c^3*(c*sec(e + f*x))^(-3 + m)*(b + a*sec(e + f*x))*tan(e + f*x))/(f*(1 - m)), -((c^4*(b^2*B*(2 - m) + 2*a*A*b*(3 - m) + a^2*B*(3 - m))*HypergeometricFunctions._₂F₁(1/2, (4 - m)/2, (6 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-4 + m)*sin(e + f*x))/(f*(8 - 6*m + m^2)*sqrt(sin(e + f*x)^2))) - (c^3*(A*b^2*(1 - m) + 2*a*b*B*(1 - m) + a^2*A*(2 - m))*HypergeometricFunctions._₂F₁(1/2, (3 - m)/2, (5 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-3 + m)*sin(e + f*x))/(f*(3 - 4*m + m^2)*sqrt(sin(e + f*x)^2)) - (a*c^3*(a*B*(1 - m) - A*b*m)*(c*sec(e + f*x))^(-3 + m)*tan(e + f*x))/(f*(2 - 3*m + m^2)) - (a*A*c^3*(c*sec(e + f*x))^(-3 + m)*(b + a*sec(e + f*x))*tan(e + f*x))/(f*(1 - m)))]
    @test_int [(c*sec(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^1, x, 7, If(13>=8, -((c^3*(b*B*(1 - m) + a*A*(2 - m))*HypergeometricFunctions._₂F₁(1/2, (3 - m)/2, (5 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-3 + m)*sin(e + f*x))/(f*(1 - m)*(3 - m)*sqrt(sin(e + f*x)^2))) - ((A*b + a*B)*c^2*HypergeometricFunctions._₂F₁(1/2, (2 - m)/2, (4 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-2 + m)*sin(e + f*x))/(f*(2 - m)*sqrt(sin(e + f*x)^2)) - (a*A*c^2*(c*sec(e + f*x))^(-2 + m)*tan(e + f*x))/(f*(1 - m)), -((c^3*(b*B*(1 - m) + a*A*(2 - m))*HypergeometricFunctions._₂F₁(1/2, (3 - m)/2, (5 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-3 + m)*sin(e + f*x))/(f*(3 - 4*m + m^2)*sqrt(sin(e + f*x)^2))) - ((A*b + a*B)*c^2*HypergeometricFunctions._₂F₁(1/2, (2 - m)/2, (4 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-2 + m)*sin(e + f*x))/(f*(2 - m)*sqrt(sin(e + f*x)^2)) - (a*A*c^2*(c*sec(e + f*x))^(-2 + m)*tan(e + f*x))/(f*(1 - m)))]
    @test_int [(c*sec(e + f*x))^m*(A + B*cos(e + f*x))/(a + b*cos(e + f*x))^1, x, 10, -(((A*b - a*B)*AppellF1(1/2, m/2, 1, 3/2, sin(e + f*x)^2, -((b^2*sin(e + f*x)^2)/(a^2 - b^2)))*cos(e + f*x)*(cos(e + f*x)^2)^(m/2)*(c*sec(e + f*x))^(1 + m)*sin(e + f*x))/((a^2 - b^2)*c*f)) + (a*(A*b - a*B)*AppellF1(1/2, (1 + m)/2, 1, 3/2, sin(e + f*x)^2, -((b^2*sin(e + f*x)^2)/(a^2 - b^2)))*(cos(e + f*x)^2)^((1 + m)/2)*(c*sec(e + f*x))^(1 + m)*sin(e + f*x))/(b*(a^2 - b^2)*c*f) - (B*c*HypergeometricFunctions._₂F₁(1/2, (1 - m)/2, (3 - m)/2, cos(e + f*x)^2)*(c*sec(e + f*x))^(-1 + m)*sin(e + f*x))/(b*f*(1 - m)*sqrt(sin(e + f*x)^2))]

    @test_int [(c*sec(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^(3/2), x, 2, (2*b*B*cos(e + f*x)*sqrt(a + b*cos(e + f*x))*(c*sec(e + f*x))^m*sin(e + f*x))/(f*(5 - 2*m)) + (2*(c*cos(e + f*x))^m*(c*sec(e + f*x))^m*Unintegrable(((1/2)*a*c*(2*b*B*(1 - m) + 2*a*A*(5/2 - m)) + (1/2)*c*(b^2*B*(3 - 2*m) + a*(2*A*b + a*B)*(5 - 2*m))*cos(e + f*x) + (1/2)*b*c*(A*b*(5 - 2*m) + 2*a*B*(3 - m))*cos(e + f*x)^2)/((c*cos(e + f*x))^m*sqrt(a + b*cos(e + f*x))), x))/(c*(5 - 2*m))]
    @test_int [(c*sec(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^(1/2), x, 1, (c*cos(e + f*x))^m*(c*sec(e + f*x))^m*Unintegrable((sqrt(a + b*cos(e + f*x))*(A + B*cos(e + f*x)))/(c*cos(e + f*x))^m, x)]
    @test_int [(c*sec(e + f*x))^m*(A + B*cos(e + f*x))/(a + b*cos(e + f*x))^(1/2), x, 1, (c*cos(e + f*x))^m*(c*sec(e + f*x))^m*Unintegrable((A + B*cos(e + f*x))/((c*cos(e + f*x))^m*sqrt(a + b*cos(e + f*x))), x)]
    @test_int [(c*sec(e + f*x))^m*(A + B*cos(e + f*x))/(a + b*cos(e + f*x))^(3/2), x, 2, (2*b*(A*b - a*B)*cos(e + f*x)*(c*sec(e + f*x))^m*sin(e + f*x))/(a*(a^2 - b^2)*f*sqrt(a + b*cos(e + f*x))) + (2*(c*cos(e + f*x))^m*(c*sec(e + f*x))^m*Unintegrable(((1/2)*c*(a^2*A + A*b^2*(1 - 2*m) - 2*a*b*B*(1 - m)) - (1/2)*a*(A*b - a*B)*c*cos(e + f*x) - (1/2)*b*(A*b - a*B)*c*(3 - 2*m)*cos(e + f*x)^2)/((c*cos(e + f*x))^m*sqrt(a + b*cos(e + f*x))), x))/(a*(a^2 - b^2)*c)]

    #= ::Title::Closed:: =#
    #=Integrands*of*the*form*(a+b*cos(e+f*x))^m*(c+d*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Section:: =#
    #=Integrands*of*the*form*(a+a*cos(e+f*x))^m*(c-c*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Section:: =#
    #=Integrands*of*the*form*(a+a*cos(e+f*x))^m*(c+d*cos(e+f*x))^n*(A+B*cos(e+f*x))=#

    #= ::Section:: =#
    #=Integrands*of*the*form*(a+b*cos(e+f*x))^m*(c+d*cos(e+f*x))^n*(A+B*cos(e+f*x))=#
    end

max_stars_repo_path: test/4 Trig functions/4.2 Cosine/4.2.3.1 (a+b cos)^m (c+d cos)^n (A+B cos).jl