text:
@testset "1.2.3.4 (f x)^m (d+e x^n)^q (a+b x^n+c x^(2 n))^p" begin
    (a, b, c, d, e, f, m, n, p, q, x, ) = @variables a b c d e f m n p q x

    #= ::Package:: =#

    #= ::Title::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^3)^q*(a+b*x^3+c*x^6)^p=#

    #= ::Section:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^3)^q*(a+b*x^3+c*x^6)^p*with*b=0=#

    #= ::Section:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^3)^q*(a+b*x^3+c*x^6)^p*with*b^2-4*a*c=0=#

    #= ::Section:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^3)^q*(a+b*x^3+c*x^6)^p*with*c*d^2-b*d*e+a*e^2=0=#

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^3)^q*(a+b*x^3+c*x^6)^p=#

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^3)^q*(a+b*x^3+c*x^6)^p=#

    #= ::Subsubsection::Closed:: =#
    #=p>0=#

    @test_int [(d + e*x^3)^5*(a + b*x^3 + c*x^6), x, 2, a*d^5*x + (1/4)*d^4*(b*d + 5*a*e)*x^4 + (1/7)*d^3*(c*d^2 + 5*e*(b*d + 2*a*e))*x^7 + (1/2)*d^2*e*(c*d^2 + 2*e*(b*d + a*e))*x^10 + (5/13)*d*e^2*(2*c*d^2 + e*(2*b*d + a*e))*x^13 + (1/16)*e^3*(10*c*d^2 + e*(5*b*d + a*e))*x^16 + (1/19)*e^4*(5*c*d + b*e)*x^19 + (1/22)*c*e^5*x^22]
    @test_int [(d + e*x^3)^4*(a + b*x^3 + c*x^6), x, 2, a*d^4*x + (d^3*(b*d + 4*a*e)*x^4)/4 + (d^2*(c*d^2 + 4*b*d*e + 6*a*e^2)*x^7)/7 + (d*e*(2*c*d^2 + e*(3*b*d + 2*a*e))*x^10)/5 + (e^2*(6*c*d^2 + e*(4*b*d + a*e))*x^13)/13 + (e^3*(4*c*d + b*e)*x^16)/16 + (c*e^4*x^19)/19]
    @test_int [(d + e*x^3)^3*(a + b*x^3 + c*x^6), x, 2, a*d^3*x + (d^2*(b*d + 3*a*e)*x^4)/4 + (d*(c*d^2 + 3*e*(b*d + a*e))*x^7)/7 + (e*(3*c*d^2 + e*(3*b*d + a*e))*x^10)/10 + (e^2*(3*c*d + b*e)*x^13)/13 + (c*e^3*x^16)/16]
    @test_int [(d + e*x^3)^2*(a + b*x^3 + c*x^6), x, 2, a*d^2*x + (d*(b*d + 2*a*e)*x^4)/4 + ((c*d^2 + e*(2*b*d + a*e))*x^7)/7 + (e*(2*c*d + b*e)*x^10)/10 + (c*e^2*x^13)/13]
    @test_int [(d + e*x^3)*(a + b*x^3 + c*x^6), x, 2, a*d*x + ((b*d + a*e)*x^4)/4 + ((c*d + b*e)*x^7)/7 + (c*e*x^10)/10]
    @test_int [(a + b*x^3 + c*x^6)/(d + e*x^3), x, 8, -(((c*d - b*e)*x)/e^2) + (c*x^4)/(4*e) - ((c*d^2 - b*d*e + a*e^2)*atan((d^(1/3) - 2*e^(1/3)*x)/(sqrt(3)*d^(1/3))))/(sqrt(3)*d^(2/3)*e^(7/3)) + ((c*d^2 - b*d*e + a*e^2)*log(d^(1/3) + e^(1/3)*x))/(3*d^(2/3)*e^(7/3)) - ((c*d^2 - b*d*e + a*e^2)*log(d^(2/3) - d^(1/3)*e^(1/3)*x + e^(2/3)*x^2))/(6*d^(2/3)*e^(7/3))]
    @test_int [(a + b*x^3 + c*x^6)/(d + e*x^3)^2, x, 8, (c*x)/e^2 + ((c*d^2 - b*d*e + a*e^2)*x)/(3*d*e^2*(d + e*x^3)) + ((4*c*d^2 - e*(b*d + 2*a*e))*atan((d^(1/3) - 2*e^(1/3)*x)/(sqrt(3)*d^(1/3))))/(3*sqrt(3)*d^(5/3)*e^(7/3)) - ((4*c*d^2 - e*(b*d + 2*a*e))*log(d^(1/3) + e^(1/3)*x))/(9*d^(5/3)*e^(7/3)) + ((4*c*d^2 - e*(b*d + 2*a*e))*log(d^(2/3) - d^(1/3)*e^(1/3)*x + e^(2/3)*x^2))/(18*d^(5/3)*e^(7/3))]
    @test_int [(a + b*x^3 + c*x^6)/(d + e*x^3)^3, x, 8, ((c*d^2 - b*d*e + a*e^2)*x)/(6*d*e^2*(d + e*x^3)^2) - ((7*c*d^2 - e*(b*d + 5*a*e))*x)/(18*d^2*e^2*(d + e*x^3)) - ((2*c*d^2 + e*(b*d + 5*a*e))*atan((d^(1/3) - 2*e^(1/3)*x)/(sqrt(3)*d^(1/3))))/(9*sqrt(3)*d^(8/3)*e^(7/3)) + ((2*c*d^2 + e*(b*d + 5*a*e))*log(d^(1/3) + e^(1/3)*x))/(27*d^(8/3)*e^(7/3)) - ((2*c*d^2 + e*(b*d + 5*a*e))*log(d^(2/3) - d^(1/3)*e^(1/3)*x + e^(2/3)*x^2))/(54*d^(8/3)*e^(7/3))]

    #= ::Subsubsection::Closed:: =#
    #=p<0=#

    @test_int [x^8*(d + e*x^3)/(a + b*x^3 + c*x^6), x, 7, ((c*d - b*e)*x^3)/(3*c^2) + (e*x^6)/(6*c) - ((b^2*c*d - 2*a*c^2*d - b^3*e + 3*a*b*c*e)*atanh((b + 2*c*x^3)/sqrt(b^2 - 4*a*c)))/(3*c^3*sqrt(b^2 - 4*a*c)) - ((b*c*d - b^2*e + a*c*e)*log(a + b*x^3 + c*x^6))/(6*c^3)]
    @test_int [x^5*(d + e*x^3)/(a + b*x^3 + c*x^6), x, 6, (e*x^3)/(3*c) + ((b*c*d - b^2*e + 2*a*c*e)*atanh((b + 2*c*x^3)/sqrt(b^2 - 4*a*c)))/(3*c^2*sqrt(b^2 - 4*a*c)) + ((c*d - b*e)*log(a + b*x^3 + c*x^6))/(6*c^2)]
    @test_int [x^2*(d + e*x^3)/(a + b*x^3 + c*x^6), x, 5, -(((2*c*d - b*e)*atanh((b + 2*c*x^3)/sqrt(b^2 - 4*a*c)))/(3*c*sqrt(b^2 - 4*a*c))) + (e*log(a + b*x^3 + c*x^6))/(6*c)]
    @test_int [x^(-1)*(d + e*x^3)/(a + b*x^3 + c*x^6), x, 7, ((b*d - 2*a*e)*atanh((b + 2*c*x^3)/sqrt(b^2 - 4*a*c)))/(3*a*sqrt(b^2 - 4*a*c)) + (d*log(x))/a - (d*log(a + b*x^3 + c*x^6))/(6*a)]
    @test_int [x^(-4)*(d + e*x^3)/(a + b*x^3 + c*x^6), x, 7, -(d/(3*a*x^3)) - ((b^2*d - 2*a*c*d - a*b*e)*atanh((b + 2*c*x^3)/sqrt(b^2 - 4*a*c)))/(3*a^2*sqrt(b^2 - 4*a*c)) - ((b*d - a*e)*log(x))/a^2 + ((b*d - a*e)*log(a + b*x^3 + c*x^6))/(6*a^2)]

    @test_int [x^4*(d + e*x^3)/(a + b*x^3 + c*x^6), x, 14, (e*x^2)/(2*c) - ((c*d - b*e - (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b - sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(2/3)*sqrt(3)*c^(5/3)*(b - sqrt(b^2 - 4*a*c))^(1/3)) - ((c*d - b*e + (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b + sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(2/3)*sqrt(3)*c^(5/3)*(b + sqrt(b^2 - 4*a*c))^(1/3)) - ((c*d - b*e - (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(2/3)*c^(5/3)*(b - sqrt(b^2 - 4*a*c))^(1/3)) - ((c*d - b*e + (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(2/3)*c^(5/3)*(b + sqrt(b^2 - 4*a*c))^(1/3)) + ((c*d - b*e - (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b - sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(2/3)*c^(5/3)*(b - sqrt(b^2 - 4*a*c))^(1/3)) + ((c*d - b*e + (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b + sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(2/3)*c^(5/3)*(b + sqrt(b^2 - 4*a*c))^(1/3))]
    @test_int [x^3*(d + e*x^3)/(a + b*x^3 + c*x^6), x, 14, (e*x)/c - ((c*d - b*e - (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b - sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)*c^(4/3)*(b - sqrt(b^2 - 4*a*c))^(2/3)) - ((c*d - b*e + (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b + sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)*c^(4/3)*(b + sqrt(b^2 - 4*a*c))^(2/3)) + ((c*d - b*e - (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(1/3)*c^(4/3)*(b - sqrt(b^2 - 4*a*c))^(2/3)) + ((c*d - b*e + (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(1/3)*c^(4/3)*(b + sqrt(b^2 - 4*a*c))^(2/3)) - ((c*d - b*e - (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b - sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(1/3)*c^(4/3)*(b - sqrt(b^2 - 4*a*c))^(2/3)) - ((c*d - b*e + (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b + sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(1/3)*c^(4/3)*(b + sqrt(b^2 - 4*a*c))^(2/3))]
    @test_int [x^1*(d + e*x^3)/(a + b*x^3 + c*x^6), x, 13, -(((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b - sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(2/3)*sqrt(3)*c^(2/3)*(b - sqrt(b^2 - 4*a*c))^(1/3))) - ((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b + sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(2/3)*sqrt(3)*c^(2/3)*(b + sqrt(b^2 - 4*a*c))^(1/3)) - ((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(2/3)*c^(2/3)*(b - sqrt(b^2 - 4*a*c))^(1/3)) - ((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(2/3)*c^(2/3)*(b + sqrt(b^2 - 4*a*c))^(1/3)) + ((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b - sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(2/3)*c^(2/3)*(b - sqrt(b^2 - 4*a*c))^(1/3)) + ((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b + sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(2/3)*c^(2/3)*(b + sqrt(b^2 - 4*a*c))^(1/3))]
    @test_int [x^0*(d + e*x^3)/(a + b*x^3 + c*x^6), x, 13, -(((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b - sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)*c^(1/3)*(b - sqrt(b^2 - 4*a*c))^(2/3))) - ((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b + sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)*c^(1/3)*(b + sqrt(b^2 - 4*a*c))^(2/3)) + ((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(1/3)*c^(1/3)*(b - sqrt(b^2 - 4*a*c))^(2/3)) + ((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(1/3)*c^(1/3)*(b + sqrt(b^2 - 4*a*c))^(2/3)) - ((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b - sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(1/3)*c^(1/3)*(b - sqrt(b^2 - 4*a*c))^(2/3)) - ((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b + sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(1/3)*c^(1/3)*(b + sqrt(b^2 - 4*a*c))^(2/3))]
    @test_int [x^(-2)*(d + e*x^3)/(a + b*x^3 + c*x^6), x, 14, -(d/(a*x)) + (c^(1/3)*(d + (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b - sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(2/3)*sqrt(3)*a*(b - sqrt(b^2 - 4*a*c))^(1/3)) + (c^(1/3)*(d - (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b + sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(2/3)*sqrt(3)*a*(b + sqrt(b^2 - 4*a*c))^(1/3)) + (c^(1/3)*(d + (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(2/3)*a*(b - sqrt(b^2 - 4*a*c))^(1/3)) + (c^(1/3)*(d - (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(2/3)*a*(b + sqrt(b^2 - 4*a*c))^(1/3)) - (c^(1/3)*(d + (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b - sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(2/3)*a*(b - sqrt(b^2 - 4*a*c))^(1/3)) - (c^(1/3)*(d - (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b + sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(2/3)*a*(b + sqrt(b^2 - 4*a*c))^(1/3))]
    @test_int [x^(-3)*(d + e*x^3)/(a + b*x^3 + c*x^6), x, 14, -(d/(2*a*x^2)) + (c^(2/3)*(d + (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b - sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)*a*(b - sqrt(b^2 - 4*a*c))^(2/3)) + (c^(2/3)*(d - (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atan((1 - (2*2^(1/3)*c^(1/3)*x)/(b + sqrt(b^2 - 4*a*c))^(1/3))/sqrt(3)))/(2^(1/3)*sqrt(3)*a*(b + sqrt(b^2 - 4*a*c))^(2/3)) - (c^(2/3)*(d + (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(1/3)*a*(b - sqrt(b^2 - 4*a*c))^(2/3)) - (c^(2/3)*(d - (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(1/3) + 2^(1/3)*c^(1/3)*x))/(3*2^(1/3)*a*(b + sqrt(b^2 - 4*a*c))^(2/3)) + (c^(2/3)*(d + (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*log((b - sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b - sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(1/3)*a*(b - sqrt(b^2 - 4*a*c))^(2/3)) + (c^(2/3)*(d - (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*log((b + sqrt(b^2 - 4*a*c))^(2/3) - 2^(1/3)*c^(1/3)*(b + sqrt(b^2 - 4*a*c))^(1/3)*x + 2^(2/3)*c^(2/3)*x^2))/(6*2^(1/3)*a*(b + sqrt(b^2 - 4*a*c))^(2/3))]

    @test_int [x^8*(1 - x^3)/(1 - x^3 + x^6), x, 7, -(x^6/6) - atan((1 - 2*x^3)/sqrt(3))/(3*sqrt(3)) + (1/6)*log(1 - x^3 + x^6)]
    @test_int [x^5*(1 - x^3)/(1 - x^3 + x^6), x, 4, -(x^3/3) - (2*atan((1 - 2*x^3)/sqrt(3)))/(3*sqrt(3))]
    @test_int [x^2*(1 - x^3)/(1 - x^3 + x^6), x, 5, -(atan((1 - 2*x^3)/sqrt(3))/(3*sqrt(3))) - (1/6)*log(1 - x^3 + x^6)]
    @test_int [x^(-1)*(1 - x^3)/(1 - x^3 + x^6), x, 7, atan((1 - 2*x^3)/sqrt(3))/(3*sqrt(3)) + log(x) - (1/6)*log(1 - x^3 + x^6)]
    @test_int [x^(-4)*(1 - x^3)/(1 - x^3 + x^6), x, 5, -(1/(3*x^3)) + (2*atan((1 - 2*x^3)/sqrt(3)))/(3*sqrt(3))]

    @test_int [x^6*(1 - x^3)/(1 - x^3 + x^6), x, 15, -(x^4/4) - ((im + sqrt(3))*atan((1 + (2*x)/((1/2)*(1 - im*sqrt(3)))^(1/3))/sqrt(3)))/(3*2^(1/3)*(1 - im*sqrt(3))^(2/3)) + ((im - sqrt(3))*atan((1 + (2*x)/((1/2)*(1 + im*sqrt(3)))^(1/3))/sqrt(3)))/(3*2^(1/3)*(1 + im*sqrt(3))^(2/3)) + ((3 + im*sqrt(3))*log((1 - im*sqrt(3))^(1/3) - 2^(1/3)*x))/(9*2^(1/3)*(1 - im*sqrt(3))^(2/3)) + ((3 - im*sqrt(3))*log((1 + im*sqrt(3))^(1/3) - 2^(1/3)*x))/(9*2^(1/3)*(1 + im*sqrt(3))^(2/3)) - ((3 + im*sqrt(3))*log((1 - im*sqrt(3))^(2/3) + (2*(1 - im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(18*2^(1/3)*(1 - im*sqrt(3))^(2/3)) - ((3 - im*sqrt(3))*log((1 + im*sqrt(3))^(2/3) + (2*(1 + im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(18*2^(1/3)*(1 + im*sqrt(3))^(2/3))]
    @test_int [x^4*(1 - x^3)/(1 - x^3 + x^6), x, 15, -(x^2/2) + (im*atan((1 + (2*x)/((1/2)*(1 - im*sqrt(3)))^(1/3))/sqrt(3)))/(3*((1/2)*(1 - im*sqrt(3)))^(1/3)) - (im*atan((1 + (2*x)/((1/2)*(1 + im*sqrt(3)))^(1/3))/sqrt(3)))/(3*((1/2)*(1 + im*sqrt(3)))^(1/3)) + (im*log((1 - im*sqrt(3))^(1/3) - 2^(1/3)*x))/(3*sqrt(3)*((1/2)*(1 - im*sqrt(3)))^(1/3)) - (im*log((1 + im*sqrt(3))^(1/3) - 2^(1/3)*x))/(3*sqrt(3)*((1/2)*(1 + im*sqrt(3)))^(1/3)) - (im*log((1 - im*sqrt(3))^(2/3) + (2*(1 - im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(3*2^(2/3)*sqrt(3)*(1 - im*sqrt(3))^(1/3)) + (im*log((1 + im*sqrt(3))^(2/3) + (2*(1 + im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(3*2^(2/3)*sqrt(3)*(1 + im*sqrt(3))^(1/3))]
    @test_int [x^3*(1 - x^3)/(1 - x^3 + x^6), x, 14, -x - (im*atan((1 + (2*x)/((1/2)*(1 - im*sqrt(3)))^(1/3))/sqrt(3)))/(3*((1/2)*(1 - im*sqrt(3)))^(2/3)) + (im*atan((1 + (2*x)/((1/2)*(1 + im*sqrt(3)))^(1/3))/sqrt(3)))/(3*((1/2)*(1 + im*sqrt(3)))^(2/3)) + (im*log((1 - im*sqrt(3))^(1/3) - 2^(1/3)*x))/(3*sqrt(3)*((1/2)*(1 - im*sqrt(3)))^(2/3)) - (im*log((1 + im*sqrt(3))^(1/3) - 2^(1/3)*x))/(3*sqrt(3)*((1/2)*(1 + im*sqrt(3)))^(2/3)) - (im*log((1 - im*sqrt(3))^(2/3) + (2*(1 - im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(3*2^(1/3)*sqrt(3)*(1 - im*sqrt(3))^(2/3)) + (im*log((1 + im*sqrt(3))^(2/3) + (2*(1 + im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(3*2^(1/3)*sqrt(3)*(1 + im*sqrt(3))^(2/3))]
    @test_int [x^1*(1 - x^3)/(1 - x^3 + x^6), x, 13, ((im - sqrt(3))*atan((1 + (2*x)/((1/2)*(1 - im*sqrt(3)))^(1/3))/sqrt(3)))/(3*2^(2/3)*(1 - im*sqrt(3))^(1/3)) - ((im + sqrt(3))*atan((1 + (2*x)/((1/2)*(1 + im*sqrt(3)))^(1/3))/sqrt(3)))/(3*2^(2/3)*(1 + im*sqrt(3))^(1/3)) - ((3 - im*sqrt(3))*log((1 - im*sqrt(3))^(1/3) - 2^(1/3)*x))/(9*2^(2/3)*(1 - im*sqrt(3))^(1/3)) - ((3 + im*sqrt(3))*log((1 + im*sqrt(3))^(1/3) - 2^(1/3)*x))/(9*2^(2/3)*(1 + im*sqrt(3))^(1/3)) + ((3 - im*sqrt(3))*log((1 - im*sqrt(3))^(2/3) + (2*(1 - im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(18*2^(2/3)*(1 - im*sqrt(3))^(1/3)) + ((3 + im*sqrt(3))*log((1 + im*sqrt(3))^(2/3) + (2*(1 + im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(18*2^(2/3)*(1 + im*sqrt(3))^(1/3))]
    @test_int [x^0*(1 - x^3)/(1 - x^3 + x^6), x, 13, -(((im - sqrt(3))*atan((1 + (2*x)/((1/2)*(1 - im*sqrt(3)))^(1/3))/sqrt(3)))/(3*2^(1/3)*(1 - im*sqrt(3))^(2/3))) + ((im + sqrt(3))*atan((1 + (2*x)/((1/2)*(1 + im*sqrt(3)))^(1/3))/sqrt(3)))/(3*2^(1/3)*(1 + im*sqrt(3))^(2/3)) - ((3 - im*sqrt(3))*log((1 - im*sqrt(3))^(1/3) - 2^(1/3)*x))/(9*2^(1/3)*(1 - im*sqrt(3))^(2/3)) - ((3 + im*sqrt(3))*log((1 + im*sqrt(3))^(1/3) - 2^(1/3)*x))/(9*2^(1/3)*(1 + im*sqrt(3))^(2/3)) + ((3 - im*sqrt(3))*log((1 - im*sqrt(3))^(2/3) + (2*(1 - im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(18*2^(1/3)*(1 - im*sqrt(3))^(2/3)) + ((3 + im*sqrt(3))*log((1 + im*sqrt(3))^(2/3) + (2*(1 + im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(18*2^(1/3)*(1 + im*sqrt(3))^(2/3))]
    @test_int [x^(-2)*(1 - x^3)/(1 - x^3 + x^6), x, 14, -(1/x) - ((im + sqrt(3))*atan((1 + (2*x)/((1/2)*(1 - im*sqrt(3)))^(1/3))/sqrt(3)))/(3*2^(2/3)*(1 - im*sqrt(3))^(1/3)) + ((im - sqrt(3))*atan((1 + (2*x)/((1/2)*(1 + im*sqrt(3)))^(1/3))/sqrt(3)))/(3*2^(2/3)*(1 + im*sqrt(3))^(1/3)) - ((3 + im*sqrt(3))*log((1 - im*sqrt(3))^(1/3) - 2^(1/3)*x))/(9*2^(2/3)*(1 - im*sqrt(3))^(1/3)) - ((3 - im*sqrt(3))*log((1 + im*sqrt(3))^(1/3) - 2^(1/3)*x))/(9*2^(2/3)*(1 + im*sqrt(3))^(1/3)) + ((3 + im*sqrt(3))*log((1 - im*sqrt(3))^(2/3) + (2*(1 - im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(18*2^(2/3)*(1 - im*sqrt(3))^(1/3)) + ((3 - im*sqrt(3))*log((1 + im*sqrt(3))^(2/3) + (2*(1 + im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(18*2^(2/3)*(1 + im*sqrt(3))^(1/3))]
    @test_int [x^(-3)*(1 - x^3)/(1 - x^3 + x^6), x, 15, -(1/(2*x^2)) + ((im + sqrt(3))*atan((1 + (2*x)/((1/2)*(1 - im*sqrt(3)))^(1/3))/sqrt(3)))/(3*2^(1/3)*(1 - im*sqrt(3))^(2/3)) - ((im - sqrt(3))*atan((1 + (2*x)/((1/2)*(1 + im*sqrt(3)))^(1/3))/sqrt(3)))/(3*2^(1/3)*(1 + im*sqrt(3))^(2/3)) - ((3 + im*sqrt(3))*log((1 - im*sqrt(3))^(1/3) - 2^(1/3)*x))/(9*2^(1/3)*(1 - im*sqrt(3))^(2/3)) - ((3 - im*sqrt(3))*log((1 + im*sqrt(3))^(1/3) - 2^(1/3)*x))/(9*2^(1/3)*(1 + im*sqrt(3))^(2/3)) + ((3 + im*sqrt(3))*log((1 - im*sqrt(3))^(2/3) + (2*(1 - im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(18*2^(1/3)*(1 - im*sqrt(3))^(2/3)) + ((3 - im*sqrt(3))*log((1 + im*sqrt(3))^(2/3) + (2*(1 + im*sqrt(3)))^(1/3)*x + 2^(2/3)*x^2))/(18*2^(1/3)*(1 + im*sqrt(3))^(2/3))]

    @test_int [(x^2*(-2 + x^3))/(1 - x^3 + x^6), x, 5, atan((1 - 2*x^3)/sqrt(3))/sqrt(3) + (1/6)*log(1 - x^3 + x^6)]

    @test_int [(1 + x^3)/(x*(1 - x^3 + x^6)), x, 7, -(atan((1 - 2*x^3)/sqrt(3))/sqrt(3)) + log(x) - (1/6)*log(1 - x^3 + x^6)]
    @test_int [(1 + x^3)/(x - x^4 + x^7), x, 8, -(atan((1 - 2*x^3)/sqrt(3))/sqrt(3)) + log(x) - (1/6)*log(1 - x^3 + x^6)]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^3)^(q/2)*(a+b*x^3+c*x^6)^p=#

    @test_int [(a + b*x^3 + c*x^6)*(d + e*x^3)^(5/2), x, 6, (54*d^2*(16*c*d^2 - 58*b*d*e + 667*a*e^2)*x*sqrt(d + e*x^3))/(124729*e^2) + (30*d*(16*c*d^2 - 58*b*d*e + 667*a*e^2)*x*(d + e*x^3)^(3/2))/(124729*e^2) + (2*(16*c*d^2 - 58*b*d*e + 667*a*e^2)*x*(d + e*x^3)^(5/2))/(11339*e^2) - (2*(8*c*d - 29*b*e)*x*(d + e*x^3)^(7/2))/(667*e^2) + (2*c*x^4*(d + e*x^3)^(7/2))/(29*e) + (54*3^(3/4)*sqrt(2 + sqrt(3))*d^3*(16*c*d^2 - 58*b*d*e + 667*a*e^2)*(d^(1/3) + e^(1/3)*x)*sqrt((d^(2/3) - d^(1/3)*e^(1/3)*x + e^(2/3)*x^2)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*Elliptic.F(asin(((1 - sqrt(3))*d^(1/3) + e^(1/3)*x)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)), -7 - 4*sqrt(3)))/(124729*e^(7/3)*sqrt((d^(1/3)*(d^(1/3) + e^(1/3)*x))/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*sqrt(d + e*x^3))]
    @test_int [(a + b*x^3 + c*x^6)*(d + e*x^3)^(3/2), x, 5, (18*d*(16*c*d^2 - 46*b*d*e + 391*a*e^2)*x*sqrt(d + e*x^3))/(21505*e^2) + (2*(16*c*d^2 - 46*b*d*e + 391*a*e^2)*x*(d + e*x^3)^(3/2))/(4301*e^2) - (2*(8*c*d - 23*b*e)*x*(d + e*x^3)^(5/2))/(391*e^2) + (2*c*x^4*(d + e*x^3)^(5/2))/(23*e) + (18*3^(3/4)*sqrt(2 + sqrt(3))*d^2*(16*c*d^2 - 46*b*d*e + 391*a*e^2)*(d^(1/3) + e^(1/3)*x)*sqrt((d^(2/3) - d^(1/3)*e^(1/3)*x + e^(2/3)*x^2)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*Elliptic.F(asin(((1 - sqrt(3))*d^(1/3) + e^(1/3)*x)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)), -7 - 4*sqrt(3)))/(21505*e^(7/3)*sqrt((d^(1/3)*(d^(1/3) + e^(1/3)*x))/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*sqrt(d + e*x^3))]
    @test_int [(a + b*x^3 + c*x^6)*(d + e*x^3)^(1/2), x, 4, (2*(16*c*d^2 - 34*b*d*e + 187*a*e^2)*x*sqrt(d + e*x^3))/(935*e^2) - (2*(8*c*d - 17*b*e)*x*(d + e*x^3)^(3/2))/(187*e^2) + (2*c*x^4*(d + e*x^3)^(3/2))/(17*e) + (2*3^(3/4)*sqrt(2 + sqrt(3))*d*(16*c*d^2 - 34*b*d*e + 187*a*e^2)*(d^(1/3) + e^(1/3)*x)*sqrt((d^(2/3) - d^(1/3)*e^(1/3)*x + e^(2/3)*x^2)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*Elliptic.F(asin(((1 - sqrt(3))*d^(1/3) + e^(1/3)*x)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)), -7 - 4*sqrt(3)))/(935*e^(7/3)*sqrt((d^(1/3)*(d^(1/3) + e^(1/3)*x))/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*sqrt(d + e*x^3))]
    @test_int [(a + b*x^3 + c*x^6)/(d + e*x^3)^(1/2), x, 3, -((2*(8*c*d - 11*b*e)*x*sqrt(d + e*x^3))/(55*e^2)) + (2*c*x^4*sqrt(d + e*x^3))/(11*e) + (2*sqrt(2 + sqrt(3))*(16*c*d^2 - 22*b*d*e + 55*a*e^2)*(d^(1/3) + e^(1/3)*x)*sqrt((d^(2/3) - d^(1/3)*e^(1/3)*x + e^(2/3)*x^2)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*Elliptic.F(asin(((1 - sqrt(3))*d^(1/3) + e^(1/3)*x)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)), -7 - 4*sqrt(3)))/(55*3^(1/4)*e^(7/3)*sqrt((d^(1/3)*(d^(1/3) + e^(1/3)*x))/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*sqrt(d + e*x^3))]
    @test_int [(a + b*x^3 + c*x^6)/(d + e*x^3)^(3/2), x, 3, (2*(c*d^2 - b*d*e + a*e^2)*x)/(3*d*e^2*sqrt(d + e*x^3)) + (2*c*x*sqrt(d + e*x^3))/(5*e^2) - (2*sqrt(2 + sqrt(3))*(16*c*d^2 - 5*e*(2*b*d + a*e))*(d^(1/3) + e^(1/3)*x)*sqrt((d^(2/3) - d^(1/3)*e^(1/3)*x + e^(2/3)*x^2)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*Elliptic.F(asin(((1 - sqrt(3))*d^(1/3) + e^(1/3)*x)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)), -7 - 4*sqrt(3)))/(15*3^(1/4)*d*e^(7/3)*sqrt((d^(1/3)*(d^(1/3) + e^(1/3)*x))/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*sqrt(d + e*x^3))]
    @test_int [(a + b*x^3 + c*x^6)/(d + e*x^3)^(5/2), x, 3, (2*(c*d^2 - b*d*e + a*e^2)*x)/(9*d*e^2*(d + e*x^3)^(3/2)) - (2*(11*c*d^2 - 2*b*d*e - 7*a*e^2)*x)/(27*d^2*e^2*sqrt(d + e*x^3)) + (2*sqrt(2 + sqrt(3))*(16*c*d^2 + e*(2*b*d + 7*a*e))*(d^(1/3) + e^(1/3)*x)*sqrt((d^(2/3) - d^(1/3)*e^(1/3)*x + e^(2/3)*x^2)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*Elliptic.F(asin(((1 - sqrt(3))*d^(1/3) + e^(1/3)*x)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)), -7 - 4*sqrt(3)))/(27*3^(1/4)*d^2*e^(7/3)*sqrt((d^(1/3)*(d^(1/3) + e^(1/3)*x))/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*sqrt(d + e*x^3))]
    @test_int [(a + b*x^3 + c*x^6)/(d + e*x^3)^(7/2), x, 4, (2*(c*d^2 - b*d*e + a*e^2)*x)/(15*d*e^2*(d + e*x^3)^(5/2)) - (2*(17*c*d^2 - 2*b*d*e - 13*a*e^2)*x)/(135*d^2*e^2*(d + e*x^3)^(3/2)) + (2*(16*c*d^2 + 14*b*d*e + 91*a*e^2)*x)/(405*d^3*e^2*sqrt(d + e*x^3)) + (2*sqrt(2 + sqrt(3))*(16*c*d^2 + 14*b*d*e + 91*a*e^2)*(d^(1/3) + e^(1/3)*x)*sqrt((d^(2/3) - d^(1/3)*e^(1/3)*x + e^(2/3)*x^2)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*Elliptic.F(asin(((1 - sqrt(3))*d^(1/3) + e^(1/3)*x)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)), -7 - 4*sqrt(3)))/(405*3^(1/4)*d^3*e^(7/3)*sqrt((d^(1/3)*(d^(1/3) + e^(1/3)*x))/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*sqrt(d + e*x^3))]
    @test_int [(a + b*x^3 + c*x^6)/(d + e*x^3)^(9/2), x, 5, (2*(c*d^2 - b*d*e + a*e^2)*x)/(21*d*e^2*(d + e*x^3)^(7/2)) - (2*(23*c*d^2 - 2*b*d*e - 19*a*e^2)*x)/(315*d^2*e^2*(d + e*x^3)^(5/2)) + (2*(16*c*d^2 + 26*b*d*e + 247*a*e^2)*x)/(2835*d^3*e^2*(d + e*x^3)^(3/2)) + (2*(16*c*d^2 + 26*b*d*e + 247*a*e^2)*x)/(1215*d^4*e^2*sqrt(d + e*x^3)) + (2*sqrt(2 + sqrt(3))*(16*c*d^2 + 26*b*d*e + 247*a*e^2)*(d^(1/3) + e^(1/3)*x)*sqrt((d^(2/3) - d^(1/3)*e^(1/3)*x + e^(2/3)*x^2)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*Elliptic.F(asin(((1 - sqrt(3))*d^(1/3) + e^(1/3)*x)/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)), -7 - 4*sqrt(3)))/(1215*3^(1/4)*d^4*e^(7/3)*sqrt((d^(1/3)*(d^(1/3) + e^(1/3)*x))/((1 + sqrt(3))*d^(1/3) + e^(1/3)*x)^2)*sqrt(d + e*x^3))]

    #= ::Title::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^4)^q*(a+b*x^4+c*x^8)^p=#

    #= ::Section:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^4)^q*(a+b*x^4+c*x^8)^p*with*b=0=#

    #= ::Section:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^4)^q*(a+b*x^4+c*x^8)^p*with*b^2-4*a*c=0=#

    #= ::Section:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^4)^q*(a+b*x^4+c*x^8)^p*with*c*d^2-b*d*e+a*e^2=0=#

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^4)^q*(a+b*x^4+c*x^8)^p=#

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^4)^q*(a+b*x^4+c*x^8)^p=#

    #= ::Subsubsection:: =#
    #=p>0=#

    #= ::Subsubsection::Closed:: =#
    #=p<0=#

    @test_int [x^4*(d + e*x^4)/(a + b*x^4 + c*x^8), x, 8, (e*x)/c - ((c*d - b*e + (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*atan((2^(1/4)*c^(1/4)*x)/(-b - sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*c^(5/4)*(-b - sqrt(b^2 - 4*a*c))^(3/4)) - ((c*d - b*e - (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*atan((2^(1/4)*c^(1/4)*x)/(-b + sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*c^(5/4)*(-b + sqrt(b^2 - 4*a*c))^(3/4)) - ((c*d - b*e + (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*atanh((2^(1/4)*c^(1/4)*x)/(-b - sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*c^(5/4)*(-b - sqrt(b^2 - 4*a*c))^(3/4)) - ((c*d - b*e - (b*c*d - b^2*e + 2*a*c*e)/sqrt(b^2 - 4*a*c))*atanh((2^(1/4)*c^(1/4)*x)/(-b + sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*c^(5/4)*(-b + sqrt(b^2 - 4*a*c))^(3/4))]
    @test_int [x^3*(d + e*x^4)/(a + b*x^4 + c*x^8), x, 5, -(((2*c*d - b*e)*atanh((b + 2*c*x^4)/sqrt(b^2 - 4*a*c)))/(4*c*sqrt(b^2 - 4*a*c))) + (e*log(a + b*x^4 + c*x^8))/(8*c)]
    @test_int [x^2*(d + e*x^4)/(a + b*x^4 + c*x^8), x, 7, ((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atan((2^(1/4)*c^(1/4)*x)/(-b - sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(3/4)*c^(3/4)*(-b - sqrt(b^2 - 4*a*c))^(1/4)) + ((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atan((2^(1/4)*c^(1/4)*x)/(-b + sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(3/4)*c^(3/4)*(-b + sqrt(b^2 - 4*a*c))^(1/4)) - ((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atanh((2^(1/4)*c^(1/4)*x)/(-b - sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(3/4)*c^(3/4)*(-b - sqrt(b^2 - 4*a*c))^(1/4)) - ((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atanh((2^(1/4)*c^(1/4)*x)/(-b + sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(3/4)*c^(3/4)*(-b + sqrt(b^2 - 4*a*c))^(1/4))]
    @test_int [x^1*(d + e*x^4)/(a + b*x^4 + c*x^8), x, 4, ((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atan((sqrt(2)*sqrt(c)*x^2)/sqrt(b - sqrt(b^2 - 4*a*c))))/(2*sqrt(2)*sqrt(c)*sqrt(b - sqrt(b^2 - 4*a*c))) + ((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atan((sqrt(2)*sqrt(c)*x^2)/sqrt(b + sqrt(b^2 - 4*a*c))))/(2*sqrt(2)*sqrt(c)*sqrt(b + sqrt(b^2 - 4*a*c)))]
    @test_int [x^0*(d + e*x^4)/(a + b*x^4 + c*x^8), x, 7, -(((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atan((2^(1/4)*c^(1/4)*x)/(-b - sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*c^(1/4)*(-b - sqrt(b^2 - 4*a*c))^(3/4))) - ((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atan((2^(1/4)*c^(1/4)*x)/(-b + sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*c^(1/4)*(-b + sqrt(b^2 - 4*a*c))^(3/4)) - ((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atanh((2^(1/4)*c^(1/4)*x)/(-b - sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*c^(1/4)*(-b - sqrt(b^2 - 4*a*c))^(3/4)) - ((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*atanh((2^(1/4)*c^(1/4)*x)/(-b + sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*c^(1/4)*(-b + sqrt(b^2 - 4*a*c))^(3/4))]
    @test_int [x^(-1)*(d + e*x^4)/(a + b*x^4 + c*x^8), x, 7, ((b*d - 2*a*e)*atanh((b + 2*c*x^4)/sqrt(b^2 - 4*a*c)))/(4*a*sqrt(b^2 - 4*a*c)) + (d*log(x))/a - (d*log(a + b*x^4 + c*x^8))/(8*a)]
    @test_int [x^(-2)*(d + e*x^4)/(a + b*x^4 + c*x^8), x, 8, -(d/(a*x)) - (c^(1/4)*(d - (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atan((2^(1/4)*c^(1/4)*x)/(-b - sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(3/4)*a*(-b - sqrt(b^2 - 4*a*c))^(1/4)) - (c^(1/4)*(d + (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atan((2^(1/4)*c^(1/4)*x)/(-b + sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(3/4)*a*(-b + sqrt(b^2 - 4*a*c))^(1/4)) + (c^(1/4)*(d - (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atanh((2^(1/4)*c^(1/4)*x)/(-b - sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(3/4)*a*(-b - sqrt(b^2 - 4*a*c))^(1/4)) + (c^(1/4)*(d + (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atanh((2^(1/4)*c^(1/4)*x)/(-b + sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(3/4)*a*(-b + sqrt(b^2 - 4*a*c))^(1/4))]
    @test_int [x^(-3)*(d + e*x^4)/(a + b*x^4 + c*x^8), x, 5, -(d/(2*a*x^2)) - (sqrt(c)*(d + (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atan((sqrt(2)*sqrt(c)*x^2)/sqrt(b - sqrt(b^2 - 4*a*c))))/(2*sqrt(2)*a*sqrt(b - sqrt(b^2 - 4*a*c))) - (sqrt(c)*(d - (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atan((sqrt(2)*sqrt(c)*x^2)/sqrt(b + sqrt(b^2 - 4*a*c))))/(2*sqrt(2)*a*sqrt(b + sqrt(b^2 - 4*a*c)))]
    @test_int [x^(-4)*(d + e*x^4)/(a + b*x^4 + c*x^8), x, 8, -(d/(3*a*x^3)) + (c^(3/4)*(d - (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atan((2^(1/4)*c^(1/4)*x)/(-b - sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*a*(-b - sqrt(b^2 - 4*a*c))^(3/4)) + (c^(3/4)*(d + (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atan((2^(1/4)*c^(1/4)*x)/(-b + sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*a*(-b + sqrt(b^2 - 4*a*c))^(3/4)) + (c^(3/4)*(d - (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atanh((2^(1/4)*c^(1/4)*x)/(-b - sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*a*(-b - sqrt(b^2 - 4*a*c))^(3/4)) + (c^(3/4)*(d + (b*d - 2*a*e)/sqrt(b^2 - 4*a*c))*atanh((2^(1/4)*c^(1/4)*x)/(-b + sqrt(b^2 - 4*a*c))^(1/4)))/(2*2^(1/4)*a*(-b + sqrt(b^2 - 4*a*c))^(3/4))]

    @test_int [x^4*(1 - x^4)/(1 - x^4 + x^8), x, 20, -x - atan((sqrt(2 - sqrt(3)) - 2*x)/sqrt(2 + sqrt(3)))/(2*sqrt(6)) - atan((sqrt(2 + sqrt(3)) - 2*x)/sqrt(2 - sqrt(3)))/(2*sqrt(6)) + atan((sqrt(2 - sqrt(3)) + 2*x)/sqrt(2 + sqrt(3)))/(2*sqrt(6)) + atan((sqrt(2 + sqrt(3)) + 2*x)/sqrt(2 - sqrt(3)))/(2*sqrt(6)) - log(1 - sqrt(2 - sqrt(3))*x + x^2)/(4*sqrt(6)) + log(1 + sqrt(2 - sqrt(3))*x + x^2)/(4*sqrt(6)) - log(1 - sqrt(2 + sqrt(3))*x + x^2)/(4*sqrt(6)) + log(1 + sqrt(2 + sqrt(3))*x + x^2)/(4*sqrt(6))]
    @test_int [x^3*(1 - x^4)/(1 - x^4 + x^8), x, 5, -(atan((1 - 2*x^4)/sqrt(3))/(4*sqrt(3))) - (1/8)*log(1 - x^4 + x^8)]
    @test_int [x^2*(1 - x^4)/(1 - x^4 + x^8), x, 21, atan((sqrt(2 - sqrt(3)) - 2*x)/sqrt(2 + sqrt(3)))/(4*sqrt(3*(2 - sqrt(3)))) - atan((sqrt(2 + sqrt(3)) - 2*x)/sqrt(2 - sqrt(3)))/(4*sqrt(3*(2 + sqrt(3)))) - atan((sqrt(2 - sqrt(3)) + 2*x)/sqrt(2 + sqrt(3)))/(4*sqrt(3*(2 - sqrt(3)))) + atan((sqrt(2 + sqrt(3)) + 2*x)/sqrt(2 - sqrt(3)))/(4*sqrt(3*(2 + sqrt(3)))) + (1/8)*sqrt((1/3)*(2 - sqrt(3)))*log(1 - sqrt(2 - sqrt(3))*x + x^2) - (1/8)*sqrt((1/3)*(2 - sqrt(3)))*log(1 + sqrt(2 - sqrt(3))*x + x^2) - (1/8)*sqrt((1/3)*(2 + sqrt(3)))*log(1 - sqrt(2 + sqrt(3))*x + x^2) + (1/8)*sqrt((1/3)*(2 + sqrt(3)))*log(1 + sqrt(2 + sqrt(3))*x + x^2)]
    @test_int [x^1*(1 - x^4)/(1 - x^4 + x^8), x, 4, -(log(1 - sqrt(3)*x^2 + x^4)/(4*sqrt(3))) + log(1 + sqrt(3)*x^2 + x^4)/(4*sqrt(3))]
    @test_int [x^0*(1 - x^4)/(1 - x^4 + x^8), x, 19, -(atan((sqrt(2 - sqrt(3)) - 2*x)/sqrt(2 + sqrt(3)))/(4*sqrt(3*(2 - sqrt(3))))) + atan((sqrt(2 + sqrt(3)) - 2*x)/sqrt(2 - sqrt(3)))/(4*sqrt(3*(2 + sqrt(3)))) + atan((sqrt(2 - sqrt(3)) + 2*x)/sqrt(2 + sqrt(3)))/(4*sqrt(3*(2 - sqrt(3)))) - atan((sqrt(2 + sqrt(3)) + 2*x)/sqrt(2 - sqrt(3)))/(4*sqrt(3*(2 + sqrt(3)))) + (1/8)*sqrt((1/3)*(2 - sqrt(3)))*log(1 - sqrt(2 - sqrt(3))*x + x^2) - (1/8)*sqrt((1/3)*(2 - sqrt(3)))*log(1 + sqrt(2 - sqrt(3))*x + x^2) - (1/8)*sqrt((1/3)*(2 + sqrt(3)))*log(1 - sqrt(2 + sqrt(3))*x + x^2) + (1/8)*sqrt((1/3)*(2 + sqrt(3)))*log(1 + sqrt(2 + sqrt(3))*x + x^2)]
    @test_int [x^(-1)*(1 - x^4)/(1 - x^4 + x^8), x, 7, atan((1 - 2*x^4)/sqrt(3))/(4*sqrt(3)) + log(x) - (1/8)*log(1 - x^4 + x^8)]
    @test_int [x^(-2)*(1 - x^4)/(1 - x^4 + x^8), x, 20, -(1/x) + atan((sqrt(2 - sqrt(3)) - 2*x)/sqrt(2 + sqrt(3)))/(2*sqrt(6)) + atan((sqrt(2 + sqrt(3)) - 2*x)/sqrt(2 - sqrt(3)))/(2*sqrt(6)) - atan((sqrt(2 - sqrt(3)) + 2*x)/sqrt(2 + sqrt(3)))/(2*sqrt(6)) - atan((sqrt(2 + sqrt(3)) + 2*x)/sqrt(2 - sqrt(3)))/(2*sqrt(6)) - log(1 - sqrt(2 - sqrt(3))*x + x^2)/(4*sqrt(6)) + log(1 + sqrt(2 - sqrt(3))*x + x^2)/(4*sqrt(6)) - log(1 - sqrt(2 + sqrt(3))*x + x^2)/(4*sqrt(6)) + log(1 + sqrt(2 + sqrt(3))*x + x^2)/(4*sqrt(6))]
    @test_int [x^(-3)*(1 - x^4)/(1 - x^4 + x^8), x, 11, -(1/(2*x^2)) + (1/4)*atan(sqrt(3) - 2*x^2) - (1/4)*atan(sqrt(3) + 2*x^2) - log(1 - sqrt(3)*x^2 + x^4)/(8*sqrt(3)) + log(1 + sqrt(3)*x^2 + x^4)/(8*sqrt(3))]
    @test_int [x^(-4)*(1 - x^4)/(1 - x^4 + x^8), x, 21, -(1/(3*x^3)) - (1/4)*sqrt((1/3)*(2 - sqrt(3)))*atan((sqrt(2 - sqrt(3)) - 2*x)/sqrt(2 + sqrt(3))) + (1/4)*sqrt((1/3)*(2 + sqrt(3)))*atan((sqrt(2 + sqrt(3)) - 2*x)/sqrt(2 - sqrt(3))) + (1/4)*sqrt((1/3)*(2 - sqrt(3)))*atan((sqrt(2 - sqrt(3)) + 2*x)/sqrt(2 + sqrt(3))) - (1/4)*sqrt((1/3)*(2 + sqrt(3)))*atan((sqrt(2 + sqrt(3)) + 2*x)/sqrt(2 - sqrt(3))) + (1/8)*sqrt((1/3)*(2 + sqrt(3)))*log(1 - sqrt(2 - sqrt(3))*x + x^2) - (1/8)*sqrt((1/3)*(2 + sqrt(3)))*log(1 + sqrt(2 - sqrt(3))*x + x^2) - (1/8)*sqrt((1/3)*(2 - sqrt(3)))*log(1 - sqrt(2 + sqrt(3))*x + x^2) + (1/8)*sqrt((1/3)*(2 - sqrt(3)))*log(1 + sqrt(2 + sqrt(3))*x + x^2)]

    #= ::Title::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x)^q*(a+b/x+c/x^2)^p=#

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*x^m*(d+e*x)^q*(a+b/x+c/x^2)^p=#

    @test_int [x^3/((a + c/x^2 + b/x)*(d + e*x)), x, 7, ((a^2*d^2 + b^2*e^2 + a*e*(b*d - c*e))*x)/(a^3*e^3) - ((a*d + b*e)*x^2)/(2*a^2*e^2) + x^3/(3*a*e) + ((b^5*d - 5*a*b^3*c*d + 5*a^2*b*c^2*d - b^4*c*e + 4*a*b^2*c^2*e - 2*a^2*c^3*e)*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(a^4*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))) - (d^5*log(d + e*x))/(e^4*(a*d^2 - e*(b*d - c*e))) + ((b^4*d - 3*a*b^2*c*d + a^2*c^2*d - b^3*c*e + 2*a*b*c^2*e)*log(c + b*x + a*x^2))/(2*a^4*(a*d^2 - e*(b*d - c*e)))]
    @test_int [x^2/((a + c/x^2 + b/x)*(d + e*x)), x, 7, -(((a*d + b*e)*x)/(a^2*e^2)) + x^2/(2*a*e) - ((b^4*d - 4*a*b^2*c*d + 2*a^2*c^2*d - b^3*c*e + 3*a*b*c^2*e)*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(a^3*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))) + (d^4*log(d + e*x))/(e^3*(a*d^2 - e*(b*d - c*e))) - ((b^3*d - 2*a*b*c*d - b^2*c*e + a*c^2*e)*log(c + b*x + a*x^2))/(2*a^3*(a*d^2 - e*(b*d - c*e)))]
    @test_int [x^1/((a + c/x^2 + b/x)*(d + e*x)), x, 7, x/(a*e) + ((b^3*d - 3*a*b*c*d - b^2*c*e + 2*a*c^2*e)*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(a^2*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))) - (d^3*log(d + e*x))/(e^2*(a*d^2 - e*(b*d - c*e))) + ((b^2*d - a*c*d - b*c*e)*log(c + b*x + a*x^2))/(2*a^2*(a*d^2 - e*(b*d - c*e)))]
    @test_int [x^0/((a + c/x^2 + b/x)*(d + e*x)), x, 7, -(((b^2*d - 2*a*c*d - b*c*e)*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(a*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e)))) + (d^2*log(d + e*x))/(e*(a*d^2 - b*d*e + c*e^2)) - ((b*d - c*e)*log(c + b*x + a*x^2))/(2*a*(a*d^2 - e*(b*d - c*e)))]
    @test_int [1/(x^1*(a + c/x^2 + b/x)*(d + e*x)), x, 7, ((b*d - 2*c*e)*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))) - (d*log(d + e*x))/(a*d^2 - e*(b*d - c*e)) + (d*log(c + b*x + a*x^2))/(2*(a*d^2 - e*(b*d - c*e)))]
    @test_int [1/(x^2*(a + c/x^2 + b/x)*(d + e*x)), x, 7, -(((2*a*d - b*e)*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e)))) + (e*log(d + e*x))/(a*d^2 - b*d*e + c*e^2) - (e*log(c + b*x + a*x^2))/(2*(a*d^2 - b*d*e + c*e^2))]
    @test_int [1/(x^3*(a + c/x^2 + b/x)*(d + e*x)), x, 7, ((a*b*d - b^2*e + 2*a*c*e)*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(c*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))) + log(x)/(c*d) - (e^2*log(d + e*x))/(d*(a*d^2 - b*d*e + c*e^2)) - ((a*d - b*e)*log(c + b*x + a*x^2))/(2*c*(a*d^2 - e*(b*d - c*e)))]
    @test_int [1/(x^4*(a + c/x^2 + b/x)*(d + e*x)), x, 7, -(1/(c*d*x)) + ((2*a^2*c*d + b^3*e - a*b*(b*d + 3*c*e))*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(c^2*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))) - ((b*d + c*e)*log(x))/(c^2*d^2) + (e^3*log(d + e*x))/(d^2*(a*d^2 - e*(b*d - c*e))) + ((a*b*d - b^2*e + a*c*e)*log(c + b*x + a*x^2))/(2*c^2*(a*d^2 - e*(b*d - c*e)))]
    @test_int [1/(x^5*(a + c/x^2 + b/x)*(d + e*x)), x, 7, -(1/(2*c*d*x^2)) + (b*d + c*e)/(c^2*d^2*x) - ((b^4*e + a^2*c*(3*b*d + 2*c*e) - a*b^2*(b*d + 4*c*e))*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(c^3*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))) + ((b^2*d^2 + b*c*d*e - c*(a*d^2 - c*e^2))*log(x))/(c^3*d^3) - (e^4*log(d + e*x))/(d^3*(a*d^2 - e*(b*d - c*e))) + ((a^2*c*d + b^3*e - a*b*(b*d + 2*c*e))*log(c + b*x + a*x^2))/(2*c^3*(a*d^2 - e*(b*d - c*e)))]

    @test_int [x^3/((a + c/x^2 + b/x)*(d + e*x)^2), x, 7, -(((2*a*d + b*e)*x)/(a^2*e^3)) + x^2/(2*a*e^2) + d^5/(e^4*(a*d^2 - e*(b*d - c*e))*(d + e*x)) + ((b^5*d^2 - 2*b^4*c*d*e + 8*a*b^2*c^2*d*e - 4*a^2*c^3*d*e + a*b*c^2*(5*a*d^2 - 3*c*e^2) - b^3*c*(5*a*d^2 - c*e^2))*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(a^3*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))^2) + (d^4*(3*a*d^2 - e*(4*b*d - 5*c*e))*log(d + e*x))/(e^4*(a*d^2 - e*(b*d - c*e))^2) + ((b^4*d^2 - 2*b^3*c*d*e + 4*a*b*c^2*d*e + a*c^2*(a*d^2 - c*e^2) - b^2*c*(3*a*d^2 - c*e^2))*log(c + b*x + a*x^2))/(2*a^3*(a*d^2 - e*(b*d - c*e))^2)]
    @test_int [x^2/((a + c/x^2 + b/x)*(d + e*x)^2), x, 7, x/(a*e^2) - d^4/(e^3*(a*d^2 - e*(b*d - c*e))*(d + e*x)) - ((b^4*d^2 - 2*b^3*c*d*e + 6*a*b*c^2*d*e + 2*a*c^2*(a*d^2 - c*e^2) - b^2*c*(4*a*d^2 - c*e^2))*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(a^2*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))^2) - (d^3*(2*a*d^2 - e*(3*b*d - 4*c*e))*log(d + e*x))/(e^3*(a*d^2 - e*(b*d - c*e))^2) - ((b*d - c*e)*(b^2*d - 2*a*c*d - b*c*e)*log(c + b*x + a*x^2))/(2*a^2*(a*d^2 - e*(b*d - c*e))^2)]
    @test_int [x^1/((a + c/x^2 + b/x)*(d + e*x)^2), x, 7, d^3/(e^2*(a*d^2 - e*(b*d - c*e))*(d + e*x)) + ((b^3*d^2 - 2*b^2*c*d*e + 4*a*c^2*d*e - b*c*(3*a*d^2 - c*e^2))*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(a*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))^2) + (d^2*(a*d^2 - e*(2*b*d - 3*c*e))*log(d + e*x))/(e^2*(a*d^2 - e*(b*d - c*e))^2) + ((b^2*d^2 - 2*b*c*d*e - c*(a*d^2 - c*e^2))*log(c + b*x + a*x^2))/(2*a*(a*d^2 - e*(b*d - c*e))^2)]
    @test_int [x^0/((a + c/x^2 + b/x)*(d + e*x)^2), x, 7, -(d^2/(e*(a*d^2 - b*d*e + c*e^2)*(d + e*x))) - ((b^2*d^2 - 2*b*c*d*e - 2*c*(a*d^2 - c*e^2))*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))^2) + (d*(b*d - 2*c*e)*log(d + e*x))/(a*d^2 - e*(b*d - c*e))^2 - (d*(b*d - 2*c*e)*log(c + b*x + a*x^2))/(2*(a*d^2 - e*(b*d - c*e))^2)]
    @test_int [1/(x^1*(a + c/x^2 + b/x)*(d + e*x)^2), x, 7, d/((a*d^2 - b*d*e + c*e^2)*(d + e*x)) + ((b*c*e^2 + a*d*(b*d - 4*c*e))*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))^2) - ((a*d^2 - c*e^2)*log(d + e*x))/(a*d^2 - e*(b*d - c*e))^2 + ((a*d^2 - c*e^2)*log(c + b*x + a*x^2))/(2*(a*d^2 - e*(b*d - c*e))^2)]
    @test_int [1/(x^2*(a + c/x^2 + b/x)*(d + e*x)^2), x, 8, -(e/((a*d^2 - b*d*e + c*e^2)*(d + e*x))) - ((2*a^2*d^2 + b^2*e^2 - 2*a*e*(b*d + c*e))*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))^2) + (e*(2*a*d - b*e)*log(d + e*x))/(a*d^2 - e*(b*d - c*e))^2 - (e*(2*a*d - b*e)*log(c + b*x + a*x^2))/(2*(a*d^2 - e*(b*d - c*e))^2)]
    @test_int [1/(x^3*(a + c/x^2 + b/x)*(d + e*x)^2), x, 7, e^2/(d*(a*d^2 - b*d*e + c*e^2)*(d + e*x)) + ((b^3*e^2 - a*b*e*(2*b*d + 3*c*e) + a^2*d*(b*d + 4*c*e))*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(c*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))^2) + log(x)/(c*d^2) - (e^2*(3*a*d^2 - e*(2*b*d - c*e))*log(d + e*x))/(d^2*(a*d^2 - e*(b*d - c*e))^2) - ((a^2*d^2 + b^2*e^2 - a*e*(2*b*d + c*e))*log(c + b*x + a*x^2))/(2*c*(a*d^2 - e*(b*d - c*e))^2)]
    @test_int [1/(x^4*(a + c/x^2 + b/x)*(d + e*x)^2), x, 7, -(1/(c*d^2*x)) - e^3/(d^2*(a*d^2 - e*(b*d - c*e))*(d + e*x)) + ((2*a^3*c*d^2 - b^4*e^2 + 2*a*b^2*e*(b*d + 2*c*e) - a^2*(b^2*d^2 + 6*b*c*d*e + 2*c^2*e^2))*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(c^2*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))^2) - ((b*d + 2*c*e)*log(x))/(c^2*d^3) + (e^3*(4*a*d^2 - e*(3*b*d - 2*c*e))*log(d + e*x))/(d^3*(a*d^2 - e*(b*d - c*e))^2) + ((a*d - b*e)*(a*b*d - b^2*e + 2*a*c*e)*log(c + b*x + a*x^2))/(2*c^2*(a*d^2 - e*(b*d - c*e))^2)]
    @test_int [1/(x^5*(a + c/x^2 + b/x)*(d + e*x)^2), x, 7, -(1/(2*c*d^2*x^2)) + (b*d + 2*c*e)/(c^2*d^3*x) + e^4/(d^3*(a*d^2 - e*(b*d - c*e))*(d + e*x)) + ((b^5*e^2 - a^3*c*d*(3*b*d + 4*c*e) - a*b^3*e*(2*b*d + 5*c*e) + a^2*b*(b^2*d^2 + 8*b*c*d*e + 5*c^2*e^2))*atanh((b + 2*a*x)/sqrt(b^2 - 4*a*c)))/(c^3*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))^2) + ((b^2*d^2 + 2*b*c*d*e - c*(a*d^2 - 3*c*e^2))*log(x))/(c^3*d^4) - (e^4*(5*a*d^2 - e*(4*b*d - 3*c*e))*log(d + e*x))/(d^4*(a*d^2 - e*(b*d - c*e))^2) + ((a^3*c*d^2 - b^4*e^2 + a*b^2*e*(2*b*d + 3*c*e) - a^2*(b^2*d^2 + 4*b*c*d*e + c^2*e^2))*log(c + b*x + a*x^2))/(2*c^3*(a*d^2 - e*(b*d - c*e))^2)]

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*x^m*(d+e*x)^(q/2)*(a+b/x+c/x^2)^(p/2)=#

    @test_int [x^4*sqrt(d + e*x)*sqrt(a + b/x + c/x^2), x, 11, -((2*(187*a^4*d^4 + 64*b^4*e^4 + 4*a*b^2*e^3*(7*b*d - 69*c*e) - 4*a^3*d^2*e*(2*b*d + 3*c*e) + 3*a^2*e^2*(3*b^2*d^2 - 29*b*c*d*e + 50*c^2*e^2))*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x))/(3465*a^4*e^4)) + (2/11)*sqrt(a + c/x^2 + b/x)*x^5*sqrt(d + e*x) + (2*(233*a^3*d^3 + 48*b^3*e^3 + a*b*e^2*(67*b*d - 157*c*e) + 4*a^2*d*e*(18*b*d - 37*c*e))*sqrt(a + c/x^2 + b/x)*x*(d + e*x)^(3/2))/(3465*a^3*e^4) - (2*(29*a^2*d^2 + 8*b^2*e^2 + a*e*(19*b*d - 18*c*e))*sqrt(a + c/x^2 + b/x)*x*(d + e*x)^(5/2))/(693*a^2*e^4) + (2*(a*d + b*e)*sqrt(a + c/x^2 + b/x)*x*(d + e*x)^(7/2))/(99*a*e^4) + (sqrt(2)*sqrt(b^2 - 4*a*c)*(128*a^5*d^5 + 128*b^5*e^5 - 4*a^4*d^3*e*(14*b*d - 27*c*e) - 8*a*b^3*e^4*(7*b*d + 87*c*e) - a^2*b*e^3*(37*b^2*d^2 - 258*b*c*d*e - 771*c^2*e^2) - a^3*d*e^2*(37*b^2*d^2 - 135*b*c*d*e + 156*c^2*e^2))*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x)*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.E(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(3465*a^5*e^5*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*(c + b*x + a*x^2)) - (1/(3465*a^5*e^5*sqrt(d + e*x)*(c + b*x + a*x^2)))*(2*sqrt(2)*sqrt(b^2 - 4*a*c)*(a*d^2 - e*(b*d - c*e))*(128*a^4*d^4 - 64*b^4*e^4 - 4*a*b^2*e^3*(7*b*d - 69*c*e) + 4*a^3*d^2*e*(2*b*d + 3*c*e) - 3*a^2*e^2*(3*b^2*d^2 - 29*b*c*d*e + 50*c^2*e^2))*sqrt(a + c/x^2 + b/x)*x*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.F(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))]
    @test_int [x^3*sqrt(d + e*x)*sqrt(a + b/x + c/x^2), x, 10, (2*(19*a^3*d^3 - 6*a^2*c*d*e^2 + 8*b^3*e^3 + 3*a*b*e^2*(b*d - 9*c*e))*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x))/(315*a^3*e^3) + (2/9)*sqrt(a + c/x^2 + b/x)*x^4*sqrt(d + e*x) - (4*(8*a^2*d^2 + 3*b^2*e^2 + a*e*(4*b*d - 7*c*e))*sqrt(a + c/x^2 + b/x)*x*(d + e*x)^(3/2))/(315*a^2*e^3) + (2*(a*d + b*e)*sqrt(a + c/x^2 + b/x)*x*(d + e*x)^(5/2))/(63*a*e^3) - (2*sqrt(2)*sqrt(b^2 - 4*a*c)*(8*a^4*d^4 + 8*b^4*e^4 - a^3*d^2*e*(4*b*d - 9*c*e) - 4*a*b^2*e^3*(b*d + 9*c*e) - 3*a^2*e^2*(b^2*d^2 - 5*b*c*d*e - 7*c^2*e^2))*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x)*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.E(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(315*a^4*e^4*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*(c + b*x + a*x^2)) + (1/(315*a^4*e^4*sqrt(d + e*x)*(c + b*x + a*x^2)))*(2*sqrt(2)*sqrt(b^2 - 4*a*c)*(16*a^3*d^3 + 6*a^2*c*d*e^2 - 8*b^3*e^3 - 3*a*b*e^2*(b*d - 9*c*e))*(a*d^2 - e*(b*d - c*e))*sqrt(a + c/x^2 + b/x)*x*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.F(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))]
    @test_int [x^2*sqrt(d + e*x)*sqrt(a + b/x + c/x^2), x, 8, -((2*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x)*(4*a^2*d^2 + 4*b^2*e^2 - a*e*(2*b*d - 5*c*e) - 3*a*e*(a*d - 4*b*e)*x))/(105*a^2*e^2)) + (2*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x)*(c + b*x + a*x^2))/(7*a) + (sqrt(2)*sqrt(b^2 - 4*a*c)*(8*a^3*d^3 + 8*b^3*e^3 - a^2*d*e*(5*b*d - 16*c*e) - a*b*e^2*(5*b*d + 29*c*e))*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x)*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.E(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(105*a^3*e^3*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*(c + b*x + a*x^2)) - (1/(105*a^3*e^3*sqrt(d + e*x)*(c + b*x + a*x^2)))*(2*sqrt(2)*sqrt(b^2 - 4*a*c)*(8*a^2*d^2 - 4*b^2*e^2 - a*e*(b*d - 10*c*e))*(a*d^2 - e*(b*d - c*e))*sqrt(a + c/x^2 + b/x)*x*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.F(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))]
    @test_int [x^1*sqrt(d + e*x)*sqrt(a + b/x + c/x^2), x, 8, -((2*(2*a*d - b*e)*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x))/(15*a*e)) + (2*sqrt(a + c/x^2 + b/x)*x*(d + e*x)^(3/2))/(5*e) - (2*sqrt(2)*sqrt(b^2 - 4*a*c)*(a^2*d^2 + b^2*e^2 - a*e*(b*d + 3*c*e))*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x)*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.E(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(15*a^2*e^2*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*(c + b*x + a*x^2)) + (2*sqrt(2)*sqrt(b^2 - 4*a*c)*(2*a*d - b*e)*(a*d^2 - e*(b*d - c*e))*sqrt(a + c/x^2 + b/x)*x*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.F(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(15*a^2*e^2*sqrt(d + e*x)*(c + b*x + a*x^2))]
    @test_int [x^0*sqrt(d + e*x)*sqrt(a + b/x + c/x^2), x, 16, (2/3)*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x) + (sqrt(2)*sqrt(b^2 - 4*a*c)*(a*d + b*e)*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x)*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.E(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(3*a*e*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*(c + b*x + a*x^2)) - (2*sqrt(2)*sqrt(b^2 - 4*a*c)*d*(a*d + b*e)*sqrt(a + c/x^2 + b/x)*x*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.F(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(3*a*e*sqrt(d + e*x)*(c + b*x + a*x^2)) + (4*sqrt(2)*sqrt(b^2 - 4*a*c)*(b*d + c*e)*sqrt(a + c/x^2 + b/x)*x*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.F(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(3*a*sqrt(d + e*x)*(c + b*x + a*x^2)) - (1/(sqrt(a)*(c + b*x + a*x^2)))*(sqrt(2)*c*sqrt(2*a*d - (b - sqrt(b^2 - 4*a*c))*e)*sqrt(a + c/x^2 + b/x)*x*sqrt(1 - (2*a*(d + e*x))/(2*a*d - (b - sqrt(b^2 - 4*a*c))*e))*sqrt(1 - (2*a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*Elliptic.Pi((2*a*d - b*e + sqrt(b^2 - 4*a*c)*e)/(2*a*d), asin((sqrt(2)*sqrt(a)*sqrt(d + e*x))/sqrt(2*a*d - (b - sqrt(b^2 - 4*a*c))*e)), (b - sqrt(b^2 - 4*a*c) - (2*a*d)/e)/(b + sqrt(b^2 - 4*a*c) - (2*a*d)/e)))]
    @test_int [sqrt(d + e*x)*sqrt(a + b/x + c/x^2)/x^1, x, 16, (-sqrt(a + c/x^2 + b/x))*sqrt(d + e*x) + (3*sqrt(b^2 - 4*a*c)*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x)*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.E(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(sqrt(2)*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*(c + b*x + a*x^2)) - (3*sqrt(2)*sqrt(b^2 - 4*a*c)*d*sqrt(a + c/x^2 + b/x)*x*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.F(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(sqrt(d + e*x)*(c + b*x + a*x^2)) + (2*sqrt(2)*sqrt(b^2 - 4*a*c)*(a*d + b*e)*sqrt(a + c/x^2 + b/x)*x*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.F(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(a*sqrt(d + e*x)*(c + b*x + a*x^2)) - ((b*d + c*e)*sqrt(2*a*d - (b - sqrt(b^2 - 4*a*c))*e)*sqrt(a + c/x^2 + b/x)*x*sqrt(1 - (2*a*(d + e*x))/(2*a*d - (b - sqrt(b^2 - 4*a*c))*e))*sqrt(1 - (2*a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*Elliptic.Pi((2*a*d - b*e + sqrt(b^2 - 4*a*c)*e)/(2*a*d), asin((sqrt(2)*sqrt(a)*sqrt(d + e*x))/sqrt(2*a*d - (b - sqrt(b^2 - 4*a*c))*e)), (b - sqrt(b^2 - 4*a*c) - (2*a*d)/e)/(b + sqrt(b^2 - 4*a*c) - (2*a*d)/e)))/(sqrt(2)*sqrt(a)*d*(c + b*x + a*x^2))]
    @test_int [sqrt(d + e*x)*sqrt(a + b/x + c/x^2)/x^2, x, 24, -(((b*d + c*e)*sqrt(a + c/x^2 + b/x)*sqrt(d + e*x))/(4*c*d)) - (sqrt(a + c/x^2 + b/x)*sqrt(d + e*x))/(2*x) + (sqrt(b^2 - 4*a*c)*(b*d + c*e)*sqrt(a + c/x^2 + b/x)*x*sqrt(d + e*x)*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.E(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(4*sqrt(2)*c*d*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*(c + b*x + a*x^2)) + (3*sqrt(b^2 - 4*a*c)*e*sqrt(a + c/x^2 + b/x)*x*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.F(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(sqrt(2)*sqrt(d + e*x)*(c + b*x + a*x^2)) - (sqrt(b^2 - 4*a*c)*(b*d + c*e)*sqrt(a + c/x^2 + b/x)*x*sqrt((a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*sqrt(-((a*(c + b*x + a*x^2))/(b^2 - 4*a*c)))*Elliptic.F(asin(sqrt((b + sqrt(b^2 - 4*a*c) + 2*a*x)/sqrt(b^2 - 4*a*c))/sqrt(2)), -((2*sqrt(b^2 - 4*a*c)*e)/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))))/(2*sqrt(2)*c*sqrt(d + e*x)*(c + b*x + a*x^2)) - ((a*d + b*e)*sqrt(2*a*d - (b - sqrt(b^2 - 4*a*c))*e)*sqrt(a + c/x^2 + b/x)*x*sqrt(1 - (2*a*(d + e*x))/(2*a*d - (b - sqrt(b^2 - 4*a*c))*e))*sqrt(1 - (2*a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*Elliptic.Pi((2*a*d - b*e + sqrt(b^2 - 4*a*c)*e)/(2*a*d), asin((sqrt(2)*sqrt(a)*sqrt(d + e*x))/sqrt(2*a*d - (b - sqrt(b^2 - 4*a*c))*e)), (b - sqrt(b^2 - 4*a*c) - (2*a*d)/e)/(b + sqrt(b^2 - 4*a*c) - (2*a*d)/e)))/(sqrt(2)*sqrt(a)*d*(c + b*x + a*x^2)) + ((b*d + c*e)^2*sqrt(2*a*d - (b - sqrt(b^2 - 4*a*c))*e)*sqrt(a + c/x^2 + b/x)*x*sqrt(1 - (2*a*(d + e*x))/(2*a*d - (b - sqrt(b^2 - 4*a*c))*e))*sqrt(1 - (2*a*(d + e*x))/(2*a*d - (b + sqrt(b^2 - 4*a*c))*e))*Elliptic.Pi((2*a*d - b*e + sqrt(b^2 - 4*a*c)*e)/(2*a*d), asin((sqrt(2)*sqrt(a)*sqrt(d + e*x))/sqrt(2*a*d - (b - sqrt(b^2 - 4*a*c))*e)), (b - sqrt(b^2 - 4*a*c) - (2*a*d)/e)/(b + sqrt(b^2 - 4*a*c) - (2*a*d)/e)))/(4*sqrt(2)*sqrt(a)*c*d^2*(c + b*x + a*x^2))]

    #= ::Title::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^n)^q*(a+b*x^n+c*x^(2*n))^p*with*symbolic*n=#

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^n)^q*(a+b*x^n+c*x^(2*n))^p*with*b=0=#

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^n)^q*(a+c*x^(2*n))^p*with*p*symbolic=#

    @test_int [(f*x)^m*(d + e*x^n)^q*(a + c*x^(2*n))^p, x, 0, Unintegrable((f*x)^m*(d + e*x^n)^q*(a + c*x^(2*n))^p, x)]

    @test_int [(f*x)^m*(a + c*x^(2*n))^p*(d + e*x^n)^3, x, 13, (d^3*(f*x)^(1 + m)*(a + c*x^(2*n))^p*HypergeometricFunctions._₂F₁((1 + m)/(2*n), -p, 1 + (1 + m)/(2*n), -((c*x^(2*n))/a)))/((1 + (c*x^(2*n))/a)^p*(f*(1 + m))) + (3*d^2*e*x^(1 + n)*(f*x)^m*(a + c*x^(2*n))^p*HypergeometricFunctions._₂F₁((1 + m + n)/(2*n), -p, (1 + m + 3*n)/(2*n), -((c*x^(2*n))/a)))/((1 + (c*x^(2*n))/a)^p*(1 + m + n)) + (3*d*e^2*x^(1 + 2*n)*(f*x)^m*(a + c*x^(2*n))^p*HypergeometricFunctions._₂F₁((1 + m + 2*n)/(2*n), -p, (1 + m + 4*n)/(2*n), -((c*x^(2*n))/a)))/((1 + (c*x^(2*n))/a)^p*(1 + m + 2*n)) + (e^3*x^(1 + 3*n)*(f*x)^m*(a + c*x^(2*n))^p*HypergeometricFunctions._₂F₁((1 + m + 3*n)/(2*n), -p, (1 + m + 5*n)/(2*n), -((c*x^(2*n))/a)))/((1 + (c*x^(2*n))/a)^p*(1 + m + 3*n))]
    @test_int [(f*x)^m*(a + c*x^(2*n))^p*(d + e*x^n)^2, x, 10, (d^2*(f*x)^(1 + m)*(a + c*x^(2*n))^p*HypergeometricFunctions._₂F₁((1 + m)/(2*n), -p, 1 + (1 + m)/(2*n), -((c*x^(2*n))/a)))/((1 + (c*x^(2*n))/a)^p*(f*(1 + m))) + (2*d*e*x^(1 + n)*(f*x)^m*(a + c*x^(2*n))^p*HypergeometricFunctions._₂F₁((1 + m + n)/(2*n), -p, (1 + m + 3*n)/(2*n), -((c*x^(2*n))/a)))/((1 + (c*x^(2*n))/a)^p*(1 + m + n)) + (e^2*x^(1 + 2*n)*(f*x)^m*(a + c*x^(2*n))^p*HypergeometricFunctions._₂F₁((1 + m + 2*n)/(2*n), -p, (1 + m + 4*n)/(2*n), -((c*x^(2*n))/a)))/((1 + (c*x^(2*n))/a)^p*(1 + m + 2*n))]
    @test_int [(f*x)^m*(a + c*x^(2*n))^p*(d + e*x^n)^1, x, 7, (d*(f*x)^(1 + m)*(a + c*x^(2*n))^p*HypergeometricFunctions._₂F₁((1 + m)/(2*n), -p, 1 + (1 + m)/(2*n), -((c*x^(2*n))/a)))/((1 + (c*x^(2*n))/a)^p*(f*(1 + m))) + (e*x^(1 + n)*(f*x)^m*(a + c*x^(2*n))^p*HypergeometricFunctions._₂F₁((1 + m + n)/(2*n), -p, (1 + m + 3*n)/(2*n), -((c*x^(2*n))/a)))/((1 + (c*x^(2*n))/a)^p*(1 + m + n))]
    @test_int [(f*x)^m*(a + c*x^(2*n))^p/(d + e*x^n)^1, x, 6, (x*(f*x)^m*(a + c*x^(2*n))^p*AppellF1((1 + m)/(2*n), -p, 1, 1 + (1 + m)/(2*n), -((c*x^(2*n))/a), (e^2*x^(2*n))/d^2))/((1 + (c*x^(2*n))/a)^p*(d*(1 + m))) - (e*x^(1 + n)*(f*x)^m*(a + c*x^(2*n))^p*AppellF1((1 + m + n)/(2*n), -p, 1, (1 + m + 3*n)/(2*n), -((c*x^(2*n))/a), (e^2*x^(2*n))/d^2))/((1 + (c*x^(2*n))/a)^p*(d^2*(1 + m + n)))]
    @test_int [(f*x)^m*(a + c*x^(2*n))^p/(d + e*x^n)^2, x, 8, (x*(f*x)^m*(a + c*x^(2*n))^p*AppellF1((1 + m)/(2*n), -p, 2, 1 + (1 + m)/(2*n), -((c*x^(2*n))/a), (e^2*x^(2*n))/d^2))/((1 + (c*x^(2*n))/a)^p*(d^2*(1 + m))) - (2*e*x^(1 + n)*(f*x)^m*(a + c*x^(2*n))^p*AppellF1((1 + m + n)/(2*n), -p, 2, (1 + m + 3*n)/(2*n), -((c*x^(2*n))/a), (e^2*x^(2*n))/d^2))/((1 + (c*x^(2*n))/a)^p*(d^3*(1 + m + n))) + (e^2*x^(1 + 2*n)*(f*x)^m*(a + c*x^(2*n))^p*AppellF1((1 + m + 2*n)/(2*n), -p, 2, (1 + m + 4*n)/(2*n), -((c*x^(2*n))/a), (e^2*x^(2*n))/d^2))/((1 + (c*x^(2*n))/a)^p*(d^4*(1 + m + 2*n)))]
    @test_int [(f*x)^m*(a + c*x^(2*n))^p/(d + e*x^n)^3, x, 10, (x*(f*x)^m*(a + c*x^(2*n))^p*AppellF1((1 + m)/(2*n), -p, 3, 1 + (1 + m)/(2*n), -((c*x^(2*n))/a), (e^2*x^(2*n))/d^2))/((1 + (c*x^(2*n))/a)^p*(d^3*(1 + m))) - (3*e*x^(1 + n)*(f*x)^m*(a + c*x^(2*n))^p*AppellF1((1 + m + n)/(2*n), -p, 3, (1 + m + 3*n)/(2*n), -((c*x^(2*n))/a), (e^2*x^(2*n))/d^2))/((1 + (c*x^(2*n))/a)^p*(d^4*(1 + m + n))) + (3*e^2*x^(1 + 2*n)*(f*x)^m*(a + c*x^(2*n))^p*AppellF1((1 + m + 2*n)/(2*n), -p, 3, (1 + m + 4*n)/(2*n), -((c*x^(2*n))/a), (e^2*x^(2*n))/d^2))/((1 + (c*x^(2*n))/a)^p*(d^5*(1 + m + 2*n))) - (e^3*x^(1 + 3*n)*(f*x)^m*(a + c*x^(2*n))^p*AppellF1((1 + m + 3*n)/(2*n), -p, 3, (1 + m + 5*n)/(2*n), -((c*x^(2*n))/a), (e^2*x^(2*n))/d^2))/((1 + (c*x^(2*n))/a)^p*(d^6*(1 + m + 3*n)))]

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^n)^q*(a+b*x^n+c*x^(2*n))^p*with*2*c*d-b*e=0=#

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*x^m*(b + 2*c*x^n)*(a + b*x^n + c*x^(2*n))^p=#

    #= ::Subsubsection::Closed:: =#
    #=p>0=#

    @test_int [x^0*(b + 2*c*x^1)*(a + b*x^1 + c*x^2)^13, x, 1, (1/14)*(a + b*x + c*x^2)^14]
    @test_int [x^1*(b + 2*c*x^2)*(a + b*x^2 + c*x^4)^13, x, 2, (1/28)*(a + b*x^2 + c*x^4)^14]
    @test_int [x^2*(b + 2*c*x^3)*(a + b*x^3 + c*x^6)^13, x, 2, (1/42)*(a + b*x^3 + c*x^6)^14]
    @test_int [x^(n - 1)*(b + 2*c*x^n)*(a + b*x^n + c*x^(2*n))^13, x, 2, (a + b*x^n + c*x^(2*n))^14/(14*n)]

    @test_int [x^0*(b + 2*c*x^1)*(-a + b*x^1 + c*x^2)^13, x, 1, (1/14)*(a - b*x - c*x^2)^14]
    @test_int [x^1*(b + 2*c*x^2)*(-a + b*x^2 + c*x^4)^13, x, 2, (1/28)*(a - b*x^2 - c*x^4)^14]
    @test_int [x^2*(b + 2*c*x^3)*(-a + b*x^3 + c*x^6)^13, x, 2, (1/42)*(a - b*x^3 - c*x^6)^14]
    @test_int [x^(n - 1)*(b + 2*c*x^n)*(-a + b*x^n + c*x^(2*n))^13, x, 2, (a - b*x^n - c*x^(2*n))^14/(14*n)]

    @test_int [x^0*(b + 2*c*x^1)*(b*x^1 + c*x^2)^13, x, 1, (1/14)*(b*x + c*x^2)^14]
    @test_int [x^1*(b + 2*c*x^2)*(b*x^2 + c*x^4)^13, x, 3, (1/28)*x^28*(b + c*x^2)^14]
    @test_int [x^2*(b + 2*c*x^3)*(b*x^3 + c*x^6)^13, x, 3, (1/42)*x^42*(b + c*x^3)^14]
    @test_int [x^(n - 1)*(b + 2*c*x^n)*(b*x^n + c*x^(2*n))^13, x, 3, (x^(14*n)*(b + c*x^n)^14)/(14*n)]

    #= ::Subsubsection::Closed:: =#
    #=p<0=#

    @test_int [x^0*(b + 2*c*x^1)/(a + b*x^1 + c*x^2), x, 1, log(a + b*x + c*x^2)]
    @test_int [x^1*(b + 2*c*x^2)/(a + b*x^2 + c*x^4), x, 2, (1/2)*log(a + b*x^2 + c*x^4)]
    @test_int [x^2*(b + 2*c*x^3)/(a + b*x^3 + c*x^6), x, 2, (1/3)*log(a + b*x^3 + c*x^6)]
    @test_int [x^(n - 1)*(b + 2*c*x^n)/(a + b*x^n + c*x^(2*n)), x, 2, log(a + b*x^n + c*x^(2*n))/n]

    @test_int [x^0*(b + 2*c*x^1)/(a + b*x^1 + c*x^2)^8, x, 1, -(1/(7*(a + b*x + c*x^2)^7))]
    @test_int [x^1*(b + 2*c*x^2)/(a + b*x^2 + c*x^4)^8, x, 2, -(1/(14*(a + b*x^2 + c*x^4)^7))]
    @test_int [x^2*(b + 2*c*x^3)/(a + b*x^3 + c*x^6)^8, x, 2, -(1/(21*(a + b*x^3 + c*x^6)^7))]
    @test_int [x^(n - 1)*(b + 2*c*x^n)/(a + b*x^n + c*x^(2*n))^8, x, 2, -(1/(7*n*(a + b*x^n + c*x^(2*n))^7))]

    @test_int [x^0*(b + 2*c*x^1)/(-a + b*x^1 + c*x^2), x, 1, log(a - b*x - c*x^2)]
    @test_int [x^1*(b + 2*c*x^2)/(-a + b*x^2 + c*x^4), x, 2, (1/2)*log(a - b*x^2 - c*x^4)]
    @test_int [x^2*(b + 2*c*x^3)/(-a + b*x^3 + c*x^6), x, 2, (1/3)*log(a - b*x^3 - c*x^6)]
    @test_int [x^(n - 1)*(b + 2*c*x^n)/(-a + b*x^n + c*x^(2*n)), x, 2, log(a - b*x^n - c*x^(2*n))/n]

    @test_int [x^0*(b + 2*c*x^1)/(-a + b*x^1 + c*x^2)^8, x, 1, 1/(7*(a - b*x - c*x^2)^7)]
    @test_int [x^1*(b + 2*c*x^2)/(-a + b*x^2 + c*x^4)^8, x, 2, 1/(14*(a - b*x^2 - c*x^4)^7)]
    @test_int [x^2*(b + 2*c*x^3)/(-a + b*x^3 + c*x^6)^8, x, 2, 1/(21*(a - b*x^3 - c*x^6)^7)]
    @test_int [x^(n - 1)*(b + 2*c*x^n)/(-a + b*x^n + c*x^(2*n))^8, x, 2, 1/(7*n*(a - b*x^n - c*x^(2*n))^7)]

    @test_int [x^0*(b + 2*c*x^1)/(b*x^1 + c*x^2), x, 1, log(b*x + c*x^2)]
    @test_int [x^1*(b + 2*c*x^2)/(b*x^2 + c*x^4), x, 4, (1/2)*log(b*x^2 + c*x^4), log(x) + (1/2)*log(b + c*x^2)]
    @test_int [x^2*(b + 2*c*x^3)/(b*x^3 + c*x^6), x, 4, (1/3)*log(b*x^3 + c*x^6), log(x) + (1/3)*log(b + c*x^3)]
    @test_int [x^(n - 1)*(b + 2*c*x^n)/(b*x^n + c*x^(2*n)), x, 4, log(x) + log(b + c*x^n)/n]

    @test_int [x^0*(b + 2*c*x^1)/(b*x^1 + c*x^2)^8, x, 1, -(1/(7*(b*x + c*x^2)^7))]
    @test_int [x^1*(b + 2*c*x^2)/(b*x^2 + c*x^4)^8, x, 3, -(1/(14*x^14*(b + c*x^2)^7))]
    @test_int [x^2*(b + 2*c*x^3)/(b*x^3 + c*x^6)^8, x, 3, -(1/(21*x^21*(b + c*x^3)^7))]
    @test_int [x^(n - 1)*(b + 2*c*x^n)/(b*x^n + c*x^(2*n))^8, x, 3, -(1/(x^(7*n)*(7*n*(b + c*x^n)^7)))]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*x^m*(b + 2*c*x^n)*(a + b*x^n + c*x^(2*n))^p*with*p*symbolic=#

    @test_int [x^0*(b + 2*c*x^1)*(a + b*x^1 + c*x^2)^p, x, 1, (a + b*x + c*x^2)^(1 + p)/(1 + p)]
    @test_int [x^1*(b + 2*c*x^2)*(a + b*x^2 + c*x^4)^p, x, 2, (a + b*x^2 + c*x^4)^(1 + p)/(2*(1 + p))]
    @test_int [x^2*(b + 2*c*x^3)*(a + b*x^3 + c*x^6)^p, x, 2, (a + b*x^3 + c*x^6)^(1 + p)/(3*(1 + p))]
    @test_int [x^(n - 1)*(b + 2*c*x^n)*(a + b*x^n + c*x^(2*n))^p, x, 2, (a + b*x^n + c*x^(2*n))^(1 + p)/(n*(1 + p))]

    @test_int [x^0*(b + 2*c*x^1)*(-a + b*x^1 + c*x^2)^p, x, 1, (-a + b*x + c*x^2)^(1 + p)/(1 + p)]
    @test_int [x^1*(b + 2*c*x^2)*(-a + b*x^2 + c*x^4)^p, x, 2, (-a + b*x^2 + c*x^4)^(1 + p)/(2*(1 + p))]
    @test_int [x^2*(b + 2*c*x^3)*(-a + b*x^3 + c*x^6)^p, x, 2, (-a + b*x^3 + c*x^6)^(1 + p)/(3*(1 + p))]
    @test_int [x^(n - 1)*(b + 2*c*x^n)*(-a + b*x^n + c*x^(2*n))^p, x, 2, (-a + b*x^n + c*x^(2*n))^(1 + p)/(n*(1 + p))]

    @test_int [x^0*(b + 2*c*x^1)*(b*x^1 + c*x^2)^p, x, 1, (b*x + c*x^2)^(1 + p)/(1 + p)]
    @test_int [x^1*(b + 2*c*x^2)*(b*x^2 + c*x^4)^p, x, 1, (b*x^2 + c*x^4)^(1 + p)/(2*(1 + p))]
    @test_int [x^2*(b + 2*c*x^3)*(b*x^3 + c*x^6)^p, x, 1, (b*x^3 + c*x^6)^(1 + p)/(3*(1 + p))]
    @test_int [x^(n - 1)*(b + 2*c*x^n)*(b*x^n + c*x^(2*n))^p, x, 2, (b*x^n + c*x^(2*n))^(1 + p)/(n*(1 + p))]

    #= ::Section:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^n)^q*(a+b*x^n+c*x^(2*n))^p*with*b^2-4*a*c=0=#

    #= ::Section:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^n)^q*(a+b*x^n+c*x^(2*n))^p*with*c*d^2-b*d*e+a*e^2=0=#

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^n)^q*(a+b*x^n+c*x^(2*n))^p=#

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^n)^q*(a+b*x^n+c*x^(2*n))^p=#

    #= ::Subsubsection:: =#
    #=p>0=#

    #= ::Subsubsection::Closed:: =#
    #=p<0=#

    @test_int [(f*x)^m*(d + e*x^n)/(a + b*x^n + c*x^(2*n)), x, 4, ((e + (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*(f*x)^(1 + m)*HypergeometricFunctions._₂F₁(1, (1 + m)/n, (1 + m + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))))/((b - sqrt(b^2 - 4*a*c))*f*(1 + m)) + ((e - (2*c*d - b*e)/sqrt(b^2 - 4*a*c))*(f*x)^(1 + m)*HypergeometricFunctions._₂F₁(1, (1 + m)/n, (1 + m + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))))/((b + sqrt(b^2 - 4*a*c))*f*(1 + m))]

    @test_int [(f*x)^m*(d + e*x^n)/(a + b*x^n + c*x^(2*n))^2, x, 5, ((f*x)^(1 + m)*(b^2*d - 2*a*c*d - a*b*e + c*(b*d - 2*a*e)*x^n))/(a*(b^2 - 4*a*c)*f*n*(a + b*x^n + c*x^(2*n))) - (c*((b*d - 2*a*e)*(1 + m - n) - (4*a*c*d*(1 + m - 2*n) - b^2*d*(1 + m - n) + 2*a*b*e*n)/sqrt(b^2 - 4*a*c))*(f*x)^(1 + m)*HypergeometricFunctions._₂F₁(1, (1 + m)/n, (1 + m + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))))/(a*(b^2 - 4*a*c)*(b - sqrt(b^2 - 4*a*c))*f*(1 + m)*n) - (c*((b*d - 2*a*e)*(1 + m - n) + (4*a*c*d*(1 + m - 2*n) - b^2*d*(1 + m - n) + 2*a*b*e*n)/sqrt(b^2 - 4*a*c))*(f*x)^(1 + m)*HypergeometricFunctions._₂F₁(1, (1 + m)/n, (1 + m + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))))/(a*(b^2 - 4*a*c)*(b + sqrt(b^2 - 4*a*c))*f*(1 + m)*n)]

    @test_int [(f*x)^m*(d + e*x^n)/(a + b*x^n + c*x^(2*n))^3, x, 6, ((f*x)^(1 + m)*(b^2*d - 2*a*c*d - a*b*e + c*(b*d - 2*a*e)*x^n))/(2*a*(b^2 - 4*a*c)*f*n*(a + b*x^n + c*x^(2*n))^2) + ((f*x)^(1 + m)*((b^2 - 2*a*c)*(a*b*e*(1 + m) + 2*a*c*d*(1 + m - 4*n) - b^2*d*(1 + m - 2*n)) + a*b*c*(b*d - 2*a*e)*(1 + m - 3*n) + c*(a*b^2*e*(1 + m) + 2*a*b*c*d*(2 + 2*m - 7*n) - 4*a^2*c*e*(1 + m - 3*n) - b^3*d*(1 + m - 2*n))*x^n))/(2*a^2*(b^2 - 4*a*c)^2*f*n^2*(a + b*x^n + c*x^(2*n))) - (1/(2*a^2*(b^2 - 4*a*c)^2*(b - sqrt(b^2 - 4*a*c))*f*(1 + m)*n^2))*(c*((a*b^2*e*(1 + m) + 2*a*b*c*d*(2 + 2*m - 7*n) - 4*a^2*c*e*(1 + m - 3*n) - b^3*d*(1 + m - 2*n))*(1 + m - n) + (a*b^3*e*(1 + m)*(1 + m - n) - 4*a^2*b*c*e*(1 + m^2 + m*(2 - n) - n - 3*n^2) - b^4*d*(1 + m^2 + m*(2 - 3*n) - 3*n + 2*n^2) + 6*a*b^2*c*d*(1 + m^2 + m*(2 - 4*n) - 4*n + 3*n^2) - 8*a^2*c^2*d*(1 + m^2 + m*(2 - 6*n) - 6*n + 8*n^2))/sqrt(b^2 - 4*a*c))*(f*x)^(1 + m)*HypergeometricFunctions._₂F₁(1, (1 + m)/n, (1 + m + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))))) - (1/(2*a^2*(b^2 - 4*a*c)^2*(b + sqrt(b^2 - 4*a*c))*f*(1 + m)*n^2))*(c*((a*b^2*e*(1 + m) + 2*a*b*c*d*(2 + 2*m - 7*n) - 4*a^2*c*e*(1 + m - 3*n) - b^3*d*(1 + m - 2*n))*(1 + m - n) - (a*b^3*e*(1 + m)*(1 + m - n) - 4*a^2*b*c*e*(1 + m^2 + m*(2 - n) - n - 3*n^2) - b^4*d*(1 + m^2 + m*(2 - 3*n) - 3*n + 2*n^2) + 6*a*b^2*c*d*(1 + m^2 + m*(2 - 4*n) - 4*n + 3*n^2) - 8*a^2*c^2*d*(1 + m^2 + m*(2 - 6*n) - 6*n + 8*n^2))/sqrt(b^2 - 4*a*c))*(f*x)^(1 + m)*HypergeometricFunctions._₂F₁(1, (1 + m)/n, (1 + m + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))))]

    @test_int [(c^(1/3) - 2*d^(1/3)*x^(1/3))/(c*d^(1/3)*x^(2/3) - c^(2/3)*d^(2/3)*x + c^(1/3)*d*x^(4/3)), x, 3, (-3*log(c^(2/3) - c^(1/3)*d^(1/3)*x^(1/3) + d^(2/3)*x^(2/3)))/(c^(1/3)*d^(2/3))]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^n)^q*(a+b*x^n+c*x^(2*n))^p*with*q*symbolic=#

    #= ::Subsubsection:: =#
    #=p>0=#

    #= ::Subsubsection::Closed:: =#
    #=p<0=#

    @test_int [(f*x)^m*(d + e*x^n)^q/(a + b*x^n + c*x^(2*n)), x, 5, (2*c*(f*x)^(1 + m)*(d + e*x^n)^q*AppellF1((1 + m)/n, 1, -q, (1 + m + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*(sqrt(b^2 - 4*a*c)*(b - sqrt(b^2 - 4*a*c))*f*(1 + m))) - (2*c*(f*x)^(1 + m)*(d + e*x^n)^q*AppellF1((1 + m)/n, 1, -q, (1 + m + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*(sqrt(b^2 - 4*a*c)*(b + sqrt(b^2 - 4*a*c))*f*(1 + m)))]

    @test_int [x^2*(d + e*x^n)^q/(a + b*x^n + c*x^(2*n)), x, 5, -((2*c*x^3*(d + e*x^n)^q*AppellF1(3/n, 1, -q, (3 + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*(3*(b^2 - 4*a*c - b*sqrt(b^2 - 4*a*c))))) - (2*c*x^3*(d + e*x^n)^q*AppellF1(3/n, 1, -q, (3 + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*(3*(b^2 - 4*a*c + b*sqrt(b^2 - 4*a*c))))]
    @test_int [x^1*(d + e*x^n)^q/(a + b*x^n + c*x^(2*n)), x, 5, -((c*x^2*(d + e*x^n)^q*AppellF1(2/n, 1, -q, (2 + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*(b^2 - 4*a*c - b*sqrt(b^2 - 4*a*c)))) - (c*x^2*(d + e*x^n)^q*AppellF1(2/n, 1, -q, (2 + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*(b^2 - 4*a*c + b*sqrt(b^2 - 4*a*c)))]
    @test_int [x^0*(d + e*x^n)^q/(a + b*x^n + c*x^(2*n)), x, 5, -((2*c*x*(d + e*x^n)^q*AppellF1(1/n, 1, -q, 1 + 1/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*(b^2 - 4*a*c - b*sqrt(b^2 - 4*a*c)))) - (2*c*x*(d + e*x^n)^q*AppellF1(1/n, 1, -q, 1 + 1/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*(b^2 - 4*a*c + b*sqrt(b^2 - 4*a*c)))]
    @test_int [(d + e*x^n)^q/(x^1*(a + b*x^n + c*x^(2*n))), x, 8, (c*(1 + b/sqrt(b^2 - 4*a*c))*(d + e*x^n)^(1 + q)*HypergeometricFunctions._₂F₁(1, 1 + q, 2 + q, (2*c*(d + e*x^n))/(2*c*d - (b - sqrt(b^2 - 4*a*c))*e)))/(a*(2*c*d - (b - sqrt(b^2 - 4*a*c))*e)*n*(1 + q)) + (c*(1 - b/sqrt(b^2 - 4*a*c))*(d + e*x^n)^(1 + q)*HypergeometricFunctions._₂F₁(1, 1 + q, 2 + q, (2*c*(d + e*x^n))/(2*c*d - (b + sqrt(b^2 - 4*a*c))*e)))/(a*(2*c*d - (b + sqrt(b^2 - 4*a*c))*e)*n*(1 + q)) - ((d + e*x^n)^(1 + q)*HypergeometricFunctions._₂F₁(1, 1 + q, 2 + q, 1 + (e*x^n)/d))/(a*d*n*(1 + q))]
    @test_int [(d + e*x^n)^q/(x^2*(a + b*x^n + c*x^(2*n))), x, 5, (2*c*(d + e*x^n)^q*AppellF1(-(1/n), 1, -q, -((1 - n)/n), -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c - b*sqrt(b^2 - 4*a*c))*x)) + (2*c*(d + e*x^n)^q*AppellF1(-(1/n), 1, -q, -((1 - n)/n), -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c + b*sqrt(b^2 - 4*a*c))*x))]
    @test_int [(d + e*x^n)^q/(x^3*(a + b*x^n + c*x^(2*n))), x, 5, (c*(d + e*x^n)^q*AppellF1(-(2/n), 1, -q, -((2 - n)/n), -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c - b*sqrt(b^2 - 4*a*c))*x^2)) + (c*(d + e*x^n)^q*AppellF1(-(2/n), 1, -q, -((2 - n)/n), -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c + b*sqrt(b^2 - 4*a*c))*x^2))]

    #= [x^m*(d + e*x^n)^q/(a + b*x^n + c*x^(2*n))^2, x, 0, -((4*c^2*x^(1 + m)*(1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))*(d + e*x^n)^q*AppellF1((1 + m)/n, 1, -q, (1 + m + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)^(3/2)*(1 + m)*(b - sqrt(b^2 - 4*a*c) + 2*c*x^n)))) + (4*c^2*x^(1 + m)*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))*(d + e*x^n)^q*AppellF1((1 + m)/n, 1, -q, (1 + m + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)^(3/2)*(1 + m)*(b + sqrt(b^2 - 4*a*c) + 2*c*x^n))) + (4*c^2*x^(1 + m)*(1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))^2*(d + e*x^n)^q*AppellF1((1 + m)/n, 2, -q, (1 + m + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)*(1 + m)*(b - sqrt(b^2 - 4*a*c) + 2*c*x^n)^2)) + (4*c^2*x^(1 + m)*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))^2*(d + e*x^n)^q*AppellF1((1 + m)/n, 2, -q, (1 + m + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)*(1 + m)*(b + sqrt(b^2 - 4*a*c) + 2*c*x^n)^2))]

    @test_int [x^2*(d + e*x^n)^q/(a + b*x^n + c*x^(2*n))^2, x, 0, 0]
    @test_int [x^1*(d + e*x^n)^q/(a + b*x^n + c*x^(2*n))^2, x, 0, -((2*c^2*x^2*(1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))*(d + e*x^n)^q*AppellF1(2/n, 1, -q, (2 + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)^(3/2)*(b - sqrt(b^2 - 4*a*c) + 2*c*x^n)))) + (2*c^2*x^2*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))*(d + e*x^n)^q*AppellF1(2/n, 1, -q, (2 + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)^(3/2)*(b + sqrt(b^2 - 4*a*c) + 2*c*x^n))) + (2*c^2*x^2*(1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))^2*(d + e*x^n)^q*AppellF1(2/n, 2, -q, (2 + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)*(b - sqrt(b^2 - 4*a*c) + 2*c*x^n)^2)) + (2*c^2*x^2*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))^2*(d + e*x^n)^q*AppellF1(2/n, 2, -q, (2 + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)*(b + sqrt(b^2 - 4*a*c) + 2*c*x^n)^2))]
    @test_int [x^0*(d + e*x^n)^q/(a + b*x^n + c*x^(2*n))^2, x, 0, -((4*c^2*x*(1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))*(d + e*x^n)^q*AppellF1(1/n, 1, -q, (1 + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)^(3/2)*(b - sqrt(b^2 - 4*a*c) + 2*c*x^n)))) + (4*c^2*x*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))*(d + e*x^n)^q*AppellF1(1/n, 1, -q, (1 + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)^(3/2)*(b + sqrt(b^2 - 4*a*c) + 2*c*x^n))) + (4*c^2*x*(1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))^2*(d + e*x^n)^q*AppellF1(1/n, 2, -q, (1 + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)*(b - sqrt(b^2 - 4*a*c) + 2*c*x^n)^2)) + (4*c^2*x*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))^2*(d + e*x^n)^q*AppellF1(1/n, 2, -q, (1 + n)/n, -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c))), -((e*x^n)/d)))/((1 + (e*x^n)/d)^q*((b^2 - 4*a*c)*(b + sqrt(b^2 - 4*a*c) + 2*c*x^n)^2))]
    @test_int [(d + e*x^n)^q/(x^1*(a + b*x^n + c*x^(2*n))^2), x, 0, ((d + e*x)^(1 + q)*(b^2*c*d - 2*a*c^2*d - b^3*e + 3*a*b*c*e + c*(b*c*d - b^2*e + 2*a*c*e)*x))/(a*(b^2 - 4*a*c)*(c*d^2 - b*d*e + a*e^2)*(a + b*x + c*x^2)) - (c*(1 + b/sqrt(b^2 - 4*a*c))*(d + e*x)^(1 + q)*HypergeometricFunctions._₂F₁(1, 1, 1 - q, -((2*c*d - (b - sqrt(b^2 - 4*a*c))*e)/(e*(b - sqrt(b^2 - 4*a*c) + 2*c*x)))))/(a^2*e*q*(b - sqrt(b^2 - 4*a*c) + 2*c*x)) - (c*(e*(b*c*d - b^2*e + 2*a*c*e)*q - (2*b*c*(c*d^2 + a*e^2*(1 - 2*q)) + 4*a*c^2*d*e*q + b^3*e^2*q - b^2*c*d*e*(2 + q))/sqrt(b^2 - 4*a*c))*(d + e*x)^(1 + q)*HypergeometricFunctions._₂F₁(1, 1, 1 - q, -((2*c*d - (b - sqrt(b^2 - 4*a*c))*e)/(e*(b - sqrt(b^2 - 4*a*c) + 2*c*x)))))/(a*(b^2 - 4*a*c)*e*(c*d^2 - b*d*e + a*e^2)*q*(b - sqrt(b^2 - 4*a*c) + 2*c*x)) - (c*(1 - b/sqrt(b^2 - 4*a*c))*(d + e*x)^(1 + q)*HypergeometricFunctions._₂F₁(1, 1, 1 - q, -((2*c*d - (b + sqrt(b^2 - 4*a*c))*e)/(e*(b + sqrt(b^2 - 4*a*c) + 2*c*x)))))/(a^2*e*q*(b + sqrt(b^2 - 4*a*c) + 2*c*x)) - (c*(e*(b*c*d - b^2*e + 2*a*c*e)*q + (2*b*c*(c*d^2 + a*e^2*(1 - 2*q)) + 4*a*c^2*d*e*q + b^3*e^2*q - b^2*c*d*e*(2 + q))/sqrt(b^2 - 4*a*c))*(d + e*x)^(1 + q)*HypergeometricFunctions._₂F₁(1, 1, 1 - q, -((2*c*d - (b + sqrt(b^2 - 4*a*c))*e)/(e*(b + sqrt(b^2 - 4*a*c) + 2*c*x)))))/(a*(b^2 - 4*a*c)*e*(c*d^2 - b*d*e + a*e^2)*q*(b + sqrt(b^2 - 4*a*c) + 2*c*x)) - ((d + e*x)^(1 + q)*HypergeometricFunctions._₂F₁(1, 1 + q, 2 + q, (d + e*x)/d))/(a^2*d*(1 + q))]
    @test_int [(d + e*x^n)^q/(x^2*(a + b*x^n + c*x^(2*n))^2), x, 0, 0]
    @test_int [(d + e*x^n)^q/(x^3*(a + b*x^n + c*x^(2*n))^2), x, 0, 0] =#

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(f*x)^m*(d+e*x^n)^q*(a+b*x^n+c*x^(2*n))^p*with*p*symbolic=#

    @test_int [(f*x)^m*(d + e*x^n)^2*(a + b*x^n + c*x^(2*n))^p, x, 10, (d^2*(f*x)^(1 + m)*(a + b*x^n + c*x^(2*n))^p*AppellF1((1 + m)/n, -p, -p, (1 + m + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))))/((1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))^p*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))^p*(f*(1 + m))) + (2*d*e*x^(1 + n)*(f*x)^m*(a + b*x^n + c*x^(2*n))^p*AppellF1((1 + m + n)/n, -p, -p, (1 + m + 2*n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))))/((1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))^p*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))^p*(1 + m + n)) + (e^2*x^(1 + 2*n)*(f*x)^m*(a + b*x^n + c*x^(2*n))^p*AppellF1((1 + m + 2*n)/n, -p, -p, (1 + m + 3*n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))))/((1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))^p*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))^p*(1 + m + 2*n))]
    @test_int [(f*x)^m*(d + e*x^n)^1*(a + b*x^n + c*x^(2*n))^p, x, 7, (d*(f*x)^(1 + m)*(a + b*x^n + c*x^(2*n))^p*AppellF1((1 + m)/n, -p, -p, (1 + m + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))))/((1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))^p*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))^p*(f*(1 + m))) + (e*x^(1 + n)*(f*x)^m*(a + b*x^n + c*x^(2*n))^p*AppellF1((1 + m + n)/n, -p, -p, (1 + m + 2*n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))))/((1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))^p*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))^p*(1 + m + n))]
    @test_int [(f*x)^m*(d + e*x^n)^0*(a + b*x^n + c*x^(2*n))^p, x, 2, ((f*x)^(1 + m)*(a + b*x^n + c*x^(2*n))^p*AppellF1((1 + m)/n, -p, -p, (1 + m + n)/n, -((2*c*x^n)/(b - sqrt(b^2 - 4*a*c))), -((2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))))/((1 + (2*c*x^n)/(b - sqrt(b^2 - 4*a*c)))^p*(1 + (2*c*x^n)/(b + sqrt(b^2 - 4*a*c)))^p*(f*(1 + m)))]
    @test_int [(f*x)^m/(d + e*x^n)^1*(a + b*x^n + c*x^(2*n))^p, x, 0, Unintegrable(((f*x)^m*(a + b*x^n + c*x^(2*n))^p)/(d + e*x^n), x)]
    @test_int [(f*x)^m/(d + e*x^n)^2*(a + b*x^n + c*x^(2*n))^p, x, 0, Unintegrable(((f*x)^m*(a + b*x^n + c*x^(2*n))^p)/(d + e*x^n)^2, x)]
    end

max_stars_repo_path: test/1 Algebraic functions/1.2 Trinomial products/1.2.3 General/1.2.3.4 (f x)^m (d+e x^n)^q (a+b x^n+c x^(2 n))^p.jl


text:
using Distributions

function poisson_dgp(N, mean_traps)
    α = rand(Normal(log(4), .1))
    β = rand(Normal(-0.25, .1))
    traps = rand(Poisson(mean_traps), N)
    complaints = similar(traps)
    for i in eachindex(traps)
        complaints[i] = rand(Poisson(exp(α + β * traps[i])))
    end

    return (α = α, β = β, traps = traps, complaints = complaints)
end

ext: jl


text:
old_pwd = pwd()
cd(dirname(@__FILE__))

@test Atom.realpath′("./utils.jl") == realpath(@__FILE__)
@test Atom.realpath′(".././dontexist") == ".././dontexist"

@test Atom.isuntitled(".\\untitled-asdj2123:12") == true
@test Atom.isuntitled(".\\untitled-asdj2cx3213") == true
@test Atom.isuntitled("./untitled-asdj2124o3:12") == true
@test Atom.isuntitled("./untitled-a1j2124o3:12") == true
@test Atom.isuntitled("untitled-1651asdsd23") == true
@test Atom.isuntitled("untitled1651asdsd23") == false
@test Atom.isuntitled("untitled-1651asdsd23:as") == false
@test Atom.isuntitled("./utils.jl") == false
@test Atom.isuntitled("../test/utils.jl") == false

@test Atom.pkgpath(@__FILE__) == "utils.jl"
@test Atom.pkgpath("foo/pkgname/src/foobar.jl") == "pkgname/src/foobar.jl"
@test Atom.pkgpath("foo\\pkgname ü\\src\\foobar.jl") == "pkgname ü\\src\\foobar.jl"

@test Atom.fullpath("untitled-asdj2cx3213") == "untitled-asdj2cx3213"
@test Atom.fullpath("/test/foobar.jl") == "/test/foobar.jl"
@test joinpath(split(Atom.fullpath("foobar.jl"), Base.Filesystem.pathsep())[end-1:end]...)  == joinpath("base", "foobar.jl")

@test Atom.appendline("test.jl", -1) == "test.jl"
@test Atom.appendline("test.jl", 0) == "test.jl"
@test Atom.appendline("test.jl", 10) == "test.jl:10"

#TODO: baselink, edit

cd(old_pwd)


text:
using Documenter, SchumakerSpline

makedocs(
    format = Documenter.HTML(),
    sitename = "SchumakerSpline",
    modules = [SchumakerSpline],
    pages = Any[
        "Introduction" => "index.md",
        "Examples" => "examples.md",
        "API" => "api.md"]
)

deploydocs(
    repo   = "github.com/s-baumann/SchumakerSpline.jl.git",
    target = "build",
    deps   = nothing,
    make   = nothing
)


text:
export SOSPoly, fsubs, jacobian

abstract type AbstractSOSPoly <: Function end

struct SOSPoly{N,M,D,LT,X,MON,JMON} <: AbstractSOSPoly where {N<:Integer,D<:Integer,LT<:Union{AbstractMatrix,Function}}
    vars::X
    mon::MON
    dmon::JMON
    initial_params::LT
end
function SOSPoly(n::Int,d::UnitRange{Int};initL=Flux.glorot_uniform)
    @polyvar x[1:n]
    m = monomials(x,d)
    dm = differentiate(m,x)
    M = length(m)
    L() = vec(initL(M,M))
    SOSPoly{n,M,last(d),typeof(L),typeof(x),typeof(m),typeof(dm)}(x,m,dm,L)
end
SOSPoly(n::Int,d::Int;initL=Flux.glorot_uniform) = SOSPoly(n,0:d;initL=initL)

fsubs(S::SOSPoly,v,x) = map(m->m(S.vars=>x), v)

function (S::SOSPoly{N,M})(x, p) where {N,M}
    xbar = fsubs(S, S.mon, x)
    L = LowerTriangular(reshape(p,M,M))
    v = L' * xbar
    dot(v,v)
end

function jacobian(S::SOSPoly{N,M}, x, p) where {N,M}
    ∂x = fsubs(S, S.dmon, x)
    xbar = fsubs(S, S.mon, x)
    L = LowerTriangular(reshape(p,M,M))
    (2 * ∂x' * (L*L') * xbar)'
end

DiffEqFlux.initial_params(S::SOSPoly) = S.initial_params()
DiffEqFlux.paramlength(::SOSPoly{N,M}) where {N,M} = M*M

const SOSPolyLayers = Tuple{<:Function,S} where {S<:SOSPoly}
function jacobian(m::FastChain{T}, x, p) where {T<:SOSPolyLayers}
    xbar = first(m.layers)(x, p)
    jacobian(last(m.layers), xbar, p) * jacobian(first(m.layers), x)
end


text:
"""
    ContinuousPost

Abstract supertype of all continuous post operators.
"""
abstract type ContinuousPost <: PostOperator end


text:
infopath(resultdir) = joinpath(resultdir, "info.json")
resultpath(resultdir, i::Integer) = joinpath(resultdir, "result-$i.json")

function loadresults(resultdir, n::Integer)
    results = Vector{Union{BenchmarkGroup,Nothing}}(undef, n)
    fill!(results, nothing)
    for i in 1:n
        path = resultpath(resultdir, i)
        isfile(path) || continue
        data = BenchmarkTools.load(path)
        @assert length(data) == 1
        results[i], = data
    end
    return results
end

"""
    BenchmarkConfigSweeps.load(resultdir) -> sweepresult

Load `sweepresult` from `resultdir`.

`sweepresult` object satisfies the row table interface.
`Tables.rows(sweepresult)` is an alias of
`BenchmarkConfigSweeps.flattable(sweepresult)`. For example,
`DataFrame(sweepresult)` can be used to obtain the sweeps as a flat table.

Note that `BenchmarkConfigSweeps.flattable` aggressively flatten/splat
environment variables and tries to interpret benchmark group keys.  For
programatic processing, use [`BenchmarkConfigSweeps.simpletable`](@ref) which
produces a predictable output.
"""
function BenchmarkConfigSweeps.load(resultdir)
    info = loadinfo(infopath(resultdir))
    results = loadresults(resultdir, length(info.configs))
    return SweepResult(resultdir, info, results)
end

struct SweepResult
    resultdir::String
    info::Info
    results::Vector{Union{BenchmarkGroup,Nothing}}
end

function Base.show(io::IO, result::SweepResult)
    print(io, BenchmarkConfigSweeps, ".load(")
    show(io, result.resultdir)
    print(io, ')')
end

function _simpletable(result::SweepResult)
    results = result.results
    configs = result.info.configs::Vector{Config}
    return (
        julia = Union{Missing,Vector{String}}[
            cfg.julia === nothing ? missing : cfg.julia.cmd for cfg in configs
        ],
        nthreads = Union{Missing,Int}[
            cfg.nthreads === nothing ? missing : cfg.nthreads.value for cfg in configs
        ],
        env = Union{Missing,Dict{String,Any}}[
            cfg.env === nothing ? missing : cfg.env.dict for cfg in configs
        ],
        env_inherit = Union{Missing,Bool}[
            cfg.env === nothing ? missing : cfg.env.inherit for cfg in configs
        ],
        result = Union{Missing,BenchmarkGroup}[
            g === nothing ? missing : g for g in results
        ],
    )
end

function try_parse_kv(str)
    i = findfirst('=', str)
    i === nothing && return nothing
    k = Symbol(strip(SubString(str, 1:i-1)))

    j = findfirst(!isspace, SubString(str, i+1:lastindex(str)))
    j === nothing && return nothing
    vstr = SubString(str, i+j:lastindex(str))

    v = tryparse(Int64, vstr)
    if v !== nothing
        return k => v
    end

    v = tryparse(Float64, vstr)
    if v !== nothing
        return k => v
    end

    if startswith(vstr, ':') && lastindex(vstr) > 1
        return k => Symbol(SubString(vstr, firstindex(vstr)+1:lastindex(vstr)))
    end

    return k => vstr
end

dont_parsekeys(ks) = (; trialkeys = ks)

function dwim_parsekeys(strings)
    vals = Pair{Symbol,Any}[]
    for (i, str) in enumerate(strings)
        kv = try_parse_kv(str)
        if kv === nothing
            push!(vals, Symbol(:level_, i) => str)
        else
            push!(vals, kv)
        end
    end
    return vals
end

"""
    BenchmarkConfigSweeps.flattable(sweepresult) -> table
    BenchmarkConfigSweeps.flattable(group::BenchmarkGroup) -> table

Convert a `sweepresult` returned from `BenchmarkConfigSweeps.load(resultdir)` as
a flat table where the benchmark parameters are splatted into a flat row.
Benchmark labels are expected to be the form `"key=value"`.

As a utility, a single `group::BenchmarkGroup` (which may not be obtained
through BenchmarkConfigSweeps) can also be passed to this function.
"""
BenchmarkConfigSweeps.flattable

# TODO: type-stabilize by using "concrete" dynamic dispatch
function BenchmarkConfigSweeps.flattable(result::SweepResult; parsekeys = dwim_parsekeys)
    parsekeys = something(parsekeys, dont_parsekeys)

    simple = _simpletable(result)
    cols = Pair{Symbol,Vector}[]
    if !all(ismissing, simple.julia)
        push!(cols, :julia => simple.julia)
    end
    if !all(ismissing, simple.nthreads)
        push!(cols, :nthreads => simple.nthreads)
    end

    envkeys = mapfoldl(union!, simple.env; init = Set{String}()) do env
        env === missing ? () : keys(env)
    end
    if !isempty(envkeys)
        for k in sort!(collect(envkeys))
            vs = map(simple.env) do env
                env === missing && return missing
                get(env, k, missing)
            end
            push!(cols, Symbol(k) => vs)
        end
    end

    configrows = Tables.rows(Tables.CopiedColumns((; cols...)))
    # TODO: check duplicates

    rows = let parsekeys = parsekeys
        Iterators.map(zip(simple.result, configrows)) do (result, config)
            result === missing && return ()
            Iterators.map(BenchmarkTools.leaves(result)) do (ks, trial)
                (; NamedTuple(config)..., parsekeys(ks)..., trial = trial)
            end
        end |>
        Iterators.flatten |>
        collect
    end

    return rows
end

function BenchmarkConfigSweeps.flattable(result::BenchmarkGroup; parsekeys = dwim_parsekeys)
    parsekeys = something(parsekeys, dont_parsekeys)

    rows = let parsekeys = parsekeys
        map(BenchmarkTools.leaves(result)) do (ks, trial)
            (; parsekeys(ks)..., trial = trial)
        end
    end

    return rows
end

BenchmarkConfigSweeps.simpletable(result::SweepResult) =
    Tables.CopiedColumns(_simpletable(result))

Tables.istable(::Type{SweepResult}) = true
Tables.rowaccess(::Type{SweepResult}) = true
Tables.rows(result::SweepResult) = BenchmarkConfigSweeps.flattable(result)


text:
#=
This file is auto-generated. Do not edit.
=#
"""
    mutable struct Pump <: Link
        name::String
        arc::Arc
        available::Bool
        pumpparams::PumpParams
        flowlimits::NamedTuple{(:min, :max), Tuple{Float64, Float64}}
        operating::Union{Nothing,Bool}
        flow::Union{Nothing,Float64}
        headgain::Union{Nothing,Float64}
        internal::InfrastructureSystemsInternal
    end

Pump, nominally centrifugal and single-speed.

# Arguments
- `name::String`
- `arc::Arc`
- `available::Bool`
- `pumpparams::PumpParams`: Pump parameters object, including pump curves
- `flowlimits::NamedTuple{(:min, :max), Tuple{Float64, Float64}}`
- `operating::Union{Nothing,Bool}`
- `flow::Union{Nothing,Float64}`
- `headgain::Union{Nothing,Float64}`: Not sure about decoupled headgain when pump is off.
- `internal::InfrastructureSystemsInternal`: internal reference, do not modify
"""
mutable struct Pump <: Link
    name::String
    arc::Arc
    available::Bool
    "Pump parameters object, including pump curves"
    pumpparams::PumpParams
    flowlimits::NamedTuple{(:min, :max), Tuple{Float64, Float64}}
    operating::Union{Nothing,Bool}
    flow::Union{Nothing,Float64}
    "Not sure about decoupled headgain when pump is off."
    headgain::Union{Nothing,Float64}
    "internal reference, do not modify"
    internal::InfrastructureSystemsInternal
end

function Pump(name, arc, available, pumpparams, flowlimits, operating, flow, headgain, )
    Pump(name, arc, available, pumpparams, flowlimits, operating, flow, headgain, InfrastructureSystemsInternal(), )
end

function Pump(; name, arc, available, pumpparams, flowlimits, operating, flow, headgain, )
    Pump(name, arc, available, pumpparams, flowlimits, operating, flow, headgain, )
end

# Constructor for demo purposes; non-functional.
function Pump(::Nothing)
    Pump(;
        name="init",
        arc=Arc(nothing),
        available=true,
        pumpparams=PumpParams(nothing),
        flowlimits=(min=0.0, max=10.0),
        operating=nothing,
        flow=nothing,
        headgain=nothing,
    )
end

"""Get Pump name."""
get_name(value::Pump) = value.name
"""Get Pump arc."""
get_arc(value::Pump) = value.arc
"""Get Pump available."""
get_available(value::Pump) = value.available
"""Get Pump pumpparams."""
get_pumpparams(value::Pump) = value.pumpparams
"""Get Pump flowlimits."""
get_flowlimits(value::Pump) = value.flowlimits
"""Get Pump operating."""
get_operating(value::Pump) = value.operating
"""Get Pump flow."""
get_flow(value::Pump) = value.flow
"""Get Pump headgain."""
get_headgain(value::Pump) = value.headgain
"""Get Pump internal."""
get_internal(value::Pump) = value.internal


text:
"""
    Disjunction{N, VT<:AbstractVector{<:Tuple{<:Predicate, <:AbstractVector{Int}}}} <: Predicate{N}

A disjunction of predicates of arity `N`.

### Fields

- `disjuncts` -- vector of disjuncts
"""
struct Disjunction{N, VT<:AbstractVector{<:Tuple{<:Predicate, <:AbstractVector{Int}}}} <: Predicate{N}
    disjuncts::VT

    function Disjunction(disjuncts::VT; N::Int=maximum([length(v) for (p, v) in disjuncts])
                        ) where {VT<:AbstractVector{<:Tuple{<:Predicate, <:AbstractVector{Int}}}}
        return new{Val{N}, VT}(disjuncts)
    end
end

# constructor for unary disjunction with only unary disjuncts
function Disjunction(disjuncts::AbstractVector{<:Predicate{Val{1}}})
    return Disjunction([(d, [1]) for d in disjuncts])
end

function Base.:(==)(d1::Disjunction, d2::Disjunction)
    return d1.disjuncts == d2.disjuncts
end

# function-like evaluation
@inline function (d::Disjunction)(args...)
    evaluate(d, args...)
end

function evaluate(d::Disjunction, args...)
    assert_same_length(d, args...)
    @inbounds for (conjunct, n_args) in d.disjuncts
        if evaluate(conjunct, args[n_args]...)
            return true
        end
    end
    return false
end


text:
#=
<render> application of the resynthesizer algorithm.

Takes one image and a mask.
Masked region of image is the corpus.

Returns new image of the same size
synthesized in its entirety from the corpus.

FUTURE render target of separately given dimensions
=#

include("../resynthesizer.jl")

function render(
    corpusImage::AbstractArray{T,N},
    corpusSelectionMask::AbstractArray{Bool,N}
    ) where {N,T}

    corpusMaskedImage = MaskedImage(corpusImage, corpusSelectionMask)

    # Output target is same size as corpus.
    newImage = copy(corpusImage)

    #=
    Mask same size as targetImage, all true.
    =#
    newMask = trues(size(newImage))

    targetMaskedImage = MaskedImage(newImage, newMask)

    resynthesize(targetMaskedImage, corpusMaskedImage)
end

max_stars_repo_name: bootchk/resynthesizerJulia

max_issues_repo_name: bootchk/resynthesizerJulia

max_forks_repo_name: bootchk/resynthesizerJulia


text:
@coeff function K_CD(reactor::Reactor)
  eta_CD * P_F / ( K_n * K_I * Q )
end


text:
# Autogenerated wrapper script for NodeJS_16_jll for i686-w64-mingw32
export node, npm, npx

JLLWrappers.@generate_wrapper_header("NodeJS_16")
JLLWrappers.@declare_executable_product(node)
JLLWrappers.@declare_file_product(npm)
JLLWrappers.@declare_file_product(npx)
function __init__()
    JLLWrappers.@generate_init_header()
    JLLWrappers.@init_executable_product(
        node,
        "bin\\node.exe",
    )

    JLLWrappers.@init_file_product(
        npm,
        "bin\\npm",
    )

    JLLWrappers.@init_file_product(
        npx,
        "bin\\npx",
    )

    JLLWrappers.@generate_init_footer()
end  # __init__()


text:
export Uniform, Log_uniform, rand_vec, rand_vecU, ParameterRandom

@with_kw struct ParameterRandom <: ParameterGenerator
    methods # Array of sampling generator. method should be callable
    len  # Total number of simulation
end

"""
Set all the variables with same method with defined ranges
"""
function ParameterRandom(param_ranges, method::RandomSampler, len)

    methods = map(x-> method(x), param_ranges)

    return ParameterRandom(methods=methods, len=len)
end

"""
Parameter Random sampling with `range`.
"""
function ParameterRandom(param_ranges::AbstractArray{T,1};method=Uniform()::RandomSampler, len=nothing) where T<:AbstractRange

    param_ranges_ = Array{Tuple{Number,Number},1}(undef,length(param_ranges)) # [(start,end),...]

    len_ = 1

    for (i, ran) in enumerate(param_ranges)
        par_rang = (ran[1], ran[end])
        len_ = len_ * length(ran)
        param_ranges_[i] = par_rang
    end

    len_ = isnothing(len) ? len_ : len # if user-defined len_

    return ParameterRandom(param_ranges_, method, len_)
end

"""
Reset one specified method
"""
function (par::ParameterRandom)(index::Integer, new_method::RandomSampler)
    methods = deepcopy(par.methods)
    methods[index] = new_method
    return ParamRandom(methods, par.len)
end

"""Length of random sampler"""
Base.length(self::ParameterRandom) = self.len

Base.size(self::ParameterRandom) = (self.len,)

## Iterator
"""Get the parameters that would be `ind` th in iteration

The total sample number is # to do

Paremeters
----------
- `ind` {int}: The iteration index

Returns
-------
- `params`: list of numbers in the range of `ParameterGrid.param_ranges`
"""
function Base.getindex(self::ParameterRandom, ind::Int)

    params = map(v-> v() ,self.methods )

    return params
end

## Uniform
"""RandomSampler for uniform distribution"""
@with_kw struct Uniform <: RandomSampler
    a=0.::Number #lower bound
    b=1.::Number # higher bound
    type= Float64
    function Uniform(a,b, type)
        if a>b
            @warn "b(=$b) should greater than a(=$a). Change to Uniform(a=$b,b=$a)"
            new(b,a, type)
        else
            new(a,b, type)
        end
    end
end

"""
    Uniform(a,b;type=Float64)
Create uniform sampler.
"""
function Uniform(a, b;type=Float64)
    return Uniform(a=a,b=b, type=type)
end

"""
    (par::Uniform)()

generate random variables.

See also
--------
`Random.rand`
"""
function (par::Uniform)() :: Number
    @unpack a, b, type = par
    num = rand() * (b - a) + a

    if type <: Integer
        samp = round(num) # convert to integer
    else
        samp =  num
    end

    return samp
end

function (par::Uniform)(len::Integer) :: Array
    @unpack a, b, type = par
    vec = rand(len)
    return vec .* (b - a) .+ a
end

"""Reset parameter range but fixed the rest."""
function (par::Uniform)(param_range)

    return Uniform(param_range[1], param_range[2], par.type)
end

## Log uniform
"""RandomSampler for log uniform distribution. a,b ∈ (0,∞)"""
@with_kw struct Log_uniform <: RandomSampler
    a = 1e-6:: Number # can not be zero
    b = 1. :: Number
    base = 10. :: Number
    type = Float64
    function Log_uniform(a,b, base, type)
        @assert base > 0.
        @assert (a>0.) & (b > 0.)
        if a>b
            @warn "b(=$b) should greater than a(=$a). Change to Log_uniform(a=$b,b=$a)"
            new(b,a,base, type)
        else
            new(a,b,base, type)
        end
    end
end

function Log_uniform(a,b;base=10., type=Float64)
    return Log_uniform(a=a, b=b, base=base, type=type)
end

function (par::Log_uniform)() :: Number
    @unpack a, b, base, type = par
    a_pow, b_pow = log.(base, [a, b])
    _pow = Uniform(a_pow, b_pow, type)()

    num = base^_pow

    if type <: Integer
        samp = round(num) # convert to integer
    else
        samp =  num
    end

    return samp

end

"""Generate a vector with same range."""
function (par::Log_uniform)(len::Integer) :: Array
    samp = Log_uniform(a=par.a, b=par.b, base=par.base, type=par.type)
    return [samp() for i in 1:1:len]
end

"""Renew the range and keep the rest."""
function (par::Log_uniform)(param_range)
    return Log_uniform(param_range[1], param_range[2], par.base, par.type)
end

## Sampling from de meta
"""generate random vector with uniform distribution `rand()`"""
function rand_vec(len::Integer, method::RandomSampler) :: Array{Float64,1}
    return method(len)
end

"""Sampling a vector with a list of sampler

REPL
----
```julia
unis = [Uniform(1,2) for i in 1:10]
vec = rand_vec(unis)
```
"""
function rand_vec(samplers::AbstractArray{T,1}) :: Array{Float64,1} where T<:RandomSampler
    return [samp() for samp in samplers]
end

"""General method for sampling a vector with individual samplers"""
function rand_vec(samplers)
    return [samp() for samp in samplers]
end

"""Uniform sampling of vector"""
rand_vecU(len::Integer, domain::Domain) = Uniform(domain.low, domain.high)(len)

rand_vecU(demeta::DEmeta, domain::Domain) = rand_vecU(length(demeta.u0), domain)

function rand_vecU(domains::Array{Domain, 1})
    vec = zeros(length(domains))
    for i in eachindex(domains)
        vec[i] = Uniform(domains[i].low, domains[i].high)()
    end
    return vec
end

"""General method. domains can be list of tuples"""
function rand_vecU(domains)
    vec = zeros(length(domains))
    for i in eachindex(domains)
        vec[i] = Uniform(domains[i]...)()
    end
    return vec
end

## Grid search


text:
using DFTK
using AtomsBase
using Unitful
using UnitfulAtomic

# Construct system in the AtomsBase world
a = 10.26u"bohr"  # Silicon lattice constant
lattice = a / 2 * [[0, 1, 1.],  # Lattice as vector of vectors
                   [1, 0, 1.],
                   [1, 1, 0.]]
atoms  = [:Si => ones(3)/8, :Si => -ones(3)/8]
system = periodic_system(atoms, lattice; fractional=true)

# Use it inside DFTK:
# Attach pseudopotentials, construct appropriate model,
# discretise and solve.
system = attach_psp(system; family="hgh", functional="lda")

model  = model_LDA(system; temperature=1e-3)
basis  = PlaneWaveBasis(model; Ecut=15, kgrid=[4, 4, 4])
scfres = self_consistent_field(basis, tol=1e-8)

# Get the DFTK model back into the AtomsBase world:
newsystem = atomic_system(model)
@show atomic_number(newsystem)


text:
module nav_msgs

using Cxx

cxx"""
#include <nav_msgs/Odometry.h>
"""

end #module

export nav_msgs

max_stars_repo_name: moyhig/CxxROS

max_issues_repo_name: moyhig/CxxROS

max_forks_repo_name: moyhig/CxxROS