text:
@testset "4.2.4.2 (a+b cos)^m (c+d cos)^n (A+B cos+C cos^2)" begin
    (A, B, C, a, b, c, d, m, x, ) = @variables A B C a b c d m x

    #= ::Package:: =#

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

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

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

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

    @test_int [cos(c + d*x)^2*(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 7, (1/8)*a*(4*A + 3*C)*x + (a*(5*A + 4*C)*sin(c + d*x))/(5*d) + (a*(4*A + 3*C)*cos(c + d*x)*sin(c + d*x))/(8*d) + (a*C*cos(c + d*x)^3*sin(c + d*x))/(4*d) + (a*C*cos(c + d*x)^4*sin(c + d*x))/(5*d) - (a*(5*A + 4*C)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)*(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 3, (1/8)*a*(4*A + 3*C)*x + (a*(3*A + 2*C)*sin(c + d*x))/(3*d) + (a*(4*A + 3*C)*cos(c + d*x)*sin(c + d*x))/(8*d) + (a*C*cos(c + d*x)^2*sin(c + d*x))/(3*d) + (a*C*cos(c + d*x)^3*sin(c + d*x))/(4*d)]
    @test_int [(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 2, (a*(2*A + C)*x)/2 + (a*(3*A + C)*sin(c + d*x))/(3*d) - (a*C*cos(c + d*x)*sin(c + d*x))/(6*d) + (C*(a + a*cos(c + d*x))^2*sin(c + d*x))/(3*a*d)]
    @test_int [(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x), x, 4, (1/2)*a*(2*A + C)*x + (a*A*atanh(sin(c + d*x)))/d + (a*C*sin(c + d*x))/d + (a*C*cos(c + d*x)*sin(c + d*x))/(2*d)]
    @test_int [(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 4, a*C*x + (a*A*atanh(sin(c + d*x)))/d + (a*C*sin(c + d*x))/d + (a*A*tan(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 4, a*C*x + (a*(A + 2*C)*atanh(sin(c + d*x)))/(2*d) + (a*A*tan(c + d*x))/d + (a*A*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 6, (a*(A + 2*C)*atanh(sin(c + d*x)))/(2*d) + (a*(2*A + 3*C)*tan(c + d*x))/(3*d) + (a*A*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 [(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 7, (a*(3*A + 4*C)*atanh(sin(c + d*x)))/(8*d) + (a*(2*A + 3*C)*tan(c + d*x))/(3*d) + (a*(3*A + 4*C)*sec(c + d*x)*tan(c + d*x))/(8*d) + (a*A*sec(c + d*x)^2*tan(c + d*x))/(3*d) + (a*A*sec(c + d*x)^3*tan(c + d*x))/(4*d)]

    @test_int [cos(c + d*x)^2*(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2), x, 9, (1/16)*a^2*(14*A + 11*C)*x + (2*a^2*(5*A + 4*C)*sin(c + d*x))/(5*d) + (a^2*(14*A + 11*C)*cos(c + d*x)*sin(c + d*x))/(16*d) + (a^2*(10*A + 9*C)*cos(c + d*x)^3*sin(c + d*x))/(40*d) + (C*cos(c + d*x)^3*(a + a*cos(c + d*x))^2*sin(c + d*x))/(6*d) + (C*cos(c + d*x)^3*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(15*d) - (2*a^2*(5*A + 4*C)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^1*(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2), x, 5, (a^2*(4*A + 3*C)*x)/4 + (a^2*(4*A + 3*C)*sin(c + d*x))/(3*d) + (a^2*(4*A + 3*C)*cos(c + d*x)*sin(c + d*x))/(12*d) + ((10*A + 3*C)*(a + a*cos(c + d*x))^2*sin(c + d*x))/(30*d) + (C*cos(c + d*x)^2*(a + a*cos(c + d*x))^2*sin(c + d*x))/(5*d) + (C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(10*a*d)]
    @test_int [cos(c + d*x)^0*(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2), x, 3, (a^2*(12*A + 7*C)*x)/8 + (a^2*(12*A + 7*C)*sin(c + d*x))/(6*d) + (a^2*(12*A + 7*C)*cos(c + d*x)*sin(c + d*x))/(24*d) - (C*(a + a*cos(c + d*x))^2*sin(c + d*x))/(12*d) + (C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(4*a*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^1, x, 6, a^2*(2*A + C)*x + (a^2*A*atanh(sin(c + d*x)))/d + (a^2*(A + C)*sin(c + d*x))/d + (C*(a + a*cos(c + d*x))^2*sin(c + d*x))/(3*d) + (C*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 6, (a^2*(2*A + 3*C)*x)/2 + (2*a^2*A*atanh(sin(c + d*x)))/d - (a^2*(2*A - 3*C)*sin(c + d*x))/(2*d) - ((2*A - C)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(2*d) + (A*(a + a*cos(c + d*x))^2*tan(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 6, 2*a^2*C*x + (a^2*(3*A + 2*C)*atanh(sin(c + d*x)))/(2*d) - (a^2*(3*A - 2*C)*sin(c + d*x))/(2*d) + (A*(a^2 + a^2*cos(c + d*x))*tan(c + d*x))/d + (A*(a + a*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 6, a^2*C*x + (a^2*(A + 2*C)*atanh(sin(c + d*x)))/d + (a^2*(A + C)*tan(c + d*x))/d + (A*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(3*d) + (A*(a + a*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 8, (a^2*(7*A + 12*C)*atanh(sin(c + d*x)))/(8*d) + (2*a^2*(2*A + 3*C)*tan(c + d*x))/(3*d) + (a^2*(11*A + 12*C)*sec(c + d*x)*tan(c + d*x))/(24*d) + (A*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(6*d) + (A*(a + a*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^6, x, 9, (a^2*(3*A + 4*C)*atanh(sin(c + d*x)))/(4*d) + (a^2*(18*A + 25*C)*tan(c + d*x))/(15*d) + (a^2*(3*A + 4*C)*sec(c + d*x)*tan(c + d*x))/(4*d) + (a^2*(9*A + 10*C)*sec(c + d*x)^2*tan(c + d*x))/(30*d) + (A*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(10*d) + (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 + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2), x, 10, (1/16)*a^3*(26*A + 21*C)*x + (a^3*(133*A + 108*C)*sin(c + d*x))/(35*d) + (a^3*(26*A + 21*C)*cos(c + d*x)*sin(c + d*x))/(16*d) + (a^3*(154*A + 129*C)*cos(c + d*x)^3*sin(c + d*x))/(280*d) + (C*cos(c + d*x)^3*(a + a*cos(c + d*x))^3*sin(c + d*x))/(7*d) + (C*cos(c + d*x)^3*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(14*a*d) + ((A + C)*cos(c + d*x)^3*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(5*d) - (a^3*(133*A + 108*C)*sin(c + d*x)^3)/(105*d)]
    @test_int [cos(c + d*x)^1*(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2), x, 11, (1/16)*a^3*(30*A + 23*C)*x + (a^3*(30*A + 23*C)*sin(c + d*x))/(10*d) + (3*a^3*(30*A + 23*C)*cos(c + d*x)*sin(c + d*x))/(80*d) + ((30*A + 7*C)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(120*d) + (C*cos(c + d*x)^2*(a + a*cos(c + d*x))^3*sin(c + d*x))/(6*d) + (C*(a + a*cos(c + d*x))^4*sin(c + d*x))/(10*a*d) - (a^3*(30*A + 23*C)*sin(c + d*x)^3)/(120*d)]
    @test_int [cos(c + d*x)^0*(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2), x, 9, (1/8)*a^3*(20*A + 13*C)*x + (a^3*(20*A + 13*C)*sin(c + d*x))/(5*d) + (3*a^3*(20*A + 13*C)*cos(c + d*x)*sin(c + d*x))/(40*d) - (C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(20*d) + (C*(a + a*cos(c + d*x))^4*sin(c + d*x))/(5*a*d) - (a^3*(20*A + 13*C)*sin(c + d*x)^3)/(60*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^1, x, 7, (a^3*(28*A + 15*C)*x)/8 + (a^3*A*atanh(sin(c + d*x)))/d + (5*a^3*(4*A + 3*C)*sin(c + d*x))/(8*d) + (C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(4*d) + (C*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(4*a*d) + ((4*A + 5*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(8*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 7, (a^3*(6*A + 5*C)*x)/2 + (3*a^3*A*atanh(sin(c + d*x)))/d + (5*a^3*C*sin(c + d*x))/(2*d) - ((3*A - C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(3*a*d) - ((6*A - 5*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(6*d) + (A*(a + a*cos(c + d*x))^3*tan(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 7, (a^3*(2*A + 7*C)*x)/2 + (a^3*(7*A + 2*C)*atanh(sin(c + d*x)))/(2*d) - (5*a^3*(A - C)*sin(c + d*x))/(2*d) - ((4*A - C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(2*d) + (3*A*(a^2 + a^2*cos(c + d*x))^2*tan(c + d*x))/(2*a*d) + (A*(a + a*cos(c + d*x))^3*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 7, 3*a^3*C*x + (a^3*(5*A + 6*C)*atanh(sin(c + d*x)))/(2*d) - (5*a^3*A*sin(c + d*x))/(2*d) + ((5*A + 3*C)*(a^3 + a^3*cos(c + d*x))*tan(c + d*x))/(3*d) + (A*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(2*a*d) + (A*(a + a*cos(c + d*x))^3*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 7, a^3*C*x + (a^3*(15*A + 28*C)*atanh(sin(c + d*x)))/(8*d) + (5*a^3*(3*A + 4*C)*tan(c + d*x))/(8*d) + ((5*A + 4*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(8*d) + (A*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(4*a*d) + (A*(a + a*cos(c + d*x))^3*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^6, x, 9, (a^3*(13*A + 20*C)*atanh(sin(c + d*x)))/(8*d) + (a^3*(38*A + 55*C)*tan(c + d*x))/(15*d) + (a^3*(109*A + 140*C)*sec(c + d*x)*tan(c + d*x))/(120*d) + ((11*A + 10*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(30*d) + (3*A*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(20*a*d) + (A*(a + a*cos(c + d*x))^3*sec(c + d*x)^4*tan(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^7, x, 10, (a^3*(23*A + 30*C)*atanh(sin(c + d*x)))/(16*d) + (a^3*(34*A + 45*C)*tan(c + d*x))/(15*d) + (a^3*(23*A + 30*C)*sec(c + d*x)*tan(c + d*x))/(16*d) + (a^3*(73*A + 90*C)*sec(c + d*x)^2*tan(c + d*x))/(120*d) + ((31*A + 30*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(120*d) + (A*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^4*tan(c + d*x))/(10*a*d) + (A*(a + a*cos(c + d*x))^3*sec(c + d*x)^5*tan(c + d*x))/(6*d)]

    @test_int [cos(c + d*x)^2*(a + a*cos(c + d*x))^4*(A + C*cos(c + d*x)^2), x, 11, (1/128)*a^4*(392*A + 323*C)*x + (4*a^4*(63*A + 52*C)*sin(c + d*x))/(35*d) + (a^4*(392*A + 323*C)*cos(c + d*x)*sin(c + d*x))/(128*d) + (a^4*(2408*A + 2007*C)*cos(c + d*x)^3*sin(c + d*x))/(2240*d) + (a*C*cos(c + d*x)^3*(a + a*cos(c + d*x))^3*sin(c + d*x))/(14*d) + (C*cos(c + d*x)^3*(a + a*cos(c + d*x))^4*sin(c + d*x))/(8*d) + ((56*A + 61*C)*cos(c + d*x)^3*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(336*d) + (7*(8*A + 7*C)*cos(c + d*x)^3*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(120*d) - (4*a^4*(63*A + 52*C)*sin(c + d*x)^3)/(105*d)]
    @test_int [cos(c + d*x)^1*(a + a*cos(c + d*x))^4*(A + C*cos(c + d*x)^2), x, 14, (1/4)*a^4*(14*A + 11*C)*x + (16*a^4*(14*A + 11*C)*sin(c + d*x))/(35*d) + (27*a^4*(14*A + 11*C)*cos(c + d*x)*sin(c + d*x))/(140*d) + (a^4*(14*A + 11*C)*cos(c + d*x)^3*sin(c + d*x))/(70*d) + ((21*A + 4*C)*(a + a*cos(c + d*x))^4*sin(c + d*x))/(105*d) + (C*cos(c + d*x)^2*(a + a*cos(c + d*x))^4*sin(c + d*x))/(7*d) + (2*C*(a + a*cos(c + d*x))^5*sin(c + d*x))/(21*a*d) - (8*a^4*(14*A + 11*C)*sin(c + d*x)^3)/(105*d)]
    @test_int [cos(c + d*x)^0*(a + a*cos(c + d*x))^4*(A + C*cos(c + d*x)^2), x, 12, (7/16)*a^4*(10*A + 7*C)*x + (4*a^4*(10*A + 7*C)*sin(c + d*x))/(5*d) + (27*a^4*(10*A + 7*C)*cos(c + d*x)*sin(c + d*x))/(80*d) + (a^4*(10*A + 7*C)*cos(c + d*x)^3*sin(c + d*x))/(40*d) - (C*(a + a*cos(c + d*x))^4*sin(c + d*x))/(30*d) + (C*(a + a*cos(c + d*x))^5*sin(c + d*x))/(6*a*d) - (2*a^4*(10*A + 7*C)*sin(c + d*x)^3)/(15*d)]
    @test_int [(a + a*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^1, x, 8, (a^4*(12*A + 7*C)*x)/2 + (a^4*A*atanh(sin(c + d*x)))/d + (a^4*(10*A + 7*C)*sin(c + d*x))/(2*d) + (a*C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(5*d) + (C*(a + a*cos(c + d*x))^4*sin(c + d*x))/(5*d) + ((5*A + 7*C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(15*d) + ((8*A + 7*C)*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(6*d)]
    @test_int [(a + a*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 8, (a^4*(52*A + 35*C)*x)/8 + (4*a^4*A*atanh(sin(c + d*x)))/d + (5*a^4*(4*A + 7*C)*sin(c + d*x))/(8*d) - (a*(4*A - C)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(4*d) - ((12*A - 7*C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(12*d) - ((12*A - 35*C)*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(24*d) + (A*(a + a*cos(c + d*x))^4*tan(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 8, 2*a^4*(2*A + 3*C)*x + (a^4*(13*A + 2*C)*atanh(sin(c + d*x)))/(2*d) - (5*a^4*(A - 2*C)*sin(c + d*x))/(2*d) - ((15*A - 2*C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(6*d) - ((9*A - 4*C)*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(3*d) + (2*a*A*(a + a*cos(c + d*x))^3*tan(c + d*x))/d + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + a*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 8, (a^4*(2*A + 13*C)*x)/2 + (2*a^4*(3*A + 2*C)*atanh(sin(c + d*x)))/d - (5*a^4*(2*A - C)*sin(c + d*x))/(2*d) - ((22*A + 3*C)*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(6*d) + ((8*A + 3*C)*(a^2 + a^2*cos(c + d*x))^2*tan(c + d*x))/(3*d) + (2*a*A*(a + a*cos(c + d*x))^3*sec(c + d*x)*tan(c + d*x))/(3*d) + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 8, 4*a^4*C*x + (a^4*(35*A + 52*C)*atanh(sin(c + d*x)))/(8*d) - (5*a^4*(7*A + 4*C)*sin(c + d*x))/(8*d) + ((35*A + 36*C)*(a^4 + a^4*cos(c + d*x))*tan(c + d*x))/(12*d) + ((7*A + 4*C)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(8*d) + (a*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^2*tan(c + d*x))/(3*d) + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [(a + a*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^6, x, 8, a^4*C*x + (a^4*(7*A + 12*C)*atanh(sin(c + d*x)))/(2*d) + (a^4*(7*A + 10*C)*tan(c + d*x))/(2*d) + ((7*A + 8*C)*(a^4 + a^4*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(6*d) + ((7*A + 5*C)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(15*d) + (a*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^3*tan(c + d*x))/(5*d) + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)^4*tan(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^7, x, 10, (7*a^4*(7*A + 10*C)*atanh(sin(c + d*x)))/(16*d) + (4*a^4*(18*A + 25*C)*tan(c + d*x))/(15*d) + (a^4*(417*A + 550*C)*sec(c + d*x)*tan(c + d*x))/(240*d) + ((43*A + 50*C)*(a^4 + a^4*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(60*d) + ((37*A + 30*C)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(120*d) + (2*a*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^4*tan(c + d*x))/(15*d) + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)^5*tan(c + d*x))/(6*d)]
    @test_int [(a + a*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^8, x, 11, (a^4*(11*A + 14*C)*atanh(sin(c + d*x)))/(4*d) + (a^4*(454*A + 581*C)*tan(c + d*x))/(105*d) + (a^4*(11*A + 14*C)*sec(c + d*x)*tan(c + d*x))/(4*d) + (a^4*(247*A + 308*C)*sec(c + d*x)^2*tan(c + d*x))/(210*d) + ((109*A + 126*C)*(a^4 + a^4*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(210*d) + ((8*A + 7*C)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^4*tan(c + d*x))/(35*d) + (2*a*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^5*tan(c + d*x))/(21*d) + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)^6*tan(c + d*x))/(7*d)]

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

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

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

    @test_int [(cos(c + d*x)^4*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 8, -(((6*A + 23*C)*x)/(2*a^3)) + (4*(9*A + 34*C)*sin(c + d*x))/(5*a^3*d) - ((6*A + 23*C)*cos(c + d*x)*sin(c + d*x))/(2*a^3*d) - ((A + C)*cos(c + d*x)^5*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((3*A + 13*C)*cos(c + d*x)^4*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((6*A + 23*C)*cos(c + d*x)^3*sin(c + d*x))/(3*d*(a^3 + a^3*cos(c + d*x))) - (4*(9*A + 34*C)*sin(c + d*x)^3)/(15*a^3*d)]
    @test_int [(cos(c + d*x)^3*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 4, ((2*A + 13*C)*x)/(2*a^3) - (2*(11*A + 76*C)*sin(c + d*x))/(15*a^3*d) + ((2*A + 13*C)*cos(c + d*x)*sin(c + d*x))/(2*a^3*d) - ((A + C)*cos(c + d*x)^4*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((A + 11*C)*cos(c + d*x)^3*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((11*A + 76*C)*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)^2*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 7, (-3*C*x)/a^3 + ((2*A + 27*C)*sin(c + d*x))/(15*a^3*d) - ((A + C)*cos(c + d*x)^3*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((A - 9*C)*cos(c + d*x)^2*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + (3*C*sin(c + d*x))/(d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(cos(c + d*x)*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 5, (C*x)/a^3 - ((A + C)*cos(c + d*x)^2*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((3*A - 7*C)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((6*A - 29*C)*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^3, x, 3, ((A + C)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + (2*(A - 4*C)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((2*A + 7*C)*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x))/(a + a*cos(c + d*x))^3, x, 5, (A*atanh(sin(c + d*x)))/(a^3*d) - ((A + C)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((7*A - 3*C)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((22*A - 3*C)*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^2)/(a + a*cos(c + d*x))^3, x, 7, (-3*A*atanh(sin(c + d*x)))/(a^3*d) + (2*(36*A + C)*tan(c + d*x))/(15*a^3*d) - ((A + C)*tan(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((9*A - C)*tan(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - (3*A*tan(c + d*x))/(d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^3)/(a + a*cos(c + d*x))^3, x, 8, ((13*A + 2*C)*atanh(sin(c + d*x)))/(2*a^3*d) - (2*(76*A + 11*C)*tan(c + d*x))/(15*a^3*d) + ((13*A + 2*C)*sec(c + d*x)*tan(c + d*x))/(2*a^3*d) - ((A + C)*sec(c + d*x)*tan(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((11*A + C)*sec(c + d*x)*tan(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((76*A + 11*C)*sec(c + d*x)*tan(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^4)/(a + a*cos(c + d*x))^3, x, 8, -(((23*A + 6*C)*atanh(sin(c + d*x)))/(2*a^3*d)) + (4*(34*A + 9*C)*tan(c + d*x))/(5*a^3*d) - ((23*A + 6*C)*sec(c + d*x)*tan(c + d*x))/(2*a^3*d) - ((A + C)*sec(c + d*x)^2*tan(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((13*A + 3*C)*sec(c + d*x)^2*tan(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((23*A + 6*C)*sec(c + d*x)^2*tan(c + d*x))/(3*d*(a^3 + a^3*cos(c + d*x))) + (4*(34*A + 9*C)*tan(c + d*x)^3)/(15*a^3*d)]

    @test_int [(cos(c + d*x)^4*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^4, x, 5, ((2*A + 21*C)*x)/(2*a^4) - (32*(5*A + 54*C)*sin(c + d*x))/(105*a^4*d) + ((2*A + 21*C)*cos(c + d*x)*sin(c + d*x))/(2*a^4*d) - ((10*A + 129*C)*cos(c + d*x)^3*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - (16*(5*A + 54*C)*cos(c + d*x)^2*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A + C)*cos(c + d*x)^5*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - (2*C*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)^3*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^4, x, 8, (-4*C*x)/a^4 + (2*(3*A + 122*C)*sin(c + d*x))/(105*a^4*d) + ((3*A - 88*C)*cos(c + d*x)^2*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) + (4*C*sin(c + d*x))/(a^4*d*(1 + cos(c + d*x))) - ((A + C)*cos(c + d*x)^4*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) + (2*(A - 6*C)*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)^2*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^4, x, 6, (C*x)/a^4 - ((8*A - 55*C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) + ((16*A - 215*C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A + C)*cos(c + d*x)^3*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) + (2*(2*A - 5*C)*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)*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^4, x, 5, ((23*A - 54*C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) + (4*(2*A + 9*C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A + C)*cos(c + d*x)^2*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - (2*(3*A - 4*C)*sin(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3)]
    @test_int [(A + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^4, x, 4, ((A + C)*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) + ((3*A - 11*C)*sin(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3) + ((6*A + 13*C)*sin(c + d*x))/(105*d*(a^2 + a^2*cos(c + d*x))^2) + ((6*A + 13*C)*sin(c + d*x))/(105*d*(a^4 + a^4*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x))/(a + a*cos(c + d*x))^4, x, 6, (A*atanh(sin(c + d*x)))/(a^4*d) - ((55*A - 8*C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - (8*(20*A - C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A + C)*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - (2*(5*A - 2*C)*sin(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3)]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^2)/(a + a*cos(c + d*x))^4, x, 8, (-4*A*atanh(sin(c + d*x)))/(a^4*d) + (2*(332*A + 3*C)*tan(c + d*x))/(105*a^4*d) - ((88*A - 3*C)*tan(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - (4*A*tan(c + d*x))/(a^4*d*(1 + cos(c + d*x))) - ((A + C)*tan(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - (2*(6*A - C)*tan(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3)]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^3)/(a + a*cos(c + d*x))^4, x, 9, ((21*A + 2*C)*atanh(sin(c + d*x)))/(2*a^4*d) - (32*(54*A + 5*C)*tan(c + d*x))/(105*a^4*d) + ((21*A + 2*C)*sec(c + d*x)*tan(c + d*x))/(2*a^4*d) - ((129*A + 10*C)*sec(c + d*x)*tan(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - (16*(54*A + 5*C)*sec(c + d*x)*tan(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A + C)*sec(c + d*x)*tan(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - (2*A*sec(c + d*x)*tan(c + d*x))/(5*a*d*(a + a*cos(c + d*x))^3)]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^4)/(a + a*cos(c + d*x))^4, x, 9, -((2*(11*A + 2*C)*atanh(sin(c + d*x)))/(a^4*d)) + (4*(454*A + 83*C)*tan(c + d*x))/(35*a^4*d) - (2*(11*A + 2*C)*sec(c + d*x)*tan(c + d*x))/(a^4*d) - ((178*A + 31*C)*sec(c + d*x)^2*tan(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - (4*(11*A + 2*C)*sec(c + d*x)^2*tan(c + d*x))/(3*a^4*d*(1 + cos(c + d*x))) - ((A + C)*sec(c + d*x)^2*tan(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - (2*(8*A + C)*sec(c + d*x)^2*tan(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3) + (4*(454*A + 83*C)*tan(c + d*x)^3)/(105*a^4*d)]

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

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

    @test_int [cos(c + d*x)^3*sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 6, (4*a*(99*A + 80*C)*sin(c + d*x))/(495*d*sqrt(a + a*cos(c + d*x))) + (2*a*(99*A + 80*C)*cos(c + d*x)^3*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) + (2*a*C*cos(c + d*x)^4*sin(c + d*x))/(99*d*sqrt(a + a*cos(c + d*x))) - (8*(99*A + 80*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3465*d) + (2*C*cos(c + d*x)^4*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(11*d) + (4*(99*A + 80*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(1155*a*d)]
    @test_int [cos(c + d*x)^2*sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 5, (2*a*(21*A + 16*C)*sin(c + d*x))/(45*d*sqrt(a + a*cos(c + d*x))) + (2*a*C*cos(c + d*x)^3*sin(c + d*x))/(63*d*sqrt(a + a*cos(c + d*x))) - (4*(21*A + 16*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d) + (2*C*cos(c + d*x)^3*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(9*d) + (2*(21*A + 16*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(105*a*d)]
    @test_int [cos(c + d*x)^1*sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 5, (2*a*(35*A + 27*C)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*(35*A + 18*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*d) + (2*C*cos(c + d*x)^2*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(7*d) + (2*C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*a*d)]
    @test_int [cos(c + d*x)^0*sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 3, (2*a*(15*A + 7*C)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) - (4*C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*d) + (2*C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*a*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x), x, 4, (2*sqrt(a)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a*C*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 4, (sqrt(a)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a*(A - 2*C)*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))) + (A*sqrt(a + a*cos(c + d*x))*tan(c + d*x))/d]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 4, (sqrt(a)*(3*A + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) + (a*A*tan(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 5, (sqrt(a)*(5*A + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a*(5*A + 8*C)*tan(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) + (a*A*sec(c + d*x)*tan(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 6, (sqrt(a)*(35*A + 48*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a*(35*A + 48*C)*tan(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a*(35*A + 48*C)*sec(c + d*x)*tan(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) + (a*A*sec(c + d*x)^2*tan(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (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 + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2), x, 6, (2*a^2*(143*A + 112*C)*sin(c + d*x))/(165*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(33*A + 28*C)*cos(c + d*x)^3*sin(c + d*x))/(231*d*sqrt(a + a*cos(c + d*x))) - (4*a*(143*A + 112*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(1155*d) + (2*a*C*cos(c + d*x)^3*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(33*d) + (2*(143*A + 112*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(385*d) + (2*C*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 + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2), x, 6, (8*a^2*(63*A + 47*C)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a*(63*A + 47*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d) + (2*(63*A + 22*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(315*d) + (2*C*cos(c + d*x)^2*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(9*d) + (2*C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(21*a*d)]
    @test_int [cos(c + d*x)^0*(a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2), x, 4, (8*a^2*(35*A + 19*C)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*(35*A + 19*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*d) - (4*C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*d) + (2*C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*a*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x), x, 5, (2*a^(3/2)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^2*(5*A + 4*C)*sin(c + d*x))/(5*d*sqrt(a + a*cos(c + d*x))) + (2*a*C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(5*d) + (2*C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 5, (3*a^(3/2)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a^2*(3*A - 8*C)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) - (a*(3*A - 2*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d) + (A*(a + a*cos(c + d*x))^(3/2)*tan(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 5, (a^(3/2)*(7*A + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) - (a^2*(5*A - 8*C)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (3*a*A*sqrt(a + a*cos(c + d*x))*tan(c + d*x))/(4*d) + (A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 5, (a^(3/2)*(11*A + 24*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a^2*(19*A + 24*C)*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)*tan(c + d*x))/(4*d) + (A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 6, (a^(3/2)*(75*A + 112*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^2*(75*A + 112*C)*tan(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a^2*(13*A + 16*C)*sec(c + d*x)*tan(c + d*x))/(32*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))/(8*d) + (A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^6, x, 7, (a^(3/2)*(133*A + 176*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(128*d) + (a^2*(133*A + 176*C)*tan(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))) + (a^2*(133*A + 176*C)*sec(c + d*x)*tan(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^2*(67*A + 80*C)*sec(c + d*x)^2*tan(c + d*x))/(240*d*sqrt(a + a*cos(c + d*x))) + (3*a*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(40*d) + (A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^4*tan(c + d*x))/(5*d)]

    @test_int [cos(c + d*x)^2*(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2), x, 7, (2*a^3*(10439*A + 8368*C)*sin(c + d*x))/(6435*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(2717*A + 2224*C)*cos(c + d*x)^3*sin(c + d*x))/(9009*d*sqrt(a + a*cos(c + d*x))) - (4*a^2*(10439*A + 8368*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(45045*d) + (2*a^2*(143*A + 136*C)*cos(c + d*x)^3*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(1287*d) + (2*a*(10439*A + 8368*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(15015*d) + (10*a*C*cos(c + d*x)^3*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(143*d) + (2*C*cos(c + d*x)^3*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(13*d)]
    @test_int [cos(c + d*x)^1*(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2), x, 7, (64*a^3*(33*A + 25*C)*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) + (16*a^2*(33*A + 25*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(693*d) + (2*a*(33*A + 25*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(231*d) + (2*(99*A + 26*C)*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(693*d) + (2*C*cos(c + d*x)^2*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(11*d) + (10*C*(a + a*cos(c + d*x))^(7/2)*sin(c + d*x))/(99*a*d)]
    @test_int [cos(c + d*x)^0*(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2), x, 5, (64*a^3*(21*A + 13*C)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (16*a^2*(21*A + 13*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d) + (2*a*(21*A + 13*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(105*d) - (4*C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(63*d) + (2*C*(a + a*cos(c + d*x))^(7/2)*sin(c + d*x))/(9*a*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x), x, 6, (2*a^(5/2)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^3*(49*A + 32*C)*sin(c + d*x))/(21*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(7*A + 8*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a*C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*d) + (2*C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 6, (5*a^(5/2)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (a^3*(15*A + 64*C)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) - (a^2*(15*A - 16*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*d) - (a*(5*A - 2*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d) + (A*(a + a*cos(c + d*x))^(5/2)*tan(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 6, (a^(5/2)*(19*A + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) - (a^3*(27*A - 56*C)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) - (a^2*(21*A - 8*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(12*d) + (5*a*A*(a + a*cos(c + d*x))^(3/2)*tan(c + d*x))/(4*d) + (A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 6, (5*a^(5/2)*(5*A + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) - (a^3*(49*A - 24*C)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (a^2*(31*A + 24*C)*sqrt(a + a*cos(c + d*x))*tan(c + d*x))/(24*d) + (5*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)*tan(c + d*x))/(12*d) + (A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 6, (a^(5/2)*(163*A + 304*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^3*(299*A + 432*C)*tan(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^2*(17*A + 16*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(32*d) + (5*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^2*tan(c + d*x))/(24*d) + (A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^6, x, 7, (a^(5/2)*(283*A + 400*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(128*d) + (a^3*(283*A + 400*C)*tan(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))) + (a^3*(787*A + 1040*C)*sec(c + d*x)*tan(c + d*x))/(960*d*sqrt(a + a*cos(c + d*x))) + (a^2*(79*A + 80*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(240*d) + (a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^3*tan(c + d*x))/(8*d) + (A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^4*tan(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^7, x, 8, (a^(5/2)*(1015*A + 1304*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(512*d) + (a^3*(1015*A + 1304*C)*tan(c + d*x))/(512*d*sqrt(a + a*cos(c + d*x))) + (a^3*(1015*A + 1304*C)*sec(c + d*x)*tan(c + d*x))/(768*d*sqrt(a + a*cos(c + d*x))) + (a^3*(109*A + 136*C)*sec(c + d*x)^2*tan(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^2*(23*A + 24*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(96*d) + (a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^4*tan(c + d*x))/(12*d) + (A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^5*tan(c + d*x))/(6*d)]

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

    @test_int [cos(c + d*x)^3*(A + C*cos(c + d*x)^2)/sqrt(a + a*cos(c + d*x)), x, 8, -((sqrt(2)*(A + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d)) + (4*(147*A + 143*C)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*(21*A + 19*C)*cos(c + d*x)^2*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) - (2*C*cos(c + d*x)^3*sin(c + d*x))/(63*d*sqrt(a + a*cos(c + d*x))) + (2*C*cos(c + d*x)^4*sin(c + d*x))/(9*d*sqrt(a + a*cos(c + d*x))) - (2*(21*A + 29*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*a*d)]
    @test_int [cos(c + d*x)^2*(A + C*cos(c + d*x)^2)/sqrt(a + a*cos(c + d*x)), x, 7, (sqrt(2)*(A + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) - (4*(35*A + 37*C)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) - (2*C*cos(c + d*x)^2*sin(c + d*x))/(35*d*sqrt(a + a*cos(c + d*x))) + (2*C*cos(c + d*x)^3*sin(c + d*x))/(7*d*sqrt(a + a*cos(c + d*x))) + (2*(35*A + 31*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*a*d)]
    @test_int [cos(c + d*x)^1*(A + C*cos(c + d*x)^2)/sqrt(a + a*cos(c + d*x)), x, 6, -((sqrt(2)*(A + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d)) + (2*(15*A + 14*C)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*C*cos(c + d*x)^2*sin(c + d*x))/(5*d*sqrt(a + a*cos(c + d*x))) - (2*C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*a*d)]
    @test_int [cos(c + d*x)^0*(A + C*cos(c + d*x)^2)/sqrt(a + a*cos(c + d*x)), x, 4, (sqrt(2)*(A + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) - (4*C*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*a*d)]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^1)/sqrt(a + a*cos(c + d*x)), x, 6, (2*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(sqrt(a)*d) - (sqrt(2)*(A + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + (2*C*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^2)/sqrt(a + a*cos(c + d*x)), x, 6, -((A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(sqrt(a)*d)) + (sqrt(2)*(A + C)*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 [((A + C*cos(c + d*x)^2)*sec(c + d*x)^3)/sqrt(a + a*cos(c + d*x)), x, 7, ((7*A + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*sqrt(a)*d) - (sqrt(2)*(A + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) - (A*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 [((A + C*cos(c + d*x)^2)*sec(c + d*x)^4)/sqrt(a + a*cos(c + d*x)), x, 8, -(((9*A + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*sqrt(a)*d)) + (sqrt(2)*(A + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + ((7*A + 8*C)*tan(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) - (A*sec(c + d*x)*tan(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (A*sec(c + d*x)^2*tan(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^5)/sqrt(a + a*cos(c + d*x)), x, 9, ((107*A + 112*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*sqrt(a)*d) - (sqrt(2)*(A + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) - ((21*A + 16*C)*tan(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + ((43*A + 48*C)*sec(c + d*x)*tan(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) - (A*sec(c + d*x)^2*tan(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (A*sec(c + d*x)^3*tan(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x)))]

    @test_int [cos(c + d*x)^3*(A + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 8, ((11*A + 19*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) - ((A + C)*cos(c + d*x)^4*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) - ((455*A + 799*C)*sin(c + d*x))/(105*a*d*sqrt(a + a*cos(c + d*x))) - ((35*A + 67*C)*cos(c + d*x)^2*sin(c + d*x))/(70*a*d*sqrt(a + a*cos(c + d*x))) + ((7*A + 11*C)*cos(c + d*x)^3*sin(c + d*x))/(14*a*d*sqrt(a + a*cos(c + d*x))) + ((245*A + 397*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(210*a^2*d)]
    @test_int [cos(c + d*x)^2*(A + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 7, -(((7*A + 15*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d)) - ((A + C)*cos(c + d*x)^3*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((15*A + 31*C)*sin(c + d*x))/(5*a*d*sqrt(a + a*cos(c + d*x))) + ((5*A + 9*C)*cos(c + d*x)^2*sin(c + d*x))/(10*a*d*sqrt(a + a*cos(c + d*x))) - ((5*A + 13*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(10*a^2*d)]
    @test_int [cos(c + d*x)^1*(A + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 6, ((3*A + 11*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) - ((A + C)*cos(c + d*x)^2*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) - ((3*A + 13*C)*sin(c + d*x))/(3*a*d*sqrt(a + a*cos(c + d*x))) + ((3*A + 7*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(6*a^2*d)]
    @test_int [cos(c + d*x)^0*(A + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 4, ((A - 7*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) + ((A + C)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + (2*C*sin(c + d*x))/(a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(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 - 3*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) - ((A + C)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 7, -((3*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(3/2)*d)) + ((9*A + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) - ((A + C)*tan(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((3*A + C)*tan(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^3)/(a + a*cos(c + d*x))^(3/2), x, 8, ((19*A + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*a^(3/2)*d) - ((13*A + 5*C)*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 + 2*C)*tan(c + d*x))/(4*a*d*sqrt(a + a*cos(c + d*x))) - ((A + C)*sec(c + d*x)*tan(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((2*A + C)*sec(c + d*x)*tan(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^4)/(a + a*cos(c + d*x))^(3/2), x, 9, -(((47*A + 24*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*a^(3/2)*d)) + ((17*A + 9*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) + (3*(7*A + 4*C)*tan(c + d*x))/(8*a*d*sqrt(a + a*cos(c + d*x))) - ((13*A + 6*C)*sec(c + d*x)*tan(c + d*x))/(12*a*d*sqrt(a + a*cos(c + d*x))) - ((A + C)*sec(c + d*x)^2*tan(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((5*A + 3*C)*sec(c + d*x)^2*tan(c + d*x))/(6*a*d*sqrt(a + a*cos(c + d*x)))]

    @test_int [cos(c + d*x)^3*(A + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(5/2), x, 8, -(((75*A + 283*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d)) - ((A + C)*cos(c + d*x)^4*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((5*A + 21*C)*cos(c + d*x)^3*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((465*A + 1729*C)*sin(c + d*x))/(120*a^2*d*sqrt(a + a*cos(c + d*x))) + ((45*A + 157*C)*cos(c + d*x)^2*sin(c + d*x))/(80*a^2*d*sqrt(a + a*cos(c + d*x))) - ((195*A + 787*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(240*a^3*d)]
    @test_int [cos(c + d*x)^2*(A + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(5/2), x, 7, ((19*A + 163*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - ((A + C)*cos(c + d*x)^3*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((A + 17*C)*cos(c + d*x)^2*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) - ((21*A + 197*C)*sin(c + d*x))/(24*a^2*d*sqrt(a + a*cos(c + d*x))) + (5*(3*A + 19*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(48*a^3*d)]
    @test_int [cos(c + d*x)^1*(A + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(5/2), x, 6, (5*(A - 15*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - ((A + C)*cos(c + d*x)^2*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((3*A - 13*C)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((A + 9*C)*sin(c + d*x))/(4*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(5/2), x, 4, ((3*A + 19*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) + ((A + C)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((3*A - 13*C)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(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 - 5*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - ((A + C)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((11*A - 5*C)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^2)/(a + a*cos(c + d*x))^(5/2), x, 8, -((5*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(5/2)*d)) + ((115*A + 3*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - ((A + C)*tan(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((15*A - C)*tan(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((35*A + 3*C)*tan(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^3)/(a + a*cos(c + d*x))^(5/2), x, 9, ((39*A + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*a^(5/2)*d) - ((219*A + 43*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - ((63*A + 11*C)*tan(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x))) - ((A + C)*sec(c + d*x)*tan(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((19*A + 3*C)*sec(c + d*x)*tan(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((31*A + 7*C)*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+C*cos(e+f*x)^2)*(a+a*cos(e+f*x))^n=#

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

    @test_int [cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 8, (2*a*(9*A + 7*C)*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (10*a*(11*A + 9*C)*Elliptic.F((1/2)*(c + d*x), 2))/(231*d) + (10*a*(11*A + 9*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (2*a*(9*A + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*a*(11*A + 9*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(77*d) + (2*a*C*cos(c + d*x)^(7/2)*sin(c + d*x))/(9*d) + (2*a*C*cos(c + d*x)^(9/2)*sin(c + d*x))/(11*d)]
    @test_int [cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 7, (2*a*(9*A + 7*C)*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (2*a*(7*A + 5*C)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*a*(7*A + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a*(9*A + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*a*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d) + (2*a*C*cos(c + d*x)^(7/2)*sin(c + d*x))/(9*d)]
    @test_int [sqrt(cos(c + d*x))*(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 6, (2*a*(5*A + 3*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*a*(7*A + 5*C)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*a*(7*A + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a*C*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*a*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [((a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 5, (2*a*(5*A + 3*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*a*(3*A + C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a*C*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*a*C*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [((a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 5, -((2*a*(A - C)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*a*(3*A + C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a*A*sin(c + d*x))/(d*sqrt(cos(c + d*x))) + (2*a*C*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [((a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 5, -((2*a*(A - C)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*a*(A + 3*C)*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*A*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 6, -((2*a*(3*A + 5*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*a*(A + 3*C)*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*A*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*a*(3*A + 5*C)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 7, -((2*a*(3*A + 5*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*a*(5*A + 7*C)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*a*A*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (2*a*A*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*a*(5*A + 7*C)*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (2*a*(3*A + 5*C)*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 + C*cos(c + d*x)^2), x, 9, (4*a^2*(9*A + 7*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (8*a^2*(33*A + 25*C)*Elliptic.F((c + d*x)/2, 2))/(231*d) + (8*a^2*(33*A + 25*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (4*a^2*(9*A + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*a^2*(99*A + 89*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(693*d) + (2*C*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^2*sin(c + d*x))/(11*d) + (8*C*cos(c + d*x)^(5/2)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(99*d)]
    @test_int [sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2), x, 8, (16*a^2*(3*A + 2*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^2*(7*A + 5*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (4*a^2*(7*A + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a^2*(21*A + 19*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*C*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^2*sin(c + d*x))/(9*d) + (8*C*cos(c + d*x)^(3/2)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(63*d)]
    @test_int [((a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 7, (4*a^2*(5*A + 3*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (8*a^2*(7*A + 3*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a^2*(35*A + 33*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(105*d) + (2*C*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2*sin(c + d*x))/(7*d) + (8*C*sqrt(cos(c + d*x))*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(35*d)]
    @test_int [((a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 7, (16*a^2*C*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^2*(3*A + C)*Elliptic.F((c + d*x)/2, 2))/(3*d) - (2*a^2*(15*A - 7*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) + (2*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - (2*(5*A - C)*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 + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 7, (-4*a^2*(A - C)*Elliptic.E((c + d*x)/2, 2))/d + (8*a^2*(A + C)*Elliptic.F((c + d*x)/2, 2))/(3*d) - (2*a^2*(5*A - C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (8*A*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(3*d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 7, (-16*a^2*A*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^2*(A + 3*C)*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a^2*(17*A + 15*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (8*A*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2))]
    @test_int [((a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 8, (-4*a^2*(3*A + 5*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (8*a^2*(3*A + 7*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a^2*(33*A + 35*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (4*a^2*(3*A + 5*C)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (8*A*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2))]
    @test_int [((a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 9, (-16*a^2*(2*A + 3*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^2*(5*A + 7*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a^2*(19*A + 21*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(5/2)) + (4*a^2*(5*A + 7*C)*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (16*a^2*(2*A + 3*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2)) + (8*A*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2))]

    @test_int [cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2), x, 10, (4*a^3*(221*A + 175*C)*Elliptic.E((c + d*x)/2, 2))/(195*d) + (4*a^3*(121*A + 95*C)*Elliptic.F((c + d*x)/2, 2))/(231*d) + (4*a^3*(121*A + 95*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (4*a^3*(221*A + 175*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(585*d) + (40*a^3*(143*A + 118*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(9009*d) + (2*C*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(13*d) + (12*C*cos(c + d*x)^(5/2)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(143*a*d) + (2*(143*A + 145*C)*cos(c + d*x)^(5/2)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(1287*d)]
    @test_int [sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2), x, 9, (4*a^3*(7*A + 5*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(143*A + 105*C)*Elliptic.F((c + d*x)/2, 2))/(231*d) + (4*a^3*(143*A + 105*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (8*a^3*(44*A + 35*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(385*d) + (2*C*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(11*d) + (4*C*cos(c + d*x)^(3/2)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(33*a*d) + (2*(33*A + 35*C)*cos(c + d*x)^(3/2)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(231*d)]
    @test_int [((a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 8, (4*a^3*(27*A + 17*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^3*(21*A + 11*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (8*a^3*(21*A + 16*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(105*d) + (2*C*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^3*sin(c + d*x))/(9*d) + (4*C*sqrt(cos(c + d*x))*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(21*a*d) + (2*(63*A + 73*C)*sqrt(cos(c + d*x))*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(315*d)]
    @test_int [((a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 8, (4*a^3*(5*A + 7*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(35*A + 13*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) - (4*a^3*(35*A - 41*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(105*d) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - (2*(7*A - C)*sqrt(cos(c + d*x))*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(7*a*d) - (2*(35*A - 11*C)*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 + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 8, (-4*a^3*(5*A - 9*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(5*A + 3*C)*Elliptic.F((c + d*x)/2, 2))/(3*d) - (8*a^3*(10*A - 3*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (4*A*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(a*d*sqrt(cos(c + d*x))) - (2*(35*A - 3*C)*sqrt(cos(c + d*x))*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(15*d)]
    @test_int [((a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 8, (-4*a^3*(9*A - 5*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(3*A + 5*C)*Elliptic.F((c + d*x)/2, 2))/(3*d) - (4*a^3*(21*A + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (4*A*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(5*a*d*cos(c + d*x)^(3/2)) + (2*(11*A + 5*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(5*d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 8, (-4*a^3*(7*A + 5*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(13*A + 35*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (8*a^3*(53*A + 70*C)*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (12*A*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(35*a*d*cos(c + d*x)^(5/2)) + (2*(7*A + 5*C)*(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 + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 9, (-4*a^3*(17*A + 27*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^3*(11*A + 21*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (8*a^3*(16*A + 21*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (4*a^3*(17*A + 27*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2)) + (4*A*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(21*a*d*cos(c + d*x)^(7/2)) + (2*(73*A + 63*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2))]
    @test_int [((a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(13/2), x, 10, (-4*a^3*(5*A + 7*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(105*A + 143*C)*Elliptic.F((c + d*x)/2, 2))/(231*d) + (8*a^3*(35*A + 44*C)*sin(c + d*x))/(385*d*cos(c + d*x)^(5/2)) + (4*a^3*(105*A + 143*C)*sin(c + d*x))/(231*d*cos(c + d*x)^(3/2)) + (4*a^3*(5*A + 7*C)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(11*d*cos(c + d*x)^(11/2)) + (4*A*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(33*a*d*cos(c + d*x)^(9/2)) + (2*(35*A + 33*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(231*d*cos(c + d*x)^(7/2))]

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

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

    @test_int [(cos(c + d*x)^(5/2)*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^2, x, 7, (4*(5*A + 14*C)*Elliptic.E((c + d*x)/2, 2))/(5*a^2*d) - (5*(A + 3*C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) - (5*(A + 3*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a^2*d) + (4*(5*A + 14*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(15*a^2*d) - ((A + 3*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(a^2*d*(1 + cos(c + d*x))) - ((A + C)*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)^(3/2)*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^2, x, 6, -(((A + 7*C)*Elliptic.E((c + d*x)/2, 2))/(a^2*d)) + (2*(A + 5*C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + (2*(A + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a^2*d) - ((A + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A + C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [(sqrt(cos(c + d*x))*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^2, x, 5, (4*C*Elliptic.E((c + d*x)/2, 2))/(a^2*d) + ((A - 5*C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + ((A - 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A + C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [(A + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2), x, 5, ((A - C)*Elliptic.E((c + d*x)/2, 2))/(a^2*d) + (2*(A + C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) - ((A - C)*sqrt(cos(c + d*x))*sin(c + d*x))/(a^2*d*(1 + cos(c + d*x))) - ((A + C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^2), x, 6, (-4*A*Elliptic.E((c + d*x)/2, 2))/(a^2*d) - ((5*A - C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + (4*A*sin(c + d*x))/(a^2*d*sqrt(cos(c + d*x))) - ((5*A - C)*sin(c + d*x))/(3*a^2*d*sqrt(cos(c + d*x))*(1 + cos(c + d*x))) - ((A + C)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2)]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^2), x, 7, ((7*A + C)*Elliptic.E((c + d*x)/2, 2))/(a^2*d) + (2*(5*A + C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + (2*(5*A + C)*sin(c + d*x))/(3*a^2*d*cos(c + d*x)^(3/2)) - ((7*A + C)*sin(c + d*x))/(a^2*d*sqrt(cos(c + d*x))) - ((7*A + C)*sin(c + d*x))/(3*a^2*d*cos(c + d*x)^(3/2)*(1 + cos(c + d*x))) - ((A + C)*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)^(7/2)*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 8, (7*(7*A + 33*C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) - ((13*A + 63*C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) - ((13*A + 63*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(6*a^3*d) + (7*(7*A + 33*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(30*a^3*d) - ((A + C)*cos(c + d*x)^(9/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - (2*(A + 6*C)*cos(c + d*x)^(7/2)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((13*A + 63*C)*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)^(5/2)*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 7, -((9*A + 119*C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((A + 11*C)*Elliptic.F((c + d*x)/2, 2))/(2*a^3*d) + ((A + 11*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*a^3*d) - ((A + C)*cos(c + d*x)^(7/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - (2*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(3*a*d*(a + a*cos(c + d*x))^2) - ((9*A + 119*C)*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)^(3/2)*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 6, -((A - 49*C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((A - 13*C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) - ((A + C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + (2*(A - 4*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((A - 13*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(6*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(sqrt(cos(c + d*x))*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 6, ((A - 9*C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((A + 3*C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) - ((A + C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + (2*(2*A - 3*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((A - 9*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(10*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^3), x, 6, ((9*A - C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((3*A + C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) - ((A + C)*sqrt(cos(c + d*x))*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - (2*(3*A - 2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((9*A - C)*sqrt(cos(c + d*x))*sin(c + d*x))/(10*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^3), x, 7, -((49*A - C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) - ((13*A - C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) + ((49*A - C)*sin(c + d*x))/(10*a^3*d*sqrt(cos(c + d*x))) - ((A + C)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^3) - (2*(4*A - C)*sin(c + d*x))/(15*a*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2) - ((13*A - C)*sin(c + d*x))/(6*d*sqrt(cos(c + d*x))*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^3), x, 8, ((119*A + 9*C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((11*A + C)*Elliptic.F((c + d*x)/2, 2))/(2*a^3*d) + ((11*A + C)*sin(c + d*x))/(2*a^3*d*cos(c + d*x)^(3/2)) - ((119*A + 9*C)*sin(c + d*x))/(10*a^3*d*sqrt(cos(c + d*x))) - ((A + C)*sin(c + d*x))/(5*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^3) - (2*A*sin(c + d*x))/(3*a*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^2) - ((119*A + 9*C)*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+C*cos(e+f*x)^2)*(a+a*cos(e+f*x))^(n/2)=#

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

    @test_int [cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 6, (sqrt(a)*(48*A + 35*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a*(48*A + 35*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a*(48*A + 35*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) + (a*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (C*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d)]
    @test_int [sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 5, (sqrt(a)*(8*A + 5*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a*(8*A + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) + (a*C*cos(c + d*x)^(3/2)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (C*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [(sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 4, (sqrt(a)*(8*A + 3*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) + (a*C*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (C*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d)]
    @test_int [(sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 4, (sqrt(a)*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a*(2*A - C)*sqrt(cos(c + d*x))*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [(sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 4, (2*sqrt(a)*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a*A*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [(sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 3, (2*a*A*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (2*a*(8*A + 15*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [(sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 4, (2*a*A*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (2*a*(24*A + 35*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (4*a*(24*A + 35*C)*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [(sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 5, (2*a*A*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))) + (2*a*(16*A + 21*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (8*a*(16*A + 21*C)*sin(c + d*x))/(315*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (16*a*(16*A + 21*C)*sin(c + d*x))/(315*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*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 + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2), x, 7, (a^(3/2)*(176*A + 133*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(128*d) + (a^2*(176*A + 133*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))) + (a^2*(176*A + 133*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^2*(80*A + 67*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(240*d*sqrt(a + a*cos(c + d*x))) + (3*a*C*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(40*d) + (C*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2), x, 6, (a^(3/2)*(112*A + 75*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^2*(112*A + 75*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a^2*(16*A + 13*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(32*d*sqrt(a + a*cos(c + d*x))) + (a*C*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(8*d) + (C*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(4*d)]
    @test_int [((a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 5, (a^(3/2)*(24*A + 11*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a^2*(24*A + 19*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (a*C*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d) + (C*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [((a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 5, (a^(3/2)*(8*A + 7*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) - (a^2*(8*A - 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) - (a*(4*A - C)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d) + (2*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 5, (3*a^(3/2)*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a^2*(8*A - 3*C)*sqrt(cos(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))*sin(c + d*x))/(d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 5, (2*a^(3/2)*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^2*(4*A + 5*C)*sin(c + d*x))/(5*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)^(3/2)) + (2*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 4, (2*a^2*(4*A + 5*C)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (2*a^2*(104*A + 175*C)*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (6*a*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [((a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 5, (2*a^2*(52*A + 63*C)*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (2*a^2*(136*A + 189*C)*sin(c + d*x))/(315*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (4*a^2*(136*A + 189*C)*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))/(21*d*cos(c + d*x)^(7/2)) + (2*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]
    @test_int [((a + a*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(13/2), x, 6, (2*a^2*(28*A + 33*C)*sin(c + d*x))/(231*d*cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))) + (2*a^2*(112*A + 143*C)*sin(c + d*x))/(385*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (8*a^2*(112*A + 143*C)*sin(c + d*x))/(1155*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (16*a^2*(112*A + 143*C)*sin(c + d*x))/(1155*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))/(33*d*cos(c + d*x)^(9/2)) + (2*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(11*d*cos(c + d*x)^(11/2))]

    @test_int [cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2), x, 8, (a^(5/2)*(1304*A + 1015*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(512*d) + (a^3*(1304*A + 1015*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(512*d*sqrt(a + a*cos(c + d*x))) + (a^3*(1304*A + 1015*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(768*d*sqrt(a + a*cos(c + d*x))) + (a^3*(136*A + 109*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^2*(24*A + 23*C)*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(96*d) + (a*C*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(12*d) + (C*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(6*d)]
    @test_int [sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2), x, 7, (a^(5/2)*(400*A + 283*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(128*d) + (a^3*(400*A + 283*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))) + (a^3*(1040*A + 787*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(960*d*sqrt(a + a*cos(c + d*x))) + (a^2*(80*A + 79*C)*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(240*d) + (a*C*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(8*d) + (C*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 6, (a^(5/2)*(304*A + 163*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^3*(432*A + 299*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^2*(16*A + 17*C)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(32*d) + (5*a*C*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*d) + (C*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*d)]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 6, (5*a^(5/2)*(8*A + 5*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) - (a^3*(24*A - 49*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) - (a^2*(8*A - 3*C)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d) - (a*(6*A - C)*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 6, (a^(5/2)*(8*A + 19*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) - (a^3*(56*A - 27*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) - (a^2*(8*A - C)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d) + (10*a*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 6, (5*a^(5/2)*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a^3*(64*A + 15*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(8*A + 5*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(5*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)) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 6, (2*a^(5/2)*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^3*(32*A + 49*C)*sin(c + d*x))/(21*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(8*A + 7*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(5/2)) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 5, (2*a^3*(8*A + 11*C)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (2*a^3*(584*A + 903*C)*sin(c + d*x))/(315*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(64*A + 63*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)) + (10*a*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2)) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(13/2), x, 6, (2*a^3*(232*A + 297*C)*sin(c + d*x))/(693*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (2*a^3*(568*A + 759*C)*sin(c + d*x))/(693*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (4*a^3*(568*A + 759*C)*sin(c + d*x))/(693*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(32*A + 33*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(231*d*cos(c + d*x)^(7/2)) + (10*a*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(99*d*cos(c + d*x)^(9/2)) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(11*d*cos(c + d*x)^(11/2))]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(15/2), x, 7, (2*a^3*(2224*A + 2717*C)*sin(c + d*x))/(9009*d*cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))) + (2*a^3*(8368*A + 10439*C)*sin(c + d*x))/(15015*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (8*a^3*(8368*A + 10439*C)*sin(c + d*x))/(45045*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (16*a^3*(8368*A + 10439*C)*sin(c + d*x))/(45045*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(136*A + 143*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(1287*d*cos(c + d*x)^(9/2)) + (10*a*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(143*d*cos(c + d*x)^(11/2)) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(13*d*cos(c + d*x)^(13/2))]

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

    @test_int [(cos(c + d*x)^(3/2)*(A + C*cos(c + d*x)^2))/sqrt(a + a*cos(c + d*x)), x, 8, -(((8*A + 9*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*sqrt(a)*d)) + (sqrt(2)*(A + C)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + ((8*A + 7*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) - (C*cos(c + d*x)^(3/2)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (C*cos(c + d*x)^(5/2)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [(sqrt(cos(c + d*x))*(A + C*cos(c + d*x)^2))/sqrt(a + a*cos(c + d*x)), x, 7, ((8*A + 7*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*sqrt(a)*d) - (sqrt(2)*(A + C)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) - (C*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (C*cos(c + d*x)^(3/2)*sin(c + d*x))/(2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))), x, 6, -((C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(sqrt(a)*d)) + (sqrt(2)*(A + C)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + (C*sqrt(cos(c + d*x))*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))), x, 6, (2*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(sqrt(a)*d) - (sqrt(2)*(A + C)*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 [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))), x, 5, (sqrt(2)*(A + C)*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*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))), x, 6, -((sqrt(2)*(A + C)*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*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (2*(13*A + 15*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(9/2)*sqrt(a + a*cos(c + d*x))), x, 7, (sqrt(2)*(A + C)*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))/(7*d*cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))) - (2*A*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (2*(31*A + 35*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) - (2*(43*A + 35*C)*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 + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^(3/2), x, 8, ((8*A + 19*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*a^(3/2)*d) - ((5*A + 13*C)*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 + C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) - ((2*A + 7*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*a*d*sqrt(a + a*cos(c + d*x))) + ((A + 2*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [(sqrt(cos(c + d*x))*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^(3/2), x, 7, -((3*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(3/2)*d)) + ((A + 9*C)*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 + C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((A + 3*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)), x, 6, (2*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(3/2)*d) + ((3*A - 5*C)*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 + C)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)), x, 5, -((7*A - C)*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 + C)*sin(c + d*x))/(2*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)) + ((5*A + C)*sin(c + d*x))/(2*a*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(3/2)), x, 6, ((11*A + 3*C)*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 + C)*sin(c + d*x))/(2*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)) + ((7*A + 3*C)*sin(c + d*x))/(6*a*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) - ((19*A + 3*C)*sin(c + d*x))/(6*a*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(7/2)*(a + a*cos(c + d*x))^(3/2)), x, 7, -((15*A + 7*C)*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 + C)*sin(c + d*x))/(2*d*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(3/2)) + ((9*A + 5*C)*sin(c + d*x))/(10*a*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) - ((13*A + 5*C)*sin(c + d*x))/(10*a*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + ((49*A + 25*C)*sin(c + d*x))/(10*a*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]

    @test_int [(cos(c + d*x)^(3/2)*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^(5/2), x, 8, -((5*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(5/2)*d)) + ((3*A + 115*C)*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 + C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((A - 15*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((3*A + 35*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [(sqrt(cos(c + d*x))*(A + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^(5/2), x, 7, (2*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(5/2)*d) + ((5*A - 43*C)*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 + C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((5*A - 11*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [(A + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(5/2)), x, 5, ((19*A + 3*C)*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 + C)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((9*A - 7*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(5/2)), x, 6, (-5*(15*A - C)*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 + C)*sin(c + d*x))/(4*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(5/2)) - ((13*A - 3*C)*sin(c + d*x))/(16*a*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)) + ((49*A + C)*sin(c + d*x))/(16*a^2*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(5/2)), x, 7, ((163*A + 19*C)*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 + C)*sin(c + d*x))/(4*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(5/2)) - ((17*A + C)*sin(c + d*x))/(16*a*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)) + (5*(19*A + 3*C)*sin(c + d*x))/(48*a^2*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) - ((299*A + 27*C)*sin(c + d*x))/(48*a^2*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]

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

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

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

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

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

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

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

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

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

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

    @test_int [cos(c + d*x)^3*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^3, x, 5, -((6*B - 13*C)*x)/(2*a^3) + (8*(9*B - 19*C)*sin(c + d*x))/(15*a^3*d) - ((6*B - 13*C)*cos(c + d*x)*sin(c + d*x))/(2*a^3*d) + ((B - C)*cos(c + d*x)^4*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((6*B - 11*C)*cos(c + d*x)^3*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + (4*(9*B - 19*C)*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)^2*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^3, x, 8, ((B - 3*C)*x)/a^3 - ((7*B - 27*C)*sin(c + d*x))/(15*a^3*d) + ((B - C)*cos(c + d*x)^3*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((4*B - 9*C)*cos(c + d*x)^2*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((B - 3*C)*sin(c + d*x))/(d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [cos(c + d*x)^1*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^3, x, 6, (C*x)/a^3 + ((B - C)*cos(c + d*x)^2*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((2*B - 7*C)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((4*B - 29*C)*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^3, x, 3, -((B - C)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((3*B - 8*C)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((3*B + 7*C)*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [((B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^1)/(a + a*cos(c + d*x))^3, x, 4, ((B - C)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((2*B + 3*C)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((2*B + 3*C)*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [((B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^2)/(a + a*cos(c + d*x))^3, x, 6, (B*atanh(sin(c + d*x)))/(a^3*d) - ((B - C)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((7*B - 2*C)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - (2*(11*B - C)*sin(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [((B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^3)/(a + a*cos(c + d*x))^3, x, 8, -(((3*B - C)*atanh(sin(c + d*x)))/(a^3*d)) + (2*(36*B - 11*C)*tan(c + d*x))/(15*a^3*d) - ((B - C)*tan(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((9*B - 4*C)*tan(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((3*B - C)*tan(c + d*x))/(d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [((B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^4)/(a + a*cos(c + d*x))^3, x, 9, ((13*B - 6*C)*atanh(sin(c + d*x)))/(2*a^3*d) - (8*(19*B - 9*C)*tan(c + d*x))/(15*a^3*d) + ((13*B - 6*C)*sec(c + d*x)*tan(c + d*x))/(2*a^3*d) - ((B - C)*sec(c + d*x)*tan(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((11*B - 6*C)*sec(c + d*x)*tan(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - (4*(19*B - 9*C)*sec(c + d*x)*tan(c + d*x))/(15*d*(a^3 + a^3*cos(c + d*x)))]

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

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

    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(1/2), x, 3, (2*a*(5*B + 7*C)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*(5*B - 2*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*d) + (2*C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*a*d)]

    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(3/2), x, 4, (8*a^2*(21*B + 19*C)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*(21*B + 19*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*d) + (2*(7*B - 2*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*d) + (2*C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*a*d)]

    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(5/2), x, 5, (64*a^3*(15*B + 13*C)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (16*a^2*(15*B + 13*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d) + (2*a*(15*B + 13*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(105*d) + (2*(9*B - 2*C)*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(63*d) + (2*C*(a + a*cos(c + d*x))^(7/2)*sin(c + d*x))/(9*a*d)]

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

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

    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 4, ((3*B - 7*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) - ((B - C)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + (2*C*sin(c + d*x))/(a*d*sqrt(a + a*cos(c + d*x)))]

    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(5/2), x, 4, ((5*B + 19*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(16*sqrt(2)*a^(5/2)*d) - ((B - C)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((5*B - 13*C)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]

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

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

    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)*cos(c + d*x)^(3/2), x, 7, (6*B*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (10*C*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (10*C*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*B*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)*cos(c + d*x)^(1/2), x, 6, (6*C*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (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) + (2*C*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(1/2), x, 5, (2*B*Elliptic.E((1/2)*(c + d*x), 2))/d + (2*C*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*C*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(3/2), x, 4, (2*C*Elliptic.E((1/2)*(c + d*x), 2))/d + (2*B*Elliptic.F((1/2)*(c + d*x), 2))/d]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(5/2), x, 5, -((2*B*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*C*Elliptic.F((1/2)*(c + d*x), 2))/d + (2*B*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(7/2), x, 6, -((2*C*Elliptic.E((1/2)*(c + d*x), 2))/d) + (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)) + (2*C*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(9/2), x, 7, -((6*B*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*C*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*B*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*C*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (6*B*sin(c + d*x))/(5*d*sqrt(cos(c + d*x)))]

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

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

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

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

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

    @test_int [cos(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 7, (1/16)*(6*A + 5*C)*x + (B*sin(c + d*x))/d + ((6*A + 5*C)*cos(c + d*x)*sin(c + d*x))/(16*d) + ((6*A + 5*C)*cos(c + d*x)^3*sin(c + d*x))/(24*d) + (C*cos(c + d*x)^5*sin(c + d*x))/(6*d) - (2*B*sin(c + d*x)^3)/(3*d) + (B*sin(c + d*x)^5)/(5*d)]
    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 7, (3*B*x)/8 + ((5*A + 4*C)*sin(c + d*x))/(5*d) + (3*B*cos(c + d*x)*sin(c + d*x))/(8*d) + (B*cos(c + d*x)^3*sin(c + d*x))/(4*d) + (C*cos(c + d*x)^4*sin(c + d*x))/(5*d) - ((5*A + 4*C)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 6, (1/8)*(4*A + 3*C)*x + (B*sin(c + d*x))/d + ((4*A + 3*C)*cos(c + d*x)*sin(c + d*x))/(8*d) + (C*cos(c + d*x)^3*sin(c + d*x))/(4*d) - (B*sin(c + d*x)^3)/(3*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 2, (B*x)/2 + ((3*A + 2*C)*sin(c + d*x))/(3*d) + (B*cos(c + d*x)*sin(c + d*x))/(2*d) + (C*cos(c + d*x)^2*sin(c + d*x))/(3*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 4, A*x + (C*x)/2 + (B*sin(c + d*x))/d + (C*cos(c + d*x)*sin(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 3, B*x + (A*atanh(sin(c + d*x)))/d + (C*sin(c + d*x))/d]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 3, C*x + (B*atanh(sin(c + d*x)))/d + (A*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 5, ((A + 2*C)*atanh(sin(c + d*x)))/(2*d) + (B*tan(c + d*x))/d + (A*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 6, (B*atanh(sin(c + d*x)))/(2*d) + ((2*A + 3*C)*tan(c + d*x))/(3*d) + (B*sec(c + d*x)*tan(c + d*x))/(2*d) + (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) + C*cos(c + d*x)^2), x, 6, ((3*A + 4*C)*atanh(sin(c + d*x)))/(8*d) + (B*tan(c + d*x))/d + ((3*A + 4*C)*sec(c + d*x)*tan(c + d*x))/(8*d) + (A*sec(c + d*x)^3*tan(c + d*x))/(4*d) + (B*tan(c + d*x)^3)/(3*d)]
    @test_int [sec(c + d*x)^6*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 7, (3*B*atanh(sin(c + d*x)))/(8*d) + ((4*A + 5*C)*tan(c + d*x))/(5*d) + (3*B*sec(c + d*x)*tan(c + d*x))/(8*d) + (B*sec(c + d*x)^3*tan(c + d*x))/(4*d) + (A*sec(c + d*x)^4*tan(c + d*x))/(5*d) + ((4*A + 5*C)*tan(c + d*x)^3)/(15*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x)), x, 7, (1/8)*a*(4*A + 3*(B + C))*x + (a*(5*A + 5*B + 4*C)*sin(c + d*x))/(5*d) + (a*(4*A + 3*(B + C))*cos(c + d*x)*sin(c + d*x))/(8*d) + (a*(B + C)*cos(c + d*x)^3*sin(c + d*x))/(4*d) + (a*C*cos(c + d*x)^4*sin(c + d*x))/(5*d) - (a*(5*A + 5*B + 4*C)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x)), x, 3, (1/8)*a*(4*A + 4*B + 3*C)*x + (a*(3*A + 2*(B + C))*sin(c + d*x))/(3*d) + (a*(4*A + 4*B + 3*C)*cos(c + d*x)*sin(c + d*x))/(8*d) + (a*(B + C)*cos(c + d*x)^2*sin(c + d*x))/(3*d) + (a*C*cos(c + d*x)^3*sin(c + d*x))/(4*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x)), x, 2, (1/2)*a*(2*A + B + C)*x + (a*(3*A + 3*B + C)*sin(c + d*x))/(3*d) + (a*(3*B - C)*cos(c + d*x)*sin(c + d*x))/(6*d) + (C*(a + a*cos(c + d*x))^2*sin(c + d*x))/(3*a*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x)), x, 4, (1/2)*a*(2*A + 2*B + C)*x + (a*A*atanh(sin(c + d*x)))/d + (a*(B + C)*sin(c + d*x))/d + (a*C*cos(c + d*x)*sin(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x)), x, 4, a*(B + C)*x + (a*(A + B)*atanh(sin(c + d*x)))/d + (a*C*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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x)), x, 4, a*C*x + (a*(A + 2*(B + C))*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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x)), x, 6, (a*(A + B + 2*C)*atanh(sin(c + d*x)))/(2*d) + (a*(2*A + 3*(B + C))*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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x)), x, 7, (a*(3*A + 4*(B + C))*atanh(sin(c + d*x)))/(8*d) - (a*(A + B - 3*(A + B + C))*tan(c + d*x))/(3*d) + (a*(3*A + 4*(B + C))*sec(c + d*x)*tan(c + d*x))/(8*d) + (a*(A + B)*sec(c + d*x)^2*tan(c + d*x))/(3*d) + (a*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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^2, x, 9, (1/16)*a^2*(14*A + 12*B + 11*C)*x + (a^2*(10*A + 9*B + 8*C)*sin(c + d*x))/(5*d) + (a^2*(14*A + 12*B + 11*C)*cos(c + d*x)*sin(c + d*x))/(16*d) + (a^2*(10*A + 12*B + 9*C)*cos(c + d*x)^3*sin(c + d*x))/(40*d) + (C*cos(c + d*x)^3*(a + a*cos(c + d*x))^2*sin(c + d*x))/(6*d) + ((3*B + C)*cos(c + d*x)^3*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(15*d) - (a^2*(10*A + 9*B + 8*C)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^2, x, 5, (1/8)*a^2*(8*A + 7*B + 6*C)*x + (a^2*(8*A + 7*B + 6*C)*sin(c + d*x))/(6*d) + (a^2*(8*A + 7*B + 6*C)*cos(c + d*x)*sin(c + d*x))/(24*d) + ((20*A - 5*B + 6*C)*(a + a*cos(c + d*x))^2*sin(c + d*x))/(60*d) + (C*cos(c + d*x)^2*(a + a*cos(c + d*x))^2*sin(c + d*x))/(5*d) + ((5*B + 2*C)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(20*a*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^2, x, 3, (1/8)*a^2*(12*A + 8*B + 7*C)*x + (a^2*(12*A + 8*B + 7*C)*sin(c + d*x))/(6*d) + (a^2*(12*A + 8*B + 7*C)*cos(c + d*x)*sin(c + d*x))/(24*d) + ((4*B - C)*(a + a*cos(c + d*x))^2*sin(c + d*x))/(12*d) + (C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(4*a*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^2, x, 6, (1/2)*a^2*(4*A + 3*B + 2*C)*x + (a^2*A*atanh(sin(c + d*x)))/d + (a^2*(2*A + 3*B + 2*C)*sin(c + d*x))/(2*d) + (C*(a + a*cos(c + d*x))^2*sin(c + d*x))/(3*d) + ((3*B + 2*C)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(6*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^2, x, 6, (1/2)*a^2*(2*A + 4*B + 3*C)*x + (a^2*(2*A + B)*atanh(sin(c + d*x)))/d - (a^2*(2*A - 2*B - 3*C)*sin(c + d*x))/(2*d) - ((2*A - C)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(2*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^2, x, 6, a^2*(B + 2*C)*x + (a^2*(3*A + 4*B + 2*C)*atanh(sin(c + d*x)))/(2*d) - (a^2*(3*A + 2*B - 2*C)*sin(c + d*x))/(2*d) + ((A + B)*(a^2 + a^2*cos(c + d*x))*tan(c + d*x))/d + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^2, x, 6, a^2*C*x + (a^2*(2*A + 3*B + 4*C)*atanh(sin(c + d*x)))/(2*d) + (a^2*(2*A + 3*B + 2*C)*tan(c + d*x))/(2*d) + ((2*A + 3*B)*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(6*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^2, x, 8, (a^2*(7*A + 8*B + 12*C)*atanh(sin(c + d*x)))/(8*d) + (a^2*(4*A + 5*B + 6*C)*tan(c + d*x))/(3*d) + (a^2*(11*A + 16*B + 12*C)*sec(c + d*x)*tan(c + d*x))/(24*d) + ((A + 2*B)*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(6*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^2, x, 9, (a^2*(6*A + 7*B + 8*C)*atanh(sin(c + d*x)))/(8*d) + (a^2*(18*A + 20*B + 25*C)*tan(c + d*x))/(15*d) + (a^2*(6*A + 7*B + 8*C)*sec(c + d*x)*tan(c + d*x))/(8*d) + (a^2*(18*A + 25*B + 20*C)*sec(c + d*x)^2*tan(c + d*x))/(60*d) + ((2*A + 5*B)*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(20*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^3, x, 10, (1/16)*a^3*(26*A + 23*B + 21*C)*x + (a^3*(133*A + 119*B + 108*C)*sin(c + d*x))/(35*d) + (a^3*(26*A + 23*B + 21*C)*cos(c + d*x)*sin(c + d*x))/(16*d) + (a^3*(154*A + 147*B + 129*C)*cos(c + d*x)^3*sin(c + d*x))/(280*d) + (C*cos(c + d*x)^3*(a + a*cos(c + d*x))^3*sin(c + d*x))/(7*d) + ((7*B + 3*C)*cos(c + d*x)^3*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(42*a*d) + ((3*A + 4*B + 3*C)*cos(c + d*x)^3*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(15*d) - (a^3*(133*A + 119*B + 108*C)*sin(c + d*x)^3)/(105*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^3, x, 11, (1/16)*a^3*(30*A + 26*B + 23*C)*x + (a^3*(30*A + 26*B + 23*C)*sin(c + d*x))/(10*d) + (3*a^3*(30*A + 26*B + 23*C)*cos(c + d*x)*sin(c + d*x))/(80*d) + ((30*A - 6*B + 7*C)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(120*d) + (C*cos(c + d*x)^2*(a + a*cos(c + d*x))^3*sin(c + d*x))/(6*d) + ((2*B + C)*(a + a*cos(c + d*x))^4*sin(c + d*x))/(10*a*d) - (a^3*(30*A + 26*B + 23*C)*sin(c + d*x)^3)/(120*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^3, x, 9, (1/8)*a^3*(20*A + 15*B + 13*C)*x + (a^3*(20*A + 15*B + 13*C)*sin(c + d*x))/(5*d) + (3*a^3*(20*A + 15*B + 13*C)*cos(c + d*x)*sin(c + d*x))/(40*d) + ((5*B - C)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(20*d) + (C*(a + a*cos(c + d*x))^4*sin(c + d*x))/(5*a*d) - (a^3*(20*A + 15*B + 13*C)*sin(c + d*x)^3)/(60*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^3, x, 7, (1/8)*a^3*(28*A + 20*B + 15*C)*x + (a^3*A*atanh(sin(c + d*x)))/d + (5*a^3*(4*A + 4*B + 3*C)*sin(c + d*x))/(8*d) + (C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(4*d) + ((4*B + 3*C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(12*a*d) + ((12*A + 20*B + 15*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(24*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^3, x, 7, (1/2)*a^3*(6*A + 7*B + 5*C)*x + (a^3*(3*A + B)*atanh(sin(c + d*x)))/d + (5*a^3*(B + C)*sin(c + d*x))/(2*d) - ((3*A - C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(3*a*d) - ((6*A - 3*B - 5*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(6*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^3, x, 7, (1/2)*a^3*(2*A + 6*B + 7*C)*x + (a^3*(7*A + 6*B + 2*C)*atanh(sin(c + d*x)))/(2*d) - (5*a^3*(A - C)*sin(c + d*x))/(2*d) - ((4*A + 2*B - C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(2*d) + ((3*A + 2*B)*(a^2 + a^2*cos(c + d*x))^2*tan(c + d*x))/(2*a*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^3, x, 7, a^3*(B + 3*C)*x + (a^3*(5*A + 7*B + 6*C)*atanh(sin(c + d*x)))/(2*d) - (5*a^3*(A + B)*sin(c + d*x))/(2*d) + ((5*A + 6*B + 3*C)*(a^3 + a^3*cos(c + d*x))*tan(c + d*x))/(3*d) + ((A + B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(2*a*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^3, x, 7, a^3*C*x + (a^3*(15*A + 20*B + 28*C)*atanh(sin(c + d*x)))/(8*d) + (5*a^3*(3*A + 4*(B + C))*tan(c + d*x))/(8*d) + ((15*A + 20*B + 12*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(24*d) + ((3*A + 4*B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(12*a*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^3, x, 9, (a^3*(13*A + 15*B + 20*C)*atanh(sin(c + d*x)))/(8*d) + (a^3*(38*A + 45*B + 55*C)*tan(c + d*x))/(15*d) + (a^3*(109*A + 135*B + 140*C)*sec(c + d*x)*tan(c + d*x))/(120*d) + ((11*A + 15*B + 10*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(30*d) + ((3*A + 5*B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(20*a*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^3, x, 10, (a^3*(23*A + 26*B + 30*C)*atanh(sin(c + d*x)))/(16*d) + (a^3*(34*A + 38*B + 45*C)*tan(c + d*x))/(15*d) + (a^3*(23*A + 26*B + 30*C)*sec(c + d*x)*tan(c + d*x))/(16*d) + (a^3*(73*A + 86*B + 90*C)*sec(c + d*x)^2*tan(c + d*x))/(120*d) + ((31*A + 42*B + 30*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(120*d) + ((A + 2*B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^4*tan(c + d*x))/(10*a*d) + (A*(a + a*cos(c + d*x))^3*sec(c + d*x)^5*tan(c + d*x))/(6*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^4, x, 11, (1/128)*a^4*(392*A + 352*B + 323*C)*x + (a^4*(252*A + 227*B + 208*C)*sin(c + d*x))/(35*d) + (a^4*(392*A + 352*B + 323*C)*cos(c + d*x)*sin(c + d*x))/(128*d) + (a^4*(2408*A + 2208*B + 2007*C)*cos(c + d*x)^3*sin(c + d*x))/(2240*d) + (a*(2*B + C)*cos(c + d*x)^3*(a + a*cos(c + d*x))^3*sin(c + d*x))/(14*d) + (C*cos(c + d*x)^3*(a + a*cos(c + d*x))^4*sin(c + d*x))/(8*d) + ((56*A + 80*B + 61*C)*cos(c + d*x)^3*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(336*d) + (7*(8*A + 8*B + 7*C)*cos(c + d*x)^3*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(120*d) - (a^4*(252*A + 227*B + 208*C)*sin(c + d*x)^3)/(105*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^4, x, 14, (1/16)*a^4*(56*A + 49*B + 44*C)*x + (4*a^4*(56*A + 49*B + 44*C)*sin(c + d*x))/(35*d) + (27*a^4*(56*A + 49*B + 44*C)*cos(c + d*x)*sin(c + d*x))/(560*d) + (a^4*(56*A + 49*B + 44*C)*cos(c + d*x)^3*sin(c + d*x))/(280*d) + ((42*A - 7*B + 8*C)*(a + a*cos(c + d*x))^4*sin(c + d*x))/(210*d) + (C*cos(c + d*x)^2*(a + a*cos(c + d*x))^4*sin(c + d*x))/(7*d) + ((7*B + 4*C)*(a + a*cos(c + d*x))^5*sin(c + d*x))/(42*a*d) - (2*a^4*(56*A + 49*B + 44*C)*sin(c + d*x)^3)/(105*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^4, x, 12, (7/16)*a^4*(10*A + 8*B + 7*C)*x + (4*a^4*(10*A + 8*B + 7*C)*sin(c + d*x))/(5*d) + (27*a^4*(10*A + 8*B + 7*C)*cos(c + d*x)*sin(c + d*x))/(80*d) + (a^4*(10*A + 8*B + 7*C)*cos(c + d*x)^3*sin(c + d*x))/(40*d) + ((6*B - C)*(a + a*cos(c + d*x))^4*sin(c + d*x))/(30*d) + (C*(a + a*cos(c + d*x))^5*sin(c + d*x))/(6*a*d) - (2*a^4*(10*A + 8*B + 7*C)*sin(c + d*x)^3)/(15*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^4, x, 8, (1/8)*a^4*(48*A + 35*B + 28*C)*x + (a^4*A*atanh(sin(c + d*x)))/d + (a^4*(40*A + 35*B + 28*C)*sin(c + d*x))/(8*d) + (a*(5*B + 4*C)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(20*d) + (C*(a + a*cos(c + d*x))^4*sin(c + d*x))/(5*d) + ((20*A + 35*B + 28*C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(60*d) + ((32*A + 35*B + 28*C)*(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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^4, x, 8, (1/8)*a^4*(52*A + 48*B + 35*C)*x + (a^4*(4*A + B)*atanh(sin(c + d*x)))/d + (5*a^4*(4*A + 8*B + 7*C)*sin(c + d*x))/(8*d) - (a*(4*A - C)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(4*d) - ((12*A - 4*B - 7*C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(12*d) - ((12*A - 32*B - 35*C)*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(24*d) + (A*(a + a*cos(c + d*x))^4*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^4, x, 8, (1/2)*a^4*(8*A + 13*B + 12*C)*x + (a^4*(13*A + 8*B + 2*C)*atanh(sin(c + d*x)))/(2*d) - (5*a^4*(A - B - 2*C)*sin(c + d*x))/(2*d) - ((15*A + 6*B - 2*C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(6*d) - ((18*A + 3*B - 8*C)*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(6*d) + (a*(2*A + B)*(a + a*cos(c + d*x))^3*tan(c + d*x))/d + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^4, x, 8, (1/2)*a^4*(2*A + 8*B + 13*C)*x + (a^4*(12*A + 13*B + 8*C)*atanh(sin(c + d*x)))/(2*d) - (5*a^4*(2*A + B - C)*sin(c + d*x))/(2*d) - ((22*A + 18*B + 3*C)*(a^4 + a^4*cos(c + d*x))*sin(c + d*x))/(6*d) + ((16*A + 15*B + 6*C)*(a^2 + a^2*cos(c + d*x))^2*tan(c + d*x))/(6*d) + (a*(4*A + 3*B)*(a + a*cos(c + d*x))^3*sec(c + d*x)*tan(c + d*x))/(6*d) + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^4, x, 8, a^4*(B + 4*C)*x + (a^4*(35*A + 48*B + 52*C)*atanh(sin(c + d*x)))/(8*d) - (5*a^4*(7*A + 8*B + 4*C)*sin(c + d*x))/(8*d) + ((35*A + 44*B + 36*C)*(a^4 + a^4*cos(c + d*x))*tan(c + d*x))/(12*d) + ((7*A + 8*B + 4*C)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(8*d) + (a*(A + B)*(a + a*cos(c + d*x))^3*sec(c + d*x)^2*tan(c + d*x))/(3*d) + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [sec(c + d*x)^6*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^4, x, 8, a^4*C*x + (a^4*(28*A + 35*B + 48*C)*atanh(sin(c + d*x)))/(8*d) + (a^4*(28*A + 35*B + 40*C)*tan(c + d*x))/(8*d) + ((28*A + 35*B + 32*C)*(a^4 + a^4*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(24*d) + ((28*A + 35*B + 20*C)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(60*d) + (a*(4*A + 5*B)*(a + a*cos(c + d*x))^3*sec(c + d*x)^3*tan(c + d*x))/(20*d) + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)^4*tan(c + d*x))/(5*d)]
    @test_int [sec(c + d*x)^7*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^4, x, 10, (7*a^4*(7*A + 8*B + 10*C)*atanh(sin(c + d*x)))/(16*d) + (a^4*(72*A + 83*B + 100*C)*tan(c + d*x))/(15*d) + (a^4*(417*A + 488*B + 550*C)*sec(c + d*x)*tan(c + d*x))/(240*d) + ((43*A + 52*B + 50*C)*(a^4 + a^4*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(60*d) + ((37*A + 48*B + 30*C)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(120*d) + (a*(2*A + 3*B)*(a + a*cos(c + d*x))^3*sec(c + d*x)^4*tan(c + d*x))/(15*d) + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)^5*tan(c + d*x))/(6*d)]
    @test_int [sec(c + d*x)^8*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^4, x, 11, (a^4*(44*A + 49*B + 56*C)*atanh(sin(c + d*x)))/(16*d) + (a^4*(454*A + 504*B + 581*C)*tan(c + d*x))/(105*d) + (a^4*(44*A + 49*B + 56*C)*sec(c + d*x)*tan(c + d*x))/(16*d) + (a^4*(988*A + 1113*B + 1232*C)*sec(c + d*x)^2*tan(c + d*x))/(840*d) + ((436*A + 511*B + 504*C)*(a^4 + a^4*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(840*d) + ((16*A + 21*B + 14*C)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^4*tan(c + d*x))/(70*d) + (a*(4*A + 7*B)*(a + a*cos(c + d*x))^3*sec(c + d*x)^5*tan(c + d*x))/(42*d) + (A*(a + a*cos(c + d*x))^4*sec(c + d*x)^6*tan(c + d*x))/(7*d)]

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

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

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^2, x, 7, -(((4*A - 7*B + 10*C)*x)/(2*a^2)) + ((5*A - 8*B + 12*C)*sin(c + d*x))/(a^2*d) - ((4*A - 7*B + 10*C)*cos(c + d*x)*sin(c + d*x))/(2*a^2*d) - ((4*A - 7*B + 10*C)*cos(c + d*x)^3*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*cos(c + d*x)^4*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2) - ((5*A - 8*B + 12*C)*sin(c + d*x)^3)/(3*a^2*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^2, x, 3, ((2*A - 4*B + 7*C)*x)/(2*a^2) - (2*(2*A - 5*B + 8*C)*sin(c + d*x))/(3*a^2*d) + ((2*A - 4*B + 7*C)*cos(c + d*x)*sin(c + d*x))/(2*a^2*d) - ((2*A - 5*B + 8*C)*cos(c + d*x)^2*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*cos(c + d*x)^3*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) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^2, x, 6, ((B - 2*C)*x)/a^2 + ((A - B + 4*C)*sin(c + d*x))/(3*a^2*d) - ((B - 2*C)*sin(c + d*x))/(a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*cos(c + d*x)^2*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) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^2, x, 3, (C*x)/a^2 + ((A + 2*B - 5*C)*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) + ((A - B + C)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^2, x, 4, (A*atanh(sin(c + d*x)))/(a^2*d) - ((4*A - B - 2*C)*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*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) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^2, x, 6, -(((2*A - B)*atanh(sin(c + d*x)))/(a^2*d)) + ((10*A - 4*B + C)*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 + C)*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) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^2, x, 7, ((7*A - 4*B + 2*C)*atanh(sin(c + d*x)))/(2*a^2*d) - (2*(8*A - 5*B + 2*C)*tan(c + d*x))/(3*a^2*d) + ((7*A - 4*B + 2*C)*sec(c + d*x)*tan(c + d*x))/(2*a^2*d) - ((8*A - 5*B + 2*C)*sec(c + d*x)*tan(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*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) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^2, x, 7, -(((10*A - 7*B + 4*C)*atanh(sin(c + d*x)))/(2*a^2*d)) + ((12*A - 8*B + 5*C)*tan(c + d*x))/(a^2*d) - ((10*A - 7*B + 4*C)*sec(c + d*x)*tan(c + d*x))/(2*a^2*d) - ((10*A - 7*B + 4*C)*sec(c + d*x)^2*tan(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*sec(c + d*x)^2*tan(c + d*x))/(3*d*(a + a*cos(c + d*x))^2) + ((12*A - 8*B + 5*C)*tan(c + d*x)^3)/(3*a^2*d)]

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

    @test_int [cos(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^4, x, 5, ((2*A - 8*B + 21*C)*x)/(2*a^4) - (8*(20*A - 83*B + 216*C)*sin(c + d*x))/(105*a^4*d) + ((2*A - 8*B + 21*C)*cos(c + d*x)*sin(c + d*x))/(2*a^4*d) - ((10*A - 52*B + 129*C)*cos(c + d*x)^3*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - (4*(20*A - 83*B + 216*C)*cos(c + d*x)^2*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A - B + C)*cos(c + d*x)^5*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) + ((B - 2*C)*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)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^4, x, 8, ((B - 4*C)*x)/a^4 + ((6*A - 55*B + 244*C)*sin(c + d*x))/(105*a^4*d) + ((3*A + 25*B - 88*C)*cos(c + d*x)^2*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - ((B - 4*C)*sin(c + d*x))/(a^4*d*(1 + cos(c + d*x))) - ((A - B + C)*cos(c + d*x)^4*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) + ((2*A + 5*B - 12*C)*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)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^4, x, 6, (C*x)/a^4 - ((8*A + 6*B - 55*C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) + ((16*A + 12*B - 215*C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A - B + C)*cos(c + d*x)^3*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) + ((4*A + 3*B - 10*C)*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)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^4, x, 5, ((23*A - 2*B - 54*C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) + ((8*A + 13*B + 36*C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A - B + C)*cos(c + d*x)^2*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - ((6*A + B - 8*C)*sin(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^4, x, 4, ((A - B + C)*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) + ((3*A + 4*B - 11*C)*sin(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3) + ((6*A + 8*B + 13*C)*sin(c + d*x))/(105*d*(a^2 + a^2*cos(c + d*x))^2) + ((6*A + 8*B + 13*C)*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) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^4, x, 6, (A*atanh(sin(c + d*x)))/(a^4*d) - ((55*A - 6*B - 8*C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - (2*(80*A - 3*B - 4*C)*sin(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A - B + C)*sin(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - ((10*A - 3*B - 4*C)*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) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^4, x, 8, -(((4*A - B)*atanh(sin(c + d*x)))/(a^4*d)) + (2*(332*A - 80*B + 3*C)*tan(c + d*x))/(105*a^4*d) - ((88*A - 25*B - 3*C)*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 + C)*tan(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - ((12*A - 5*B - 2*C)*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) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^4, x, 9, ((21*A - 8*B + 2*C)*atanh(sin(c + d*x)))/(2*a^4*d) - (8*(216*A - 83*B + 20*C)*tan(c + d*x))/(105*a^4*d) + ((21*A - 8*B + 2*C)*sec(c + d*x)*tan(c + d*x))/(2*a^4*d) - ((129*A - 52*B + 10*C)*sec(c + d*x)*tan(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - (4*(216*A - 83*B + 20*C)*sec(c + d*x)*tan(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))) - ((A - B + C)*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)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^4, x, 9, -(((44*A - 21*B + 8*C)*atanh(sin(c + d*x)))/(2*a^4*d)) + (4*(454*A - 216*B + 83*C)*tan(c + d*x))/(35*a^4*d) - ((44*A - 21*B + 8*C)*sec(c + d*x)*tan(c + d*x))/(2*a^4*d) - ((178*A - 87*B + 31*C)*sec(c + d*x)^2*tan(c + d*x))/(105*a^4*d*(1 + cos(c + d*x))^2) - ((44*A - 21*B + 8*C)*sec(c + d*x)^2*tan(c + d*x))/(3*a^4*d*(1 + cos(c + d*x))) - ((A - B + C)*sec(c + d*x)^2*tan(c + d*x))/(7*d*(a + a*cos(c + d*x))^4) - ((16*A - 9*B + 2*C)*sec(c + d*x)^2*tan(c + d*x))/(35*a*d*(a + a*cos(c + d*x))^3) + (4*(454*A - 216*B + 83*C)*tan(c + d*x)^3)/(105*a^4*d)]

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

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

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(1/2), x, 6, (4*a*(99*A + 88*B + 80*C)*sin(c + d*x))/(495*d*sqrt(a + a*cos(c + d*x))) + (2*a*(99*A + 88*B + 80*C)*cos(c + d*x)^3*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) + (2*a*(11*B + C)*cos(c + d*x)^4*sin(c + d*x))/(99*d*sqrt(a + a*cos(c + d*x))) - (8*(99*A + 88*B + 80*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3465*d) + (2*C*cos(c + d*x)^4*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(11*d) + (4*(99*A + 88*B + 80*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(1155*a*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(1/2), x, 5, (2*a*(21*A + 18*B + 16*C)*sin(c + d*x))/(45*d*sqrt(a + a*cos(c + d*x))) + (2*a*(9*B + C)*cos(c + d*x)^3*sin(c + d*x))/(63*d*sqrt(a + a*cos(c + d*x))) - (4*(21*A + 18*B + 16*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d) + (2*C*cos(c + d*x)^3*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(9*d) + (2*(21*A + 18*B + 16*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(105*a*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(1/2), x, 5, (2*a*(35*A + 49*B + 27*C)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*(35*A - 14*B + 18*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*d) + (2*C*cos(c + d*x)^2*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(7*d) + (2*(7*B + C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*a*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(1/2), x, 3, (2*a*(15*A + 5*B + 7*C)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*(5*B - 2*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*d) + (2*C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*a*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(1/2), x, 4, (2*sqrt(a)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a*(3*B + C)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*C*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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(1/2), x, 4, (sqrt(a)*(A + 2*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a*(A - 2*C)*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(1/2), x, 4, (sqrt(a)*(3*A + 4*B + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) + (a*(A + 4*B)*tan(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(1/2), x, 5, (sqrt(a)*(5*A + 6*B + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a*(5*A + 6*B + 8*C)*tan(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) + (a*(A + 6*B)*sec(c + d*x)*tan(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(1/2), x, 6, (sqrt(a)*(35*A + 40*B + 48*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a*(35*A + 40*B + 48*C)*tan(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a*(35*A + 40*B + 48*C)*sec(c + d*x)*tan(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) + (a*(A + 8*B)*sec(c + d*x)^2*tan(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(3/2), x, 6, (2*a^2*(429*A + 374*B + 336*C)*sin(c + d*x))/(495*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(99*A + 110*B + 84*C)*cos(c + d*x)^3*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) - (4*a*(429*A + 374*B + 336*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3465*d) + (2*a*(11*B + 3*C)*cos(c + d*x)^3*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(99*d) + (2*(429*A + 374*B + 336*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(1155*d) + (2*C*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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(3/2), x, 6, (8*a^2*(63*A + 57*B + 47*C)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a*(63*A + 57*B + 47*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d) + (2*(63*A - 18*B + 22*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(315*d) + (2*C*cos(c + d*x)^2*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(9*d) + (2*(3*B + C)*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(21*a*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(3/2), x, 4, (8*a^2*(35*A + 21*B + 19*C)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*(35*A + 21*B + 19*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*d) + (2*(7*B - 2*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*d) + (2*C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*a*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(3/2), x, 5, (2*a^(3/2)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^2*(15*A + 20*B + 12*C)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a*(5*B + 3*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*d) + (2*C*(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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(3/2), x, 5, (a^(3/2)*(3*A + 2*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a^2*(3*A - 6*B - 8*C)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) - (a*(3*A - 2*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(3/2), x, 5, (a^(3/2)*(7*A + 12*B + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) - (a^2*(5*A + 4*B - 8*C)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (a*(3*A + 4*B)*sqrt(a + a*cos(c + d*x))*tan(c + d*x))/(4*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(3/2), x, 5, (a^(3/2)*(11*A + 14*B + 24*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a^2*(19*A + 30*B + 24*C)*tan(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (a*(A + 2*B)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(4*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(3/2), x, 6, (a^(3/2)*(75*A + 88*B + 112*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^2*(75*A + 88*B + 112*C)*tan(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a^2*(39*A + 56*B + 48*C)*sec(c + d*x)*tan(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) + (a*(3*A + 8*B)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(24*d) + (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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(3/2), x, 7, (a^(3/2)*(133*A + 150*B + 176*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(128*d) + (a^2*(133*A + 150*B + 176*C)*tan(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))) + (a^2*(133*A + 150*B + 176*C)*sec(c + d*x)*tan(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^2*(67*A + 90*B + 80*C)*sec(c + d*x)^2*tan(c + d*x))/(240*d*sqrt(a + a*cos(c + d*x))) + (a*(3*A + 10*B)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(40*d) + (A*(a + a*cos(c + d*x))^(3/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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(5/2), x, 7, (2*a^3*(10439*A + 9230*B + 8368*C)*sin(c + d*x))/(6435*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(2717*A + 2522*B + 2224*C)*cos(c + d*x)^3*sin(c + d*x))/(9009*d*sqrt(a + a*cos(c + d*x))) - (4*a^2*(10439*A + 9230*B + 8368*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(45045*d) + (2*a^2*(143*A + 182*B + 136*C)*cos(c + d*x)^3*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(1287*d) + (2*a*(10439*A + 9230*B + 8368*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(15015*d) + (2*a*(13*B + 5*C)*cos(c + d*x)^3*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(143*d) + (2*C*cos(c + d*x)^3*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(13*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(5/2), x, 7, (64*a^3*(165*A + 143*B + 125*C)*sin(c + d*x))/(3465*d*sqrt(a + a*cos(c + d*x))) + (16*a^2*(165*A + 143*B + 125*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3465*d) + (2*a*(165*A + 143*B + 125*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(1155*d) + (2*(99*A - 22*B + 26*C)*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(693*d) + (2*C*cos(c + d*x)^2*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(11*d) + (2*(11*B + 5*C)*(a + a*cos(c + d*x))^(7/2)*sin(c + d*x))/(99*a*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(5/2), x, 5, (64*a^3*(21*A + 15*B + 13*C)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (16*a^2*(21*A + 15*B + 13*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d) + (2*a*(21*A + 15*B + 13*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(105*d) + (2*(9*B - 2*C)*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(63*d) + (2*C*(a + a*cos(c + d*x))^(7/2)*sin(c + d*x))/(9*a*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(5/2), x, 6, (2*a^(5/2)*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^3*(245*A + 224*B + 160*C)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(35*A + 56*B + 40*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*d) + (2*a*(7*B + 5*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*d) + (2*C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(5/2), x, 6, (a^(5/2)*(5*A + 2*B)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (a^3*(15*A + 70*B + 64*C)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) - (a^2*(15*A - 10*B - 16*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*d) - (a*(5*A - 2*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d) + (A*(a + a*cos(c + d*x))^(5/2)*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(5/2), x, 6, (a^(5/2)*(19*A + 20*B + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) - (a^3*(27*A - 12*B - 56*C)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) - (a^2*(21*A + 12*B - 8*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(12*d) + (a*(5*A + 4*B)*(a + a*cos(c + d*x))^(3/2)*tan(c + d*x))/(4*d) + (A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(5/2), x, 6, (a^(5/2)*(25*A + 38*B + 40*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) - (a^3*(49*A + 54*B - 24*C)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (a^2*(31*A + 42*B + 24*C)*sqrt(a + a*cos(c + d*x))*tan(c + d*x))/(24*d) + (a*(5*A + 6*B)*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)*tan(c + d*x))/(12*d) + (A*(a + a*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(5/2), x, 6, (a^(5/2)*(163*A + 200*B + 304*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^3*(299*A + 392*B + 432*C)*tan(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^2*(17*A + 24*B + 16*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(32*d) + (a*(5*A + 8*B)*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^2*tan(c + d*x))/(24*d) + (A*(a + a*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(5/2), x, 7, (a^(5/2)*(283*A + 326*B + 400*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(128*d) + (a^3*(283*A + 326*B + 400*C)*tan(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))) + (a^3*(787*A + 950*B + 1040*C)*sec(c + d*x)*tan(c + d*x))/(960*d*sqrt(a + a*cos(c + d*x))) + (a^2*(79*A + 110*B + 80*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(240*d) + (a*(A + 2*B)*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^3*tan(c + d*x))/(8*d) + (A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^4*tan(c + d*x))/(5*d)]
    @test_int [sec(c + d*x)^7*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^(5/2), x, 8, (a^(5/2)*(1015*A + 1132*B + 1304*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(512*d) + (a^3*(1015*A + 1132*B + 1304*C)*tan(c + d*x))/(512*d*sqrt(a + a*cos(c + d*x))) + (a^3*(1015*A + 1132*B + 1304*C)*sec(c + d*x)*tan(c + d*x))/(768*d*sqrt(a + a*cos(c + d*x))) + (a^3*(545*A + 628*B + 680*C)*sec(c + d*x)^2*tan(c + d*x))/(960*d*sqrt(a + a*cos(c + d*x))) + (a^2*(115*A + 156*B + 120*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^3*tan(c + d*x))/(480*d) + (a*(5*A + 12*B)*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^4*tan(c + d*x))/(60*d) + (A*(a + a*cos(c + d*x))^(5/2)*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) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(1/2), x, 8, -((sqrt(2)*(A - B + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d)) + (4*(147*A - 111*B + 143*C)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*(21*A - 3*B + 19*C)*cos(c + d*x)^2*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*(9*B - C)*cos(c + d*x)^3*sin(c + d*x))/(63*d*sqrt(a + a*cos(c + d*x))) + (2*C*cos(c + d*x)^4*sin(c + d*x))/(9*d*sqrt(a + a*cos(c + d*x))) - (2*(21*A - 93*B + 29*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*a*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(1/2), x, 7, (sqrt(2)*(A - B + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) - (4*(35*A - 49*B + 37*C)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*(7*B - C)*cos(c + d*x)^2*sin(c + d*x))/(35*d*sqrt(a + a*cos(c + d*x))) + (2*C*cos(c + d*x)^3*sin(c + d*x))/(7*d*sqrt(a + a*cos(c + d*x))) + (2*(35*A - 7*B + 31*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*a*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(1/2), x, 6, -((sqrt(2)*(A - B + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d)) + (2*(15*A - 10*B + 14*C)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*C*cos(c + d*x)^2*sin(c + d*x))/(5*d*sqrt(a + a*cos(c + d*x))) + (2*(5*B - C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(15*a*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(1/2), x, 4, (sqrt(2)*(A - B + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + (2*(3*B - 2*C)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*a*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(1/2), x, 6, (2*A*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(sqrt(a)*d) - (sqrt(2)*(A - B + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + (2*C*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) + C*cos(c + d*x)^2)/(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 + C)*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) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(1/2), x, 7, ((7*A - 4*B + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*sqrt(a)*d) - (sqrt(2)*(A - B + C)*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 [sec(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(1/2), x, 8, -(((9*A - 14*B + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*sqrt(a)*d)) + (sqrt(2)*(A - B + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + ((7*A - 2*B + 8*C)*tan(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) - ((A - 6*B)*sec(c + d*x)*tan(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (A*sec(c + d*x)^2*tan(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(1/2), x, 9, ((107*A - 72*B + 112*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*sqrt(a)*d) - (sqrt(2)*(A - B + C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) - ((21*A - 56*B + 16*C)*tan(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + ((43*A - 8*B + 48*C)*sec(c + d*x)*tan(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) - ((A - 8*B)*sec(c + d*x)^2*tan(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (A*sec(c + d*x)^3*tan(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x)))]

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 8, ((11*A - 15*B + 19*C)*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 + C)*cos(c + d*x)^4*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) - ((455*A - 651*B + 799*C)*sin(c + d*x))/(105*a*d*sqrt(a + a*cos(c + d*x))) - ((35*A - 63*B + 67*C)*cos(c + d*x)^2*sin(c + d*x))/(70*a*d*sqrt(a + a*cos(c + d*x))) + ((7*A - 7*B + 11*C)*cos(c + d*x)^3*sin(c + d*x))/(14*a*d*sqrt(a + a*cos(c + d*x))) + ((245*A - 273*B + 397*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(210*a^2*d)]
    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 7, -(((7*A - 11*B + 15*C)*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 + C)*cos(c + d*x)^3*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((45*A - 65*B + 93*C)*sin(c + d*x))/(15*a*d*sqrt(a + a*cos(c + d*x))) + ((5*A - 5*B + 9*C)*cos(c + d*x)^2*sin(c + d*x))/(10*a*d*sqrt(a + a*cos(c + d*x))) - ((15*A - 35*B + 39*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(30*a^2*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 6, ((3*A - 7*B + 11*C)*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 + C)*cos(c + d*x)^2*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) - ((3*A - 9*B + 13*C)*sin(c + d*x))/(3*a*d*sqrt(a + a*cos(c + d*x))) + ((3*A - 3*B + 7*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(6*a^2*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 4, ((A + 3*B - 7*C)*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 + C)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + (2*C*sin(c + d*x))/(a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(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 - 3*C)*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 + C)*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) + C*cos(c + d*x)^2)/(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 + C)*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 + C)*tan(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((3*A - B + C)*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) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 8, ((19*A - 12*B + 8*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*a^(3/2)*d) - ((13*A - 9*B + 5*C)*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 + 2*C)*tan(c + d*x))/(4*a*d*sqrt(a + a*cos(c + d*x))) - ((A - B + C)*sec(c + d*x)*tan(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((2*A - B + C)*sec(c + d*x)*tan(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + a*cos(c + d*x))^(3/2), x, 9, -(((47*A - 38*B + 24*C)*atanh((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*a^(3/2)*d)) + ((17*A - 13*B + 9*C)*atanh((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(a + a*cos(c + d*x)))))/(2*sqrt(2)*a^(3/2)*d) + ((21*A - 14*B + 12*C)*tan(c + d*x))/(8*a*d*sqrt(a + a*cos(c + d*x))) - ((13*A - 12*B + 6*C)*sec(c + d*x)*tan(c + d*x))/(12*a*d*sqrt(a + a*cos(c + d*x))) - ((A - B + C)*sec(c + d*x)^2*tan(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((5*A - 3*B + 3*C)*sec(c + d*x)^2*tan(c + d*x))/(6*a*d*sqrt(a + a*cos(c + d*x)))]

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

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

    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*cos(c + d*x)^(3/2), x, 6, (6*B*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*(7*A + 5*C)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*(7*A + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*B*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*cos(c + d*x)^(1/2), x, 5, (2*(5*A + 3*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (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) + (2*C*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(1/2), x, 4, (2*B*Elliptic.E((1/2)*(c + d*x), 2))/d + (2*(3*A + C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*C*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(3/2), x, 4, -((2*(A - C)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*B*Elliptic.F((1/2)*(c + d*x), 2))/d + (2*A*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(5/2), x, 5, -((2*B*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*(A + 3*C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*A*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*B*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(7/2), x, 6, -((2*(3*A + 5*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*B*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*A*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*B*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*(3*A + 5*C)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x)))]

    @test_int [cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 8, (2*a*(9*A + 7*(B + C))*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (10*a*(11*A + 11*B + 9*C)*Elliptic.F((1/2)*(c + d*x), 2))/(231*d) + (10*a*(11*A + 11*B + 9*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (2*a*(9*A + 7*(B + C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*a*(11*A + 11*B + 9*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(77*d) + (2*a*(B + C)*cos(c + d*x)^(7/2)*sin(c + d*x))/(9*d) + (2*a*C*cos(c + d*x)^(9/2)*sin(c + d*x))/(11*d)]
    @test_int [cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 7, (2*a*(9*A + 9*B + 7*C)*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (2*a*(7*A + 5*(B + C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*a*(7*A + 5*(B + C))*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a*(9*A + 9*B + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*a*(B + C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d) + (2*a*C*cos(c + d*x)^(7/2)*sin(c + d*x))/(9*d)]
    @test_int [sqrt(cos(c + d*x))*(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 6, (2*a*(5*A + 3*(B + C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*a*(7*A + 7*B + 5*C)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*a*(7*A + 7*B + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a*(B + C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*a*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [((a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 5, (2*a*(5*A + 5*B + 3*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*a*(3*A + B + C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a*(B + C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*a*C*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) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 5, -((2*a*(A - B - C)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*a*(3*A + 3*B + C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a*A*sin(c + d*x))/(d*sqrt(cos(c + d*x))) + (2*a*C*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) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 5, -((2*a*(A + B - C)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*a*(A + 3*(B + C))*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*(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) + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 6, -((2*a*(3*A + 5*(B + C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*a*(A + B + 3*C)*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*(A + B)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*a*(3*A + 5*(B + C))*sin(c + d*x))/(5*d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 7, -((2*a*(3*A + 3*B + 5*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*a*(5*A + 7*(B + C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*a*A*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (2*a*(A + B)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*a*(5*A + 7*(B + C))*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (2*a*(3*A + 3*B + 5*C)*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) + C*cos(c + d*x)^2), x, 9, (4*a^2*(9*A + 8*B + 7*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^2*(66*A + 55*B + 50*C)*Elliptic.F((c + d*x)/2, 2))/(231*d) + (4*a^2*(66*A + 55*B + 50*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (4*a^2*(9*A + 8*B + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*a^2*(99*A + 121*B + 89*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(693*d) + (2*C*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^2*sin(c + d*x))/(11*d) + (2*(11*B + 4*C)*cos(c + d*x)^(5/2)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(99*d)]
    @test_int [sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 8, (4*a^2*(12*A + 9*B + 8*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^2*(7*A + 6*B + 5*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (4*a^2*(7*A + 6*B + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a^2*(21*A + 27*B + 19*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*C*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^2*sin(c + d*x))/(9*d) + (2*(9*B + 4*C)*cos(c + d*x)^(3/2)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(63*d)]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 7, (4*a^2*(5*A + 4*B + 3*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^2*(14*A + 7*B + 6*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a^2*(35*A + 49*B + 33*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(105*d) + (2*C*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2*sin(c + d*x))/(7*d) + (2*(7*B + 4*C)*sqrt(cos(c + d*x))*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(35*d)]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 7, (4*a^2*(5*B + 4*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^2*(3*A + 2*B + C)*Elliptic.F((c + d*x)/2, 2))/(3*d) - (2*a^2*(15*A - 5*B - 7*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) + (2*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - (2*(5*A - C)*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) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 7, (-4*a^2*(A - C)*Elliptic.E((c + d*x)/2, 2))/d + (4*a^2*(2*A + 3*B + 2*C)*Elliptic.F((c + d*x)/2, 2))/(3*d) - (2*a^2*(5*A + 3*B - C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*(4*A + 3*B)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(3*d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/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 + 3*C)*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a^2*(17*A + 25*B + 15*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*(4*A + 5*B)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2))]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 8, (-4*a^2*(3*A + 4*B + 5*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^2*(6*A + 7*B + 14*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a^2*(33*A + 49*B + 35*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (4*a^2*(3*A + 4*B + 5*C)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (2*(4*A + 7*B)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2))]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 9, (-4*a^2*(8*A + 9*B + 12*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^2*(5*A + 6*B + 7*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a^2*(19*A + 27*B + 21*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(5/2)) + (4*a^2*(5*A + 6*B + 7*C)*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (4*a^2*(8*A + 9*B + 12*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^2*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2)) + (2*(4*A + 9*B)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(63*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) + C*cos(c + d*x)^2), x, 10, (4*a^3*(221*A + 195*B + 175*C)*Elliptic.E((c + d*x)/2, 2))/(195*d) + (4*a^3*(121*A + 105*B + 95*C)*Elliptic.F((c + d*x)/2, 2))/(231*d) + (4*a^3*(121*A + 105*B + 95*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (4*a^3*(221*A + 195*B + 175*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(585*d) + (20*a^3*(286*A + 273*B + 236*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(9009*d) + (2*C*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(13*d) + (2*(13*B + 6*C)*cos(c + d*x)^(5/2)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(143*a*d) + (2*(143*A + 195*B + 145*C)*cos(c + d*x)^(5/2)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(1287*d)]
    @test_int [sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 9, (4*a^3*(21*A + 17*B + 15*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^3*(143*A + 121*B + 105*C)*Elliptic.F((c + d*x)/2, 2))/(231*d) + (4*a^3*(143*A + 121*B + 105*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (4*a^3*(264*A + 253*B + 210*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(1155*d) + (2*C*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^3*sin(c + d*x))/(11*d) + (2*(11*B + 6*C)*cos(c + d*x)^(3/2)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(99*a*d) + (2*(99*A + 143*B + 105*C)*cos(c + d*x)^(3/2)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(693*d)]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 8, (4*a^3*(27*A + 21*B + 17*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^3*(21*A + 13*B + 11*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (4*a^3*(42*A + 41*B + 32*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(105*d) + (2*C*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^3*sin(c + d*x))/(9*d) + (2*(3*B + 2*C)*sqrt(cos(c + d*x))*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(21*a*d) + (2*(63*A + 99*B + 73*C)*sqrt(cos(c + d*x))*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(315*d)]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 8, (4*a^3*(5*A + 9*B + 7*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(35*A + 21*B + 13*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) - (4*a^3*(35*A - 42*B - 41*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(105*d) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - (2*(7*A - C)*sqrt(cos(c + d*x))*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(7*a*d) - (2*(35*A - 7*B - 11*C)*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) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 8, (-4*a^3*(5*A - 5*B - 9*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(5*A + 5*B + 3*C)*Elliptic.F((c + d*x)/2, 2))/(3*d) - (4*a^3*(20*A + 5*B - 6*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*(2*A + B)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(a*d*sqrt(cos(c + d*x))) - (2*(35*A + 15*B - 3*C)*sqrt(cos(c + d*x))*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(15*d)]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 8, (-4*a^3*(9*A + 5*B - 5*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(3*A + 5*(B + C))*Elliptic.F((c + d*x)/2, 2))/(3*d) - (4*a^3*(21*A + 20*B + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*(6*A + 5*B)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(15*a*d*cos(c + d*x)^(3/2)) + (2*(33*A + 35*B + 15*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(15*d*sqrt(cos(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 8, (-4*a^3*(7*A + 9*B + 5*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (4*a^3*(13*A + 21*B + 35*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (4*a^3*(106*A + 147*B + 140*C)*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (2*(6*A + 7*B)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(35*a*d*cos(c + d*x)^(5/2)) + (2*(7*A + 9*B + 5*C)*(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) + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 9, (-4*a^3*(17*A + 21*B + 27*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^3*(11*A + 13*B + 21*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (4*a^3*(32*A + 41*B + 42*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (4*a^3*(17*A + 21*B + 27*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2)) + (2*(2*A + 3*B)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(21*a*d*cos(c + d*x)^(7/2)) + (2*(73*A + 99*B + 63*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2))]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(13/2), x, 10, (-4*a^3*(15*A + 17*B + 21*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (4*a^3*(105*A + 121*B + 143*C)*Elliptic.F((c + d*x)/2, 2))/(231*d) + (4*a^3*(210*A + 253*B + 264*C)*sin(c + d*x))/(1155*d*cos(c + d*x)^(5/2)) + (4*a^3*(105*A + 121*B + 143*C)*sin(c + d*x))/(231*d*cos(c + d*x)^(3/2)) + (4*a^3*(15*A + 17*B + 21*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^3*sin(c + d*x))/(11*d*cos(c + d*x)^(11/2)) + (2*(6*A + 11*B)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(99*a*d*cos(c + d*x)^(9/2)) + (2*(105*A + 143*B + 99*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(693*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) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x)), x, 7, (-3*(5*A - 7*B + 7*C)*Elliptic.E((c + d*x)/2, 2))/(5*a*d) + (5*(7*A - 7*B + 9*C)*Elliptic.F((c + d*x)/2, 2))/(21*a*d) + (5*(7*A - 7*B + 9*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*a*d) - ((5*A - 7*B + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*a*d) + ((7*A - 7*B + 9*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*a*d) - ((A - B + C)*cos(c + d*x)^(7/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) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x)), x, 6, (3*(5*A - 5*B + 7*C)*Elliptic.E((c + d*x)/2, 2))/(5*a*d) - ((3*A - 5*B + 5*C)*Elliptic.F((c + d*x)/2, 2))/(3*a*d) - ((3*A - 5*B + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a*d) + ((5*A - 5*B + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*a*d) - ((A - B + C)*cos(c + d*x)^(5/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) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x)), x, 5, -(((A - 3*B + 3*C)*Elliptic.E((c + d*x)/2, 2))/(a*d)) + ((3*A - 3*B + 5*C)*Elliptic.F((c + d*x)/2, 2))/(3*a*d) + ((3*A - 3*B + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a*d) - ((A - B + C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(d*(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + a*cos(c + d*x))), x, 4, ((A - B + 3*C)*Elliptic.E((c + d*x)/2, 2))/(a*d) + ((A + B - C)*Elliptic.F((c + d*x)/2, 2))/(a*d) - ((A - B + C)*sqrt(cos(c + d*x))*sin(c + d*x))/(d*(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))), x, 5, -(((3*A - B + C)*Elliptic.E((c + d*x)/2, 2))/(a*d)) - ((A - B - C)*Elliptic.F((c + d*x)/2, 2))/(a*d) + ((3*A - B + C)*sin(c + d*x))/(a*d*sqrt(cos(c + d*x))) - ((A - B + C)*sin(c + d*x))/(d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))), x, 6, ((3*A - 3*B + C)*Elliptic.E((c + d*x)/2, 2))/(a*d) + ((5*A - 3*B + 3*C)*Elliptic.F((c + d*x)/2, 2))/(3*a*d) + ((5*A - 3*B + 3*C)*sin(c + d*x))/(3*a*d*cos(c + d*x)^(3/2)) - ((3*A - 3*B + C)*sin(c + d*x))/(a*d*sqrt(cos(c + d*x))) - ((A - B + C)*sin(c + d*x))/(d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(7/2)*(a + a*cos(c + d*x))), x, 7, (-3*(7*A - 5*B + 5*C)*Elliptic.E((c + d*x)/2, 2))/(5*a*d) - ((5*A - 5*B + 3*C)*Elliptic.F((c + d*x)/2, 2))/(3*a*d) + ((7*A - 5*B + 5*C)*sin(c + d*x))/(5*a*d*cos(c + d*x)^(5/2)) - ((5*A - 5*B + 3*C)*sin(c + d*x))/(3*a*d*cos(c + d*x)^(3/2)) + (3*(7*A - 5*B + 5*C)*sin(c + d*x))/(5*a*d*sqrt(cos(c + d*x))) - ((A - B + C)*sin(c + d*x))/(d*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x)))]

    @test_int [(cos(c + d*x)^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^2, x, 7, ((20*A - 35*B + 56*C)*Elliptic.E((c + d*x)/2, 2))/(5*a^2*d) - (5*(A - 2*B + 3*C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) - (5*(A - 2*B + 3*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a^2*d) + ((20*A - 35*B + 56*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(15*a^2*d) - ((A - 2*B + 3*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*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)^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^2, x, 6, -(((A - 4*B + 7*C)*Elliptic.E((c + d*x)/2, 2))/(a^2*d)) + ((2*A - 5*B + 10*C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + ((2*A - 5*B + 10*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a^2*d) - ((A - 4*B + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*cos(c + d*x)^(5/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) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^2, x, 5, -(((B - 4*C)*Elliptic.E((c + d*x)/2, 2))/(a^2*d)) + ((A + 2*B - 5*C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + ((A + 2*B - 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2), x, 5, ((A - C)*Elliptic.E((c + d*x)/2, 2))/(a^2*d) + ((2*A + B + 2*C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) - ((A - C)*sqrt(cos(c + d*x))*sin(c + d*x))/(a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*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) + C*cos(c + d*x)^2)/(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 - C)*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 - C)*sin(c + d*x))/(3*a^2*d*sqrt(cos(c + d*x))*(1 + cos(c + d*x))) - ((A - B + C)*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) + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^2), x, 7, ((7*A - 4*B + C)*Elliptic.E((c + d*x)/2, 2))/(a^2*d) + ((10*A - 5*B + 2*C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*d) + ((10*A - 5*B + 2*C)*sin(c + d*x))/(3*a^2*d*cos(c + d*x)^(3/2)) - ((7*A - 4*B + C)*sin(c + d*x))/(a^2*d*sqrt(cos(c + d*x))) - ((7*A - 4*B + C)*sin(c + d*x))/(3*a^2*d*cos(c + d*x)^(3/2)*(1 + cos(c + d*x))) - ((A - B + C)*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)^(7/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 8, (7*(7*A - 17*B + 33*C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) - ((13*A - 33*B + 63*C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) - ((13*A - 33*B + 63*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(6*a^3*d) + (7*(7*A - 17*B + 33*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(30*a^3*d) - ((A - B + C)*cos(c + d*x)^(9/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((2*A - 7*B + 12*C)*cos(c + d*x)^(7/2)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((13*A - 33*B + 63*C)*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)^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 7, -((9*A - 49*B + 119*C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((3*A - 13*B + 33*C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) + ((3*A - 13*B + 33*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(6*a^3*d) - ((A - B + C)*cos(c + d*x)^(7/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((B - 2*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(3*a*d*(a + a*cos(c + d*x))^2) - ((9*A - 49*B + 119*C)*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)^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 6, -((A + 9*B - 49*C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((A + 3*B - 13*C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) - ((A - B + C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((2*A + 3*B - 8*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) + ((A + 3*B - 13*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(6*d*(a^3 + a^3*cos(c + d*x)))]
    @test_int [(sqrt(cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^3, x, 6, ((A - B - 9*C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((A + B + 3*C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) - ((A - B + C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) + ((4*A + B - 6*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((A - B - 9*C)*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) + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^3), x, 6, ((9*A + B - C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((3*A + B + C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) - ((A - B + C)*sqrt(cos(c + d*x))*sin(c + d*x))/(5*d*(a + a*cos(c + d*x))^3) - ((6*A - B - 4*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*a*d*(a + a*cos(c + d*x))^2) - ((9*A + B - C)*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) + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^3), x, 7, -((49*A - 9*B - C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) - ((13*A - 3*B - C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) + ((49*A - 9*B - C)*sin(c + d*x))/(10*a^3*d*sqrt(cos(c + d*x))) - ((A - B + C)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^3) - ((8*A - 3*B - 2*C)*sin(c + d*x))/(15*a*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^2) - ((13*A - 3*B - C)*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) + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^3), x, 8, ((119*A - 49*B + 9*C)*Elliptic.E((c + d*x)/2, 2))/(10*a^3*d) + ((33*A - 13*B + 3*C)*Elliptic.F((c + d*x)/2, 2))/(6*a^3*d) + ((33*A - 13*B + 3*C)*sin(c + d*x))/(6*a^3*d*cos(c + d*x)^(3/2)) - ((119*A - 49*B + 9*C)*sin(c + d*x))/(10*a^3*d*sqrt(cos(c + d*x))) - ((A - B + C)*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) - ((119*A - 49*B + 9*C)*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+B*cos(e+f*x)+C*cos(e+f*x)^2)*(a+a*cos(e+f*x))^(n/2)=#

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

    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*cos(c + d*x)^(3/2), x, 6, (sqrt(a)*(48*A + 40*B + 35*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a*(48*A + 40*B + 35*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a*(48*A + 40*B + 35*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) + (a*(8*B + C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (C*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*cos(c + d*x)^(1/2), x, 5, (sqrt(a)*(8*A + 6*B + 5*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a*(8*A + 6*B + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) + (a*(6*B + C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (C*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(1/2), x, 4, (sqrt(a)*(8*A + 4*B + 3*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) + (a*(4*B + C)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (C*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(3/2), x, 4, (sqrt(a)*(2*B + C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a*(2*A - C)*sqrt(cos(c + d*x))*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(5/2), x, 4, (2*sqrt(a)*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a*(A + 3*B)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(7/2), x, 3, (2*a*(A + 5*B)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (2*a*(8*A + 10*B + 15*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(9/2), x, 4, (2*a*(A + 7*B)*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (2*a*(24*A + 28*B + 35*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (4*a*(24*A + 28*B + 35*C)*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(11/2), x, 5, (2*a*(A + 9*B)*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))) + (2*a*(16*A + 18*B + 21*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (8*a*(16*A + 18*B + 21*C)*sin(c + d*x))/(315*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (16*a*(16*A + 18*B + 21*C)*sin(c + d*x))/(315*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]

    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*cos(c + d*x)^(3/2), x, 7, (a^(3/2)*(176*A + 150*B + 133*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(128*d) + (a^2*(176*A + 150*B + 133*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))) + (a^2*(176*A + 150*B + 133*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^2*(80*A + 90*B + 67*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(240*d*sqrt(a + a*cos(c + d*x))) + (a*(10*B + 3*C)*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(40*d) + (C*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*cos(c + d*x)^(1/2), x, 6, (a^(3/2)*(112*A + 88*B + 75*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^2*(112*A + 88*B + 75*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(64*d*sqrt(a + a*cos(c + d*x))) + (a^2*(48*A + 56*B + 39*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))) + (a*(8*B + 3*C)*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(24*d) + (C*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(4*d)]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(1/2), x, 5, (a^(3/2)*(24*A + 14*B + 11*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) + (a^2*(24*A + 30*B + 19*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) + (a*(2*B + C)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d) + (C*sqrt(cos(c + d*x))*(a + a*cos(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) + C*cos(c + d*x)^2)/cos(c + d*x)^(3/2), x, 5, (a^(3/2)*(8*A + 12*B + 7*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) - (a^2*(8*A - 4*B - 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) - (a*(4*A - C)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d) + (2*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(5/2), x, 5, (a^(3/2)*(2*B + 3*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a^2*(8*A + 6*B - 3*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*a*(A + B)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(7/2), x, 5, (2*a^(3/2)*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^2*(12*A + 20*B + 15*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a*(3*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*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(9/2), x, 4, (2*a^2*(4*A + 6*B + 5*C)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (2*a^2*(104*A + 126*B + 175*C)*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a*(3*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*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(11/2), x, 5, (2*a^2*(52*A + 72*B + 63*C)*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (2*a^2*(136*A + 156*B + 189*C)*sin(c + d*x))/(315*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (4*a^2*(136*A + 156*B + 189*C)*sin(c + d*x))/(315*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a*(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*cos(c + d*x))^(3/2)*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]
    @test_int [(a + a*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(13/2), x, 6, (2*a^2*(84*A + 110*B + 99*C)*sin(c + d*x))/(693*d*cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))) + (2*a^2*(336*A + 374*B + 429*C)*sin(c + d*x))/(1155*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (8*a^2*(336*A + 374*B + 429*C)*sin(c + d*x))/(3465*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (16*a^2*(336*A + 374*B + 429*C)*sin(c + d*x))/(3465*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a*(3*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*cos(c + d*x))^(3/2)*sin(c + d*x))/(11*d*cos(c + d*x)^(11/2))]

    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*cos(c + d*x)^(3/2), x, 8, (a^(5/2)*(1304*A + 1132*B + 1015*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(512*d) + (a^3*(1304*A + 1132*B + 1015*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(512*d*sqrt(a + a*cos(c + d*x))) + (a^3*(1304*A + 1132*B + 1015*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(768*d*sqrt(a + a*cos(c + d*x))) + (a^3*(680*A + 628*B + 545*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(960*d*sqrt(a + a*cos(c + d*x))) + (a^2*(120*A + 156*B + 115*C)*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(480*d) + (a*(12*B + 5*C)*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(60*d) + (C*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(6*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*cos(c + d*x)^(1/2), x, 7, (a^(5/2)*(400*A + 326*B + 283*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(128*d) + (a^3*(400*A + 326*B + 283*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))) + (a^3*(1040*A + 950*B + 787*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(960*d*sqrt(a + a*cos(c + d*x))) + (a^2*(80*A + 110*B + 79*C)*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(240*d) + (a*(2*B + C)*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(8*d) + (C*cos(c + d*x)^(3/2)*(a + a*cos(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) + C*cos(c + d*x)^2)/cos(c + d*x)^(1/2), x, 6, (a^(5/2)*(304*A + 200*B + 163*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(64*d) + (a^3*(432*A + 392*B + 299*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))) + (a^2*(16*A + 24*B + 17*C)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(32*d) + (a*(8*B + 5*C)*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*d) + (C*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(3/2), x, 6, (a^(5/2)*(40*A + 38*B + 25*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*d) - (a^3*(24*A - 54*B - 49*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))) - (a^2*(8*A - 2*B - 3*C)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d) - (a*(6*A - C)*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(5/2), x, 6, (a^(5/2)*(8*A + 20*B + 19*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*d) - (a^3*(56*A + 12*B - 27*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) - (a^2*(8*A + 4*B - C)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d) + (2*a*(5*A + 3*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(7/2), x, 6, (a^(5/2)*(2*B + 5*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d - (a^3*(64*A + 70*B + 15*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(8*A + 10*B + 5*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*a*(A + B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(9/2), x, 6, (2*a^(5/2)*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/d + (2*a^3*(160*A + 224*B + 245*C)*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(40*A + 56*B + 35*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (2*a*(5*A + 7*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(11/2), x, 5, (2*a^3*(8*A + 10*B + 11*C)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (2*a^3*(584*A + 690*B + 903*C)*sin(c + d*x))/(315*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(64*A + 90*B + 63*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)) + (2*a*(5*A + 9*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2)) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(13/2), x, 6, (2*a^3*(1160*A + 1364*B + 1485*C)*sin(c + d*x))/(3465*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (2*a^3*(2840*A + 3212*B + 3795*C)*sin(c + d*x))/(3465*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (4*a^3*(2840*A + 3212*B + 3795*C)*sin(c + d*x))/(3465*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(32*A + 44*B + 33*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(231*d*cos(c + d*x)^(7/2)) + (2*a*(5*A + 11*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(99*d*cos(c + d*x)^(9/2)) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(11*d*cos(c + d*x)^(11/2))]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^(15/2), x, 7, (2*a^3*(2224*A + 2522*B + 2717*C)*sin(c + d*x))/(9009*d*cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))) + (2*a^3*(8368*A + 9230*B + 10439*C)*sin(c + d*x))/(15015*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (8*a^3*(8368*A + 9230*B + 10439*C)*sin(c + d*x))/(45045*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + (16*a^3*(8368*A + 9230*B + 10439*C)*sin(c + d*x))/(45045*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x))) + (2*a^2*(136*A + 182*B + 143*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(1287*d*cos(c + d*x)^(9/2)) + (2*a*(5*A + 13*B)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(143*d*cos(c + d*x)^(11/2)) + (2*A*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(13*d*cos(c + d*x)^(13/2))]

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

    @test_int [(cos(c + d*x)^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(a + a*cos(c + d*x)), x, 8, -(((8*A - 14*B + 9*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(8*sqrt(a)*d)) + (sqrt(2)*(A - B + C)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + ((8*A - 2*B + 7*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))) + ((6*B - C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))) + (C*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) + C*cos(c + d*x)^2))/sqrt(a + a*cos(c + d*x)), x, 7, ((8*A - 4*B + 7*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*sqrt(a)*d) - (sqrt(2)*(A - B + C)*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*B - C)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (C*cos(c + d*x)^(3/2)*sin(c + d*x))/(2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(1/2)*sqrt(a + a*cos(c + d*x))), x, 6, ((2*B - C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(sqrt(a)*d) + (sqrt(2)*(A - B + C)*atan((sqrt(a)*sin(c + d*x))/(sqrt(2)*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))))/(sqrt(a)*d) + (C*sqrt(cos(c + d*x))*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))), x, 6, (2*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(sqrt(a)*d) - (sqrt(2)*(A - B + C)*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 [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))), x, 5, (sqrt(2)*(A - B + C)*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 [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))), x, 6, -((sqrt(2)*(A - B + C)*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 + 15*C)*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(9/2)*sqrt(a + a*cos(c + d*x))), x, 7, (sqrt(2)*(A - B + C)*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))/(7*d*cos(c + d*x)^(7/2)*sqrt(a + a*cos(c + d*x))) - (2*(A - 7*B)*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) + (2*(31*A - 7*B + 35*C)*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) - (2*(43*A - 91*B + 35*C)*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]

    @test_int [(sqrt(cos(c + d*x))*(a*A + (A*b + a*B)*cos(c + d*x) + b*B*cos(c + d*x)^2))/sqrt(a + a*cos(c + d*x)), x, 7, ((8*a*A - 4*A*b - 4*a*B + 7*b*B)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*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(a)*d) + ((4*A*b + 4*a*B - b*B)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))) + (b*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)^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^(3/2), x, 8, ((8*A - 12*B + 19*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(4*a^(3/2)*d) - ((5*A - 9*B + 13*C)*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 + C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) - ((2*A - 6*B + 7*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*a*d*sqrt(a + a*cos(c + d*x))) + ((A - B + 2*C)*cos(c + d*x)^(3/2)*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) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^(3/2), x, 7, ((2*B - 3*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(3/2)*d) + ((A - 5*B + 9*C)*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 + C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((A - B + 3*C)*sqrt(cos(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) + C*cos(c + d*x)^2)/(cos(c + d*x)^(1/2)*(a + a*cos(c + d*x))^(3/2)), x, 6, (2*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(3/2)*d) + ((3*A + B - 5*C)*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 + C)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)), x, 5, -(((7*A - 3*B - C)*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 + C)*sin(c + d*x))/(2*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)) + ((5*A - B + C)*sin(c + d*x))/(2*a*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(3/2)), x, 6, ((11*A - 7*B + 3*C)*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 + C)*sin(c + d*x))/(2*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(3/2)) + ((7*A - 3*B + 3*C)*sin(c + d*x))/(6*a*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) - ((19*A - 15*B + 3*C)*sin(c + d*x))/(6*a*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(7/2)*(a + a*cos(c + d*x))^(3/2)), x, 7, -(((15*A - 11*B + 7*C)*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 + C)*sin(c + d*x))/(2*d*cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(3/2)) + ((9*A - 5*B + 5*C)*sin(c + d*x))/(10*a*d*cos(c + d*x)^(5/2)*sqrt(a + a*cos(c + d*x))) - ((39*A - 35*B + 15*C)*sin(c + d*x))/(30*a*d*cos(c + d*x)^(3/2)*sqrt(a + a*cos(c + d*x))) + ((147*A - 95*B + 75*C)*sin(c + d*x))/(30*a*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) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^(5/2), x, 8, ((2*B - 5*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(5/2)*d) + ((3*A - 43*B + 115*C)*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 + C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((A + 7*B - 15*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((3*A - 11*B + 35*C)*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)^(1/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + a*cos(c + d*x))^(5/2), x, 7, (2*C*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x))))/(a^(5/2)*d) + ((5*A + 3*B - 43*C)*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 + C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) + ((5*A + 3*B - 11*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(1/2)*(a + a*cos(c + d*x))^(5/2)), x, 5, ((19*A + 5*B + 3*C)*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 + C)*sqrt(cos(c + d*x))*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((9*A - B - 7*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(5/2)), x, 6, -(((75*A - 19*B - 5*C)*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 + C)*sin(c + d*x))/(4*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(5/2)) - ((13*A - 5*B - 3*C)*sin(c + d*x))/(16*a*d*sqrt(cos(c + d*x))*(a + a*cos(c + d*x))^(3/2)) + ((49*A - 9*B + C)*sin(c + d*x))/(16*a^2*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + a*cos(c + d*x))^(5/2)), x, 7, ((163*A - 75*B + 19*C)*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 + C)*sin(c + d*x))/(4*d*cos(c + d*x)^(3/2)*(a + a*cos(c + d*x))^(5/2)) - ((17*A - 9*B + C)*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 + 15*C)*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 + 27*C)*sin(c + d*x))/(48*a^2*d*sqrt(cos(c + d*x))*sqrt(a + a*cos(c + d*x)))]

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

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

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

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

    @test_int [cos(c + d*x)^2*(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 7, (1/8)*a*(4*A + 3*C)*x + (b*(5*A + 4*C)*sin(c + d*x))/(5*d) + (a*(4*A + 3*C)*cos(c + d*x)*sin(c + d*x))/(8*d) + (a*C*cos(c + d*x)^3*sin(c + d*x))/(4*d) + (b*C*cos(c + d*x)^4*sin(c + d*x))/(5*d) - (b*(5*A + 4*C)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^1*(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 3, (1/8)*b*(4*A + 3*C)*x + (a*(3*A + 2*C)*sin(c + d*x))/(3*d) + (b*(4*A + 3*C)*cos(c + d*x)*sin(c + d*x))/(8*d) + (a*C*cos(c + d*x)^2*sin(c + d*x))/(3*d) + (b*C*cos(c + d*x)^3*sin(c + d*x))/(4*d)]
    @test_int [cos(c + d*x)^0*(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 2, (a*(2*A + C)*x)/2 - ((a^2*C - b^2*(3*A + 2*C))*sin(c + d*x))/(3*b*d) - (a*C*cos(c + d*x)*sin(c + d*x))/(6*d) + (C*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*b*d)]
    @test_int [(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^1, x, 4, (1/2)*b*(2*A + C)*x + (a*A*atanh(sin(c + d*x)))/d + (a*C*sin(c + d*x))/d + (b*C*cos(c + d*x)*sin(c + d*x))/(2*d)]
    @test_int [(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 4, a*C*x + (A*b*atanh(sin(c + d*x)))/d + (b*C*sin(c + d*x))/d + (a*A*tan(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 4, b*C*x + (a*(A + 2*C)*atanh(sin(c + d*x)))/(2*d) + (A*b*tan(c + d*x))/d + (a*A*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 6, (b*(A + 2*C)*atanh(sin(c + d*x)))/(2*d) + (a*(2*A + 3*C)*tan(c + d*x))/(3*d) + (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 [(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 7, (a*(3*A + 4*C)*atanh(sin(c + d*x)))/(8*d) + (b*(2*A + 3*C)*tan(c + d*x))/(3*d) + (a*(3*A + 4*C)*sec(c + d*x)*tan(c + d*x))/(8*d) + (A*b*sec(c + d*x)^2*tan(c + d*x))/(3*d) + (a*A*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^6, x, 7, (b*(3*A + 4*C)*atanh(sin(c + d*x)))/(8*d) + (a*(4*A + 5*C)*tan(c + d*x))/(5*d) + (b*(3*A + 4*C)*sec(c + d*x)*tan(c + d*x))/(8*d) + (A*b*sec(c + d*x)^3*tan(c + d*x))/(4*d) + (a*A*sec(c + d*x)^4*tan(c + d*x))/(5*d) + (a*(4*A + 5*C)*tan(c + d*x)^3)/(15*d)]

    @test_int [cos(c + d*x)^2*(a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2), x, 8, (1/16)*(b^2*(6*A + 5*C) + a^2*(8*A + 6*C))*x + (2*a*b*(5*A + 4*C)*sin(c + d*x))/(5*d) + ((b^2*(6*A + 5*C) + a^2*(8*A + 6*C))*cos(c + d*x)*sin(c + d*x))/(16*d) + ((2*a^2*C + b^2*(6*A + 5*C))*cos(c + d*x)^3*sin(c + d*x))/(24*d) + (a*b*C*cos(c + d*x)^4*sin(c + d*x))/(15*d) + (C*cos(c + d*x)^3*(a + b*cos(c + d*x))^2*sin(c + d*x))/(6*d) - (2*a*b*(5*A + 4*C)*sin(c + d*x)^3)/(15*d)]
    @test_int [cos(c + d*x)^1*(a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2), x, 4, (1/4)*a*b*(4*A + 3*C)*x + ((5*a^2*(3*A + 2*C) + 2*b^2*(5*A + 4*C))*sin(c + d*x))/(15*d) + (a*b*(4*A + 3*C)*cos(c + d*x)*sin(c + d*x))/(4*d) + ((2*a^2*C + b^2*(5*A + 4*C))*cos(c + d*x)^2*sin(c + d*x))/(15*d) + (a*b*C*cos(c + d*x)^3*sin(c + d*x))/(10*d) + (C*cos(c + d*x)^2*(a + b*cos(c + d*x))^2*sin(c + d*x))/(5*d)]
    @test_int [cos(c + d*x)^0*(a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2), x, 3, (1/8)*(4*a^2*(2*A + C) + b^2*(4*A + 3*C))*x + (a*(12*A*b^2 - a^2*C + 8*b^2*C)*sin(c + d*x))/(6*b*d) - ((2*a^2*C - 3*b^2*(4*A + 3*C))*cos(c + d*x)*sin(c + d*x))/(24*d) - (a*C*(a + b*cos(c + d*x))^2*sin(c + d*x))/(12*b*d) + (C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(4*b*d)]
    @test_int [(a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^1, x, 5, a*b*(2*A + C)*x + (a^2*A*atanh(sin(c + d*x)))/d + ((3*A*b^2 + 2*(a^2 + b^2)*C)*sin(c + d*x))/(3*d) + (a*b*C*cos(c + d*x)*sin(c + d*x))/(3*d) + (C*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 5, (1/2)*(2*A*b^2 + (2*a^2 + b^2)*C)*x + (2*a*A*b*atanh(sin(c + d*x)))/d - (2*a*b*(A - C)*sin(c + d*x))/d - (b^2*(2*A - C)*cos(c + d*x)*sin(c + d*x))/(2*d) + (A*(a + b*cos(c + d*x))^2*tan(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 5, 2*a*b*C*x + ((2*A*b^2 + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*d) - (b^2*(A - 2*C)*sin(c + d*x))/(2*d) + (a*A*b*tan(c + d*x))/d + (A*(a + b*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 5, b^2*C*x + (a*b*(A + 2*C)*atanh(sin(c + d*x)))/d + ((2*A*b^2 + a^2*(2*A + 3*C))*tan(c + d*x))/(3*d) + (a*A*b*sec(c + d*x)*tan(c + d*x))/(3*d) + (A*(a + b*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 7, ((4*b^2*(A + 2*C) + a^2*(3*A + 4*C))*atanh(sin(c + d*x)))/(8*d) + (2*a*b*(2*A + 3*C)*tan(c + d*x))/(3*d) + ((2*A*b^2 + a^2*(3*A + 4*C))*sec(c + d*x)*tan(c + d*x))/(8*d) + (a*A*b*sec(c + d*x)^2*tan(c + d*x))/(6*d) + (A*(a + b*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [(a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^6, x, 8, (a*b*(3*A + 4*C)*atanh(sin(c + d*x)))/(4*d) + ((5*b^2*(2*A + 3*C) + 2*a^2*(4*A + 5*C))*tan(c + d*x))/(15*d) + (a*b*(3*A + 4*C)*sec(c + d*x)*tan(c + d*x))/(4*d) + ((2*A*b^2 + a^2*(4*A + 5*C))*sec(c + d*x)^2*tan(c + d*x))/(15*d) + (a*A*b*sec(c + d*x)^3*tan(c + d*x))/(10*d) + (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)^1*(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2), x, 5, (1/16)*b*(6*a^2*(4*A + 3*C) + b^2*(6*A + 5*C))*x + (a*(5*a^2*(3*A + 2*C) + 6*b^2*(5*A + 4*C))*sin(c + d*x))/(15*d) + (b*(6*a^2*(4*A + 3*C) + b^2*(6*A + 5*C))*cos(c + d*x)*sin(c + d*x))/(16*d) + (a*(15*A*b^2 + (a^2 + 12*b^2)*C)*cos(c + d*x)^2*sin(c + d*x))/(15*d) + (b*(6*a^2*C + 5*b^2*(6*A + 5*C))*cos(c + d*x)^3*sin(c + d*x))/(120*d) + (a*C*cos(c + d*x)^2*(a + b*cos(c + d*x))^2*sin(c + d*x))/(10*d) + (C*cos(c + d*x)^2*(a + b*cos(c + d*x))^3*sin(c + d*x))/(6*d)]
    @test_int [cos(c + d*x)^0*(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2), x, 4, (1/8)*a*(4*a^2*(2*A + C) + 3*b^2*(4*A + 3*C))*x - ((3*a^4*C - 4*b^4*(5*A + 4*C) - 4*a^2*b^2*(20*A + 13*C))*sin(c + d*x))/(30*b*d) + (a*(100*A*b^2 - 6*a^2*C + 71*b^2*C)*cos(c + d*x)*sin(c + d*x))/(120*d) - ((3*a^2*C - 4*b^2*(5*A + 4*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(60*b*d) - (a*C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(20*b*d) + (C*(a + b*cos(c + d*x))^4*sin(c + d*x))/(5*b*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^1, x, 6, (1/8)*b*(12*a^2*(2*A + C) + b^2*(4*A + 3*C))*x + (a^3*A*atanh(sin(c + d*x)))/d + (a*(6*A*b^2 + (a^2 + 4*b^2)*C)*sin(c + d*x))/(2*d) + (b*(2*a^2*C + b^2*(4*A + 3*C))*cos(c + d*x)*sin(c + d*x))/(8*d) + (a*C*(a + b*cos(c + d*x))^2*sin(c + d*x))/(4*d) + (C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(4*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 6, (1/2)*a*(6*A*b^2 + 2*a^2*C + 3*b^2*C)*x + (3*a^2*A*b*atanh(sin(c + d*x)))/d - (b*(a^2*(6*A - 8*C) - b^2*(3*A + 2*C))*sin(c + d*x))/(3*d) - (a*b^2*(6*A - 5*C)*cos(c + d*x)*sin(c + d*x))/(6*d) - (b*(3*A - C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*d) + (A*(a + b*cos(c + d*x))^3*tan(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 6, (1/2)*b*(2*A*b^2 + (6*a^2 + b^2)*C)*x + (a*(6*A*b^2 + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*d) - (3*a*b^2*(3*A - 2*C)*sin(c + d*x))/(2*d) - (b^3*(4*A - C)*cos(c + d*x)*sin(c + d*x))/(2*d) + (3*A*b*(a + b*cos(c + d*x))^2*tan(c + d*x))/(2*d) + (A*(a + b*cos(c + d*x))^3*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 6, 3*a*b^2*C*x + (b*(2*A*b^2 + 3*a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*d) - (b^3*(5*A - 6*C)*sin(c + d*x))/(6*d) + (a*(3*A*b^2 + a^2*(2*A + 3*C))*tan(c + d*x))/(3*d) + (A*b*(a + b*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(2*d) + (A*(a + b*cos(c + d*x))^3*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 6, b^3*C*x + (a*(12*b^2*(A + 2*C) + a^2*(3*A + 4*C))*atanh(sin(c + d*x)))/(8*d) + (b*(A*b^2 + a^2*(4*A + 6*C))*tan(c + d*x))/(2*d) + (a*(2*A*b^2 + a^2*(3*A + 4*C))*sec(c + d*x)*tan(c + d*x))/(8*d) + (A*b*(a + b*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(4*d) + (A*(a + b*cos(c + d*x))^3*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^6, x, 8, (b*(4*b^2*(A + 2*C) + 3*a^2*(3*A + 4*C))*atanh(sin(c + d*x)))/(8*d) + (a*(15*b^2*(2*A + 3*C) + 2*a^2*(4*A + 5*C))*tan(c + d*x))/(15*d) + (3*b*(2*A*b^2 + 5*a^2*(3*A + 4*C))*sec(c + d*x)*tan(c + d*x))/(40*d) + (a*(3*A*b^2 + 2*a^2*(4*A + 5*C))*sec(c + d*x)^2*tan(c + d*x))/(30*d) + (3*A*b*(a + b*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(20*d) + (A*(a + b*cos(c + d*x))^3*sec(c + d*x)^4*tan(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^7, x, 9, (a*(6*b^2*(3*A + 4*C) + a^2*(5*A + 6*C))*atanh(sin(c + d*x)))/(16*d) + (b*(5*b^2*(2*A + 3*C) + 6*a^2*(4*A + 5*C))*tan(c + d*x))/(15*d) + (a*(6*b^2*(3*A + 4*C) + a^2*(5*A + 6*C))*sec(c + d*x)*tan(c + d*x))/(16*d) + (b*(A*b^2 + 3*a^2*(4*A + 5*C))*sec(c + d*x)^2*tan(c + d*x))/(15*d) + (a*(6*A*b^2 + 5*a^2*(5*A + 6*C))*sec(c + d*x)^3*tan(c + d*x))/(120*d) + (A*b*(a + b*cos(c + d*x))^2*sec(c + d*x)^4*tan(c + d*x))/(10*d) + (A*(a + b*cos(c + d*x))^3*sec(c + d*x)^5*tan(c + d*x))/(6*d)]

    @test_int [cos(c + d*x)^1*(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2), x, 6, (1/4)*a*b*(b^2*(6*A + 5*C) + a^2*(8*A + 6*C))*x + ((35*a^4*(3*A + 2*C) + 84*a^2*b^2*(5*A + 4*C) + 8*b^4*(7*A + 6*C))*sin(c + d*x))/(105*d) + (a*b*(b^2*(6*A + 5*C) + a^2*(8*A + 6*C))*cos(c + d*x)*sin(c + d*x))/(4*d) + ((4*a^4*C + 4*b^4*(7*A + 6*C) + 3*a^2*b^2*(63*A + 50*C))*cos(c + d*x)^2*sin(c + d*x))/(105*d) + (a*b*(126*A*b^2 + 6*a^2*C + 103*b^2*C)*cos(c + d*x)^3*sin(c + d*x))/(210*d) + ((2*a^2*C + b^2*(7*A + 6*C))*cos(c + d*x)^2*(a + b*cos(c + d*x))^2*sin(c + d*x))/(35*d) + (2*a*C*cos(c + d*x)^2*(a + b*cos(c + d*x))^3*sin(c + d*x))/(21*d) + (C*cos(c + d*x)^2*(a + b*cos(c + d*x))^4*sin(c + d*x))/(7*d)]
    @test_int [cos(c + d*x)^0*(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2), x, 5, (1/16)*(8*a^4*(2*A + C) + 12*a^2*b^2*(4*A + 3*C) + b^4*(6*A + 5*C))*x - (a*(4*a^4*C - 32*b^4*(5*A + 4*C) - a^2*b^2*(190*A + 121*C))*sin(c + d*x))/(60*b*d) - ((8*a^4*C - 15*b^4*(6*A + 5*C) - 2*a^2*b^2*(130*A + 89*C))*cos(c + d*x)*sin(c + d*x))/(240*d) + (a*(70*A*b^2 - 4*a^2*C + 53*b^2*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(120*b*d) - ((4*a^2*C - 5*b^2*(6*A + 5*C))*(a + b*cos(c + d*x))^3*sin(c + d*x))/(120*b*d) - (a*C*(a + b*cos(c + d*x))^4*sin(c + d*x))/(30*b*d) + (C*(a + b*cos(c + d*x))^5*sin(c + d*x))/(6*b*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^1, x, 7, (1/2)*a*b*(4*a^2*(2*A + C) + b^2*(4*A + 3*C))*x + (a^4*A*atanh(sin(c + d*x)))/d + ((6*a^4*C + 2*b^4*(5*A + 4*C) + a^2*b^2*(85*A + 56*C))*sin(c + d*x))/(15*d) + (a*b*(40*A*b^2 + 6*a^2*C + 29*b^2*C)*cos(c + d*x)*sin(c + d*x))/(30*d) + ((3*a^2*C + b^2*(5*A + 4*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(15*d) + (a*C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(5*d) + (C*(a + b*cos(c + d*x))^4*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 7, (1/8)*(8*a^4*C + 24*a^2*b^2*(2*A + C) + b^4*(4*A + 3*C))*x + (4*a^3*A*b*atanh(sin(c + d*x)))/d - (a*b*(a^2*(12*A - 19*C) - 8*b^2*(3*A + 2*C))*sin(c + d*x))/(6*d) - (b^2*(a^2*(24*A - 26*C) - 3*b^2*(4*A + 3*C))*cos(c + d*x)*sin(c + d*x))/(24*d) - (a*b*(12*A - 7*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(12*d) - (b*(4*A - C)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(4*d) + (A*(a + b*cos(c + d*x))^4*tan(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 7, 2*a*b*(2*A*b^2 + (2*a^2 + b^2)*C)*x + (a^2*(12*A*b^2 + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*d) - (b^2*(a^2*(39*A - 34*C) - 2*b^2*(3*A + 2*C))*sin(c + d*x))/(6*d) - (a*b^3*(9*A - 4*C)*cos(c + d*x)*sin(c + d*x))/(3*d) - (b^2*(15*A - 2*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(6*d) + (2*A*b*(a + b*cos(c + d*x))^3*tan(c + d*x))/d + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 7, (1/2)*b^2*(2*A*b^2 + (12*a^2 + b^2)*C)*x + (2*a*b*(2*A*b^2 + a^2*(A + 2*C))*atanh(sin(c + d*x)))/d - (2*a*b*(b^2*(11*A - 6*C) + a^2*(2*A + 3*C))*sin(c + d*x))/(3*d) - (b^2*(3*b^2*(6*A - C) + a^2*(4*A + 6*C))*cos(c + d*x)*sin(c + d*x))/(6*d) + ((6*A*b^2 + a^2*(2*A + 3*C))*(a + b*cos(c + d*x))^2*tan(c + d*x))/(3*d) + (2*A*b*(a + b*cos(c + d*x))^3*sec(c + d*x)*tan(c + d*x))/(3*d) + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 7, 4*a*b^3*C*x + ((8*A*b^4 + 24*a^2*b^2*(A + 2*C) + a^4*(3*A + 4*C))*atanh(sin(c + d*x)))/(8*d) - (b^2*(2*b^2*(13*A - 12*C) + 3*a^2*(3*A + 4*C))*sin(c + d*x))/(24*d) + (a*b*(12*A*b^2 + a^2*(23*A + 36*C))*tan(c + d*x))/(12*d) + ((4*A*b^2 + a^2*(3*A + 4*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(8*d) + (A*b*(a + b*cos(c + d*x))^3*sec(c + d*x)^2*tan(c + d*x))/(3*d) + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^6, x, 7, b^4*C*x + (a*b*(4*b^2*(A + 2*C) + a^2*(3*A + 4*C))*atanh(sin(c + d*x)))/(2*d) + ((6*A*b^4 + 2*a^4*(4*A + 5*C) + a^2*b^2*(56*A + 85*C))*tan(c + d*x))/(15*d) + (a*b*(6*A*b^2 + a^2*(29*A + 40*C))*sec(c + d*x)*tan(c + d*x))/(30*d) + ((3*A*b^2 + a^2*(4*A + 5*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(15*d) + (A*b*(a + b*cos(c + d*x))^3*sec(c + d*x)^3*tan(c + d*x))/(5*d) + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)^4*tan(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^7, x, 9, ((8*b^4*(A + 2*C) + 12*a^2*b^2*(3*A + 4*C) + a^4*(5*A + 6*C))*atanh(sin(c + d*x)))/(16*d) + (4*a*b*(5*b^2*(2*A + 3*C) + 2*a^2*(4*A + 5*C))*tan(c + d*x))/(15*d) + ((24*A*b^4 + 15*a^4*(5*A + 6*C) + 10*a^2*b^2*(49*A + 66*C))*sec(c + d*x)*tan(c + d*x))/(240*d) + (a*b*(4*A*b^2 + a^2*(39*A + 50*C))*sec(c + d*x)^2*tan(c + d*x))/(60*d) + ((12*A*b^2 + 5*a^2*(5*A + 6*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(120*d) + (2*A*b*(a + b*cos(c + d*x))^3*sec(c + d*x)^4*tan(c + d*x))/(15*d) + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)^5*tan(c + d*x))/(6*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^8, x, 10, (a*b*(2*b^2*(3*A + 4*C) + a^2*(5*A + 6*C))*atanh(sin(c + d*x)))/(4*d) + ((35*b^4*(2*A + 3*C) + 84*a^2*b^2*(4*A + 5*C) + 8*a^4*(6*A + 7*C))*tan(c + d*x))/(105*d) + (a*b*(2*b^2*(3*A + 4*C) + a^2*(5*A + 6*C))*sec(c + d*x)*tan(c + d*x))/(4*d) + ((4*A*b^4 + 4*a^4*(6*A + 7*C) + 3*a^2*b^2*(50*A + 63*C))*sec(c + d*x)^2*tan(c + d*x))/(105*d) + (a*b*(6*A*b^2 + a^2*(103*A + 126*C))*sec(c + d*x)^3*tan(c + d*x))/(210*d) + ((2*A*b^2 + a^2*(6*A + 7*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^4*tan(c + d*x))/(35*d) + (2*A*b*(a + b*cos(c + d*x))^3*sec(c + d*x)^5*tan(c + d*x))/(21*d) + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)^6*tan(c + d*x))/(7*d)]

    @test_int [(a + b*cos(c + d*x))^3*(a^2 - b^2*cos(c + d*x)^2), x, 5, (a*(8*a^4 + 8*a^2*b^2 - 9*b^4)*x)/8 + (b*(83*a^4 - 32*a^2*b^2 - 16*b^4)*sin(c + d*x))/(30*d) + (a*b^2*(106*a^2 - 71*b^2)*cos(c + d*x)*sin(c + d*x))/(120*d) + (b*(23*a^2 - 16*b^2)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(60*d) + (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 [(a + b*cos(c + d*x))^2*(a^2 - b^2*cos(c + d*x)^2), x, 4, ((8*a^4 - 3*b^4)*x)/8 + (a*b*(13*a^2 - 8*b^2)*sin(c + d*x))/(6*d) + (b^2*(14*a^2 - 9*b^2)*cos(c + d*x)*sin(c + d*x))/(24*d) + (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 [(a + b*cos(c + d*x))*(a^2 - b^2*cos(c + d*x)^2), x, 3, (a*(2*a^2 - b^2)*x)/2 + (2*b*(2*a^2 - b^2)*sin(c + d*x))/(3*d) + (a*b^2*cos(c + d*x)*sin(c + d*x))/(6*d) - (b*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*d)]

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

    @test_int [cos(c + d*x)^3*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 7, ((8*a^4*C + 4*a^2*b^2*(2*A + C) + b^4*(4*A + 3*C))*x)/(8*b^5) - (2*a^3*(A*b^2 + a^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b^5*sqrt(a + b)*d) - (a*(3*A*b^2 + 3*a^2*C + 2*b^2*C)*sin(c + d*x))/(3*b^4*d) + ((4*a^2*C + b^2*(4*A + 3*C))*cos(c + d*x)*sin(c + d*x))/(8*b^3*d) - (a*C*cos(c + d*x)^2*sin(c + d*x))/(3*b^2*d) + (C*cos(c + d*x)^3*sin(c + d*x))/(4*b*d)]
    @test_int [cos(c + d*x)^2*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 6, -((a*(2*A*b^2 + (2*a^2 + b^2)*C)*x)/(2*b^4)) + (2*a^2*(A*b^2 + a^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b^4*sqrt(a + b)*d) + ((3*a^2*C + b^2*(3*A + 2*C))*sin(c + d*x))/(3*b^3*d) - (a*C*cos(c + d*x)*sin(c + d*x))/(2*b^2*d) + (C*cos(c + d*x)^2*sin(c + d*x))/(3*b*d)]
    @test_int [cos(c + d*x)^1*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 5, ((2*a^2*C + b^2*(2*A + C))*x)/(2*b^3) - (2*a*(A*b^2 + a^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b^3*sqrt(a + b)*d) - (a*C*sin(c + d*x))/(b^2*d) + (C*cos(c + d*x)*sin(c + d*x))/(2*b*d)]
    @test_int [cos(c + d*x)^0*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 4, -((a*C*x)/b^2) + (2*(A*b^2 + a^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b^2*sqrt(a + b)*d) + (C*sin(c + d*x))/(b*d)]
    @test_int [sec(c + d*x)^1*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 4, (C*x)/b - (2*(A*b^2 + a^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a*sqrt(a - b)*b*sqrt(a + b)*d) + (A*atanh(sin(c + d*x)))/(a*d)]
    @test_int [sec(c + d*x)^2*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 5, (2*(A*b^2 + a^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^2*sqrt(a - b)*sqrt(a + b)*d) - (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 + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 6, -((2*b*(A*b^2 + a^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^3*sqrt(a - b)*sqrt(a + b)*d)) + ((2*A*b^2 + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*a^3*d) - (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 + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 7, (2*b^2*(A*b^2 + a^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^4*sqrt(a - b)*sqrt(a + b)*d) - (b*(2*A*b^2 + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*a^4*d) + ((3*A*b^2 + a^2*(2*A + 3*C))*tan(c + d*x))/(3*a^3*d) - (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 + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 7, -((a*(2*A*b^2 + (4*a^2 + b^2)*C)*x)/b^5) + (2*a^2*(2*a^2*A*b^2 - 3*A*b^4 + 4*a^4*C - 5*a^2*b^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^5*(a + b)^(3/2)*d) + ((a^2*b^2*(6*A - 7*C) + 12*a^4*C - b^4*(3*A + 2*C))*sin(c + d*x))/(3*b^4*(a^2 - b^2)*d) - (a*(A*b^2 + 2*a^2*C - b^2*C)*cos(c + d*x)*sin(c + d*x))/(b^3*(a^2 - b^2)*d) + ((3*A*b^2 + 4*a^2*C - b^2*C)*cos(c + d*x)^2*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d) - ((A*b^2 + a^2*C)*cos(c + d*x)^3*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^2*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 6, ((2*A*b^2 + (6*a^2 + b^2)*C)*x)/(2*b^4) - (2*a*(a^2*A*b^2 - 2*A*b^4 + 3*a^4*C - 4*a^2*b^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^4*(a + b)^(3/2)*d) - (a*(A*b^2 + 3*a^2*C - 2*b^2*C)*sin(c + d*x))/(b^3*(a^2 - b^2)*d) + ((2*A*b^2 + 3*a^2*C - b^2*C)*cos(c + d*x)*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d) - ((A*b^2 + a^2*C)*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)^1*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 5, -((2*a*C*x)/b^3) - (2*(A*b^4 - 2*a^4*C + 3*a^2*b^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^3*(a + b)^(3/2)*d) + (C*sin(c + d*x))/(b^2*d) + (a*(A*b^2 + a^2*C)*sin(c + d*x))/(b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 4, (C*x)/b^2 + (2*a*(A*b^2 - a^2*C + 2*b^2*C)*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*b^2 + a^2*C)*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 5, -((2*b*(2*a^2*A - A*b^2 + a^2*C)*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) + ((A*b^2 + a^2*C)*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 6, (2*(3*a^2*A*b^2 - 2*A*b^4 + a^4*C)*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*atanh(sin(c + d*x)))/(a^3*d) - ((2*A*b^2 - a^2*(A - C))*tan(c + d*x))/(a^2*(a^2 - b^2)*d) + ((A*b^2 + a^2*C)*tan(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 7, -((2*b*(4*a^2*A*b^2 - 3*A*b^4 + 2*a^4*C - a^2*b^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^4*(a - b)^(3/2)*(a + b)^(3/2)*d)) + ((6*A*b^2 + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*a^4*d) + (b*(3*A*b^2 - a^2*(2*A - C))*tan(c + d*x))/(a^3*(a^2 - b^2)*d) - ((3*A*b^2 - a^2*(A - 2*C))*sec(c + d*x)*tan(c + d*x))/(2*a^2*(a^2 - b^2)*d) + ((A*b^2 + a^2*C)*sec(c + d*x)*tan(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^4*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 8, (2*b^2*(5*a^2*A*b^2 - 4*A*b^4 + 3*a^4*C - 2*a^2*b^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^5*(a - b)^(3/2)*(a + b)^(3/2)*d) - (b*(4*A*b^2 + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(a^5*d) - ((12*A*b^4 - a^2*b^2*(7*A - 6*C) - a^4*(2*A + 3*C))*tan(c + d*x))/(3*a^4*(a^2 - b^2)*d) + (b*(2*A*b^2 - a^2*(A - C))*sec(c + d*x)*tan(c + d*x))/(a^3*(a^2 - b^2)*d) - ((4*A*b^2 - a^2*(A - 3*C))*sec(c + d*x)^2*tan(c + d*x))/(3*a^2*(a^2 - b^2)*d) + ((A*b^2 + a^2*C)*sec(c + d*x)^2*tan(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]

    @test_int [cos(c + d*x)^3*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 7, ((2*A*b^2 + (12*a^2 + b^2)*C)*x)/(2*b^5) - (a*(6*A*b^6 + a^4*b^2*(2*A - 29*C) - 5*a^2*b^4*(A - 4*C) + 12*a^6*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(5/2)*b^5*(a + b)^(5/2)*d) - (a*(a^2*b^2*(2*A - 21*C) - b^4*(5*A - 6*C) + 12*a^4*C)*sin(c + d*x))/(2*b^4*(a^2 - b^2)^2*d) + ((a^2*b^2*(A - 10*C) - b^4*(4*A - C) + 6*a^4*C)*cos(c + d*x)*sin(c + d*x))/(2*b^3*(a^2 - b^2)^2*d) - ((A*b^2 + a^2*C)*cos(c + d*x)^3*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + ((3*A*b^4 - 4*a^4*C + 7*a^2*b^2*C)*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)^2*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 6, -((3*a*C*x)/b^4) + ((2*A*b^6 + 6*a^6*C - 15*a^4*b^2*C + a^2*b^4*(A + 12*C))*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*b^2 + 3*a^2*C - 2*b^2*C)*sin(c + d*x))/(2*b^3*(a^2 - b^2)*d) - ((A*b^2 + a^2*C)*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*b^4 - 3*a^4*C + a^2*b^2*(A + 6*C))*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)^1*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 5, (C*x)/b^3 - (a*(3*A*b^4 + (2*a^4 - 5*a^2*b^2 + 6*b^4)*C)*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*(A*b^2 + a^2*C)*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + ((2*A*b^4 - 3*a^4*C + a^2*b^2*(A + 6*C))*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)^0*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 5, ((a^2*(2*A + C) + b^2*(A + 2*C))*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(5/2)*(a + b)^(5/2)*d) - ((A*b^2 + a^2*C)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - (a*(3*A*b^2 - a^2*C + 4*b^2*C)*sin(c + d*x))/(2*b*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 6, (b*(5*a^2*A*b^2 - 2*A*b^4 - 3*a^4*(2*A + C))*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) + ((A*b^2 + a^2*C)*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((2*A*b^4 - a^4*C - a^2*b^2*(5*A + 2*C))*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 + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 7, -(((15*a^2*A*b^4 - 6*A*b^6 - 2*a^6*C - a^4*b^2*(12*A + C))*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*atanh(sin(c + d*x)))/(a^4*d) - ((11*a^2*A*b^2 - 6*A*b^4 - a^4*(2*A - 3*C))*tan(c + d*x))/(2*a^3*(a^2 - b^2)^2*d) + ((A*b^2 + a^2*C)*tan(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((3*A*b^4 - 2*a^4*C - a^2*b^2*(6*A + C))*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 + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 8, -((b*(12*A*b^6 - a^2*b^4*(29*A - 2*C) + 5*a^4*b^2*(4*A - C) + 6*a^6*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^5*(a - b)^(5/2)*(a + b)^(5/2)*d)) + ((12*A*b^2 + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*a^5*d) - (b*(12*A*b^4 + a^4*(6*A - 5*C) - a^2*b^2*(21*A - 2*C))*tan(c + d*x))/(2*a^4*(a^2 - b^2)^2*d) + ((6*A*b^4 + a^4*(A - 4*C) - a^2*b^2*(10*A - C))*sec(c + d*x)*tan(c + d*x))/(2*a^3*(a^2 - b^2)^2*d) + ((A*b^2 + a^2*C)*sec(c + d*x)*tan(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + ((7*a^2*A*b^2 - 4*A*b^4 + 3*a^4*C)*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 + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^4, x, 8, ((2*A*b^2 + (20*a^2 + b^2)*C)*x)/(2*b^6) + ((8*a*A*b^8 - a^7*b^2*(2*A - 69*C) + 7*a^5*b^4*(A - 12*C) - 8*a^3*b^6*(A - 5*C) - 20*a^9*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(sqrt(a - b)*b^6*sqrt(a + b)*(a^2 - b^2)^3*d) - (a*(a^4*b^2*(6*A - 167*C) - a^2*b^4*(17*A - 146*C) + 2*b^6*(13*A - 12*C) + 60*a^6*C)*sin(c + d*x))/(6*b^5*(a^2 - b^2)^3*d) + ((a^4*b^2*(A - 27*C) - a^2*b^4*(2*A - 23*C) + b^6*(6*A - C) + 10*a^6*C)*cos(c + d*x)*sin(c + d*x))/(2*b^4*(a^2 - b^2)^3*d) - ((A*b^2 + a^2*C)*cos(c + d*x)^4*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) + ((4*A*b^4 - 5*a^4*C + a^2*b^2*(A + 10*C))*cos(c + d*x)^3*sin(c + d*x))/(6*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) - ((12*A*b^6 + a^4*b^2*(2*A - 53*C) + 20*a^6*C + a^2*b^4*(A + 48*C))*cos(c + d*x)^2*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)^3*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^4, x, 7, -((4*a*C*x)/b^5) - ((2*A*b^8 - 8*a^8*C + 28*a^6*b^2*C - 35*a^4*b^4*C + a^2*b^6*(3*A + 20*C))*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(7/2)*b^5*(a + b)^(7/2)*d) - ((5*A*b^4 - (12*a^4 - 23*a^2*b^2 + 6*b^4)*C)*sin(c + d*x))/(6*b^4*(a^2 - b^2)^2*d) - ((A*b^2 + a^2*C)*cos(c + d*x)^3*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) + ((3*A*b^4 - 4*a^4*C + a^2*b^2*(2*A + 9*C))*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*b^6 + 4*a^6*C - 11*a^4*b^2*C + 3*a^2*b^4*(A + 4*C))*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)^2*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^4, x, 6, (C*x)/b^4 + (a*(a^2*b^4*(A - 8*C) - 2*a^6*C + 7*a^4*b^2*C + 4*b^6*(A + 2*C))*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*b^2 + a^2*C)*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*A*b^4 - 3*a^4*C + a^2*b^2*(3*A + 8*C))*sin(c + d*x))/(6*b^3*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) - ((4*A*b^6 + 9*a^6*C + 2*a^2*b^4*(7*A + 17*C) - a^4*b^2*(3*A + 28*C))*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)^1*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^4, x, 6, -((b*(b^2*(A + 2*C) + a^2*(4*A + 3*C))*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^2 + a^2*C)*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) + ((3*A*b^4 - 4*a^4*C + a^2*b^2*(2*A + 9*C))*sin(c + d*x))/(6*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) + (a*(a^2*b^2*(2*A - 5*C) + 2*a^4*C + b^4*(13*A + 18*C))*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)^0*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^4, x, 6, (a*(a^2*(2*A + C) + b^2*(3*A + 4*C))*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(7/2)*(a + b)^(7/2)*d) - ((A*b^2 + a^2*C)*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) - (a*(5*A*b^2 - a^2*C + 6*b^2*C)*sin(c + d*x))/(6*b*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) + ((a^4*C - 2*b^4*(2*A + 3*C) - a^2*b^2*(11*A + 10*C))*sin(c + d*x))/(6*b*(a^2 - b^2)^3*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^4, x, 7, -((b*(7*a^2*A*b^4 - 2*A*b^6 - a^4*b^2*(8*A - C) + 4*a^6*(2*A + C))*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) + ((A*b^2 + a^2*C)*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) - ((3*A*b^4 - 2*a^4*C - a^2*b^2*(8*A + 3*C))*sin(c + d*x))/(6*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) - ((17*a^2*A*b^4 - 6*A*b^6 - 2*a^6*C - 13*a^4*b^2*(2*A + C))*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 + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^4, x, 8, -(((35*a^4*A*b^4 - 28*a^2*A*b^6 + 8*A*b^8 - 2*a^8*C - a^6*b^2*(20*A + 3*C))*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*atanh(sin(c + d*x)))/(a^5*d) + ((68*a^2*A*b^4 - 24*A*b^6 + a^6*(6*A - 11*C) - a^4*b^2*(65*A + 4*C))*tan(c + d*x))/(6*a^4*(a^2 - b^2)^3*d) + ((A*b^2 + a^2*C)*tan(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) - ((4*A*b^4 - 3*a^4*C - a^2*b^2*(9*A + 2*C))*tan(c + d*x))/(6*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) - ((11*a^2*A*b^4 - 4*A*b^6 - 2*a^6*C - 3*a^4*b^2*(4*A + C))*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 + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^4, x, 9, ((20*A*b^9 - a^2*b^7*(69*A - 2*C) - 8*a^6*b^3*(5*A - C) + 7*a^4*b^5*(12*A - C) - 8*a^8*b*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^6*sqrt(a - b)*sqrt(a + b)*(a^2 - b^2)^3*d) + ((20*A*b^2 + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*a^6*d) + (b*(60*A*b^6 - a^6*(24*A - 26*C) + a^4*b^2*(146*A - 17*C) - a^2*b^4*(167*A - 6*C))*tan(c + d*x))/(6*a^5*(a^2 - b^2)^3*d) - ((10*A*b^6 - a^6*(A - 6*C) + a^4*b^2*(23*A - 2*C) - a^2*b^4*(27*A - C))*sec(c + d*x)*tan(c + d*x))/(2*a^4*(a^2 - b^2)^3*d) + ((A*b^2 + a^2*C)*sec(c + d*x)*tan(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^3) - ((5*A*b^4 - 4*a^4*C - a^2*b^2*(10*A + C))*sec(c + d*x)*tan(c + d*x))/(6*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^2) + ((20*A*b^6 - a^2*b^4*(53*A - 2*C) + 12*a^6*C + a^4*b^2*(48*A + C))*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*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 7, -(((8*a^4 - 4*a^2*b^2 - b^4)*x)/(8*b^5)) + (2*a^3*sqrt(a - b)*sqrt(a + b)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(b^5*d) + (a*(3*a^2 - b^2)*sin(c + d*x))/(3*b^4*d) - ((4*a^2 - b^2)*cos(c + d*x)*sin(c + d*x))/(8*b^3*d) + (a*cos(c + d*x)^2*sin(c + d*x))/(3*b^2*d) - (cos(c + d*x)^3*sin(c + d*x))/(4*b*d)]
    @test_int [cos(c + d*x)^2*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 6, (a*(2*a^2 - b^2)*x)/(2*b^4) - (2*a^2*sqrt(a - b)*sqrt(a + b)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(b^4*d) - ((3*a^2 - b^2)*sin(c + d*x))/(3*b^3*d) + (a*cos(c + d*x)*sin(c + d*x))/(2*b^2*d) - (cos(c + d*x)^2*sin(c + d*x))/(3*b*d)]
    @test_int [cos(c + d*x)^1*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 5, -(((2*a^2 - b^2)*x)/(2*b^3)) + (2*a*sqrt(a - b)*sqrt(a + b)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(b^3*d) + (a*sin(c + d*x))/(b^2*d) - (cos(c + d*x)*sin(c + d*x))/(2*b*d)]
    @test_int [cos(c + d*x)^0*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 4, (a*x)/b^2 - (2*sqrt(a - b)*sqrt(a + b)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(b^2*d) - sin(c + d*x)/(b*d)]
    @test_int [sec(c + d*x)^1*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 4, -(x/b) + (2*sqrt(a - b)*sqrt(a + b)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a*b*d) + atanh(sin(c + d*x))/(a*d)]
    @test_int [sec(c + d*x)^2*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 5, -((2*sqrt(a - b)*sqrt(a + b)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^2*d)) - (b*atanh(sin(c + d*x)))/(a^2*d) + tan(c + d*x)/(a*d)]
    @test_int [sec(c + d*x)^3*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 6, (2*sqrt(a - b)*b*sqrt(a + b)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^3*d) - ((a^2 - 2*b^2)*atanh(sin(c + d*x)))/(2*a^3*d) - (b*tan(c + d*x))/(a^2*d) + (sec(c + d*x)*tan(c + d*x))/(2*a*d)]
    @test_int [sec(c + d*x)^4*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 7, -((2*sqrt(a - b)*b^2*sqrt(a + b)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^4*d)) + (b*(a^2 - 2*b^2)*atanh(sin(c + d*x)))/(2*a^4*d) - ((a^2 - 3*b^2)*tan(c + d*x))/(3*a^3*d) - (b*sec(c + d*x)*tan(c + d*x))/(2*a^2*d) + (sec(c + d*x)^2*tan(c + d*x))/(3*a*d)]

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

    @test_int [cos(c + d*x)^4*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 8, (a*(20*a^2 - 3*b^2)*x)/(2*b^6) - (a^2*(20*a^4 - 33*a^2*b^2 + 12*b^4)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^6*(a + b)^(3/2)*d) - ((60*a^4 - 59*a^2*b^2 + 2*b^4)*sin(c + d*x))/(6*b^5*(a^2 - b^2)*d) + (a*(10*a^2 - 9*b^2)*cos(c + d*x)*sin(c + d*x))/(2*b^4*(a^2 - b^2)*d) - ((20*a^2 - 17*b^2)*cos(c + d*x)^2*sin(c + d*x))/(6*b^3*(a^2 - b^2)*d) + (cos(c + d*x)^4*sin(c + d*x))/(2*b*d*(a + b*cos(c + d*x))^2) + ((5*a^2 - 4*b^2)*cos(c + d*x)^3*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^3*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 7, -(((12*a^2 - b^2)*x)/(2*b^5)) + (a*(12*a^4 - 19*a^2*b^2 + 6*b^4)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^5*(a + b)^(3/2)*d) + (a*(12*a^2 - 11*b^2)*sin(c + d*x))/(2*b^4*(a^2 - b^2)*d) - ((6*a^2 - 5*b^2)*cos(c + d*x)*sin(c + d*x))/(2*b^3*(a^2 - b^2)*d) + (cos(c + d*x)^3*sin(c + d*x))/(2*b*d*(a + b*cos(c + d*x))^2) + ((4*a^2 - 3*b^2)*cos(c + d*x)^2*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^2*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 6, (3*a*x)/b^4 - ((6*a^4 - 9*a^2*b^2 + 2*b^4)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^4*(a + b)^(3/2)*d) - (3*sin(c + d*x))/(2*b^3*d) + (cos(c + d*x)^2*sin(c + d*x))/(2*b*d*(a + b*cos(c + d*x))^2) - (a*(3*a^2 - 2*b^2)*sin(c + d*x))/(2*b^3*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^1*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 5, -(x/b^3) + (a*(2*a^2 - 3*b^2)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^3*(a + b)^(3/2)*d) - (a*sin(c + d*x))/(2*b^2*d*(a + b*cos(c + d*x))^2) + ((3*a^2 - 2*b^2)*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 6, atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b))/((a - b)^(3/2)*(a + b)^(3/2)*d) + sin(c + d*x)/(2*b*d*(a + b*cos(c + d*x))^2) - (a*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 6, -((b*(3*a^2 - 2*b^2)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^3*(a - b)^(3/2)*(a + b)^(3/2)*d)) + atanh(sin(c + d*x))/(a^3*d) - sin(c + d*x)/(2*a*d*(a + b*cos(c + d*x))^2) - ((a^2 - 2*b^2)*sin(c + d*x))/(2*a^2*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 7, -(((2*a^4 - 9*a^2*b^2 + 6*b^4)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^4*(a - b)^(3/2)*(a + b)^(3/2)*d)) - (3*b*atanh(sin(c + d*x)))/(a^4*d) + ((5*a^2 - 6*b^2)*tan(c + d*x))/(2*a^3*(a^2 - b^2)*d) - tan(c + d*x)/(2*a*d*(a + b*cos(c + d*x))^2) - ((2*a^2 - 3*b^2)*tan(c + d*x))/(2*a^2*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 8, (b*(6*a^4 - 19*a^2*b^2 + 12*b^4)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^5*(a - b)^(3/2)*(a + b)^(3/2)*d) - ((a^2 - 12*b^2)*atanh(sin(c + d*x)))/(2*a^5*d) - (b*(11*a^2 - 12*b^2)*tan(c + d*x))/(2*a^4*(a^2 - b^2)*d) + ((5*a^2 - 6*b^2)*sec(c + d*x)*tan(c + d*x))/(2*a^3*(a^2 - b^2)*d) - (sec(c + d*x)*tan(c + d*x))/(2*a*d*(a + b*cos(c + d*x))^2) - ((3*a^2 - 4*b^2)*sec(c + d*x)*tan(c + d*x))/(2*a^2*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^4*(1 - cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 9, -((b^2*(12*a^4 - 33*a^2*b^2 + 20*b^4)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^6*(a - b)^(3/2)*(a + b)^(3/2)*d)) + (b*(3*a^2 - 20*b^2)*atanh(sin(c + d*x)))/(2*a^6*d) - ((2*a^4 - 59*a^2*b^2 + 60*b^4)*tan(c + d*x))/(6*a^5*(a^2 - b^2)*d) - (b*(9*a^2 - 10*b^2)*sec(c + d*x)*tan(c + d*x))/(2*a^4*(a^2 - b^2)*d) + ((17*a^2 - 20*b^2)*sec(c + d*x)^2*tan(c + d*x))/(6*a^3*(a^2 - b^2)*d) - (sec(c + d*x)^2*tan(c + d*x))/(2*a*d*(a + b*cos(c + d*x))^2) - ((4*a^2 - 5*b^2)*sec(c + d*x)^2*tan(c + d*x))/(2*a^2*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]

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

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

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

    @test_int [cos(c + d*x)^2*sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 9, -((2*(16*a^4*C + 6*a^2*b^2*(7*A + 4*C) - 21*b^4*(9*A + 7*C))*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)))) + (4*a*(a^2 - b^2)*(21*A*b^2 + 8*a^2*C + 18*b^2*C)*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))) - (4*a*(21*A*b^2 + 8*a^2*C + 18*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*b^3*d) + (2*(24*a^2*C + 7*b^2*(9*A + 7*C))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(315*b^3*d) - (4*a*C*cos(c + d*x)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(21*b^2*d) + (2*C*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)*sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 8, (2*a*(35*A*b^2 + 8*a^2*C + 19*b^2*C)*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)*(35*A*b^2 + 8*a^2*C + 25*b^2*C)*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*(8*a^2*C + 5*b^2*(7*A + 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*b^2*d) - (8*a*C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*b^2*d) + (2*C*cos(c + d*x)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*b*d)]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 7, -((2*(2*a^2*C - 3*b^2*(5*A + 3*C))*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)))) + (4*a*(a^2 - b^2)*C*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))) - (4*a*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b*d) + (2*C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*b*d)]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x), x, 9, (2*a*C*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(3*b*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2*C - b^2*(3*A + C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(3*b*d*sqrt(a + b*cos(c + d*x))) + (2*a*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))) + (2*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 9, -(((A - 2*C)*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (a*A*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))) + (A*b*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))) + (A*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/d]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 10, -(A*b*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(4*a*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (b*(3*A + 8*C)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(4*d*sqrt(a + b*cos(c + d*x))) - ((A*b^2 - 4*a^2*(A + 2*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (2*b)/(a + b)))/(4*a*d*sqrt(a + b*cos(c + d*x))) + (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 [sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 11, ((3*A*b^2 - 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(24*a^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - ((A*b^2 - 8*a^2*(2*A + 3*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(24*a*d*sqrt(a + b*cos(c + d*x))) + (b*(A*b^2 + 4*a^2*(A + 2*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (2*b)/(a + b)))/(8*a^2*d*sqrt(a + b*cos(c + d*x))) - ((3*A*b^2 - 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(24*a^2*d) + (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))^(3/2)*(A + C*cos(c + d*x)^2), x, 10, -((4*a*(8*a^4*C + 3*a^2*b^2*(11*A + 6*C) - b^4*(451*A + 348*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(1155*b^4*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(a^2 - b^2)*(16*a^4*C + 6*a^2*b^2*(11*A + 8*C) - 25*b^4*(11*A + 9*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(1155*b^4*d*sqrt(a + b*cos(c + d*x))) - (2*(16*a^4*C + 6*a^2*b^2*(11*A + 8*C) - 25*b^4*(11*A + 9*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(1155*b^3*d) - (4*a*(33*A*b^2 + 8*a^2*C + 34*b^2*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(1155*b^3*d) + (2*(8*a^2*C + 3*b^2*(11*A + 9*C))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(231*b^3*d) - (4*a*C*cos(c + d*x)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(33*b^2*d) + (2*C*cos(c + d*x)^2*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(11*b*d)]
    @test_int [cos(c + d*x)*(a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2), x, 9, (2*(8*a^4*C + 21*b^4*(9*A + 7*C) + 3*a^2*b^2*(21*A + 11*C))*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*(a^2 - b^2)*(63*A*b^2 + 8*a^2*C + 39*b^2*C)*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*a*(63*A*b^2 + 8*a^2*C + 39*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*b^2*d) + (2*(8*a^2*C + 7*b^2*(9*A + 7*C))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(315*b^2*d) - (8*a*C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(63*b^2*d) + (2*C*cos(c + d*x)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(9*b*d)]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2), x, 8, (4*a*(70*A*b^2 - 3*a^2*C + 41*b^2*C)*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)*(35*A*b^2 - 6*a^2*C + 25*b^2*C)*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*(6*a^2*C - 5*b^2*(7*A + 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*b*d) - (4*a*C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*b*d) + (2*C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*b*d)]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x), x, 10, (2*(a^2*C + b^2*(5*A + 3*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(5*b*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (2*a*(5*A*b^2 - (a^2 - b^2)*C)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(5*b*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*a*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*d) + (2*C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 10, -(a*(3*A - 8*C)*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(3*d*sqrt((a + b*cos(c + d*x))/(a + b))) + ((a^2*(3*A - 2*C) + 2*b^2*(3*A + C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(3*d*sqrt(a + b*cos(c + d*x))) + (3*a*A*b*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))) - (b*(3*A - 2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d) + (A*(a + b*cos(c + d*x))^(3/2)*tan(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 10, -(b*(5*A - 8*C)*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(4*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (a*b*(7*A + 8*C)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(4*d*sqrt(a + b*cos(c + d*x))) + ((3*A*b^2 + 4*a^2*(A + 2*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (2*b)/(a + b)))/(4*d*sqrt(a + b*cos(c + d*x))) + (3*A*b*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(4*d) + (A*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 11, -((3*A*b^2 + 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(24*a*d*sqrt((a + b*cos(c + d*x))/(a + b))) + ((8*a^2*(2*A + 3*C) + b^2*(17*A + 48*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(24*d*sqrt(a + b*cos(c + d*x))) - (b*(A*b^2 - 12*a^2*(A + 2*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (2*b)/(a + b)))/(8*a*d*sqrt(a + b*cos(c + d*x))) + ((3*A*b^2 + 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(24*a*d) + (A*b*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(4*d) + (A*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 12, (b*(3*A*b^2 - 4*a^2*(13*A + 20*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(64*a^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (b*(A*b^2 - 4*a^2*(19*A + 28*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(64*a*d*sqrt(a + b*cos(c + d*x))) + ((3*A*b^4 + 24*a^2*b^2*(A + 2*C) + 16*a^4*(3*A + 4*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (2*b)/(a + b)))/(64*a^2*d*sqrt(a + b*cos(c + d*x))) - (b*(3*A*b^2 - 4*a^2*(13*A + 20*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(64*a^2*d) + ((A*b^2 + 4*a^2*(3*A + 4*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(32*a*d) + (A*b*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(8*d) + (A*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^3*tan(c + d*x))/(4*d)]

    @test_int [cos(c + d*x)^2*(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2), x, 11, -((2*(240*a^6*C - 1617*b^6*(13*A + 11*C) + 10*a^4*b^2*(143*A + 76*C) - 3*a^2*b^4*(13299*A + 10223*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(45045*b^4*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (4*a*(a^2 - b^2)*(120*a^4*C + 5*a^2*b^2*(143*A + 94*C) - 3*b^4*(2717*A + 2174*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(45045*b^4*d*sqrt(a + b*cos(c + d*x))) - (4*a*(120*a^4*C + 5*a^2*b^2*(143*A + 94*C) - 3*b^4*(2717*A + 2174*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(45045*b^3*d) - (2*(240*a^4*C - 539*b^4*(13*A + 11*C) + 10*a^2*b^2*(143*A + 124*C))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(45045*b^3*d) - (4*a*(143*A*b^2 + 24*a^2*C + 166*b^2*C)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(9009*b^3*d) + (2*(24*a^2*C + 11*b^2*(13*A + 11*C))*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(1287*b^3*d) - (12*a*C*cos(c + d*x)*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(143*b^2*d) + (2*C*cos(c + d*x)^2*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(13*b*d)]
    @test_int [cos(c + d*x)*(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2), x, 10, (2*a*(8*a^4*C + 3*a^2*b^2*(33*A + 17*C) + 3*b^4*(319*A + 247*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(693*b^3*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2 - b^2)*(8*a^4*C + 15*b^4*(11*A + 9*C) + 3*a^2*b^2*(33*A + 19*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(693*b^3*d*sqrt(a + b*cos(c + d*x))) + (2*(8*a^4*C + 15*b^4*(11*A + 9*C) + 3*a^2*b^2*(33*A + 19*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(693*b^2*d) + (2*a*(99*A*b^2 + 8*a^2*C + 67*b^2*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(693*b^2*d) + (2*(8*a^2*C + 9*b^2*(11*A + 9*C))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(693*b^2*d) - (8*a*C*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(99*b^2*d) + (2*C*cos(c + d*x)*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(11*b*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2), x, 9, -((2*(10*a^4*C - 21*b^4*(9*A + 7*C) - 3*a^2*b^2*(161*A + 93*C))*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)))) - (4*a*(a^2 - b^2)*(84*A*b^2 - 5*a^2*C + 57*b^2*C)*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))) + (4*a*(84*A*b^2 - 5*a^2*C + 57*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*b*d) - (2*(10*a^2*C - 7*b^2*(9*A + 7*C))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(315*b*d) - (4*a*C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(63*b*d) + (2*C*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(9*b*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x), x, 11, (2*a*(49*A*b^2 + 3*a^2*C + 29*b^2*C)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(21*b*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (2*(2*a^2*b^2*(7*A - C) - 3*a^4*C + b^4*(7*A + 5*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(21*b*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*(3*a^2*C + b^2*(7*A + 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a*C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*d) + (2*C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^2, x, 11, -((a^2*(15*A - 46*C) - 6*b^2*(5*A + 3*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(15*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (a*(a^2*(15*A - 16*C) + 4*b^2*(15*A + 4*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(15*d*sqrt(a + b*cos(c + d*x))) + (5*a^2*A*b*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))) - (a*b*(15*A - 16*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*d) - (b*(5*A - 2*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d) + (A*(a + b*cos(c + d*x))^(5/2)*tan(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^3, x, 11, -(a*b*(27*A - 56*C)*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(12*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (b*(8*b^2*(3*A + C) + a^2*(33*A + 16*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(12*d*sqrt(a + b*cos(c + d*x))) + (a*(15*A*b^2 + 4*a^2*(A + 2*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (2*b)/(a + b)))/(4*d*sqrt(a + b*cos(c + d*x))) - (b^2*(21*A - 8*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(12*d) + (5*A*b*(a + b*cos(c + d*x))^(3/2)*tan(c + d*x))/(4*d) + (A*(a + b*cos(c + d*x))^(5/2)*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^4, x, 11, -((3*b^2*(11*A - 16*C) + 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(24*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (a*(8*a^2*(2*A + 3*C) + b^2*(59*A + 96*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(24*d*sqrt(a + b*cos(c + d*x))) + (5*b*(A*b^2 + 4*a^2*(A + 2*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (2*b)/(a + b)))/(8*d*sqrt(a + b*cos(c + d*x))) + ((15*A*b^2 + 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(24*d) + (5*A*b*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)*tan(c + d*x))/(12*d) + (A*(a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^5, x, 12, -(b*(15*A*b^2 + 4*a^2*(71*A + 108*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(192*a*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (b*(4*a^2*(89*A + 132*C) + b^2*(133*A + 384*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(192*d*sqrt(a + b*cos(c + d*x))) - ((5*A*b^4 - 120*a^2*b^2*(A + 2*C) - 16*a^4*(3*A + 4*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (2*b)/(a + b)))/(64*a*d*sqrt(a + b*cos(c + d*x))) + (b*(15*A*b^2 + 4*a^2*(71*A + 108*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(192*a*d) + ((5*A*b^2 + 4*a^2*(3*A + 4*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(32*d) + (5*A*b*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^2*tan(c + d*x))/(24*d) + (A*(a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^3*tan(c + d*x))/(4*d)]

    @test_int [(a + b*cos(c + d*x))^(3/2)*(a^2 - b^2*cos(c + d*x)^2), x, 9, (4*a*(73*a^2 - 41*b^2)*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(105*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(41*a^4 - 66*a^2*b^2 + 25*b^4)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(105*d*sqrt(a + b*cos(c + d*x))) + (2*b*(41*a^2 - 25*b^2)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*d) + (4*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 [sqrt(a + b*cos(c + d*x))*(a^2 - b^2*cos(c + d*x)^2), x, 8, (2*(17*a^2 - 9*b^2)*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))) - (4*a*(a^2 - b^2)*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))) + (4*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)]

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

    @test_int [(cos(c + d*x)^3*(A + C*cos(c + d*x)^2))/sqrt(a + b*cos(c + d*x)), x, 9, (2*(128*a^4*C + 21*b^4*(9*A + 7*C) + 12*a^2*b^2*(14*A + 9*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(315*b^5*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*a*(128*a^4*C + 4*a^2*b^2*(42*A + 19*C) + 3*b^4*(49*A + 37*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(315*b^5*d*sqrt(a + b*cos(c + d*x))) - (4*a*(42*A*b^2 + 32*a^2*C + 31*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*b^4*d) + (2*(48*a^2*C + 7*b^2*(9*A + 7*C))*cos(c + d*x)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*b^3*d) - (16*a*C*cos(c + d*x)^2*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(63*b^2*d) + (2*C*cos(c + d*x)^3*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(9*b*d)]
    @test_int [(cos(c + d*x)^2*(A + C*cos(c + d*x)^2))/sqrt(a + b*cos(c + d*x)), x, 8, -((4*a*(35*A*b^2 + 24*a^2*C + 22*b^2*C)*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*(48*a^4*C + 5*b^4*(7*A + 5*C) + 2*a^2*b^2*(35*A + 16*C))*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*(24*a^2*C + 5*b^2*(7*A + 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*b^3*d) - (12*a*C*cos(c + d*x)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*b^2*d) + (2*C*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)*(A + C*cos(c + d*x)^2))/sqrt(a + b*cos(c + d*x)), x, 7, (2*(8*a^2*C + 3*b^2*(5*A + 3*C))*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*a*(15*A*b^2 + 8*a^2*C + 7*b^2*C)*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))) - (8*a*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b^2*d) + (2*C*cos(c + d*x)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*b*d)]
    @test_int [(A + C*cos(c + d*x)^2)/sqrt(a + b*cos(c + d*x)), x, 6, (-4*a*C*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(3*b^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (2*(2*a^2*C + b^2*(3*A + C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(3*b^2*d*sqrt(a + b*cos(c + d*x))) + (2*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b*d)]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x))/sqrt(a + b*cos(c + d*x)), x, 8, (2*C*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(b*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*a*C*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(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 [((A + C*cos(c + d*x)^2)*sec(c + d*x)^2)/sqrt(a + b*cos(c + d*x)), x, 9, -((A*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(a*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((A + 2*C)*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))) - (A*b*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (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 [((A + C*cos(c + d*x)^2)*sec(c + d*x)^3)/sqrt(a + b*cos(c + d*x)), x, 10, (3*A*b*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(4*a^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (A*b*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(4*a*d*sqrt(a + b*cos(c + d*x))) + ((3*A*b^2 + 4*a^2*(A + 2*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (2*b)/(a + b)))/(4*a^2*d*sqrt(a + b*cos(c + d*x))) - (3*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 [((A + C*cos(c + d*x)^2)*sec(c + d*x)^4)/sqrt(a + b*cos(c + d*x)), x, 11, -((15*A*b^2 + 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(24*a^3*d*sqrt((a + b*cos(c + d*x))/(a + b))) + ((5*A*b^2 + 8*a^2*(2*A + 3*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(24*a^2*d*sqrt(a + b*cos(c + d*x))) - (b*(5*A*b^2 + 4*a^2*(A + 2*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (c + d*x)/2, (2*b)/(a + b)))/(8*a^3*d*sqrt(a + b*cos(c + d*x))) + ((15*A*b^2 + 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(24*a^3*d) - (5*A*b*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(12*a^2*d) + (A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(3*a*d)]

    @test_int [(cos(c + d*x)^3*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(3/2), x, 9, -((2*a*(4*a^2*b^2*(70*A - 43*C) + 384*a^4*C - b^4*(175*A + 107*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(105*b^5*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(384*a^4*C + 5*b^4*(7*A + 5*C) + 4*a^2*b^2*(70*A + 29*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(105*b^5*d*sqrt(a + b*cos(c + d*x))) - (2*(A*b^2 + a^2*C)*cos(c + d*x)^3*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (2*(2*a^2*b^2*(70*A - 31*C) + 192*a^4*C - 5*b^4*(7*A + 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*b^4*(a^2 - b^2)*d) - (2*a*(35*A*b^2 + 48*a^2*C - 13*b^2*C)*cos(c + d*x)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*b^3*(a^2 - b^2)*d) + (2*(7*A*b^2 + 8*a^2*C - b^2*C)*cos(c + d*x)^2*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(7*b^2*(a^2 - b^2)*d)]
    @test_int [(cos(c + d*x)^2*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(3/2), x, 8, (2*(2*a^2*b^2*(5*A - 4*C) + 16*a^4*C - b^4*(5*A + 3*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(5*b^4*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (4*a*(5*A*b^2 + 2*(4*a^2 + b^2)*C)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(5*b^4*d*sqrt(a + b*cos(c + d*x))) - (2*(A*b^2 + a^2*C)*cos(c + d*x)^2*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (2*a*(5*A*b^2 + 8*a^2*C - 3*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*b^3*(a^2 - b^2)*d) + (2*(5*A*b^2 + 6*a^2*C - b^2*C)*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)*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(3/2), x, 7, -((2*a*(3*A*b^2 + 8*a^2*C - 5*b^2*C)*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*(3*A*b^2 + (8*a^2 + b^2)*C)*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*(A*b^2 + a^2*C)*sin(c + d*x))/(b^2*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (2*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b^2*d)]
    @test_int [(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 6, (2*(A*b^2 + 2*a^2*C - b^2*C)*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))) - (4*a*C*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*b^2 + a^2*C)*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x))/(a + b*cos(c + d*x))^(3/2), x, 9, (-2*(A*b^2 + a^2*C)*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(a*b*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (2*C*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(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)))/(a*d*sqrt(a + b*cos(c + d*x))) + (2*(A*b^2 + a^2*C)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 10, ((3*A*b^2 - a^2*(A - 2*C))*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*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*(3*A*b^2 - a^2*(A - 2*C))*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 [((A + C*cos(c + d*x)^2)*sec(c + d*x)^3)/(a + b*cos(c + d*x))^(3/2), x, 11, -((b*(15*A*b^2 - a^2*(7*A - 8*C))*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*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))) + ((15*A*b^2 + 4*a^2*(A + 2*C))*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^2*(15*A*b^2 - a^2*(7*A - 8*C))*sin(c + d*x))/(4*a^3*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (5*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)^3*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(5/2), x, 9, (2*(4*a^4*b^2*(10*A - 53*C) - 5*a^2*b^4*(15*A - 11*C) + 128*a^6*C + 3*b^6*(5*A + 3*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(15*b^5*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*a*(4*a^2*b^2*(10*A - 29*C) + 128*a^4*C - b^4*(45*A + 17*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(15*b^5*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (2*(A*b^2 + a^2*C)*cos(c + d*x)^3*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (4*(3*A*b^4 - a^2*b^2*(A - 6*C) - 4*a^4*C)*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))) - (4*a*(a^2*b^2*(10*A - 49*C) - b^4*(20*A - 7*C) + 32*a^4*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b^4*(a^2 - b^2)^2*d) + (2*(a^2*b^2*(15*A - 71*C) - b^4*(35*A - 3*C) + 48*a^4*C)*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)^2*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(5/2), x, 8, -((4*a*(a^2*b^2*(A - 14*C) - b^4*(3*A - 4*C) + 8*a^4*C)*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*(2*a^2*b^2*(A - 8*C) + 16*a^4*C - b^4*(3*A + C))*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*b^2 + a^2*C)*cos(c + d*x)^2*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (4*a*(2*A*b^4 - 3*a^4*C + 5*a^2*b^2*C)*sin(c + d*x))/(3*b^3*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) + (2*(A*b^2 + 2*a^2*C - b^2*C)*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)*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(5/2), x, 7, -((2*(3*b^4*(A - C) - 8*a^4*C + a^2*b^2*(A + 15*C))*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*a*(A*b^2 - 8*a^2*C + 9*b^2*C)*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*(A*b^2 + a^2*C)*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*(3*A*b^4 - 5*a^4*C + a^2*b^2*(A + 9*C))*sin(c + d*x))/(3*b^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 7, (4*a*(2*A*b^2 - (a^2 - 3*b^2)*C)*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*b^2 - 2*a^2*C + 3*b^2*C)*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*b^2 + a^2*C)*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (4*a*(2*A*b^2 - a^2*C + 3*b^2*C)*sin(c + d*x))/(3*b*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x))/(a + b*cos(c + d*x))^(5/2), x, 10, (2*(3*A*b^4 - a^4*C - a^2*b^2*(7*A + 3*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(3*a^2*b*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (2*(A*b^2 + a^2*C)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(3*a*b*(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, (c + d*x)/2, (2*b)/(a + b)))/(a^2*d*sqrt(a + b*cos(c + d*x))) + (2*(A*b^2 + a^2*C)*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (2*(3*A*b^4 - a^4*C - a^2*b^2*(7*A + 3*C))*sin(c + d*x))/(3*a^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 11, ((26*a^2*A*b^2 - 15*A*b^4 - a^4*(3*A - 8*C))*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))) - ((5*A*b^2 - a^2*(3*A - 2*C))*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*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*(5*A*b^2 - a^2*(3*A - 2*C))*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (b*(26*a^2*A*b^2 - 15*A*b^4 - a^4*(3*A - 8*C))*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 [(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(7/2), x, 8, -((2*(2*a^4*C - 3*b^4*(3*A + 5*C) - a^2*b^2*(23*A + 19*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^2*(a^2 - b^2)^3*d*sqrt((a + b*cos(c + d*x))/(a + b)))) - (4*a*(4*A*b^2 - (a^2 - 5*b^2)*C)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) - (2*(A*b^2 + a^2*C)*sin(c + d*x))/(5*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(5/2)) - (4*a*(4*A*b^2 - a^2*C + 5*b^2*C)*sin(c + d*x))/(15*b*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^(3/2)) + (2*(2*a^4*C - 3*b^4*(3*A + 5*C) - a^2*b^2*(23*A + 19*C))*sin(c + d*x))/(15*b*(a^2 - b^2)^3*d*sqrt(a + b*cos(c + d*x)))]

    @test_int [(a^2 - b^2*cos(c + d*x)^2)/sqrt(a + b*cos(c + d*x)), x, 7, (4*a*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*(a^2 - b^2)*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*b*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [(a^2 - b^2*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 6, (-2*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(d*sqrt((a + b*cos(c + d*x))/(a + b))) + (4*a*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)))]
    @test_int [(a^2 - b^2*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 7, (4*a*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/((a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*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))) - (4*a*b*sin(c + d*x))/((a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [(a^2 - b^2*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(7/2), x, 8, (2*(5*a^2 + 3*b^2)*sqrt(a + b*cos(c + d*x))*Elliptic.E((c + d*x)/2, (2*b)/(a + b)))/(3*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (4*a*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((c + d*x)/2, (2*b)/(a + b)))/(3*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (4*a*b*sin(c + d*x))/(3*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (2*b*(5*a^2 + 3*b^2)*sin(c + d*x))/(3*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]

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

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

    @test_int [cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 8, (2*a*(9*A + 7*C)*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (10*b*(11*A + 9*C)*Elliptic.F((1/2)*(c + d*x), 2))/(231*d) + (10*b*(11*A + 9*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (2*a*(9*A + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*b*(11*A + 9*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(77*d) + (2*a*C*cos(c + d*x)^(7/2)*sin(c + d*x))/(9*d) + (2*b*C*cos(c + d*x)^(9/2)*sin(c + d*x))/(11*d)]
    @test_int [cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 7, (2*b*(9*A + 7*C)*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (2*a*(7*A + 5*C)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*a*(7*A + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*b*(9*A + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*a*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d) + (2*b*C*cos(c + d*x)^(7/2)*sin(c + d*x))/(9*d)]
    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 6, (2*a*(5*A + 3*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*b*(7*A + 5*C)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*b*(7*A + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*a*C*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*b*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [((a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 5, (2*b*(5*A + 3*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*a*(3*A + C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a*C*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*b*C*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [((a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 5, -((2*a*(A - C)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*b*(3*A + C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a*A*sin(c + d*x))/(d*sqrt(cos(c + d*x))) + (2*b*C*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [((a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 5, -((2*b*(A - C)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*a*(A + 3*C)*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*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 6, -((2*a*(3*A + 5*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*b*(A + 3*C)*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*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*a*(3*A + 5*C)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 7, -((2*b*(3*A + 5*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*a*(5*A + 7*C)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*a*A*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (2*A*b*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*a*(5*A + 7*C)*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (2*b*(3*A + 5*C)*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))^2*(A + C*cos(c + d*x)^2), x, 8, (4*a*b*(9*A + 7*C)*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (2*(11*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*Elliptic.F((1/2)*(c + d*x), 2))/(231*d) + (2*(11*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (4*a*b*(9*A + 7*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*(4*a^2*C + b^2*(11*A + 9*C))*cos(c + d*x)^(5/2)*sin(c + d*x))/(77*d) + (8*a*b*C*cos(c + d*x)^(7/2)*sin(c + d*x))/(99*d) + (2*C*cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(11*d)]
    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2), x, 7, (2*(3*a^2*(5*A + 3*C) + b^2*(9*A + 7*C))*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (4*a*b*(7*A + 5*C)*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (4*a*b*(7*A + 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*(4*a^2*C + b^2*(9*A + 7*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (8*a*b*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(63*d) + (2*C*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(9*d)]
    @test_int [((a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 6, (4*a*b*(5*A + 3*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*(7*a^2*(3*A + C) + b^2*(7*A + 5*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*(4*a^2*C + b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (8*a*b*C*cos(c + d*x)^(3/2)*sin(c + d*x))/(35*d) + (2*C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d)]
    @test_int [((a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 6, -((2*(5*a^2*(A - C) - b^2*(5*A + 3*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (4*a*b*(3*A + C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) - (4*a*b*(3*A - C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) - (2*b^2*(5*A - C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 6, -((4*a*b*(A - C)*Elliptic.E((1/2)*(c + d*x), 2))/d) + (2*(b^2*(3*A + C) + a^2*(A + 3*C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (8*a*A*b*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) - (2*b^2*(A - C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 6, -((2*(5*b^2*(A - C) + a^2*(3*A + 5*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (4*a*b*(A + 3*C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (8*a*A*b*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)) + (2*(4*A*b^2 + a^2*(3*A + 5*C))*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + b*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 7, -((4*a*b*(3*A + 5*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*(7*b^2*(A + 3*C) + a^2*(5*A + 7*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (8*a*A*b*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*(4*A*b^2 + a^2*(5*A + 7*C))*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (4*a*b*(3*A + 5*C)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]

    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2), x, 8, (2*a*(a^2*(5*A + 3*C) + b^2*(9*A + 7*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d) + (2*b*(33*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*Elliptic.F((1/2)*(c + d*x), 2))/(231*d) + (2*b*(33*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (2*a*(99*A*b^2 + 8*a^2*C + 77*b^2*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(165*d) + (2*b*(8*a^2*C + 3*b^2*(11*A + 9*C))*cos(c + d*x)^(5/2)*sin(c + d*x))/(231*d) + (4*a*C*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(33*d) + (2*C*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(11*d)]
    @test_int [((a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 7, (2*b*(9*a^2*(5*A + 3*C) + b^2*(9*A + 7*C))*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (2*a*(7*a^2*(3*A + C) + 3*b^2*(7*A + 5*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*a*(63*A*b^2 + 8*a^2*C + 45*b^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(63*d) + (2*b*(24*a^2*C + 7*b^2*(9*A + 7*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(315*d) + (4*a*C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(21*d) + (2*C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^3*sin(c + d*x))/(9*d)]
    @test_int [((a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 7, -((2*a*(5*a^2*(A - C) - 3*b^2*(5*A + 3*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*b*(21*a^2*(3*A + C) + b^2*(7*A + 5*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) - (2*b*(6*a^2*(7*A - 3*C) - b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) - (2*a*b^2*(35*A - 11*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(35*d) - (2*b*(7*A - C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d) + (2*A*(a + b*cos(c + d*x))^3*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 7, -((2*b*(15*a^2*(A - C) - b^2*(5*A + 3*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*a*(3*b^2*(3*A + C) + a^2*(A + 3*C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) - (2*a*b^2*(5*A - C)*sqrt(cos(c + d*x))*sin(c + d*x))/d - (2*b^3*(35*A - 3*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (4*A*b*(a + b*cos(c + d*x))^2*sin(c + d*x))/(d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^3*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 7, -((2*a*(15*b^2*(A - C) + a^2*(3*A + 5*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*b*(b^2*(3*A + C) + 3*a^2*(A + 3*C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) + (2*a*(8*A*b^2 + a^2*(3*A + 5*C))*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) - (2*b^3*(9*A - 5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) + (4*A*b*(a + b*cos(c + d*x))^2*sin(c + d*x))/(5*d*cos(c + d*x)^(3/2)) + (2*A*(a + b*cos(c + d*x))^3*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 7, -((2*b*(5*b^2*(A - C) + 3*a^2*(3*A + 5*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*a*(21*b^2*(A + 3*C) + a^2*(5*A + 7*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*a*(24*A*b^2 + 5*a^2*(5*A + 7*C))*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (6*b*(8*A*b^2 + 7*a^2*(3*A + 5*C))*sin(c + d*x))/(35*d*sqrt(cos(c + d*x))) + (12*A*b*(a + b*cos(c + d*x))^2*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*A*(a + b*cos(c + d*x))^3*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [((a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 8, -((2*a*(9*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*Elliptic.E((1/2)*(c + d*x), 2))/(15*d)) + (2*b*(7*b^2*(A + 3*C) + 3*a^2*(5*A + 7*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (2*a*(24*A*b^2 + 7*a^2*(7*A + 9*C))*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)) + (2*b*(8*A*b^2 + 9*a^2*(5*A + 7*C))*sin(c + d*x))/(63*d*cos(c + d*x)^(3/2)) + (2*a*(9*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (4*A*b*(a + b*cos(c + d*x))^2*sin(c + d*x))/(21*d*cos(c + d*x)^(7/2)) + (2*A*(a + b*cos(c + d*x))^3*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]

    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2), x, 9, (2*(39*a^4*(5*A + 3*C) + 78*a^2*b^2*(9*A + 7*C) + 7*b^4*(13*A + 11*C))*Elliptic.E((1/2)*(c + d*x), 2))/(195*d) + (8*a*b*(11*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*Elliptic.F((1/2)*(c + d*x), 2))/(231*d) + (8*a*b*(11*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (2*(192*a^4*C + 77*b^4*(13*A + 11*C) + 11*a^2*b^2*(637*A + 491*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(6435*d) + (4*a*b*(1573*A*b^2 + 96*a^2*C + 1259*b^2*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(9009*d) + (2*(48*a^2*C + 11*b^2*(13*A + 11*C))*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(1287*d) + (16*a*C*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(143*d) + (2*C*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^4*sin(c + d*x))/(13*d)]
    @test_int [((a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 8, (8*a*b*(3*a^2*(5*A + 3*C) + b^2*(9*A + 7*C))*Elliptic.E((1/2)*(c + d*x), 2))/(15*d) + (2*(77*a^4*(3*A + C) + 66*a^2*b^2*(7*A + 5*C) + 5*b^4*(11*A + 9*C))*Elliptic.F((1/2)*(c + d*x), 2))/(231*d) + (2*(64*a^4*C + 15*b^4*(11*A + 9*C) + 9*a^2*b^2*(143*A + 101*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(693*d) + (4*a*b*(891*A*b^2 + 96*a^2*C + 673*b^2*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(3465*d) + (2*(16*a^2*C + 3*b^2*(11*A + 9*C))*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(231*d) + (16*a*C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^3*sin(c + d*x))/(99*d) + (2*C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^4*sin(c + d*x))/(11*d)]
    @test_int [((a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 8, -((2*(15*a^4*(A - C) - 18*a^2*b^2*(5*A + 3*C) - b^4*(9*A + 7*C))*Elliptic.E((1/2)*(c + d*x), 2))/(15*d)) + (8*a*b*(7*a^2*(3*A + C) + b^2*(7*A + 5*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) - (4*a*b*(a^2*(63*A - 31*C) - 6*b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(63*d) - (2*b^2*(3*a^2*(105*A - 41*C) - 7*b^2*(9*A + 7*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(315*d) - (2*a*b*(21*A - 5*C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(21*d) - (2*b*(9*A - C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^3*sin(c + d*x))/(9*d) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 8, -((8*a*b*(5*a^2*(A - C) - b^2*(5*A + 3*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*(42*a^2*b^2*(3*A + C) + 7*a^4*(A + 3*C) + b^4*(7*A + 5*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) - (2*b^2*(3*a^2*(49*A - 13*C) - b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) - (4*a*b^3*(175*A - 27*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(105*d) - (2*b^2*(21*A - C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d) + (16*A*b*(a + b*cos(c + d*x))^3*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 8, -((2*(30*a^2*b^2*(A - C) - b^4*(5*A + 3*C) + a^4*(3*A + 5*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (8*a*b*(b^2*(3*A + C) + a^2*(A + 3*C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*d) - (4*a*b*(2*b^2*(33*A - 5*C) + 3*a^2*(3*A + 5*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) - (2*b^2*(b^2*(59*A - 3*C) + 3*a^2*(3*A + 5*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*(16*A*b^2 + a^2*(3*A + 5*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (16*A*b*(a + b*cos(c + d*x))^3*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 8, -((8*a*b*(5*b^2*(A - C) + a^2*(3*A + 5*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*d)) + (2*(7*b^4*(3*A + C) + 42*a^2*b^2*(A + 3*C) + a^4*(5*A + 7*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (4*a*b*(96*A*b^2 + a^2*(101*A + 175*C))*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))) - (2*b^2*(b^2*(87*A - 35*C) + 5*a^2*(5*A + 7*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(105*d) + (2*(48*A*b^2 + 5*a^2*(5*A + 7*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (16*A*b*(a + b*cos(c + d*x))^3*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [((a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 8, -((2*(15*b^4*(A - C) + 18*a^2*b^2*(3*A + 5*C) + a^4*(7*A + 9*C))*Elliptic.E((1/2)*(c + d*x), 2))/(15*d)) + (8*a*b*(7*b^2*(A + 3*C) + a^2*(5*A + 7*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*d) + (4*a*b*(32*A*b^2 + a^2*(101*A + 147*C))*sin(c + d*x))/(315*d*cos(c + d*x)^(3/2)) + (2*(192*A*b^4 + 21*a^4*(7*A + 9*C) + 7*a^2*b^2*(155*A + 261*C))*sin(c + d*x))/(315*d*sqrt(cos(c + d*x))) + (2*(48*A*b^2 + 7*a^2*(7*A + 9*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)) + (16*A*b*(a + b*cos(c + d*x))^3*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2)) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]
    @test_int [((a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(13/2), x, 9, -((8*a*b*(3*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*Elliptic.E((1/2)*(c + d*x), 2))/(15*d)) + (2*(77*b^4*(A + 3*C) + 66*a^2*b^2*(5*A + 7*C) + 5*a^4*(9*A + 11*C))*Elliptic.F((1/2)*(c + d*x), 2))/(231*d) + (4*a*b*(96*A*b^2 + a^2*(673*A + 891*C))*sin(c + d*x))/(3465*d*cos(c + d*x)^(5/2)) + (2*(64*A*b^4 + 15*a^4*(9*A + 11*C) + 9*a^2*b^2*(101*A + 143*C))*sin(c + d*x))/(693*d*cos(c + d*x)^(3/2)) + (8*a*b*(3*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*(16*A*b^2 + 3*a^2*(9*A + 11*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(231*d*cos(c + d*x)^(7/2)) + (16*A*b*(a + b*cos(c + d*x))^3*sin(c + d*x))/(99*d*cos(c + d*x)^(9/2)) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(11*d*cos(c + d*x)^(11/2))]

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

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

    @test_int [(cos(c + d*x)^(5/2)*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^2, x, 8, ((3*a^2*b^2*(5*A - 8*C) + 35*a^4*C - 2*b^4*(5*A + 3*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*b^4*(a^2 - b^2)*d) - (a*(a^2*b^2*(9*A - 20*C) + 21*a^4*C - 4*b^4*(3*A + C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^5*(a^2 - b^2)*d) - (a^2*(5*A*b^4 - 3*a^2*b^2*(A - 3*C) - 7*a^4*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/((a - b)*b^5*(a + b)^2*d) - (a*(3*A*b^2 + 7*a^2*C - 4*b^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b^3*(a^2 - b^2)*d) + ((5*A*b^2 + 7*a^2*C - 2*b^2*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*b^2*(a^2 - b^2)*d) - ((A*b^2 + a^2*C)*cos(c + d*x)^(5/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 + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^2, x, 7, -((a*(A*b^2 + 5*a^2*C - 4*b^2*C)*Elliptic.E((1/2)*(c + d*x), 2))/(b^3*(a^2 - b^2)*d)) + ((a^2*b^2*(3*A - 16*C) + 15*a^4*C - 2*b^4*(3*A + C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^4*(a^2 - b^2)*d) + (a*(3*A*b^4 - a^2*b^2*(A - 7*C) - 5*a^4*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/((a - b)*b^4*(a + b)^2*d) + ((3*A*b^2 + 5*a^2*C - 2*b^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d) - ((A*b^2 + a^2*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [(sqrt(cos(c + d*x))*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^2, x, 6, ((A*b^2 + 3*a^2*C - 2*b^2*C)*Elliptic.E((1/2)*(c + d*x), 2))/(b^2*(a^2 - b^2)*d) + (a*(A*b^2 - 3*a^2*C + 4*b^2*C)*Elliptic.F((1/2)*(c + d*x), 2))/(b^3*(a^2 - b^2)*d) - ((A*b^4 - 3*a^4*C + a^2*b^2*(A + 5*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/((a - b)*b^3*(a + b)^2*d) - ((A*b^2 + a^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2), x, 6, -(((A*b^2 + a^2*C)*Elliptic.E((1/2)*(c + d*x), 2))/(a*b*(a^2 - b^2)*d)) - ((A*b^2 - a^2*C + 2*b^2*C)*Elliptic.F((1/2)*(c + d*x), 2))/(b^2*(a^2 - b^2)*d) - ((A*b^4 + a^4*C - 3*a^2*b^2*(A + C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a*(a - b)*b^2*(a + b)^2*d) + ((A*b^2 + a^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2), x, 7, ((3*A*b^2 - a^2*(2*A - C))*Elliptic.E((1/2)*(c + d*x), 2))/(a^2*(a^2 - b^2)*d) + ((A*b^2 + a^2*C)*Elliptic.F((1/2)*(c + d*x), 2))/(a*b*(a^2 - b^2)*d) + ((3*A*b^4 - a^4*C - a^2*b^2*(5*A + C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^2*(a - b)*b*(a + b)^2*d) - ((3*A*b^2 - a^2*(2*A - C))*sin(c + d*x))/(a^2*(a^2 - b^2)*d*sqrt(cos(c + d*x))) + ((A*b^2 + a^2*C)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(cos(c + d*x))*(a + b*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))^2), x, 8, -((b*(5*A*b^2 - a^2*(4*A - C))*Elliptic.E((1/2)*(c + d*x), 2))/(a^3*(a^2 - b^2)*d)) - ((5*A*b^2 - a^2*(2*A - 3*C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*a^2*(a^2 - b^2)*d) - ((5*A*b^4 - a^2*b^2*(7*A - C) - 3*a^4*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^3*(a - b)*(a + b)^2*d) - ((5*A*b^2 - a^2*(2*A - 3*C))*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d*cos(c + d*x)^(3/2)) + (b*(5*A*b^2 - a^2*(4*A - C))*sin(c + d*x))/(a^3*(a^2 - b^2)*d*sqrt(cos(c + d*x))) + ((A*b^2 + a^2*C)*sin(c + d*x))/(a*(a^2 - b^2)*d*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(7/2)*(a + b*cos(c + d*x))^2), x, 9, ((35*A*b^4 - 3*a^2*b^2*(8*A - 5*C) - 2*a^4*(3*A + 5*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*a^4*(a^2 - b^2)*d) + (b*(7*A*b^2 - a^2*(4*A - 3*C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*a^3*(a^2 - b^2)*d) + (b*(7*A*b^4 - 3*a^2*b^2*(3*A - C) - 5*a^4*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^4*(a - b)*(a + b)^2*d) - ((7*A*b^2 - a^2*(2*A - 5*C))*sin(c + d*x))/(5*a^2*(a^2 - b^2)*d*cos(c + d*x)^(5/2)) + (b*(7*A*b^2 - a^2*(4*A - 3*C))*sin(c + d*x))/(3*a^3*(a^2 - b^2)*d*cos(c + d*x)^(3/2)) - ((35*A*b^4 - 3*a^2*b^2*(8*A - 5*C) - 2*a^4*(3*A + 5*C))*sin(c + d*x))/(5*a^4*(a^2 - b^2)*d*sqrt(cos(c + d*x))) + ((A*b^2 + a^2*C)*sin(c + d*x))/(a*(a^2 - b^2)*d*cos(c + d*x)^(5/2)*(a + b*cos(c + d*x)))]

    @test_int [(cos(c + d*x)^(5/2)*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^3, x, 8, -((a*(a^2*b^2*(3*A - 65*C) - 3*b^4*(3*A - 8*C) + 35*a^4*C)*Elliptic.E((1/2)*(c + d*x), 2))/(4*b^4*(a^2 - b^2)^2*d)) + ((a^4*b^2*(9*A - 223*C) - a^2*b^4*(15*A - 128*C) + 105*a^6*C + 8*b^6*(3*A + C))*Elliptic.F((1/2)*(c + d*x), 2))/(12*b^5*(a^2 - b^2)^2*d) - (a*(15*A*b^6 + a^4*b^2*(3*A - 86*C) - 3*a^2*b^4*(2*A - 21*C) + 35*a^6*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*(a - b)^2*b^5*(a + b)^3*d) + ((a^2*b^2*(3*A - 61*C) - b^4*(21*A - 8*C) + 35*a^4*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(12*b^3*(a^2 - b^2)^2*d) - ((A*b^2 + a^2*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + ((5*A*b^4 - 7*a^4*C + a^2*b^2*(A + 13*C))*cos(c + d*x)^(3/2)*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 + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^3, x, 7, -(((b^4*(5*A - 8*C) - 15*a^4*C + a^2*b^2*(A + 29*C))*Elliptic.E((1/2)*(c + d*x), 2))/(4*b^3*(a^2 - b^2)^2*d)) - (a*(15*a^4*C + b^4*(7*A + 24*C) - a^2*b^2*(A + 33*C))*Elliptic.F((1/2)*(c + d*x), 2))/(4*b^4*(a^2 - b^2)^2*d) + ((3*A*b^6 + 15*a^6*C + 5*a^2*b^4*(2*A + 7*C) - a^4*b^2*(A + 38*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*(a - b)^2*b^4*(a + b)^3*d) - ((A*b^2 + a^2*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + ((3*A*b^4 - 5*a^4*C + a^2*b^2*(3*A + 11*C))*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 [(sqrt(cos(c + d*x))*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^3, x, 7, ((A*b^4 - 3*a^4*C + a^2*b^2*(5*A + 9*C))*Elliptic.E((1/2)*(c + d*x), 2))/(4*a*b^2*(a^2 - b^2)^2*d) + ((a^2*b^2*(3*A - 5*C) + 3*a^4*C + b^4*(3*A + 8*C))*Elliptic.F((1/2)*(c + d*x), 2))/(4*b^3*(a^2 - b^2)^2*d) + ((A*b^6 - 3*a^4*b^2*(A - 2*C) - 3*a^6*C - 5*a^2*b^4*(2*A + 3*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a*(a - b)^2*b^3*(a + b)^3*d) - ((A*b^2 + a^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((A*b^4 - 3*a^4*C + a^2*b^2*(5*A + 9*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(4*a*b*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^3), x, 7, ((3*A*b^4 - a^4*C - a^2*b^2*(9*A + 5*C))*Elliptic.E((1/2)*(c + d*x), 2))/(4*a^2*b*(a^2 - b^2)^2*d) + ((A*b^4 + a^4*C - 7*a^2*b^2*(A + C))*Elliptic.F((1/2)*(c + d*x), 2))/(4*a*b^2*(a^2 - b^2)^2*d) + ((3*A*b^6 - 3*a^2*b^4*(2*A - C) - a^6*C + 5*a^4*b^2*(3*A + 2*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a^2*(a - b)^2*b^2*(a + b)^3*d) + ((A*b^2 + a^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((3*A*b^4 - a^4*C - a^2*b^2*(9*A + 5*C))*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 [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^3), x, 8, -(((15*A*b^4 + a^4*(8*A - 5*C) - a^2*b^2*(29*A + C))*Elliptic.E((1/2)*(c + d*x), 2))/(4*a^3*(a^2 - b^2)^2*d)) - ((5*A*b^4 - 3*a^4*C - a^2*b^2*(11*A + 3*C))*Elliptic.F((1/2)*(c + d*x), 2))/(4*a^2*b*(a^2 - b^2)^2*d) - ((15*A*b^6 + 3*a^6*C - a^2*b^4*(38*A + C) + 5*a^4*b^2*(7*A + 2*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a^3*(a - b)^2*b*(a + b)^3*d) + ((15*A*b^4 + a^4*(8*A - 5*C) - a^2*b^2*(29*A + C))*sin(c + d*x))/(4*a^3*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))) + ((A*b^2 + a^2*C)*sin(c + d*x))/(2*a*(a^2 - b^2)*d*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2) - ((5*A*b^4 - 3*a^4*C - a^2*b^2*(11*A + 3*C))*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 [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))^3), x, 9, (b*(35*A*b^4 + 3*a^4*(8*A - 3*C) - a^2*b^2*(65*A - 3*C))*Elliptic.E((1/2)*(c + d*x), 2))/(4*a^4*(a^2 - b^2)^2*d) + ((35*A*b^4 + a^4*(8*A - 21*C) - a^2*b^2*(61*A - 3*C))*Elliptic.F((1/2)*(c + d*x), 2))/(12*a^3*(a^2 - b^2)^2*d) + ((35*A*b^6 - a^2*b^4*(86*A - 3*C) + 3*a^4*b^2*(21*A - 2*C) + 15*a^6*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a^4*(a - b)^2*(a + b)^3*d) + ((35*A*b^4 + a^4*(8*A - 21*C) - a^2*b^2*(61*A - 3*C))*sin(c + d*x))/(12*a^3*(a^2 - b^2)^2*d*cos(c + d*x)^(3/2)) - (b*(35*A*b^4 + 3*a^4*(8*A - 3*C) - a^2*b^2*(65*A - 3*C))*sin(c + d*x))/(4*a^4*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))) + ((A*b^2 + a^2*C)*sin(c + d*x))/(2*a*(a^2 - b^2)*d*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2) - ((7*A*b^4 - 5*a^4*C - a^2*b^2*(13*A + C))*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)))]

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

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

    @test_int [sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2), x, 8, ((a - b)*sqrt(a + b)*(3*a^2*C - 8*b^2*(3*A + 2*C))*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)*(3*a^2*C - 2*a*b*C - 8*b^2*(3*A + 2*C))*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) - (a*sqrt(a + b)*(8*A*b^2 + (a^2 + 4*b^2)*C)*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) - ((3*a^2*C - 8*b^2*(3*A + 2*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*b^2*d*sqrt(cos(c + d*x))) - (a*C*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*b*d)]
    @test_int [(sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 7, -(((a - b)*sqrt(a + b)*C*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*b*d)) + (sqrt(a + b)*(8*A*b + (a + 2*b)*C)*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)*(a^2*C - 4*b^2*(2*A + C))*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) + (a*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b*d*sqrt(cos(c + d*x))) + (C*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d)]
    @test_int [(sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 7, ((a - b)*sqrt(a + b)*(2*A - C)*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 - 2*A*b - a*C)*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) - (a*sqrt(a + b)*C*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) + (2*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - ((2*A - C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [(sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 6, (2*A*(a - b)*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)))/(3*a^2*d) - (2*sqrt(a + b)*(A*b - a*(A + 3*C))*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*sqrt(a + b)*C*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*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [(sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 5, -((2*(a - b)*sqrt(a + b)*(2*A*b^2 - 3*a^2*(3*A + 5*C))*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 + 15*a*C)*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*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*a*d*cos(c + d*x)^(3/2))]
    @test_int [(sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 6, (2*(a - b)*b*sqrt(a + b)*(8*A*b^2 + a^2*(19*A + 35*C))*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)*(6*a*A*b + 8*A*b^2 + 5*a^2*(5*A + 7*C))*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*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*a*d*cos(c + d*x)^(5/2)) - (2*(4*A*b^2 - 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*a^2*d*cos(c + d*x)^(3/2))]

    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2), x, 9, -(((a - b)*sqrt(a + b)*(80*A*b^2 - 3*a^2*C + 52*b^2*C)*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)))/(64*b^2*d)) - (sqrt(a + b)*(3*a^3*C - 2*a^2*b*C - 8*b^3*(4*A + 3*C) - 4*a*b^2*(20*A + 13*C))*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)))/(64*b^2*d) - (sqrt(a + b)*(3*a^4*C + 24*a^2*b^2*(2*A + C) + 16*b^4*(4*A + 3*C))*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) + (a*(80*A*b^2 - 3*a^2*C + 52*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(64*b^2*d*sqrt(cos(c + d*x))) - ((3*a^2*C - 4*b^2*(4*A + 3*C))*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*b*d) - (a*C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(8*b*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*b*d)]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 8, -(((a - b)*sqrt(a + b)*(3*a^2*C + 8*b^2*(3*A + 2*C))*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)*(48*a*A*b + 24*A*b^2 + 3*a^2*C + 14*a*b*C + 16*b^2*C)*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) - (a*sqrt(a + b)*(24*A*b^2 - a^2*C + 12*b^2*C)*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) + ((3*a^2*C + 8*b^2*(3*A + 2*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*b*d*sqrt(cos(c + d*x))) + (a*C*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 8, ((a - b)*sqrt(a + b)*(8*A - 5*C)*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*d) - (sqrt(a + b)*(8*a*A - 16*A*b - 5*a*C - 2*b*C)*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)*(8*A*b^2 + 3*a^2*C + 4*b^2*C)*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) - (a*(8*A - 5*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(cos(c + d*x))) - (b*(4*A - C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d) + (2*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 8, ((a - b)*b*sqrt(a + b)*(8*A - 3*C)*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)*(6*A*b^2 + 2*a^2*(A + 3*C) - a*(8*A*b - 3*b*C))*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) - (3*a*sqrt(a + b)*C*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*b*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - (b*(8*A - 3*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 7, (2*(a - b)*sqrt(a + b)*(A*b^2 + a^2*(3*A + 5*C))*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)))/(5*a^2*d) - (2*sqrt(a + b)*(A*b^2 - 2*a*b*(2*A + 5*C) + a^2*(3*A + 5*C))*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)))/(5*a*d) - (2*b*sqrt(a + b)*C*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*b*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*d*cos(c + d*x)^(3/2)) + (2*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 6, -((4*(a - b)*b*sqrt(a + b)*(3*A*b^2 - a^2*(41*A + 70*C))*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)*(25*a^2*A - 57*a*A*b - 6*A*b^2 + 35*a^2*C - 105*a*b*C)*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) + (6*A*b*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*(3*A*b^2 + 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*a*d*cos(c + d*x)^(3/2)) + (2*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 7, (2*(a - b)*sqrt(a + b)*(8*A*b^4 + 21*a^4*(7*A + 9*C) + 3*a^2*b^2*(11*A + 21*C))*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)*(6*a*A*b^2 + 8*A*b^3 - 21*a^3*(7*A + 9*C) + a^2*(39*A*b + 63*b*C))*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*b*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(21*d*cos(c + d*x)^(7/2)) + (2*(3*A*b^2 + 7*a^2*(7*A + 9*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*a*d*cos(c + d*x)^(5/2)) - (4*b*(2*A*b^2 - a^2*(44*A + 63*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*a^2*d*cos(c + d*x)^(3/2)) + (2*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]

    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2), x, 10, ((a - b)*sqrt(a + b)*(45*a^4*C - 256*b^4*(5*A + 4*C) - 12*a^2*b^2*(220*A + 141*C))*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*C - 30*a^3*b*C - 256*b^4*(5*A + 4*C) - 12*a^2*b^2*(220*A + 141*C) - 8*a*b^3*(260*A + 193*C))*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) - (a*sqrt(a + b)*(3*a^4*C + 40*a^2*b^2*(2*A + C) + 80*b^4*(4*A + 3*C))*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) - ((45*a^4*C - 256*b^4*(5*A + 4*C) - 12*a^2*b^2*(220*A + 141*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(1920*b^2*d*sqrt(cos(c + d*x))) + (a*(240*A*b^2 - 15*a^2*C + 172*b^2*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(320*b*d) - ((15*a^2*C - 16*b^2*(5*A + 4*C))*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(240*b*d) - (3*a*C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(40*b*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(5*b*d)]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 9, -(((a - b)*sqrt(a + b)*(432*A*b^2 + 15*a^2*C + 284*b^2*C)*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*b*d)) + (sqrt(a + b)*(15*a^3*C + 24*b^3*(4*A + 3*C) + 2*a^2*b*(192*A + 59*C) + 4*a*b^2*(108*A + 71*C))*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)*(5*a^4*C - 120*a^2*b^2*(2*A + C) - 16*b^4*(4*A + 3*C))*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) + (a*(432*A*b^2 + 15*a^2*C + 284*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(192*b*d*sqrt(cos(c + d*x))) + ((5*a^2*C + 4*b^2*(4*A + 3*C))*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*d) + (5*a*C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*d)]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 9, ((a - b)*sqrt(a + b)*(a^2*(48*A - 33*C) - 8*b^2*(3*A + 2*C))*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)*(a^2*(48*A - 33*C) - 8*b^2*(3*A + 2*C) - 2*a*b*(72*A + 13*C))*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) - (5*a*sqrt(a + b)*(8*A*b^2 + (a^2 + 4*b^2)*C)*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) - ((a^2*(48*A - 33*C) - 8*b^2*(3*A + 2*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*d*sqrt(cos(c + d*x))) - (a*b*(8*A - 3*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d) - (b*(6*A - C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 9, ((a - b)*b*sqrt(a + b)*(56*A - 27*C)*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)))/(12*d) + (sqrt(a + b)*(6*b^2*(12*A + C) + 8*a^2*(A + 3*C) - a*(56*A*b - 27*b*C))*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)))/(12*d) - (sqrt(a + b)*(8*A*b^2 + 15*a^2*C + 4*b^2*C)*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) - (a*b*(56*A - 27*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(12*d*sqrt(cos(c + d*x))) - (b^2*(8*A - C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d) + (10*A*b*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 9, ((a - b)*sqrt(a + b)*(b^2*(46*A - 15*C) + 6*a^2*(3*A + 5*C))*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) + (sqrt(a + b)*(30*A*b^3 - a*b^2*(46*A - 15*C) - 6*a^3*(3*A + 5*C) + a^2*(34*A*b + 90*b*C))*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) - (5*a*b*sqrt(a + b)*C*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*(5*A*b^2 + a^2*(3*A + 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) - ((b^2*(46*A - 15*C) + 6*a^2*(3*A + 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*A*b*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 8, (2*(a - b)*b*sqrt(a + b)*(3*A*b^2 + a^2*(29*A + 49*C))*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)))/(21*a^2*d) - (2*sqrt(a + b)*(3*A*b^3 - 9*a*b^2*(3*A + 7*C) - a^3*(5*A + 7*C) + a^2*b*(29*A + 49*C))*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)))/(21*a*d) - (2*b^2*sqrt(a + b)*C*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*(3*A*b^2 + a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (2*A*b*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(5/2)) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 7, -((2*(a - b)*sqrt(a + b)*(10*A*b^4 - 21*a^4*(7*A + 9*C) - 3*a^2*b^2*(93*A + 161*C))*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 + 21*a^3*(7*A + 9*C) + 15*a*b^2*(11*A + 21*C) - 6*a^2*b*(19*A + 28*C))*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*(15*A*b^2 + 7*a^2*(7*A + 9*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)) + (2*b*(5*A*b^2 + a^2*(163*A + 231*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*a*d*cos(c + d*x)^(3/2)) + (10*A*b*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2)) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(13/2), x, 8, (2*(a - b)*b*sqrt(a + b)*(8*A*b^4 + 3*a^2*b^2*(17*A + 33*C) + a^4*(741*A + 957*C))*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)))/(693*a^4*d) + (2*(a - b)*sqrt(a + b)*(6*a*A*b^3 + 8*A*b^4 + 15*a^4*(9*A + 11*C) + 3*a^2*b^2*(19*A + 33*C) - 6*a^3*b*(101*A + 132*C))*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)))/(693*a^3*d) + (2*(5*A*b^2 + 3*a^2*(9*A + 11*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(231*d*cos(c + d*x)^(7/2)) + (2*b*(3*A*b^2 + a^2*(229*A + 297*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(693*a*d*cos(c + d*x)^(5/2)) - (2*(4*A*b^4 - 15*a^4*(9*A + 11*C) - a^2*b^2*(205*A + 297*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(693*a^2*d*cos(c + d*x)^(3/2)) + (10*A*b*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(99*d*cos(c + d*x)^(9/2)) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(11*d*cos(c + d*x)^(11/2))]
    #= [((a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/cos(c + d*x)^(15/2), x, 10, -((2*(a + b)*(17787*a^6*A + 30669*a^4*A*b^2 - 760*a^2*A*b^4 - 240*A*b^6 + 21021*a^6*C + 39897*a^4*b^2*C - 1430*a^2*b^4*C)*sqrt(1 + cos(c + d*x))*sqrt((a + b*cos(c + d*x))/((a + b)*(1 + cos(c + d*x))))*Elliptic.E(asin(sin(c + d*x)/(1 + cos(c + d*x))), -((a - b)/(a + b))))/(45045*a^4*d*sqrt(a + b*cos(c + d*x)))) + (1/(45045*a^3*d*sqrt(a + b*cos(c + d*x))))*(2*(17787*a^6*A + 30831*a^5*A*b + 30669*a^4*A*b^2 + 16685*a^3*A*b^3 - 760*a^2*A*b^4 - 60*a*A*b^5 - 240*A*b^6 + 21021*a^6*C + 37323*a^5*b*C + 39897*a^4*b^2*C + 22165*a^3*b^3*C - 1430*a^2*b^4*C)*sqrt(1 + cos(c + d*x))*sqrt((a + b*cos(c + d*x))/((a + b)*(1 + cos(c + d*x))))*Elliptic.F(asin(sin(c + d*x)/(1 + cos(c + d*x))), -((a - b)/(a + b)))) + (2*(121*a^2*A + 15*A*b^2 + 143*a^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(1287*d*cos(c + d*x)^(9/2)) + (2*b*(2209*a^2*A + 15*A*b^2 + 2717*a^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(9009*a*d*cos(c + d*x)^(7/2)) + (2*(5929*a^4*A + 8145*a^2*A*b^2 - 90*A*b^4 + 7007*a^4*C + 10725*a^2*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(45045*a^2*d*cos(c + d*x)^(5/2)) + (2*b*(18973*a^4*A + 395*a^2*A*b^2 + 120*A*b^4 + 23309*a^4*C + 715*a^2*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(45045*a^3*d*cos(c + d*x)^(3/2)) + (10*A*b*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(143*d*cos(c + d*x)^(11/2)) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(13*d*cos(c + d*x)^(13/2)) + (2*(17787*a^6*A + 30669*a^4*A*b^2 - 760*a^2*A*b^4 - 240*A*b^6 + 21021*a^6*C + 39897*a^4*b^2*C - 1430*a^2*b^4*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x)/(1 + cos(c + d*x)))/(45045*a^4*d*sqrt(cos(c + d*x)))] =#

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

    @test_int [(cos(c + d*x)^(3/2)*(A + C*cos(c + d*x)^2))/sqrt(a + b*cos(c + d*x)), x, 8, -(((a - b)*sqrt(a + b)*(15*a^2*C + 8*b^2*(3*A + 2*C))*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^3*d)) + (sqrt(a + b)*(15*a^2*C - 10*a*b*C + 8*b^2*(3*A + 2*C))*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^3*d) + (a*sqrt(a + b)*(8*A*b^2 + 5*a^2*C + 4*b^2*C)*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^4*d) + ((15*a^2*C + 8*b^2*(3*A + 2*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*b^3*d*sqrt(cos(c + d*x))) - (5*a*C*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(12*b^2*d) + (C*cos(c + d*x)^(3/2)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b*d)]
    @test_int [(sqrt(cos(c + d*x))*(A + C*cos(c + d*x)^2))/sqrt(a + b*cos(c + d*x)), x, 7, (3*(a - b)*sqrt(a + b)*C*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*b^2*d) - ((3*a - 2*b)*sqrt(a + b)*C*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)*(3*a^2*C + 4*b^2*(2*A + C))*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) - (3*a*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b^2*d*sqrt(cos(c + d*x))) + (C*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*b*d)]
    @test_int [(A + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))), x, 6, -(((a - b)*sqrt(a + b)*C*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)*(2*A*b + a*C)*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*d) + (a*sqrt(a + b)*C*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) + (C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(b*d*sqrt(cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*sqrt(a + b*cos(c + d*x))), x, 6, (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*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)*C*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 [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*sqrt(a + b*cos(c + d*x))), x, 4, -((4*A*(a - b)*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)))/(3*a^3*d)) + (2*sqrt(a + b)*(2*A*b + a*(A + 3*C))*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 [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(7/2)*sqrt(a + b*cos(c + d*x))), x, 5, (2*(a - b)*sqrt(a + b)*(8*A*b^2 + 3*a^2*(3*A + 5*C))*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)*(2*a*A*b - 8*A*b^2 - 3*a^2*(3*A + 5*C))*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)) - (8*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 [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(9/2)*sqrt(a + b*cos(c + d*x))), x, 6, -((4*(a - b)*b*sqrt(a + b)*(24*A*b^2 + a^2*(22*A + 35*C))*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^5*d)) - (2*sqrt(a + b)*(12*a*A*b^2 - 48*A*b^3 - 5*a^3*(5*A + 7*C) - a^2*(44*A*b + 70*b*C))*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^4*d) + (2*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(7*a*d*cos(c + d*x)^(7/2)) - (12*A*b*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*a^2*d*cos(c + d*x)^(5/2)) + (2*(24*A*b^2 + 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*a^3*d*cos(c + d*x)^(3/2))]

    @test_int [(cos(c + d*x)^(3/2)*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(3/2), x, 8, ((8*A*b^2 + 15*a^2*C - 7*b^2*C)*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*b^3*sqrt(a + b)*d) - ((8*A*b^2 + (15*a^2 + 5*a*b - 2*b^2)*C)*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^3*sqrt(a + b)*d) - (sqrt(a + b)*(8*A*b^2 + 15*a^2*C + 4*b^2*C)*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^4*d) - (2*(A*b^2 + a^2*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (a*(8*A*b^2 + 15*a^2*C - 7*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b^3*(a^2 - b^2)*d*sqrt(cos(c + d*x))) + ((4*A*b^2 + 5*a^2*C - b^2*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d)]
    @test_int [(sqrt(cos(c + d*x))*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(3/2), x, 7, -(((2*A*b^2 + 3*a^2*C - b^2*C)*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^2 + a*(3*a + b)*C)*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^2*sqrt(a + b)*d) + (3*a*sqrt(a + b)*C*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*b^2 + a^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + ((2*A*b^2 + 3*a^2*C - b^2*C)*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 [(A + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)), x, 6, (2*(A*b^2 + a^2*C)*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*b*sqrt(a + b)*d) + (2*(A*b - a*C)*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)*C*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*b^2 + a^2*C)*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^(3/2)), x, 4, -((2*(2*A*b^2 - a^2*(A - C))*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 - C))*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*(A*b^2 + a^2*C)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))^(3/2)), x, 5, (2*b*(8*A*b^2 - a^2*(5*A - 3*C))*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*(6*a*A*b + 8*A*b^2 + a^2*(A + 3*C))*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*(A*b^2 + a^2*C)*sin(c + d*x))/(a*(a^2 - b^2)*d*cos(c + d*x)^(3/2)*sqrt(a + b*cos(c + d*x))) - (2*(4*A*b^2 - a^2*(A - 3*C))*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 [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(7/2)*(a + b*cos(c + d*x))^(3/2)), x, 6, -((2*(16*A*b^4 - 2*a^2*b^2*(4*A - 5*C) - a^4*(3*A + 5*C))*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)))/(5*a^5*sqrt(a + b)*d)) - (2*(12*a*A*b^2 + 16*A*b^3 + 2*a^2*b*(2*A + 5*C) + a^3*(3*A + 5*C))*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)))/(5*a^4*sqrt(a + b)*d) + (2*(A*b^2 + a^2*C)*sin(c + d*x))/(a*(a^2 - b^2)*d*cos(c + d*x)^(5/2)*sqrt(a + b*cos(c + d*x))) - (2*(6*A*b^2 - a^2*(A - 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*a^2*(a^2 - b^2)*d*cos(c + d*x)^(5/2)) + (2*b*(8*A*b^2 - a^2*(3*A - 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*a^3*(a^2 - b^2)*d*cos(c + d*x)^(3/2))]

    @test_int [(cos(c + d*x)^(3/2)*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(5/2), x, 8, ((8*A*b^4 - 15*a^4*C + 26*a^2*b^2*C - 3*b^4*C)*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) + ((2*a*A*b^3 - 6*A*b^4 + 15*a^4*C + 5*a^3*b*C - 21*a^2*b^2*C - 3*a*b^3*C)*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^3*(a + b)^(3/2)*d) + (5*a*sqrt(a + b)*C*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*b^2 + a^2*C)*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*(3*A*b^4 - 5*a^4*C + a^2*b^2*(A + 9*C))*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))) - ((8*A*b^4 - (15*a^4 - 26*a^2*b^2 + 3*b^4)*C)*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 [(sqrt(cos(c + d*x))*(A + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(5/2), x, 7, -((2*(A*b^4 - 3*a^4*C + a^2*b^2*(3*A + 7*C))*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*b^2*sqrt(a + b)*(a^2 - b^2)*d)) + (2*(3*a*A*b^2 - A*b^3 - 3*a^3*C - a^2*b*C + 6*a*b^2*C)*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)*C*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*b^2 + a^2*C)*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*b^4 - 3*a^4*C + a^2*b^2*(3*A + 7*C))*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 [(A + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)), x, 5, (4*b*(3*a^2*A - A*b^2 + 2*a^2*C)*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*b*(A + C) - a^2*(3*A + C))*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*(A*b^2 + a^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (4*b*(A*b^2 - a^2*(3*A + 2*C))*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 [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^(5/2)), x, 5, (2*(8*A*b^4 + 3*a^4*(A - C) - a^2*b^2*(15*A + C))*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)*(a^2 - b^2)*d) + (2*(6*a*A*b^2 + 8*A*b^3 - 3*a^3*(A - C) - a^2*b*(9*A + C))*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*(A*b^2 + a^2*C)*sin(c + d*x))/(3*a*(a^2 - b^2)*d*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)) - (4*(2*A*b^4 - a^4*C - a^2*b^2*(4*A + C))*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 [(A + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))^(5/2)), x, 6, -((4*b*(8*A*b^4 + a^4*(4*A - 3*C) - a^2*b^2*(14*A - C))*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*sqrt(a + b)*(a^2 - b^2)*d)) - (2*(12*a*A*b^3 + 16*A*b^4 - 2*a^2*b^2*(8*A - C) - a^4*(A + 3*C) - a^3*(9*A*b - 3*b*C))*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*(A*b^2 + a^2*C)*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)) + (4*(5*a^2*A*b^2 - 3*A*b^4 + 2*a^4*C)*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*(8*A*b^4 + a^4*(A - 5*C) - a^2*b^2*(13*A - C))*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))]

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

    @test_int [cos(c + d*x)^m*(A + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2, x, 6, If(13>=8, ((2*a^2*C + b^2*(C*(3 + m) + A*(4 + m)))*cos(c + d*x)^(1 + m)*sin(c + d*x))/(d*(2 + m)*(4 + m)) + (2*a*b*C*cos(c + d*x)^(2 + m)*sin(c + d*x))/(d*(3 + m)*(4 + m)) + (C*cos(c + d*x)^(1 + m)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(d*(4 + m)) - ((a^2*(4 + m)*(C*(1 + m) + A*(2 + m)) + b^2*(1 + m)*(C*(3 + m) + A*(4 + m)))*cos(c + d*x)^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(1 + m)*(2 + m)*(4 + m)*sqrt(sin(c + d*x)^2)) - (2*a*b*(C*(2 + m) + A*(3 + m))*cos(c + d*x)^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(2 + m)*(3 + m)*sqrt(sin(c + d*x)^2)), ((2*a^2*C + b^2*(C*(3 + m) + A*(4 + m)))*cos(c + d*x)^(1 + m)*sin(c + d*x))/(d*(2 + m)*(4 + m)) + (2*a*b*C*cos(c + d*x)^(2 + m)*sin(c + d*x))/(d*(3 + m)*(4 + m)) + (C*cos(c + d*x)^(1 + m)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(d*(4 + m)) - ((a^2*(4 + m)*(C*(1 + m) + A*(2 + m)) + b^2*(1 + m)*(C*(3 + m) + A*(4 + m)))*cos(c + d*x)^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(4 + m)*(2 + 3*m + m^2)*sqrt(sin(c + d*x)^2)) - (2*a*b*(C*(2 + m) + A*(3 + m))*cos(c + d*x)^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(2 + m)*(3 + m)*sqrt(sin(c + d*x)^2)))]
    @test_int [cos(c + d*x)^m*(A + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^1, x, 5, (a*C*cos(c + d*x)^(1 + m)*sin(c + d*x))/(d*(2 + m)) + (b*C*cos(c + d*x)^(2 + m)*sin(c + d*x))/(d*(3 + m)) - (a*(C*(1 + m) + A*(2 + m))*cos(c + d*x)^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(1 + m)*(2 + m)*sqrt(sin(c + d*x)^2)) - (b*(C*(2 + m) + A*(3 + m))*cos(c + d*x)^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(2 + m)*(3 + m)*sqrt(sin(c + d*x)^2))]
    @test_int [cos(c + d*x)^m*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^1, x, 8, (a*(A*b^2 + a^2*C)*AppellF1(1/2, (1 - m)/2, 1, 3/2, sin(c + d*x)^2, -((b^2*sin(c + d*x)^2)/(a^2 - b^2)))*cos(c + d*x)^(-1 + m)*(cos(c + d*x)^2)^((1 - m)/2)*sin(c + d*x))/(b^2*(a^2 - b^2)*d) - ((A*b^2 + a^2*C)*AppellF1(1/2, -(m/2), 1, 3/2, sin(c + d*x)^2, -((b^2*sin(c + d*x)^2)/(a^2 - b^2)))*cos(c + d*x)^m*sin(c + d*x))/((cos(c + d*x)^2)^(m/2)*(b*(a^2 - b^2)*d)) + (a*C*cos(c + d*x)^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(b^2*d*(1 + m)*sqrt(sin(c + d*x)^2)) - (C*cos(c + d*x)^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(b*d*(2 + m)*sqrt(sin(c + d*x)^2))]
    @test_int [cos(c + d*x)^m*(A + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 9, ((A*b^4*m - a^4*C*(1 + m) + a^2*b^2*(A - A*m + C*(2 + m)))*AppellF1(1/2, (1 - m)/2, 1, 3/2, sin(c + d*x)^2, -((b^2*sin(c + d*x)^2)/(a^2 - b^2)))*cos(c + d*x)^(-1 + m)*(cos(c + d*x)^2)^((1 - m)/2)*sin(c + d*x))/(b^2*(a^2 - b^2)^2*d) - ((A*b^4*m - a^4*C*(1 + m) + a^2*b^2*(A - A*m + C*(2 + m)))*AppellF1(1/2, -(m/2), 1, 3/2, sin(c + d*x)^2, -((b^2*sin(c + d*x)^2)/(a^2 - b^2)))*cos(c + d*x)^m*sin(c + d*x))/((cos(c + d*x)^2)^(m/2)*(a*b*(a^2 - b^2)^2*d)) + ((A*b^2 + a^2*C)*cos(c + d*x)^(1 + m)*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x))) - ((a^2*C*(1 + m) - b^2*(C - A*m))*cos(c + d*x)^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(b^2*(a^2 - b^2)*d*(1 + m)*sqrt(sin(c + d*x)^2)) + ((A*b^2 + a^2*C)*(1 + m)*cos(c + d*x)^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(a*b*(a^2 - b^2)*d*(2 + m)*sqrt(sin(c + d*x)^2))]

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

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

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

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

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

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

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

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

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

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

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

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

    @test_int [cos(c + d*x)^1*(B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 9, -((2*(14*a^2*b*B - 63*b^3*B - 8*a^3*C - 19*a*b^2*C)*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*b*B - 8*a^2*C - 25*b^2*C)*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*b*B - 8*a^2*C - 25*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*b^2*d) + (2*(7*b*B - 4*a*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*b^2*d) + (2*C*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)^0*(B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 7, (2*(5*a*b*B - 2*a^2*C + 9*b^2*C)*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*b*B - 2*a*C)*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*b*B - 2*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b*d) + (2*C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*b*d)]
    @test_int [sec(c + d*x)^1*(B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 7, (2*(3*b*B + a*C)*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)*C*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*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^2*(B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 9, (2*C*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*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))) + (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)))]
    @test_int [sec(c + d*x)^3*(B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 10, -((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*B + 2*b*C)*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))) + ((b*B + 2*a*C)*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*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^4*(B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 11, -(((b*B + 4*a*C)*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*b*B + 4*a*C)*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*B - b^2*B + 4*a*b*C)*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))) + ((b*B + 4*a*C)*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(4*a*d) + (B*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(2*d)]

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

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

    @test_int [cos(c + d*x)^2*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 9, -((2*(40*a^3*b*B - 25*a*b^3*B - 48*a^4*C + 24*a^2*b^2*C + 9*b^4*C)*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*b*B + 5*b^3*B - 48*a^3*C - 12*a*b^2*C)*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*(b*B - a*C)*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*b*B - 5*b^3*B - 24*a^3*C + 9*a*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b^3*(a^2 - b^2)*d) - (2*(5*a*b*B - 6*a^2*C + b^2*C)*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)^1*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 8, (2*(6*a^2*b*B - 3*b^3*B - 8*a^3*C + 5*a*b^2*C)*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*b*B - 8*a^2*C - b^2*C)*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*(b*B - a*C)*sin(c + d*x))/(b^2*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (2*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b^2*d)]
    @test_int [cos(c + d*x)^0*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 6, -((2*(a*b*B - 2*a^2*C + b^2*C)*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*(b*B - 2*a*C)*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*(b*B - a*C)*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 7, (2*(b*B - a*C)*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*C*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*(b*B - a*C)*sin(c + d*x))/((a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 8, -((2*(b*B - a*C)*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*(b*B - a*C)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^3*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 11, -(((a^2*B - 3*b^2*B + 2*a*b*C)*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)))) + (B*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*b*B - 2*a*C)*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*B - 3*b^2*B + 2*a*b*C)*sin(c + d*x))/(a^2*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (B*tan(c + d*x))/(a*d*sqrt(a + b*cos(c + d*x)))]

    @test_int [cos(c + d*x)^2*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 9, (2*(8*a^4*b*B - 15*a^2*b^3*B + 3*b^5*B - 16*a^5*C + 28*a^3*b^2*C - 8*a*b^4*C)*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*b*B - 9*a*b^3*B - 16*a^4*C + 16*a^2*b^2*C + b^4*C)*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*(b*B - a*C)*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*b*B - 7*b^3*B - 6*a^3*C + 10*a*b^2*C)*sin(c + d*x))/(3*b^3*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) - (2*(a*b*B - 2*a^2*C + b^2*C)*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)^1*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 8, -((2*(2*a^3*b*B - 6*a*b^3*B - 8*a^4*C + 15*a^2*b^2*C - 3*b^4*C)*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*b*B - 3*b^3*B - 8*a^3*C + 9*a*b^2*C)*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*(b*B - a*C)*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*b*B - 6*b^3*B - 5*a^3*C + 9*a*b^2*C)*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)^0*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 7, -((2*(a^2*b*B + 3*b^3*B + 2*a^3*C - 6*a*b^2*C)*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*b*B + 2*a^2*C - 3*b^2*C)*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*(b*B - a*C)*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*(a^2*b*B + 3*b^3*B + 2*a^3*C - 6*a*b^2*C)*sin(c + d*x))/(3*b*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 8, (2*(4*a*b*B - a^2*C - 3*b^2*C)*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*(b*B - a*C)*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*(b*B - a*C)*sin(c + d*x))/(3*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (2*(4*a*b*B - a^2*C - 3*b^2*C)*sin(c + d*x))/(3*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^2*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 11, -((2*(7*a^2*b*B - 3*b^3*B - 4*a^3*C)*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*(b*B - a*C)*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*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))) + (2*b*(b*B - a*C)*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*b*(7*a^2*b*B - 3*b^3*B - 4*a^3*C)*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)^3*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 12, -(((3*a^4*B - 26*a^2*b^2*B + 15*b^4*B + 14*a^3*b*C - 6*a*b^3*C)*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*B - 5*b^2*B + 2*a*b*C)*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*b*B - 2*a*C)*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*B - 5*b^2*B + 2*a*b*C)*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (b*(3*a^4*B - 26*a^2*b^2*B + 15*b^4*B + 14*a^3*b*C - 6*a*b^3*C)*sin(c + d*x))/(3*a^3*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) + (B*tan(c + d*x))/(a*d*(a + b*cos(c + d*x))^(3/2))]

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

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

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

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

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

    @test_int [cos(c + d*x)^(5/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 9, (2*(5*a^2 + 3*b^2)*(b*B - a*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*b^4*d) - (2*(21*a^3*b*B + 7*a*b^3*B - 21*a^4*C - 7*a^2*b^2*C - 5*b^4*C)*Elliptic.F((1/2)*(c + d*x), 2))/(21*b^5*d) + (2*a^4*(b*B - a*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^5*(a + b)*d) - (2*(7*a*b*B - 7*a^2*C - 5*b^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*b^3*d) + (2*(b*B - a*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*b^2*d) + (2*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*b*d)]
    @test_int [cos(c + d*x)^(3/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 8, -((2*(5*a*b*B - 5*a^2*C - 3*b^2*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*b^3*d)) + (2*(3*a^2 + b^2)*(b*B - a*C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^4*d) - (2*a^3*(b*B - a*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^4*(a + b)*d) + (2*(b*B - a*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b^2*d) + (2*C*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*b*d)]
    @test_int [cos(c + d*x)^(1/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 7, (2*(b*B - a*C)*Elliptic.E((1/2)*(c + d*x), 2))/(b^2*d) - (2*(3*a*b*B - 3*a^2*C - b^2*C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^3*d) + (2*a^2*(b*B - a*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^3*(a + b)*d) + (2*C*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b*d)]
    @test_int [cos(c + d*x)^(-1/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 6, (2*C*Elliptic.E((1/2)*(c + d*x), 2))/(b*d) + (2*(b*B - a*C)*Elliptic.F((1/2)*(c + d*x), 2))/(b^2*d) - (2*a*(b*B - a*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^2*(a + b)*d)]
    @test_int [cos(c + d*x)^(-3/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 4, (2*C*Elliptic.F((1/2)*(c + d*x), 2))/(b*d) + (2*(b*B - a*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b*(a + b)*d)]
    @test_int [cos(c + d*x)^(-5/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 6, -((2*B*Elliptic.E((1/2)*(c + d*x), 2))/(a*d)) - (2*(b*B - a*C)*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)^(-7/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 8, (2*(b*B - a*C)*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*(b*B - a*C)*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 - a*C)*sin(c + d*x))/(a^2*d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-9/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 9, -((2*(3*a^2*B + 5*b^2*B - 5*a*b*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*a^3*d)) - (2*(b*B - a*C)*Elliptic.F((1/2)*(c + d*x), 2))/(3*a^2*d) - (2*b^2*(b*B - a*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^3*(a + b)*d) + (2*B*sin(c + d*x))/(5*a*d*cos(c + d*x)^(5/2)) - (2*(b*B - a*C)*sin(c + d*x))/(3*a^2*d*cos(c + d*x)^(3/2)) + (2*(3*a^2*B + 5*b^2*B - 5*a*b*C)*sin(c + d*x))/(5*a^3*d*sqrt(cos(c + d*x)))]

    @test_int [(cos(c + d*x)^(5/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^2, x, 9, -((25*a^3*b*B - 20*a*b^3*B - 35*a^4*C + 24*a^2*b^2*C + 6*b^4*C)*Elliptic.E((c + d*x)/2, 2))/(5*b^4*(a^2 - b^2)*d) + ((15*a^4*b*B - 16*a^2*b^3*B - 2*b^5*B - 21*a^5*C + 20*a^3*b^2*C + 4*a*b^4*C)*Elliptic.F((c + d*x)/2, 2))/(3*b^5*(a^2 - b^2)*d) - (a^3*(5*a^2*b*B - 7*b^3*B - 7*a^3*C + 9*a*b^2*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/((a - b)*b^5*(a + b)^2*d) + ((5*a^2*b*B - 2*b^3*B - 7*a^3*C + 4*a*b^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b^3*(a^2 - b^2)*d) - ((5*a*b*B - 7*a^2*C + 2*b^2*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*b^2*(a^2 - b^2)*d) + (a*(b*B - a*C)*cos(c + d*x)^(5/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)*(B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^2, x, 8, ((3*a^2*b*B - 2*b^3*B - 5*a^3*C + 4*a*b^2*C)*Elliptic.E((c + d*x)/2, 2))/(b^3*(a^2 - b^2)*d) - ((9*a^3*b*B - 12*a*b^3*B - 15*a^4*C + 16*a^2*b^2*C + 2*b^4*C)*Elliptic.F((c + d*x)/2, 2))/(3*b^4*(a^2 - b^2)*d) + (a^2*(3*a^2*b*B - 5*b^3*B - 5*a^3*C + 7*a*b^2*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/((a - b)*b^4*(a + b)^2*d) - ((3*a*b*B - 5*a^2*C + 2*b^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d) + (a*(b*B - a*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [(sqrt(cos(c + d*x))*(B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^2, x, 7, -(((a*b*B - 3*a^2*C + 2*b^2*C)*Elliptic.E((c + d*x)/2, 2))/(b^2*(a^2 - b^2)*d)) + ((a^2*b*B - 2*b^3*B - 3*a^3*C + 4*a*b^2*C)*Elliptic.F((c + d*x)/2, 2))/(b^3*(a^2 - b^2)*d) - (a*(a^2*b*B - 3*b^3*B - 3*a^3*C + 5*a*b^2*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/((a - b)*b^3*(a + b)^2*d) + (a*(b*B - a*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2), x, 7, ((b*B - a*C)*Elliptic.E((c + d*x)/2, 2))/(b*(a^2 - b^2)*d) + ((a*b*B + a^2*C - 2*b^2*C)*Elliptic.F((c + d*x)/2, 2))/(b^2*(a^2 - b^2)*d) - ((a^2*b*B + b^3*B + a^3*C - 3*a*b^2*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/((a - b)*b^2*(a + b)^2*d) - ((b*B - a*C)*sqrt(cos(c + d*x))*sin(c + d*x))/((a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2), x, 7, -(((b*B - a*C)*Elliptic.E((c + d*x)/2, 2))/(a*(a^2 - b^2)*d)) - ((b*B - a*C)*Elliptic.F((c + d*x)/2, 2))/(b*(a^2 - b^2)*d) + ((3*a^2*b*B - b^3*B - a^3*C - a*b^2*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/(a*(a - b)*b*(a + b)^2*d) + (b*(b*B - a*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))^2), x, 8, -(((2*a^2*B - 3*b^2*B + a*b*C)*Elliptic.E((c + d*x)/2, 2))/(a^2*(a^2 - b^2)*d)) + ((b*B - a*C)*Elliptic.F((c + d*x)/2, 2))/(a*(a^2 - b^2)*d) - ((5*a^2*b*B - 3*b^3*B - 3*a^3*C + a*b^2*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/(a^2*(a - b)*(a + b)^2*d) + ((2*a^2*B - 3*b^2*B + a*b*C)*sin(c + d*x))/(a^2*(a^2 - b^2)*d*sqrt(cos(c + d*x))) + (b*(b*B - a*C)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(cos(c + d*x))*(a + b*cos(c + d*x)))]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(7/2)*(a + b*cos(c + d*x))^2), x, 9, ((4*a^2*b*B - 5*b^3*B - 2*a^3*C + 3*a*b^2*C)*Elliptic.E((c + d*x)/2, 2))/(a^3*(a^2 - b^2)*d) + ((2*a^2*B - 5*b^2*B + 3*a*b*C)*Elliptic.F((c + d*x)/2, 2))/(3*a^2*(a^2 - b^2)*d) + (b*(7*a^2*b*B - 5*b^3*B - 5*a^3*C + 3*a*b^2*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/(a^3*(a - b)*(a + b)^2*d) + ((2*a^2*B - 5*b^2*B + 3*a*b*C)*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d*cos(c + d*x)^(3/2)) - ((4*a^2*b*B - 5*b^3*B - 2*a^3*C + 3*a*b^2*C)*sin(c + d*x))/(a^3*(a^2 - b^2)*d*sqrt(cos(c + d*x))) + (b*(b*B - a*C)*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)*(B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^3, x, 9, ((15*a^4*b*B - 29*a^2*b^3*B + 8*b^5*B - 35*a^5*C + 65*a^3*b^2*C - 24*a*b^4*C)*Elliptic.E((c + d*x)/2, 2))/(4*b^4*(a^2 - b^2)^2*d) - ((45*a^5*b*B - 99*a^3*b^3*B + 72*a*b^5*B - 105*a^6*C + 223*a^4*b^2*C - 128*a^2*b^4*C - 8*b^6*C)*Elliptic.F((c + d*x)/2, 2))/(12*b^5*(a^2 - b^2)^2*d) + (a^2*(15*a^4*b*B - 38*a^2*b^3*B + 35*b^5*B - 35*a^5*C + 86*a^3*b^2*C - 63*a*b^4*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/(4*(a - b)^2*b^5*(a + b)^3*d) - ((15*a^3*b*B - 33*a*b^3*B - 35*a^4*C + 61*a^2*b^2*C - 8*b^4*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(12*b^3*(a^2 - b^2)^2*d) + (a*(b*B - a*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + (a*(3*a^2*b*B - 9*b^3*B - 7*a^3*C + 13*a*b^2*C)*cos(c + d*x)^(3/2)*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)*(B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^3, x, 8, -((3*a^3*b*B - 9*a*b^3*B - 15*a^4*C + 29*a^2*b^2*C - 8*b^4*C)*Elliptic.E((c + d*x)/2, 2))/(4*b^3*(a^2 - b^2)^2*d) + ((3*a^4*b*B - 5*a^2*b^3*B + 8*b^5*B - 15*a^5*C + 33*a^3*b^2*C - 24*a*b^4*C)*Elliptic.F((c + d*x)/2, 2))/(4*b^4*(a^2 - b^2)^2*d) - (a*(3*a^4*b*B - 6*a^2*b^3*B + 15*b^5*B - 15*a^5*C + 38*a^3*b^2*C - 35*a*b^4*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/(4*(a - b)^2*b^4*(a + b)^3*d) + (a*(b*B - a*C)*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*b*B - 7*b^3*B - 5*a^3*C + 11*a*b^2*C)*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 [(sqrt(cos(c + d*x))*(B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^3, x, 8, -((a^2*b*B + 5*b^3*B + 3*a^3*C - 9*a*b^2*C)*Elliptic.E((c + d*x)/2, 2))/(4*b^2*(a^2 - b^2)^2*d) + ((a^3*b*B - 7*a*b^3*B + 3*a^4*C - 5*a^2*b^2*C + 8*b^4*C)*Elliptic.F((c + d*x)/2, 2))/(4*b^3*(a^2 - b^2)^2*d) - ((a^4*b*B - 10*a^2*b^3*B - 3*b^5*B + 3*a^5*C - 6*a^3*b^2*C + 15*a*b^4*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/(4*(a - b)^2*b^3*(a + b)^3*d) + (a*(b*B - a*C)*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*b*B + 5*b^3*B + 3*a^3*C - 9*a*b^2*C)*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 [(B*cos(c + d*x) + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^3), x, 8, ((5*a^2*b*B + b^3*B - a^3*C - 5*a*b^2*C)*Elliptic.E((c + d*x)/2, 2))/(4*a*b*(a^2 - b^2)^2*d) + ((3*a^2*b*B + 3*b^3*B + a^3*C - 7*a*b^2*C)*Elliptic.F((c + d*x)/2, 2))/(4*b^2*(a^2 - b^2)^2*d) - ((3*a^4*b*B + 10*a^2*b^3*B - b^5*B + a^5*C - 10*a^3*b^2*C - 3*a*b^4*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/(4*a*(a - b)^2*b^2*(a + b)^3*d) - ((b*B - a*C)*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*b*B + b^3*B - a^3*C - 5*a*b^2*C)*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 [(B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^3), x, 8, -((9*a^2*b*B - 3*b^3*B - 5*a^3*C - a*b^2*C)*Elliptic.E((c + d*x)/2, 2))/(4*a^2*(a^2 - b^2)^2*d) - ((7*a^2*b*B - b^3*B - 3*a^3*C - 3*a*b^2*C)*Elliptic.F((c + d*x)/2, 2))/(4*a*b*(a^2 - b^2)^2*d) + ((15*a^4*b*B - 6*a^2*b^3*B + 3*b^5*B - 3*a^5*C - 10*a^3*b^2*C + a*b^4*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/(4*a^2*(a - b)^2*b*(a + b)^3*d) + (b*(b*B - a*C)*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*b*B - 3*b^3*B - 5*a^3*C - a*b^2*C)*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 [(B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))^3), x, 9, -((8*a^4*B - 29*a^2*b^2*B + 15*b^4*B + 9*a^3*b*C - 3*a*b^3*C)*Elliptic.E((c + d*x)/2, 2))/(4*a^3*(a^2 - b^2)^2*d) + ((11*a^2*b*B - 5*b^3*B - 7*a^3*C + a*b^2*C)*Elliptic.F((c + d*x)/2, 2))/(4*a^2*(a^2 - b^2)^2*d) - ((35*a^4*b*B - 38*a^2*b^3*B + 15*b^5*B - 15*a^5*C + 6*a^3*b^2*C - 3*a*b^4*C)*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2))/(4*a^3*(a - b)^2*(a + b)^3*d) + ((8*a^4*B - 29*a^2*b^2*B + 15*b^4*B + 9*a^3*b*C - 3*a*b^3*C)*sin(c + d*x))/(4*a^3*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))) + (b*(b*B - a*C)*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*b*B - 5*b^3*B - 7*a^3*C + a*b^2*C)*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))*(a + b*cos(c + d*x)))]

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

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

    @test_int [sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*(B*cos(c + d*x) + C*cos(c + d*x)^2), x, 9, -((a - b)*sqrt(a + b)*(6*a*b*B - 3*a^2*C + 16*b^2*C)*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*b*B - 3*a*C + 8*b*C)*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*b*B - 8*b^3*B - a^3*C - 4*a*b^2*C)*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*b*B - 3*a^2*C + 16*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*b^2*d*sqrt(cos(c + d*x))) + ((2*b*B - a*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*b*d)]
    @test_int [(sqrt(a + b*cos(c + d*x))*(B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 8, -((a - b)*sqrt(a + b)*(4*b*B + a*C)*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)*(a*C + 2*b*(2*B + C))*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*b*B - a^2*C + 4*b^2*C)*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*b*B + a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b*d*sqrt(cos(c + d*x))) + (C*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d)]
    @test_int [(sqrt(a + b*cos(c + d*x))*(B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 7, -(((a - b)*sqrt(a + b)*C*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*B + C)*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*b*B + a*C)*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) + (C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [(sqrt(a + b*cos(c + d*x))*(B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 6, (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*d) + (2*sqrt(a + b)*(b*B - a*(B - C))*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)*C*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 [(sqrt(a + b*cos(c + d*x))*(B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 5, (2*(a - b)*sqrt(a + b)*(b*B + 3*a*C)*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)*(B - 3*C)*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*cos(c + d*x))*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [(sqrt(a + b*cos(c + d*x))*(B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 6, (2*(a - b)*sqrt(a + b)*(9*a^2*B - 2*b^2*B + 5*a*b*C)*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*B + 2*b*B - 5*a*C)*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*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*(b*B + 5*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*a*d*cos(c + d*x)^(3/2))]
    @test_int [(sqrt(a + b*cos(c + d*x))*(B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 7, (2*(a - b)*sqrt(a + b)*(19*a^2*b*B + 8*b^3*B + 63*a^3*C - 14*a*b^2*C)*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*b^2*B + a^2*(25*B - 63*C) + 2*a*b*(3*B - 7*C))*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*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (2*(b*B + 7*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*a*d*cos(c + d*x)^(5/2)) + (2*(25*a^2*B - 4*b^2*B + 7*a*b*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*a^2*d*cos(c + d*x)^(3/2))]

    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2), x, 10, -((a - b)*sqrt(a + b)*(24*a^2*b*B + 128*b^3*B - 9*a^3*C + 156*a*b^2*C)*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*C - 6*a^2*b*(4*B + C) - 8*b^3*(16*B + 9*C) - 4*a*b^2*(28*B + 39*C))*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*b*B - 96*a*b^3*B - 3*a^4*C - 24*a^2*b^2*C - 48*b^4*C)*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*b*B + 128*b^3*B - 9*a^3*C + 156*a*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(192*b^2*d*sqrt(cos(c + d*x))) + ((8*a*b*B - 3*a^2*C + 12*b^2*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*b*d) + ((8*b*B - 3*a*C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*b*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*b*d)]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 9, -(((a - b)*sqrt(a + b)*(30*a*b*B + 3*a^2*C + 16*b^2*C)*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*b*B + 12*b^2*B + 3*a^2*C + 14*a*b*C + 16*b^2*C)*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*b*B + 8*b^3*B - a^3*C + 12*a*b^2*C)*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*b*B + 3*a^2*C + 16*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*b*d*sqrt(cos(c + d*x))) + ((6*b*B + 7*a*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(12*d) + (b*C*cos(c + d*x)^(3/2)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 8, -((a - b)*sqrt(a + b)*(4*b*B + 5*a*C)*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*B + 4*b*B + 5*a*C + 2*b*C)*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*b*B + 3*a^2*C + 4*b^2*C)*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*b*B + 5*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(cos(c + d*x))) + (b*C*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d)]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 8, ((a - b)*sqrt(a + b)*(2*a*B - b*C)*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 - C) - b*(4*B + C))*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*b*B + 3*a*C)*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*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - ((2*a*B - b*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 7, (2*(a - b)*sqrt(a + b)*(4*b*B + 3*a*C)*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*b^2*B - a*b*(4*B - 6*C) + a^2*(B - 3*C))*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)*C*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*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 6, (2*(a - b)*sqrt(a + b)*(9*a^2*B + 3*b^2*B + 20*a*b*C)*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*B - 3*b*B - 5*a*C + 15*b*C)*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*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*(6*b*B + 5*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 7, (2*(a - b)*sqrt(a + b)*(82*a^2*b*B - 6*b^3*B + 63*a^3*C + 21*a*b^2*C)*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*b^2*B - a^2*(25*B - 63*C) + 3*a*b*(19*B - 7*C))*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*B*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (2*(8*b*B + 7*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*(25*a^2*B + 3*b^2*B + 42*a*b*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*a*d*cos(c + d*x)^(3/2))]

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

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

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

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

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

    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2, x, 4, (1/8)*(8*a*A*b + 4*a^2*B + 3*b^2*B + 6*a*b*C)*x + ((20*a*b*B + 5*a^2*(3*A + 2*C) + 2*b^2*(5*A + 4*C))*sin(c + d*x))/(15*d) + ((8*a*A*b + 4*a^2*B + 3*b^2*B + 6*a*b*C)*cos(c + d*x)*sin(c + d*x))/(8*d) + ((5*A*b^2 + 10*a*b*B + 2*a^2*C + 4*b^2*C)*cos(c + d*x)^2*sin(c + d*x))/(15*d) + (b*(5*b*B + 2*a*C)*cos(c + d*x)^3*sin(c + d*x))/(20*d) + (C*cos(c + d*x)^2*(a + b*cos(c + d*x))^2*sin(c + d*x))/(5*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2, x, 3, (1/8)*(8*a*b*B + 4*a^2*(2*A + C) + b^2*(4*A + 3*C))*x + ((4*a^2*b*B + 4*b^3*B - a^3*C + 4*a*b^2*(3*A + 2*C))*sin(c + d*x))/(6*b*d) + ((12*A*b^2 + 8*a*b*B - 2*a^2*C + 9*b^2*C)*cos(c + d*x)*sin(c + d*x))/(24*d) + ((4*b*B - a*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(12*b*d) + (C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(4*b*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2, x, 5, (1/2)*(2*a^2*B + b^2*B + 2*a*b*(2*A + C))*x + (a^2*A*atanh(sin(c + d*x)))/d + ((3*A*b^2 + 6*a*b*B + 2*a^2*C + 2*b^2*C)*sin(c + d*x))/(3*d) + (b*(3*b*B + 2*a*C)*cos(c + d*x)*sin(c + d*x))/(6*d) + (C*(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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2, x, 5, (1/2)*(2*A*b^2 + 4*a*b*B + 2*a^2*C + b^2*C)*x + (a*(2*A*b + a*B)*atanh(sin(c + d*x)))/d - (b*(2*a*A - b*B - 2*a*C)*sin(c + d*x))/d - (b^2*(2*A - C)*cos(c + d*x)*sin(c + d*x))/(2*d) + (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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2, x, 5, b*(b*B + 2*a*C)*x + ((2*A*b^2 + 4*a*b*B + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*d) - (b^2*(A - 2*C)*sin(c + d*x))/(2*d) + (a*(A*b + a*B)*tan(c + d*x))/d + (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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2, x, 5, b^2*C*x + ((a^2*B + 2*b^2*B + 2*a*b*(A + 2*C))*atanh(sin(c + d*x)))/(2*d) + ((2*A*b^2 + 6*a*b*B + a^2*(2*A + 3*C))*tan(c + d*x))/(3*d) + (a*(2*A*b + 3*a*B)*sec(c + d*x)*tan(c + d*x))/(6*d) + (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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2, x, 7, ((8*a*b*B + 4*b^2*(A + 2*C) + a^2*(3*A + 4*C))*atanh(sin(c + d*x)))/(8*d) + ((4*a*A*b + 2*a^2*B + 3*b^2*B + 6*a*b*C)*tan(c + d*x))/(3*d) + ((2*A*b^2 + 8*a*b*B + a^2*(3*A + 4*C))*sec(c + d*x)*tan(c + d*x))/(8*d) + (a*(A*b + 2*a*B)*sec(c + d*x)^2*tan(c + d*x))/(6*d) + (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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2, x, 8, ((6*a*A*b + 3*a^2*B + 4*b^2*B + 8*a*b*C)*atanh(sin(c + d*x)))/(8*d) + ((20*a*b*B + 5*b^2*(2*A + 3*C) + 2*a^2*(4*A + 5*C))*tan(c + d*x))/(15*d) + ((6*a*A*b + 3*a^2*B + 4*b^2*B + 8*a*b*C)*sec(c + d*x)*tan(c + d*x))/(8*d) + ((2*A*b^2 + 10*a*b*B + a^2*(4*A + 5*C))*sec(c + d*x)^2*tan(c + d*x))/(15*d) + (a*(2*A*b + 5*a*B)*sec(c + d*x)^3*tan(c + d*x))/(20*d) + (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)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^3, x, 5, (1/16)*(8*a^3*B + 18*a*b^2*B + 6*a^2*b*(4*A + 3*C) + b^3*(6*A + 5*C))*x + ((30*a^2*b*B + 8*b^3*B + 5*a^3*(3*A + 2*C) + 6*a*b^2*(5*A + 4*C))*sin(c + d*x))/(15*d) + ((8*a^3*B + 18*a*b^2*B + 6*a^2*b*(4*A + 3*C) + b^3*(6*A + 5*C))*cos(c + d*x)*sin(c + d*x))/(16*d) + ((12*a^2*b*B + 4*b^3*B + a^3*C + 3*a*b^2*(5*A + 4*C))*cos(c + d*x)^2*sin(c + d*x))/(15*d) + (b*(30*A*b^2 + 42*a*b*B + 6*a^2*C + 25*b^2*C)*cos(c + d*x)^3*sin(c + d*x))/(120*d) + ((2*b*B + a*C)*cos(c + d*x)^2*(a + b*cos(c + d*x))^2*sin(c + d*x))/(10*d) + (C*cos(c + d*x)^2*(a + b*cos(c + d*x))^3*sin(c + d*x))/(6*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^3, x, 4, (1/8)*(12*a^2*b*B + 3*b^3*B + 4*a^3*(2*A + C) + 3*a*b^2*(4*A + 3*C))*x + ((15*a^3*b*B + 60*a*b^3*B - 3*a^4*C + 4*b^4*(5*A + 4*C) + 4*a^2*b^2*(20*A + 13*C))*sin(c + d*x))/(30*b*d) + ((30*a^2*b*B + 45*b^3*B - 6*a^3*C + a*b^2*(100*A + 71*C))*cos(c + d*x)*sin(c + d*x))/(120*d) + ((4*b^2*(5*A + 4*C) + 3*a*(5*b*B - a*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(60*b*d) + ((5*b*B - a*C)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(20*b*d) + (C*(a + b*cos(c + d*x))^4*sin(c + d*x))/(5*b*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^3, x, 6, (1/8)*(8*a^3*B + 12*a*b^2*B + 12*a^2*b*(2*A + C) + b^3*(4*A + 3*C))*x + (a^3*A*atanh(sin(c + d*x)))/d + ((16*a^2*b*B + 4*b^3*B + 3*a^3*C + 6*a*b^2*(3*A + 2*C))*sin(c + d*x))/(6*d) + (b*(12*A*b^2 + 20*a*b*B + 6*a^2*C + 9*b^2*C)*cos(c + d*x)*sin(c + d*x))/(24*d) + ((4*b*B + 3*a*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(12*d) + (C*(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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^3, x, 6, (1/2)*(6*a^2*b*B + b^3*B + 2*a^3*C + 3*a*b^2*(2*A + C))*x + (a^2*(3*A*b + a*B)*atanh(sin(c + d*x)))/d + (b*(9*a*b*B - a^2*(6*A - 8*C) + b^2*(3*A + 2*C))*sin(c + d*x))/(3*d) - (b^2*(6*a*A - 3*b*B - 5*a*C)*cos(c + d*x)*sin(c + d*x))/(6*d) - (b*(3*A - C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*d) + (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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^3, x, 6, (1/2)*b*(2*A*b^2 + 6*a*b*B + 6*a^2*C + b^2*C)*x + (a*(6*A*b^2 + 6*a*b*B + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*d) - (b*(9*a*A*b + 4*a^2*B - 2*b^2*B - 6*a*b*C)*sin(c + d*x))/(2*d) - (b^2*(4*A*b + 2*a*B - b*C)*cos(c + d*x)*sin(c + d*x))/(2*d) + ((3*A*b + 2*a*B)*(a + b*cos(c + d*x))^2*tan(c + d*x))/(2*d) + (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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^3, x, 6, b^2*(b*B + 3*a*C)*x + ((2*A*b^3 + a^3*B + 6*a*b^2*B + 3*a^2*b*(A + 2*C))*atanh(sin(c + d*x)))/(2*d) - (b^2*(5*A*b + 3*a*B - 6*b*C)*sin(c + d*x))/(6*d) + (a*(3*A*b^2 + 6*a*b*B + a^2*(2*A + 3*C))*tan(c + d*x))/(3*d) + ((A*b + a*B)*(a + b*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(2*d) + (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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^3, x, 6, b^3*C*x + ((12*a^2*b*B + 8*b^3*B + 12*a*b^2*(A + 2*C) + a^3*(3*A + 4*C))*atanh(sin(c + d*x)))/(8*d) + ((3*A*b^3 + 4*a^3*B + 16*a*b^2*B + 6*a^2*b*(2*A + 3*C))*tan(c + d*x))/(6*d) + (a*(6*A*b^2 + 20*a*b*B + 3*a^2*(3*A + 4*C))*sec(c + d*x)*tan(c + d*x))/(24*d) + ((3*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 + 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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^3, x, 8, ((3*a^3*B + 12*a*b^2*B + 4*b^3*(A + 2*C) + 3*a^2*b*(3*A + 4*C))*atanh(sin(c + d*x)))/(8*d) + ((30*a^2*b*B + 15*b^3*B + 15*a*b^2*(2*A + 3*C) + 2*a^3*(4*A + 5*C))*tan(c + d*x))/(15*d) + ((6*A*b^3 + 15*a^3*B + 50*a*b^2*B + 15*a^2*b*(3*A + 4*C))*sec(c + d*x)*tan(c + d*x))/(40*d) + (a*(3*A*b^2 + 15*a*b*B + 2*a^2*(4*A + 5*C))*sec(c + d*x)^2*tan(c + d*x))/(30*d) + ((3*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 + 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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^3, x, 9, ((18*a^2*b*B + 8*b^3*B + 6*a*b^2*(3*A + 4*C) + a^3*(5*A + 6*C))*atanh(sin(c + d*x)))/(16*d) + ((8*a^3*B + 30*a*b^2*B + 5*b^3*(2*A + 3*C) + 6*a^2*b*(4*A + 5*C))*tan(c + d*x))/(15*d) + ((18*a^2*b*B + 8*b^3*B + 6*a*b^2*(3*A + 4*C) + a^3*(5*A + 6*C))*sec(c + d*x)*tan(c + d*x))/(16*d) + ((A*b^3 + 4*a^3*B + 12*a*b^2*B + 3*a^2*b*(4*A + 5*C))*sec(c + d*x)^2*tan(c + d*x))/(15*d) + (a*(6*A*b^2 + 42*a*b*B + 5*a^2*(5*A + 6*C))*sec(c + d*x)^3*tan(c + d*x))/(120*d) + ((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 + b*cos(c + d*x))^3*sec(c + d*x)^5*tan(c + d*x))/(6*d)]

    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^4, x, 6, (1/16)*(8*a^4*B + 36*a^2*b^2*B + 5*b^4*B + 8*a^3*b*(4*A + 3*C) + 4*a*b^3*(6*A + 5*C))*x + ((280*a^3*b*B + 224*a*b^3*B + 35*a^4*(3*A + 2*C) + 84*a^2*b^2*(5*A + 4*C) + 8*b^4*(7*A + 6*C))*sin(c + d*x))/(105*d) + ((8*a^4*B + 36*a^2*b^2*B + 5*b^4*B + 8*a^3*b*(4*A + 3*C) + 4*a*b^3*(6*A + 5*C))*cos(c + d*x)*sin(c + d*x))/(16*d) + ((91*a^3*b*B + 112*a*b^3*B + 4*a^4*C + 4*b^4*(7*A + 6*C) + 3*a^2*b^2*(63*A + 50*C))*cos(c + d*x)^2*sin(c + d*x))/(105*d) + (b*(336*a^2*b*B + 175*b^3*B + 24*a^3*C + 4*a*b^2*(126*A + 103*C))*cos(c + d*x)^3*sin(c + d*x))/(840*d) + ((14*A*b^2 + 21*a*b*B + 4*a^2*C + 12*b^2*C)*cos(c + d*x)^2*(a + b*cos(c + d*x))^2*sin(c + d*x))/(70*d) + ((7*b*B + 4*a*C)*cos(c + d*x)^2*(a + b*cos(c + d*x))^3*sin(c + d*x))/(42*d) + (C*cos(c + d*x)^2*(a + b*cos(c + d*x))^4*sin(c + d*x))/(7*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^4, x, 5, (1/16)*(32*a^3*b*B + 24*a*b^3*B + 8*a^4*(2*A + C) + 12*a^2*b^2*(4*A + 3*C) + b^4*(6*A + 5*C))*x + ((24*a^4*b*B + 224*a^2*b^3*B + 32*b^5*B - 4*a^5*C + 32*a*b^4*(5*A + 4*C) + a^3*b^2*(190*A + 121*C))*sin(c + d*x))/(60*b*d) + ((48*a^3*b*B + 232*a*b^3*B - 8*a^4*C + 15*b^4*(6*A + 5*C) + 2*a^2*b^2*(130*A + 89*C))*cos(c + d*x)*sin(c + d*x))/(240*d) + ((24*a^2*b*B + 32*b^3*B - 4*a^3*C + a*b^2*(70*A + 53*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(120*b*d) + ((5*b^2*(6*A + 5*C) + 4*a*(6*b*B - a*C))*(a + b*cos(c + d*x))^3*sin(c + d*x))/(120*b*d) + ((6*b*B - a*C)*(a + b*cos(c + d*x))^4*sin(c + d*x))/(30*b*d) + (C*(a + b*cos(c + d*x))^5*sin(c + d*x))/(6*b*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^4, x, 7, (1/8)*(8*a^4*B + 24*a^2*b^2*B + 3*b^4*B + 16*a^3*b*(2*A + C) + 4*a*b^3*(4*A + 3*C))*x + (a^4*A*atanh(sin(c + d*x)))/d + ((95*a^3*b*B + 80*a*b^3*B + 12*a^4*C + 4*b^4*(5*A + 4*C) + 2*a^2*b^2*(85*A + 56*C))*sin(c + d*x))/(30*d) + (b*(130*a^2*b*B + 45*b^3*B + 24*a^3*C + 4*a*b^2*(40*A + 29*C))*cos(c + d*x)*sin(c + d*x))/(120*d) + ((20*A*b^2 + 35*a*b*B + 12*a^2*C + 16*b^2*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(60*d) + ((5*b*B + 4*a*C)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(20*d) + (C*(a + b*cos(c + d*x))^4*sin(c + d*x))/(5*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^4, x, 7, (1/8)*(32*a^3*b*B + 16*a*b^3*B + 8*a^4*C + 24*a^2*b^2*(2*A + C) + b^4*(4*A + 3*C))*x + (a^3*(4*A*b + a*B)*atanh(sin(c + d*x)))/d + (b*(34*a^2*b*B + 4*b^3*B - a^3*(12*A - 19*C) + 8*a*b^2*(3*A + 2*C))*sin(c + d*x))/(6*d) + (b^2*(32*a*b*B - a^2*(24*A - 26*C) + 3*b^2*(4*A + 3*C))*cos(c + d*x)*sin(c + d*x))/(24*d) - (b*(12*a*A - 4*b*B - 7*a*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(12*d) - (b*(4*A - C)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(4*d) + (A*(a + b*cos(c + d*x))^4*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^4, x, 7, (1/2)*b*(12*a^2*b*B + b^3*B + 8*a^3*C + 4*a*b^2*(2*A + C))*x + (a^2*(12*A*b^2 + 8*a*b*B + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*d) - (b*(12*a^3*B - 24*a*b^2*B + a^2*b*(39*A - 34*C) - 2*b^3*(3*A + 2*C))*sin(c + d*x))/(6*d) - (b^2*(6*a^2*B - 3*b^2*B + 2*a*b*(9*A - 4*C))*cos(c + d*x)*sin(c + d*x))/(6*d) - (b*(15*A*b + 6*a*B - 2*b*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(6*d) + ((2*A*b + a*B)*(a + b*cos(c + d*x))^3*tan(c + d*x))/d + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^4, x, 7, (1/2)*b^2*(2*A*b^2 + 8*a*b*B + 12*a^2*C + b^2*C)*x + (a*(8*A*b^3 + a^3*B + 12*a*b^2*B + 4*a^2*b*(A + 2*C))*atanh(sin(c + d*x)))/(2*d) - (b*(39*a^2*b*B - 6*b^3*B + 4*a*b^2*(11*A - 6*C) + 4*a^3*(2*A + 3*C))*sin(c + d*x))/(6*d) - (b^2*(18*a*b*B + 3*b^2*(6*A - C) + a^2*(4*A + 6*C))*cos(c + d*x)*sin(c + d*x))/(6*d) + ((12*A*b^2 + 15*a*b*B + a^2*(4*A + 6*C))*(a + b*cos(c + d*x))^2*tan(c + d*x))/(6*d) + ((4*A*b + 3*a*B)*(a + b*cos(c + d*x))^3*sec(c + d*x)*tan(c + d*x))/(6*d) + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)^2*tan(c + d*x))/(3*d)]
    @test_int [sec(c + d*x)^5*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^4, x, 7, b^3*(b*B + 4*a*C)*x + ((8*A*b^4 + 16*a^3*b*B + 32*a*b^3*B + 24*a^2*b^2*(A + 2*C) + a^4*(3*A + 4*C))*atanh(sin(c + d*x)))/(8*d) - (b^2*(32*a*b*B + 2*b^2*(13*A - 12*C) + 3*a^2*(3*A + 4*C))*sin(c + d*x))/(24*d) + (a*(12*A*b^3 + 8*a^3*B + 36*a*b^2*B + a^2*b*(23*A + 36*C))*tan(c + d*x))/(12*d) + ((4*A*b^2 + 8*a*b*B + a^2*(3*A + 4*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)*tan(c + d*x))/(8*d) + ((A*b + a*B)*(a + b*cos(c + d*x))^3*sec(c + d*x)^2*tan(c + d*x))/(3*d) + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)^3*tan(c + d*x))/(4*d)]
    @test_int [sec(c + d*x)^6*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^4, x, 7, b^4*C*x + ((3*a^4*B + 24*a^2*b^2*B + 8*b^4*B + 16*a*b^3*(A + 2*C) + 4*a^3*b*(3*A + 4*C))*atanh(sin(c + d*x)))/(8*d) + ((12*A*b^4 + 80*a^3*b*B + 95*a*b^3*B + 4*a^4*(4*A + 5*C) + 2*a^2*b^2*(56*A + 85*C))*tan(c + d*x))/(30*d) + (a*(24*A*b^3 + 45*a^3*B + 130*a*b^2*B + 4*a^2*b*(29*A + 40*C))*sec(c + d*x)*tan(c + d*x))/(120*d) + ((12*A*b^2 + 35*a*b*B + 4*a^2*(4*A + 5*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^2*tan(c + d*x))/(60*d) + ((4*A*b + 5*a*B)*(a + b*cos(c + d*x))^3*sec(c + d*x)^3*tan(c + d*x))/(20*d) + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)^4*tan(c + d*x))/(5*d)]
    @test_int [sec(c + d*x)^7*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^4, x, 9, ((24*a^3*b*B + 32*a*b^3*B + 8*b^4*(A + 2*C) + 12*a^2*b^2*(3*A + 4*C) + a^4*(5*A + 6*C))*atanh(sin(c + d*x)))/(16*d) + ((8*a^4*B + 60*a^2*b^2*B + 15*b^4*B + 20*a*b^3*(2*A + 3*C) + 8*a^3*b*(4*A + 5*C))*tan(c + d*x))/(15*d) + ((24*A*b^4 + 360*a^3*b*B + 336*a*b^3*B + 15*a^4*(5*A + 6*C) + 10*a^2*b^2*(49*A + 66*C))*sec(c + d*x)*tan(c + d*x))/(240*d) + (a*(4*A*b^3 + 16*a^3*B + 36*a*b^2*B + a^2*b*(39*A + 50*C))*sec(c + d*x)^2*tan(c + d*x))/(60*d) + ((12*A*b^2 + 48*a*b*B + 5*a^2*(5*A + 6*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^3*tan(c + d*x))/(120*d) + ((2*A*b + 3*a*B)*(a + b*cos(c + d*x))^3*sec(c + d*x)^4*tan(c + d*x))/(15*d) + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)^5*tan(c + d*x))/(6*d)]
    @test_int [sec(c + d*x)^8*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^4, x, 10, ((5*a^4*B + 36*a^2*b^2*B + 8*b^4*B + 8*a*b^3*(3*A + 4*C) + 4*a^3*b*(5*A + 6*C))*atanh(sin(c + d*x)))/(16*d) + ((224*a^3*b*B + 280*a*b^3*B + 35*b^4*(2*A + 3*C) + 84*a^2*b^2*(4*A + 5*C) + 8*a^4*(6*A + 7*C))*tan(c + d*x))/(105*d) + ((5*a^4*B + 36*a^2*b^2*B + 8*b^4*B + 8*a*b^3*(3*A + 4*C) + 4*a^3*b*(5*A + 6*C))*sec(c + d*x)*tan(c + d*x))/(16*d) + ((4*A*b^4 + 112*a^3*b*B + 91*a*b^3*B + 4*a^4*(6*A + 7*C) + 3*a^2*b^2*(50*A + 63*C))*sec(c + d*x)^2*tan(c + d*x))/(105*d) + (a*(24*A*b^3 + 175*a^3*B + 336*a*b^2*B + a^2*(412*A*b + 504*b*C))*sec(c + d*x)^3*tan(c + d*x))/(840*d) + ((4*A*b^2 + 21*a*b*B + 2*a^2*(6*A + 7*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^4*tan(c + d*x))/(70*d) + ((4*A*b + 7*a*B)*(a + b*cos(c + d*x))^3*sec(c + d*x)^5*tan(c + d*x))/(42*d) + (A*(a + b*cos(c + d*x))^4*sec(c + d*x)^6*tan(c + d*x))/(7*d)]

    @test_int [(a*b*B - a^2*C + b^2*B*cos(c + d*x) + b^2*C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^3, x, 5, (1/8)*(8*a^4*b*B + 24*a^2*b^3*B + 3*b^5*B - 8*a^5*C - 8*a^3*b^2*C + 9*a*b^4*C)*x + (b*(95*a^3*b*B + 80*a*b^3*B - 83*a^4*C + 32*a^2*b^2*C + 16*b^4*C)*sin(c + d*x))/(30*d) + (b^2*(130*a^2*b*B + 45*b^3*B - 106*a^3*C + 71*a*b^2*C)*cos(c + d*x)*sin(c + d*x))/(120*d) + (b*(35*a*b*B - 23*a^2*C + 16*b^2*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(60*d) + (b*(5*b*B - a*C)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(20*d) + (b*C*(a + b*cos(c + d*x))^4*sin(c + d*x))/(5*d)]
    @test_int [(a*b*B - a^2*C + b^2*B*cos(c + d*x) + b^2*C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2, x, 4, (1/8)*(8*a^3*b*B + 12*a*b^3*B - 8*a^4*C + 3*b^4*C)*x + (b*(16*a^2*b*B + 4*b^3*B - 13*a^3*C + 8*a*b^2*C)*sin(c + d*x))/(6*d) + (b^2*(20*a*b*B - 14*a^2*C + 9*b^2*C)*cos(c + d*x)*sin(c + d*x))/(24*d) + (b*(4*b*B - a*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(12*d) + (b*C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(4*d)]
    @test_int [(a*b*B - a^2*C + b^2*B*cos(c + d*x) + b^2*C*cos(c + d*x)^2)*(a + b*cos(c + d*x)), x, 3, (1/2)*(2*a^2*b*B + b^3*B - 2*a^3*C + a*b^2*C)*x + (2*b*(3*a*b*B - 2*a^2*C + b^2*C)*sin(c + d*x))/(3*d) + (b^2*(3*b*B - a*C)*cos(c + d*x)*sin(c + d*x))/(6*d) + (b*C*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*d)]

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

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

    @test_int [cos(c + d*x)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 7, ((6*a^2*b*B + b^3*B - 8*a^3*C - 2*a*b^2*(2*A + C))*x)/(2*b^5) + (2*a^2*(2*a^2*A*b^2 - 3*A*b^4 - 3*a^3*b*B + 4*a*b^3*B + 4*a^4*C - 5*a^2*b^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^5*(a + b)^(3/2)*d) - ((9*a^3*b*B - 6*a*b^3*B - a^2*b^2*(6*A - 7*C) - 12*a^4*C + b^4*(3*A + 2*C))*sin(c + d*x))/(3*b^4*(a^2 - b^2)*d) + ((3*a^2*b*B - b^3*B - 2*a*b^2*(A - C) - 4*a^3*C)*cos(c + d*x)*sin(c + d*x))/(2*b^3*(a^2 - b^2)*d) + ((3*A*b^2 - 3*a*b*B + 4*a^2*C - b^2*C)*cos(c + d*x)^2*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d) - ((A*b^2 - a*(b*B - a*C))*cos(c + d*x)^3*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 6, ((2*A*b^2 - 4*a*b*B + 6*a^2*C + b^2*C)*x)/(2*b^4) - (2*a*(a^2*A*b^2 - 2*A*b^4 - 2*a^3*b*B + 3*a*b^3*B + 3*a^4*C - 4*a^2*b^2*C)*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*b*B - b^3*B - a*b^2*(A - 2*C) - 3*a^3*C)*sin(c + d*x))/(b^3*(a^2 - b^2)*d) + ((2*A*b^2 - 2*a*b*B + 3*a^2*C - b^2*C)*cos(c + d*x)*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d) - ((A*b^2 - a*(b*B - a*C))*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)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 5, ((b*B - 2*a*C)*x)/b^3 - (2*(A*b^4 + a^3*b*B - 2*a*b^3*B - 2*a^4*C + 3*a^2*b^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/((a - b)^(3/2)*b^3*(a + b)^(3/2)*d) + (C*sin(c + d*x))/(b^2*d) + (a*(A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 4, (C*x)/b^2 + (2*(a*A*b^2 - b^3*B - a^3*C + 2*a*b^2*C)*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*b^2 - a*(b*B - a*C))*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 5, -((2*(2*a^2*A*b - A*b^3 - a^3*B + a^2*b*C)*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) + ((A*b^2 - a*(b*B - a*C))*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 6, (2*(3*a^2*A*b^2 - 2*A*b^4 - 2*a^3*b*B + a*b^3*B + a^4*C)*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) - ((2*A*b^2 - a*b*B - a^2*(A - C))*tan(c + d*x))/(a^2*(a^2 - b^2)*d) + ((A*b^2 - a*(b*B - a*C))*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 7, -((2*b*(4*a^2*A*b^2 - 3*A*b^4 - 3*a^3*b*B + 2*a*b^3*B + 2*a^4*C - a^2*b^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^4*(a - b)^(3/2)*(a + b)^(3/2)*d)) + ((6*A*b^2 - 4*a*b*B + a^2*(A + 2*C))*atanh(sin(c + d*x)))/(2*a^4*d) + ((3*A*b^3 + a^3*B - 2*a*b^2*B - a^2*b*(2*A - C))*tan(c + d*x))/(a^3*(a^2 - b^2)*d) - ((3*A*b^2 - 2*a*b*B - a^2*(A - 2*C))*sec(c + d*x)*tan(c + d*x))/(2*a^2*(a^2 - b^2)*d) + ((A*b^2 - a*(b*B - a*C))*sec(c + d*x)*tan(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 8, (2*b^2*(5*a^2*A*b^2 - 4*A*b^4 - 4*a^3*b*B + 3*a*b^3*B + 3*a^4*C - 2*a^2*b^2*C)*atan((sqrt(a - b)*tan((1/2)*(c + d*x)))/sqrt(a + b)))/(a^5*(a - b)^(3/2)*(a + b)^(3/2)*d) - ((8*A*b^3 - a^3*B - 6*a*b^2*B + 2*a^2*b*(A + 2*C))*atanh(sin(c + d*x)))/(2*a^5*d) - ((12*A*b^4 + 6*a^3*b*B - 9*a*b^3*B - a^2*b^2*(7*A - 6*C) - a^4*(2*A + 3*C))*tan(c + d*x))/(3*a^4*(a^2 - b^2)*d) + ((4*A*b^3 + a^3*B - 3*a*b^2*B - 2*a^2*b*(A - C))*sec(c + d*x)*tan(c + d*x))/(2*a^3*(a^2 - b^2)*d) - ((4*A*b^2 - 3*a*b*B - a^2*(A - 3*C))*sec(c + d*x)^2*tan(c + d*x))/(3*a^2*(a^2 - b^2)*d) + ((A*b^2 - a*(b*B - a*C))*sec(c + d*x)^2*tan(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]

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

    #= ::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)+C*cos(e+f*x)^2)=#

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

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 9, (2*(24*a^3*b*B + 57*a*b^3*B - 16*a^4*C - 6*a^2*b^2*(7*A + 4*C) + 21*b^4*(9*A + 7*C))*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*b*B + 75*b^3*B - 16*a^3*C - 6*a*b^2*(7*A + 6*C))*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*b*B + 75*b^3*B - 16*a^3*C - 6*a*b^2*(7*A + 6*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*b^3*d) + (2*(63*A*b^2 - 36*a*b*B + 24*a^2*C + 49*b^2*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(315*b^3*d) + (2*(3*b*B - 2*a*C)*cos(c + d*x)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(21*b^2*d) + (2*C*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)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 8, -((2*(14*a^2*b*B - 63*b^3*B - 8*a^3*C - a*b^2*(35*A + 19*C))*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)*(35*A*b^2 - 14*a*b*B + 8*a^2*C + 25*b^2*C)*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*(35*A*b^2 - 14*a*b*B + 8*a^2*C + 25*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*b^2*d) + (2*(7*b*B - 4*a*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*b^2*d) + (2*C*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)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 7, (2*(3*b^2*(5*A + 3*C) + a*(5*b*B - 2*a*C))*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*b*B - 2*a*C)*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*b*B - 2*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b*d) + (2*C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*b*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 9, (2*(3*b*B + a*C)*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*(3*A*b^2 - (a^2 - b^2)*C)*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*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))) + (2*C*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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 9, -(((A - 2*C)*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) + C*cos(c + d*x)^2)*(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 + 8*b*C)*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*b^2 - 4*a*b*B - 4*a^2*(A + 2*C))*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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 11, ((3*A*b^2 - 6*a*b*B - 8*a^2*(2*A + 3*C))*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))) - ((A*b^2 - 18*a*b*B - 8*a^2*(2*A + 3*C))*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))) + ((A*b^3 + 8*a^3*B - 2*a*b^2*B + 4*a^2*b*(A + 2*C))*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))) - ((3*A*b^2 - 6*a*b*B - 8*a^2*(2*A + 3*C))*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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(3/2), x, 10, (2*(88*a^4*b*B + 363*a^2*b^3*B + 1617*b^5*B - 48*a^5*C - 18*a^3*b^2*(11*A + 6*C) + 6*a*b^4*(451*A + 348*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3465*b^4*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2 - b^2)*(88*a^3*b*B + 429*a*b^3*B - 48*a^4*C - 18*a^2*b^2*(11*A + 8*C) + 75*b^4*(11*A + 9*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3465*b^4*d*sqrt(a + b*cos(c + d*x))) + (2*(88*a^3*b*B + 429*a*b^3*B - 48*a^4*C - 18*a^2*b^2*(11*A + 8*C) + 75*b^4*(11*A + 9*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3465*b^3*d) + (2*(88*a^2*b*B + 539*b^3*B - 48*a^3*C - 6*a*b^2*(33*A + 34*C))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3465*b^3*d) + (2*(99*A*b^2 - 44*a*b*B + 24*a^2*C + 81*b^2*C)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(693*b^3*d) + (2*(11*b*B - 6*a*C)*cos(c + d*x)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(99*b^2*d) + (2*C*cos(c + d*x)^2*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(11*b*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(3/2), x, 9, -((2*(18*a^3*b*B - 246*a*b^3*B - 8*a^4*C - 21*b^4*(9*A + 7*C) - 3*a^2*b^2*(21*A + 11*C))*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*b*B - 75*b^3*B - 8*a^3*C - 3*a*b^2*(21*A + 13*C))*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*b*B - 75*b^3*B - 8*a^3*C - 3*a*b^2*(21*A + 13*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*b^2*d) + (2*(63*A*b^2 - 18*a*b*B + 8*a^2*C + 49*b^2*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(315*b^2*d) + (2*(9*b*B - 4*a*C)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(63*b^2*d) + (2*C*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)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(3/2), x, 8, (2*(21*a^2*b*B + 63*b^3*B - 6*a^3*C + 2*a*b^2*(70*A + 41*C))*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)*(35*A*b^2 + 21*a*b*B - 6*a^2*C + 25*b^2*C)*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*(35*A*b^2 + 21*a*b*B - 6*a^2*C + 25*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*b*d) + (2*(7*b*B - 2*a*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*b*d) + (2*C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*b*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(3/2), x, 10, (2*(15*A*b^2 + 20*a*b*B + 3*a^2*C + 9*b^2*C)*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*(5*a^2*b*B - 5*b^3*B + 3*a^3*C - 3*a*b^2*(5*A + C))*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*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*(5*b*B + 3*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*d) + (2*C*(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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(3/2), x, 10, -(((3*a*A - 6*b*B - 8*a*C)*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)))) + ((6*a*b*B + a^2*(3*A - 2*C) + 2*b^2*(3*A + C))*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*(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))) - (b*(3*A - 2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d) + (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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(3/2), x, 10, -(((5*A*b + 4*a*B - 8*b*C)*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)))) + ((4*a^2*B + 8*b^2*B + a*b*(7*A + 8*C))*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))) + ((3*A*b^2 + 12*a*b*B + 4*a^2*(A + 2*C))*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))) + ((3*A*b + 4*a*B)*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(4*d) + (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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(3/2), x, 11, -(((3*A*b^2 + 30*a*b*B + 8*a^2*(2*A + 3*C))*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)))) + ((42*a*b*B + 8*a^2*(2*A + 3*C) + b^2*(17*A + 48*C))*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))) - ((A*b^3 - 8*a^3*B - 6*a*b^2*B - 12*a^2*b*(A + 2*C))*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))) + ((3*A*b^2 + 30*a*b*B + 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(24*a*d) + ((A*b + 2*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(4*d) + (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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(3/2), x, 12, ((9*A*b^3 - 128*a^3*B - 24*a*b^2*B - 12*a^2*b*(13*A + 20*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(192*a^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - ((3*A*b^3 - 128*a^3*B - 136*a*b^2*B - 12*a^2*b*(19*A + 28*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(192*a*d*sqrt(a + b*cos(c + d*x))) + ((3*A*b^4 + 96*a^3*b*B - 8*a*b^3*B + 24*a^2*b^2*(A + 2*C) + 16*a^4*(3*A + 4*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(64*a^2*d*sqrt(a + b*cos(c + d*x))) - ((9*A*b^3 - 128*a^3*B - 24*a*b^2*B - 12*a^2*b*(13*A + 20*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(192*a^2*d) + ((3*A*b^2 + 56*a*b*B + 12*a^2*(3*A + 4*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(96*a*d) + ((3*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 + b*cos(c + d*x))^(3/2)*sec(c + d*x)^3*tan(c + d*x))/(4*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(5/2), x, 11, (2*(520*a^5*b*B + 3315*a^3*b^3*B + 48165*a*b^5*B - 240*a^6*C + 1617*b^6*(13*A + 11*C) - 10*a^4*b^2*(143*A + 76*C) + 3*a^2*b^4*(13299*A + 10223*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(45045*b^4*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2 - b^2)*(520*a^4*b*B + 3705*a^2*b^3*B + 8775*b^5*B - 240*a^5*C - 10*a^3*b^2*(143*A + 94*C) + 6*a*b^4*(2717*A + 2174*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(45045*b^4*d*sqrt(a + b*cos(c + d*x))) + (2*(520*a^4*b*B + 3705*a^2*b^3*B + 8775*b^5*B - 240*a^5*C - 10*a^3*b^2*(143*A + 94*C) + 6*a*b^4*(2717*A + 2174*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(45045*b^3*d) + (2*(520*a^3*b*B + 4355*a*b^3*B - 240*a^4*C + 539*b^4*(13*A + 11*C) - 10*a^2*b^2*(143*A + 124*C))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(45045*b^3*d) + (2*(104*a^2*b*B + 1053*b^3*B - 48*a^3*C - 2*a*b^2*(143*A + 166*C))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(9009*b^3*d) + (2*(143*A*b^2 - 52*a*b*B + 24*a^2*C + 121*b^2*C)*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(1287*b^3*d) + (2*(13*b*B - 6*a*C)*cos(c + d*x)*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(143*b^2*d) + (2*C*cos(c + d*x)^2*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(13*b*d)]
    @test_int [cos(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(5/2), x, 10, -((2*(110*a^4*b*B - 3069*a^2*b^3*B - 1617*b^5*B - 40*a^5*C - 15*a^3*b^2*(33*A + 17*C) - 15*a*b^4*(319*A + 247*C))*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*b*B - 1254*a*b^3*B - 40*a^4*C - 75*b^4*(11*A + 9*C) - 15*a^2*b^2*(33*A + 19*C))*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*b*B - 1254*a*b^3*B - 40*a^4*C - 75*b^4*(11*A + 9*C) - 15*a^2*b^2*(33*A + 19*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3465*b^2*d) - (2*(110*a^2*b*B - 539*b^3*B - 40*a^3*C - 5*a*b^2*(99*A + 67*C))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3465*b^2*d) + (2*(99*A*b^2 - 22*a*b*B + 8*a^2*C + 81*b^2*C)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(693*b^2*d) + (2*(11*b*B - 4*a*C)*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(99*b^2*d) + (2*C*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)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(5/2), x, 9, (2*(45*a^3*b*B + 435*a*b^3*B - 10*a^4*C + 21*b^4*(9*A + 7*C) + 3*a^2*b^2*(161*A + 93*C))*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*b*B + 75*b^3*B - 10*a^3*C + 6*a*b^2*(28*A + 19*C))*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*b*B + 75*b^3*B - 10*a^3*C + 6*a*b^2*(28*A + 19*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*b*d) + (2*(63*A*b^2 + 45*a*b*B - 10*a^2*C + 49*b^2*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(315*b*d) + (2*(9*b*B - 2*a*C)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(63*b*d) + (2*C*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(9*b*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(5/2), x, 11, (2*(161*a^2*b*B + 63*b^3*B + 15*a^3*C + 5*a*b^2*(49*A + 29*C))*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*(56*a^3*b*B - 56*a*b^3*B - 10*a^2*b^2*(7*A - C) + 15*a^4*C - 5*b^4*(7*A + 5*C))*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*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*(35*A*b^2 + 56*a*b*B + 15*a^2*C + 25*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*d) + (2*(7*b*B + 5*a*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*d) + (2*C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [sec(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(5/2), x, 11, ((70*a*b*B - a^2*(15*A - 46*C) + 6*b^2*(5*A + 3*C))*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))) + ((20*a^2*b*B + 10*b^3*B + a^3*(15*A - 16*C) + 4*a*b^2*(15*A + 4*C))*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))) + (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*(15*a*A - 10*b*B - 16*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*d) - (b*(5*A - 2*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d) + (A*(a + b*cos(c + d*x))^(5/2)*tan(c + d*x))/d]
    @test_int [sec(c + d*x)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(5/2), x, 11, -(((12*a^2*B - 24*b^2*B + a*b*(27*A - 56*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(12*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((12*a^3*B + 48*a*b^2*B + 8*b^3*(3*A + C) + a^2*b*(33*A + 16*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(12*d*sqrt(a + b*cos(c + d*x))) + (a*(15*A*b^2 + 20*a*b*B + 4*a^2*(A + 2*C))*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))) - (b*(21*A*b + 12*a*B - 8*b*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(12*d) + ((5*A*b + 4*a*B)*(a + b*cos(c + d*x))^(3/2)*tan(c + d*x))/(4*d) + (A*(a + b*cos(c + d*x))^(5/2)*sec(c + d*x)*tan(c + d*x))/(2*d)]
    @test_int [sec(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(5/2), x, 11, -(((54*a*b*B + 3*b^2*(11*A - 16*C) + 8*a^2*(2*A + 3*C))*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)))) + ((66*a^2*b*B + 48*b^3*B + 8*a^3*(2*A + 3*C) + a*b^2*(59*A + 96*C))*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))) + ((5*A*b^3 + 8*a^3*B + 30*a*b^2*B + 20*a^2*b*(A + 2*C))*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))) + ((15*A*b^2 + 42*a*b*B + 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(24*d) + ((5*A*b + 6*a*B)*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)*tan(c + d*x))/(12*d) + (A*(a + b*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(5/2), x, 12, -(((15*A*b^3 + 128*a^3*B + 264*a*b^2*B + 4*a^2*b*(71*A + 108*C))*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)))) + ((128*a^3*B + 472*a*b^2*B + 4*a^2*b*(89*A + 132*C) + b^3*(133*A + 384*C))*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))) - ((5*A*b^4 - 160*a^3*b*B - 40*a*b^3*B - 120*a^2*b^2*(A + 2*C) - 16*a^4*(3*A + 4*C))*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))) + ((15*A*b^3 + 128*a^3*B + 264*a*b^2*B + 4*a^2*b*(71*A + 108*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(192*a*d) + ((5*A*b^2 + 24*a*b*B + 4*a^2*(3*A + 4*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(32*d) + ((5*A*b + 8*a*B)*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^2*tan(c + d*x))/(24*d) + (A*(a + b*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(5/2), x, 13, ((45*A*b^4 - 2840*a^3*b*B - 150*a*b^3*B - 256*a^4*(4*A + 5*C) - 12*a^2*b^2*(141*A + 220*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(1920*a^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) - ((15*A*b^4 - 3560*a^3*b*B - 1330*a*b^3*B - 256*a^4*(4*A + 5*C) - 4*a^2*b^2*(809*A + 1180*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(1920*a*d*sqrt(a + b*cos(c + d*x))) + ((3*A*b^5 + 96*a^5*B + 240*a^3*b^2*B - 10*a*b^4*B + 40*a^2*b^3*(A + 2*C) + 80*a^4*b*(3*A + 4*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(128*a^2*d*sqrt(a + b*cos(c + d*x))) - ((45*A*b^4 - 2840*a^3*b*B - 150*a*b^3*B - 256*a^4*(4*A + 5*C) - 12*a^2*b^2*(141*A + 220*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(1920*a^2*d) + ((15*A*b^3 + 360*a^3*B + 590*a*b^2*B + 4*a^2*b*(193*A + 260*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(960*a*d) + ((15*A*b^2 + 110*a*b*B + 16*a^2*(4*A + 5*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(240*d) + ((A*b + 2*a*B)*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^3*tan(c + d*x))/(8*d) + (A*(a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^4*tan(c + d*x))/(5*d)]

    @test_int [(a*b*B - a^2*C + b^2*B*cos(c + d*x) + b^2*C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(3/2), x, 9, (2*(161*a^2*b*B + 63*b^3*B - 146*a^3*C + 82*a*b^2*C)*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(105*d*sqrt((a + b*cos(c + d*x))/(a + b))) - (2*(a^2 - b^2)*(56*a*b*B - 41*a^2*C + 25*b^2*C)*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(105*d*sqrt(a + b*cos(c + d*x))) + (2*b*(56*a*b*B - 41*a^2*C + 25*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*d) + (2*b*(7*b*B - 2*a*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*d) + (2*b*C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [(a*b*B - a^2*C + b^2*B*cos(c + d*x) + b^2*C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^(1/2), x, 8, (2*(20*a*b*B - 17*a^2*C + 9*b^2*C)*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*(a^2 - b^2)*(5*b*B - 2*a*C)*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*b*(5*b*B - 2*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*d) + (2*b*C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d)]

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

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(1/2), x, 8, (2*(56*a^2*b*B + 63*b^3*B - 48*a^3*C - 2*a*b^2*(35*A + 22*C))*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*b*B + 49*a*b^3*B - 48*a^4*C - 5*b^4*(7*A + 5*C) - 2*a^2*b^2*(35*A + 16*C))*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*(35*A*b^2 - 28*a*b*B + 24*a^2*C + 25*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*b^3*d) + (2*(7*b*B - 6*a*C)*cos(c + d*x)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*b^2*d) + (2*C*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)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(1/2), x, 7, (2*(15*A*b^2 - 10*a*b*B + 8*a^2*C + 9*b^2*C)*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*b*B + 5*b^3*B - 8*a^3*C - a*b^2*(15*A + 7*C))*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*b*B - 4*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b^2*d) + (2*C*cos(c + d*x)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*b*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(1/2), x, 6, (2*(3*b*B - 2*a*C)*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*b^2 - 3*a*b*B + 2*a^2*C + b^2*C)*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*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b*d)]
    @test_int [sec(c + d*x)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(1/2), x, 8, (2*C*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*(b*B - a*C)*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*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) + C*cos(c + d*x)^2)/(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 + 2*C)*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) + C*cos(c + d*x)^2)/(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))) + ((3*A*b^2 - 4*a*b*B + 4*a^2*(A + 2*C))*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 [sec(c + d*x)^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(1/2), x, 11, -(((15*A*b^2 - 18*a*b*B + 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(24*a^3*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + ((5*A*b^2 - 6*a*b*B + 8*a^2*(2*A + 3*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(24*a^2*d*sqrt(a + b*cos(c + d*x))) - ((5*A*b^3 - 8*a^3*B - 6*a*b^2*B + 4*a^2*b*(A + 2*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.Pi(2, (1/2)*(c + d*x), (2*b)/(a + b)))/(8*a^3*d*sqrt(a + b*cos(c + d*x))) + ((15*A*b^2 - 18*a*b*B + 8*a^2*(2*A + 3*C))*sqrt(a + b*cos(c + d*x))*tan(c + d*x))/(24*a^3*d) - ((5*A*b - 6*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)*tan(c + d*x))/(12*a^2*d) + (A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^2*tan(c + d*x))/(3*a*d)]

    @test_int [cos(c + d*x)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 8, -((2*(40*a^3*b*B - 25*a*b^3*B - 6*a^2*b^2*(5*A - 4*C) - 48*a^4*C + 3*b^4*(5*A + 3*C))*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*b*B + 5*b^3*B - 48*a^3*C - 6*a*b^2*(5*A + 2*C))*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*b^2 - a*(b*B - a*C))*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*b*B - 5*b^3*B - 3*a*b^2*(5*A - 3*C) - 24*a^3*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b^3*(a^2 - b^2)*d) + (2*(5*A*b^2 - 5*a*b*B + 6*a^2*C - b^2*C)*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)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 7, (2*(6*a^2*b*B - 3*b^3*B - a*b^2*(3*A - 5*C) - 8*a^3*C)*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*(3*A*b^2 - 6*a*b*B + 8*a^2*C + b^2*C)*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*(A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(b^2*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (2*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b^2*d)]
    @test_int [cos(c + d*x)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 6, (2*(A*b^2 - a*b*B + 2*a^2*C - b^2*C)*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*(b*B - 2*a*C)*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*b^2 - a*(b*B - a*C))*sin(c + d*x))/(b*(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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 9, -((2*(A*b^2 - a*(b*B - a*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(a*b*(a^2 - b^2)*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*C*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*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*(A*b^2 - a*(b*B - a*C))*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 10, ((3*A*b^2 - 2*a*b*B - a^2*(A - 2*C))*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*(3*A*b^2 - 2*a*b*B - a^2*(A - 2*C))*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(3/2), x, 11, -(((15*A*b^3 + 4*a^3*B - 12*a*b^2*B - a^2*(7*A*b - 8*b*C))*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))) + ((15*A*b^2 - 12*a*b*B + 4*a^2*(A + 2*C))*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*(15*A*b^3 + 4*a^3*B - 12*a*b^2*B - a^2*(7*A*b - 8*b*C))*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)^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 9, -((2*(80*a^5*b*B - 140*a^3*b^3*B + 40*a*b^5*B - 4*a^4*b^2*(10*A - 53*C) + 5*a^2*b^4*(15*A - 11*C) - 128*a^6*C - 3*b^6*(5*A + 3*C))*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*b*B - 80*a^2*b^3*B - 5*b^5*B - 4*a^3*b^2*(10*A - 29*C) - 128*a^5*C + a*b^4*(45*A + 17*C))*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*b^2 - a*(b*B - a*C))*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*(6*A*b^4 + 5*a^3*b*B - 9*a*b^3*B - 2*a^2*b^2*(A - 6*C) - 8*a^4*C)*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*b*B - 65*a^2*b^3*B + 5*b^5*B - 2*a^3*b^2*(10*A - 49*C) + 2*a*b^4*(20*A - 7*C) - 64*a^5*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*b^4*(a^2 - b^2)^2*d) - (2*(30*a^3*b*B - 50*a*b^3*B - a^2*b^2*(15*A - 71*C) + b^4*(35*A - 3*C) - 48*a^4*C)*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)^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 8, (2*(8*a^4*b*B - 15*a^2*b^3*B + 3*b^5*B - 2*a^3*b^2*(A - 14*C) + 2*a*b^4*(3*A - 4*C) - 16*a^5*C)*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*b*B - 9*a*b^3*B - 2*a^2*b^2*(A - 8*C) - 16*a^4*C + b^4*(3*A + C))*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*b^2 - a*(b*B - a*C))*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*(4*A*b^4 + a*(3*a^2*b*B - 7*b^3*B - 6*a^3*C + 10*a*b^2*C))*sin(c + d*x))/(3*b^3*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) + (2*(A*b^2 - a*b*B + 2*a^2*C - b^2*C)*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)^1*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 7, -((2*(2*a^3*b*B - 6*a*b^3*B + 3*b^4*(A - C) - 8*a^4*C + a^2*b^2*(A + 15*C))*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*b*B - 3*b^3*B - 8*a^3*C + a*b^2*(A + 9*C))*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*(A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*(3*A*b^4 + 2*a^3*b*B - 6*a*b^3*B - 5*a^4*C + a^2*b^2*(A + 9*C))*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)^0*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 7, -((2*(a^2*b*B + 3*b^3*B + 2*a^3*C - 2*a*b^2*(2*A + 3*C))*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*b^2 - a*b*B - 2*a^2*C + 3*b^2*C)*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*b^2 - a*(b*B - a*C))*sin(c + d*x))/(3*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) + (2*(a^2*b*B + 3*b^3*B + 2*a^3*C - 2*a*b^2*(2*A + 3*C))*sin(c + d*x))/(3*b*(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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 10, (2*(3*A*b^4 + 4*a^3*b*B - a^4*C - a^2*b^2*(7*A + 3*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(3*a^2*b*(a^2 - b^2)^2*d*sqrt((a + b*cos(c + d*x))/(a + b))) + (2*(A*b^2 - a*(b*B - a*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(3*a*b*(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*(A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (2*(3*A*b^4 + 4*a^3*b*B - a^4*C - a^2*b^2*(7*A + 3*C))*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 11, ((26*a^2*A*b^2 - 15*A*b^4 - 14*a^3*b*B + 6*a*b^3*B - a^4*(3*A - 8*C))*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))) - ((5*A*b^2 - 2*a*b*B - a^2*(3*A - 2*C))*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*(5*A*b^2 - 2*a*b*B - a^2*(3*A - 2*C))*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (b*(26*a^2*A*b^2 - 15*A*b^4 - 14*a^3*b*B + 6*a*b^3*B - a^4*(3*A - 8*C))*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(5/2), x, 12, ((105*A*b^5 - 12*a^5*B + 104*a^3*b^2*B - 60*a*b^4*B + a^4*b*(33*A - 56*C) - 2*a^2*b^3*(85*A - 12*C))*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))) + ((35*A*b^3 + 12*a^3*B - 20*a*b^2*B - a^2*(27*A*b - 8*b*C))*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))) + ((35*A*b^2 - 20*a*b*B + 4*a^2*(A + 2*C))*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*(35*A*b^3 + 12*a^3*B - 20*a*b^2*B - a^2*(27*A*b - 8*b*C))*sin(c + d*x))/(12*a^3*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (b*(105*A*b^5 - 12*a^5*B + 104*a^3*b^2*B - 60*a*b^4*B + a^4*b*(33*A - 56*C) - 2*a^2*b^3*(85*A - 12*C))*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 [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^(7/2), x, 8, -((2*(3*a^3*b*B + 29*a*b^3*B + 2*a^4*C - 3*b^4*(3*A + 5*C) - a^2*b^2*(23*A + 19*C))*sqrt(a + b*cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^2*(a^2 - b^2)^3*d*sqrt((a + b*cos(c + d*x))/(a + b)))) + (2*(3*a^2*b*B + 5*b^3*B + 2*a^3*C - 2*a*b^2*(4*A + 5*C))*sqrt((a + b*cos(c + d*x))/(a + b))*Elliptic.F((1/2)*(c + d*x), (2*b)/(a + b)))/(15*b^2*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x))) - (2*(A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(5*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(5/2)) + (2*(3*a^2*b*B + 5*b^3*B + 2*a^3*C - 2*a*b^2*(4*A + 5*C))*sin(c + d*x))/(15*b*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))^(3/2)) + (2*(3*a^3*b*B + 29*a*b^3*B + 2*a^4*C - 3*b^4*(3*A + 5*C) - a^2*b^2*(23*A + 19*C))*sin(c + d*x))/(15*b*(a^2 - b^2)^3*d*sqrt(a + b*cos(c + d*x)))]

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

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(d*cos(e+f*x))^(m/2)*(a+b*cos(e+f*x))^n*(A+B*cos(e+f*x)+C*cos(e+f*x)^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) + C*cos(c + d*x)^2), x, 7, (2*(9*A*b + 9*a*B + 7*b*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (2*(7*a*A + 5*b*B + 5*a*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*(7*a*A + 5*b*B + 5*a*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*(9*A*b + 9*a*B + 7*b*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*(b*B + a*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d) + (2*b*C*cos(c + d*x)^(7/2)*sin(c + d*x))/(9*d)]
    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 6, (2*(5*a*A + 3*b*B + 3*a*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(7*A*b + 7*a*B + 5*b*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*(7*A*b + 7*a*B + 5*b*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*(b*B + a*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*b*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*d)]
    @test_int [((a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 5, (2*(5*A*b + 5*a*B + 3*b*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(b*B + a*(3*A + C))*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*(b*B + a*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*b*C*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d)]
    @test_int [((a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 5, (2*(b*B - a*(A - C))*Elliptic.E((c + d*x)/2, 2))/d + (2*(3*A*b + 3*a*B + b*C)*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a*A*sin(c + d*x))/(d*sqrt(cos(c + d*x))) + (2*b*C*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d)]
    @test_int [((a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 5, (-2*(A*b + a*B - b*C)*Elliptic.E((c + d*x)/2, 2))/d + (2*(3*b*B + a*(A + 3*C))*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*b + a*B)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 6, (-2*(3*a*A + 5*b*B + 5*a*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(A*b + a*B + 3*b*C)*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*b + a*B)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*(3*a*A + 5*b*B + 5*a*C)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 7, (-2*(3*A*b + 3*a*B + 5*b*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(5*a*A + 7*b*B + 7*a*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a*A*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2)) + (2*(A*b + a*B)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2)) + (2*(5*a*A + 7*b*B + 7*a*C)*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (2*(3*A*b + 3*a*B + 5*b*C)*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))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 8, (2*(18*a*A*b + 9*a^2*B + 7*b^2*B + 14*a*b*C)*Elliptic.E((c + d*x)/2, 2))/(15*d) + (2*(110*a*b*B + 11*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*Elliptic.F((c + d*x)/2, 2))/(231*d) + (2*(110*a*b*B + 11*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (2*(18*a*A*b + 9*a^2*B + 7*b^2*B + 14*a*b*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*(11*A*b^2 + 22*a*b*B + 4*a^2*C + 9*b^2*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(77*d) + (2*b*(11*b*B + 4*a*C)*cos(c + d*x)^(7/2)*sin(c + d*x))/(99*d) + (2*C*cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(11*d)]
    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 7, (2*(18*a*b*B + 3*a^2*(5*A + 3*C) + b^2*(9*A + 7*C))*Elliptic.E((c + d*x)/2, 2))/(15*d) + (2*(14*a*A*b + 7*a^2*B + 5*b^2*B + 10*a*b*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*(14*a*A*b + 7*a^2*B + 5*b^2*B + 10*a*b*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*(9*A*b^2 + 18*a*b*B + 4*a^2*C + 7*b^2*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(45*d) + (2*b*(9*b*B + 4*a*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(63*d) + (2*C*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(9*d)]
    @test_int [((a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 6, (2*(10*a*A*b + 5*a^2*B + 3*b^2*B + 6*a*b*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(14*a*b*B + 7*a^2*(3*A + C) + b^2*(7*A + 5*C))*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*(7*A*b^2 + 14*a*b*B + 4*a^2*C + 5*b^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) + (2*b*(7*b*B + 4*a*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(35*d) + (2*C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d)]
    @test_int [((a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 6, (2*(10*a*b*B - 5*a^2*(A - C) + b^2*(5*A + 3*C))*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(3*a^2*B + b^2*B + 2*a*b*(3*A + C))*Elliptic.F((c + d*x)/2, 2))/(3*d) - (2*b*(6*a*A - b*B - 2*a*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) - (2*b^2*(5*A - C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 6, (-2*(a^2*B - b^2*B + 2*a*b*(A - C))*Elliptic.E((c + d*x)/2, 2))/d + (2*(6*a*b*B + b^2*(3*A + C) + a^2*(A + 3*C))*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a*(4*A*b + 3*a*B)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) - (2*b^2*(A - C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 6, (-2*(10*a*b*B + 5*b^2*(A - C) + a^2*(3*A + 5*C))*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(a^2*B + 3*b^2*B + 2*a*b*(A + 3*C))*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a*(4*A*b + 5*a*B)*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)) + (2*(4*A*b^2 + 10*a*b*B + a^2*(3*A + 5*C))*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 7, (-2*(6*a*A*b + 3*a^2*B + 5*b^2*B + 10*a*b*C)*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(14*a*b*B + 7*b^2*(A + 3*C) + a^2*(5*A + 7*C))*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a*(4*A*b + 7*a*B)*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*(4*A*b^2 + 14*a*b*B + a^2*(5*A + 7*C))*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (2*(6*a*A*b + 3*a^2*B + 5*b^2*B + 10*a*b*C)*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [((a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 8, (-2*(18*a*b*B + 3*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*Elliptic.E((c + d*x)/2, 2))/(15*d) + (2*(10*a*A*b + 5*a^2*B + 7*b^2*B + 14*a*b*C)*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a*(4*A*b + 9*a*B)*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2)) + (2*(4*A*b^2 + 18*a*b*B + a^2*(7*A + 9*C))*sin(c + d*x))/(45*d*cos(c + d*x)^(5/2)) + (2*(10*a*A*b + 5*a^2*B + 7*b^2*B + 14*a*b*C)*sin(c + d*x))/(21*d*cos(c + d*x)^(3/2)) + (2*(18*a*b*B + 3*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^2*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]

    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 8, (2*(27*a^2*b*B + 7*b^3*B + 3*a^3*(5*A + 3*C) + 3*a*b^2*(9*A + 7*C))*Elliptic.E((c + d*x)/2, 2))/(15*d) + (2*(77*a^3*B + 165*a*b^2*B + 33*a^2*b*(7*A + 5*C) + 5*b^3*(11*A + 9*C))*Elliptic.F((c + d*x)/2, 2))/(231*d) + (2*(77*a^3*B + 165*a*b^2*B + 33*a^2*b*(7*A + 5*C) + 5*b^3*(11*A + 9*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (2*(242*a^2*b*B + 77*b^3*B + 24*a^3*C + 33*a*b^2*(9*A + 7*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(495*d) + (2*b*(99*A*b^2 + 143*a*b*B + 24*a^2*C + 81*b^2*C)*cos(c + d*x)^(5/2)*sin(c + d*x))/(693*d) + (2*(11*b*B + 6*a*C)*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(99*d) + (2*C*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(11*d)]
    @test_int [((a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 7, (2*(15*a^3*B + 27*a*b^2*B + 9*a^2*b*(5*A + 3*C) + b^3*(9*A + 7*C))*Elliptic.E((c + d*x)/2, 2))/(15*d) + (2*(21*a^2*b*B + 5*b^3*B + 7*a^3*(3*A + C) + 3*a*b^2*(7*A + 5*C))*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*(54*a^2*b*B + 15*b^3*B + 8*a^3*C + 9*a*b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(63*d) + (2*b*(63*A*b^2 + 99*a*b*B + 24*a^2*C + 49*b^2*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(315*d) + (2*(3*b*B + 2*a*C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(21*d) + (2*C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^3*sin(c + d*x))/(9*d)]
    @test_int [((a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 7, (2*(15*a^2*b*B + 3*b^3*B - 5*a^3*(A - C) + 3*a*b^2*(5*A + 3*C))*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(21*a^3*B + 21*a*b^2*B + 21*a^2*b*(3*A + C) + b^3*(7*A + 5*C))*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*b*(21*a*b*B - 6*a^2*(7*A - 3*C) + b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) - (2*b^2*(35*a*A - 7*b*B - 11*a*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(35*d) - (2*b*(7*A - C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d) + (2*A*(a + b*cos(c + d*x))^3*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 7, (-2*(5*a^3*B - 15*a*b^2*B + 15*a^2*b*(A - C) - b^3*(5*A + 3*C))*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(9*a^2*b*B + b^3*B + 3*a*b^2*(3*A + C) + a^3*(A + 3*C))*Elliptic.F((c + d*x)/2, 2))/(3*d) - (2*b*(6*a^2*B - b^2*B + 3*a*b*(5*A - C))*sqrt(cos(c + d*x))*sin(c + d*x))/(3*d) - (2*b^2*(35*A*b + 15*a*B - 3*b*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*(2*A*b + a*B)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^3*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 7, (-2*(15*a^2*b*B - 5*b^3*B + 15*a*b^2*(A - C) + a^3*(3*A + 5*C))*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(a^3*B + 9*a*b^2*B + b^3*(3*A + C) + 3*a^2*b*(A + 3*C))*Elliptic.F((c + d*x)/2, 2))/(3*d) + (2*a*(24*A*b^2 + 35*a*b*B + 3*a^2*(3*A + 5*C))*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) - (2*b^2*(9*A*b + 5*a*B - 5*b*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) + (2*(6*A*b + 5*a*B)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)) + (2*A*(a + b*cos(c + d*x))^3*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 7, (-2*(3*a^3*B + 15*a*b^2*B + 5*b^3*(A - C) + 3*a^2*b*(3*A + 5*C))*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(21*a^2*b*B + 21*b^3*B + 21*a*b^2*(A + 3*C) + a^3*(5*A + 7*C))*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a*(24*A*b^2 + 63*a*b*B + 5*a^2*(5*A + 7*C))*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (2*(24*A*b^3 + 21*a^3*B + 98*a*b^2*B + 21*a^2*b*(3*A + 5*C))*sin(c + d*x))/(35*d*sqrt(cos(c + d*x))) + (2*(6*A*b + 7*a*B)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*A*(a + b*cos(c + d*x))^3*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [((a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 8, (-2*(27*a^2*b*B + 15*b^3*B + 9*a*b^2*(3*A + 5*C) + a^3*(7*A + 9*C))*Elliptic.E((c + d*x)/2, 2))/(15*d) + (2*(5*a^3*B + 21*a*b^2*B + 7*b^3*(A + 3*C) + 3*a^2*b*(5*A + 7*C))*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a*(24*A*b^2 + 99*a*b*B + 7*a^2*(7*A + 9*C))*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)) + (2*(8*A*b^3 + 15*a^3*B + 54*a*b^2*B + 9*a^2*b*(5*A + 7*C))*sin(c + d*x))/(63*d*cos(c + d*x)^(3/2)) + (2*(27*a^2*b*B + 15*b^3*B + 9*a*b^2*(3*A + 5*C) + a^3*(7*A + 9*C))*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*(2*A*b + 3*a*B)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(21*d*cos(c + d*x)^(7/2)) + (2*A*(a + b*cos(c + d*x))^3*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]

    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 9, (2*(468*a^3*b*B + 364*a*b^3*B + 39*a^4*(5*A + 3*C) + 78*a^2*b^2*(9*A + 7*C) + 7*b^4*(13*A + 11*C))*Elliptic.E((c + d*x)/2, 2))/(195*d) + (2*(77*a^4*B + 330*a^2*b^2*B + 45*b^4*B + 44*a^3*b*(7*A + 5*C) + 20*a*b^3*(11*A + 9*C))*Elliptic.F((c + d*x)/2, 2))/(231*d) + (2*(77*a^4*B + 330*a^2*b^2*B + 45*b^4*B + 44*a^3*b*(7*A + 5*C) + 20*a*b^3*(11*A + 9*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(231*d) + (2*(3458*a^3*b*B + 4004*a*b^3*B + 192*a^4*C + 77*b^4*(13*A + 11*C) + 11*a^2*b^2*(637*A + 491*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(6435*d) + (2*b*(2171*a^2*b*B + 1053*b^3*B + 192*a^3*C + 2*a*b^2*(1573*A + 1259*C))*cos(c + d*x)^(5/2)*sin(c + d*x))/(9009*d) + (2*(143*A*b^2 + 221*a*b*B + 48*a^2*C + 121*b^2*C)*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(1287*d) + (2*(13*b*B + 8*a*C)*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(143*d) + (2*C*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^4*sin(c + d*x))/(13*d)]
    @test_int [((a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 8, (2*(15*a^4*B + 54*a^2*b^2*B + 7*b^4*B + 12*a^3*b*(5*A + 3*C) + 4*a*b^3*(9*A + 7*C))*Elliptic.E((c + d*x)/2, 2))/(15*d) + (2*(308*a^3*b*B + 220*a*b^3*B + 77*a^4*(3*A + C) + 66*a^2*b^2*(7*A + 5*C) + 5*b^4*(11*A + 9*C))*Elliptic.F((c + d*x)/2, 2))/(231*d) + (2*(682*a^3*b*B + 660*a*b^3*B + 64*a^4*C + 15*b^4*(11*A + 9*C) + 9*a^2*b^2*(143*A + 101*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(693*d) + (2*b*(1353*a^2*b*B + 539*b^3*B + 192*a^3*C + 2*a*b^2*(891*A + 673*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(3465*d) + (2*(33*A*b^2 + 55*a*b*B + 16*a^2*C + 27*b^2*C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(231*d) + (2*(11*b*B + 8*a*C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^3*sin(c + d*x))/(99*d) + (2*C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^4*sin(c + d*x))/(11*d)]
    @test_int [((a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 8, (2*(60*a^3*b*B + 36*a*b^3*B - 15*a^4*(A - C) + 18*a^2*b^2*(5*A + 3*C) + b^4*(9*A + 7*C))*Elliptic.E((c + d*x)/2, 2))/(15*d) + (2*(21*a^4*B + 42*a^2*b^2*B + 5*b^4*B + 28*a^3*b*(3*A + C) + 4*a*b^3*(7*A + 5*C))*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*b*(117*a^2*b*B + 15*b^3*B - a^3*(126*A - 62*C) + 12*a*b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(63*d) + (2*b^2*(162*a*b*B - a^2*(315*A - 123*C) + 7*b^2*(9*A + 7*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(315*d) - (2*b*(21*a*A - 3*b*B - 5*a*C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(21*d) - (2*b*(9*A - C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^3*sin(c + d*x))/(9*d) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 8, (-2*(5*a^4*B - 30*a^2*b^2*B - 3*b^4*B + 20*a^3*b*(A - C) - 4*a*b^3*(5*A + 3*C))*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(84*a^3*b*B + 28*a*b^3*B + 42*a^2*b^2*(3*A + C) + 7*a^4*(A + 3*C) + b^4*(7*A + 5*C))*Elliptic.F((c + d*x)/2, 2))/(21*d) - (2*b*(42*a^3*B - 28*a*b^2*B + 3*a^2*b*(49*A - 13*C) - b^3*(7*A + 5*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(21*d) - (2*b^2*(350*a*A*b + 105*a^2*B - 21*b^2*B - 54*a*b*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(105*d) - (2*b*(21*A*b + 7*a*B - b*C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d) + (2*(8*A*b + 3*a*B)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 8, (-2*(20*a^3*b*B - 20*a*b^3*B + 30*a^2*b^2*(A - C) - b^4*(5*A + 3*C) + a^4*(3*A + 5*C))*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(a^4*B + 18*a^2*b^2*B + b^4*B + 4*a*b^3*(3*A + C) + 4*a^3*b*(A + 3*C))*Elliptic.F((c + d*x)/2, 2))/(3*d) - (2*b*(105*a^2*b*B - 5*b^3*B + 4*a*b^2*(33*A - 5*C) + 6*a^3*(3*A + 5*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(15*d) - (2*b^2*(50*a*b*B + b^2*(59*A - 3*C) + 3*a^2*(3*A + 5*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*(16*A*b^2 + 15*a*b*B + a^2*(3*A + 5*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) + (2*(8*A*b + 5*a*B)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(15*d*cos(c + d*x)^(3/2)) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 8, (-2*(3*a^4*B + 30*a^2*b^2*B - 5*b^4*B + 20*a*b^3*(A - C) + 4*a^3*b*(3*A + 5*C))*Elliptic.E((c + d*x)/2, 2))/(5*d) + (2*(28*a^3*b*B + 84*a*b^3*B + 7*b^4*(3*A + C) + 42*a^2*b^2*(A + 3*C) + a^4*(5*A + 7*C))*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a*(192*A*b^3 + 63*a^3*B + 413*a*b^2*B + a^2*(202*A*b + 350*b*C))*sin(c + d*x))/(105*d*sqrt(cos(c + d*x))) - (2*b^2*(98*a*b*B + b^2*(87*A - 35*C) + 5*a^2*(5*A + 7*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(105*d) + (2*(48*A*b^2 + 77*a*b*B + 5*a^2*(5*A + 7*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (2*(8*A*b + 7*a*B)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [((a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 8, (-2*(36*a^3*b*B + 60*a*b^3*B + 15*b^4*(A - C) + 18*a^2*b^2*(3*A + 5*C) + a^4*(7*A + 9*C))*Elliptic.E((c + d*x)/2, 2))/(15*d) + (2*(5*a^4*B + 42*a^2*b^2*B + 21*b^4*B + 28*a*b^3*(A + 3*C) + 4*a^3*b*(5*A + 7*C))*Elliptic.F((c + d*x)/2, 2))/(21*d) + (2*a*(64*A*b^3 + 75*a^3*B + 261*a*b^2*B + a^2*(202*A*b + 294*b*C))*sin(c + d*x))/(315*d*cos(c + d*x)^(3/2)) + (2*(192*A*b^4 + 756*a^3*b*B + 1098*a*b^3*B + 21*a^4*(7*A + 9*C) + 7*a^2*b^2*(155*A + 261*C))*sin(c + d*x))/(315*d*sqrt(cos(c + d*x))) + (2*(48*A*b^2 + 117*a*b*B + 7*a^2*(7*A + 9*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)) + (2*(8*A*b + 9*a*B)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2)) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]
    @test_int [((a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(13/2), x, 9, (-2*(7*a^4*B + 54*a^2*b^2*B + 15*b^4*B + 12*a*b^3*(3*A + 5*C) + 4*a^3*b*(7*A + 9*C))*Elliptic.E((c + d*x)/2, 2))/(15*d) + (2*(220*a^3*b*B + 308*a*b^3*B + 77*b^4*(A + 3*C) + 66*a^2*b^2*(5*A + 7*C) + 5*a^4*(9*A + 11*C))*Elliptic.F((c + d*x)/2, 2))/(231*d) + (2*a*(192*A*b^3 + 539*a^3*B + 1353*a*b^2*B + 2*a^2*b*(673*A + 891*C))*sin(c + d*x))/(3465*d*cos(c + d*x)^(5/2)) + (2*(64*A*b^4 + 660*a^3*b*B + 682*a*b^3*B + 15*a^4*(9*A + 11*C) + 9*a^2*b^2*(101*A + 143*C))*sin(c + d*x))/(693*d*cos(c + d*x)^(3/2)) + (2*(7*a^4*B + 54*a^2*b^2*B + 15*b^4*B + 12*a*b^3*(3*A + 5*C) + 4*a^3*b*(7*A + 9*C))*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*(16*A*b^2 + 55*a*b*B + 3*a^2*(9*A + 11*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(231*d*cos(c + d*x)^(7/2)) + (2*(8*A*b + 11*a*B)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(99*d*cos(c + d*x)^(9/2)) + (2*A*(a + b*cos(c + d*x))^4*sin(c + d*x))/(11*d*cos(c + d*x)^(11/2))]

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

    @test_int [cos(c + d*x)^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 8, (2*(5*a^2*b*B + 3*b^3*B - 5*a^3*C - a*b^2*(5*A + 3*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*b^4*d) - (2*(21*a^3*b*B + 7*a*b^3*B - 21*a^4*C - 7*a^2*b^2*(3*A + C) - b^4*(7*A + 5*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*b^5*d) - (2*a^3*(A*b^2 - a*(b*B - a*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^5*(a + b)*d) + (2*(7*A*b^2 - 7*a*b*B + 7*a^2*C + 5*b^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(21*b^3*d) + (2*(b*B - a*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*b^2*d) + (2*C*cos(c + d*x)^(5/2)*sin(c + d*x))/(7*b*d)]
    @test_int [cos(c + d*x)^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 7, (2*(5*A*b^2 - 5*a*b*B + 5*a^2*C + 3*b^2*C)*Elliptic.E((1/2)*(c + d*x), 2))/(5*b^3*d) + (2*(3*a^2*b*B + b^3*B - 3*a^3*C - a*b^2*(3*A + C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^4*d) + (2*a^2*(A*b^2 - a*(b*B - a*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^4*(a + b)*d) + (2*(b*B - a*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b^2*d) + (2*C*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*b*d)]
    @test_int [cos(c + d*x)^(1/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 6, (2*(b*B - a*C)*Elliptic.E((1/2)*(c + d*x), 2))/(b^2*d) + (2*(b^2*(3*A + C) - 3*a*(b*B - a*C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^3*d) - (2*a*(A*b^2 - a*(b*B - a*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^3*(a + b)*d) + (2*C*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 5, (2*C*Elliptic.E((1/2)*(c + d*x), 2))/(b*d) + (2*(b*B - a*C)*Elliptic.F((1/2)*(c + d*x), 2))/(b^2*d) + (2*(A*b^2 - a*(b*B - a*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(b^2*(a + b)*d)]
    @test_int [cos(c + d*x)^(-3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 6, -((2*A*Elliptic.E((1/2)*(c + d*x), 2))/(a*d)) + (2*C*Elliptic.F((1/2)*(c + d*x), 2))/(b*d) - (2*(A*b^2 - a*(b*B - a*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a*b*(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) + C*cos(c + d*x)^2)/(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*(A*b^2 - a*(b*B - a*C))*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)^(-7/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 8, -((2*(5*A*b^2 - 5*a*b*B + a^2*(3*A + 5*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*a^3*d)) - (2*(A*b - a*B)*Elliptic.F((1/2)*(c + d*x), 2))/(3*a^2*d) - (2*b*(A*b^2 - a*(b*B - a*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^3*(a + b)*d) + (2*A*sin(c + d*x))/(5*a*d*cos(c + d*x)^(5/2)) - (2*(A*b - a*B)*sin(c + d*x))/(3*a^2*d*cos(c + d*x)^(3/2)) + (2*(5*A*b^2 - 5*a*b*B + a^2*(3*A + 5*C))*sin(c + d*x))/(5*a^3*d*sqrt(cos(c + d*x)))]
    @test_int [cos(c + d*x)^(-9/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x)), x, 9, (2*(5*A*b^3 - 3*a^3*B - 5*a*b^2*B + a^2*b*(3*A + 5*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*a^4*d) + (2*(7*A*b^2 - 7*a*b*B + a^2*(5*A + 7*C))*Elliptic.F((1/2)*(c + d*x), 2))/(21*a^3*d) + (2*b^2*(A*b^2 - a*(b*B - a*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^4*(a + b)*d) + (2*A*sin(c + d*x))/(7*a*d*cos(c + d*x)^(7/2)) - (2*(A*b - a*B)*sin(c + d*x))/(5*a^2*d*cos(c + d*x)^(5/2)) + (2*(7*A*b^2 - 7*a*b*B + a^2*(5*A + 7*C))*sin(c + d*x))/(21*a^3*d*cos(c + d*x)^(3/2)) - (2*(5*A*b^3 - 3*a^3*B - 5*a*b^2*B + a^2*b*(3*A + 5*C))*sin(c + d*x))/(5*a^4*d*sqrt(cos(c + d*x)))]

    @test_int [cos(c + d*x)^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 8, -(((25*a^3*b*B - 20*a*b^3*B - 3*a^2*b^2*(5*A - 8*C) - 35*a^4*C + 2*b^4*(5*A + 3*C))*Elliptic.E((1/2)*(c + d*x), 2))/(5*b^4*(a^2 - b^2)*d)) + ((15*a^4*b*B - 16*a^2*b^3*B - 2*b^5*B - a^3*b^2*(9*A - 20*C) - 21*a^5*C + 4*a*b^4*(3*A + C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^5*(a^2 - b^2)*d) - (a^2*(5*A*b^4 + 5*a^3*b*B - 7*a*b^3*B - 3*a^2*b^2*(A - 3*C) - 7*a^4*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/((a - b)*b^5*(a + b)^2*d) + ((5*a^2*b*B - 2*b^3*B - a*b^2*(3*A - 4*C) - 7*a^3*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b^3*(a^2 - b^2)*d) + ((5*A*b^2 - 5*a*b*B + 7*a^2*C - 2*b^2*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(5*b^2*(a^2 - b^2)*d) - ((A*b^2 - a*(b*B - a*C))*cos(c + d*x)^(5/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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 7, ((3*a^2*b*B - 2*b^3*B - a*b^2*(A - 4*C) - 5*a^3*C)*Elliptic.E((1/2)*(c + d*x), 2))/(b^3*(a^2 - b^2)*d) - ((9*a^3*b*B - 12*a*b^3*B - a^2*b^2*(3*A - 16*C) - 15*a^4*C + 2*b^4*(3*A + C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*b^4*(a^2 - b^2)*d) + (a*(3*A*b^4 + 3*a^3*b*B - 5*a*b^3*B - a^2*b^2*(A - 7*C) - 5*a^4*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/((a - b)*b^4*(a + b)^2*d) + ((3*A*b^2 - 3*a*b*B + 5*a^2*C - 2*b^2*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d) - ((A*b^2 - a*(b*B - a*C))*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)^(1/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 6, ((A*b^2 - a*b*B + 3*a^2*C - 2*b^2*C)*Elliptic.E((1/2)*(c + d*x), 2))/(b^2*(a^2 - b^2)*d) + ((a^2*b*B - 2*b^3*B - 3*a^3*C + a*b^2*(A + 4*C))*Elliptic.F((1/2)*(c + d*x), 2))/(b^3*(a^2 - b^2)*d) - ((A*b^4 + a^3*b*B - 3*a*b^3*B - 3*a^4*C + a^2*b^2*(A + 5*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/((a - b)*b^3*(a + b)^2*d) - ((A*b^2 - a*(b*B - a*C))*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 6, -(((A*b^2 - a*(b*B - a*C))*Elliptic.E((1/2)*(c + d*x), 2))/(a*b*(a^2 - b^2)*d)) - ((A*b^2 - a*b*B - a^2*C + 2*b^2*C)*Elliptic.F((1/2)*(c + d*x), 2))/(b^2*(a^2 - b^2)*d) - ((A*b^4 + a^3*b*B + a*b^3*B + a^4*C - 3*a^2*b^2*(A + C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a*(a - b)*b^2*(a + b)^2*d) + ((A*b^2 - a*(b*B - a*C))*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 7, ((3*A*b^2 - a*b*B - a^2*(2*A - C))*Elliptic.E((1/2)*(c + d*x), 2))/(a^2*(a^2 - b^2)*d) + ((A*b^2 - a*(b*B - a*C))*Elliptic.F((1/2)*(c + d*x), 2))/(a*b*(a^2 - b^2)*d) + ((3*A*b^4 + 3*a^3*b*B - a*b^3*B - a^4*C - a^2*b^2*(5*A + C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^2*(a - b)*b*(a + b)^2*d) - ((3*A*b^2 - a*b*B - a^2*(2*A - C))*sin(c + d*x))/(a^2*(a^2 - b^2)*d*sqrt(cos(c + d*x))) + ((A*b^2 - a*(b*B - a*C))*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 8, -(((5*A*b^3 + 2*a^3*B - 3*a*b^2*B - a^2*b*(4*A - C))*Elliptic.E((1/2)*(c + d*x), 2))/(a^3*(a^2 - b^2)*d)) - ((5*A*b^2 - 3*a*b*B - a^2*(2*A - 3*C))*Elliptic.F((1/2)*(c + d*x), 2))/(3*a^2*(a^2 - b^2)*d) - ((5*A*b^4 + 5*a^3*b*B - 3*a*b^3*B - a^2*b^2*(7*A - C) - 3*a^4*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(a^3*(a - b)*(a + b)^2*d) - ((5*A*b^2 - 3*a*b*B - a^2*(2*A - 3*C))*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d*cos(c + d*x)^(3/2)) + ((5*A*b^3 + 2*a^3*B - 3*a*b^2*B - a^2*b*(4*A - C))*sin(c + d*x))/(a^3*(a^2 - b^2)*d*sqrt(cos(c + d*x))) + ((A*b^2 - a*(b*B - a*C))*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)^(7/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 9, -(((175*a^5*b*B - 325*a^3*b^3*B + 120*a*b^5*B + a^2*b^4*(145*A - 192*C) - 3*a^4*b^2*(25*A - 187*C) - 315*a^6*C - 8*b^6*(5*A + 3*C))*Elliptic.E((1/2)*(c + d*x), 2))/(20*b^5*(a^2 - b^2)^2*d)) + ((105*a^6*b*B - 223*a^4*b^3*B + 128*a^2*b^5*B + 8*b^7*B + 3*a^3*b^4*(33*A - 64*C) - 9*a^5*b^2*(5*A - 43*C) - 189*a^7*C - 24*a*b^6*(3*A + C))*Elliptic.F((1/2)*(c + d*x), 2))/(12*b^6*(a^2 - b^2)^2*d) + (a^2*(35*A*b^6 - 35*a^5*b*B + 86*a^3*b^3*B - 63*a*b^5*B - a^2*b^4*(38*A - 99*C) + 15*a^4*b^2*(A - 10*C) + 63*a^6*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*(a - b)^2*b^6*(a + b)^3*d) + ((35*a^4*b*B - 61*a^2*b^3*B + 8*b^5*B + 3*a*b^4*(11*A - 8*C) - 15*a^3*b^2*(A - 7*C) - 63*a^5*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(12*b^4*(a^2 - b^2)^2*d) - ((35*a^3*b*B - 65*a*b^3*B - a^2*b^2*(15*A - 101*C) + b^4*(45*A - 8*C) - 63*a^4*C)*cos(c + d*x)^(3/2)*sin(c + d*x))/(20*b^3*(a^2 - b^2)^2*d) - ((A*b^2 - a*(b*B - a*C))*cos(c + d*x)^(7/2)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + ((7*A*b^4 + 5*a^3*b*B - 11*a*b^3*B - a^2*b^2*(A - 15*C) - 9*a^4*C)*cos(c + d*x)^(5/2)*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)^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 8, ((15*a^4*b*B - 29*a^2*b^3*B + 8*b^5*B - a^3*b^2*(3*A - 65*C) + 3*a*b^4*(3*A - 8*C) - 35*a^5*C)*Elliptic.E((1/2)*(c + d*x), 2))/(4*b^4*(a^2 - b^2)^2*d) - ((45*a^5*b*B - 99*a^3*b^3*B + 72*a*b^5*B - a^4*b^2*(9*A - 223*C) + a^2*b^4*(15*A - 128*C) - 105*a^6*C - 8*b^6*(3*A + C))*Elliptic.F((1/2)*(c + d*x), 2))/(12*b^5*(a^2 - b^2)^2*d) - (a*(15*A*b^6 - 15*a^5*b*B + 38*a^3*b^3*B - 35*a*b^5*B + a^4*b^2*(3*A - 86*C) - 3*a^2*b^4*(2*A - 21*C) + 35*a^6*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*(a - b)^2*b^5*(a + b)^3*d) - ((15*a^3*b*B - 33*a*b^3*B - a^2*b^2*(3*A - 61*C) + b^4*(21*A - 8*C) - 35*a^4*C)*sqrt(cos(c + d*x))*sin(c + d*x))/(12*b^3*(a^2 - b^2)^2*d) - ((A*b^2 - a*(b*B - a*C))*cos(c + d*x)^(5/2)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + ((5*A*b^4 + 3*a^3*b*B - 9*a*b^3*B - 7*a^4*C + a^2*b^2*(A + 13*C))*cos(c + d*x)^(3/2)*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 7, -(((3*a^3*b*B - 9*a*b^3*B + b^4*(5*A - 8*C) - 15*a^4*C + a^2*b^2*(A + 29*C))*Elliptic.E((1/2)*(c + d*x), 2))/(4*b^3*(a^2 - b^2)^2*d)) + ((3*a^4*b*B - 5*a^2*b^3*B + 8*b^5*B - 15*a^5*C - a*b^4*(7*A + 24*C) + a^3*b^2*(A + 33*C))*Elliptic.F((1/2)*(c + d*x), 2))/(4*b^4*(a^2 - b^2)^2*d) + ((3*A*b^6 - 3*a^5*b*B + 6*a^3*b^3*B - 15*a*b^5*B + 15*a^6*C + 5*a^2*b^4*(2*A + 7*C) - a^4*b^2*(A + 38*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*(a - b)^2*b^4*(a + b)^3*d) - ((A*b^2 - a*(b*B - a*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) + ((3*A*b^4 + a^3*b*B - 7*a*b^3*B - 5*a^4*C + a^2*b^2*(3*A + 11*C))*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)^(1/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 7, ((A*b^4 - a^3*b*B - 5*a*b^3*B - 3*a^4*C + a^2*b^2*(5*A + 9*C))*Elliptic.E((1/2)*(c + d*x), 2))/(4*a*b^2*(a^2 - b^2)^2*d) + ((a^3*b*B - 7*a*b^3*B + a^2*b^2*(3*A - 5*C) + 3*a^4*C + b^4*(3*A + 8*C))*Elliptic.F((1/2)*(c + d*x), 2))/(4*b^3*(a^2 - b^2)^2*d) + ((A*b^6 - a^5*b*B + 10*a^3*b^3*B + 3*a*b^5*B - 3*a^4*b^2*(A - 2*C) - 3*a^6*C - 5*a^2*b^4*(2*A + 3*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a*(a - b)^2*b^3*(a + b)^3*d) - ((A*b^2 - a*(b*B - a*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((A*b^4 - a^3*b*B - 5*a*b^3*B - 3*a^4*C + a^2*b^2*(5*A + 9*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(4*a*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 7, ((3*A*b^4 + 5*a^3*b*B + a*b^3*B - a^4*C - a^2*b^2*(9*A + 5*C))*Elliptic.E((1/2)*(c + d*x), 2))/(4*a^2*b*(a^2 - b^2)^2*d) + ((A*b^4 + 3*a^3*b*B + 3*a*b^3*B + a^4*C - 7*a^2*b^2*(A + C))*Elliptic.F((1/2)*(c + d*x), 2))/(4*a*b^2*(a^2 - b^2)^2*d) + ((3*A*b^6 - 3*a^5*b*B - 10*a^3*b^3*B + a*b^5*B - 3*a^2*b^4*(2*A - C) - a^6*C + 5*a^4*b^2*(3*A + 2*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a^2*(a - b)^2*b^2*(a + b)^3*d) + ((A*b^2 - a*(b*B - a*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((3*A*b^4 + 5*a^3*b*B + a*b^3*B - a^4*C - a^2*b^2*(9*A + 5*C))*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 8, -(((15*A*b^4 + 9*a^3*b*B - 3*a*b^3*B + a^4*(8*A - 5*C) - a^2*b^2*(29*A + C))*Elliptic.E((1/2)*(c + d*x), 2))/(4*a^3*(a^2 - b^2)^2*d)) - ((5*A*b^4 + 7*a^3*b*B - a*b^3*B - 3*a^4*C - a^2*b^2*(11*A + 3*C))*Elliptic.F((1/2)*(c + d*x), 2))/(4*a^2*b*(a^2 - b^2)^2*d) - ((15*A*b^6 - 15*a^5*b*B + 6*a^3*b^3*B - 3*a*b^5*B + 3*a^6*C - a^2*b^4*(38*A + C) + 5*a^4*b^2*(7*A + 2*C))*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a^3*(a - b)^2*b*(a + b)^3*d) + ((15*A*b^4 + 9*a^3*b*B - 3*a*b^3*B + a^4*(8*A - 5*C) - a^2*b^2*(29*A + C))*sin(c + d*x))/(4*a^3*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))) + ((A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(2*a*(a^2 - b^2)*d*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^2) - ((5*A*b^4 + 7*a^3*b*B - a*b^3*B - 3*a^4*C - a^2*b^2*(11*A + 3*C))*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) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^3, x, 9, ((35*A*b^5 - 8*a^5*B + 29*a^3*b^2*B - 15*a*b^4*B + 3*a^4*b*(8*A - 3*C) - a^2*b^3*(65*A - 3*C))*Elliptic.E((1/2)*(c + d*x), 2))/(4*a^4*(a^2 - b^2)^2*d) + ((35*A*b^4 + 33*a^3*b*B - 15*a*b^3*B + a^4*(8*A - 21*C) - a^2*b^2*(61*A - 3*C))*Elliptic.F((1/2)*(c + d*x), 2))/(12*a^3*(a^2 - b^2)^2*d) + ((35*A*b^6 - 35*a^5*b*B + 38*a^3*b^3*B - 15*a*b^5*B - a^2*b^4*(86*A - 3*C) + 3*a^4*b^2*(21*A - 2*C) + 15*a^6*C)*Elliptic.Pi((2*b)/(a + b), (1/2)*(c + d*x), 2))/(4*a^4*(a - b)^2*(a + b)^3*d) + ((35*A*b^4 + 33*a^3*b*B - 15*a*b^3*B + a^4*(8*A - 21*C) - a^2*b^2*(61*A - 3*C))*sin(c + d*x))/(12*a^3*(a^2 - b^2)^2*d*cos(c + d*x)^(3/2)) - ((35*A*b^5 - 8*a^5*B + 29*a^3*b^2*B - 15*a*b^4*B + 3*a^4*b*(8*A - 3*C) - a^2*b^3*(65*A - 3*C))*sin(c + d*x))/(4*a^4*(a^2 - b^2)^2*d*sqrt(cos(c + d*x))) + ((A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(2*a*(a^2 - b^2)*d*cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^2) - ((7*A*b^4 + 9*a^3*b*B - 3*a*b^3*B - 5*a^4*C - a^2*b^2*(13*A + C))*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)))]

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

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

    @test_int [sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 8, -((a - b)*sqrt(a + b)*(8*b^2*(3*A + 2*C) + 3*a*(2*b*B - a*C))*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)*(24*A*b^2 + (a + 2*b)*(6*b*B - 3*a*C + 8*b*C))*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*b*B - 8*b^3*B - a^3*C - 4*a*b^2*(2*A + C))*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) + ((8*b^2*(3*A + 2*C) + 3*a*(2*b*B - a*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*b^2*d*sqrt(cos(c + d*x))) + ((2*b*B - a*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*b*d)]
    @test_int [(sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 7, -((a - b)*sqrt(a + b)*(4*b*B + a*C)*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)*(8*A*b + a*C + 2*b*(2*B + C))*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)*(8*A*b^2 + 4*a*b*B - a^2*C + 4*b^2*C)*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*b*B + a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b*d*sqrt(cos(c + d*x))) + (C*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d)]
    @test_int [(sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 7, ((a - b)*sqrt(a + b)*(2*A - C)*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 - a*(2*A - 2*B - C))*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) - (sqrt(a + b)*(2*b*B + a*C)*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) + (2*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - ((2*A - C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [(sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 6, (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*sqrt(a + b)*(b*(A - 3*B) - a*(A - 3*B + 3*C))*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*sqrt(a + b)*C*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*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [(sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 5, (-2*(a - b)*sqrt(a + b)*(2*A*b^2 - 5*a*b*B - 3*a^2*(3*A + 5*C))*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)*(2*A*b + a*(9*A - 5*B + 15*C))*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 [(sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 6, (2*(a - b)*sqrt(a + b)*(8*A*b^3 + 63*a^3*B - 14*a*b^2*B + a^2*b*(19*A + 35*C))*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 + 2*a*b*(3*A - 7*B) + a^2*(25*A - 63*B + 35*C))*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*(4*A*b^2 - 7*a*b*B - 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*a^2*d*cos(c + d*x)^(3/2))]

    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 9, -((a - b)*sqrt(a + b)*(24*a^2*b*B + 128*b^3*B - 9*a^3*C + 12*a*b^2*(20*A + 13*C))*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*C - 6*a^2*b*(4*B + C) - 8*b^3*(12*A + 16*B + 9*C) - 4*a*b^2*(60*A + 28*B + 39*C))*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*b*B - 96*a*b^3*B - 3*a^4*C - 24*a^2*b^2*(2*A + C) - 16*b^4*(4*A + 3*C))*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*b*B + 128*b^3*B - 9*a^3*C + 12*a*b^2*(20*A + 13*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(192*b^2*d*sqrt(cos(c + d*x))) + ((4*b^2*(4*A + 3*C) + a*(8*b*B - 3*a*C))*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*b*d) + ((8*b*B - 3*a*C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*b*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*b*d)]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 8, -((a - b)*sqrt(a + b)*(24*A*b^2 + 30*a*b*B + 3*a^2*C + 16*b^2*C)*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)*(3*a^2*C + 4*b^2*(6*A + 3*B + 4*C) + 2*a*b*(24*A + 15*B + 7*C))*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*b*B + 8*b^3*B - a^3*C + 12*a*b^2*(2*A + C))*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) + ((24*A*b^2 + 30*a*b*B + 3*a^2*C + 16*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*b*d*sqrt(cos(c + d*x))) + ((2*b*B + a*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(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) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 8, ((a - b)*sqrt(a + b)*(8*a*A - 4*b*B - 5*a*C)*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)*(a*(8*A - 8*B - 5*C) - 2*b*(8*A + 2*B + C))*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)*(8*A*b^2 + 12*a*b*B + 3*a^2*C + 4*b^2*C)*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) - ((8*a*A - 4*b*B - 5*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(cos(c + d*x))) - (b*(4*A - C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d) + (2*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 8, ((a - b)*sqrt(a + b)*(8*A*b + 6*a*B - 3*b*C)*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)*(6*A*b^2 + 2*a^2*(A - 3*B + 3*C) - a*b*(8*A - 3*(4*B + C)))*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) - (sqrt(a + b)*(2*b*B + 3*a*C)*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*b + a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(d*sqrt(cos(c + d*x))) - ((8*A*b + 6*a*B - 3*b*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 7, (2*(a - b)*sqrt(a + b)*(3*A*b^2 + 20*a*b*B + 3*a^2*(3*A + 5*C))*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*sqrt(a + b)*(3*b^2*(A - 5*B) - 2*a*b*(6*A - 10*B + 15*C) + a^2*(9*A - 5*B + 15*C))*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*sqrt(a + b)*C*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*(3*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 + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 6, (-2*(a - b)*sqrt(a + b)*(6*A*b^3 - 63*a^3*B - 21*a*b^2*B - 2*a^2*b*(41*A + 70*C))*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 + 35*C) + 3*a*b*(19*A - 7*B + 35*C))*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*(3*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*(3*A*b^2 + 42*a*b*B + 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*a*d*cos(c + d*x)^(3/2)) + (2*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [((a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 7, (2*(a - b)*sqrt(a + b)*(8*A*b^4 + 246*a^3*b*B - 18*a*b^3*B + 21*a^4*(7*A + 9*C) + 3*a^2*b^2*(11*A + 21*C))*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 + 6*a*b^2*(A - 3*B) + 3*a^2*b*(13*A - 57*B + 21*C) - 3*a^3*(49*A - 25*B + 63*C))*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*b + 3*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(21*d*cos(c + d*x)^(7/2)) + (2*(3*A*b^2 + 72*a*b*B + 7*a^2*(7*A + 9*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*a*d*cos(c + d*x)^(5/2)) - (2*(4*A*b^3 - 75*a^3*B - 9*a*b^2*B - 2*a^2*b*(44*A + 63*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*a^2*d*cos(c + d*x)^(3/2)) + (2*A*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]

    @test_int [sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2), x, 10, -((a - b)*sqrt(a + b)*(150*a^3*b*B + 2840*a*b^3*B - 45*a^4*C + 256*b^4*(5*A + 4*C) + 12*a^2*b^2*(220*A + 141*C))*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*C - 30*a^3*b*(5*B + C) - 16*b^4*(80*A + 45*B + 64*C) - 8*a*b^3*(260*A + 355*B + 193*C) - 4*a^2*b^2*(660*A + 295*B + 423*C))*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*b*B - 240*a^2*b^3*B - 96*b^5*B - 3*a^5*C - 40*a^3*b^2*(2*A + C) - 80*a*b^4*(4*A + 3*C))*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*b*B + 2840*a*b^3*B - 45*a^4*C + 256*b^4*(5*A + 4*C) + 12*a^2*b^2*(220*A + 141*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(1920*b^2*d*sqrt(cos(c + d*x))) + ((50*a^2*b*B + 120*b^3*B - 15*a^3*C + 4*a*b^2*(60*A + 43*C))*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(320*b*d) + ((80*A*b^2 + 50*a*b*B - 15*a^2*C + 64*b^2*C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(240*b*d) + ((10*b*B - 3*a*C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(40*b*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(5*b*d)]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(cos(c + d*x)), x, 9, -((a - b)*sqrt(a + b)*(264*a^2*b*B + 128*b^3*B + 15*a^3*C + 4*a*b^2*(108*A + 71*C))*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*C + 8*b^3*(12*A + 16*B + 9*C) + 2*a^2*b*(192*A + 132*B + 59*C) + 4*a*b^2*(108*A + 52*B + 71*C))*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*b*B + 160*a*b^3*B - 5*a^4*C + 120*a^2*b^2*(2*A + C) + 16*b^4*(4*A + 3*C))*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*b*B + 128*b^3*B + 15*a^3*C + 4*a*b^2*(108*A + 71*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(192*b*d*sqrt(cos(c + d*x))) + ((16*A*b^2 + 24*a*b*B + 5*a^2*C + 12*b^2*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*d) + ((8*b*B + 5*a*C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*d) + (C*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*d)]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(3/2), x, 9, -((a - b)*sqrt(a + b)*(54*a*b*B - a^2*(48*A - 33*C) + 8*b^2*(3*A + 2*C))*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)*(a^2*(48*A - 48*B - 33*C) - 4*b^2*(6*A + 3*B + 4*C) - 2*a*b*(72*A + 27*B + 13*C))*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*b*B + 8*b^3*B + 5*a^3*C + 20*a*b^2*(2*A + C))*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*b*B - a^2*(48*A - 33*C) + 8*b^2*(3*A + 2*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*d*sqrt(cos(c + d*x))) - (b*(8*a*A - 2*b*B - 3*a*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d) - (b*(6*A - C)*sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(d*sqrt(cos(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(5/2), x, 9, ((a - b)*sqrt(a + b)*(24*a^2*B - 12*b^2*B + a*b*(56*A - 27*C))*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)))/(12*a*d) - (sqrt(a + b)*(a*b*(56*A - 72*B - 27*C) - 6*b^2*(12*A + 2*B + C) - 8*a^2*(A - 3*B + 3*C))*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)))/(12*d) - (sqrt(a + b)*(8*A*b^2 + 20*a*b*B + 15*a^2*C + 4*b^2*C)*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) - ((24*a^2*B - 12*b^2*B + a*b*(56*A - 27*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(12*d*sqrt(cos(c + d*x))) - (b*(8*A*b + 4*a*B - b*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d) + (2*(5*A*b + 3*a*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(cos(c + d*x))) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2))]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(7/2), x, 9, ((a - b)*sqrt(a + b)*(70*a*b*B + b^2*(46*A - 15*C) + 6*a^2*(3*A + 5*C))*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) + (sqrt(a + b)*(30*A*b^3 - 2*a^3*(9*A - 5*B + 15*C) + 2*a^2*b*(17*A - 35*B + 45*C) - a*b^2*(46*A - 15*(6*B + C)))*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) - (b*sqrt(a + b)*(2*b*B + 5*a*C)*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*(5*A*b^2 + 10*a*b*B + a^2*(3*A + 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*d*sqrt(cos(c + d*x))) - ((70*a*b*B + b^2*(46*A - 15*C) + 6*a^2*(3*A + 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*d*sqrt(cos(c + d*x))) + (2*(A*b + a*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*cos(c + d*x)^(3/2)) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(5*d*cos(c + d*x)^(5/2))]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(9/2), x, 8, (2*(a - b)*sqrt(a + b)*(15*A*b^3 + 63*a^3*B + 161*a*b^2*B + 5*a^2*b*(29*A + 49*C))*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*sqrt(a + b)*(15*b^3*(A - 7*B) - a^3*(25*A - 63*B + 35*C) + a^2*b*(145*A - 119*B + 245*C) - a*b^2*(135*A - 161*B + 315*C))*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*b^2*sqrt(a + b)*C*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*(15*A*b^2 + 56*a*b*B + 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*d*cos(c + d*x)^(3/2)) + (2*(5*A*b + 7*a*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(35*d*cos(c + d*x)^(5/2)) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(7*d*cos(c + d*x)^(7/2))]
    @test_int [((a + b*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d*x)^(11/2), x, 7, (-2*(a - b)*sqrt(a + b)*(10*A*b^4 - 435*a^3*b*B - 45*a*b^3*B - 21*a^4*(7*A + 9*C) - 3*a^2*b^2*(93*A + 161*C))*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 + 15*a*b^2*(11*A - 3*B + 21*C) - 6*a^2*b*(19*A - 60*B + 28*C) + 3*a^3*(49*A - 25*B + 63*C))*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*(15*A*b^2 + 90*a*b*B + 7*a^2*(7*A + 9*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*d*cos(c + d*x)^(5/2)) + (2*(5*A*b^3 + 75*a^3*B + 135*a*b^2*B + a^2*b*(163*A + 231*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(315*a*d*cos(c + d*x)^(3/2)) + (2*(5*A*b + 9*a*B)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(63*d*cos(c + d*x)^(7/2)) + (2*A*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(9*d*cos(c + d*x)^(9/2))]

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

    @test_int [(cos(c + d*x)^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(a + b*cos(c + d*x)), x, 8, -((a - b)*sqrt(a + b)*(24*A*b^2 - 18*a*b*B + 15*a^2*C + 16*b^2*C)*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^3*d) + (sqrt(a + b)*(24*A*b^2 - 18*a*b*B + 12*b^2*B + 15*a^2*C - 10*a*b*C + 16*b^2*C)*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^3*d) - (sqrt(a + b)*(6*a^2*b*B + 8*b^3*B - 5*a^3*C - 4*a*b^2*(2*A + C))*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^4*d) + ((24*A*b^2 - 18*a*b*B + 15*a^2*C + 16*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(24*b^3*d*sqrt(cos(c + d*x))) + ((6*b*B - 5*a*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(12*b^2*d) + (C*cos(c + d*x)^(3/2)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b*d)]
    @test_int [(sqrt(cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(a + b*cos(c + d*x)), x, 7, -((a - b)*sqrt(a + b)*(4*b*B - 3*a*C)*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)*(3*a*C - 2*b*(2*B + C))*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)*(8*A*b^2 - 4*a*b*B + 3*a^2*C + 4*b^2*C)*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*b*B - 3*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b^2*d*sqrt(cos(c + d*x))) + (C*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*b*d)]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))), x, 6, -(((a - b)*sqrt(a + b)*C*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)*(2*A*b + a*C)*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*d) - (sqrt(a + b)*(2*b*B - a*C)*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) + (C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(b*d*sqrt(cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*sqrt(a + b*cos(c + d*x))), 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^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) - (2*sqrt(a + b)*C*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 [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*sqrt(a + b*cos(c + d*x))), 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 + 3*C))*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 [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(7/2)*sqrt(a + b*cos(c + d*x))), x, 5, (2*(a - b)*sqrt(a + b)*(8*A*b^2 - 10*a*b*B + 3*a^2*(3*A + 5*C))*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 - 2*a*b*(A + 5*B) + a^2*(9*A - 5*B + 15*C))*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 [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(9/2)*sqrt(a + b*cos(c + d*x))), x, 6, (-2*(a - b)*sqrt(a + b)*(48*A*b^3 - 63*a^3*B - 56*a*b^2*B + a^2*(44*A*b + 70*b*C))*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^5*d) + (2*sqrt(a + b)*(48*A*b^3 - 4*a*b^2*(3*A + 14*B) + a^3*(25*A - 63*B + 35*C) + 2*a^2*b*(22*A + 7*(B + 5*C)))*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^4*d) + (2*A*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(7*a*d*cos(c + d*x)^(7/2)) - (2*(6*A*b - 7*a*B)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(35*a^2*d*cos(c + d*x)^(5/2)) + (2*(24*A*b^2 - 28*a*b*B + 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(105*a^3*d*cos(c + d*x)^(3/2))]

    @test_int [(sqrt(cos(c + d*x))*(a*A + (A*b + a*B)*cos(c + d*x) + b*B*cos(c + d*x)^2))/sqrt(a + b*cos(c + d*x)), x, 8, -((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 [(a + a*cos(c + d*x) + 2*b*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))), x, 4, (-2*(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) + (4*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)))/d + (2*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) + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(3/2), x, 8, -((12*a^2*b*B - 4*b^3*B - a*b^2*(8*A - 7*C) - 15*a^3*C)*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^3*sqrt(a + b)*d) - ((8*A*b^2 - a*b*(12*B - 5*C) + 15*a^2*C - 2*b^2*(2*B + C))*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^3*sqrt(a + b)*d) - (sqrt(a + b)*(8*A*b^2 - 12*a*b*B + 15*a^2*C + 4*b^2*C)*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^4*d) - (2*(A*b^2 - a*(b*B - a*C))*cos(c + d*x)^(3/2)*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + ((12*a^2*b*B - 4*b^3*B - a*b^2*(8*A - 7*C) - 15*a^3*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b^3*(a^2 - b^2)*d*sqrt(cos(c + d*x))) + ((4*A*b^2 - 4*a*b*B + 5*a^2*C - b^2*C)*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d)]
    @test_int [(sqrt(cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(3/2), x, 7, -(((2*A*b^2 - 2*a*b*B + 3*a^2*C - b^2*C)*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^2 - a*(b*(2*B - C) - 3*a*C))*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^2*sqrt(a + b)*d) - (sqrt(a + b)*(2*b*B - 3*a*C)*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*b^2 - a*(b*B - a*C))*sqrt(cos(c + d*x))*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + ((2*A*b^2 - 2*a*b*B + 3*a^2*C - b^2*C)*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 [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(sqrt(cos(c + d*x))*(a + b*cos(c + d*x))^(3/2)), x, 6, (2*(A*b^2 - a*(b*B - a*C))*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*b*sqrt(a + b)*d) + (2*(A*b + b*B - a*C)*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)*C*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*b^2 - a*(b*B - a*C))*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^(3/2)), x, 4, -((2*(2*A*b^2 - a*b*B - a^2*(A - C))*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 - C))*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*(A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(cos(c + d*x))*sqrt(a + b*cos(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))^(3/2)), x, 5, (2*(8*A*b^3 + 3*a^3*B - 6*a*b^2*B - a^2*(5*A*b - 3*b*C))*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*(8*A*b^2 + 6*a*b*(A - B) + a^2*(A - 3*B + 3*C))*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*(A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(a*(a^2 - b^2)*d*cos(c + d*x)^(3/2)*sqrt(a + b*cos(c + d*x))) - (2*(4*A*b^2 - 3*a*b*B - a^2*(A - 3*C))*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 [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(7/2)*(a + b*cos(c + d*x))^(3/2)), x, 6, -((2*(48*A*b^4 + 25*a^3*b*B - 40*a*b^3*B - 6*a^2*b^2*(4*A - 5*C) - 3*a^4*(3*A + 5*C))*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^5*sqrt(a + b)*d)) - (2*(48*A*b^3 + 4*a*b^2*(9*A - 10*B) + 6*a^2*b*(2*A - 5*B + 5*C) + a^3*(9*A - 5*B + 15*C))*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^4*sqrt(a + b)*d) + (2*(A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(a*(a^2 - b^2)*d*cos(c + d*x)^(5/2)*sqrt(a + b*cos(c + d*x))) - (2*(6*A*b^2 - 5*a*b*B - a^2*(A - 5*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(5*a^2*(a^2 - b^2)*d*cos(c + d*x)^(5/2)) + (2*(24*A*b^3 + 5*a^3*B - 20*a*b^2*B - a^2*(9*A*b - 15*b*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(15*a^3*(a^2 - b^2)*d*cos(c + d*x)^(3/2))]

    @test_int [(cos(c + d*x)^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(5/2), x, 8, ((8*A*b^4 + 6*a^3*b*B - 14*a*b^3*B - 15*a^4*C + 26*a^2*b^2*C - 3*b^4*C)*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*b^4 - a*b^3*(2*A + 3*(4*B - C)) + a^3*b*(6*B - 5*C) - 15*a^4*C + a^2*b^2*(2*B + 21*C))*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^3*sqrt(a + b)*(a^2 - b^2)*d) - (sqrt(a + b)*(2*b*B - 5*a*C)*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*b^2 - a*(b*B - a*C))*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*(3*A*b^4 + 2*a^3*b*B - 6*a*b^3*B - 5*a^4*C + a^2*b^2*(A + 9*C))*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))) - ((8*A*b^4 + 6*a^3*b*B - 14*a*b^3*B - 15*a^4*C + 26*a^2*b^2*C - 3*b^4*C)*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 [(sqrt(cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/(a + b*cos(c + d*x))^(5/2), x, 7, -((2*(A*b^4 - 4*a*b^3*B - 3*a^4*C + a^2*b^2*(3*A + 7*C))*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*b^2*sqrt(a + b)*(a^2 - b^2)*d)) - (2*(b^3*(A + 3*B) + 3*a^3*C + a^2*b*C - a*b^2*(3*A + B + 6*C))*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^2*sqrt(a + b)*(a^2 - b^2)*d) - (2*sqrt(a + b)*C*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*b^2 - a*(b*B - a*C))*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*b^4 - 4*a*b^3*B - 3*a^4*C + a^2*b^2*(3*A + 7*C))*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 [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(sqrt(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 + 4*a^2*b*C)*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 - a^2*(3*A + 3*B + C) + a*b*(3*A + B + 3*C))*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*(A*b^2 - a*(b*B - a*C))*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*(2*A*b^3 + 3*a^3*B + a*b^2*B - 2*a^2*b*(3*A + 2*C))*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 [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(3/2)*(a + b*cos(c + d*x))^(5/2)), x, 5, (2*(8*A*b^4 + 6*a^3*b*B - 2*a*b^3*B + 3*a^4*(A - C) - a^2*b^2*(15*A + C))*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)*(a^2 - b^2)*d) + (2*(8*A*b^3 + 2*a*b^2*(3*A - B) - 3*a^3*(A - B - C) - a^2*b*(9*A + 3*B + C))*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*(A*b^2 - a*(b*B - a*C))*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*(4*A*b^4 + 5*a^3*b*B - a*b^3*B - 2*a^4*C - 2*a^2*b^2*(4*A + C))*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 [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(cos(c + d*x)^(5/2)*(a + b*cos(c + d*x))^(5/2)), x, 6, -((2*(16*A*b^5 - 3*a^5*B + 15*a^3*b^2*B - 8*a*b^4*B - 2*a^2*b^3*(14*A - C) + a^4*(8*A*b - 6*b*C))*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*sqrt(a + b)*(a^2 - b^2)*d)) - (2*(16*A*b^4 + 4*a*b^3*(3*A - 2*B) - 3*a^3*b*(3*A - 3*B - C) - 2*a^2*b^2*(8*A + 3*B - C) - a^4*(A - 3*B + 3*C))*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*(A*b^2 - a*(b*B - a*C))*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*(10*a^2*A*b^2 - 6*A*b^4 - 7*a^3*b*B + 3*a*b^3*B + 4*a^4*C)*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*(8*A*b^4 + 8*a^3*b*B - 4*a*b^3*B + a^4*(A - 5*C) - a^2*b^2*(13*A - C))*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))]

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

    @test_int [cos(c + d*x)^m*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2, x, 6, If(13>=8, ((2*a^2*C + b^2*C*(3 + m) + A*b^2*(4 + m) + 2*a*b*B*(4 + m))*cos(c + d*x)^(1 + m)*sin(c + d*x))/(d*(2 + m)*(4 + m)) + (b*(2*a*C + b*B*(4 + m))*cos(c + d*x)^(2 + m)*sin(c + d*x))/(d*(3 + m)*(4 + m)) + (C*cos(c + d*x)^(1 + m)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(d*(4 + m)) - ((2*a*b*B*(4 + 5*m + m^2) + a^2*(4 + m)*(C*(1 + m) + A*(2 + m)) + b^2*(1 + m)*(C*(3 + m) + A*(4 + m)))*cos(c + d*x)^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(1 + m)*(2 + m)*(4 + m)*sqrt(sin(c + d*x)^2)) - ((b^2*B*(2 + m) + a^2*B*(3 + m) + 2*a*b*(C*(2 + m) + A*(3 + m)))*cos(c + d*x)^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(2 + m)*(3 + m)*sqrt(sin(c + d*x)^2)), ((2*a^2*C + b^2*C*(3 + m) + A*b^2*(4 + m) + 2*a*b*B*(4 + m))*cos(c + d*x)^(1 + m)*sin(c + d*x))/(d*(2 + m)*(4 + m)) + (b*(2*a*C + b*B*(4 + m))*cos(c + d*x)^(2 + m)*sin(c + d*x))/(d*(3 + m)*(4 + m)) + (C*cos(c + d*x)^(1 + m)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(d*(4 + m)) - ((2*a*b*B*(4 + 5*m + m^2) + a^2*(4 + m)*(C*(1 + m) + A*(2 + m)) + b^2*(1 + m)*(C*(3 + m) + A*(4 + m)))*cos(c + d*x)^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(4 + m)*(2 + 3*m + m^2)*sqrt(sin(c + d*x)^2)) - ((b^2*B*(2 + m) + a^2*B*(3 + m) + 2*a*b*(C*(2 + m) + A*(3 + m)))*cos(c + d*x)^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(2 + m)*(3 + m)*sqrt(sin(c + d*x)^2)))]
    @test_int [cos(c + d*x)^m*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^1, x, 5, ((b*B + a*C)*cos(c + d*x)^(1 + m)*sin(c + d*x))/(d*(2 + m)) + (b*C*cos(c + d*x)^(2 + m)*sin(c + d*x))/(d*(3 + m)) - (((b*B + a*C)*(1 + m) + a*A*(2 + m))*cos(c + d*x)^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(1 + m)*(2 + m)*sqrt(sin(c + d*x)^2)) - ((b*C*(2 + m) + A*b*(3 + m) + a*B*(3 + m))*cos(c + d*x)^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(d*(2 + m)*(3 + m)*sqrt(sin(c + d*x)^2))]
    @test_int [cos(c + d*x)^m*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^1, x, 8, (a*(A*b^2 - a*(b*B - a*C))*AppellF1(1/2, (1 - m)/2, 1, 3/2, sin(c + d*x)^2, -((b^2*sin(c + d*x)^2)/(a^2 - b^2)))*cos(c + d*x)^(-1 + m)*(cos(c + d*x)^2)^((1 - m)/2)*sin(c + d*x))/(b^2*(a^2 - b^2)*d) - ((A*b^2 - a*(b*B - a*C))*AppellF1(1/2, -(m/2), 1, 3/2, sin(c + d*x)^2, -((b^2*sin(c + d*x)^2)/(a^2 - b^2)))*cos(c + d*x)^m*sin(c + d*x))/((cos(c + d*x)^2)^(m/2)*(b*(a^2 - b^2)*d)) - ((b*B - a*C)*cos(c + d*x)^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(b^2*d*(1 + m)*sqrt(sin(c + d*x)^2)) - (C*cos(c + d*x)^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(b*d*(2 + m)*sqrt(sin(c + d*x)^2))]
    @test_int [cos(c + d*x)^m*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(a + b*cos(c + d*x))^2, x, 9, ((A*b^4*m + a^3*b*B*m - a*b^3*B*(1 + m) - a^4*C*(1 + m) + a^2*b^2*(A - A*m + C*(2 + m)))*AppellF1(1/2, (1 - m)/2, 1, 3/2, sin(c + d*x)^2, -((b^2*sin(c + d*x)^2)/(a^2 - b^2)))*cos(c + d*x)^(-1 + m)*(cos(c + d*x)^2)^((1 - m)/2)*sin(c + d*x))/(b^2*(a^2 - b^2)^2*d) - ((A*b^4*m + a^3*b*B*m - a*b^3*B*(1 + m) - a^4*C*(1 + m) + a^2*b^2*(A - A*m + C*(2 + m)))*AppellF1(1/2, -(m/2), 1, 3/2, sin(c + d*x)^2, -((b^2*sin(c + d*x)^2)/(a^2 - b^2)))*cos(c + d*x)^m*sin(c + d*x))/((cos(c + d*x)^2)^(m/2)*(a*b*(a^2 - b^2)^2*d)) + ((A*b^2 - a*(b*B - a*C))*cos(c + d*x)^(1 + m)*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x))) + ((a*b*B*m - a^2*C*(1 + m) + b^2*(C - A*m))*cos(c + d*x)^(1 + m)*HypergeometricFunctions._₂F₁(1/2, (1 + m)/2, (3 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(b^2*(a^2 - b^2)*d*(1 + m)*sqrt(sin(c + d*x)^2)) + ((A*b^2 - a*(b*B - a*C))*(1 + m)*cos(c + d*x)^(2 + m)*HypergeometricFunctions._₂F₁(1/2, (2 + m)/2, (4 + m)/2, cos(c + d*x)^2)*sin(c + d*x))/(a*b*(a^2 - b^2)*d*(2 + m)*sqrt(sin(c + d*x)^2))]

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

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

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

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

    @test_int [(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 8, -((2*a*(3*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (2*a*(5*A + 7*C)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a*(3*A + 5*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a*(5*A + 7*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(21*d) + (2*a*A*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d) + (2*a*A*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 7, -((2*a*(3*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (2*a*(A + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*(3*A + 5*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a*A*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 6, -((2*a*(A - C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (2*a*(A + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*A*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 6, -((2*a*(A - C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (2*a*(3*A + C)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*C*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (2*a*A*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 6, (2*a*(5*A + 3*C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (2*a*(3*A + C)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*C*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*a*C*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 7, (2*a*(5*A + 3*C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (2*a*(7*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a*C*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*a*C*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*a*(7*A + 5*C)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 8, (2*a*(9*A + 7*C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(15*d) + (2*a*(7*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a*C*sin(c + d*x))/(9*d*sec(c + d*x)^(7/2)) + (2*a*C*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*a*(9*A + 7*C)*sin(c + d*x))/(45*d*sec(c + d*x)^(3/2)) + (2*a*(7*A + 5*C)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]

    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 10, (-16*a^2*(2*A + 3*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^2*(5*A + 7*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (16*a^2*(2*A + 3*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (4*a^2*(5*A + 7*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(21*d) + (2*a^2*(19*A + 21*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(105*d) + (8*A*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d) + (2*A*(a + a*cos(c + d*x))^2*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 9, (-4*a^2*(3*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (8*a^2*(3*A + 7*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (4*a^2*(3*A + 5*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a^2*(33*A + 35*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (8*A*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*A*(a + a*cos(c + d*x))^2*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 8, (-16*a^2*A*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^2*(A + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a^2*(17*A + 15*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (8*A*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*A*(a + a*cos(c + d*x))^2*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 8, (-4*a^2*(A - C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (8*a^2*(A + C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*a^2*(5*A - C)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (8*A*(a^2 + a^2*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + a*cos(c + d*x))^2*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 8, (16*a^2*C*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^2*(3*A + C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*a^2*(15*A - 7*C)*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) - (2*(5*A - C)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(5*d*sqrt(sec(c + d*x))) + (2*A*(a + a*cos(c + d*x))^2*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 8, (4*a^2*(5*A + 3*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (8*a^2*(7*A + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a^2*(35*A + 33*C)*sin(c + d*x))/(105*d*sqrt(sec(c + d*x))) + (2*C*(a + a*cos(c + d*x))^2*sin(c + d*x))/(7*d*sqrt(sec(c + d*x))) + (8*C*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(35*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 9, (16*a^2*(3*A + 2*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^2*(7*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a^2*(21*A + 19*C)*sin(c + d*x))/(105*d*sec(c + d*x)^(3/2)) + (2*C*(a + a*cos(c + d*x))^2*sin(c + d*x))/(9*d*sec(c + d*x)^(3/2)) + (8*C*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(63*d*sec(c + d*x)^(3/2)) + (4*a^2*(7*A + 5*C)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^2*(A + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 10, (4*a^2*(9*A + 7*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (8*a^2*(33*A + 25*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (2*a^2*(99*A + 89*C)*sin(c + d*x))/(693*d*sec(c + d*x)^(5/2)) + (2*C*(a + a*cos(c + d*x))^2*sin(c + d*x))/(11*d*sec(c + d*x)^(5/2)) + (8*C*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(99*d*sec(c + d*x)^(5/2)) + (4*a^2*(9*A + 7*C)*sin(c + d*x))/(45*d*sec(c + d*x)^(3/2)) + (8*a^2*(33*A + 25*C)*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]

    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(13/2), x, 11, (-4*a^3*(5*A + 7*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(105*A + 143*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (4*a^3*(5*A + 7*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (4*a^3*(105*A + 143*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(231*d) + (8*a^3*(35*A + 44*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(385*d) + (2*(35*A + 33*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(231*d) + (4*A*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^(9/2)*sin(c + d*x))/(33*a*d) + (2*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^(11/2)*sin(c + d*x))/(11*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 10, (-4*a^3*(17*A + 27*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^3*(11*A + 21*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (4*a^3*(17*A + 27*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (8*a^3*(16*A + 21*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*(73*A + 63*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d) + (4*A*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^(7/2)*sin(c + d*x))/(21*a*d) + (2*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 9, (-4*a^3*(7*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(13*A + 35*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (8*a^3*(53*A + 70*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d) + (2*(7*A + 5*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (12*A*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*a*d) + (2*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 9, (-4*a^3*(9*A - 5*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(3*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (4*a^3*(21*A + 5*C)*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) + (2*(11*A + 5*C)*(a^3 + a^3*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (4*A*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^(3/2)*sin(c + d*x))/(5*a*d) + (2*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 9, (-4*a^3*(5*A - 9*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(5*A + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (8*a^3*(10*A - 3*C)*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) - (2*(35*A - 3*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) + (4*A*(a^2 + a^2*cos(c + d*x))^2*sqrt(sec(c + d*x))*sin(c + d*x))/(a*d) + (2*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 9, (4*a^3*(5*A + 7*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(35*A + 13*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) - (4*a^3*(35*A - 41*C)*sin(c + d*x))/(105*d*sqrt(sec(c + d*x))) - (2*(7*A - C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(7*a*d*sqrt(sec(c + d*x))) - (2*(35*A - 11*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(35*d*sqrt(sec(c + d*x))) + (2*A*(a + a*cos(c + d*x))^3*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 9, (4*a^3*(27*A + 17*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^3*(21*A + 11*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (8*a^3*(21*A + 16*C)*sin(c + d*x))/(105*d*sqrt(sec(c + d*x))) + (2*C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(9*d*sqrt(sec(c + d*x))) + (4*C*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(21*a*d*sqrt(sec(c + d*x))) + (2*(63*A + 73*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(315*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 10, (4*a^3*(7*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(143*A + 105*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (8*a^3*(44*A + 35*C)*sin(c + d*x))/(385*d*sec(c + d*x)^(3/2)) + (2*C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(11*d*sec(c + d*x)^(3/2)) + (4*C*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(33*a*d*sec(c + d*x)^(3/2)) + (2*(33*A + 35*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(231*d*sec(c + d*x)^(3/2)) + (4*a^3*(143*A + 105*C)*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 11, (4*a^3*(221*A + 175*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(195*d) + (4*a^3*(121*A + 95*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (40*a^3*(143*A + 118*C)*sin(c + d*x))/(9009*d*sec(c + d*x)^(5/2)) + (2*C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(13*d*sec(c + d*x)^(5/2)) + (12*C*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(143*a*d*sec(c + d*x)^(5/2)) + (2*(143*A + 145*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(1287*d*sec(c + d*x)^(5/2)) + (4*a^3*(221*A + 175*C)*sin(c + d*x))/(585*d*sec(c + d*x)^(3/2)) + (4*a^3*(121*A + 95*C)*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]

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

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

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

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

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

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

    @test_int [sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 6, (16*a*(16*A + 21*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (8*a*(16*A + 21*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a*(16*A + 21*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 5, (4*a*(24*A + 35*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*(24*A + 35*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 4, (2*a*(8*A + 15*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a*A*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 5, (2*sqrt(a)*C*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))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 5, (sqrt(a)*C*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*A - C)*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 5, (sqrt(a)*(8*A + 3*C)*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*C*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x)))]
    @test_int [(sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 6, (sqrt(a)*(8*A + 5*C)*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*C*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d*sec(c + d*x)^(3/2)) + (a*(8*A + 5*C)*sin(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(sqrt(a + a*cos(c + d*x))*(A + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 7, (sqrt(a)*(48*A + 35*C)*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*C*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)) + (C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d*sec(c + d*x)^(5/2)) + (a*(48*A + 35*C)*sin(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a*(48*A + 35*C)*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))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(13/2), x, 7, (16*a^2*(112*A + 143*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(1155*d*sqrt(a + a*cos(c + d*x))) + (8*a^2*(112*A + 143*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(1155*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(112*A + 143*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(385*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(28*A + 33*C)*sec(c + d*x)^(7/2)*sin(c + d*x))/(231*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))/(33*d) + (2*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))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 6, (4*a^2*(136*A + 189*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(136*A + 189*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(52*A + 63*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*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))/(21*d) + (2*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))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 5, (2*a^2*(104*A + 175*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(4*A + 5*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (6*a*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*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))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 6, (2*a^(3/2)*C*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 + 5*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*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))/(5*d) + (2*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))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 6, (3*a^(3/2)*C*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*(8*A - 3*C)*sin(c + d*x))/(3*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 + (2*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))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 6, (a^(3/2)*(8*A + 7*C)*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*(8*A - 5*C)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) - (a*(4*A - C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) + (2*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))^(3/2)*(A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 6, (a^(3/2)*(24*A + 11*C)*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*(24*A + 19*C)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (a*C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) + (C*(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))^(3/2)*(A + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 7, (a^(3/2)*(112*A + 75*C)*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*(16*A + 13*C)*sin(c + d*x))/(32*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a*C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(8*d*sec(c + d*x)^(3/2)) + (C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(4*d*sec(c + d*x)^(3/2)) + (a^2*(112*A + 75*C)*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))^(3/2)*(A + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 8, (a^(3/2)*(176*A + 133*C)*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^2*(80*A + 67*C)*sin(c + d*x))/(240*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)) + (3*a*C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(40*d*sec(c + d*x)^(5/2)) + (C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d*sec(c + d*x)^(5/2)) + (a^2*(176*A + 133*C)*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a^2*(176*A + 133*C)*sin(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(15/2), x, 8, (16*a^3*(8368*A + 10439*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(45045*d*sqrt(a + a*cos(c + d*x))) + (8*a^3*(8368*A + 10439*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(45045*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(8368*A + 10439*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(15015*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(2224*A + 2717*C)*sec(c + d*x)^(7/2)*sin(c + d*x))/(9009*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(136*A + 143*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(9/2)*sin(c + d*x))/(1287*d) + (10*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(11/2)*sin(c + d*x))/(143*d) + (2*A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(13/2)*sin(c + d*x))/(13*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(13/2), x, 7, (4*a^3*(568*A + 759*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(568*A + 759*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(232*A + 297*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(32*A + 33*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(231*d) + (10*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(9/2)*sin(c + d*x))/(99*d) + (2*A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(11/2)*sin(c + d*x))/(11*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 6, (2*a^3*(584*A + 903*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(8*A + 11*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(64*A + 63*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d) + (10*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d) + (2*A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 7, (2*a^(5/2)*C*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 + 49*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(21*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(8*A + 7*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(21*d) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(5/2)*sin(c + d*x))/(7*d) + (2*A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 7, (5*a^(5/2)*C*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*(64*A + 15*C)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (2*a^2*(8*A + 5*C)*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a*A*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d) + (2*A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 7, (a^(5/2)*(8*A + 19*C)*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*(56*A - 27*C)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) - (a^2*(8*A - C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) + (10*a*A*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 7, (5*a^(5/2)*(8*A + 5*C)*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*(24*A - 49*C)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) - (a^2*(8*A - 3*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) - (a*(6*A - C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (2*A*(a + a*cos(c + d*x))^(5/2)*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 7, (a^(5/2)*(304*A + 163*C)*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*(432*A + 299*C)*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (a^2*(16*A + 17*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(32*d*sqrt(sec(c + d*x))) + (5*a*C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*d*sqrt(sec(c + d*x))) + (C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 8, (a^(5/2)*(400*A + 283*C)*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*(1040*A + 787*C)*sin(c + d*x))/(960*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a^2*(80*A + 79*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(240*d*sec(c + d*x)^(3/2)) + (a*C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(8*d*sec(c + d*x)^(3/2)) + (C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (a^3*(400*A + 283*C)*sin(c + d*x))/(128*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 9, (a^(5/2)*(1304*A + 1015*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(512*d) + (a^3*(136*A + 109*C)*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)) + (a^2*(24*A + 23*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(96*d*sec(c + d*x)^(5/2)) + (a*C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(12*d*sec(c + d*x)^(5/2)) + (C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(6*d*sec(c + d*x)^(5/2)) + (a^3*(1304*A + 1015*C)*sin(c + d*x))/(768*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a^3*(1304*A + 1015*C)*sin(c + d*x))/(512*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

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

    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2))/sqrt(a + a*cos(c + d*x)), x, 9, -((sqrt(2)*(A + C)*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 + 273*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) - (2*(29*A + 21*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*(19*A + 21*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) - (2*A*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2))/sqrt(a + a*cos(c + d*x)), x, 8, (sqrt(2)*(A + C)*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 + 35*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*(31*A + 35*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) - (2*A*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2))/sqrt(a + a*cos(c + d*x)), x, 7, -((sqrt(2)*(A + C)*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 + 15*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) - (2*A*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/sqrt(a + a*cos(c + d*x)), x, 6, (sqrt(2)*(A + C)*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))/(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 + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/sqrt(a + a*cos(c + d*x)), x, 7, (2*C*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 + C)*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 + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/sqrt(a + a*cos(c + d*x)), x, 7, -((C*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 + C)*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) + (C*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))), x, 8, ((8*A + 7*C)*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 + C)*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) + (C*sin(c + d*x))/(2*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) - (C*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/(sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)), x, 9, -(((8*A + 9*C)*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*sqrt(a)*d)) + (sqrt(2)*(A + C)*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) + (C*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)) - (C*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + ((8*A + 7*C)*sin(c + d*x))/(8*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2))/(a + a*cos(c + d*x))^(3/2), x, 9, ((19*A + 11*C)*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 + 665*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(210*a*d*sqrt(a + a*cos(c + d*x))) + ((397*A + 245*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(210*a*d*sqrt(a + a*cos(c + d*x))) - ((67*A + 35*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(70*a*d*sqrt(a + a*cos(c + d*x))) - ((A + C)*sec(c + d*x)^(7/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((11*A + 7*C)*sec(c + d*x)^(7/2)*sin(c + d*x))/(14*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2))/(a + a*cos(c + d*x))^(3/2), x, 8, -((15*A + 7*C)*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) + ((49*A + 25*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(10*a*d*sqrt(a + a*cos(c + d*x))) - ((13*A + 5*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(10*a*d*sqrt(a + a*cos(c + d*x))) - ((A + C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((9*A + 5*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(10*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + a*cos(c + d*x))^(3/2), x, 7, ((11*A + 3*C)*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 + 3*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(6*a*d*sqrt(a + a*cos(c + d*x))) - ((A + C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((7*A + 3*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(6*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + a*cos(c + d*x))^(3/2), x, 6, -((7*A - C)*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 + C)*sqrt(sec(c + d*x))*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((5*A + C)*sqrt(sec(c + d*x))*sin(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + a*cos(c + d*x))^(3/2), x, 7, (2*C*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) + ((3*A - 5*C)*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 + C)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))), x, 8, -((3*C*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 + 9*C)*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 + C)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)) + ((A + 3*C)*sin(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)), x, 9, ((8*A + 19*C)*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*a^(3/2)*d) - ((5*A + 13*C)*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 + C)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(5/2)) + ((A + 2*C)*sin(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) - ((2*A + 7*C)*sin(c + d*x))/(4*a*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2))/(a + a*cos(c + d*x))^(5/2), x, 9, -((283*A + 75*C)*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 + 735*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(240*a^2*d*sqrt(a + a*cos(c + d*x))) - ((787*A + 195*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(240*a^2*d*sqrt(a + a*cos(c + d*x))) - ((A + C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((21*A + 5*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((157*A + 45*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(80*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + a*cos(c + d*x))^(5/2), x, 8, ((163*A + 19*C)*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 + 27*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(48*a^2*d*sqrt(a + a*cos(c + d*x))) - ((A + C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((17*A + C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + (5*(19*A + 3*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(48*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + a*cos(c + d*x))^(5/2), x, 7, (-5*(15*A - C)*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 + C)*sqrt(sec(c + d*x))*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((13*A - 3*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((49*A + C)*sqrt(sec(c + d*x))*sin(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + a*cos(c + d*x))^(5/2), x, 6, ((19*A + 3*C)*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 + C)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sqrt(sec(c + d*x))) - ((9*A - 7*C)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^(5/2)*sqrt(sec(c + d*x))), x, 8, (2*C*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) + ((5*A - 43*C)*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 + C)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)) + ((5*A - 11*C)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)), x, 9, -((5*C*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 + 115*C)*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 + C)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(5/2)) + ((A - 15*C)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)) + ((3*A + 35*C)*sin(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(5/2)), x, 10, ((8*A + 39*C)*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*a^(5/2)*d) - ((43*A + 219*C)*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 + C)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(7/2)) - ((3*A + 19*C)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(5/2)) + ((7*A + 31*C)*sin(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) - ((11*A + 63*C)*sin(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

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

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

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

    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 8, -((6*B*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (2*C*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (6*B*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*C*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d) + (2*B*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 7, -((2*C*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (2*B*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*C*sqrt(sec(c + d*x))*sin(c + d*x))/d + (2*B*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 6, -((2*B*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (2*C*sqrt(cos(c + d*x))*Elliptic.F((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 [(B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 5, (2*C*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d + (2*B*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(1/2), x, 6, (2*B*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d + (2*C*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*C*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/sec(c + d*x)^(1/2), x, 7, (6*C*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (2*B*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*C*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*B*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [(B*cos(c + d*x) + C*cos(c + d*x)^2)/sec(c + d*x)^(3/2), x, 8, (6*B*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (10*C*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*C*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*B*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (10*C*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]

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

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

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

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

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

    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 7, -((2*(3*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (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 + 5*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*B*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d) + (2*A*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 6, (-2*B*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*(A + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*B*sqrt(sec(c + d*x))*sin(c + d*x))/d + (2*A*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 5, (-2*(A - C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*B*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*A*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 5, (2*B*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*(3*A + C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*C*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/sqrt(sec(c + d*x)), x, 6, (2*(5*A + 3*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*B*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*C*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*B*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/sec(c + d*x)^(3/2), x, 7, (6*B*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(7*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*C*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*B*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*(7*A + 5*C)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]

    @test_int [(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 8, -((2*a*(3*A + 3*B + 5*C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (2*a*(5*A + 7*(B + C))*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a*(3*A + 3*B + 5*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a*(5*A + 7*(B + C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(21*d) + (2*a*(A + B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d) + (2*a*A*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 7, -((2*a*(3*A + 5*(B + C))*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d)) + (2*a*(A + B + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*(3*A + 5*(B + C))*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 6, -((2*a*(A + B - C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (2*a*(A + 3*(B + C))*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 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) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 6, -((2*a*(A - B - C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/d) + (2*a*(3*A + 3*B + C)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*C*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (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) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 6, (2*a*(5*A + 5*B + 3*C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (2*a*(3*A + B + C)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*C*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*a*(B + C)*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) + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 7, (2*a*(5*A + 3*(B + C))*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(5*d) + (2*a*(7*A + 7*B + 5*C)*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a*C*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*a*(B + C)*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*a*(7*A + 7*B + 5*C)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 8, (2*a*(9*A + 9*B + 7*C)*sqrt(cos(c + d*x))*Elliptic.E((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(15*d) + (2*a*(7*A + 5*(B + C))*sqrt(cos(c + d*x))*Elliptic.F((1/2)*(c + d*x), 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a*C*sin(c + d*x))/(9*d*sec(c + d*x)^(7/2)) + (2*a*(B + C)*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*a*(9*A + 9*B + 7*C)*sin(c + d*x))/(45*d*sec(c + d*x)^(3/2)) + (2*a*(7*A + 5*(B + C))*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 10, (-4*a^2*(8*A + 9*B + 12*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^2*(5*A + 6*B + 7*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (4*a^2*(8*A + 9*B + 12*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (4*a^2*(5*A + 6*B + 7*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(21*d) + (2*a^2*(19*A + 27*B + 21*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(105*d) + (2*(4*A + 9*B)*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d) + (2*A*(a + a*cos(c + d*x))^2*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 9, (-4*a^2*(3*A + 4*B + 5*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^2*(6*A + 7*B + 14*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (4*a^2*(3*A + 4*B + 5*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a^2*(33*A + 49*B + 35*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*(4*A + 7*B)*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*A*(a + a*cos(c + d*x))^2*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 8, (-4*a^2*(4*A + 5*B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^2*(A + 2*B + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a^2*(17*A + 25*B + 15*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*(4*A + 5*B)*(a^2 + a^2*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*A*(a + a*cos(c + d*x))^2*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 8, (-4*a^2*(A - C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (4*a^2*(2*A + 3*B + 2*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*a^2*(5*A + 3*B - C)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (2*(4*A + 3*B)*(a^2 + a^2*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + a*cos(c + d*x))^2*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 8, (4*a^2*(5*B + 4*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^2*(3*A + 2*B + C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*a^2*(15*A - 5*B - 7*C)*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) - (2*(5*A - C)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(5*d*sqrt(sec(c + d*x))) + (2*A*(a + a*cos(c + d*x))^2*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 8, (4*a^2*(5*A + 4*B + 3*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^2*(14*A + 7*B + 6*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a^2*(35*A + 49*B + 33*C)*sin(c + d*x))/(105*d*sqrt(sec(c + d*x))) + (2*C*(a + a*cos(c + d*x))^2*sin(c + d*x))/(7*d*sqrt(sec(c + d*x))) + (2*(7*B + 4*C)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(35*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 9, (4*a^2*(12*A + 9*B + 8*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^2*(7*A + 6*B + 5*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a^2*(21*A + 27*B + 19*C)*sin(c + d*x))/(105*d*sec(c + d*x)^(3/2)) + (2*C*(a + a*cos(c + d*x))^2*sin(c + d*x))/(9*d*sec(c + d*x)^(3/2)) + (2*(9*B + 4*C)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(63*d*sec(c + d*x)^(3/2)) + (4*a^2*(7*A + 6*B + 5*C)*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) + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 10, (4*a^2*(9*A + 8*B + 7*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^2*(66*A + 55*B + 50*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (2*a^2*(99*A + 121*B + 89*C)*sin(c + d*x))/(693*d*sec(c + d*x)^(5/2)) + (2*C*(a + a*cos(c + d*x))^2*sin(c + d*x))/(11*d*sec(c + d*x)^(5/2)) + (2*(11*B + 4*C)*(a^2 + a^2*cos(c + d*x))*sin(c + d*x))/(99*d*sec(c + d*x)^(5/2)) + (4*a^2*(9*A + 8*B + 7*C)*sin(c + d*x))/(45*d*sec(c + d*x)^(3/2)) + (4*a^2*(66*A + 55*B + 50*C)*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]

    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(13/2), x, 11, (-4*a^3*(15*A + 17*B + 21*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^3*(105*A + 121*B + 143*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (4*a^3*(15*A + 17*B + 21*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (4*a^3*(105*A + 121*B + 143*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(231*d) + (4*a^3*(210*A + 253*B + 264*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(1155*d) + (2*(105*A + 143*B + 99*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(693*d) + (2*(6*A + 11*B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^(9/2)*sin(c + d*x))/(99*a*d) + (2*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^(11/2)*sin(c + d*x))/(11*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 10, (-4*a^3*(17*A + 21*B + 27*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^3*(11*A + 13*B + 21*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (4*a^3*(17*A + 21*B + 27*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (4*a^3*(32*A + 41*B + 42*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*(73*A + 99*B + 63*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d) + (2*(2*A + 3*B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^(7/2)*sin(c + d*x))/(21*a*d) + (2*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 9, (-4*a^3*(7*A + 9*B + 5*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(13*A + 21*B + 35*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (4*a^3*(106*A + 147*B + 140*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d) + (2*(7*A + 9*B + 5*C)*(a^3 + a^3*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*(6*A + 7*B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*a*d) + (2*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 9, (-4*a^3*(9*A + 5*B - 5*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(3*A + 5*(B + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (4*a^3*(21*A + 20*B + 5*C)*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) + (2*(33*A + 35*B + 15*C)*(a^3 + a^3*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*(6*A + 5*B)*(a^2 + a^2*cos(c + d*x))^2*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*a*d) + (2*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 9, (-4*a^3*(5*A - 5*B - 9*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(5*A + 5*B + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (4*a^3*(20*A + 5*B - 6*C)*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) - (2*(35*A + 15*B - 3*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) + (2*(2*A + B)*(a^2 + a^2*cos(c + d*x))^2*sqrt(sec(c + d*x))*sin(c + d*x))/(a*d) + (2*A*(a + a*cos(c + d*x))^3*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 9, (4*a^3*(5*A + 9*B + 7*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (4*a^3*(35*A + 21*B + 13*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) - (4*a^3*(35*A - 42*B - 41*C)*sin(c + d*x))/(105*d*sqrt(sec(c + d*x))) - (2*(7*A - C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(7*a*d*sqrt(sec(c + d*x))) - (2*(35*A - 7*B - 11*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(35*d*sqrt(sec(c + d*x))) + (2*A*(a + a*cos(c + d*x))^3*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 9, (4*a^3*(27*A + 21*B + 17*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^3*(21*A + 13*B + 11*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (4*a^3*(42*A + 41*B + 32*C)*sin(c + d*x))/(105*d*sqrt(sec(c + d*x))) + (2*C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(9*d*sqrt(sec(c + d*x))) + (2*(3*B + 2*C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(21*a*d*sqrt(sec(c + d*x))) + (2*(63*A + 99*B + 73*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(315*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 10, (4*a^3*(21*A + 17*B + 15*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (4*a^3*(143*A + 121*B + 105*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (4*a^3*(264*A + 253*B + 210*C)*sin(c + d*x))/(1155*d*sec(c + d*x)^(3/2)) + (2*C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(11*d*sec(c + d*x)^(3/2)) + (2*(11*B + 6*C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(99*a*d*sec(c + d*x)^(3/2)) + (2*(99*A + 143*B + 105*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(693*d*sec(c + d*x)^(3/2)) + (4*a^3*(143*A + 121*B + 105*C)*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]
    @test_int [((a + a*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 11, (4*a^3*(221*A + 195*B + 175*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(195*d) + (4*a^3*(121*A + 105*B + 95*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (20*a^3*(286*A + 273*B + 236*C)*sin(c + d*x))/(9009*d*sec(c + d*x)^(5/2)) + (2*C*(a + a*cos(c + d*x))^3*sin(c + d*x))/(13*d*sec(c + d*x)^(5/2)) + (2*(13*B + 6*C)*(a^2 + a^2*cos(c + d*x))^2*sin(c + d*x))/(143*a*d*sec(c + d*x)^(5/2)) + (2*(143*A + 195*B + 145*C)*(a^3 + a^3*cos(c + d*x))*sin(c + d*x))/(1287*d*sec(c + d*x)^(5/2)) + (4*a^3*(221*A + 195*B + 175*C)*sin(c + d*x))/(585*d*sec(c + d*x)^(3/2)) + (4*a^3*(121*A + 105*B + 95*C)*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]

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

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

    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + a*cos(c + d*x))^2, x, 8, ((7*A - 4*B + C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^2*d) + ((10*A - 5*B + 2*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*a^2*d) - ((7*A - 4*B + C)*sqrt(sec(c + d*x))*sin(c + d*x))/(a^2*d) + ((10*A - 5*B + 2*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*d) - ((7*A - 4*B + C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + a*cos(c + d*x))^2, x, 7, -(((4*A - B)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^2*d)) - ((5*A - 2*B - C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 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 - C)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))) - ((A - B + C)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2)]
    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + a*cos(c + d*x))^2, x, 6, ((A - C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^2*d) + ((2*A + B + 2*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*a^2*d) - ((A - C)*sin(c + d*x))/(a^2*d*(1 + cos(c + d*x))*sqrt(sec(c + d*x))) - ((A - B + C)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^2*sqrt(sec(c + d*x))), x, 6, -(((B - 4*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^2*d)) + ((A + 2*B - 5*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*a^2*d) - ((A - B + C)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2*sec(c + d*x)^(3/2)) + ((A + 2*B - 5*C)*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^2*sec(c + d*x)^(3/2)), x, 7, -(((A - 4*B + 7*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^2*d)) + ((2*A - 5*B + 10*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*a^2*d) - ((A - B + C)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2*sec(c + d*x)^(5/2)) - ((A - 4*B + 7*C)*sin(c + d*x))/(3*a^2*d*(1 + cos(c + d*x))*sec(c + d*x)^(3/2)) + ((2*A - 5*B + 10*C)*sin(c + d*x))/(3*a^2*d*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^2*sec(c + d*x)^(5/2)), x, 8, ((20*A - 35*B + 56*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*a^2*d) - (5*(A - 2*B + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*a^2*d) - ((A - B + C)*sin(c + d*x))/(3*d*(a + a*cos(c + d*x))^2*sec(c + d*x)^(7/2)) - ((A - 2*B + 3*C)*sin(c + d*x))/(a^2*d*(1 + cos(c + d*x))*sec(c + d*x)^(5/2)) + ((20*A - 35*B + 56*C)*sin(c + d*x))/(15*a^2*d*sec(c + d*x)^(3/2)) - (5*(A - 2*B + 3*C)*sin(c + d*x))/(3*a^2*d*sqrt(sec(c + d*x)))]

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

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

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

    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 6, (16*a*(16*A + 18*B + 21*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (8*a*(16*A + 18*B + 21*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a*(16*A + 18*B + 21*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*(A + 9*B)*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 5, (4*a*(24*A + 28*B + 35*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*(24*A + 28*B + 35*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a*(A + 7*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 4, (2*a*(8*A + 10*B + 15*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a*(A + 5*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 5, (2*sqrt(a)*C*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 + 3*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 5, (sqrt(a)*(2*B + C)*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*A - C)*sin(c + d*x))/(d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (2*A*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(1/2), x, 5, (sqrt(a)*(8*A + 4*B + 3*C)*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*(4*B + C)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x)))]
    @test_int [sqrt(a + a*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/sec(c + d*x)^(1/2), x, 6, (sqrt(a)*(8*A + 6*B + 5*C)*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*(6*B + C)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(3*d*sec(c + d*x)^(3/2)) + (a*(8*A + 6*B + 5*C)*sin(c + d*x))/(8*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) + C*cos(c + d*x)^2)/sec(c + d*x)^(3/2), x, 7, (sqrt(a)*(48*A + 40*B + 35*C)*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*(8*B + C)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)) + (C*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d*sec(c + d*x)^(5/2)) + (a*(48*A + 40*B + 35*C)*sin(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a*(48*A + 40*B + 35*C)*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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(13/2), x, 7, (16*a^2*(336*A + 374*B + 429*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(3465*d*sqrt(a + a*cos(c + d*x))) + (8*a^2*(336*A + 374*B + 429*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3465*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(336*A + 374*B + 429*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(1155*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(84*A + 110*B + 99*C)*sec(c + d*x)^(7/2)*sin(c + d*x))/(693*d*sqrt(a + a*cos(c + d*x))) + (2*a*(3*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*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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 6, (4*a^2*(136*A + 156*B + 189*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(136*A + 156*B + 189*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(52*A + 72*B + 63*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a*(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*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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 5, (2*a^2*(104*A + 126*B + 175*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(4*A + 6*B + 5*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a*(3*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*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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 6, (2*a^(3/2)*C*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*(12*A + 20*B + 15*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a*(3*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*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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 6, (a^(3/2)*(2*B + 3*C)*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*(8*A + 6*B - 3*C)*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (2*a*(A + B)*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d + (2*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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 6, (a^(3/2)*(8*A + 12*B + 7*C)*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*(8*A - 4*B - 5*C)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) - (a*(4*A - C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) + (2*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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(1/2), x, 6, (a^(3/2)*(24*A + 14*B + 11*C)*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*(24*A + 30*B + 19*C)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (a*(2*B + C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) + (C*(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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/sec(c + d*x)^(1/2), x, 7, (a^(3/2)*(112*A + 88*B + 75*C)*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*(48*A + 56*B + 39*C)*sin(c + d*x))/(96*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a*(8*B + 3*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(24*d*sec(c + d*x)^(3/2)) + (C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(4*d*sec(c + d*x)^(3/2)) + (a^2*(112*A + 88*B + 75*C)*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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/sec(c + d*x)^(3/2), x, 8, (a^(3/2)*(176*A + 150*B + 133*C)*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^2*(80*A + 90*B + 67*C)*sin(c + d*x))/(240*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)) + (a*(10*B + 3*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(40*d*sec(c + d*x)^(5/2)) + (C*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(5*d*sec(c + d*x)^(5/2)) + (a^2*(176*A + 150*B + 133*C)*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a^2*(176*A + 150*B + 133*C)*sin(c + d*x))/(128*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(15/2), x, 8, (16*a^3*(8368*A + 9230*B + 10439*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(45045*d*sqrt(a + a*cos(c + d*x))) + (8*a^3*(8368*A + 9230*B + 10439*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(45045*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(8368*A + 9230*B + 10439*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(15015*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(2224*A + 2522*B + 2717*C)*sec(c + d*x)^(7/2)*sin(c + d*x))/(9009*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(136*A + 182*B + 143*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(9/2)*sin(c + d*x))/(1287*d) + (2*a*(5*A + 13*B)*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(11/2)*sin(c + d*x))/(143*d) + (2*A*(a + a*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(13/2), x, 7, (4*a^3*(2840*A + 3212*B + 3795*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(3465*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(2840*A + 3212*B + 3795*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3465*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(1160*A + 1364*B + 1485*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(3465*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(32*A + 44*B + 33*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(231*d) + (2*a*(5*A + 11*B)*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(9/2)*sin(c + d*x))/(99*d) + (2*A*(a + a*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 6, (2*a^3*(584*A + 690*B + 903*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*a^3*(8*A + 10*B + 11*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(64*A + 90*B + 63*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d) + (2*a*(5*A + 9*B)*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d) + (2*A*(a + a*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 7, (2*a^(5/2)*C*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*(160*A + 224*B + 245*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*a^2*(40*A + 56*B + 35*C)*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*a*(5*A + 7*B)*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*A*(a + a*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 7, (a^(5/2)*(2*B + 5*C)*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*(64*A + 70*B + 15*C)*sin(c + d*x))/(15*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (2*a^2*(8*A + 10*B + 5*C)*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a*(A + B)*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d) + (2*A*(a + a*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 7, (a^(5/2)*(8*A + 20*B + 19*C)*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*(56*A + 12*B - 27*C)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) - (a^2*(8*A + 4*B - C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) + (2*a*(5*A + 3*B)*(a + a*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + a*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 7, (a^(5/2)*(40*A + 38*B + 25*C)*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*(24*A - 54*B - 49*C)*sin(c + d*x))/(24*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) - (a^2*(8*A - 2*B - 3*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) - (a*(6*A - C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (2*A*(a + a*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(1/2), x, 7, (a^(5/2)*(304*A + 200*B + 163*C)*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*(432*A + 392*B + 299*C)*sin(c + d*x))/(192*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x))) + (a^2*(16*A + 24*B + 17*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(32*d*sqrt(sec(c + d*x))) + (a*(8*B + 5*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*d*sqrt(sec(c + d*x))) + (C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*d*sqrt(sec(c + d*x)))]
    @test_int [(a + a*cos(c + d*x))^(5/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/sec(c + d*x)^(1/2), x, 8, (a^(5/2)*(400*A + 326*B + 283*C)*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*(1040*A + 950*B + 787*C)*sin(c + d*x))/(960*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a^2*(80*A + 110*B + 79*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(240*d*sec(c + d*x)^(3/2)) + (a*(2*B + C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(8*d*sec(c + d*x)^(3/2)) + (C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (a^3*(400*A + 326*B + 283*C)*sin(c + d*x))/(128*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) + C*cos(c + d*x)^2)/sec(c + d*x)^(3/2), x, 9, (a^(5/2)*(1304*A + 1132*B + 1015*C)*asin((sqrt(a)*sin(c + d*x))/sqrt(a + a*cos(c + d*x)))*sqrt(cos(c + d*x))*sqrt(sec(c + d*x)))/(512*d) + (a^3*(680*A + 628*B + 545*C)*sin(c + d*x))/(960*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)) + (a^2*(120*A + 156*B + 115*C)*sqrt(a + a*cos(c + d*x))*sin(c + d*x))/(480*d*sec(c + d*x)^(5/2)) + (a*(12*B + 5*C)*(a + a*cos(c + d*x))^(3/2)*sin(c + d*x))/(60*d*sec(c + d*x)^(5/2)) + (C*(a + a*cos(c + d*x))^(5/2)*sin(c + d*x))/(6*d*sec(c + d*x)^(5/2)) + (a^3*(1304*A + 1132*B + 1015*C)*sin(c + d*x))/(768*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + (a^3*(1304*A + 1132*B + 1015*C)*sin(c + d*x))/(512*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2)/sqrt(a + a*cos(c + d*x)), x, 9, -((sqrt(2)*(A - B + C)*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 + 273*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) - (2*(29*A - 93*B + 21*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d*sqrt(a + a*cos(c + d*x))) + (2*(19*A - 3*B + 21*C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2)/sqrt(a + a*cos(c + d*x)), x, 8, (sqrt(2)*(A - B + C)*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 + 35*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d*sqrt(a + a*cos(c + d*x))) + (2*(31*A - 7*B + 35*C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2)/sqrt(a + a*cos(c + d*x)), x, 7, -((sqrt(2)*(A - B + C)*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 + 15*C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2)/sqrt(a + a*cos(c + d*x)), x, 6, (sqrt(2)*(A - B + C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2)/sqrt(a + a*cos(c + d*x)), x, 7, (2*C*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 + C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(1/2)/sqrt(a + a*cos(c + d*x)), x, 7, ((2*B - C)*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 + C)*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) + (C*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) + C*cos(c + d*x)^2)/(sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(1/2)), x, 8, ((8*A - 4*B + 7*C)*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 + C)*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) + (C*sin(c + d*x))/(2*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + ((4*B - C)*sin(c + d*x))/(4*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)), x, 9, -(((8*A - 14*B + 9*C)*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*sqrt(a)*d)) + (sqrt(2)*(A - B + C)*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) + (C*sin(c + d*x))/(3*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(5/2)) + ((6*B - C)*sin(c + d*x))/(12*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) + ((8*A - 2*B + 7*C)*sin(c + d*x))/(8*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2)/(a + a*cos(c + d*x))^(3/2), x, 9, ((19*A - 15*B + 11*C)*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 + 665*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(210*a*d*sqrt(a + a*cos(c + d*x))) + ((397*A - 273*B + 245*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(210*a*d*sqrt(a + a*cos(c + d*x))) - ((67*A - 63*B + 35*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(70*a*d*sqrt(a + a*cos(c + d*x))) - ((A - B + C)*sec(c + d*x)^(7/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((11*A - 7*B + 7*C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2)/(a + a*cos(c + d*x))^(3/2), x, 8, -(((15*A - 11*B + 7*C)*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 + 75*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(30*a*d*sqrt(a + a*cos(c + d*x))) - ((39*A - 35*B + 15*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(30*a*d*sqrt(a + a*cos(c + d*x))) - ((A - B + C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((9*A - 5*B + 5*C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2)/(a + a*cos(c + d*x))^(3/2), x, 7, ((11*A - 7*B + 3*C)*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 + 3*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(6*a*d*sqrt(a + a*cos(c + d*x))) - ((A - B + C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((7*A - 3*B + 3*C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2)/(a + a*cos(c + d*x))^(3/2), x, 6, -(((7*A - 3*B - C)*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 + C)*sqrt(sec(c + d*x))*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)) + ((5*A - B + C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(1/2)/(a + a*cos(c + d*x))^(3/2), x, 7, (2*C*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) + ((3*A + B - 5*C)*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 + C)*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) + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(1/2)), x, 8, ((2*B - 3*C)*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 + 9*C)*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 + C)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)) + ((A - B + 3*C)*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) + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)), x, 9, ((8*A - 12*B + 19*C)*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*a^(3/2)*d) - ((5*A - 9*B + 13*C)*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 + C)*sin(c + d*x))/(2*d*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(5/2)) + ((A - B + 2*C)*sin(c + d*x))/(2*a*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) - ((2*A - 6*B + 7*C)*sin(c + d*x))/(4*a*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2)/(a + a*cos(c + d*x))^(5/2), x, 9, -(((283*A - 163*B + 75*C)*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 + 735*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(240*a^2*d*sqrt(a + a*cos(c + d*x))) - ((787*A - 475*B + 195*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(240*a^2*d*sqrt(a + a*cos(c + d*x))) - ((A - B + C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((21*A - 13*B + 5*C)*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 + 45*C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2)/(a + a*cos(c + d*x))^(5/2), x, 8, ((163*A - 75*B + 19*C)*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 + 27*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(48*a^2*d*sqrt(a + a*cos(c + d*x))) - ((A - B + C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((17*A - 9*B + C)*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 + 15*C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2)/(a + a*cos(c + d*x))^(5/2), x, 7, -(((75*A - 19*B - 5*C)*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 + C)*sqrt(sec(c + d*x))*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)) - ((13*A - 5*B - 3*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)) + ((49*A - 9*B + C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(1/2)/(a + a*cos(c + d*x))^(5/2), x, 6, ((19*A + 5*B + 3*C)*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 + C)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sqrt(sec(c + d*x))) - ((9*A - B - 7*C)*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) + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(1/2)), x, 8, (2*C*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) + ((5*A + 3*B - 43*C)*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 + C)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)) + ((5*A + 3*B - 11*C)*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) + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)), x, 9, ((2*B - 5*C)*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 + 115*C)*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 + C)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(5/2)) + ((A + 7*B - 15*C)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)) + ((3*A - 11*B + 35*C)*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) + C*cos(c + d*x)^2)/((a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(5/2)), x, 10, ((8*A - 20*B + 39*C)*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*a^(5/2)*d) - ((43*A - 115*B + 219*C)*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 + C)*sin(c + d*x))/(4*d*(a + a*cos(c + d*x))^(5/2)*sec(c + d*x)^(7/2)) - ((3*A - 11*B + 19*C)*sin(c + d*x))/(16*a*d*(a + a*cos(c + d*x))^(3/2)*sec(c + d*x)^(5/2)) + ((7*A - 15*B + 31*C)*sin(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x))*sec(c + d*x)^(3/2)) - ((11*A - 35*B + 63*C)*sin(c + d*x))/(16*a^2*d*sqrt(a + a*cos(c + d*x))*sqrt(sec(c + d*x)))]

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

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

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

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

    @test_int [(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 8, (-2*b*(3*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*a*(5*A + 7*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b*(3*A + 5*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a*(5*A + 7*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(21*d) + (2*A*b*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d) + (2*a*A*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 7, (-2*a*(3*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*b*(A + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*a*(3*A + 5*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 6, (-2*b*(A - C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*a*(A + 3*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 6, (-2*a*(A - C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*b*(3*A + C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*b*C*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (2*a*A*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 6, (2*b*(5*A + 3*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*a*(3*A + C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*b*C*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*a*C*sin(c + d*x))/(3*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 7, (2*a*(5*A + 3*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*b*(7*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b*C*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*a*C*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*b*(7*A + 5*C)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 8, (2*b*(9*A + 7*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*a*(7*A + 5*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b*C*sin(c + d*x))/(9*d*sec(c + d*x)^(7/2)) + (2*a*C*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*b*(9*A + 7*C)*sin(c + d*x))/(45*d*sec(c + d*x)^(3/2)) + (2*a*(7*A + 5*C)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]

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

    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 9, (-2*a*(9*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*b*(7*b^2*(A + 3*C) + 3*a^2*(5*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*a*(9*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*b*(8*A*b^2 + 9*a^2*(5*A + 7*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(63*d) + (2*a*(24*A*b^2 + 7*a^2*(7*A + 9*C))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d) + (4*A*b*(a + b*cos(c + d*x))^2*sec(c + d*x)^(7/2)*sin(c + d*x))/(21*d) + (2*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 8, (-2*b*(5*b^2*(A - C) + 3*a^2*(3*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*a*(21*b^2*(A + 3*C) + a^2*(5*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (6*b*(8*A*b^2 + 7*a^2*(3*A + 5*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(35*d) + (2*a*(24*A*b^2 + 5*a^2*(5*A + 7*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (12*A*b*(a + b*cos(c + d*x))^2*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 8, (-2*a*(15*b^2*(A - C) + a^2*(3*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*b*(b^2*(3*A + C) + 3*a^2*(A + 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*b^3*(9*A - 5*C)*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) + (2*a*(8*A*b^2 + a^2*(3*A + 5*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (4*A*b*(a + b*cos(c + d*x))^2*sec(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 8, (-2*b*(15*a^2*(A - C) - b^2*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*a*(3*b^2*(3*A + C) + a^2*(A + 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*b^3*(35*A - 3*C)*sin(c + d*x))/(15*d*sec(c + d*x)^(3/2)) - (2*a*b^2*(5*A - C)*sin(c + d*x))/(d*sqrt(sec(c + d*x))) + (4*A*b*(a + b*cos(c + d*x))^2*sqrt(sec(c + d*x))*sin(c + d*x))/d + (2*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 8, (-2*a*(5*a^2*(A - C) - 3*b^2*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*b*(21*a^2*(3*A + C) + b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) - (2*a*b^2*(35*A - 11*C)*sin(c + d*x))/(35*d*sec(c + d*x)^(3/2)) - (2*b*(6*a^2*(7*A - 3*C) - b^2*(7*A + 5*C))*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) - (2*b*(7*A - C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d*sqrt(sec(c + d*x))) + (2*A*(a + b*cos(c + d*x))^3*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 8, (2*b*(9*a^2*(5*A + 3*C) + b^2*(9*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*a*(7*a^2*(3*A + C) + 3*b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b*(24*a^2*C + 7*b^2*(9*A + 7*C))*sin(c + d*x))/(315*d*sec(c + d*x)^(3/2)) + (2*a*(63*A*b^2 + 8*a^2*C + 45*b^2*C)*sin(c + d*x))/(63*d*sqrt(sec(c + d*x))) + (4*a*C*(a + b*cos(c + d*x))^2*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) + (2*C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(9*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 9, (2*a*(a^2*(5*A + 3*C) + b^2*(9*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*b*(33*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (2*b*(8*a^2*C + 3*b^2*(11*A + 9*C))*sin(c + d*x))/(231*d*sec(c + d*x)^(5/2)) + (2*a*(99*A*b^2 + 8*a^2*C + 77*b^2*C)*sin(c + d*x))/(165*d*sec(c + d*x)^(3/2)) + (4*a*C*(a + b*cos(c + d*x))^2*sin(c + d*x))/(33*d*sec(c + d*x)^(3/2)) + (2*C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(11*d*sec(c + d*x)^(3/2)) + (2*b*(33*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^3*(A + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 10, (2*b*(39*a^2*(9*A + 7*C) + 7*b^2*(13*A + 11*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(195*d) + (2*a*(11*a^2*(7*A + 5*C) + 15*b^2*(11*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (2*b*(24*a^2*C + 11*b^2*(13*A + 11*C))*sin(c + d*x))/(1287*d*sec(c + d*x)^(7/2)) + (6*a*(143*A*b^2 + 8*a^2*C + 117*b^2*C)*sin(c + d*x))/(1001*d*sec(c + d*x)^(5/2)) + (12*a*C*(a + b*cos(c + d*x))^2*sin(c + d*x))/(143*d*sec(c + d*x)^(5/2)) + (2*C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(13*d*sec(c + d*x)^(5/2)) + (2*b*(39*a^2*(9*A + 7*C) + 7*b^2*(13*A + 11*C))*sin(c + d*x))/(585*d*sec(c + d*x)^(3/2)) + (2*a*(11*a^2*(7*A + 5*C) + 15*b^2*(11*A + 9*C))*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]

    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(13/2), x, 10, (-8*a*b*(3*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(77*b^4*(A + 3*C) + 66*a^2*b^2*(5*A + 7*C) + 5*a^4*(9*A + 11*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (8*a*b*(3*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*(64*A*b^4 + 15*a^4*(9*A + 11*C) + 9*a^2*b^2*(101*A + 143*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(693*d) + (4*a*b*(96*A*b^2 + a^2*(673*A + 891*C))*sec(c + d*x)^(5/2)*sin(c + d*x))/(3465*d) + (2*(16*A*b^2 + 3*a^2*(9*A + 11*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^(7/2)*sin(c + d*x))/(231*d) + (16*A*b*(a + b*cos(c + d*x))^3*sec(c + d*x)^(9/2)*sin(c + d*x))/(99*d) + (2*A*(a + b*cos(c + d*x))^4*sec(c + d*x)^(11/2)*sin(c + d*x))/(11*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 9, (-2*(15*b^4*(A - C) + 18*a^2*b^2*(3*A + 5*C) + a^4*(7*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (8*a*b*(7*b^2*(A + 3*C) + a^2*(5*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*(192*A*b^4 + 21*a^4*(7*A + 9*C) + 7*a^2*b^2*(155*A + 261*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d) + (4*a*b*(32*A*b^2 + a^2*(101*A + 147*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d) + (2*(48*A*b^2 + 7*a^2*(7*A + 9*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d) + (16*A*b*(a + b*cos(c + d*x))^3*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d) + (2*A*(a + b*cos(c + d*x))^4*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 9, (-8*a*b*(5*b^2*(A - C) + a^2*(3*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(7*b^4*(3*A + C) + 42*a^2*b^2*(A + 3*C) + a^4*(5*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) - (2*b^2*(b^2*(87*A - 35*C) + 5*a^2*(5*A + 7*C))*sin(c + d*x))/(105*d*sqrt(sec(c + d*x))) + (4*a*b*(96*A*b^2 + a^2*(101*A + 175*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d) + (2*(48*A*b^2 + 5*a^2*(5*A + 7*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (16*A*b*(a + b*cos(c + d*x))^3*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*A*(a + b*cos(c + d*x))^4*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 9, (-2*(30*a^2*b^2*(A - C) - b^4*(5*A + 3*C) + a^4*(3*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (8*a*b*(b^2*(3*A + C) + a^2*(A + 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*b^2*(b^2*(59*A - 3*C) + 3*a^2*(3*A + 5*C))*sin(c + d*x))/(15*d*sec(c + d*x)^(3/2)) - (4*a*b*(2*b^2*(33*A - 5*C) + 3*a^2*(3*A + 5*C))*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) + (2*(16*A*b^2 + a^2*(3*A + 5*C))*(a + b*cos(c + d*x))^2*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (16*A*b*(a + b*cos(c + d*x))^3*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*A*(a + b*cos(c + d*x))^4*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 9, (-8*a*b*(5*a^2*(A - C) - b^2*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(42*a^2*b^2*(3*A + C) + 7*a^4*(A + 3*C) + b^4*(7*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) - (4*a*b^3*(175*A - 27*C)*sin(c + d*x))/(105*d*sec(c + d*x)^(3/2)) - (2*b^2*(3*a^2*(49*A - 13*C) - b^2*(7*A + 5*C))*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) - (2*b^2*(21*A - C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d*sqrt(sec(c + d*x))) + (16*A*b*(a + b*cos(c + d*x))^3*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + b*cos(c + d*x))^4*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 9, (-2*(15*a^4*(A - C) - 18*a^2*b^2*(5*A + 3*C) - b^4*(9*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (8*a*b*(7*a^2*(3*A + C) + b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) - (2*b^2*(3*a^2*(105*A - 41*C) - 7*b^2*(9*A + 7*C))*sin(c + d*x))/(315*d*sec(c + d*x)^(3/2)) - (4*a*b*(a^2*(63*A - 31*C) - 6*b^2*(7*A + 5*C))*sin(c + d*x))/(63*d*sqrt(sec(c + d*x))) - (2*a*b*(21*A - 5*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) - (2*b*(9*A - C)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(9*d*sqrt(sec(c + d*x))) + (2*A*(a + b*cos(c + d*x))^4*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 9, (8*a*b*(3*a^2*(5*A + 3*C) + b^2*(9*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(77*a^4*(3*A + C) + 66*a^2*b^2*(7*A + 5*C) + 5*b^4*(11*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (4*a*b*(891*A*b^2 + 96*a^2*C + 673*b^2*C)*sin(c + d*x))/(3465*d*sec(c + d*x)^(3/2)) + (2*(64*a^4*C + 15*b^4*(11*A + 9*C) + 9*a^2*b^2*(143*A + 101*C))*sin(c + d*x))/(693*d*sqrt(sec(c + d*x))) + (2*(16*a^2*C + 3*b^2*(11*A + 9*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(231*d*sqrt(sec(c + d*x))) + (16*a*C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(99*d*sqrt(sec(c + d*x))) + (2*C*(a + b*cos(c + d*x))^4*sin(c + d*x))/(11*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^4*(A + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 10, (2*(39*a^4*(5*A + 3*C) + 78*a^2*b^2*(9*A + 7*C) + 7*b^4*(13*A + 11*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(195*d) + (8*a*b*(11*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (4*a*b*(1573*A*b^2 + 96*a^2*C + 1259*b^2*C)*sin(c + d*x))/(9009*d*sec(c + d*x)^(5/2)) + (2*(192*a^4*C + 77*b^4*(13*A + 11*C) + 11*a^2*b^2*(637*A + 491*C))*sin(c + d*x))/(6435*d*sec(c + d*x)^(3/2)) + (2*(48*a^2*C + 11*b^2*(13*A + 11*C))*(a + b*cos(c + d*x))^2*sin(c + d*x))/(1287*d*sec(c + d*x)^(3/2)) + (16*a*C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(143*d*sec(c + d*x)^(3/2)) + (2*C*(a + b*cos(c + d*x))^4*sin(c + d*x))/(13*d*sec(c + d*x)^(3/2)) + (8*a*b*(11*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]

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

    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2))/(a + b*cos(c + d*x)), x, 9, (-2*(5*A*b^2 + a^2*(3*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*a^3*d) - (2*A*b*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*a^2*d) - (2*b*(A*b^2 + a^2*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^3*(a + b)*d) + (2*(5*A*b^2 + a^2*(3*A + 5*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(5*a^3*d) - (2*A*b*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*d) + (2*A*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*a*d)]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x)), x, 8, (2*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*(A*b^2 + a^2*C)*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*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x)), x, 7, (-2*A*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*d) + (2*C*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b*d) - (2*(A*b^2 + a^2*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*b*(a + b)*d) + (2*A*sqrt(sec(c + d*x))*sin(c + d*x))/(a*d)]
    @test_int [((A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x)), x, 6, (2*C*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b*d) - (2*a*C*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^2*d) + (2*(A*b^2 + a^2*C)*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 + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))*sqrt(sec(c + d*x))), x, 7, (-2*a*C*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^2*d) + (2*(3*a^2*C + b^2*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*b^3*d) - (2*a*(A*b^2 + a^2*C)*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*C*sin(c + d*x))/(3*b*d*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))*sec(c + d*x)^(3/2)), x, 8, (2*(5*a^2*C + b^2*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*b^3*d) - (2*a*(3*A*b^2 + (3*a^2 + b^2)*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*b^4*d) + (2*a^2*(A*b^2 + a^2*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^4*(a + b)*d) + (2*C*sin(c + d*x))/(5*b*d*sec(c + d*x)^(3/2)) - (2*a*C*sin(c + d*x))/(3*b^2*d*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))*sec(c + d*x)^(5/2)), x, 9, (-2*a*(5*A*b^2 + 5*a^2*C + 3*b^2*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*b^4*d) + (2*(21*a^4*C + 7*a^2*b^2*(3*A + C) + b^4*(7*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*b^5*d) - (2*a^3*(A*b^2 + a^2*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^5*(a + b)*d) + (2*C*sin(c + d*x))/(7*b*d*sec(c + d*x)^(5/2)) - (2*a*C*sin(c + d*x))/(5*b^2*d*sec(c + d*x)^(3/2)) + (2*(7*a^2*C + b^2*(7*A + 5*C))*sin(c + d*x))/(21*b^3*d*sqrt(sec(c + d*x)))]

    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x))^2, x, 9, -((b*(5*A*b^2 - a^2*(4*A - C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^3*(a^2 - b^2)*d)) - ((5*A*b^2 - a^2*(2*A - 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*a^2*(a^2 - b^2)*d) - ((5*A*b^4 - a^2*b^2*(7*A - C) - 3*a^4*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^3*(a - b)*(a + b)^2*d) + (b*(5*A*b^2 - a^2*(4*A - C))*sqrt(sec(c + d*x))*sin(c + d*x))/(a^3*(a^2 - b^2)*d) - ((5*A*b^2 - a^2*(2*A - 3*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d) + ((A*b^2 + a^2*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x))^2, x, 8, ((3*A*b^2 - a^2*(2*A - C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^2*(a^2 - b^2)*d) + ((A*b^2 + a^2*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*b*(a^2 - b^2)*d) + ((3*A*b^4 - a^4*C - a^2*b^2*(5*A + C))*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)*b*(a + b)^2*d) - ((3*A*b^2 - a^2*(2*A - C))*sqrt(sec(c + d*x))*sin(c + d*x))/(a^2*(a^2 - b^2)*d) + ((A*b^2 + a^2*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x))^2, x, 7, -(((A*b^2 + a^2*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*b*(a^2 - b^2)*d)) - ((A*b^2 - a^2*C + 2*b^2*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^2*(a^2 - b^2)*d) - ((A*b^4 + a^4*C - 3*a^2*b^2*(A + C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*(a - b)*b^2*(a + b)^2*d) + ((A*b^2 + a^2*C)*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^2*sqrt(sec(c + d*x))), x, 7, ((A*b^2 + 3*a^2*C - 2*b^2*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^2*(a^2 - b^2)*d) + (a*(A*b^2 - 3*a^2*C + 4*b^2*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^3*(a^2 - b^2)*d) - ((A*b^4 - 3*a^4*C + a^2*b^2*(A + 5*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/((a - b)*b^3*(a + b)^2*d) - ((A*b^2 + a^2*C)*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^2*sec(c + d*x)^(3/2)), x, 8, -((a*(A*b^2 + 5*a^2*C - 4*b^2*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^3*(a^2 - b^2)*d)) + ((a^2*b^2*(3*A - 16*C) + 15*a^4*C - 2*b^4*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*b^4*(a^2 - b^2)*d) + (a*(3*A*b^4 - a^2*b^2*(A - 7*C) - 5*a^4*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/((a - b)*b^4*(a + b)^2*d) - ((A*b^2 + a^2*C)*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)) + ((3*A*b^2 + 5*a^2*C - 2*b^2*C)*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^2*sec(c + d*x)^(5/2)), x, 9, ((3*a^2*b^2*(5*A - 8*C) + 35*a^4*C - 2*b^4*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*b^4*(a^2 - b^2)*d) - (a*(a^2*b^2*(9*A - 20*C) + 21*a^4*C - 4*b^4*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*b^5*(a^2 - b^2)*d) - (a^2*(5*A*b^4 - 3*a^2*b^2*(A - 3*C) - 7*a^4*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/((a - b)*b^5*(a + b)^2*d) - ((A*b^2 + a^2*C)*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)) + ((5*A*b^2 + 7*a^2*C - 2*b^2*C)*sin(c + d*x))/(5*b^2*(a^2 - b^2)*d*sec(c + d*x)^(3/2)) - (a*(3*A*b^2 + 7*a^2*C - 4*b^2*C)*sin(c + d*x))/(3*b^3*(a^2 - b^2)*d*sqrt(sec(c + d*x)))]

    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x))^3, x, 10, (b*(35*A*b^4 + 3*a^4*(8*A - 3*C) - a^2*b^2*(65*A - 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^4*(a^2 - b^2)^2*d) + ((35*A*b^4 + a^4*(8*A - 21*C) - a^2*b^2*(61*A - 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(12*a^3*(a^2 - b^2)^2*d) + ((35*A*b^6 - a^2*b^4*(86*A - 3*C) + 3*a^4*b^2*(21*A - 2*C) + 15*a^6*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^4*(a - b)^2*(a + b)^3*d) - (b*(35*A*b^4 + 3*a^4*(8*A - 3*C) - a^2*b^2*(65*A - 3*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*a^4*(a^2 - b^2)^2*d) + ((35*A*b^4 + a^4*(8*A - 21*C) - a^2*b^2*(61*A - 3*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(12*a^3*(a^2 - b^2)^2*d) + ((A*b^2 + a^2*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((7*A*b^4 - 5*a^4*C - a^2*b^2*(13*A + C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x))^3, x, 9, -((15*A*b^4 + a^4*(8*A - 5*C) - a^2*b^2*(29*A + C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^3*(a^2 - b^2)^2*d) - ((5*A*b^4 - 3*a^4*C - a^2*b^2*(11*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^2*b*(a^2 - b^2)^2*d) - ((15*A*b^6 + 3*a^6*C - a^2*b^4*(38*A + C) + 5*a^4*b^2*(7*A + 2*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^3*(a - b)^2*b*(a + b)^3*d) + ((15*A*b^4 + a^4*(8*A - 5*C) - a^2*b^2*(29*A + C))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*a^3*(a^2 - b^2)^2*d) + ((A*b^2 + a^2*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((5*A*b^4 - 3*a^4*C - a^2*b^2*(11*A + 3*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [((A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x))^3, x, 8, ((3*A*b^4 - a^4*C - a^2*b^2*(9*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^2*b*(a^2 - b^2)^2*d) + ((A*b^4 + a^4*C - 7*a^2*b^2*(A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a*b^2*(a^2 - b^2)^2*d) + ((3*A*b^6 - 3*a^2*b^4*(2*A - C) - a^6*C + 5*a^4*b^2*(3*A + 2*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^2*(a - b)^2*b^2*(a + b)^3*d) + ((A*b^2 + a^2*C)*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2*sqrt(sec(c + d*x))) - ((3*A*b^4 - a^4*C - a^2*b^2*(9*A + 5*C))*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^3*sqrt(sec(c + d*x))), x, 8, ((A*b^4 - 3*a^4*C + a^2*b^2*(5*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a*b^2*(a^2 - b^2)^2*d) + ((a^2*b^2*(3*A - 5*C) + 3*a^4*C + b^4*(3*A + 8*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*b^3*(a^2 - b^2)^2*d) + ((A*b^6 - 3*a^4*b^2*(A - 2*C) - 3*a^6*C - 5*a^2*b^4*(2*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a*(a - b)^2*b^3*(a + b)^3*d) - ((A*b^2 + a^2*C)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2*sqrt(sec(c + d*x))) - ((A*b^4 - 3*a^4*C + a^2*b^2*(5*A + 9*C))*sin(c + d*x))/(4*a*b*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^3*sec(c + d*x)^(3/2)), x, 8, -((b^4*(5*A - 8*C) - 15*a^4*C + a^2*b^2*(A + 29*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*b^3*(a^2 - b^2)^2*d) - (a*(15*a^4*C + b^4*(7*A + 24*C) - a^2*b^2*(A + 33*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*b^4*(a^2 - b^2)^2*d) + ((3*A*b^6 + 15*a^6*C + 5*a^2*b^4*(2*A + 7*C) - a^4*b^2*(A + 38*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*(a - b)^2*b^4*(a + b)^3*d) - ((A*b^2 + a^2*C)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2*sec(c + d*x)^(3/2)) + ((3*A*b^4 - 5*a^4*C + a^2*b^2*(3*A + 11*C))*sin(c + d*x))/(4*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^3*sec(c + d*x)^(5/2)), x, 9, -(a*(a^2*b^2*(3*A - 65*C) - 3*b^4*(3*A - 8*C) + 35*a^4*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*b^4*(a^2 - b^2)^2*d) + ((a^4*b^2*(9*A - 223*C) - a^2*b^4*(15*A - 128*C) + 105*a^6*C + 8*b^6*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(12*b^5*(a^2 - b^2)^2*d) - (a*(15*A*b^6 + a^4*b^2*(3*A - 86*C) - 3*a^2*b^4*(2*A - 21*C) + 35*a^6*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*(a - b)^2*b^5*(a + b)^3*d) - ((A*b^2 + a^2*C)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2*sec(c + d*x)^(5/2)) + ((5*A*b^4 - 7*a^4*C + a^2*b^2*(A + 13*C))*sin(c + d*x))/(4*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)) + ((a^2*b^2*(3*A - 61*C) - b^4*(21*A - 8*C) + 35*a^4*C)*sin(c + d*x))/(12*b^3*(a^2 - b^2)^2*d*sqrt(sec(c + d*x)))]
    @test_int [(A + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^3*sec(c + d*x)^(7/2)), x, 10, -((a^2*b^4*(145*A - 192*C) - 3*a^4*b^2*(25*A - 187*C) - 315*a^6*C - 8*b^6*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(20*b^5*(a^2 - b^2)^2*d) + (a*(a^2*b^4*(33*A - 64*C) - 3*a^4*b^2*(5*A - 43*C) - 63*a^6*C - 8*b^6*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*b^6*(a^2 - b^2)^2*d) + (a^2*(35*A*b^6 - a^2*b^4*(38*A - 99*C) + 15*a^4*b^2*(A - 10*C) + 63*a^6*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*(a - b)^2*b^6*(a + b)^3*d) - ((A*b^2 + a^2*C)*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2*sec(c + d*x)^(7/2)) + ((7*A*b^4 - a^2*b^2*(A - 15*C) - 9*a^4*C)*sin(c + d*x))/(4*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)) + ((a^2*b^2*(15*A - 101*C) - b^4*(45*A - 8*C) + 63*a^4*C)*sin(c + d*x))/(20*b^3*(a^2 - b^2)^2*d*sec(c + d*x)^(3/2)) + (a*(b^4*(11*A - 8*C) - 5*a^2*b^2*(A - 7*C) - 21*a^4*C)*sin(c + d*x))/(4*b^4*(a^2 - b^2)^2*d*sqrt(sec(c + d*x)))]

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

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

    @test_int [sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 8, (-2*(a - b)*sqrt(a + b)*(16*A*b^4 + 6*a^2*b^2*(4*A + 7*C) - 21*a^4*(7*A + 9*C))*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^5*d*sqrt(sec(c + d*x))) - (2*(a - b)*sqrt(a + b)*(12*a*A*b^2 + 16*A*b^3 + 6*a^2*b*(6*A + 7*C) + 21*a^3*(7*A + 9*C))*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^4*d*sqrt(sec(c + d*x))) + (2*b*(8*A*b^2 + a^2*(13*A + 21*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*a^3*d) - (2*(6*A*b^2 - 7*a^2*(7*A + 9*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*a^2*d) + (2*A*b*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*a*d) + (2*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 7, (2*(a - b)*b*sqrt(a + b)*(8*A*b^2 + a^2*(19*A + 35*C))*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)*(6*a*A*b + 8*A*b^2 + 5*a^2*(5*A + 7*C))*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*(4*A*b^2 - 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*a^2*d) + (2*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 6, (-2*(a - b)*sqrt(a + b)*(2*A*b^2 - 3*a^2*(3*A + 5*C))*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 + 15*a*C)*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*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 7, (2*A*(a - b)*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)))/(3*a^2*d*sqrt(sec(c + d*x))) - (2*sqrt(a + b)*(A*b - a*(A + 3*C))*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*sqrt(a + b)*C*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*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 8, ((a - b)*sqrt(a + b)*(2*A - C)*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 - 2*A*b - a*C)*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))) - (a*sqrt(a + b)*C*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))) + (2*A*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d - ((2*A - C)*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 + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 8, -((a - b)*sqrt(a + b)*C*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*b*d*sqrt(sec(c + d*x))) + (sqrt(a + b)*(8*A*b + (a + 2*b)*C)*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)*(a^2*C - 4*b^2*(2*A + C))*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))) + (C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) + (a*C*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 + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 9, ((a - b)*sqrt(a + b)*(3*a^2*C - 8*b^2*(3*A + 2*C))*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)*(3*a^2*C - 2*a*b*C - 8*b^2*(3*A + 2*C))*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))) - (a*sqrt(a + b)*(8*A*b^2 + (a^2 + 4*b^2)*C)*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))) - (a*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*b*d*sqrt(sec(c + d*x))) - ((3*a^2*C - 8*b^2*(3*A + 2*C))*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(24*b^2*d)]
    @test_int [(sqrt(a + b*cos(c + d*x))*(A + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 10, -((a - b)*sqrt(a + b)*(48*A*b^2 + 15*a^2*C + 28*b^2*C)*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*b^3*d*sqrt(sec(c + d*x))) + (sqrt(a + b)*(15*a^3*C - 10*a^2*b*C + 24*b^3*(4*A + 3*C) + 4*a*b^2*(12*A + 7*C))*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^3*d*sqrt(sec(c + d*x))) + (sqrt(a + b)*(5*a^4*C + 8*a^2*b^2*(2*A + C) - 16*b^4*(4*A + 3*C))*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^4*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(4*b*d*sec(c + d*x)^(3/2)) + ((5*a^2*C + 4*b^2*(4*A + 3*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*b^2*d*sqrt(sec(c + d*x))) - (5*a*C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*b^2*d*sqrt(sec(c + d*x))) + (a*(48*A*b^2 + 15*a^2*C + 28*b^2*C)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(192*b^3*d)]

    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 8, (2*(a - b)*sqrt(a + b)*(8*A*b^4 + 21*a^4*(7*A + 9*C) + 3*a^2*b^2*(11*A + 21*C))*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)*(6*a*A*b^2 + 8*A*b^3 - 21*a^3*(7*A + 9*C) + a^2*(39*A*b + 63*b*C))*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))) - (4*b*(2*A*b^2 - a^2*(44*A + 63*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*a^2*d) + (2*(3*A*b^2 + 7*a^2*(7*A + 9*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*a*d) + (2*A*b*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(21*d) + (2*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))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 7, (-4*(a - b)*b*sqrt(a + b)*(3*A*b^2 - a^2*(41*A + 70*C))*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)*(25*a^2*A - 57*a*A*b - 6*A*b^2 + 35*a^2*C - 105*a*b*C)*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*(3*A*b^2 + 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*a*d) + (6*A*b*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*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))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 8, (2*(a - b)*sqrt(a + b)*(A*b^2 + a^2*(3*A + 5*C))*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)))/(5*a^2*d*sqrt(sec(c + d*x))) - (2*sqrt(a + b)*(A*b^2 - 2*a*b*(2*A + 5*C) + a^2*(3*A + 5*C))*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)))/(5*a*d*sqrt(sec(c + d*x))) - (2*b*sqrt(a + b)*C*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*b*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(5*d) + (2*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))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 9, ((a - b)*b*sqrt(a + b)*(8*A - 3*C)*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)*(6*A*b^2 + 2*a^2*(A + 3*C) - a*(8*A*b - 3*b*C))*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))) - (3*a*sqrt(a + b)*C*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*b*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d - (b*(8*A - 3*C)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*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))^(3/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 9, ((a - b)*sqrt(a + b)*(8*A - 5*C)*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*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(8*a*A - 16*A*b - 5*a*C - 2*b*C)*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)*(8*A*b^2 + 3*a^2*C + 4*b^2*C)*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*(4*A - C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) - (a*(8*A - 5*C)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*d) + (2*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))^(3/2)*(A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 9, -((a - b)*sqrt(a + b)*(3*a^2*C + 8*b^2*(3*A + 2*C))*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)*(48*a*A*b + 24*A*b^2 + 3*a^2*C + 14*a*b*C + 16*b^2*C)*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))) - (a*sqrt(a + b)*(24*A*b^2 - a^2*C + 12*b^2*C)*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))) + (a*C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + ((3*a^2*C + 8*b^2*(3*A + 2*C))*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 + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 10, -((a - b)*sqrt(a + b)*(80*A*b^2 - 3*a^2*C + 52*b^2*C)*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)))/(64*b^2*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(3*a^3*C - 2*a^2*b*C - 8*b^3*(4*A + 3*C) - 4*a*b^2*(20*A + 13*C))*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)))/(64*b^2*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(3*a^4*C + 24*a^2*b^2*(2*A + C) + 16*b^4*(4*A + 3*C))*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))) - ((3*a^2*C - 4*b^2*(4*A + 3*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*b*d*sqrt(sec(c + d*x))) - (a*C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(8*b*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*b*d*sqrt(sec(c + d*x))) + (a*(80*A*b^2 - 3*a^2*C + 52*b^2*C)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(64*b^2*d)]

    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(13/2), x, 9, (2*(a - b)*b*sqrt(a + b)*(8*A*b^4 + 3*a^2*b^2*(17*A + 33*C) + a^4*(741*A + 957*C))*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)))/(693*a^4*d*sqrt(sec(c + d*x))) + (2*(a - b)*sqrt(a + b)*(6*a*A*b^3 + 8*A*b^4 + 15*a^4*(9*A + 11*C) + 3*a^2*b^2*(19*A + 33*C) - 6*a^3*b*(101*A + 132*C))*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)))/(693*a^3*d*sqrt(sec(c + d*x))) - (2*(4*A*b^4 - 15*a^4*(9*A + 11*C) - a^2*b^2*(205*A + 297*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(693*a^2*d) + (2*b*(3*A*b^2 + a^2*(229*A + 297*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(693*a*d) + (2*(5*A*b^2 + 3*a^2*(9*A + 11*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(231*d) + (10*A*b*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(9/2)*sin(c + d*x))/(99*d) + (2*A*(a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^(11/2)*sin(c + d*x))/(11*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 8, (-2*(a - b)*sqrt(a + b)*(10*A*b^4 - 21*a^4*(7*A + 9*C) - 3*a^2*b^2*(93*A + 161*C))*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 + 21*a^3*(7*A + 9*C) + 15*a*b^2*(11*A + 21*C) - 6*a^2*b*(19*A + 28*C))*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*b*(5*A*b^2 + a^2*(163*A + 231*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*a*d) + (2*(15*A*b^2 + 7*a^2*(7*A + 9*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d) + (10*A*b*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d) + (2*A*(a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 9, (2*(a - b)*b*sqrt(a + b)*(3*A*b^2 + a^2*(29*A + 49*C))*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)))/(21*a^2*d*sqrt(sec(c + d*x))) - (2*sqrt(a + b)*(3*A*b^3 - 9*a*b^2*(3*A + 7*C) - a^3*(5*A + 7*C) + a^2*b*(29*A + 49*C))*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)))/(21*a*d*sqrt(sec(c + d*x))) - (2*b^2*sqrt(a + b)*C*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*(3*A*b^2 + a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(21*d) + (2*A*b*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(5/2)*sin(c + d*x))/(7*d) + (2*A*(a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 10, ((a - b)*sqrt(a + b)*(b^2*(46*A - 15*C) + 6*a^2*(3*A + 5*C))*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))) + (sqrt(a + b)*(30*A*b^3 - a*b^2*(46*A - 15*C) - 6*a^3*(3*A + 5*C) + a^2*(34*A*b + 90*b*C))*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))) - (5*a*b*sqrt(a + b)*C*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*(5*A*b^2 + a^2*(3*A + 5*C))*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) - ((b^2*(46*A - 15*C) + 6*a^2*(3*A + 5*C))*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*A*b*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d) + (2*A*(a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 10, ((a - b)*b*sqrt(a + b)*(56*A - 27*C)*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)))/(12*d*sqrt(sec(c + d*x))) + (sqrt(a + b)*(6*b^2*(12*A + C) + 8*a^2*(A + 3*C) - a*(56*A*b - 27*b*C))*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)))/(12*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(8*A*b^2 + 15*a^2*C + 4*b^2*C)*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^2*(8*A - C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) - (a*b*(56*A - 27*C)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(12*d) + (10*A*b*(a + b*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 10, ((a - b)*sqrt(a + b)*(a^2*(48*A - 33*C) - 8*b^2*(3*A + 2*C))*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)*(a^2*(48*A - 33*C) - 8*b^2*(3*A + 2*C) - 2*a*b*(72*A + 13*C))*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))) - (5*a*sqrt(a + b)*(8*A*b^2 + (a^2 + 4*b^2)*C)*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))) - (a*b*(8*A - 3*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) - (b*(6*A - C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) - ((a^2*(48*A - 33*C) - 8*b^2*(3*A + 2*C))*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(24*d) + (2*A*(a + b*cos(c + d*x))^(5/2)*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^(5/2)*(A + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 10, -((a - b)*sqrt(a + b)*(432*A*b^2 + 15*a^2*C + 284*b^2*C)*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*b*d*sqrt(sec(c + d*x))) + (sqrt(a + b)*(15*a^3*C + 24*b^3*(4*A + 3*C) + 2*a^2*b*(192*A + 59*C) + 4*a*b^2*(108*A + 71*C))*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)*(5*a^4*C - 120*a^2*b^2*(2*A + C) - 16*b^4*(4*A + 3*C))*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))) + ((5*a^2*C + 4*b^2*(4*A + 3*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*d*sqrt(sec(c + d*x))) + (5*a*C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) + (a*(432*A*b^2 + 15*a^2*C + 284*b^2*C)*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 + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 11, ((a - b)*sqrt(a + b)*(45*a^4*C - 256*b^4*(5*A + 4*C) - 12*a^2*b^2*(220*A + 141*C))*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))) - (sqrt(a + b)*(45*a^4*C - 30*a^3*b*C - 256*b^4*(5*A + 4*C) - 12*a^2*b^2*(220*A + 141*C) - 8*a*b^3*(260*A + 193*C))*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)))/(1920*b^2*d*sqrt(sec(c + d*x))) - (a*sqrt(a + b)*(3*a^4*C + 40*a^2*b^2*(2*A + C) + 80*b^4*(4*A + 3*C))*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))) + (a*(240*A*b^2 - 15*a^2*C + 172*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(320*b*d*sqrt(sec(c + d*x))) - ((15*a^2*C - 16*b^2*(5*A + 4*C))*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(240*b*d*sqrt(sec(c + d*x))) - (3*a*C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(40*b*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(5*b*d*sqrt(sec(c + d*x))) - ((45*a^4*C - 256*b^4*(5*A + 4*C) - 12*a^2*b^2*(220*A + 141*C))*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 [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2))/sqrt(a + b*cos(c + d*x)), x, 7, (-4*(a - b)*b*sqrt(a + b)*(24*A*b^2 + a^2*(22*A + 35*C))*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^5*d*sqrt(sec(c + d*x))) - (2*sqrt(a + b)*(12*a*A*b^2 - 48*A*b^3 - 5*a^3*(5*A + 7*C) - a^2*(44*A*b + 70*b*C))*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^4*d*sqrt(sec(c + d*x))) + (2*(24*A*b^2 + 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*a^3*d) - (12*A*b*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*a^2*d) + (2*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*a*d)]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2))/sqrt(a + b*cos(c + d*x)), x, 6, (2*(a - b)*sqrt(a + b)*(8*A*b^2 + 3*a^2*(3*A + 5*C))*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)*(2*a*A*b - 8*A*b^2 - 3*a^2*(3*A + 5*C))*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))) - (8*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 [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/sqrt(a + b*cos(c + d*x)), x, 5, (-4*A*(a - b)*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)))/(3*a^3*d*sqrt(sec(c + d*x))) + (2*sqrt(a + b)*(2*A*b + a*(A + 3*C))*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 [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/sqrt(a + b*cos(c + d*x)), x, 7, (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*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)))/(a*d*sqrt(sec(c + d*x))) - (2*sqrt(a + b)*C*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 + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/sqrt(a + b*cos(c + d*x)), x, 7, -(((a - b)*sqrt(a + b)*C*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)*(2*A*b + a*C)*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*d*sqrt(sec(c + d*x))) + (a*sqrt(a + b)*C*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))) + (C*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(b*d)]
    @test_int [(A + C*cos(c + d*x)^2)/(sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))), x, 8, (3*(a - b)*sqrt(a + b)*C*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*b^2*d*sqrt(sec(c + d*x))) - ((3*a - 2*b)*sqrt(a + b)*C*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)*(3*a^2*C + 4*b^2*(2*A + C))*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))) + (C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*b*d*sqrt(sec(c + d*x))) - (3*a*C*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*b^2*d)]

    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2))/(a + b*cos(c + d*x))^(3/2), x, 7, -((2*(16*A*b^4 - 2*a^2*b^2*(4*A - 5*C) - a^4*(3*A + 5*C))*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)))/(5*a^5*sqrt(a + b)*d*sqrt(sec(c + d*x)))) - (2*(12*a*A*b^2 + 16*A*b^3 + 2*a^2*b*(2*A + 5*C) + a^3*(3*A + 5*C))*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)))/(5*a^4*sqrt(a + b)*d*sqrt(sec(c + d*x))) + (2*b*(8*A*b^2 - a^2*(3*A - 5*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(5*a^3*(a^2 - b^2)*d) + (2*(A*b^2 + a^2*C)*sec(c + d*x)^(5/2)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (2*(6*A*b^2 - a^2*(A - 5*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*a^2*(a^2 - b^2)*d)]
    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x))^(3/2), x, 6, (2*b*(8*A*b^2 - a^2*(5*A - 3*C))*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*(6*a*A*b + 8*A*b^2 + a^2*(A + 3*C))*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*(A*b^2 + a^2*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (2*(4*A*b^2 - a^2*(A - 3*C))*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x))^(3/2), x, 5, -((2*(2*A*b^2 - a^2*(A - C))*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 - C))*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*(A*b^2 + a^2*C)*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 + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x))^(3/2), x, 7, (2*(A*b^2 + a^2*C)*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*b*sqrt(a + b)*d*sqrt(sec(c + d*x))) + (2*(A*b - a*C)*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)*C*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*b^2 + a^2*C)*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 + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))), x, 8, -(((2*A*b^2 + 3*a^2*C - b^2*C)*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^2 + a*(3*a + b)*C)*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^2*sqrt(a + b)*d*sqrt(sec(c + d*x))) + (3*a*sqrt(a + b)*C*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*b^2 + a^2*C)*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))) + ((2*A*b^2 + 3*a^2*C - b^2*C)*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 + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)), x, 9, ((8*A*b^2 + 15*a^2*C - 7*b^2*C)*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*b^3*sqrt(a + b)*d*sqrt(sec(c + d*x))) - ((8*A*b^2 + (15*a^2 + 5*a*b - 2*b^2)*C)*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^3*sqrt(a + b)*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(8*A*b^2 + 15*a^2*C + 4*b^2*C)*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^4*d*sqrt(sec(c + d*x))) - (2*(A*b^2 + a^2*C)*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)) + ((4*A*b^2 + 5*a^2*C - b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d*sqrt(sec(c + d*x))) - (a*(8*A*b^2 + 15*a^2*C - 7*b^2*C)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*b^3*(a^2 - b^2)*d)]

    @test_int [((A + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x))^(5/2), x, 7, -((4*b*(8*A*b^4 + a^4*(4*A - 3*C) - a^2*b^2*(14*A - C))*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*sqrt(a + b)*(a^2 - b^2)*d*sqrt(sec(c + d*x)))) - (2*(12*a*A*b^3 + 16*A*b^4 - 2*a^2*b^2*(8*A - C) - a^4*(A + 3*C) - a^3*(9*A*b - 3*b*C))*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*(A*b^2 + a^2*C)*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)) + (4*(5*a^2*A*b^2 - 3*A*b^4 + 2*a^4*C)*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*(8*A*b^4 + a^4*(A - 5*C) - a^2*b^2*(13*A - C))*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 + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x))^(5/2), x, 6, (2*(8*A*b^4 + 3*a^4*(A - C) - a^2*b^2*(15*A + C))*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)*(a^2 - b^2)*d*sqrt(sec(c + d*x))) + (2*(6*a*A*b^2 + 8*A*b^3 - 3*a^3*(A - C) - a^2*b*(9*A + C))*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*(A*b^2 + a^2*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)) - (4*(2*A*b^4 - a^4*C - a^2*b^2*(4*A + C))*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 + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x))^(5/2), x, 6, -((4*b*(A*b^2 - a^2*(3*A + 2*C))*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*b*(A + C) - a^2*(3*A + C))*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*(A*b^2 + a^2*C)*sin(c + d*x))/(3*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))) + (4*b*(A*b^2 - a^2*(3*A + 2*C))*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 + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^(5/2)*sqrt(sec(c + d*x))), x, 8, -((2*(A*b^4 - 3*a^4*C + a^2*b^2*(3*A + 7*C))*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*b^2*sqrt(a + b)*(a^2 - b^2)*d*sqrt(sec(c + d*x)))) - (2*(A*b^3 + 3*a^3*C + a^2*b*C - 3*a*b^2*(A + 2*C))*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)*C*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*b^2 + a^2*C)*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*b^4 - 3*a^4*C + a^2*b^2*(3*A + 7*C))*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 + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)), x, 9, ((8*A*b^4 - (15*a^4 - 26*a^2*b^2 + 3*b^4)*C)*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))) - ((6*A*b^4 - a*b^3*(2*A - 3*C) - 15*a^4*C - 5*a^3*b*C + 21*a^2*b^2*C)*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^3*(a + b)^(3/2)*d*sqrt(sec(c + d*x))) + (5*a*sqrt(a + b)*C*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*b^2 + a^2*C)*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*(3*A*b^4 - 5*a^4*C + a^2*b^2*(A + 9*C))*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))) - ((8*A*b^4 - (15*a^4 - 26*a^2*b^2 + 3*b^4)*C)*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)]

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

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

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

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

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

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

    @test_int [(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 8, (-2*(3*A*b + 3*a*B + 5*b*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(5*a*A + 7*b*B + 7*a*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*(3*A*b + 3*a*B + 5*b*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*(5*a*A + 7*b*B + 7*a*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(21*d) + (2*(A*b + a*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d) + (2*a*A*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 7, (-2*(3*a*A + 5*b*B + 5*a*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(A*b + a*B + 3*b*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*(3*a*A + 5*b*B + 5*a*C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 6, (-2*(A*b + a*B - b*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*(3*b*B + a*(A + 3*C))*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 6, (2*(b*B - a*(A - C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*(3*A*b + 3*a*B + b*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*b*C*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (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) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 6, (2*(5*A*b + 5*a*B + 3*b*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(b*B + a*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*b*C*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*(b*B + a*C)*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) + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 7, (2*(5*a*A + 3*b*B + 3*a*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(7*A*b + 7*a*B + 5*b*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b*C*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*(b*B + a*C)*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) + (2*(7*A*b + 7*a*B + 5*b*C)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 8, (2*(9*A*b + 9*a*B + 7*b*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(7*a*A + 5*b*B + 5*a*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b*C*sin(c + d*x))/(9*d*sec(c + d*x)^(7/2)) + (2*(b*B + a*C)*sin(c + d*x))/(7*d*sec(c + d*x)^(5/2)) + (2*(9*A*b + 9*a*B + 7*b*C)*sin(c + d*x))/(45*d*sec(c + d*x)^(3/2)) + (2*(7*a*A + 5*b*B + 5*a*C)*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 9, (-2*(18*a*b*B + 3*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(10*a*A*b + 5*a^2*B + 7*b^2*B + 14*a*b*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*(18*a*b*B + 3*b^2*(3*A + 5*C) + a^2*(7*A + 9*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*(10*a*A*b + 5*a^2*B + 7*b^2*B + 14*a*b*C)*sec(c + d*x)^(3/2)*sin(c + d*x))/(21*d) + (2*(4*A*b^2 + 18*a*b*B + a^2*(7*A + 9*C))*sec(c + d*x)^(5/2)*sin(c + d*x))/(45*d) + (2*a*(4*A*b + 9*a*B)*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d) + (2*A*(a + b*cos(c + d*x))^2*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 8, (-2*(6*a*A*b + 3*a^2*B + 5*b^2*B + 10*a*b*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(14*a*b*B + 7*b^2*(A + 3*C) + a^2*(5*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*(6*a*A*b + 3*a^2*B + 5*b^2*B + 10*a*b*C)*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*(4*A*b^2 + 14*a*b*B + a^2*(5*A + 7*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(21*d) + (2*a*(4*A*b + 7*a*B)*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*A*(a + b*cos(c + d*x))^2*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 7, (-2*(10*a*b*B + 5*b^2*(A - C) + a^2*(3*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(a^2*B + 3*b^2*B + 2*a*b*(A + 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) + (2*(4*A*b^2 + 10*a*b*B + a^2*(3*A + 5*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*a*(4*A*b + 5*a*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*A*(a + b*cos(c + d*x))^2*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 7, (-2*(a^2*B - b^2*B + 2*a*b*(A - C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/d + (2*(6*a*b*B + b^2*(3*A + C) + a^2*(A + 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*b^2*(A - C)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (2*a*(4*A*b + 3*a*B)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + b*cos(c + d*x))^2*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 7, (2*(10*a*b*B - 5*a^2*(A - C) + b^2*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(3*a^2*B + b^2*B + 2*a*b*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*b^2*(5*A - C)*sin(c + d*x))/(5*d*sec(c + d*x)^(3/2)) - (2*b*(6*a*A - b*B - 2*a*C)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (2*A*(a + b*cos(c + d*x))^2*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) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 7, (2*(10*a*A*b + 5*a^2*B + 3*b^2*B + 6*a*b*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(14*a*b*B + 7*a^2*(3*A + C) + b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b*(7*b*B + 4*a*C)*sin(c + d*x))/(35*d*sec(c + d*x)^(3/2)) + (2*(7*A*b^2 + 14*a*b*B + 4*a^2*C + 5*b^2*C)*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) + (2*C*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^2*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 8, (2*(18*a*b*B + 3*a^2*(5*A + 3*C) + b^2*(9*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(14*a*A*b + 7*a^2*B + 5*b^2*B + 10*a*b*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b*(9*b*B + 4*a*C)*sin(c + d*x))/(63*d*sec(c + d*x)^(5/2)) + (2*(9*A*b^2 + 18*a*b*B + 4*a^2*C + 7*b^2*C)*sin(c + d*x))/(45*d*sec(c + d*x)^(3/2)) + (2*C*(a + b*cos(c + d*x))^2*sin(c + d*x))/(9*d*sec(c + d*x)^(3/2)) + (2*(14*a*A*b + 7*a^2*B + 5*b^2*B + 10*a*b*C)*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) + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 9, (2*(18*a*A*b + 9*a^2*B + 7*b^2*B + 14*a*b*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(110*a*b*B + 11*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (2*b*(11*b*B + 4*a*C)*sin(c + d*x))/(99*d*sec(c + d*x)^(7/2)) + (2*(11*A*b^2 + 22*a*b*B + 4*a^2*C + 9*b^2*C)*sin(c + d*x))/(77*d*sec(c + d*x)^(5/2)) + (2*C*(a + b*cos(c + d*x))^2*sin(c + d*x))/(11*d*sec(c + d*x)^(5/2)) + (2*(18*a*A*b + 9*a^2*B + 7*b^2*B + 14*a*b*C)*sin(c + d*x))/(45*d*sec(c + d*x)^(3/2)) + (2*(110*a*b*B + 11*a^2*(7*A + 5*C) + 5*b^2*(11*A + 9*C))*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]

    @test_int [(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 9, (-2*(27*a^2*b*B + 15*b^3*B + 9*a*b^2*(3*A + 5*C) + a^3*(7*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(5*a^3*B + 21*a*b^2*B + 7*b^3*(A + 3*C) + 3*a^2*b*(5*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*(27*a^2*b*B + 15*b^3*B + 9*a*b^2*(3*A + 5*C) + a^3*(7*A + 9*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*(8*A*b^3 + 15*a^3*B + 54*a*b^2*B + 9*a^2*b*(5*A + 7*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(63*d) + (2*a*(24*A*b^2 + 99*a*b*B + 7*a^2*(7*A + 9*C))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d) + (2*(2*A*b + 3*a*B)*(a + b*cos(c + d*x))^2*sec(c + d*x)^(7/2)*sin(c + d*x))/(21*d) + (2*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 8, (-2*(3*a^3*B + 15*a*b^2*B + 5*b^3*(A - C) + 3*a^2*b*(3*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(21*a^2*b*B + 21*b^3*B + 21*a*b^2*(A + 3*C) + a^3*(5*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*(24*A*b^3 + 21*a^3*B + 98*a*b^2*B + 21*a^2*b*(3*A + 5*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(35*d) + (2*a*(24*A*b^2 + 63*a*b*B + 5*a^2*(5*A + 7*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*(6*A*b + 7*a*B)*(a + b*cos(c + d*x))^2*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 8, (-2*(15*a^2*b*B - 5*b^3*B + 15*a*b^2*(A - C) + a^3*(3*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(a^3*B + 9*a*b^2*B + b^3*(3*A + C) + 3*a^2*b*(A + 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*b^2*(9*A*b + 5*a*B - 5*b*C)*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) + (2*a*(24*A*b^2 + 35*a*b*B + 3*a^2*(3*A + 5*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*(6*A*b + 5*a*B)*(a + b*cos(c + d*x))^2*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 8, (-2*(5*a^3*B - 15*a*b^2*B + 15*a^2*b*(A - C) - b^3*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(9*a^2*b*B + b^3*B + 3*a*b^2*(3*A + C) + a^3*(A + 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*b^2*(35*A*b + 15*a*B - 3*b*C)*sin(c + d*x))/(15*d*sec(c + d*x)^(3/2)) - (2*b*(6*a^2*B - b^2*B + 3*a*b*(5*A - C))*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + (2*(2*A*b + a*B)*(a + b*cos(c + d*x))^2*sqrt(sec(c + d*x))*sin(c + d*x))/d + (2*A*(a + b*cos(c + d*x))^3*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 8, (2*(15*a^2*b*B + 3*b^3*B - 5*a^3*(A - C) + 3*a*b^2*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(21*a^3*B + 21*a*b^2*B + 21*a^2*b*(3*A + C) + b^3*(7*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) - (2*b^2*(35*a*A - 7*b*B - 11*a*C)*sin(c + d*x))/(35*d*sec(c + d*x)^(3/2)) + (2*b*(21*a*b*B - 6*a^2*(7*A - 3*C) + b^2*(7*A + 5*C))*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) - (2*b*(7*A - C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d*sqrt(sec(c + d*x))) + (2*A*(a + b*cos(c + d*x))^3*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 8, (2*(15*a^3*B + 27*a*b^2*B + 9*a^2*b*(5*A + 3*C) + b^3*(9*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(21*a^2*b*B + 5*b^3*B + 7*a^3*(3*A + C) + 3*a*b^2*(7*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b*(63*A*b^2 + 99*a*b*B + 24*a^2*C + 49*b^2*C)*sin(c + d*x))/(315*d*sec(c + d*x)^(3/2)) + (2*(54*a^2*b*B + 15*b^3*B + 8*a^3*C + 9*a*b^2*(7*A + 5*C))*sin(c + d*x))/(63*d*sqrt(sec(c + d*x))) + (2*(3*b*B + 2*a*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) + (2*C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(9*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 9, (2*(27*a^2*b*B + 7*b^3*B + 3*a^3*(5*A + 3*C) + 3*a*b^2*(9*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(77*a^3*B + 165*a*b^2*B + 33*a^2*b*(7*A + 5*C) + 5*b^3*(11*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (2*b*(99*A*b^2 + 143*a*b*B + 24*a^2*C + 81*b^2*C)*sin(c + d*x))/(693*d*sec(c + d*x)^(5/2)) + (2*(242*a^2*b*B + 77*b^3*B + 24*a^3*C + 33*a*b^2*(9*A + 7*C))*sin(c + d*x))/(495*d*sec(c + d*x)^(3/2)) + (2*(11*b*B + 6*a*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(99*d*sec(c + d*x)^(3/2)) + (2*C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(11*d*sec(c + d*x)^(3/2)) + (2*(77*a^3*B + 165*a*b^2*B + 33*a^2*b*(7*A + 5*C) + 5*b^3*(11*A + 9*C))*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^3*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 10, (2*(117*a^3*B + 273*a*b^2*B + 39*a^2*b*(9*A + 7*C) + 7*b^3*(13*A + 11*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(195*d) + (2*(165*a^2*b*B + 45*b^3*B + 11*a^3*(7*A + 5*C) + 15*a*b^2*(11*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (2*b*(143*A*b^2 + 195*a*b*B + 24*a^2*C + 121*b^2*C)*sin(c + d*x))/(1287*d*sec(c + d*x)^(7/2)) + (2*(338*a^2*b*B + 117*b^3*B + 24*a^3*C + 39*a*b^2*(11*A + 9*C))*sin(c + d*x))/(1001*d*sec(c + d*x)^(5/2)) + (2*(13*b*B + 6*a*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(143*d*sec(c + d*x)^(5/2)) + (2*C*(a + b*cos(c + d*x))^3*sin(c + d*x))/(13*d*sec(c + d*x)^(5/2)) + (2*(117*a^3*B + 273*a*b^2*B + 39*a^2*b*(9*A + 7*C) + 7*b^3*(13*A + 11*C))*sin(c + d*x))/(585*d*sec(c + d*x)^(3/2)) + (2*(165*a^2*b*B + 45*b^3*B + 11*a^3*(7*A + 5*C) + 15*a*b^2*(11*A + 9*C))*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]

    @test_int [(a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(13/2), x, 10, (-2*(7*a^4*B + 54*a^2*b^2*B + 15*b^4*B + 12*a*b^3*(3*A + 5*C) + 4*a^3*b*(7*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(220*a^3*b*B + 308*a*b^3*B + 77*b^4*(A + 3*C) + 66*a^2*b^2*(5*A + 7*C) + 5*a^4*(9*A + 11*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (2*(7*a^4*B + 54*a^2*b^2*B + 15*b^4*B + 12*a*b^3*(3*A + 5*C) + 4*a^3*b*(7*A + 9*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*(64*A*b^4 + 660*a^3*b*B + 682*a*b^3*B + 15*a^4*(9*A + 11*C) + 9*a^2*b^2*(101*A + 143*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(693*d) + (2*a*(192*A*b^3 + 539*a^3*B + 1353*a*b^2*B + 2*a^2*b*(673*A + 891*C))*sec(c + d*x)^(5/2)*sin(c + d*x))/(3465*d) + (2*(16*A*b^2 + 55*a*b*B + 3*a^2*(9*A + 11*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^(7/2)*sin(c + d*x))/(231*d) + (2*(8*A*b + 11*a*B)*(a + b*cos(c + d*x))^3*sec(c + d*x)^(9/2)*sin(c + d*x))/(99*d) + (2*A*(a + b*cos(c + d*x))^4*sec(c + d*x)^(11/2)*sin(c + d*x))/(11*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 9, (-2*(36*a^3*b*B + 60*a*b^3*B + 15*b^4*(A - C) + 18*a^2*b^2*(3*A + 5*C) + a^4*(7*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(5*a^4*B + 42*a^2*b^2*B + 21*b^4*B + 28*a*b^3*(A + 3*C) + 4*a^3*b*(5*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*(192*A*b^4 + 756*a^3*b*B + 1098*a*b^3*B + 21*a^4*(7*A + 9*C) + 7*a^2*b^2*(155*A + 261*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(315*d) + (2*a*(64*A*b^3 + 75*a^3*B + 261*a*b^2*B + a^2*(202*A*b + 294*b*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*d) + (2*(48*A*b^2 + 117*a*b*B + 7*a^2*(7*A + 9*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d) + (2*(8*A*b + 9*a*B)*(a + b*cos(c + d*x))^3*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d) + (2*A*(a + b*cos(c + d*x))^4*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 9, (-2*(3*a^4*B + 30*a^2*b^2*B - 5*b^4*B + 20*a*b^3*(A - C) + 4*a^3*b*(3*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(28*a^3*b*B + 84*a*b^3*B + 7*b^4*(3*A + C) + 42*a^2*b^2*(A + 3*C) + a^4*(5*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) - (2*b^2*(98*a*b*B + b^2*(87*A - 35*C) + 5*a^2*(5*A + 7*C))*sin(c + d*x))/(105*d*sqrt(sec(c + d*x))) + (2*a*(192*A*b^3 + 63*a^3*B + 413*a*b^2*B + a^2*(202*A*b + 350*b*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(105*d) + (2*(48*A*b^2 + 77*a*b*B + 5*a^2*(5*A + 7*C))*(a + b*cos(c + d*x))^2*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*(8*A*b + 7*a*B)*(a + b*cos(c + d*x))^3*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*A*(a + b*cos(c + d*x))^4*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 9, (-2*(20*a^3*b*B - 20*a*b^3*B + 30*a^2*b^2*(A - C) - b^4*(5*A + 3*C) + a^4*(3*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(a^4*B + 18*a^2*b^2*B + b^4*B + 4*a*b^3*(3*A + C) + 4*a^3*b*(A + 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*d) - (2*b^2*(50*a*b*B + b^2*(59*A - 3*C) + 3*a^2*(3*A + 5*C))*sin(c + d*x))/(15*d*sec(c + d*x)^(3/2)) - (2*b*(105*a^2*b*B - 5*b^3*B + 4*a*b^2*(33*A - 5*C) + 6*a^3*(3*A + 5*C))*sin(c + d*x))/(15*d*sqrt(sec(c + d*x))) + (2*(16*A*b^2 + 15*a*b*B + a^2*(3*A + 5*C))*(a + b*cos(c + d*x))^2*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) + (2*(8*A*b + 5*a*B)*(a + b*cos(c + d*x))^3*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*d) + (2*A*(a + b*cos(c + d*x))^4*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 9, (-2*(5*a^4*B - 30*a^2*b^2*B - 3*b^4*B + 20*a^3*b*(A - C) - 4*a*b^3*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*d) + (2*(84*a^3*b*B + 28*a*b^3*B + 42*a^2*b^2*(3*A + C) + 7*a^4*(A + 3*C) + b^4*(7*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) - (2*b^2*(350*a*A*b + 105*a^2*B - 21*b^2*B - 54*a*b*C)*sin(c + d*x))/(105*d*sec(c + d*x)^(3/2)) - (2*b*(42*a^3*B - 28*a*b^2*B + 3*a^2*b*(49*A - 13*C) - b^3*(7*A + 5*C))*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) - (2*b*(21*A*b + 7*a*B - b*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(7*d*sqrt(sec(c + d*x))) + (2*(8*A*b + 3*a*B)*(a + b*cos(c + d*x))^3*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + b*cos(c + d*x))^4*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d)]
    @test_int [(a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 9, (2*(60*a^3*b*B + 36*a*b^3*B - 15*a^4*(A - C) + 18*a^2*b^2*(5*A + 3*C) + b^4*(9*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(21*a^4*B + 42*a^2*b^2*B + 5*b^4*B + 28*a^3*b*(3*A + C) + 4*a*b^3*(7*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*d) + (2*b^2*(162*a*b*B - a^2*(315*A - 123*C) + 7*b^2*(9*A + 7*C))*sin(c + d*x))/(315*d*sec(c + d*x)^(3/2)) + (2*b*(117*a^2*b*B + 15*b^3*B - a^3*(126*A - 62*C) + 12*a*b^2*(7*A + 5*C))*sin(c + d*x))/(63*d*sqrt(sec(c + d*x))) - (2*b*(21*a*A - 3*b*B - 5*a*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(21*d*sqrt(sec(c + d*x))) - (2*b*(9*A - C)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(9*d*sqrt(sec(c + d*x))) + (2*A*(a + b*cos(c + d*x))^4*sqrt(sec(c + d*x))*sin(c + d*x))/d]
    @test_int [(a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 9, (2*(15*a^4*B + 54*a^2*b^2*B + 7*b^4*B + 12*a^3*b*(5*A + 3*C) + 4*a*b^3*(9*A + 7*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(15*d) + (2*(308*a^3*b*B + 220*a*b^3*B + 77*a^4*(3*A + C) + 66*a^2*b^2*(7*A + 5*C) + 5*b^4*(11*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (2*b*(1353*a^2*b*B + 539*b^3*B + 192*a^3*C + 2*a*b^2*(891*A + 673*C))*sin(c + d*x))/(3465*d*sec(c + d*x)^(3/2)) + (2*(682*a^3*b*B + 660*a*b^3*B + 64*a^4*C + 15*b^4*(11*A + 9*C) + 9*a^2*b^2*(143*A + 101*C))*sin(c + d*x))/(693*d*sqrt(sec(c + d*x))) + (2*(33*A*b^2 + 55*a*b*B + 16*a^2*C + 27*b^2*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(231*d*sqrt(sec(c + d*x))) + (2*(11*b*B + 8*a*C)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(99*d*sqrt(sec(c + d*x))) + (2*C*(a + b*cos(c + d*x))^4*sin(c + d*x))/(11*d*sqrt(sec(c + d*x)))]
    @test_int [((a + b*cos(c + d*x))^4*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 10, (2*(468*a^3*b*B + 364*a*b^3*B + 39*a^4*(5*A + 3*C) + 78*a^2*b^2*(9*A + 7*C) + 7*b^4*(13*A + 11*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(195*d) + (2*(77*a^4*B + 330*a^2*b^2*B + 45*b^4*B + 44*a^3*b*(7*A + 5*C) + 20*a*b^3*(11*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(231*d) + (2*b*(2171*a^2*b*B + 1053*b^3*B + 192*a^3*C + 2*a*b^2*(1573*A + 1259*C))*sin(c + d*x))/(9009*d*sec(c + d*x)^(5/2)) + (2*(3458*a^3*b*B + 4004*a*b^3*B + 192*a^4*C + 77*b^4*(13*A + 11*C) + 11*a^2*b^2*(637*A + 491*C))*sin(c + d*x))/(6435*d*sec(c + d*x)^(3/2)) + (2*(143*A*b^2 + 221*a*b*B + 48*a^2*C + 121*b^2*C)*(a + b*cos(c + d*x))^2*sin(c + d*x))/(1287*d*sec(c + d*x)^(3/2)) + (2*(13*b*B + 8*a*C)*(a + b*cos(c + d*x))^3*sin(c + d*x))/(143*d*sec(c + d*x)^(3/2)) + (2*C*(a + b*cos(c + d*x))^4*sin(c + d*x))/(13*d*sec(c + d*x)^(3/2)) + (2*(77*a^4*B + 330*a^2*b^2*B + 45*b^4*B + 44*a^3*b*(7*A + 5*C) + 20*a*b^3*(11*A + 9*C))*sin(c + d*x))/(231*d*sqrt(sec(c + d*x)))]

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

    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2))/(a + b*cos(c + d*x)), x, 9, (-2*(5*A*b^2 - 5*a*b*B + a^2*(3*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*a^3*d) - (2*(A*b - a*B)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*a^2*d) - (2*b*(A*b^2 - a*(b*B - a*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^3*(a + b)*d) + (2*(5*A*b^2 - 5*a*b*B + a^2*(3*A + 5*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(5*a^3*d) - (2*(A*b - a*B)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*d) + (2*A*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*a*d)]
    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x)), x, 8, (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*(A*b^2 - a*(b*B - a*C))*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x)), x, 7, (-2*A*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*d) + (2*C*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b*d) - (2*(A*b^2 - a*(b*B - a*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*b*(a + b)*d) + (2*A*sqrt(sec(c + d*x))*sin(c + d*x))/(a*d)]
    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x)), x, 6, (2*C*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b*d) + (2*(b*B - a*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^2*d) + (2*(A*b^2 - a*(b*B - a*C))*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) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))*sqrt(sec(c + d*x))), x, 7, (2*(b*B - a*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^2*d) + (2*(b^2*(3*A + C) - 3*a*(b*B - a*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*b^3*d) - (2*a*(A*b^2 - a*(b*B - a*C))*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*C*sin(c + d*x))/(3*b*d*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))*sec(c + d*x)^(3/2)), x, 8, (2*(5*A*b^2 - 5*a*b*B + 5*a^2*C + 3*b^2*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*b^3*d) + (2*(3*a^2*b*B + b^3*B - 3*a^3*C - a*b^2*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*b^4*d) + (2*a^2*(A*b^2 - a*(b*B - a*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^4*(a + b)*d) + (2*C*sin(c + d*x))/(5*b*d*sec(c + d*x)^(3/2)) + (2*(b*B - a*C)*sin(c + d*x))/(3*b^2*d*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))*sec(c + d*x)^(5/2)), x, 9, (2*(5*a^2*b*B + 3*b^3*B - 5*a^3*C - a*b^2*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*b^4*d) - (2*(21*a^3*b*B + 7*a*b^3*B - 21*a^4*C - 7*a^2*b^2*(3*A + C) - b^4*(7*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(21*b^5*d) - (2*a^3*(A*b^2 - a*(b*B - a*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^5*(a + b)*d) + (2*C*sin(c + d*x))/(7*b*d*sec(c + d*x)^(5/2)) + (2*(b*B - a*C)*sin(c + d*x))/(5*b^2*d*sec(c + d*x)^(3/2)) + (2*(7*A*b^2 - 7*a*b*B + 7*a^2*C + 5*b^2*C)*sin(c + d*x))/(21*b^3*d*sqrt(sec(c + d*x)))]

    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x))^2, x, 9, -(((5*A*b^3 + 2*a^3*B - 3*a*b^2*B - a^2*b*(4*A - C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^3*(a^2 - b^2)*d)) - ((5*A*b^2 - 3*a*b*B - a^2*(2*A - 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*a^2*(a^2 - b^2)*d) - ((5*A*b^4 + 5*a^3*b*B - 3*a*b^3*B - a^2*b^2*(7*A - C) - 3*a^4*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^3*(a - b)*(a + b)^2*d) + ((5*A*b^3 + 2*a^3*B - 3*a*b^2*B - a^2*b*(4*A - C))*sqrt(sec(c + d*x))*sin(c + d*x))/(a^3*(a^2 - b^2)*d) - ((5*A*b^2 - 3*a*b*B - a^2*(2*A - 3*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*a^2*(a^2 - b^2)*d) + ((A*b^2 - a*(b*B - a*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x))^2, x, 8, ((3*A*b^2 - a*b*B - a^2*(2*A - C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a^2*(a^2 - b^2)*d) + ((A*b^2 - a*(b*B - a*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*b*(a^2 - b^2)*d) + ((3*A*b^4 + 3*a^3*b*B - a*b^3*B - a^4*C - a^2*b^2*(5*A + C))*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)*b*(a + b)^2*d) - ((3*A*b^2 - a*b*B - a^2*(2*A - C))*sqrt(sec(c + d*x))*sin(c + d*x))/(a^2*(a^2 - b^2)*d) + ((A*b^2 - a*(b*B - a*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x))^2, x, 7, -(((A*b^2 - a*(b*B - a*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*b*(a^2 - b^2)*d)) - ((A*b^2 - a*b*B - a^2*C + 2*b^2*C)*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^2*(a^2 - b^2)*d) - ((A*b^4 + a^3*b*B + a*b^3*B + a^4*C - 3*a^2*b^2*(A + C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(a*(a - b)*b^2*(a + b)^2*d) + ((A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(a*(a^2 - b^2)*d*(a + b*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^2*sqrt(sec(c + d*x))), x, 7, ((A*b^2 - a*b*B + 3*a^2*C - 2*b^2*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^2*(a^2 - b^2)*d) + ((a^2*b*B - 2*b^3*B - 3*a^3*C + a*b^2*(A + 4*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^3*(a^2 - b^2)*d) - ((A*b^4 + a^3*b*B - 3*a*b^3*B - 3*a^4*C + a^2*b^2*(A + 5*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/((a - b)*b^3*(a + b)^2*d) - ((A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^2*sec(c + d*x)^(3/2)), x, 8, ((3*a^2*b*B - 2*b^3*B - a*b^2*(A - 4*C) - 5*a^3*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(b^3*(a^2 - b^2)*d) - ((9*a^3*b*B - 12*a*b^3*B - a^2*b^2*(3*A - 16*C) - 15*a^4*C + 2*b^4*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*b^4*(a^2 - b^2)*d) + (a*(3*A*b^4 + 3*a^3*b*B - 5*a*b^3*B - a^2*b^2*(A - 7*C) - 5*a^4*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/((a - b)*b^4*(a + b)^2*d) - ((A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)) + ((3*A*b^2 - 3*a*b*B + 5*a^2*C - 2*b^2*C)*sin(c + d*x))/(3*b^2*(a^2 - b^2)*d*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^2*sec(c + d*x)^(5/2)), x, 9, -((25*a^3*b*B - 20*a*b^3*B - 3*a^2*b^2*(5*A - 8*C) - 35*a^4*C + 2*b^4*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(5*b^4*(a^2 - b^2)*d) + ((15*a^4*b*B - 16*a^2*b^3*B - 2*b^5*B - a^3*b^2*(9*A - 20*C) - 21*a^5*C + 4*a*b^4*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(3*b^5*(a^2 - b^2)*d) - (a^2*(5*A*b^4 + 5*a^3*b*B - 7*a*b^3*B - 3*a^2*b^2*(A - 3*C) - 7*a^4*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/((a - b)*b^5*(a + b)^2*d) - ((A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(b*(a^2 - b^2)*d*(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)) + ((5*A*b^2 - 5*a*b*B + 7*a^2*C - 2*b^2*C)*sin(c + d*x))/(5*b^2*(a^2 - b^2)*d*sec(c + d*x)^(3/2)) + ((5*a^2*b*B - 2*b^3*B - a*b^2*(3*A - 4*C) - 7*a^3*C)*sin(c + d*x))/(3*b^3*(a^2 - b^2)*d*sqrt(sec(c + d*x)))]

    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x))^3, x, 10, ((35*A*b^5 - 8*a^5*B + 29*a^3*b^2*B - 15*a*b^4*B + 3*a^4*b*(8*A - 3*C) - a^2*b^3*(65*A - 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^4*(a^2 - b^2)^2*d) + ((35*A*b^4 + 33*a^3*b*B - 15*a*b^3*B + a^4*(8*A - 21*C) - a^2*b^2*(61*A - 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(12*a^3*(a^2 - b^2)^2*d) + ((35*A*b^6 - 35*a^5*b*B + 38*a^3*b^3*B - 15*a*b^5*B - a^2*b^4*(86*A - 3*C) + 3*a^4*b^2*(21*A - 2*C) + 15*a^6*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^4*(a - b)^2*(a + b)^3*d) - ((35*A*b^5 - 8*a^5*B + 29*a^3*b^2*B - 15*a*b^4*B + 3*a^4*b*(8*A - 3*C) - a^2*b^3*(65*A - 3*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*a^4*(a^2 - b^2)^2*d) + ((35*A*b^4 + 33*a^3*b*B - 15*a*b^3*B + a^4*(8*A - 21*C) - a^2*b^2*(61*A - 3*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(12*a^3*(a^2 - b^2)^2*d) + ((A*b^2 - a*(b*B - a*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((7*A*b^4 + 9*a^3*b*B - 3*a*b^3*B - 5*a^4*C - a^2*b^2*(13*A + C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x))^3, x, 9, -((15*A*b^4 + 9*a^3*b*B - 3*a*b^3*B + a^4*(8*A - 5*C) - a^2*b^2*(29*A + C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^3*(a^2 - b^2)^2*d) - ((5*A*b^4 + 7*a^3*b*B - a*b^3*B - 3*a^4*C - a^2*b^2*(11*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^2*b*(a^2 - b^2)^2*d) - ((15*A*b^6 - 15*a^5*b*B + 6*a^3*b^3*B - 3*a*b^5*B + 3*a^6*C - a^2*b^4*(38*A + C) + 5*a^4*b^2*(7*A + 2*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^3*(a - b)^2*b*(a + b)^3*d) + ((15*A*b^4 + 9*a^3*b*B - 3*a*b^3*B + a^4*(8*A - 5*C) - a^2*b^2*(29*A + C))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*a^3*(a^2 - b^2)^2*d) + ((A*b^2 - a*(b*B - a*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2) - ((5*A*b^4 + 7*a^3*b*B - a*b^3*B - 3*a^4*C - a^2*b^2*(11*A + 3*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x)))]
    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x))^3, x, 8, ((3*A*b^4 + 5*a^3*b*B + a*b^3*B - a^4*C - a^2*b^2*(9*A + 5*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^2*b*(a^2 - b^2)^2*d) + ((A*b^4 + 3*a^3*b*B + 3*a*b^3*B + a^4*C - 7*a^2*b^2*(A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a*b^2*(a^2 - b^2)^2*d) + ((3*A*b^6 - 3*a^5*b*B - 10*a^3*b^3*B + a*b^5*B - 3*a^2*b^4*(2*A - C) - a^6*C + 5*a^4*b^2*(3*A + 2*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a^2*(a - b)^2*b^2*(a + b)^3*d) + ((A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(2*a*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2*sqrt(sec(c + d*x))) - ((3*A*b^4 + 5*a^3*b*B + a*b^3*B - a^4*C - a^2*b^2*(9*A + 5*C))*sin(c + d*x))/(4*a^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^3*sqrt(sec(c + d*x))), x, 8, ((A*b^4 - a^3*b*B - 5*a*b^3*B - 3*a^4*C + a^2*b^2*(5*A + 9*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a*b^2*(a^2 - b^2)^2*d) + ((a^3*b*B - 7*a*b^3*B + a^2*b^2*(3*A - 5*C) + 3*a^4*C + b^4*(3*A + 8*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*b^3*(a^2 - b^2)^2*d) + ((A*b^6 - a^5*b*B + 10*a^3*b^3*B + 3*a*b^5*B - 3*a^4*b^2*(A - 2*C) - 3*a^6*C - 5*a^2*b^4*(2*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*a*(a - b)^2*b^3*(a + b)^3*d) - ((A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2*sqrt(sec(c + d*x))) - ((A*b^4 - a^3*b*B - 5*a*b^3*B - 3*a^4*C + a^2*b^2*(5*A + 9*C))*sin(c + d*x))/(4*a*b*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^3*sec(c + d*x)^(3/2)), x, 8, -((3*a^3*b*B - 9*a*b^3*B + b^4*(5*A - 8*C) - 15*a^4*C + a^2*b^2*(A + 29*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*b^3*(a^2 - b^2)^2*d) + ((3*a^4*b*B - 5*a^2*b^3*B + 8*b^5*B - 15*a^5*C - a*b^4*(7*A + 24*C) + a^3*b^2*(A + 33*C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*b^4*(a^2 - b^2)^2*d) + ((3*A*b^6 - 3*a^5*b*B + 6*a^3*b^3*B - 15*a*b^5*B + 15*a^6*C + 5*a^2*b^4*(2*A + 7*C) - a^4*b^2*(A + 38*C))*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*(a - b)^2*b^4*(a + b)^3*d) - ((A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2*sec(c + d*x)^(3/2)) + ((3*A*b^4 + a^3*b*B - 7*a*b^3*B - 5*a^4*C + a^2*b^2*(3*A + 11*C))*sin(c + d*x))/(4*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^3*sec(c + d*x)^(5/2)), x, 9, ((15*a^4*b*B - 29*a^2*b^3*B + 8*b^5*B - a^3*b^2*(3*A - 65*C) + 3*a*b^4*(3*A - 8*C) - 35*a^5*C)*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*b^4*(a^2 - b^2)^2*d) - ((45*a^5*b*B - 99*a^3*b^3*B + 72*a*b^5*B - a^4*b^2*(9*A - 223*C) + a^2*b^4*(15*A - 128*C) - 105*a^6*C - 8*b^6*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(12*b^5*(a^2 - b^2)^2*d) - (a*(15*A*b^6 - 15*a^5*b*B + 38*a^3*b^3*B - 35*a*b^5*B + a^4*b^2*(3*A - 86*C) - 3*a^2*b^4*(2*A - 21*C) + 35*a^6*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*(a - b)^2*b^5*(a + b)^3*d) - ((A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2*sec(c + d*x)^(5/2)) + ((5*A*b^4 + 3*a^3*b*B - 9*a*b^3*B - 7*a^4*C + a^2*b^2*(A + 13*C))*sin(c + d*x))/(4*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)) - ((15*a^3*b*B - 33*a*b^3*B - a^2*b^2*(3*A - 61*C) + b^4*(21*A - 8*C) - 35*a^4*C)*sin(c + d*x))/(12*b^3*(a^2 - b^2)^2*d*sqrt(sec(c + d*x)))]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^3*sec(c + d*x)^(7/2)), x, 10, -((175*a^5*b*B - 325*a^3*b^3*B + 120*a*b^5*B + a^2*b^4*(145*A - 192*C) - 3*a^4*b^2*(25*A - 187*C) - 315*a^6*C - 8*b^6*(5*A + 3*C))*sqrt(cos(c + d*x))*Elliptic.E((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(20*b^5*(a^2 - b^2)^2*d) + ((105*a^6*b*B - 223*a^4*b^3*B + 128*a^2*b^5*B + 8*b^7*B + 3*a^3*b^4*(33*A - 64*C) - 9*a^5*b^2*(5*A - 43*C) - 189*a^7*C - 24*a*b^6*(3*A + C))*sqrt(cos(c + d*x))*Elliptic.F((c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(12*b^6*(a^2 - b^2)^2*d) + (a^2*(35*A*b^6 - 35*a^5*b*B + 86*a^3*b^3*B - 63*a*b^5*B - a^2*b^4*(38*A - 99*C) + 15*a^4*b^2*(A - 10*C) + 63*a^6*C)*sqrt(cos(c + d*x))*Elliptic.Pi((2*b)/(a + b), (c + d*x)/2, 2)*sqrt(sec(c + d*x)))/(4*(a - b)^2*b^6*(a + b)^3*d) - ((A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(2*b*(a^2 - b^2)*d*(a + b*cos(c + d*x))^2*sec(c + d*x)^(7/2)) + ((7*A*b^4 + 5*a^3*b*B - 11*a*b^3*B - a^2*b^2*(A - 15*C) - 9*a^4*C)*sin(c + d*x))/(4*b^2*(a^2 - b^2)^2*d*(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)) - ((35*a^3*b*B - 65*a*b^3*B - a^2*b^2*(15*A - 101*C) + b^4*(45*A - 8*C) - 63*a^4*C)*sin(c + d*x))/(20*b^3*(a^2 - b^2)^2*d*sec(c + d*x)^(3/2)) + ((35*a^4*b*B - 61*a^2*b^3*B + 8*b^5*B + 3*a*b^4*(11*A - 8*C) - 15*a^3*b^2*(A - 7*C) - 63*a^5*C)*sin(c + d*x))/(12*b^4*(a^2 - b^2)^2*d*sqrt(sec(c + d*x)))]

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

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

    @test_int [sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 8, (-2*(a - b)*sqrt(a + b)*(16*A*b^4 - 57*a^3*b*B - 24*a*b^3*B + 6*a^2*b^2*(4*A + 7*C) - 21*a^4*(7*A + 9*C))*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^5*d*sqrt(sec(c + d*x))) - (2*(a - b)*sqrt(a + b)*(16*A*b^3 + 12*a*b^2*(A - 2*B) + 6*a^2*b*(6*A - 3*B + 7*C) + 3*a^3*(49*A - 25*B + 63*C))*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^4*d*sqrt(sec(c + d*x))) + (2*(8*A*b^3 + 75*a^3*B - 12*a*b^2*B + a^2*b*(13*A + 21*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*a^3*d) - (2*(6*A*b^2 - 9*a*b*B - 7*a^2*(7*A + 9*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*a^2*d) + (2*(A*b + 9*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*a*d) + (2*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(9/2)*sin(c + d*x))/(9*d)]
    @test_int [sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 7, (2*(a - b)*sqrt(a + b)*(8*A*b^3 + 63*a^3*B - 14*a*b^2*B + a^2*b*(19*A + 35*C))*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 + 2*a*b*(3*A - 7*B) + a^2*(25*A - 63*B + 35*C))*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*(4*A*b^2 - 7*a*b*B - 5*a^2*(5*A + 7*C))*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 6, (-2*(a - b)*sqrt(a + b)*(2*A*b^2 - 5*a*b*B - 3*a^2*(3*A + 5*C))*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)*(2*A*b + a*(9*A - 5*B + 15*C))*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 7, (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*sqrt(a + b)*(b*(A - 3*B) - a*(A - 3*B + 3*C))*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*sqrt(a + b)*C*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*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 8, ((a - b)*sqrt(a + b)*(2*A - C)*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 - a*(2*A - 2*B - C))*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))) - (sqrt(a + b)*(2*b*B + a*C)*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))) + (2*A*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d - ((2*A - C)*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) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 8, -((a - b)*sqrt(a + b)*(4*b*B + a*C)*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)*(8*A*b + a*C + 2*b*(2*B + C))*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)*(8*A*b^2 + 4*a*b*B - a^2*C + 4*b^2*C)*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))) + (C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) + ((4*b*B + a*C)*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) + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 9, -((a - b)*sqrt(a + b)*(8*b^2*(3*A + 2*C) + 3*a*(2*b*B - a*C))*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)*(24*A*b^2 + (a + 2*b)*(6*b*B - 3*a*C + 8*b*C))*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*b*B - 8*b^3*B - a^3*C - 4*a*b^2*(2*A + C))*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*b*B - a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*b*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*b*d*sqrt(sec(c + d*x))) + ((8*b^2*(3*A + 2*C) + 3*a*(2*b*B - a*C))*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(24*b^2*d)]
    @test_int [(sqrt(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/sec(c + d*x)^(3/2), x, 10, ((a - b)*sqrt(a + b)*(24*a^2*b*B - 128*b^3*B - 15*a^3*C - 4*a*b^2*(12*A + 7*C))*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^3*d*sqrt(sec(c + d*x))) + (sqrt(a + b)*(15*a^3*C - 2*a^2*b*(12*B + 5*C) + 4*a*b^2*(12*A + 4*B + 7*C) + 8*b^3*(12*A + 16*B + 9*C))*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^3*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(8*a^3*b*B + 32*a*b^3*B - 5*a^4*C - 8*a^2*b^2*(2*A + C) + 16*b^4*(4*A + 3*C))*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^4*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(4*b*d*sec(c + d*x)^(3/2)) + ((16*A*b^2 - 8*a*b*B + 5*a^2*C + 12*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*b^2*d*sqrt(sec(c + d*x))) + ((8*b*B - 5*a*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*b^2*d*sqrt(sec(c + d*x))) - ((24*a^2*b*B - 128*b^3*B - 15*a^3*C - 4*a*b^2*(12*A + 7*C))*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(192*b^3*d)]

    @test_int [(a + b*cos(c + d*x))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 8, (2*(a - b)*sqrt(a + b)*(8*A*b^4 + 246*a^3*b*B - 18*a*b^3*B + 21*a^4*(7*A + 9*C) + 3*a^2*b^2*(11*A + 21*C))*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 + 6*a*b^2*(A - 3*B) + 3*a^2*b*(13*A - 57*B + 21*C) - 3*a^3*(49*A - 25*B + 63*C))*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*(4*A*b^3 - 75*a^3*B - 9*a*b^2*B - 2*a^2*b*(44*A + 63*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*a^2*d) + (2*(3*A*b^2 + 72*a*b*B + 7*a^2*(7*A + 9*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*a*d) + (2*(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 + 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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 7, (-2*(a - b)*sqrt(a + b)*(6*A*b^3 - 63*a^3*B - 21*a*b^2*B - 2*a^2*b*(41*A + 70*C))*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 + 35*C) + 3*a*b*(19*A - 7*B + 35*C))*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*(3*A*b^2 + 42*a*b*B + 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*a*d) + (2*(3*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 + 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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 8, (2*(a - b)*sqrt(a + b)*(3*A*b^2 + 20*a*b*B + 3*a^2*(3*A + 5*C))*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*sqrt(a + b)*(3*b^2*(A - 5*B) - 2*a*b*(6*A - 10*B + 15*C) + a^2*(9*A - 5*B + 15*C))*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*sqrt(a + b)*C*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*(3*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 + 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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 9, ((a - b)*sqrt(a + b)*(8*A*b + 6*a*B - 3*b*C)*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)*(6*A*b^2 + 2*a^2*(A - 3*B + 3*C) - a*b*(8*A - 3*(4*B + C)))*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))) - (sqrt(a + b)*(2*b*B + 3*a*C)*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*b + a*B)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/d - ((8*A*b + 6*a*B - 3*b*C)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 9, ((a - b)*sqrt(a + b)*(8*a*A - 4*b*B - 5*a*C)*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)*(a*(8*A - 8*B - 5*C) - 2*b*(8*A + 2*B + C))*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)*(8*A*b^2 + 12*a*b*B + 3*a^2*C + 4*b^2*C)*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*(4*A - C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) - ((8*a*A - 4*b*B - 5*a*C)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*d) + (2*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))^(3/2)*(A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 9, -((a - b)*sqrt(a + b)*(24*A*b^2 + 30*a*b*B + 3*a^2*C + 16*b^2*C)*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)*(3*a^2*C + 4*b^2*(6*A + 3*B + 4*C) + 2*a*b*(24*A + 15*B + 7*C))*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*b*B + 8*b^3*B - a^3*C + 12*a*b^2*(2*A + C))*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))) + ((2*b*B + a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + ((24*A*b^2 + 30*a*b*B + 3*a^2*C + 16*b^2*C)*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) + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 10, -((a - b)*sqrt(a + b)*(24*a^2*b*B + 128*b^3*B - 9*a^3*C + 12*a*b^2*(20*A + 13*C))*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*C - 6*a^2*b*(4*B + C) - 8*b^3*(12*A + 16*B + 9*C) - 4*a*b^2*(60*A + 28*B + 39*C))*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*b*B - 96*a*b^3*B - 3*a^4*C - 24*a^2*b^2*(2*A + C) - 16*b^4*(4*A + 3*C))*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))) + ((4*b^2*(4*A + 3*C) + a*(8*b*B - 3*a*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*b*d*sqrt(sec(c + d*x))) + ((8*b*B - 3*a*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*b*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*b*d*sqrt(sec(c + d*x))) + ((24*a^2*b*B + 128*b^3*B - 9*a^3*C + 12*a*b^2*(20*A + 13*C))*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(13/2), x, 9, (2*(a - b)*sqrt(a + b)*(40*A*b^5 + 1617*a^5*B + 3069*a^3*b^2*B - 110*a*b^4*B + 15*a^2*b^3*(17*A + 33*C) + 15*a^4*b*(247*A + 319*C))*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))) + (2*(a - b)*sqrt(a + b)*(40*A*b^4 + 10*a*b^3*(3*A - 11*B) + 15*a^2*b^2*(19*A - 121*B + 33*C) + 3*a^4*(225*A - 539*B + 275*C) - 6*a^3*b*(505*A - 209*B + 660*C))*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)))/(3465*a^3*d*sqrt(sec(c + d*x))) - (2*(20*A*b^4 - 1793*a^3*b*B - 55*a*b^3*B - 75*a^4*(9*A + 11*C) - 5*a^2*b^2*(205*A + 297*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(3465*a^2*d) + (2*(15*A*b^3 + 539*a^3*B + 825*a*b^2*B + 5*a^2*b*(229*A + 297*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(3465*a*d) + (2*(5*A*b^2 + 44*a*b*B + 3*a^2*(9*A + 11*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(231*d) + (2*(5*A*b + 11*a*B)*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(9/2)*sin(c + d*x))/(99*d) + (2*A*(a + b*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(11/2), x, 8, (-2*(a - b)*sqrt(a + b)*(10*A*b^4 - 435*a^3*b*B - 45*a*b^3*B - 21*a^4*(7*A + 9*C) - 3*a^2*b^2*(93*A + 161*C))*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 + 15*a*b^2*(11*A - 3*B + 21*C) - 6*a^2*b*(19*A - 60*B + 28*C) + 3*a^3*(49*A - 25*B + 63*C))*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*(5*A*b^3 + 75*a^3*B + 135*a*b^2*B + a^2*b*(163*A + 231*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(315*a*d) + (2*(15*A*b^2 + 90*a*b*B + 7*a^2*(7*A + 9*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(315*d) + (2*(5*A*b + 9*a*B)*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(7/2)*sin(c + d*x))/(63*d) + (2*A*(a + b*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2), x, 9, (2*(a - b)*sqrt(a + b)*(15*A*b^3 + 63*a^3*B + 161*a*b^2*B + 5*a^2*b*(29*A + 49*C))*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*sqrt(a + b)*(15*b^3*(A - 7*B) - a^3*(25*A - 63*B + 35*C) + a^2*b*(145*A - 119*B + 245*C) - a*b^2*(135*A - 161*B + 315*C))*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*b^2*sqrt(a + b)*C*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*(15*A*b^2 + 56*a*b*B + 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*d) + (2*(5*A*b + 7*a*B)*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*d) + (2*A*(a + b*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2), x, 10, ((a - b)*sqrt(a + b)*(70*a*b*B + b^2*(46*A - 15*C) + 6*a^2*(3*A + 5*C))*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))) + (sqrt(a + b)*(30*A*b^3 - 2*a^3*(9*A - 5*B + 15*C) + 2*a^2*b*(17*A - 35*B + 45*C) - a*b^2*(46*A - 15*(6*B + C)))*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))) - (b*sqrt(a + b)*(2*b*B + 5*a*C)*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*(5*A*b^2 + 10*a*b*B + a^2*(3*A + 5*C))*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(5*d) - ((70*a*b*B + b^2*(46*A - 15*C) + 6*a^2*(3*A + 5*C))*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(15*d) + (2*(A*b + a*B)*(a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)*sin(c + d*x))/(3*d) + (2*A*(a + b*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2), x, 10, ((a - b)*sqrt(a + b)*(24*a^2*B - 12*b^2*B + a*b*(56*A - 27*C))*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)))/(12*a*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(a*b*(56*A - 72*B - 27*C) - 6*b^2*(12*A + 2*B + C) - 8*a^2*(A - 3*B + 3*C))*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)))/(12*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(8*A*b^2 + 20*a*b*B + 15*a^2*C + 4*b^2*C)*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*(8*A*b + 4*a*B - b*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*d*sqrt(sec(c + d*x))) - ((24*a^2*B - 12*b^2*B + a*b*(56*A - 27*C))*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(12*d) + (2*(5*A*b + 3*a*B)*(a + b*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))*sin(c + d*x))/(3*d) + (2*A*(a + b*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2), x, 10, -((a - b)*sqrt(a + b)*(54*a*b*B - a^2*(48*A - 33*C) + 8*b^2*(3*A + 2*C))*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)*(a^2*(48*A - 48*B - 33*C) - 4*b^2*(6*A + 3*B + 4*C) - 2*a*b*(72*A + 27*B + 13*C))*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*b*B + 8*b^3*B + 5*a^3*C + 20*a*b^2*(2*A + C))*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*(8*a*A - 2*b*B - 3*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) - (b*(6*A - C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(3*d*sqrt(sec(c + d*x))) + ((54*a*b*B - a^2*(48*A - 33*C) + 8*b^2*(3*A + 2*C))*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(24*d) + (2*A*(a + b*cos(c + d*x))^(5/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) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)), x, 10, -((a - b)*sqrt(a + b)*(264*a^2*b*B + 128*b^3*B + 15*a^3*C + 4*a*b^2*(108*A + 71*C))*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*C + 8*b^3*(12*A + 16*B + 9*C) + 2*a^2*b*(192*A + 132*B + 59*C) + 4*a*b^2*(108*A + 52*B + 71*C))*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*b*B + 160*a*b^3*B - 5*a^4*C + 120*a^2*b^2*(2*A + C) + 16*b^4*(4*A + 3*C))*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))) + ((16*A*b^2 + 24*a*b*B + 5*a^2*C + 12*b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(32*d*sqrt(sec(c + d*x))) + ((8*b*B + 5*a*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(24*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(4*d*sqrt(sec(c + d*x))) + ((264*a^2*b*B + 128*b^3*B + 15*a^3*C + 4*a*b^2*(108*A + 71*C))*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) + C*cos(c + d*x)^2))/sqrt(sec(c + d*x)), x, 11, -((a - b)*sqrt(a + b)*(150*a^3*b*B + 2840*a*b^3*B - 45*a^4*C + 256*b^4*(5*A + 4*C) + 12*a^2*b^2*(220*A + 141*C))*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))) - (sqrt(a + b)*(45*a^4*C - 30*a^3*b*(5*B + C) - 16*b^4*(80*A + 45*B + 64*C) - 8*a*b^3*(260*A + 355*B + 193*C) - 4*a^2*b^2*(660*A + 295*B + 423*C))*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)))/(1920*b^2*d*sqrt(sec(c + d*x))) + (sqrt(a + b)*(10*a^4*b*B - 240*a^2*b^3*B - 96*b^5*B - 3*a^5*C - 40*a^3*b^2*(2*A + C) - 80*a*b^4*(4*A + 3*C))*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*b*B + 120*b^3*B - 15*a^3*C + 4*a*b^2*(60*A + 43*C))*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(320*b*d*sqrt(sec(c + d*x))) + ((80*A*b^2 + 50*a*b*B - 15*a^2*C + 64*b^2*C)*(a + b*cos(c + d*x))^(3/2)*sin(c + d*x))/(240*b*d*sqrt(sec(c + d*x))) + ((10*b*B - 3*a*C)*(a + b*cos(c + d*x))^(5/2)*sin(c + d*x))/(40*b*d*sqrt(sec(c + d*x))) + (C*(a + b*cos(c + d*x))^(7/2)*sin(c + d*x))/(5*b*d*sqrt(sec(c + d*x))) + ((150*a^3*b*B + 2840*a*b^3*B - 45*a^4*C + 256*b^4*(5*A + 4*C) + 12*a^2*b^2*(220*A + 141*C))*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 [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(9/2))/sqrt(a + b*cos(c + d*x)), x, 7, (-2*(a - b)*sqrt(a + b)*(48*A*b^3 - 63*a^3*B - 56*a*b^2*B + a^2*(44*A*b + 70*b*C))*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^5*d*sqrt(sec(c + d*x))) + (2*sqrt(a + b)*(48*A*b^3 - 4*a*b^2*(3*A + 14*B) + a^3*(25*A - 63*B + 35*C) + 2*a^2*b*(22*A + 7*(B + 5*C)))*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^4*d*sqrt(sec(c + d*x))) + (2*(24*A*b^2 - 28*a*b*B + 5*a^2*(5*A + 7*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(105*a^3*d) - (2*(6*A*b - 7*a*B)*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(35*a^2*d) + (2*A*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(7/2)*sin(c + d*x))/(7*a*d)]
    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2))/sqrt(a + b*cos(c + d*x)), x, 6, (2*(a - b)*sqrt(a + b)*(8*A*b^2 - 10*a*b*B + 3*a^2*(3*A + 5*C))*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 - 2*a*b*(A + 5*B) + a^2*(9*A - 5*B + 15*C))*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 [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/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 + 3*C))*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 [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/sqrt(a + b*cos(c + d*x)), 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^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))) - (2*sqrt(a + b)*C*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*cos(c + d*x) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/sqrt(a + b*cos(c + d*x)), x, 7, -(((a - b)*sqrt(a + b)*C*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)*(2*A*b + a*C)*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*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(2*b*B - a*C)*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))) + (C*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(b*d)]
    @test_int [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/(sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))), x, 8, -((a - b)*sqrt(a + b)*(4*b*B - 3*a*C)*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)*(3*a*C - 2*b*(2*B + C))*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)*(8*A*b^2 - 4*a*b*B + 3*a^2*C + 4*b^2*C)*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))) + (C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*b*d*sqrt(sec(c + d*x))) + ((4*b*B - 3*a*C)*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) + C*cos(c + d*x)^2)/(sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)), x, 9, -((a - b)*sqrt(a + b)*(24*A*b^2 - 18*a*b*B + 15*a^2*C + 16*b^2*C)*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^3*d*sqrt(sec(c + d*x))) + (sqrt(a + b)*(24*A*b^2 - 18*a*b*B + 12*b^2*B + 15*a^2*C - 10*a*b*C + 16*b^2*C)*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^3*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(6*a^2*b*B + 8*b^3*B - 5*a^3*C - 4*a*b^2*(2*A + C))*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^4*d*sqrt(sec(c + d*x))) + (C*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(3*b*d*sec(c + d*x)^(3/2)) + ((6*b*B - 5*a*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(12*b^2*d*sqrt(sec(c + d*x))) + ((24*A*b^2 - 18*a*b*B + 15*a^2*C + 16*b^2*C)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(24*b^3*d)]

    @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 + 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*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 [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(7/2))/(a + b*cos(c + d*x))^(3/2), x, 7, -((2*(48*A*b^4 + 25*a^3*b*B - 40*a*b^3*B - 6*a^2*b^2*(4*A - 5*C) - 3*a^4*(3*A + 5*C))*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^5*sqrt(a + b)*d*sqrt(sec(c + d*x)))) - (2*(48*A*b^3 + 4*a*b^2*(9*A - 10*B) + 6*a^2*b*(2*A - 5*B + 5*C) + a^3*(9*A - 5*B + 15*C))*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^4*sqrt(a + b)*d*sqrt(sec(c + d*x))) + (2*(24*A*b^3 + 5*a^3*B - 20*a*b^2*B - a^2*(9*A*b - 15*b*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)*sin(c + d*x))/(15*a^3*(a^2 - b^2)*d) + (2*(A*b^2 - a*(b*B - a*C))*sec(c + d*x)^(5/2)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (2*(6*A*b^2 - 5*a*b*B - a^2*(A - 5*C))*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(5/2)*sin(c + d*x))/(5*a^2*(a^2 - b^2)*d)]
    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x))^(3/2), x, 6, (2*(8*A*b^3 + 3*a^3*B - 6*a*b^2*B - a^2*(5*A*b - 3*b*C))*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*(8*A*b^2 + 6*a*b*(A - B) + a^2*(A - 3*B + 3*C))*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*(A*b^2 - a*(b*B - a*C))*sec(c + d*x)^(3/2)*sin(c + d*x))/(a*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (2*(4*A*b^2 - 3*a*b*B - a^2*(A - 3*C))*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x))^(3/2), x, 5, -((2*(2*A*b^2 - a*b*B - a^2*(A - C))*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 - C))*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*(A*b^2 - a*(b*B - a*C))*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) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x))^(3/2), x, 7, (2*(A*b^2 - a*(b*B - a*C))*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*b*sqrt(a + b)*d*sqrt(sec(c + d*x))) + (2*(A*b + b*B - a*C)*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)*C*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*b^2 - a*(b*B - a*C))*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) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^(3/2)*sqrt(sec(c + d*x))), x, 8, -(((2*A*b^2 - 2*a*b*B + 3*a^2*C - b^2*C)*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^2 - a*(b*(2*B - C) - 3*a*C))*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^2*sqrt(a + b)*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(2*b*B - 3*a*C)*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*b^2 - a*(b*B - a*C))*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))) + ((2*A*b^2 - 2*a*b*B + 3*a^2*C - b^2*C)*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) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^(3/2)*sec(c + d*x)^(3/2)), x, 9, -((12*a^2*b*B - 4*b^3*B - a*b^2*(8*A - 7*C) - 15*a^3*C)*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^3*sqrt(a + b)*d*sqrt(sec(c + d*x))) - ((8*A*b^2 - a*b*(12*B - 5*C) + 15*a^2*C - 2*b^2*(2*B + C))*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^3*sqrt(a + b)*d*sqrt(sec(c + d*x))) - (sqrt(a + b)*(8*A*b^2 - 12*a*b*B + 15*a^2*C + 4*b^2*C)*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^4*d*sqrt(sec(c + d*x))) - (2*(A*b^2 - a*(b*B - a*C))*sin(c + d*x))/(b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))*sec(c + d*x)^(3/2)) + ((4*A*b^2 - 4*a*b*B + 5*a^2*C - b^2*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x))/(2*b^2*(a^2 - b^2)*d*sqrt(sec(c + d*x))) + ((12*a^2*b*B - 4*b^3*B - a*b^2*(8*A - 7*C) - 15*a^3*C)*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x))*sin(c + d*x))/(4*b^3*(a^2 - b^2)*d)]

    @test_int [((A + B*cos(c + d*x) + C*cos(c + d*x)^2)*sec(c + d*x)^(5/2))/(a + b*cos(c + d*x))^(5/2), x, 7, -((2*(16*A*b^5 - 3*a^5*B + 15*a^3*b^2*B - 8*a*b^4*B - 2*a^2*b^3*(14*A - C) + a^4*(8*A*b - 6*b*C))*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*sqrt(a + b)*(a^2 - b^2)*d*sqrt(sec(c + d*x)))) - (2*(16*A*b^4 + 4*a*b^3*(3*A - 2*B) - 3*a^3*b*(3*A - 3*B - C) - 2*a^2*b^2*(8*A + 3*B - C) - a^4*(A - 3*B + 3*C))*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*(A*b^2 - a*(b*B - a*C))*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*(10*a^2*A*b^2 - 6*A*b^4 - 7*a^3*b*B + 3*a*b^3*B + 4*a^4*C)*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*(8*A*b^4 + 8*a^3*b*B - 4*a*b^3*B + a^4*(A - 5*C) - a^2*b^2*(13*A - C))*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) + C*cos(c + d*x)^2)*sec(c + d*x)^(3/2))/(a + b*cos(c + d*x))^(5/2), x, 6, (2*(8*A*b^4 + 6*a^3*b*B - 2*a*b^3*B + 3*a^4*(A - C) - a^2*b^2*(15*A + C))*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)*(a^2 - b^2)*d*sqrt(sec(c + d*x))) + (2*(8*A*b^3 + 2*a*b^2*(3*A - B) - 3*a^3*(A - B - C) - a^2*b*(9*A + 3*B + C))*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*(A*b^2 - a*(b*B - a*C))*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*(4*A*b^4 + 5*a^3*b*B - a*b^3*B - 2*a^4*C - 2*a^2*b^2*(4*A + C))*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) + C*cos(c + d*x)^2)*sqrt(sec(c + d*x)))/(a + b*cos(c + d*x))^(5/2), x, 6, -((2*(2*A*b^3 + 3*a^3*B + a*b^2*B - 2*a^2*b*(3*A + 2*C))*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 - a^2*(3*A + 3*B + C) + a*b*(3*A + B + 3*C))*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*(A*b^2 - a*(b*B - a*C))*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*(2*A*b^3 + 3*a^3*B + a*b^2*B - 2*a^2*b*(3*A + 2*C))*sqrt(sec(c + d*x))*sin(c + d*x))/(3*a*(a^2 - b^2)^2*d*sqrt(a + b*cos(c + d*x)))]
    #= [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^(1/2)), x, 8, (2*(A*b^4 - 4*a*b^3*B - 3*a^4*C + a^2*b^2*(3*A + 7*C))*sqrt(cos(c + d*x))*sqrt(1 + cos(c + d*x))*sqrt((a + b*cos(c + d*x))/((a + b)*(1 + cos(c + d*x))))*Elliptic.E(asin(sin(c + d*x)/(1 + cos(c + d*x))), -((a - b)/(a + b)))*sqrt(sec(c + d*x)))/(3*a*(a - b)*b^2*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) - (2*(3*a*A*b - a*b*B - 2*a^2*C + 3*a*b*C + b^2*(A - 3*B + 3*C))*sqrt(cos(c + d*x))*sqrt(1 + cos(c + d*x))*sqrt((a + b*cos(c + d*x))/((a + b)*(1 + cos(c + d*x))))*Elliptic.F(asin(sin(c + d*x)/(1 + cos(c + d*x))), -((a - b)/(a + b)))*sqrt(sec(c + d*x)))/(3*(a - b)*b*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))) + (4*C*sqrt(cos(c + d*x))*sqrt(1 + cos(c + d*x))*sqrt((a + b*cos(c + d*x))/((a + b)*(1 + cos(c + d*x))))*Elliptic.Pi(-1, asin(sin(c + d*x)/(1 + cos(c + d*x))), -((a - b)/(a + b)))*sqrt(sec(c + d*x)))/(b^2*d*sqrt(a + b*cos(c + d*x))) - (2*(A*b^2 - a*b*B + a^2*C)*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*b^4 - 4*a*b^3*B - 3*a^4*C + a^2*b^2*(3*A + 7*C))*sin(c + d*x)/(1 + cos(c + d*x)))/(3*a*b^2*(a + b)*(a^2 - b^2)*d*sqrt(a + b*cos(c + d*x))*sqrt(sec(c + d*x)))] =#
    #= [(A + B*cos(c + d*x) + C*cos(c + d*x)^2)/((a + b*cos(c + d*x))^(5/2)*sec(c + d*x)^(3/2)), x, 9, -((8*A*b^4 + 6*a^3*b*B - 14*a*b^3*B - 15*a^4*C + 26*a^2*b^2*C - 3*b^4*C)*sqrt(cos(c + d*x))*sqrt(1 + cos(c + d*x))*sqrt((a + b*cos(c + d*x))/((a + b)*(1 + cos(c + d*x))))*Elliptic.E(asin(sin(c + d*x)/(1 + cos(c + d*x))), -((a - b)/(a + b)))*sqrt(sec(c + d*x)))/(3*(a - b)^2*b^3*(a + b)*d*sqrt(a + b*cos(c + d*x))) + (2*(a*A*b^2 + 3*A*b^3 + 2*a^2*b*B - 3*a*b^2*B - 3*b^3*B - 5*a^3*C + 3*a^2*b*C + 6*a*b^2*C)*sqrt(cos(c + d*x))*sqrt(1 + cos(c + d*x))*sqrt((a + b*cos(c + d*x))/((a + b)*(1 + cos(c + d*x))))*Elliptic.F(asin(sin(c + d*x)/(1 + cos(c + d*x))), -((a - b)/(a + b)))*sqrt(sec(c + d*x)))/(3*(a - b)^2*b^2*(a + b)*d*sqrt(a + b*cos(c + d*x))) + (2*(2*b*B - 5*a*C)*sqrt(cos(c + d*x))*sqrt(1 + cos(c + d*x))*sqrt((a + b*cos(c + d*x))/((a + b)*(1 + cos(c + d*x))))*Elliptic.Pi(-1, asin(sin(c + d*x)/(1 + cos(c + d*x))), -((a - b)/(a + b)))*sqrt(sec(c + d*x)))/(b^3*d*sqrt(a + b*cos(c + d*x))) - (2*(A*b^2 - a*b*B + a^2*C)*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*b^2 + 3*A*b^4 + 2*a^3*b*B - 6*a*b^3*B - 5*a^4*C + 9*a^2*b^2*C)*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))) - ((8*A*b^4 + 6*a^3*b*B - 14*a*b^3*B - 15*a^4*C + 26*a^2*b^2*C - 3*b^4*C)*sqrt(a + b*cos(c + d*x))*sin(c + d*x)/(1 + cos(c + d*x)))/(3*b^3*(a^2 - b^2)^2*d*sqrt(sec(c + d*x)))] =#
    end

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