text:
@testset "constraints" begin
    include("algorithms/matching.jl")
    include("absolute.jl")
    include("datasstructures/disjointSet.jl")
    include("datasstructures/rsparsebitset.jl")
    include("disjunctive.jl")
    include("alldifferent.jl")
    include("compacttable.jl")
    include("equal.jl")
    include("notequal.jl")
    include("lessorequal.jl")
    include("greaterorequal.jl")
    include("sumtozero.jl")
    include("sumlessthan.jl")
    include("sumgreaterthan.jl")
    include("islessorequal.jl")
    include("inset.jl")
    include("reifiedinset.jl")
    include("binaryor.jl")
    include("isbinaryor.jl")
    include("setdiffsingleton.jl")
    include("element2d.jl")
    include("element1d.jl")
    include("binarymaximum.jl")
    include("setequalconstant.jl")

    @testset "addOnDomainChange!()" begin
        trailer = SeaPearl.Trailer()
        x = SeaPearl.IntVar(2, 6, "x", trailer)
        ax = SeaPearl.IntVarViewMul(x, 3, "ax")

        y = SeaPearl.IntVar(8, 9, "y", trailer)
        b = SeaPearl.BoolVar("b", trailer)

        constraint = SeaPearl.EqualConstant(ax, 6, trailer)
        reified_constraint = SeaPearl.isLessOrEqual(b, x, y, trailer)

        SeaPearl.addOnDomainChange!(ax, constraint)

        @test constraint in x.onDomainChange

        SeaPearl.addOnDomainChange!(b, reified_constraint)

        @test reified_constraint in b.onDomainChange

        s = SeaPearl.IntSetVar(2, 6, "x", trailer)
        set_constraint = SeaPearl.InSet(ax, s, trailer)
        SeaPearl.addOnDomainChange!(s, constraint)
        SeaPearl.addOnDomainChange!(ax, constraint)

        @test set_constraint in s.onDomainChange
        @test set_constraint in x.onDomainChange
    end

    @testset "addToPropagate!()" begin
        trailer = SeaPearl.Trailer()
        x = SeaPearl.IntVar(2, 6, "x", trailer)
        ax = SeaPearl.IntVarViewMul(x, 3, "ax")

        constraint = SeaPearl.EqualConstant(ax, 6, trailer)

        toPropagate = Set{SeaPearl.Constraint}()
        constraints = Array{SeaPearl.Constraint}([constraint])

        SeaPearl.addToPropagate!(toPropagate, constraints)

        @test constraint in toPropagate

        toPropagate = Set{SeaPearl.Constraint}()
        SeaPearl.setValue!(constraint.active, false)
        @test !(constraint in toPropagate)

        s = SeaPearl.IntSetVar(2, 6, "x", trailer)
        set_constraint = SeaPearl.InSet(ax, s, trailer)
        constraints = Array{SeaPearl.Constraint}([set_constraint])
        SeaPearl.addToPropagate!(toPropagate, constraints)

        @test set_constraint in toPropagate
    end

    @testset "triggerDomainChange!()" begin
        trailer = SeaPearl.Trailer()
        x = SeaPearl.IntVar(2, 6, "x", trailer)
        ax = SeaPearl.IntVarViewMul(x, 3, "ax")

        y = SeaPearl.IntVar(8, 9, "y", trailer)
        b = SeaPearl.BoolVar("b", trailer)

        constraint = SeaPearl.EqualConstant(ax, 6, trailer)
        reified_constraint = SeaPearl.isLessOrEqual(b, x, y, trailer)

        toPropagate = Set{SeaPearl.Constraint}()

        SeaPearl.triggerDomainChange!(toPropagate, ax)

        @test constraint in toPropagate

        SeaPearl.triggerDomainChange!(toPropagate, b)
        @test reified_constraint in toPropagate

        s = SeaPearl.IntSetVar(2, 6, "x", trailer)
        set_constraint = SeaPearl.InSet(ax, s, trailer)
        SeaPearl.triggerDomainChange!(toPropagate, s)

        @test set_constraint in toPropagate
    end
end


text:
@testset "3.5 Logarithm functions" begin
    (A, B, F, a, b, c, d, e, f, g, m, n, p, q, x, ) = @variables A B F a b c d e f g m n p q x

    #= ::Package:: =#

    #= ::Title:: =#
    #=Integration*Problems*Involving*Logarithms=#

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

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*log(c*x^n)^(q-1)*(a*x^m+b*log(c*x^n)^q)^p / x=#

    @test_int [log(c*x^n)^(q - 1)*(a*x^m + b*log(c*x^n)^q)^p/x, x, 1, -((a*m*CannotIntegrate(x^(-1 + m)*(a*x^m + b*log(c*x^n)^q)^p, x))/(b*n*q)) + (a*x^m + b*log(c*x^n)^q)^(1 + p)/(b*n*(1 + p)*q)]

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

    @test_int [log(c*x^n)*(a*x^m + b*log(c*x^n)^2)^3/x, x, 13, -((360*a*b^2*n^5*x^m)/m^6) - (9*a^2*b*n^3*x^(2*m))/(8*m^4) - (a^3*n*x^(3*m))/(9*m^2) + (360*a*b^2*n^4*x^m*log(c*x^n))/m^5 + (9*a^2*b*n^2*x^(2*m)*log(c*x^n))/(4*m^3) + (a^3*x^(3*m)*log(c*x^n))/(3*m) - (180*a*b^2*n^3*x^m*log(c*x^n)^2)/m^4 - (9*a^2*b*n*x^(2*m)*log(c*x^n)^2)/(4*m^2) + (60*a*b^2*n^2*x^m*log(c*x^n)^3)/m^3 + (3*a^2*b*x^(2*m)*log(c*x^n)^3)/(2*m) - (15*a*b^2*n*x^m*log(c*x^n)^4)/m^2 + (3*a*b^2*x^m*log(c*x^n)^5)/m + (b^3*log(c*x^n)^8)/(8*n)]
    @test_int [log(c*x^n)*(a*x^m + b*log(c*x^n)^2)^2/x, x, 8, -((12*a*b*n^3*x^m)/m^4) - (a^2*n*x^(2*m))/(4*m^2) + (12*a*b*n^2*x^m*log(c*x^n))/m^3 + (a^2*x^(2*m)*log(c*x^n))/(2*m) - (6*a*b*n*x^m*log(c*x^n)^2)/m^2 + (2*a*b*x^m*log(c*x^n)^3)/m + (b^2*log(c*x^n)^6)/(6*n)]
    @test_int [log(c*x^n)*(a*x^m + b*log(c*x^n)^2)^1/x, x, 5, -((a*n*x^m)/m^2) + (a*x^m*log(c*x^n))/m + (b*log(c*x^n)^4)/(4*n)]
    @test_int [log(c*x^n)*(a*x^m + b*log(c*x^n)^2)^0/x, x, 1, log(c*x^n)^2/(2*n)]
    @test_int [log(c*x^n)/(x*(a*x^m + b*log(c*x^n)^2)^1), x, 1, -((a*m*CannotIntegrate(x^(-1 + m)/(a*x^m + b*log(c*x^n)^2), x))/(2*b*n)) + log(a*x^m + b*log(c*x^n)^2)/(2*b*n)]
    @test_int [log(c*x^n)/(x*(a*x^m + b*log(c*x^n)^2)^2), x, 1, -((a*m*CannotIntegrate(x^(-1 + m)/(a*x^m + b*log(c*x^n)^2)^2, x))/(2*b*n)) - 1/(2*b*n*(a*x^m + b*log(c*x^n)^2))]
    @test_int [log(c*x^n)/(x*(a*x^m + b*log(c*x^n)^2)^3), x, 1, -((a*m*CannotIntegrate(x^(-1 + m)/(a*x^m + b*log(c*x^n)^2)^3, x))/(2*b*n)) - 1/(4*b*n*(a*x^m + b*log(c*x^n)^2)^2)]

    #= ::Subsection::Closed:: =#
    #=Integrands*of*the*form*(d*x^m+e*log(c*x^n)^(q-1))*(a*x^m+b*log(c*x^n)^q)^p / x*when*a*e*m-b*d*n*q=0=#

    @test_int [(a*m*x^m + b*n*q*log(c*x^n)^(q - 1))*(a*x^m + b*log(c*x^n)^q)^p/x, x, 1, (a*x^m + b*log(c*x^n)^q)^(1 + p)/(1 + p)]

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

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

    @test_int [(a*(m - 1)*x^(m - 1) + b*n*q*log(c*x^n)^(q - 1))/(a*x^m + b*x*log(c*x^n)^q), x, 2, log(a*x^(m - 1) + b*log(c*x^n)^q)]

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

    @test_int [(d*x^m + e*log(c*x^n)^(q - 1))*(a*x^m + b*log(c*x^n)^q)^p/x, x, 1, (d - (a*e*m)/(b*n*q))*CannotIntegrate(x^(-1 + m)*(a*x^m + b*log(c*x^n)^q)^p, x) + (e*(a*x^m + b*log(c*x^n)^q)^(1 + p))/(b*n*(1 + p)*q)]

    @test_int [(d*x^m + e*log(c*x^n)^(q - 1))*(a*x^m + b*log(c*x^n)^q)^3/x, x, 9, -((a^3*(a*e*m - b*d*n*q)*x^(4*m))/(4*b*m*n*q)) - (b^2*(a*e*m - b*d*n*q)*x^m*Gamma(1 + 3*q, -((m*log(c*x^n))/n))*log(c*x^n)^(3*q))/((c*x^n)^(m/n)*(-((m*log(c*x^n))/n))^(3*q)*(m*n*q)) - (3*2^(-1 - 2*q)*a*b*(a*e*m - b*d*n*q)*x^(2*m)*Gamma(1 + 2*q, -((2*m*log(c*x^n))/n))*log(c*x^n)^(2*q))/((c*x^n)^((2*m)/n)*(-((m*log(c*x^n))/n))^(2*q)*(m*n*q)) - (a^2*(a*e*m - b*d*n*q)*x^(3*m)*Gamma(1 + q, -((3*m*log(c*x^n))/n))*log(c*x^n)^q)/(3^q*(c*x^n)^((3*m)/n)*(-((m*log(c*x^n))/n))^q*(m*n*q)) + (e*(a*x^m + b*log(c*x^n)^q)^4)/(4*b*n*q)]
    @test_int [(d*x^m + e*log(c*x^n)^(q - 1))*(a*x^m + b*log(c*x^n)^q)^2/x, x, 7, -((a^2*(a*e*m - b*d*n*q)*x^(3*m))/(3*b*m*n*q)) - (b*(a*e*m - b*d*n*q)*x^m*Gamma(1 + 2*q, -((m*log(c*x^n))/n))*log(c*x^n)^(2*q))/((c*x^n)^(m/n)*(-((m*log(c*x^n))/n))^(2*q)*(m*n*q)) - (a*(a*e*m - b*d*n*q)*x^(2*m)*Gamma(1 + q, -((2*m*log(c*x^n))/n))*log(c*x^n)^q)/(2^q*(c*x^n)^((2*m)/n)*(-((m*log(c*x^n))/n))^q*(m*n*q)) + (e*(a*x^m + b*log(c*x^n)^q)^3)/(3*b*n*q)]
    @test_int [(d*x^m + e*log(c*x^n)^(q - 1))*(a*x^m + b*log(c*x^n)^q)^1/x, x, 5, -((a*(a*e*m - b*d*n*q)*x^(2*m))/(2*b*m*n*q)) + (((b*d)/m - (a*e)/(n*q))*x^m*Gamma(1 + q, -((m*log(c*x^n))/n))*log(c*x^n)^q)/((c*x^n)^(m/n)*(-((m*log(c*x^n))/n))^q) + (e*(a*x^m + b*log(c*x^n)^q)^2)/(2*b*n*q)]
    @test_int [(d*x^m + e*log(c*x^n)^(q - 1))*(a*x^m + b*log(c*x^n)^q)^0/x, x, 4, (d*x^m)/m + (e*log(c*x^n)^q)/(n*q)]
    @test_int [(d*x^m + e*log(c*x^n)^(q - 1))/(x*(a*x^m + b*log(c*x^n)^q)^1), x, 1, (d - (a*e*m)/(b*n*q))*CannotIntegrate(x^(-1 + m)/(a*x^m + b*log(c*x^n)^q), x) + (e*log(a*x^m + b*log(c*x^n)^q))/(b*n*q)]
    @test_int [(d*x^m + e*log(c*x^n)^(q - 1))/(x*(a*x^m + b*log(c*x^n)^q)^2), x, 1, (d - (a*e*m)/(b*n*q))*CannotIntegrate(x^(-1 + m)/(a*x^m + b*log(c*x^n)^q)^2, x) - e/(b*n*q*(a*x^m + b*log(c*x^n)^q))]
    @test_int [(d*x^m + e*log(c*x^n)^(q - 1))/(x*(a*x^m + b*log(c*x^n)^q)^3), x, 1, (d - (a*e*m)/(b*n*q))*CannotIntegrate(x^(-1 + m)/(a*x^m + b*log(c*x^n)^q)^3, x) - e/(2*b*n*q*(a*x^m + b*log(c*x^n)^q)^2)]

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

    @test_int [(a*d*n*x^m - a*d*m*x^m*log(c*x^n) - b*d*n*(q - 1)*log(c*x^n)^q)/(x*(a*x^m + b*log(c*x^n)^q)^2), x, 1, (d*log(c*x^n))/(a*x^m + b*log(c*x^n)^q)]

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

    @test_int [(n*q - log(c*x^n))/(a*x + b*log(c*x^n)^q)^2, x, 1, -((n*(1 - q)*CannotIntegrate(1/(x*(a*x + b*log(c*x^n)^q)), x))/a) + log(c*x^n)/(a*(a*x + b*log(c*x^n)^q))]

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*G(x)*log(F(x))*when*C=G(x)*(1-F(x)) / D(F(x),x)=#

    @test_int [log(2*x*(d*sqrt(-e/d) + e*x)/(d + e*x^2))/(d + e*x^2), x, 1, -((sqrt(-(e/d))*PolyLog(2, 1 - (2*x*(d*sqrt(-(e/d)) + e*x))/(d + e*x^2)))/(2*e))]
    @test_int [log(-2*x*(d*sqrt(-e/d) - e*x)/(d + e*x^2))/(d + e*x^2), x, 1, (sqrt(-(e/d))*PolyLog(2, 1 + (2*x*(d*sqrt(-(e/d)) - e*x))/(d + e*x^2)))/(2*e)]

    @test_int [log(2*x*(d*sqrt(e)/sqrt(-d) + e*x)/(d + e*x^2))/(d + e*x^2), x, 1, -(PolyLog(2, 1 + (2*sqrt(e)*x*(sqrt(-d) - sqrt(e)*x))/(d + e*x^2))/(2*sqrt(-d)*sqrt(e)))]
    @test_int [log(-2*x*(d*sqrt(e)/sqrt(-d) - e*x)/(d + e*x^2))/(d + e*x^2), x, 1, PolyLog(2, 1 - (2*sqrt(e)*x*(sqrt(-d) + sqrt(e)*x))/(d + e*x^2))/(2*sqrt(-d)*sqrt(e))]

    @test_int [log(2*x*(d*sqrt(-e)/sqrt(d) + e*x)/(d + e*x^2))/(d + e*x^2), x, 1, PolyLog(2, 1 - (2*x*(sqrt(d)*sqrt(-e) + e*x))/(d + e*x^2))/(2*sqrt(d)*sqrt(-e))]
    @test_int [log(-2*x*(d*sqrt(-e)/sqrt(d) - e*x)/(d + e*x^2))/(d + e*x^2), x, 1, -(PolyLog(2, 1 + (2*x*(sqrt(d)*sqrt(-e) - e*x))/(d + e*x^2))/(2*sqrt(d)*sqrt(-e)))]

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

    @test_int [(e*x)^m*(a + b*log(c*log(d*x)^p)), x, 3, -((b*p*(d*x)^(-1 - m)*(e*x)^(1 + m)*ExpIntegralEi((1 + m)*log(d*x)))/(e*(1 + m))) + ((e*x)^(1 + m)*(a + b*log(c*log(d*x)^p)))/(e*(1 + m))]
    @test_int [(e*x)^m*(a + b*log(c*log(d*x^n)^p)), x, 3, -((b*p*(e*x)^(1 + m)*ExpIntegralEi(((1 + m)*log(d*x^n))/n))/((d*x^n)^((1 + m)/n)*(e*(1 + m)))) + ((e*x)^(1 + m)*(a + b*log(c*log(d*x^n)^p)))/(e*(1 + m))]

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

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

    @test_int [log(c*log(d*x^n)^p), x, 3, ((-p)*x*ExpIntegralEi(log(d*x^n)/n))/(d*x^n)^n^(-1) + x*log(c*log(d*x^n)^p)]
    @test_int [log(c*log(d*x^n)^p)/x, x, 1, (-p)*log(x) + (log(d*x^n)*log(c*log(d*x^n)^p))/n]

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*u*log(d*(a+b*x+c*x^2)^p)^n=#

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

    @test_int [x^m*log(d*(b*x + c*x^2)^n), x, 3, -((2*n*x^(1 + m))/(1 + m)^2) + (n*x^(1 + m)*HypergeometricFunctions._₂F₁(1, 1 + m, 2 + m, -((c*x)/b)))/(1 + m)^2 + (x^(1 + m)*log(d*(b*x + c*x^2)^n))/(1 + m)]

    @test_int [x^4*log(d*(b*x + c*x^2)^n), x, 3, -((b^4*n*x)/(5*c^4)) + (b^3*n*x^2)/(10*c^3) - (b^2*n*x^3)/(15*c^2) + (b*n*x^4)/(20*c) - (2*n*x^5)/25 + (b^5*n*log(b + c*x))/(5*c^5) + (1/5)*x^5*log(d*(b*x + c*x^2)^n)]
    @test_int [x^3*log(d*(b*x + c*x^2)^n), x, 3, (b^3*n*x)/(4*c^3) - (b^2*n*x^2)/(8*c^2) + (b*n*x^3)/(12*c) - (n*x^4)/8 - (b^4*n*log(b + c*x))/(4*c^4) + (1/4)*x^4*log(d*(b*x + c*x^2)^n)]
    @test_int [x^2*log(d*(b*x + c*x^2)^n), x, 3, -((b^2*n*x)/(3*c^2)) + (b*n*x^2)/(6*c) - (2*n*x^3)/9 + (b^3*n*log(b + c*x))/(3*c^3) + (1/3)*x^3*log(d*(b*x + c*x^2)^n)]
    @test_int [x^1*log(d*(b*x + c*x^2)^n), x, 3, (b*n*x)/(2*c) - (n*x^2)/2 - (b^2*n*log(b + c*x))/(2*c^2) + (1/2)*x^2*log(d*(b*x + c*x^2)^n)]
    @test_int [x^0*log(d*(b*x + c*x^2)^n), x, 3, -2*n*x + (b*n*log(b + c*x))/c + x*log(d*(b*x + c*x^2)^n)]
    @test_int [log(d*(b*x + c*x^2)^n)/x^1, x, 7, (-(1/2))*n*log(x)^2 - n*log(x)*log(1 + (c*x)/b) + log(x)*log(d*(b*x + c*x^2)^n) - n*PolyLog(2, -((c*x)/b))]
    @test_int [log(d*(b*x + c*x^2)^n)/x^2, x, 3, -(n/x) + (c*n*log(x))/b - (c*n*log(b + c*x))/b - log(d*(b*x + c*x^2)^n)/x]
    @test_int [log(d*(b*x + c*x^2)^n)/x^3, x, 3, -(n/(4*x^2)) - (c*n)/(2*b*x) - (c^2*n*log(x))/(2*b^2) + (c^2*n*log(b + c*x))/(2*b^2) - log(d*(b*x + c*x^2)^n)/(2*x^2)]
    @test_int [log(d*(b*x + c*x^2)^n)/x^4, x, 3, -(n/(9*x^3)) - (c*n)/(6*b*x^2) + (c^2*n)/(3*b^2*x) + (c^3*n*log(x))/(3*b^3) - (c^3*n*log(b + c*x))/(3*b^3) - log(d*(b*x + c*x^2)^n)/(3*x^3)]
    @test_int [log(d*(b*x + c*x^2)^n)/x^5, x, 3, -(n/(16*x^4)) - (c*n)/(12*b*x^3) + (c^2*n)/(8*b^2*x^2) - (c^3*n)/(4*b^3*x) - (c^4*n*log(x))/(4*b^4) + (c^4*n*log(b + c*x))/(4*b^4) - log(d*(b*x + c*x^2)^n)/(4*x^4)]

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

    @test_int [x^4*log(d*(a + b*x + c*x^2)^n), x, 7, -(((b^4 - 4*a*b^2*c + 2*a^2*c^2)*n*x)/(5*c^4)) + (b*(b^2 - 3*a*c)*n*x^2)/(10*c^3) - ((b^2 - 2*a*c)*n*x^3)/(15*c^2) + (b*n*x^4)/(20*c) - (2*n*x^5)/25 + (sqrt(b^2 - 4*a*c)*(b^4 - 3*a*b^2*c + a^2*c^2)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(5*c^5) + (b*(b^4 - 5*a*b^2*c + 5*a^2*c^2)*n*log(a + b*x + c*x^2))/(10*c^5) + (1/5)*x^5*log(d*(a + b*x + c*x^2)^n)]
    @test_int [x^3*log(d*(a + b*x + c*x^2)^n), x, 7, (b*(b^2 - 3*a*c)*n*x)/(4*c^3) - ((b^2 - 2*a*c)*n*x^2)/(8*c^2) + (b*n*x^3)/(12*c) - (n*x^4)/8 - (b*sqrt(b^2 - 4*a*c)*(b^2 - 2*a*c)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(4*c^4) - ((b^4 - 4*a*b^2*c + 2*a^2*c^2)*n*log(a + b*x + c*x^2))/(8*c^4) + (1/4)*x^4*log(d*(a + b*x + c*x^2)^n)]
    @test_int [x^2*log(d*(a + b*x + c*x^2)^n), x, 7, -(((b^2 - 2*a*c)*n*x)/(3*c^2)) + (b*n*x^2)/(6*c) - (2*n*x^3)/9 + (sqrt(b^2 - 4*a*c)*(b^2 - a*c)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(3*c^3) + (b*(b^2 - 3*a*c)*n*log(a + b*x + c*x^2))/(6*c^3) + (1/3)*x^3*log(d*(a + b*x + c*x^2)^n)]
    @test_int [x^1*log(d*(a + b*x + c*x^2)^n), x, 7, (b*n*x)/(2*c) - (n*x^2)/2 - (b*sqrt(b^2 - 4*a*c)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(2*c^2) - ((b^2 - 2*a*c)*n*log(a + b*x + c*x^2))/(4*c^2) + (1/2)*x^2*log(d*(a + b*x + c*x^2)^n)]
    @test_int [x^0*log(d*(a + b*x + c*x^2)^n), x, 6, -2*n*x + (sqrt(b^2 - 4*a*c)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/c + (b*n*log(a + b*x + c*x^2))/(2*c) + x*log(d*(a + b*x + c*x^2)^n)]
    @test_int [log(d*(a + b*x + c*x^2)^n)/x^1, x, 7, (-n)*log(x)*log(1 + (2*c*x)/(b - sqrt(b^2 - 4*a*c))) - n*log(x)*log(1 + (2*c*x)/(b + sqrt(b^2 - 4*a*c))) + log(x)*log(d*(a + b*x + c*x^2)^n) - n*PolyLog(2, -((2*c*x)/(b - sqrt(b^2 - 4*a*c)))) - n*PolyLog(2, -((2*c*x)/(b + sqrt(b^2 - 4*a*c))))]
    @test_int [log(d*(a + b*x + c*x^2)^n)/x^2, x, 7, (sqrt(b^2 - 4*a*c)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/a + (b*n*log(x))/a - (b*n*log(a + b*x + c*x^2))/(2*a) - log(d*(a + b*x + c*x^2)^n)/x]
    @test_int [log(d*(a + b*x + c*x^2)^n)/x^3, x, 7, -((b*n)/(2*a*x)) - (b*sqrt(b^2 - 4*a*c)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(2*a^2) - ((b^2 - 2*a*c)*n*log(x))/(2*a^2) + ((b^2 - 2*a*c)*n*log(a + b*x + c*x^2))/(4*a^2) - log(d*(a + b*x + c*x^2)^n)/(2*x^2)]
    @test_int [log(d*(a + b*x + c*x^2)^n)/x^4, x, 7, -((b*n)/(6*a*x^2)) + ((b^2 - 2*a*c)*n)/(3*a^2*x) + (sqrt(b^2 - 4*a*c)*(b^2 - a*c)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(3*a^3) + (b*(b^2 - 3*a*c)*n*log(x))/(3*a^3) - (b*(b^2 - 3*a*c)*n*log(a + b*x + c*x^2))/(6*a^3) - log(d*(a + b*x + c*x^2)^n)/(3*x^3)]
    @test_int [log(d*(a + b*x + c*x^2)^n)/x^5, x, 7, -((b*n)/(12*a*x^3)) + ((b^2 - 2*a*c)*n)/(8*a^2*x^2) - (b*(b^2 - 3*a*c)*n)/(4*a^3*x) - (b*sqrt(b^2 - 4*a*c)*(b^2 - 2*a*c)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(4*a^4) - ((b^4 - 4*a*b^2*c + 2*a^2*c^2)*n*log(x))/(4*a^4) + ((b^4 - 4*a*b^2*c + 2*a^2*c^2)*n*log(a + b*x + c*x^2))/(8*a^4) - log(d*(a + b*x + c*x^2)^n)/(4*x^4)]

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

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

    @test_int [log(d*(a + b*x + c*x^2)^n)*(d + e*x)^4, x, 7, -(((10*c^4*d^4 + b^4*e^4 - 10*c^3*d^2*e*(b*d + 2*a*e) - b^2*c*e^3*(5*b*d + 4*a*e) + c^2*e^2*(10*b^2*d^2 + 15*a*b*d*e + 2*a^2*e^2))*n*x)/(5*c^4)) - (e*(20*c^3*d^3 - b^3*e^3 - 10*c^2*d*e*(b*d + a*e) + b*c*e^2*(5*b*d + 3*a*e))*n*x^2)/(10*c^3) - (e^2*(20*c^2*d^2 + b^2*e^2 - c*e*(5*b*d + 2*a*e))*n*x^3)/(15*c^2) - (e^3*(10*c*d - b*e)*n*x^4)/(20*c) - (2/25)*e^4*n*x^5 + (sqrt(b^2 - 4*a*c)*(5*c^4*d^4 + b^4*e^4 - 10*c^3*d^2*e*(b*d + a*e) - b^2*c*e^3*(5*b*d + 3*a*e) + c^2*e^2*(10*b^2*d^2 + 10*a*b*d*e + a^2*e^2))*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(5*c^5) - ((2*c*d - b*e)*(c^4*d^4 + b^4*e^4 - 2*c^3*d^2*e*(b*d + 5*a*e) - b^2*c*e^3*(3*b*d + 5*a*e) + c^2*e^2*(4*b^2*d^2 + 10*a*b*d*e + 5*a^2*e^2))*n*log(a + b*x + c*x^2))/(10*c^5*e) + ((d + e*x)^5*log(d*(a + b*x + c*x^2)^n))/(5*e)]
    @test_int [log(d*(a + b*x + c*x^2)^n)*(d + e*x)^3, x, 7, -(((8*c^3*d^3 - b^3*e^3 + b*c*e^2*(4*b*d + 3*a*e) - 2*c^2*d*e*(3*b*d + 4*a*e))*n*x)/(4*c^3)) - (e*(12*c^2*d^2 + b^2*e^2 - 2*c*e*(2*b*d + a*e))*n*x^2)/(8*c^2) - (e^2*(8*c*d - b*e)*n*x^3)/(12*c) - (1/8)*e^3*n*x^4 + (sqrt(b^2 - 4*a*c)*(2*c*d - b*e)*(2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(4*c^4) - ((2*c^4*d^4 + b^4*e^4 - 4*b^2*c*e^3*(b*d + a*e) - 4*c^3*d^2*e*(b*d + 3*a*e) + 2*c^2*e^2*(3*b^2*d^2 + 6*a*b*d*e + a^2*e^2))*n*log(a + b*x + c*x^2))/(8*c^4*e) + ((d + e*x)^4*log(d*(a + b*x + c*x^2)^n))/(4*e)]
    @test_int [log(d*(a + b*x + c*x^2)^n)*(d + e*x)^2, x, 7, -(((6*c^2*d^2 + b^2*e^2 - c*e*(3*b*d + 2*a*e))*n*x)/(3*c^2)) - (e*(6*c*d - b*e)*n*x^2)/(6*c) - (2/9)*e^2*n*x^3 + (sqrt(b^2 - 4*a*c)*(3*c^2*d^2 + b^2*e^2 - c*e*(3*b*d + a*e))*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(3*c^3) - ((2*c*d - b*e)*(c^2*d^2 + b^2*e^2 - c*e*(b*d + 3*a*e))*n*log(a + b*x + c*x^2))/(6*c^3*e) + ((d + e*x)^3*log(d*(a + b*x + c*x^2)^n))/(3*e)]
    @test_int [log(d*(a + b*x + c*x^2)^n)*(d + e*x)^1, x, 7, (-(1/2))*(4*d - (b*e)/c)*n*x - (1/2)*e*n*x^2 + (sqrt(b^2 - 4*a*c)*(2*c*d - b*e)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(2*c^2) - ((2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))*n*log(a + b*x + c*x^2))/(4*c^2*e) + ((d + e*x)^2*log(d*(a + b*x + c*x^2)^n))/(2*e)]
    @test_int [log(d*(a + b*x + c*x^2)^n)*(d + e*x)^0, x, 6, -2*n*x + (sqrt(b^2 - 4*a*c)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/c + (b*n*log(a + b*x + c*x^2))/(2*c) + x*log(d*(a + b*x + c*x^2)^n)]
    @test_int [log(d*(a + b*x + c*x^2)^n)/(d + e*x)^1, x, 9, -((n*log(-((e*(b - sqrt(b^2 - 4*a*c) + 2*c*x))/(2*c*d - (b - sqrt(b^2 - 4*a*c))*e)))*log(d + e*x))/e) - (n*log(-((e*(b + sqrt(b^2 - 4*a*c) + 2*c*x))/(2*c*d - (b + sqrt(b^2 - 4*a*c))*e)))*log(d + e*x))/e + (log(d + e*x)*log(d*(a + b*x + c*x^2)^n))/e - (n*PolyLog(2, (2*c*(d + e*x))/(2*c*d - (b - sqrt(b^2 - 4*a*c))*e)))/e - (n*PolyLog(2, (2*c*(d + e*x))/(2*c*d - (b + sqrt(b^2 - 4*a*c))*e)))/e]
    @test_int [log(d*(a + b*x + c*x^2)^n)/(d + e*x)^2, x, 7, (sqrt(b^2 - 4*a*c)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(c*d^2 - b*d*e + a*e^2) - ((2*c*d - b*e)*n*log(d + e*x))/(e*(c*d^2 - b*d*e + a*e^2)) + ((2*c*d - b*e)*n*log(a + b*x + c*x^2))/(2*e*(c*d^2 - b*d*e + a*e^2)) - log(d*(a + b*x + c*x^2)^n)/(e*(d + e*x))]
    @test_int [log(d*(a + b*x + c*x^2)^n)/(d + e*x)^3, x, 7, ((2*c*d - b*e)*n)/(2*e*(c*d^2 - b*d*e + a*e^2)*(d + e*x)) + (sqrt(b^2 - 4*a*c)*(2*c*d - b*e)*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(2*(c*d^2 - b*d*e + a*e^2)^2) - ((2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))*n*log(d + e*x))/(2*e*(c*d^2 - b*d*e + a*e^2)^2) + ((2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))*n*log(a + b*x + c*x^2))/(4*e*(c*d^2 - b*d*e + a*e^2)^2) - log(d*(a + b*x + c*x^2)^n)/(2*e*(d + e*x)^2)]
    @test_int [log(d*(a + b*x + c*x^2)^n)/(d + e*x)^4, x, 7, ((2*c*d - b*e)*n)/(6*e*(c*d^2 - b*d*e + a*e^2)*(d + e*x)^2) + ((2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))*n)/(3*e*(c*d^2 - b*d*e + a*e^2)^2*(d + e*x)) + (sqrt(b^2 - 4*a*c)*(3*c^2*d^2 + b^2*e^2 - c*e*(3*b*d + a*e))*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(3*(c*d^2 - b*d*e + a*e^2)^3) - ((2*c*d - b*e)*(c^2*d^2 + b^2*e^2 - c*e*(b*d + 3*a*e))*n*log(d + e*x))/(3*e*(c*d^2 - b*d*e + a*e^2)^3) + ((2*c*d - b*e)*(c^2*d^2 + b^2*e^2 - c*e*(b*d + 3*a*e))*n*log(a + b*x + c*x^2))/(6*e*(c*d^2 - b*d*e + a*e^2)^3) - log(d*(a + b*x + c*x^2)^n)/(3*e*(d + e*x)^3)]
    @test_int [log(d*(a + b*x + c*x^2)^n)/(d + e*x)^5, x, 7, ((2*c*d - b*e)*n)/(12*e*(c*d^2 - b*d*e + a*e^2)*(d + e*x)^3) + ((2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))*n)/(8*e*(c*d^2 - b*d*e + a*e^2)^2*(d + e*x)^2) + ((2*c*d - b*e)*(c^2*d^2 + b^2*e^2 - c*e*(b*d + 3*a*e))*n)/(4*e*(c*d^2 - b*d*e + a*e^2)^3*(d + e*x)) + (sqrt(b^2 - 4*a*c)*(2*c*d - b*e)*(2*c^2*d^2 + b^2*e^2 - 2*c*e*(b*d + a*e))*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/(4*(c*d^2 - b*d*e + a*e^2)^4) - ((2*c^4*d^4 + b^4*e^4 - 4*b^2*c*e^3*(b*d + a*e) - 4*c^3*d^2*e*(b*d + 3*a*e) + 2*c^2*e^2*(3*b^2*d^2 + 6*a*b*d*e + a^2*e^2))*n*log(d + e*x))/(4*e*(c*d^2 - b*d*e + a*e^2)^4) + ((2*c^4*d^4 + b^4*e^4 - 4*b^2*c*e^3*(b*d + a*e) - 4*c^3*d^2*e*(b*d + 3*a*e) + 2*c^2*e^2*(3*b^2*d^2 + 6*a*b*d*e + a^2*e^2))*n*log(a + b*x + c*x^2))/(8*e*(c*d^2 - b*d*e + a*e^2)^4) - log(d*(a + b*x + c*x^2)^n)/(4*e*(d + e*x)^4)]

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

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

    @test_int [log(d*(a + c*x^2)^n)/(a*e + c*e*x^2), x, 6, (im*n*atan((sqrt(c)*x)/sqrt(a))^2)/(sqrt(a)*sqrt(c)*e) + (2*n*atan((sqrt(c)*x)/sqrt(a))*log((2*sqrt(a))/(sqrt(a) + im*sqrt(c)*x)))/(sqrt(a)*sqrt(c)*e) + (atan((sqrt(c)*x)/sqrt(a))*log(d*(a + c*x^2)^n))/(sqrt(a)*sqrt(c)*e) + (im*n*PolyLog(2, 1 - (2*sqrt(a))/(sqrt(a) + im*sqrt(c)*x)))/(sqrt(a)*sqrt(c)*e)]
    @test_int [log(d*(a + b*x + c*x^2)^n)/(a*e + b*e*x + c*e*x^2), x, 8, (2*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c))^2)/(sqrt(b^2 - 4*a*c)*e) - (4*n*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c))*log(2/(1 - b/sqrt(b^2 - 4*a*c) - (2*c*x)/sqrt(b^2 - 4*a*c))))/(sqrt(b^2 - 4*a*c)*e) - (2*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c))*log(d*(a + b*x + c*x^2)^n))/(sqrt(b^2 - 4*a*c)*e) - (2*n*PolyLog(2, -((1 + b/sqrt(b^2 - 4*a*c) + (2*c*x)/sqrt(b^2 - 4*a*c))/(1 - b/sqrt(b^2 - 4*a*c) - (2*c*x)/sqrt(b^2 - 4*a*c)))))/(sqrt(b^2 - 4*a*c)*e)]

    @test_int [log(g*(a + b*x + c*x^2)^n)/(d + e*x^2), x, 20, -((n*log((sqrt(e)*(b - sqrt(b^2 - 4*a*c) + 2*c*x))/(2*c*sqrt(-d) + (b - sqrt(b^2 - 4*a*c))*sqrt(e)))*log(sqrt(-d) - sqrt(e)*x))/(2*sqrt(-d)*sqrt(e))) - (n*log((sqrt(e)*(b + sqrt(b^2 - 4*a*c) + 2*c*x))/(2*c*sqrt(-d) + (b + sqrt(b^2 - 4*a*c))*sqrt(e)))*log(sqrt(-d) - sqrt(e)*x))/(2*sqrt(-d)*sqrt(e)) + (n*log(-((sqrt(e)*(b - sqrt(b^2 - 4*a*c) + 2*c*x))/(2*c*sqrt(-d) - (b - sqrt(b^2 - 4*a*c))*sqrt(e))))*log(sqrt(-d) + sqrt(e)*x))/(2*sqrt(-d)*sqrt(e)) + (n*log(-((sqrt(e)*(b + sqrt(b^2 - 4*a*c) + 2*c*x))/(2*c*sqrt(-d) - (b + sqrt(b^2 - 4*a*c))*sqrt(e))))*log(sqrt(-d) + sqrt(e)*x))/(2*sqrt(-d)*sqrt(e)) + (log(sqrt(-d) - sqrt(e)*x)*log(g*(a + b*x + c*x^2)^n))/(2*sqrt(-d)*sqrt(e)) - (log(sqrt(-d) + sqrt(e)*x)*log(g*(a + b*x + c*x^2)^n))/(2*sqrt(-d)*sqrt(e)) - (n*PolyLog(2, (2*c*(sqrt(-d) - sqrt(e)*x))/(2*c*sqrt(-d) + (b - sqrt(b^2 - 4*a*c))*sqrt(e))))/(2*sqrt(-d)*sqrt(e)) - (n*PolyLog(2, (2*c*(sqrt(-d) - sqrt(e)*x))/(2*c*sqrt(-d) + (b + sqrt(b^2 - 4*a*c))*sqrt(e))))/(2*sqrt(-d)*sqrt(e)) + (n*PolyLog(2, (2*c*(sqrt(-d) + sqrt(e)*x))/(2*c*sqrt(-d) - (b - sqrt(b^2 - 4*a*c))*sqrt(e))))/(2*sqrt(-d)*sqrt(e)) + (n*PolyLog(2, (2*c*(sqrt(-d) + sqrt(e)*x))/(2*c*sqrt(-d) - (b + sqrt(b^2 - 4*a*c))*sqrt(e))))/(2*sqrt(-d)*sqrt(e))]
    @test_int [log(g*(a + b*x + c*x^2)^n)/(d + e*x +f*x^2), x, 20, -((n*log(-((f*(b - sqrt(b^2 - 4*a*c) + 2*c*x))/(c*e - b*f + sqrt(b^2 - 4*a*c)*f - c*sqrt(e^2 - 4*d*f))))*log(e - sqrt(e^2 - 4*d*f) + 2*f*x))/sqrt(e^2 - 4*d*f)) - (n*log((f*(b + sqrt(b^2 - 4*a*c) + 2*c*x))/((b + sqrt(b^2 - 4*a*c))*f - c*(e - sqrt(e^2 - 4*d*f))))*log(e - sqrt(e^2 - 4*d*f) + 2*f*x))/sqrt(e^2 - 4*d*f) + (n*log((f*(b - sqrt(b^2 - 4*a*c) + 2*c*x))/((b - sqrt(b^2 - 4*a*c))*f - c*(e + sqrt(e^2 - 4*d*f))))*log(e + sqrt(e^2 - 4*d*f) + 2*f*x))/sqrt(e^2 - 4*d*f) + (n*log((f*(b + sqrt(b^2 - 4*a*c) + 2*c*x))/((b + sqrt(b^2 - 4*a*c))*f - c*(e + sqrt(e^2 - 4*d*f))))*log(e + sqrt(e^2 - 4*d*f) + 2*f*x))/sqrt(e^2 - 4*d*f) + (log(e - sqrt(e^2 - 4*d*f) + 2*f*x)*log(g*(a + b*x + c*x^2)^n))/sqrt(e^2 - 4*d*f) - (log(e + sqrt(e^2 - 4*d*f) + 2*f*x)*log(g*(a + b*x + c*x^2)^n))/sqrt(e^2 - 4*d*f) - (n*PolyLog(2, -((c*(e - sqrt(e^2 - 4*d*f) + 2*f*x))/((b - sqrt(b^2 - 4*a*c))*f - c*(e - sqrt(e^2 - 4*d*f))))))/sqrt(e^2 - 4*d*f) - (n*PolyLog(2, -((c*(e - sqrt(e^2 - 4*d*f) + 2*f*x))/((b + sqrt(b^2 - 4*a*c))*f - c*(e - sqrt(e^2 - 4*d*f))))))/sqrt(e^2 - 4*d*f) + (n*PolyLog(2, -((c*(e + sqrt(e^2 - 4*d*f) + 2*f*x))/((b - sqrt(b^2 - 4*a*c))*f - c*(e + sqrt(e^2 - 4*d*f))))))/sqrt(e^2 - 4*d*f) + (n*PolyLog(2, -((c*(e + sqrt(e^2 - 4*d*f) + 2*f*x))/((b + sqrt(b^2 - 4*a*c))*f - c*(e + sqrt(e^2 - 4*d*f))))))/sqrt(e^2 - 4*d*f)]

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

    @test_int [log(d*(b*x + c*x^2)^n)^2, x, 14, 8*n^2*x - (4*b*n^2*log(b + c*x))/c - (2*b*n^2*log(-((c*x)/b))*log(b + c*x))/c - (b*n^2*log(b + c*x)^2)/c - 4*n*x*log(d*(b*x + c*x^2)^n) + (2*b*n*log(b + c*x)*log(d*(b*x + c*x^2)^n))/c + x*log(d*(b*x + c*x^2)^n)^2 - (2*b*n^2*PolyLog(2, 1 + (c*x)/b))/c]
    @test_int [log(d*(a + b*x + c*x^2)^n)^2, x, 27, 8*n^2*x - (4*sqrt(b^2 - 4*a*c)*n^2*atanh((b + 2*c*x)/sqrt(b^2 - 4*a*c)))/c - ((b - sqrt(b^2 - 4*a*c))*n^2*log(b - sqrt(b^2 - 4*a*c) + 2*c*x)^2)/(2*c) - ((b + sqrt(b^2 - 4*a*c))*n^2*log(-((b - sqrt(b^2 - 4*a*c) + 2*c*x)/(2*sqrt(b^2 - 4*a*c))))*log(b + sqrt(b^2 - 4*a*c) + 2*c*x))/c - ((b + sqrt(b^2 - 4*a*c))*n^2*log(b + sqrt(b^2 - 4*a*c) + 2*c*x)^2)/(2*c) - ((b - sqrt(b^2 - 4*a*c))*n^2*log(b - sqrt(b^2 - 4*a*c) + 2*c*x)*log((b + sqrt(b^2 - 4*a*c) + 2*c*x)/(2*sqrt(b^2 - 4*a*c))))/c - (2*b*n^2*log(a + b*x + c*x^2))/c - 4*n*x*log(d*(a + b*x + c*x^2)^n) + ((b - sqrt(b^2 - 4*a*c))*n*log(b - sqrt(b^2 - 4*a*c) + 2*c*x)*log(d*(a + b*x + c*x^2)^n))/c + ((b + sqrt(b^2 - 4*a*c))*n*log(b + sqrt(b^2 - 4*a*c) + 2*c*x)*log(d*(a + b*x + c*x^2)^n))/c + x*log(d*(a + b*x + c*x^2)^n)^2 - ((b - sqrt(b^2 - 4*a*c))*n^2*PolyLog(2, -((b - sqrt(b^2 - 4*a*c) + 2*c*x)/(2*sqrt(b^2 - 4*a*c)))))/c - ((b + sqrt(b^2 - 4*a*c))*n^2*PolyLog(2, (b + sqrt(b^2 - 4*a*c) + 2*c*x)/(2*sqrt(b^2 - 4*a*c))))/c]

    @test_int [x^2*log(1 + x + x^2)/(2 + 3*x + x^2), x, 28, -2*x + sqrt(3)*atan((1 + 2*x)/sqrt(3)) - log(2 + 2*x)*log(-((1 - im*sqrt(3) + 2*x)/(1 + im*sqrt(3)))) + 4*log(4 + 2*x)*log(-((1 - im*sqrt(3) + 2*x)/(3 + im*sqrt(3)))) - log(2 + 2*x)*log(-((1 + im*sqrt(3) + 2*x)/(1 - im*sqrt(3)))) + 4*log(4 + 2*x)*log(-((1 + im*sqrt(3) + 2*x)/(3 - im*sqrt(3)))) + (1/2)*log(1 + x + x^2) + x*log(1 + x + x^2) + log(2 + 2*x)*log(1 + x + x^2) - 4*log(4 + 2*x)*log(1 + x + x^2) - PolyLog(2, (2*(1 + x))/(1 - im*sqrt(3))) - PolyLog(2, (2*(1 + x))/(1 + im*sqrt(3))) + 4*PolyLog(2, (2*(2 + x))/(3 - im*sqrt(3))) + 4*PolyLog(2, (2*(2 + x))/(3 + im*sqrt(3)))]

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

    @test_int [log(-1 + x + x^2)^2/x^3, x, 34, log(x) - (1/2)*(1 + sqrt(5))*log(1 - sqrt(5) + 2*x) + 3*log((1/2)*(-1 + sqrt(5)))*log(1 - sqrt(5) + 2*x) - (1/4)*(3 + sqrt(5))*log(1 - sqrt(5) + 2*x)^2 - (1/2)*(1 - sqrt(5))*log(1 + sqrt(5) + 2*x) - (1/2)*(3 - sqrt(5))*log(-((1 - sqrt(5) + 2*x)/(2*sqrt(5))))*log(1 + sqrt(5) + 2*x) - (1/4)*(3 - sqrt(5))*log(1 + sqrt(5) + 2*x)^2 - (1/2)*(3 + sqrt(5))*log(1 - sqrt(5) + 2*x)*log((1 + sqrt(5) + 2*x)/(2*sqrt(5))) + 3*log(x)*log(1 + (2*x)/(1 + sqrt(5))) + log(-1 + x + x^2)/x - 3*log(x)*log(-1 + x + x^2) + (1/2)*(3 + sqrt(5))*log(1 - sqrt(5) + 2*x)*log(-1 + x + x^2) + (1/2)*(3 - sqrt(5))*log(1 + sqrt(5) + 2*x)*log(-1 + x + x^2) - log(-1 + x + x^2)^2/(2*x^2) + 3*PolyLog(2, -((2*x)/(1 + sqrt(5)))) - (1/2)*(3 + sqrt(5))*PolyLog(2, -((1 - sqrt(5) + 2*x)/(2*sqrt(5)))) - (1/2)*(3 - sqrt(5))*PolyLog(2, (1 + sqrt(5) + 2*x)/(2*sqrt(5))) - 3*PolyLog(2, 1 + (2*x)/(1 - sqrt(5)))]

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

    @test_int [x^3*log(-1 + 4*x + 4*sqrt((-1 + x)*x)), x, 25, x/4096 - x^2/1024 + x^3/192 - x^4/32 - (683*sqrt(-x + x^2))/4096 + (149*(1 - 2*x)*sqrt(-x + x^2))/2048 - (1/12)*(-x + x^2)^(3/2) - (1/32)*x*(-x + x^2)^(3/2) + atanh((1 - 10*x)/(6*sqrt(-x + x^2)))/32768 - (1537*atanh(x/sqrt(-x + x^2)))/16384 - log(1 + 8*x)/32768 + (1/4)*x^4*log(-1 + 4*x + 4*sqrt(-x + x^2))]
    @test_int [x^2*log(-1 + 4*x + 4*sqrt((-1 + x)*x)), x, 20, -(x/384) + x^2/96 - x^3/18 - (85/384)*sqrt(-x + x^2) + (5/64)*(1 - 2*x)*sqrt(-x + x^2) - (1/18)*(-x + x^2)^(3/2) - atanh((1 - 10*x)/(6*sqrt(-x + x^2)))/3072 - (223*atanh(x/sqrt(-x + x^2)))/1536 + log(1 + 8*x)/3072 + (1/3)*x^3*log(-1 + 4*x + 4*sqrt(-x + x^2))]
    @test_int [x^1*log(-1 + 4*x + 4*sqrt((-1 + x)*x)), x, 16, x/32 - x^2/8 - (11/32)*sqrt(-x + x^2) + (1/16)*(1 - 2*x)*sqrt(-x + x^2) + (1/256)*atanh((1 - 10*x)/(6*sqrt(-x + x^2))) - (33/128)*atanh(x/sqrt(-x + x^2)) - (1/256)*log(1 + 8*x) + (1/2)*x^2*log(-1 + 4*x + 4*sqrt(-x + x^2))]
    @test_int [x^0*log(-1 + 4*x + 4*sqrt((-1 + x)*x)), x, 13, -(x/2) - (1/2)*sqrt(-x + x^2) - (1/16)*atanh((1 - 10*x)/(6*sqrt(-x + x^2))) - (7/8)*atanh(x/sqrt(-x + x^2)) + (1/16)*log(1 + 8*x) + x*log(-1 + 4*x + 4*sqrt(-x + x^2))]
    @test_int [log(-1 + 4*x + 4*sqrt((-1 + x)*x))/x^1, x, 1, CannotIntegrate(log(-1 + 4*x + 4*sqrt(-x + x^2))/x, x)]
    @test_int [log(-1 + 4*x + 4*sqrt((-1 + x)*x))/x^2, x, 19, (4*sqrt(-x + x^2))/x + 4*atanh((1 - 10*x)/(6*sqrt(-x + x^2))) + 4*log(x) - 4*log(1 + 8*x) - log(-1 + 4*x + 4*sqrt(-x + x^2))/x]
    @test_int [log(-1 + 4*x + 4*sqrt((-1 + x)*x))/x^3, x, 20, -(2/x) - (10*sqrt(-x + x^2))/x - (2*(-x + x^2)^(3/2))/(3*x^3) - 16*atanh((1 - 10*x)/(6*sqrt(-x + x^2))) - 16*log(x) + 16*log(1 + 8*x) - log(-1 + 4*x + 4*sqrt(-x + x^2))/(2*x^2)]

    @test_int [x^(3/2)*log(-1 + 4*x + 4*sqrt((-1 + x)*x)), x, 15, -(sqrt(x)/160) + x^(3/2)/60 - (2*x^(5/2))/25 - (17*sqrt(-x + x^2))/(32*sqrt(x)) - (71*(-x + x^2)^(3/2))/(300*x^(3/2)) - (2*(-x + x^2)^(3/2))/(25*sqrt(x)) - (sqrt(-x + x^2)*atan((2/3)*sqrt(2)*sqrt(-1 + x)))/(320*sqrt(2)*sqrt(-1 + x)*sqrt(x)) + atan(2*sqrt(2)*sqrt(x))/(320*sqrt(2)) + (2/5)*x^(5/2)*log(-1 + 4*x + 4*sqrt(-x + x^2))]
    @test_int [x^(1/2)*log(-1 + 4*x + 4*sqrt((-1 + x)*x)), x, 13, sqrt(x)/12 - (2*x^(3/2))/9 - (11*sqrt(-x + x^2))/(12*sqrt(x)) - (2*(-x + x^2)^(3/2))/(9*x^(3/2)) + (sqrt(-x + x^2)*atan((2/3)*sqrt(2)*sqrt(-1 + x)))/(24*sqrt(2)*sqrt(-1 + x)*sqrt(x)) - atan(2*sqrt(2)*sqrt(x))/(24*sqrt(2)) + (2/3)*x^(3/2)*log(-1 + 4*x + 4*sqrt(-x + x^2))]
    @test_int [log(-1 + 4*x + 4*sqrt((-1 + x)*x))/x^(1/2), x, 12, -2*sqrt(x) - (2*sqrt(-x + x^2))/sqrt(x) - (sqrt(-x + x^2)*atan((2/3)*sqrt(2)*sqrt(-1 + x)))/(sqrt(2)*sqrt(-1 + x)*sqrt(x)) + atan(2*sqrt(2)*sqrt(x))/sqrt(2) + 2*sqrt(x)*log(-1 + 4*x + 4*sqrt(-x + x^2))]
    @test_int [log(-1 + 4*x + 4*sqrt((-1 + x)*x))/x^(3/2), x, 15, -((4*sqrt(2)*sqrt(-x + x^2)*atan((2/3)*sqrt(2)*sqrt(-1 + x)))/(sqrt(-1 + x)*sqrt(x))) + 4*sqrt(2)*atan(2*sqrt(2)*sqrt(x)) - 8*atan(sqrt(x)/sqrt(-x + x^2)) - (2*log(-1 + 4*x + 4*sqrt(-x + x^2)))/sqrt(x)]
    @test_int [log(-1 + 4*x + 4*sqrt((-1 + x)*x))/x^(5/2), x, 18, -(16/(3*sqrt(x))) + (4*sqrt(-x + x^2))/(3*x^(3/2)) + (32*sqrt(2)*sqrt(-x + x^2)*atan((2/3)*sqrt(2)*sqrt(-1 + x)))/(3*sqrt(-1 + x)*sqrt(x)) - (32/3)*sqrt(2)*atan(2*sqrt(2)*sqrt(x)) + (44/3)*atan(sqrt(x)/sqrt(-x + x^2)) - (2*log(-1 + 4*x + 4*sqrt(-x + x^2)))/(3*x^(3/2))]

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*x^m*log(d+e*(F^(c*(a+b*x)))^n)=#

    @test_int [x^3*log(a + b*ℯ^x), x, 6, (1/4)*x^4*log(a + b*ℯ^x) - (1/4)*x^4*log(1 + (b*ℯ^x)/a) - x^3*PolyLog(2, -((b*ℯ^x)/a)) + 3*x^2*PolyLog(3, -((b*ℯ^x)/a)) - 6*x*PolyLog(4, -((b*ℯ^x)/a)) + 6*PolyLog(5, -((b*ℯ^x)/a))]
    @test_int [x^2*log(a + b*ℯ^x), x, 5, (1/3)*x^3*log(a + b*ℯ^x) - (1/3)*x^3*log(1 + (b*ℯ^x)/a) - x^2*PolyLog(2, -((b*ℯ^x)/a)) + 2*x*PolyLog(3, -((b*ℯ^x)/a)) - 2*PolyLog(4, -((b*ℯ^x)/a))]
    @test_int [x^1*log(a + b*ℯ^x), x, 4, (1/2)*x^2*log(a + b*ℯ^x) - (1/2)*x^2*log(1 + (b*ℯ^x)/a) - x*PolyLog(2, -((b*ℯ^x)/a)) + PolyLog(3, -((b*ℯ^x)/a))]
    @test_int [x^0*log(a + b*ℯ^x), x, 4, x*log(a + b*ℯ^x) - x*log(1 + (b*ℯ^x)/a) - PolyLog(2, -((b*ℯ^x)/a))]
    @test_int [log(a + b*ℯ^x)/x^1, x, 0, CannotIntegrate(log(a + b*ℯ^x)/x, x)]

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

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

    @test_int [log(pi + b*(F^(e*(c + d*x)))^n), x, 3, x*log(pi) - PolyLog(2, -((b*(F^(e*(c + d*x)))^n)/pi))/(d*e*n*log(F))]

    #= ::Section::Closed:: =#
    #=Integrands*of*the*form*F(log(c*x^n))/x=#

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

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

    @test_int [log(log(6*x))/(x*log(6*x)), x, 2, log(log(6*x))^2/2]
    @test_int [2^log(x)/x, x, 2, 2^log(x)/log(2), x^log(2)/log(2)]
    @test_int [sin(log(x))^2/x, x, 3, log(x)/2 - (1/2)*cos(log(x))*sin(log(x))]
    @test_int [(7 - log(x))/(x*(3 + log(x))), x, 3, -log(x) + 10*log(3 + log(x))]
    @test_int [((2 - log(x))*(3 + log(x))^2)/x, x, 3, (5/3)*(3 + log(x))^3 - (1/4)*(3 + log(x))^4]
    @test_int [(log(x)^2*sqrt(1 + log(x)^2))/x, x, 4, (-(1/8))*asinh(log(x)) + (1/8)*log(x)*sqrt(1 + log(x)^2) + (1/4)*log(x)^3*sqrt(1 + log(x)^2)]
    @test_int [(1 + log(x))/(x*(3 + 2*log(x))^2), x, 3, 1/(4*(3 + 2*log(x))) + (1/4)*log(3 + 2*log(x))]
    @test_int [log(x)/(x*sqrt(1 + log(x))), x, 3, -2*sqrt(1 + log(x)) + (2/3)*(1 + log(x))^(3/2)]
    @test_int [log(x)/(x*sqrt(-1 + 4*log(x))), x, 3, (1/8)*sqrt(-1 + 4*log(x)) + (1/24)*(-1 + 4*log(x))^(3/2)]
    @test_int [sqrt(1 + log(x))/(x*log(x)), x, 4, -2*atanh(sqrt(1 + log(x))) + 2*sqrt(1 + log(x))]
    @test_int [(1 - 4*log(x) + log(x)^2)/(x*(-1 + log(x))^4), x, 3, -(2/(3*(1 - log(x))^3)) + 1/(1 - log(x)) + 1/(-1 + log(x))^2]

    @test_int [(log(a*x^n)^2)^p/x, x, 3, (log(a*x^n)*(log(a*x^n)^2)^p)/(n*(1 + 2*p))]
    @test_int [(log(a*x^n)^m)^p/x, x, 3, (log(a*x^n)*(log(a*x^n)^m)^p)/(n*(1 + m*p))]
    @test_int [sqrt(log(a*x^n)^2)/x, x, 3, (log(a*x^n)*sqrt(log(a*x^n)^2))/(2*n)]
    @test_int [(b*log(a*x^n)^m)^p/x, x, 3, (log(a*x^n)*(b*log(a*x^n)^m)^p)/(n*(1 + m*p))]

    @test_int [1/(x*log(ℯ^x)), x, 4, -(log(x)/(x - log(ℯ^x))) + log(log(ℯ^x))/(x - log(ℯ^x))]

    #= ::Section::Closed:: =#
    #=Integrands*involving*logarithms*and*trig*functions=#

    #= ::Subsection::Closed:: =#
    #=Integrands*involving*products*of*logarithms*and*trig*functions=#

    @test_int [log(x)*sin(a + b*x)^1, x, 5, (cos(a)*CosIntegral(b*x))/b - (cos(a + b*x)*log(x))/b - (sin(a)*SinIntegral(b*x))/b]
    @test_int [log(x)*sin(a + b*x)^2, x, 5, -(x/2) + (1/2)*x*log(x) + (CosIntegral(2*b*x)*sin(2*a))/(4*b) - (cos(a + b*x)*log(x)*sin(a + b*x))/(2*b) + (cos(2*a)*SinIntegral(2*b*x))/(4*b)]
    @test_int [log(x)*sin(a + b*x)^3, x, 15, (3*cos(a)*CosIntegral(b*x))/(4*b) - (cos(3*a)*CosIntegral(3*b*x))/(12*b) - (cos(a + b*x)*log(x))/b + (cos(a + b*x)^3*log(x))/(3*b) - (3*sin(a)*SinIntegral(b*x))/(4*b) + (sin(3*a)*SinIntegral(3*b*x))/(12*b)]

    @test_int [log(x)*cos(a + b*x)^1, x, 5, -((CosIntegral(b*x)*sin(a))/b) + (log(x)*sin(a + b*x))/b - (cos(a)*SinIntegral(b*x))/b]
    @test_int [log(x)*cos(a + b*x)^2, x, 7, -(x/2) + (1/2)*x*log(x) - (CosIntegral(2*b*x)*sin(2*a))/(4*b) + (cos(a + b*x)*log(x)*sin(a + b*x))/(2*b) - (cos(2*a)*SinIntegral(2*b*x))/(4*b)]
    @test_int [log(x)*cos(a + b*x)^3, x, 15, -((3*CosIntegral(b*x)*sin(a))/(4*b)) - (CosIntegral(3*b*x)*sin(3*a))/(12*b) + (log(x)*sin(a + b*x))/b - (log(x)*sin(a + b*x)^3)/(3*b) - (3*cos(a)*SinIntegral(b*x))/(4*b) - (cos(3*a)*SinIntegral(3*b*x))/(12*b)]

    @test_int [cos(x)*log(x) + sin(x)/x, x, 4, log(x)*sin(x)]

    #= ::Subsection::Closed:: =#
    #=Integrands*involving*logarithms*of*trig*functions=#

    @test_int [log(a*sin(x)), x, 5, (im*x^2)/2 - x*log(1 - ℯ^(2*im*x)) + x*log(a*sin(x)) + (1/2)*im*PolyLog(2, ℯ^(2*im*x))]
    @test_int [log(a*sin(x)^2), x, 6, im*x^2 - 2*x*log(1 - ℯ^(2*im*x)) + x*log(a*sin(x)^2) + im*PolyLog(2, ℯ^(2*im*x))]
    @test_int [log(a*sin(x)^n), x, 6, (1/2)*im*n*x^2 - n*x*log(1 - ℯ^(2*im*x)) + x*log(a*sin(x)^n) + (1/2)*im*n*PolyLog(2, ℯ^(2*im*x))]

    @test_int [log(a*cos(x)), x, 5, (im*x^2)/2 - x*log(1 + ℯ^(2*im*x)) + x*log(a*cos(x)) + (1/2)*im*PolyLog(2, -ℯ^(2*im*x))]
    @test_int [log(a*cos(x)^2), x, 6, im*x^2 - 2*x*log(1 + ℯ^(2*im*x)) + x*log(a*cos(x)^2) + im*PolyLog(2, -ℯ^(2*im*x))]
    @test_int [log(a*cos(x)^n), x, 6, (1/2)*im*n*x^2 - n*x*log(1 + ℯ^(2*im*x)) + x*log(a*cos(x)^n) + (1/2)*im*n*PolyLog(2, -ℯ^(2*im*x))]

    @test_int [log(a*tan(x)), x, 7, 2*x*atanh(ℯ^(2*im*x)) + x*log(a*tan(x)) - (1/2)*im*PolyLog(2, -ℯ^(2*im*x)) + (1/2)*im*PolyLog(2, ℯ^(2*im*x))]
    @test_int [log(a*tan(x)^2), x, 8, 4*x*atanh(ℯ^(2*im*x)) + x*log(a*tan(x)^2) - im*PolyLog(2, -ℯ^(2*im*x)) + im*PolyLog(2, ℯ^(2*im*x))]
    @test_int [log(a*tan(x)^n), x, 8, 2*n*x*atanh(ℯ^(2*im*x)) + x*log(a*tan(x)^n) - (1/2)*im*n*PolyLog(2, -ℯ^(2*im*x)) + (1/2)*im*n*PolyLog(2, ℯ^(2*im*x))]

    @test_int [log(a*cot(x)), x, 7, -2*x*atanh(ℯ^(2*im*x)) + x*log(a*cot(x)) + (1/2)*im*PolyLog(2, -ℯ^(2*im*x)) - (1/2)*im*PolyLog(2, ℯ^(2*im*x))]
    @test_int [log(a*cot(x)^2), x, 8, -4*x*atanh(ℯ^(2*im*x)) + x*log(a*cot(x)^2) + im*PolyLog(2, -ℯ^(2*im*x)) - im*PolyLog(2, ℯ^(2*im*x))]
    @test_int [log(a*cot(x)^n), x, 8, -2*n*x*atanh(ℯ^(2*im*x)) + x*log(a*cot(x)^n) + (1/2)*im*n*PolyLog(2, -ℯ^(2*im*x)) - (1/2)*im*n*PolyLog(2, ℯ^(2*im*x))]

    @test_int [log(a*sec(x)), x, 5, -((im*x^2)/2) + x*log(1 + ℯ^(2*im*x)) + x*log(a*sec(x)) - (1/2)*im*PolyLog(2, -ℯ^(2*im*x))]
    @test_int [log(a*sec(x)^2), x, 6, (-im)*x^2 + 2*x*log(1 + ℯ^(2*im*x)) + x*log(a*sec(x)^2) - im*PolyLog(2, -ℯ^(2*im*x))]
    @test_int [log(a*sec(x)^n), x, 6, (-(1/2))*im*n*x^2 + n*x*log(1 + ℯ^(2*im*x)) + x*log(a*sec(x)^n) - (1/2)*im*n*PolyLog(2, -ℯ^(2*im*x))]

    @test_int [log(a*csc(x)), x, 5, -((im*x^2)/2) + x*log(1 - ℯ^(2*im*x)) + x*log(a*csc(x)) - (1/2)*im*PolyLog(2, ℯ^(2*im*x))]
    @test_int [log(a*csc(x)^2), x, 6, (-im)*x^2 + 2*x*log(1 - ℯ^(2*im*x)) + x*log(a*csc(x)^2) - im*PolyLog(2, ℯ^(2*im*x))]
    @test_int [log(a*csc(x)^n), x, 6, (-(1/2))*im*n*x^2 + n*x*log(1 - ℯ^(2*im*x)) + x*log(a*csc(x)^n) - (1/2)*im*n*PolyLog(2, ℯ^(2*im*x))]

    @test_int [cos(x)*log((1 - cos(2*x))/2), x, 3, -2*sin(x) + log((1/2)*(1 - cos(2*x)))*sin(x)]
    @test_int [cot(x)/log(ℯ*sin(x)), x, 3, log(log(ℯ*sin(x))), log(1 + log(sin(x)))]
    @test_int [cot(x)/log(ℯ^sin(x)), x, 5, log(log(ℯ^sin(x)))/(-log(ℯ^sin(x)) + sin(x)) - log(sin(x))/(-log(ℯ^sin(x)) + sin(x))]
    @test_int [log(cos(x))*sec(x)^2, x, 3, -x + tan(x) + log(cos(x))*tan(x)]
    @test_int [cot(x)*log(sin(x)), x, 2, log(sin(x))^2/2]
    @test_int [cos(x)*log(sin(x))*sin(x)^2, x, 4, (-(1/9))*sin(x)^3 + (1/3)*log(sin(x))*sin(x)^3]
    @test_int [log(sin(a/2 + b*x/2)*cos(a/2 + b*x/2))*cos(a + b*x), x, 2, -(sin(a + b*x)/b) + (log(cos(a/2 + (b*x)/2)*sin(a/2 + (b*x)/2))*sin(a + b*x))/b]
    @test_int [tan(x)/log(cos(x)), x, 3, -log(log(cos(x)))]

    @test_int [log(cos(x))*tan(x), x, 2, -log(cos(x))^2/2]
    @test_int [log(cos(x))*sin(x), x, 2, cos(x) - cos(x)*log(cos(x))]
    @test_int [log(cos(x))*cos(x), x, 4, atanh(sin(x)) - sin(x) + log(cos(x))*sin(x)]

    @test_int [log(sin(x))*cos(x), x, 2, -sin(x) + log(sin(x))*sin(x)]
    @test_int [log(sin(x))*sin(x)^2, x, 10, x/4 + (im*x^2)/4 - (1/2)*x*log(1 - ℯ^(2*im*x)) + (1/2)*x*log(sin(x)) + (1/4)*im*PolyLog(2, ℯ^(2*im*x)) + (1/4)*cos(x)*sin(x) - (1/2)*cos(x)*log(sin(x))*sin(x)]
    @test_int [log(sin(x))*sin(x)^3, x, 7, (-(2/3))*atanh(cos(x)) + (2*cos(x))/3 - cos(x)^3/9 - cos(x)*log(sin(x)) + (1/3)*cos(x)^3*log(sin(x))]
    @test_int [log(sin(sqrt(x))), x, 8, (im/3)*x^(3/2) - x*log(1 - ℯ^((2*im)*sqrt(x))) + x*log(sin(sqrt(x))) + im*sqrt(x)*PolyLog(2, ℯ^((2*im)*sqrt(x))) - PolyLog(3, ℯ^((2*im)*sqrt(x)))/2]
    @test_int [log(sin(x))*csc(x)^2, x, 3, -x - cot(x) - cot(x)*log(sin(x))]

    #= ::Section::Closed:: =#
    #=Integrands*involving*logarithms*and*hyperbolic*functions=#

    #= ::Subsection::Closed:: =#
    #=Integrands*involving*products*of*logarithms*and*hyperbolic*functions=#

    @test_int [log(x)*sinh(a + b*x)^1, x, 5, -((cosh(a)*CoshIntegral(b*x))/b) + (cosh(a + b*x)*log(x))/b - (sinh(a)*SinhIntegral(b*x))/b]
    @test_int [log(x)*sinh(a + b*x)^2, x, 7, x/2 - (1/2)*x*log(x) - (CoshIntegral(2*b*x)*sinh(2*a))/(4*b) + (cosh(a + b*x)*log(x)*sinh(a + b*x))/(2*b) - (cosh(2*a)*SinhIntegral(2*b*x))/(4*b)]
    @test_int [log(x)*sinh(a + b*x)^3, x, 15, (3*cosh(a)*CoshIntegral(b*x))/(4*b) - (cosh(3*a)*CoshIntegral(3*b*x))/(12*b) - (cosh(a + b*x)*log(x))/b + (cosh(a + b*x)^3*log(x))/(3*b) + (3*sinh(a)*SinhIntegral(b*x))/(4*b) - (sinh(3*a)*SinhIntegral(3*b*x))/(12*b)]

    @test_int [log(x)*cosh(a + b*x)^1, x, 5, -((CoshIntegral(b*x)*sinh(a))/b) + (log(x)*sinh(a + b*x))/b - (cosh(a)*SinhIntegral(b*x))/b]
    @test_int [log(x)*cosh(a + b*x)^2, x, 7, -(x/2) + (1/2)*x*log(x) - (CoshIntegral(2*b*x)*sinh(2*a))/(4*b) + (cosh(a + b*x)*log(x)*sinh(a + b*x))/(2*b) - (cosh(2*a)*SinhIntegral(2*b*x))/(4*b)]
    @test_int [log(x)*cosh(a + b*x)^3, x, 15, -((3*CoshIntegral(b*x)*sinh(a))/(4*b)) - (CoshIntegral(3*b*x)*sinh(3*a))/(12*b) + (log(x)*sinh(a + b*x))/b + (log(x)*sinh(a + b*x)^3)/(3*b) - (3*cosh(a)*SinhIntegral(b*x))/(4*b) - (cosh(3*a)*SinhIntegral(3*b*x))/(12*b)]

    #= ::Subsection::Closed:: =#
    #=Integrands*involving*logarithms*of*hyperbolic*functions=#

    @test_int [log(a*sinh(x)), x, 5, x^2/2 - x*log(1 - ℯ^(2*x)) + x*log(a*sinh(x)) - (1/2)*PolyLog(2, ℯ^(2*x))]
    @test_int [log(a*sinh(x)^2), x, 6, x^2 - 2*x*log(1 - ℯ^(2*x)) + x*log(a*sinh(x)^2) - PolyLog(2, ℯ^(2*x))]
    @test_int [log(a*sinh(x)^n), x, 6, (n*x^2)/2 - n*x*log(1 - ℯ^(2*x)) + x*log(a*sinh(x)^n) - (1/2)*n*PolyLog(2, ℯ^(2*x))]

    @test_int [log(a*cosh(x)), x, 5, x^2/2 - x*log(1 + ℯ^(2*x)) + x*log(a*cosh(x)) - (1/2)*PolyLog(2, -ℯ^(2*x))]
    @test_int [log(a*cosh(x)^2), x, 6, x^2 - 2*x*log(1 + ℯ^(2*x)) + x*log(a*cosh(x)^2) - PolyLog(2, -ℯ^(2*x))]
    @test_int [log(a*cosh(x)^n), x, 6, (n*x^2)/2 - n*x*log(1 + ℯ^(2*x)) + x*log(a*cosh(x)^n) - (1/2)*n*PolyLog(2, -ℯ^(2*x))]

    @test_int [log(tanh(x)), x, 7, 2*x*atanh(ℯ^(2*x)) + x*log(tanh(x)) + (1/2)*PolyLog(2, -ℯ^(2*x)) - (1/2)*PolyLog(2, ℯ^(2*x))]
    @test_int [log(a*tanh(x)), x, 7, 2*x*atanh(ℯ^(2*x)) + x*log(a*tanh(x)) + (1/2)*PolyLog(2, -ℯ^(2*x)) - (1/2)*PolyLog(2, ℯ^(2*x))]
    @test_int [log(a*tanh(x)^2), x, 8, 4*x*atanh(ℯ^(2*x)) + x*log(a*tanh(x)^2) + PolyLog(2, -ℯ^(2*x)) - PolyLog(2, ℯ^(2*x))]
    @test_int [log(a*tanh(x)^n), x, 8, 2*n*x*atanh(ℯ^(2*x)) + x*log(a*tanh(x)^n) + (1/2)*n*PolyLog(2, -ℯ^(2*x)) - (1/2)*n*PolyLog(2, ℯ^(2*x))]

    @test_int [log(coth(x)), x, 7, -2*x*atanh(ℯ^(2*x)) + x*log(coth(x)) - (1/2)*PolyLog(2, -ℯ^(2*x)) + (1/2)*PolyLog(2, ℯ^(2*x))]
    @test_int [log(a*coth(x)), x, 7, -2*x*atanh(ℯ^(2*x)) + x*log(a*coth(x)) - (1/2)*PolyLog(2, -ℯ^(2*x)) + (1/2)*PolyLog(2, ℯ^(2*x))]
    @test_int [log(a*coth(x)^2), x, 8, -4*x*atanh(ℯ^(2*x)) + x*log(a*coth(x)^2) - PolyLog(2, -ℯ^(2*x)) + PolyLog(2, ℯ^(2*x))]
    @test_int [log(a*coth(x)^n), x, 8, -2*n*x*atanh(ℯ^(2*x)) + x*log(a*coth(x)^n) - (1/2)*n*PolyLog(2, -ℯ^(2*x)) + (1/2)*n*PolyLog(2, ℯ^(2*x))]

    @test_int [log(a*sech(x)), x, 5, -(x^2/2) + x*log(1 + ℯ^(2*x)) + x*log(a*sech(x)) + (1/2)*PolyLog(2, -ℯ^(2*x))]
    @test_int [log(a*sech(x)^2), x, 6, -x^2 + 2*x*log(1 + ℯ^(2*x)) + x*log(a*sech(x)^2) + PolyLog(2, -ℯ^(2*x))]
    @test_int [log(a*sech(x)^n), x, 6, -((n*x^2)/2) + n*x*log(1 + ℯ^(2*x)) + x*log(a*sech(x)^n) + (1/2)*n*PolyLog(2, -ℯ^(2*x))]

    @test_int [log(a*csch(x)), x, 5, -(x^2/2) + x*log(1 - ℯ^(2*x)) + x*log(a*csch(x)) + (1/2)*PolyLog(2, ℯ^(2*x))]
    @test_int [log(a*csch(x)^2), x, 6, -x^2 + 2*x*log(1 - ℯ^(2*x)) + x*log(a*csch(x)^2) + PolyLog(2, ℯ^(2*x))]
    @test_int [log(a*csch(x)^n), x, 6, -((n*x^2)/2) + n*x*log(1 - ℯ^(2*x)) + x*log(a*csch(x)^n) + (1/2)*n*PolyLog(2, ℯ^(2*x))]

    @test_int [log(sinh(a/2 + b*x/2)*cosh(a/2 + b*x/2))*cosh(a + b*x), x, 2, -(sinh(a + b*x)/b) + (log(cosh(a/2 + (b*x)/2)*sinh(a/2 + (b*x)/2))*sinh(a + b*x))/b]
    @test_int [log(cosh(x)^2)*sinh(x), x, 3, -2*cosh(x) + cosh(x)*log(cosh(x)^2)]

    #= ::Section::Closed:: =#
    #=Problems*from*Calculus*textbooks=#

    #= ::Subsection::Closed:: =#
    #=Anton*Calculus, 4th*Edition=#

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

    #= ::Subsection::Closed:: =#
    #=Edwards*and*Penney*Calculus=#

    @test_int [1/(x*sqrt(1 - log(x)^2)), x, 2, asin(log(x))]

    #= ::Subsection::Closed:: =#
    #=Thomas*Calculus, 8th*Edition=#

    @test_int [16*x^3*log(x)^2, x, 3, x^4/2 - 2*x^4*log(x) + 4*x^4*log(x)^2]
    @test_int [log(sqrt(a + b*x)), x, 2, -(x/2) + ((a + b*x)*log(sqrt(a + b*x)))/b]
    @test_int [x*log(sqrt(2 + x)), x, 3, x/2 - x^2/8 + (1/2)*x^2*log(sqrt(2 + x)) - log(2 + x)]
    @test_int [x*log((1 + 3*x)^(1/3)), x, 3, x/18 - x^2/12 + (1/2)*x^2*log((1 + 3*x)^(1/3)) - (1/54)*log(1 + 3*x)]
    @test_int [x*log(x + x^3), x, 4, -((3*x^2)/4) + (1/2)*log(1 + x^2) + (1/2)*x^2*log(x + x^3)]
    @test_int [log(x + sqrt(1 + x^2)), x, 2, -sqrt(1 + x^2) + x*log(x + sqrt(1 + x^2))]
    @test_int [log(x + sqrt(-1 + x^2)), x, 2, -sqrt(-1 + x^2) + x*log(x + sqrt(-1 + x^2))]
    @test_int [log(x - sqrt(-1 + x^2)), x, 2, sqrt(-1 + x^2) + x*log(x - sqrt(-1 + x^2))]
    @test_int [log(sqrt(x) + sqrt(1 + x)), x, 6, (-(1/2))*sqrt(x)*sqrt(1 + x) + asinh(sqrt(x))/2 + x*log(sqrt(x) + sqrt(1 + x))]

    #= ::Section::Closed:: =#
    #=Problems*from*integration*competitions=#

    #= ::Subsection::Closed:: =#
    #=MIT*Integration*Competition=#

    @test_int [x^(1/3)*log(x), x, 1, -((9*x^(4/3))/16) + (3/4)*x^(4/3)*log(x)]

    #= ::Subsection::Closed:: =#
    #=University*of*Wisconsin*Integration*Competition=#

    @test_int [2^log(x), x, 2, x^(1 + log(2))/(1 + log(2))]
    @test_int [(1 - log(x))/x^2, x, 1, log(x)/x]

    #= ::Section::Closed:: =#
    #=Miscellaneous*problems=#

    @test_int [log(1 + x + sqrt(1 + x)), x, 3, - x + sqrt(1 + x) + (1/2)*log(1 + x) + x*log(1 + x + sqrt(1 + x))]
    @test_int [log(x + x^3), x, 3, -3*x + 2*atan(x) + x*log(x + x^3)]
    @test_int [2^log(-8 + 7*x), x, 2, (-8 + 7*x)^(1 + log(2))/(7*(1 + log(2)))]
    @test_int [log((-11 + 5*x)/(5 + 76*x)), x, 2, (-(1/5))*(11 - 5*x)*log(-((11 - 5*x)/(5 + 76*x))) - (861/380)*log(5 + 76*x)]
    @test_int [log(1/(13 + x)), x, 2, x + (13 + x)*log((13 + x)^(-1))]
    @test_int [x*log((1 + x)/x^2), x, 4, x/2 + x^2/4 - (1/2)*log(1 + x) + (1/2)*x^2*log((1 + x)/x^2)]
    @test_int [x^3*log((7 + 5*x)/x^2), x, 4, (343*x)/500 - (49*x^2)/200 + (7*x^3)/60 + x^4/16 - (2401*log(7 + 5*x))/2500 + (1/4)*x^4*log((7 + 5*x)/x^2)]
    #= [x^3*log(d + c*x)^4, x, 89, (c*x*(-70140*d^3 + 5190*c*d^2*x - 700*c^2*d*x^2 + 81*c^3*x^3) + 12*(5845*d^4 + 4980*c*d^3*x - 690*c^2*d^2*x^2 + 148*c^3*d*x^3 - 27*c^4*x^4)*log(d + c*x) - 72*(415*d^4 + 300*c*d^3*x - 78*c^2*d^2*x^2 + 28*c^3*d*x^3 - 9*c^4*x^4)*log(d + c*x)^2 + 288*(25*d^4 + 12*c*d^3*x - 6*c^2*d^2*x^2 + 4*c^3*d*x^3 - 3*c^4*x^4)*log(d + c*x)^3 - 864*(d^4 - c^4*x^4)*log(d + c*x)^4)/(3456*c^4)] =#

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

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

    @test_int [1/(a*x + b*x/log(c*x^n)), x, 3, log(x)/a - (b*log(b + a*log(c*x^n)))/(a^2*n)]
    @test_int [1/(a*x + b*x/log(c*x^n)^2), x, 3, -((sqrt(b)*atan((sqrt(a)*log(c*x^n))/sqrt(b)))/(a^(3/2)*n)) + log(x)/a]
    @test_int [1/(a*x + b*x/log(c*x^n)^3), x, 8, (b^(1/3)*atan((b^(1/3) - 2*a^(1/3)*log(c*x^n))/(sqrt(3)*b^(1/3))))/(sqrt(3)*a^(4/3)*n) + log(x)/a - (b^(1/3)*log(b^(1/3) + a^(1/3)*log(c*x^n)))/(3*a^(4/3)*n) + (b^(1/3)*log(b^(2/3) - a^(1/3)*b^(1/3)*log(c*x^n) + a^(2/3)*log(c*x^n)^2))/(6*a^(4/3)*n)]
    @test_int [1/(a*x + b*x/log(c*x^n)^4), x, 11, (b^(1/4)*atan(1 - (sqrt(2)*a^(1/4)*log(c*x^n))/b^(1/4)))/(2*sqrt(2)*a^(5/4)*n) - (b^(1/4)*atan(1 + (sqrt(2)*a^(1/4)*log(c*x^n))/b^(1/4)))/(2*sqrt(2)*a^(5/4)*n) + log(x)/a + (b^(1/4)*log(sqrt(b) - sqrt(2)*a^(1/4)*b^(1/4)*log(c*x^n) + sqrt(a)*log(c*x^n)^2))/(4*sqrt(2)*a^(5/4)*n) - (b^(1/4)*log(sqrt(b) + sqrt(2)*a^(1/4)*b^(1/4)*log(c*x^n) + sqrt(a)*log(c*x^n)^2))/(4*sqrt(2)*a^(5/4)*n)]

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

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

    @test_int [log(1/x)^2/x^5, x, 2, -(1/(32*x^4)) + log(1/x)/(8*x^4) - log(1/x)^2/(4*x^4)]

    @test_int [1/sqrt(-log(a*x^2)), x, 3, -((sqrt(pi/2)*x*erf(sqrt(-log(a*x^2))/sqrt(2)))/sqrt(a*x^2))]
    @test_int [1/sqrt(-log(a/x^2)), x, 3, sqrt(pi/2)*sqrt(a/x^2)*x*erfi(sqrt(-log(a/x^2))/sqrt(2))]
    @test_int [1/sqrt(-log(a*x^n)), x, 3, -((sqrt(pi)*x*erf(sqrt(-log(a*x^n))/sqrt(n)))/(sqrt(n)*(a*x^n)^n^(-1)))]

    @test_int [log(1 + sqrt(x) - x)/x, x, 8, -2*log((1/2)*(1 + sqrt(5)))*log(1 + sqrt(5) - 2*sqrt(x)) - 2*log(1 - (2*sqrt(x))/(1 - sqrt(5)))*log(sqrt(x)) + 2*log(1 + sqrt(x) - x)*log(sqrt(x)) + 2*PolyLog(2, 1 - (2*sqrt(x))/(1 + sqrt(5))) - 2*PolyLog(2, (2*sqrt(x))/(1 - sqrt(5)))]

    @test_int [(x*log(c + d*x))/(a + b*x), x, 7, -(x/b) + ((c + d*x)*log(c + d*x))/(b*d) - (a*log(-((d*(a + b*x))/(b*c - a*d)))*log(c + d*x))/b^2 - (a*PolyLog(2, (b*(c + d*x))/(b*c - a*d)))/b^2]
    @test_int [log(x)/(-1 + x), x, 1, -PolyLog(2, 1 - x)]
    @test_int [(x*log(1 - a - b*x))/(a + b*x), x, 6, -(x/b) - ((1 - a - b*x)*log(1 - a - b*x))/b^2 + (a*PolyLog(2, a + b*x))/b^2]
    @test_int [((b + 2*c*x)*log(x))/(x*(b + c*x)), x, 5, log(x)^2/2 + log(x)*log(1 + (c*x)/b) + PolyLog(2, -((c*x)/b))]

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

    @test_int [log((1 - x^2)/(1 + x^2))/(1 + x)^2, x, 8, -(1/(1 + x)) - atan(x) + (1/2)*log(1 - x^2) - log((1 - x^2)/(1 + x^2))/(1 + x) - (1/2)*log(1 + x^2)]

    @test_int [log(c*(1 + x^2)^n)/(1 + x^2), x, 5, im*n*atan(x)^2 + 2*n*atan(x)*log(2/(1 + im*x)) + atan(x)*log(c*(1 + x^2)^n) + im*n*PolyLog(2, 1 - 2/(1 + im*x))]
    @test_int [log(x^2/(1 + x^2))/(1 + x^2), x, 5, im*atan(x)^2 - 2*atan(x)*log(2 - 2/(1 - im*x)) + atan(x)*log(x^2/(1 + x^2)) + im*PolyLog(2, -1 + 2/(1 - im*x))]
    @test_int [log(c*x^2/(a + b*x^2))/(a + b*x^2), x, 5, (im*atan((sqrt(b)*x)/sqrt(a))^2)/(sqrt(a)*sqrt(b)) + (atan((sqrt(b)*x)/sqrt(a))*log((c*x^2)/(a + b*x^2)))/(sqrt(a)*sqrt(b)) - (2*atan((sqrt(b)*x)/sqrt(a))*log(2 - (2*sqrt(a))/(sqrt(a) - im*sqrt(b)*x)))/(sqrt(a)*sqrt(b)) + (im*PolyLog(2, -1 + (2*sqrt(a))/(sqrt(a) - im*sqrt(b)*x)))/(sqrt(a)*sqrt(b))]

    @test_int [log(1 + (im*sqrt(1 - a*x))/sqrt(1 + a*x))/(1 - a^2*x^2), x, 1, PolyLog(2, -((im*sqrt(1 - a*x))/sqrt(1 + a*x)))/a]
    @test_int [log(1 - (im*sqrt(1 - a*x))/sqrt(1 + a*x))/(1 - a^2*x^2), x, 1, PolyLog(2, (im*sqrt(1 - a*x))/sqrt(1 + a*x))/a]

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

    @test_int [ℯ^x*log(a + b*ℯ^x), x, 5, -ℯ^x + ((a + b*ℯ^x)*log(a + b*ℯ^x))/b, -ℯ^x + (a*log(a + b*ℯ^x))/b + ℯ^x*log(a + b*ℯ^x)]

    @test_int [log(x)*ℯ^(a + b*x), x, 3, -((ℯ^a*ExpIntegralEi(b*x))/b) + (ℯ^(a + b*x)*log(x))/b]

    #= Attempted*expansion*of*these*integrands*can*lead*to*infinite*recursion! =#
    @test_int [x^2/(x + log(x)), x, 0, CannotIntegrate(x^2/(x + log(x)), x)]
    @test_int [x^1/(x + log(x)), x, 0, CannotIntegrate(x/(x + log(x)), x)]
    @test_int [x^0/(x + log(x)), x, 0, CannotIntegrate(1/(x + log(x)), x)]
    @test_int [1/(x^1*(x + log(x))), x, 0, CannotIntegrate(1/(x*(x + log(x))), x)]
    @test_int [1/(x^2*(x + log(x))), x, 0, CannotIntegrate(1/(x^2*(x + log(x))), x)]

    @test_int [log(x)/(x + 4*x*log(x)^2), x, 2, log(1 + 4*log(x)^2)/8]

    @test_int [(1 - log(x))/(x*(x + log(x))), x, 2, log(1 + log(x)/x)]
    @test_int [(1 + x)/(log(x)*(x + log(x))), x, 8, log(log(x)) - log(x + log(x)) + LogIntegral(x)]

    @test_int [log(sqrt((x + 1)/x) + 2), x, 5, (-(1/6))*log(1 - sqrt(1 + 1/x)) + (1/2)*log(1 + sqrt(1 + 1/x)) - (1/3)*log(2 + sqrt(1 + 1/x)) + x*log(2 + sqrt((1 + x)/x))]
    @test_int [log(sqrt((x + 1)/x) + 1), x, 6, -(1/(2*(1 + sqrt(1 + 1/x)))) + (1/2)*atanh(sqrt((1 + x)/x)) + x*log(1 + sqrt((1 + x)/x))]
    @test_int [log(sqrt((x + 1)/x) + 0), x, 4, x*log(sqrt(1 + 1/x)) + (1/2)*log(1 + x)]
    @test_int [log(sqrt((x + 1)/x) - 1), x, 5, -(1/(2*(1 - sqrt(1 + 1/x)))) - (1/2)*atanh(sqrt(1 + 1/x)) + x*log(-1 + sqrt((1 + x)/x))]
    @test_int [log(sqrt((x + 1)/x) - 2), x, If(13>=8, 7, 4), (1/2)*log(1 - sqrt(1 + 1/x)) - (1/3)*log(2 - sqrt(1 + 1/x)) - (1/6)*log(1 + sqrt(1 + 1/x)) + x*log(-2 + sqrt((1 + x)/x))]

    #= Contributed*by*Oleg*Marichev*of*Wolfram*Research*Inc. =#
    @test_int [x^(a*x) + x^(a*x)*log(x), x, 2, x^(a*x)/a]

    @test_int [(log(x)^m)^p, x, 3, (Gamma(1 + m*p, -log(x))*(log(x)^m)^p)/(-log(x))^(m*p)]

    #= [log(a + b*x + c*sqrt(d + e*x))/(f + g*x^2), x, 44, (log((g^(1/4)*(c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2) + 2*b*sqrt(d + e*x)))/(2*b*sqrt((-e)*sqrt(-f) + d*sqrt(g)) + (c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))*log(sqrt((-e)*sqrt(-f) + d*sqrt(g)) - g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) + (log((g^(1/4)*(c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2) + 2*b*sqrt(d + e*x)))/(2*b*sqrt((-e)*sqrt(-f) + d*sqrt(g)) + (c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))*log(sqrt((-e)*sqrt(-f) + d*sqrt(g)) - g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) - (log(a + b*x + c*sqrt(d + e*x))*log(sqrt((-e)*sqrt(-f) + d*sqrt(g)) - g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) - (log((g^(1/4)*(c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2) + 2*b*sqrt(d + e*x)))/(2*b*sqrt(e*sqrt(-f) + d*sqrt(g)) + (c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))*log(sqrt(e*sqrt(-f) + d*sqrt(g)) - g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) - (log((g^(1/4)*(c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2) + 2*b*sqrt(d + e*x)))/(2*b*sqrt(e*sqrt(-f) + d*sqrt(g)) + (c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))*log(sqrt(e*sqrt(-f) + d*sqrt(g)) - g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) + (log(a + b*x + c*sqrt(d + e*x))*log(sqrt(e*sqrt(-f) + d*sqrt(g)) - g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) + (log(-((g^(1/4)*(c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2) + 2*b*sqrt(d + e*x)))/(2*b*sqrt((-e)*sqrt(-f) + d*sqrt(g)) - (c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4))))*log(sqrt((-e)*sqrt(-f) + d*sqrt(g)) + g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) + (log(-((g^(1/4)*(c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2) + 2*b*sqrt(d + e*x)))/(2*b*sqrt((-e)*sqrt(-f) + d*sqrt(g)) - (c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4))))*log(sqrt((-e)*sqrt(-f) + d*sqrt(g)) + g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) - (log(a + b*x + c*sqrt(d + e*x))*log(sqrt((-e)*sqrt(-f) + d*sqrt(g)) + g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) - (log(-((g^(1/4)*(c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2) + 2*b*sqrt(d + e*x)))/(2*b*sqrt(e*sqrt(-f) + d*sqrt(g)) - (c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4))))*log(sqrt(e*sqrt(-f) + d*sqrt(g)) + g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) - (log(-((g^(1/4)*(c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2) + 2*b*sqrt(d + e*x)))/(2*b*sqrt(e*sqrt(-f) + d*sqrt(g)) - (c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4))))*log(sqrt(e*sqrt(-f) + d*sqrt(g)) + g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) + (log(a + b*x + c*sqrt(d + e*x))*log(sqrt(e*sqrt(-f) + d*sqrt(g)) + g^(1/4)*sqrt(d + e*x)))/(2*sqrt(-f)*sqrt(g)) + PolyLog(2, (2*b*(sqrt((-e)*sqrt(-f) + d*sqrt(g)) - g^(1/4)*sqrt(d + e*x)))/(2*b*sqrt((-e)*sqrt(-f) + d*sqrt(g)) + (c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))/(2*sqrt(-f)*sqrt(g)) + PolyLog(2, (2*b*(sqrt((-e)*sqrt(-f) + d*sqrt(g)) - g^(1/4)*sqrt(d + e*x)))/(2*b*sqrt((-e)*sqrt(-f) + d*sqrt(g)) + (c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))/(2*sqrt(-f)*sqrt(g)) - PolyLog(2, (2*b*(sqrt(e*sqrt(-f) + d*sqrt(g)) - g^(1/4)*sqrt(d + e*x)))/(2*b*sqrt(e*sqrt(-f) + d*sqrt(g)) + (c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))/(2*sqrt(-f)*sqrt(g)) - PolyLog(2, (2*b*(sqrt(e*sqrt(-f) + d*sqrt(g)) - g^(1/4)*sqrt(d + e*x)))/(2*b*sqrt(e*sqrt(-f) + d*sqrt(g)) + (c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))/(2*sqrt(-f)*sqrt(g)) + PolyLog(2, (2*b*(sqrt((-e)*sqrt(-f) + d*sqrt(g)) + g^(1/4)*sqrt(d + e*x)))/(2*b*sqrt((-e)*sqrt(-f) + d*sqrt(g)) - (c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))/(2*sqrt(-f)*sqrt(g)) + PolyLog(2, (2*b*(sqrt((-e)*sqrt(-f) + d*sqrt(g)) + g^(1/4)*sqrt(d + e*x)))/(2*b*sqrt((-e)*sqrt(-f) + d*sqrt(g)) - (c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))/(2*sqrt(-f)*sqrt(g)) - PolyLog(2, (2*b*(sqrt(e*sqrt(-f) + d*sqrt(g)) + g^(1/4)*sqrt(d + e*x)))/(2*b*sqrt(e*sqrt(-f) + d*sqrt(g)) - (c*e - sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))/(2*sqrt(-f)*sqrt(g)) - PolyLog(2, (2*b*(sqrt(e*sqrt(-f) + d*sqrt(g)) + g^(1/4)*sqrt(d + e*x)))/(2*b*sqrt(e*sqrt(-f) + d*sqrt(g)) - (c*e + sqrt(4*b^2*d - 4*a*b*e + c^2*e^2))*g^(1/4)))/(2*sqrt(-f)*sqrt(g))] =#

    @test_int [log(x)/sqrt(a + b*log(x)), x, 4, -(((2*a + b)*sqrt(pi)*erfi(sqrt(a + b*log(x))/sqrt(b)))/(ℯ^(a/b)*(2*b^(3/2)))) + (x*sqrt(a + b*log(x)))/b]
    @test_int [log(x)/sqrt(a - b*log(x)), x, 4, -(((2*a - b)*ℯ^(a/b)*sqrt(pi)*erf(sqrt(a - b*log(x))/sqrt(b)))/(2*b^(3/2))) - (x*sqrt(a - b*log(x)))/b]

    @test_int [(A + B*log(x))/sqrt(a + b*log(x)), x, 4, ((2*A*b - (2*a + b)*B)*sqrt(pi)*erfi(sqrt(a + b*log(x))/sqrt(b)))/(ℯ^(a/b)*(2*b^(3/2))) + (B*x*sqrt(a + b*log(x)))/b]
    @test_int [(A + B*log(x))/sqrt(a - b*log(x)), x, 4, -(((2*A*b + 2*a*B - b*B)*ℯ^(a/b)*sqrt(pi)*erf(sqrt(a - b*log(x))/sqrt(b)))/(2*b^(3/2))) - (B*x*sqrt(a - b*log(x)))/b]

    @test_int [x^2*log(log(x)*sin(x)), x, 13, (im*x^4)/12 - (1/3)*ExpIntegralEi(3*log(x)) - (1/3)*x^3*log(1 - ℯ^(2*im*x)) + (1/3)*x^3*log(log(x)*sin(x)) + (1/2)*im*x^2*PolyLog(2, ℯ^(2*im*x)) - (1/2)*x*PolyLog(3, ℯ^(2*im*x)) - (1/4)*im*PolyLog(4, ℯ^(2*im*x))]
    @test_int [x^1*log(log(x)*sin(x)), x, 12, (im*x^3)/6 - (1/2)*ExpIntegralEi(2*log(x)) - (1/2)*x^2*log(1 - ℯ^(2*im*x)) + (1/2)*x^2*log(log(x)*sin(x)) + (1/2)*im*x*PolyLog(2, ℯ^(2*im*x)) - (1/4)*PolyLog(3, ℯ^(2*im*x))]
    @test_int [x^0*log(log(x)*sin(x)), x, 7, (im*x^2)/2 - x*log(1 - ℯ^(2*im*x)) + x*log(log(x)*sin(x)) - LogIntegral(x) + (1/2)*im*PolyLog(2, ℯ^(2*im*x))]
    @test_int [log(log(x)*sin(x))/x^1, x, 0, CannotIntegrate(log(log(x)*sin(x))/x, x)]
    @test_int [log(log(x)*sin(x))/x^2, x, 5, ExpIntegralEi(-log(x)) - log(log(x)*sin(x))/x + Unintegrable(cot(x)/x, x)]

    @test_int [x^2*log(ℯ^x*log(x)*sin(x)), x, 14, (-(1/12) + im/12)*x^4 - (1/3)*ExpIntegralEi(3*log(x)) - (1/3)*x^3*log(1 - ℯ^(2*im*x)) + (1/3)*x^3*log(ℯ^x*log(x)*sin(x)) + (1/2)*im*x^2*PolyLog(2, ℯ^(2*im*x)) - (1/2)*x*PolyLog(3, ℯ^(2*im*x)) - (1/4)*im*PolyLog(4, ℯ^(2*im*x))]
    @test_int [x^1*log(ℯ^x*log(x)*sin(x)), x, 13, (-(1/6) + im/6)*x^3 - (1/2)*ExpIntegralEi(2*log(x)) - (1/2)*x^2*log(1 - ℯ^(2*im*x)) + (1/2)*x^2*log(ℯ^x*log(x)*sin(x)) + (1/2)*im*x*PolyLog(2, ℯ^(2*im*x)) - (1/4)*PolyLog(3, ℯ^(2*im*x))]
    @test_int [x^0*log(ℯ^x*log(x)*sin(x)), x, 7, (-(1/2) + im/2)*x^2 - x*log(1 - ℯ^(2*im*x)) + x*log(ℯ^x*log(x)*sin(x)) - LogIntegral(x) + (1/2)*im*PolyLog(2, ℯ^(2*im*x))]
    @test_int [log(ℯ^x*log(x)*sin(x))/x^1, x, 0, CannotIntegrate(log(ℯ^x*log(x)*sin(x))/x, x)]
    @test_int [log(ℯ^x*log(x)*sin(x))/x^2, x, 7, ExpIntegralEi(-log(x)) + log(x) - log(ℯ^x*log(x)*sin(x))/x + Unintegrable(cot(x)/x, x)]
    end

ext: jl

max_stars_repo_path: test/3 Logarithms/3.5 Logarithm functions.jl


text:
using OrdinaryDiffEq
using Trixi

###############################################################################
# semidiscretization of the shallow water equations

equations = ShallowWaterEquations2D(gravity_constant=9.81)

initial_condition = initial_condition_convergence_test

volume_flux = (flux_wintermeyer_etal, flux_nonconservative_wintermeyer_etal)
surface_flux = (flux_lax_friedrichs, flux_nonconservative_fjordholm_etal)
dg = DGMulti(polydeg=3, element_type = Quad(), approximation_type = SBP(),
             surface_integral = SurfaceIntegralWeakForm(surface_flux),
             volume_integral = VolumeIntegralFluxDifferencing(volume_flux))

cells_per_dimension = 8
vertex_coordinates, EToV = StartUpDG.uniform_mesh(dg.basis.elementType, cells_per_dimension)
vertex_coordinates = map(x -> sqrt(2) .* 0.5 .* (1 .+ x), vertex_coordinates) # map domain to [0, sqrt(2)]^2
mesh = VertexMappedMesh(vertex_coordinates, EToV, dg, is_periodic=(true, true))

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, dg;
                                    source_terms=source_terms_convergence_test)

###############################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 0.4)
ode = semidiscretize(semi, tspan)

summary_callback = SummaryCallback()

analysis_interval = 100
analysis_callback = AnalysisCallback(semi, interval=analysis_interval, uEltype=real(dg))
alive_callback = AliveCallback(analysis_interval=analysis_interval)

callbacks = CallbackSet(summary_callback,
                        analysis_callback,
                        alive_callback)

###############################################################################
# run the simulation

sol = solve(ode, RDPK3SpFSAL49(), abstol=1.0e-7, reltol=1.0e-7,
            save_everystep=false, callback=callbacks);

summary_callback() # print the timer summary


text:
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: iotsecuretunneling
using AWS.Compat
using AWS.UUIDs

"""
    close_tunnel(tunnel_id)
    close_tunnel(tunnel_id, params::Dict{String,<:Any})

Closes a tunnel identified by the unique tunnel id. When a CloseTunnel request is received,
we close the WebSocket connections between the client and proxy server so no data can be
transmitted.

# Arguments
- `tunnel_id`: The ID of the tunnel to close.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"delete"`: When set to true, AWS IoT Secure Tunneling deletes the tunnel data
  immediately.
"""
close_tunnel(tunnelId; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("CloseTunnel", Dict{String, Any}("tunnelId"=>tunnelId); aws_config=aws_config)
close_tunnel(tunnelId, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("CloseTunnel", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("tunnelId"=>tunnelId), params)); aws_config=aws_config)

"""
    describe_tunnel(tunnel_id)
    describe_tunnel(tunnel_id, params::Dict{String,<:Any})

Gets information about a tunnel identified by the unique tunnel id.

# Arguments
- `tunnel_id`: The tunnel to describe.

"""
describe_tunnel(tunnelId; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("DescribeTunnel", Dict{String, Any}("tunnelId"=>tunnelId); aws_config=aws_config)
describe_tunnel(tunnelId, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("DescribeTunnel", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("tunnelId"=>tunnelId), params)); aws_config=aws_config)

"""
    list_tags_for_resource(resource_arn)
    list_tags_for_resource(resource_arn, params::Dict{String,<:Any})

Lists the tags for the specified resource.

# Arguments
- `resource_arn`: The resource ARN.

"""
list_tags_for_resource(resourceArn; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("ListTagsForResource", Dict{String, Any}("resourceArn"=>resourceArn); aws_config=aws_config)
list_tags_for_resource(resourceArn, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("ListTagsForResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("resourceArn"=>resourceArn), params)); aws_config=aws_config)

"""
    list_tunnels()
    list_tunnels(params::Dict{String,<:Any})

List all tunnels for an AWS account. Tunnels are listed by creation time in descending
order, newer tunnels will be listed before older tunnels.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The maximum number of results to return at once.
- `"nextToken"`: A token to retrieve the next set of results.
- `"thingName"`: The name of the IoT thing associated with the destination device.
"""
list_tunnels(; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("ListTunnels"; aws_config=aws_config)
list_tunnels(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("ListTunnels", params; aws_config=aws_config)

"""
    open_tunnel()
    open_tunnel(params::Dict{String,<:Any})

Creates a new tunnel, and returns two client access tokens for clients to use to connect to
the AWS IoT Secure Tunneling proxy server.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"description"`: A short text description of the tunnel.
- `"destinationConfig"`: The destination configuration for the OpenTunnel request.
- `"tags"`: A collection of tag metadata.
- `"timeoutConfig"`: Timeout configuration for a tunnel.
"""
open_tunnel(; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("OpenTunnel"; aws_config=aws_config)
open_tunnel(params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("OpenTunnel", params; aws_config=aws_config)

"""
    tag_resource(resource_arn, tags)
    tag_resource(resource_arn, tags, params::Dict{String,<:Any})

A resource tag.

# Arguments
- `resource_arn`: The ARN of the resource.
- `tags`: The tags for the resource.

"""
tag_resource(resourceArn, tags; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("TagResource", Dict{String, Any}("resourceArn"=>resourceArn, "tags"=>tags); aws_config=aws_config)
tag_resource(resourceArn, tags, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("TagResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("resourceArn"=>resourceArn, "tags"=>tags), params)); aws_config=aws_config)

"""
    untag_resource(resource_arn, tag_keys)
    untag_resource(resource_arn, tag_keys, params::Dict{String,<:Any})

Removes a tag from a resource.

# Arguments
- `resource_arn`: The resource ARN.
- `tag_keys`: The keys of the tags to remove.

"""
untag_resource(resourceArn, tagKeys; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("UntagResource", Dict{String, Any}("resourceArn"=>resourceArn, "tagKeys"=>tagKeys); aws_config=aws_config)
untag_resource(resourceArn, tagKeys, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()) = iotsecuretunneling("UntagResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("resourceArn"=>resourceArn, "tagKeys"=>tagKeys), params)); aws_config=aws_config)


text:
using JuMP, EAGO

                     m = Model()

                     EAGO.register_eago_operators!(m)

                     @variable(m, -1 <= x[i=1:2] <= 1)

                     @variable(m, -5.483106975000851 <= q <= 6.193029789058127)

                     add_NL_constraint(m, :(sigmoid(0.7547513043737739 + -0.48113681936364117*sigmoid(-0.10262045764995253 + -0.12743000480166566*sigmoid(0.5778005478095731 + 0.8852363638482865*sigmoid(0.4643971142728849 + -0.24024828850470392*$(x[1]) + -0.4967453535429427*$(x[2])) + -0.8793054881197468*sigmoid(-0.24055139829732441 + -0.12659057285603792*$(x[1]) + -0.42759160850418754*$(x[2]))) + -0.1298782680512347*sigmoid(0.07154777431849713 + -0.5862593464659436*sigmoid(0.4643971142728849 + -0.24024828850470392*$(x[1]) + -0.4967453535429427*$(x[2])) + 0.9939436563912345*sigmoid(-0.24055139829732441 + -0.12659057285603792*$(x[1]) + -0.42759160850418754*$(x[2])))) + -0.9820460002458025*sigmoid(0.1263157800600383 + 0.1285425867505281*sigmoid(0.5778005478095731 + 0.8852363638482865*sigmoid(0.4643971142728849 + -0.24024828850470392*$(x[1]) + -0.4967453535429427*$(x[2])) + -0.8793054881197468*sigmoid(-0.24055139829732441 + -0.12659057285603792*$(x[1]) + -0.42759160850418754*$(x[2]))) + -0.6128023058992138*sigmoid(0.07154777431849713 + -0.5862593464659436*sigmoid(0.4643971142728849 + -0.24024828850470392*$(x[1]) + -0.4967453535429427*$(x[2])) + 0.9939436563912345*sigmoid(-0.24055139829732441 + -0.12659057285603792*$(x[1]) + -0.42759160850418754*$(x[2]))))) + sigmoid(-0.6861294460251406 + 0.36167652828680286*sigmoid(-0.10262045764995253 + -0.12743000480166566*sigmoid(0.5778005478095731 + 0.8852363638482865*sigmoid(0.4643971142728849 + -0.24024828850470392*$(x[1]) + -0.4967453535429427*$(x[2])) + -0.8793054881197468*sigmoid(-0.24055139829732441 + -0.12659057285603792*$(x[1]) + -0.42759160850418754*$(x[2]))) + -0.1298782680512347*sigmoid(0.07154777431849713 + -0.5862593464659436*sigmoid(0.4643971142728849 + -0.24024828850470392*$(x[1]) + -0.4967453535429427*$(x[2])) + 0.9939436563912345*sigmoid(-0.24055139829732441 + -0.12659057285603792*$(x[1]) + -0.42759160850418754*$(x[2])))) + -0.5440699588803759*sigmoid(0.1263157800600383 + 0.1285425867505281*sigmoid(0.5778005478095731 + 0.8852363638482865*sigmoid(0.4643971142728849 + -0.24024828850470392*$(x[1]) + -0.4967453535429427*$(x[2])) + -0.8793054881197468*sigmoid(-0.24055139829732441 + -0.12659057285603792*$(x[1]) + -0.42759160850418754*$(x[2]))) + -0.6128023058992138*sigmoid(0.07154777431849713 + -0.5862593464659436*sigmoid(0.4643971142728849 + -0.24024828850470392*$(x[1]) + -0.4967453535429427*$(x[2])) + 0.9939436563912345*sigmoid(-0.24055139829732441 + -0.12659057285603792*$(x[1]) + -0.42759160850418754*$(x[2]))))) - $q <= 0.0))

                     @objective(m, Min, q)

                     return m

max_stars_repo_name: PSORLab/RSActivationFunctions

max_issues_repo_name: PSORLab/RSActivationFunctions

max_forks_repo_name: PSORLab/RSActivationFunctions


text:
# Autogenerated wrapper script for Graphene_jll for armv7l-linux-musleabihf
export libgraphene

using Glib_jll
JLLWrappers.@generate_wrapper_header("Graphene")
JLLWrappers.@declare_library_product(libgraphene, "libgraphene-1.0.so.0")
function __init__()
    JLLWrappers.@generate_init_header(Glib_jll)
    JLLWrappers.@init_library_product(
        libgraphene,
        "lib/libgraphene-1.0.so",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@generate_init_footer()
end  # __init__()


text:
const default_kwargs = Dict{Symbol, Any}()

"""
    set_default(; kwargs...)

Set default kwarg values for latexify.

This works for all keyword arguments except `:env`. It is additive such that if
you call it multiple times, defaults will be added or replaced, but not reset.

Example:
```julia
set_default(cdot = false, transpose = true)
```

To reset the defaults that you have set, use `reset_default`.
To see your specified defaults, use `get_default`.
"""
function set_default(; kwargs...)
    for key in keys(kwargs)
        default_kwargs[key] = kwargs[key]
    end
end

"""
    reset_default()

Reset user-specified default kwargs for latexify, set by `set_default`.
"""
reset_default() = empty!(default_kwargs)

"""
    get_default

Get a Dict with the user-specified default kwargs for latexify, set by `set_default`.
"""
function get_default end
get_default() = default_kwargs
get_default(arg::Symbol) = default_kwargs[arg]
get_default(args::AbstractArray) =  map(x->default_kwargs[x], args)
get_default(args...) = Tuple(get_default(arg) for arg in args)


text:
#############################################################
#
# General Functions
#
#############################################################

#Function that builds global variable to hold authentication keys
#TODO: Figure out how to do OAuth authentication directly, rather than user putting in credentials directly
function twitterauth(consumer_key::AbstractString, consumer_secret::AbstractString, oauth_token::AbstractString, oauth_secret::AbstractString)
    #Create a global variable to hold return from this function
    global twittercred

    return twittercred = TWCRED(consumer_key, consumer_secret, oauth_token, oauth_secret)

end

#General function for OAuth authenticated GET request
function get_oauth(endpoint::AbstractString, options::Dict)

    oauth_request_resource(endpoint, "GET", options, twittercred.consumer_key, twittercred.consumer_secret, twittercred.oauth_token, twittercred.oauth_secret)

end

#General function for OAuth authenticated POST request
function post_oauth(endpoint::AbstractString, options::Dict)

    oauth_request_resource(endpoint, "POST", options, twittercred.consumer_key, twittercred.consumer_secret, twittercred.oauth_token, twittercred.oauth_secret)

end


text:
function renormalizeTrotter!{T}(simulator::Quantum2dFractalInititerSimulator{T}, dimM::Int)
	lattice = simulator.lattice
	tensorT, tensorTtilde = getTensorT(lattice)
 	tensorPx = getTensorP(lattice,1)
 	tensorPy = getTensorP(lattice,2)
 	tensorQ = getTensorQ(lattice)

 	if isodd(getTrotterCount(simulator))
 		whichisT = 1
		tensorT1 = tensorT
		tensorT2 = tensorTtilde
	else
 		whichisT = 2
		tensorT2 = tensorT
		tensorT1 = tensorTtilde
 	end

	nextTensorT, nextTensorTtilde, projectorUx, projectorUy = renormalizeTensorT_trotter(tensorT1, tensorT2, dimM , whichIsTensorT = whichisT)
	nextTensorTtilde = symmetrizeTensorTrotter(nextTensorTtilde)
 	nextTensorPy = renormalizeTensorPy_trotter(tensorPy, projectorUx, projectorUy, dimM)
 	nextTensorPx = renormalizeTensorPx_trotter(tensorPx, projectorUx, projectorUy, dimM)
 	nextTensorQ = renormalizeTensorQ_trotter(tensorQ, projectorUx, projectorUy, dimM)

	setTensorT!(lattice, nextTensorT)
	setTensorT!(lattice, nextTensorTtilde; tilde = true)
 	setTensorP!(lattice, 1, nextTensorPx)
 	setTensorP!(lattice, 2, nextTensorPy)
 	setTensorQ!(lattice, nextTensorQ)

end

#---------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------
function renormalizeSpace!{T}(simulator::Quantum2dFractalInititerSimulator{T}, dimM::Int)
	lattice = simulator.lattice
	tensorT, tensorTtilde = getTensorT(lattice)
	# println(traceTensorTPeriodic(tensorTtilde), " over ", traceTensorTPeriodic(tensorT)) ###debug
	tensorPx = getTensorP(lattice,1)
	tensorQ = getTensorQ(lattice)

	tensorCore, tensorCoretilde, tensorUy =
	calculateCoreTensors(tensorT, tensorTtilde, dimM)
	tensorCore, normC = normalizeTensor(tensorCore)
	tensorCoretilde = tensorCoretilde ./ normC
	setNorm!(simulator, normC, getIndexOf(simulator, "c"))

	tensorLeg = calculateLegTensor(tensorPx, tensorUy, dimM)
	tensorLeg, normLy = normalizeAndSetNorm!(simulator, tensorLeg, "ly")
  		###### optional(later) extend leg
	tensorCaret = calculateCaretTensor(tensorQ, tensorUy, dimM)
	tensorCaret, normEy = normalizeAndSetNorm!(simulator, tensorCaret, "ey")

	tensorLegCore, tensorLegCoretilde = calculateTensorLegCore(tensorLeg, tensorCore, tensorCoretilde, dimM)
	tensorLegCore, normLc = normalizeAndSetNorm!(simulator, tensorLegCore, "lc")
	tensorCaretCore = calculateTensorCaretCore(tensorCaret, tensorCore, dimM)
	tensorCaretCore, normEc = normalizeAndSetNorm!(simulator, tensorCaretCore, "ec")

	tensorTau = rotateTensorS_xy(tensorLegCore)
	tensorTautilde = rotateTensorS_xy(tensorLegCoretilde)

 	# do the similar things
	# second stage
	# P = getTensorP(lattice,2)
	# Tau -> Core, tensorU
	# P, Q, tensorU -> leg, caret

	tensorP = getTensorP(lattice,2)
	tensorCore, tensorCoretilde, tensorUy =
	calculateCoreTensors(tensorTau, tensorTautilde, dimM, mirror = true)
	tensorCore, normLccl = normalizeAndSetNorm!(simulator, tensorCore, "lccl")
	tensorCoretilde = tensorCoretilde ./ normLccl
	tensorLeg = calculateLegTensor(tensorP, tensorUy, dimM)
	tensorLeg, normLx = normalizeAndSetNorm!(simulator, tensorLeg, "lx")
  		###### optional(later) extend leg
	tensorCaret = calculateCaretTensor(permutedims(tensorQ, [2,1,3,4]), tensorUy, dimM)
	tensorCaret, normEx = normalizeAndSetNorm!(simulator, tensorCaret, "ex")

	# calculateNextPQ:
	# input:	CaretCore, LegCore, leg, caret, tensorUy, dimM
	# output:	nextTensorPx, nextTensorQ
	## CareCore, LegCore from the prev stage
	## CaretCore, LegCore, leg, caret -> Py, Q
	##### 137,153 #noleg#
		# 1. tensorPi0: CaretCore + CoreLeg = eccl
		tensorPi0 = calculateWallCore(tensorCaretCore, mirrorTensorS(tensorLegCore), tensorUy, dimM)
		tensorPi0, normEccl = normalizeAndSetNorm!(simulator, tensorPi0, "eccl")
		# 2. tensorPi1: leg + tensorPi0 = eccll
			# tensorPi1 = calculatePi1(tensorPi0, leg, dimM)
			tensorPi1 = calculateLegWall(tensorLeg, tensorPi0, dimM)
		tensorPi1, normEccll = normalizeAndSetNorm!(simulator, tensorPi1, "eccll")
		# 3. nextTensorPy: tensorPi1 + leg = ecclll
			nextTensorPy = calculateWallLeg(tensorPi1, tensorLeg, dimM)
			nextTensorPy, normPy = normalizeAndSetNorm!(simulator, nextTensorPy, "py")
		# 4. nextTensorQ:  tensorPi1 + caret = ecclle
			nextTensorQ = calculateWallCaret(tensorPi1, tensorCaret, dimM)
			nextTensorQ, normQ = normalizeAndSetNorm!(simulator, nextTensorQ, "q")
	# Core, leg -> LegCore ( attach leg to y index)
	# Core = lccl, leg -> LegCore = lccll
	tensorLegCore, tensorLegCoretilde = calculateTensorLegCore(tensorLeg, tensorCore, tensorCoretilde, dimM)
	tensorLegCore, normLccll = normalizeAndSetNorm!(simulator, tensorLegCore, "lccll")
	tensorLegCoretilde = tensorLegCoretilde ./ normLccll
		## LegCore, leg (attach leg to the yp index) -> rotate -> T
		## LegCore = lccll + leg = lcclll = next tensorT
		tensorT, tensorTtilde = calculateTensorCoreLeg(tensorLegCore, tensorLegCoretilde, tensorLeg, dimM)
		tensorT, normT = normalizeAndSetNorm!(simulator, tensorT, "t")
		tensorTtilde = tensorTtilde ./ normT
		nextTensorT = rotateTensorS_xy(tensorT)
		nextTensorTtilde = rotateTensorS_xy(tensorTtilde)
		# symmetrize tensorTtilde
		nextTensorTtilde = symmetrizeTensorSpatial(nextTensorTtilde)
		## LegCore, caret -> Px (lccll + caret = nextTensorPx = lcclle)
		nextTensorPx = calculateTensorCoreCaret(tensorLegCore, tensorCaret, dimM)
		nextTensorPx, normPx = normalizeAndSetNorm!(simulator, nextTensorPx, "px")

		setTensorT!(lattice, nextTensorT)
		setTensorT!(lattice, nextTensorTtilde; tilde = true)
		setTensorP!(lattice, 1, nextTensorPx)
	setTensorP!(lattice, 2, nextTensorPy)
	setTensorQ!(lattice, nextTensorQ)

# 	# with mirror
# 	tensorPx = getTensorP(lattice,2)
# 	tensorUy = getTensorUy(dimM, "x", rotatedTensorS1, mirror = true)
# 	tensorUz = getTensorUz(dimM, "x", rotatedTensorS1, mirror = true)
# 	tensorCore2 = getTensorCore(rotatedTensorS1, mirrorTensorS(rotatedTensorS1), tensorUy, tensorUz)
# 	tensorCore2tilde = getTensorCore(rotatedTensorS1tilde, mirrorTensorS(rotatedTensorS1tilde), tensorUy, tensorUz)
#
#  	legProjectorZ = getLegProjectorZ(tensorPx, dimM)
#  	tensorLegY = constructLegY(tensorPx, tensorUy, legProjectorZ)
#  		###### optional(later) extend leg
#  	caretProjectorZ = getCaretProjectorZ(tensorQ, dimM)
#  	tensorCaretY = constructCaretY(tensorQ, tensorUy, caretProjectorZ)
#
#  	tensorSProjectorZ = getSProjectorZ(tensorLegY, tensorCore2, dimM)
#  	tensorS2 = constructTensorS(tensorLegY, tensorSProjectorZ, tensorCore2)
#  	tensorS2tilde = constructTensorS(tensorLegY, tensorSProjectorZ, tensorCore2tilde)
#
# 	# 1. T: S2 + leg
# 	# 2. Ttilde: S2tilde + leg
# 		#
# 	# 3. Py: S2 + caret
#
	# from CaretCore, LegCore, newLeg, newCaret
	# -> Py, Q
	# do it without rotating anything
	# 1. 	CaretCore + CoreLeg
# 	# 1. ScS1: Sc + mirror(S1)
# 	# 2. ScS1Leg: ScS1 + leg
# 	# 3. Px: ScS1Leg + leg
# 	# 4. Q: ScS1Leg + caret
#
# 	# rotate
# 	# store them
# 	# T, Ttilde
# 	# Px, Py
# 	# Q
#
# 	# from S and Sc
# 	###### from here
# 	# attach one more leg or caret
# 	# to make next tensor T

end


text:
@testset "26.remove-duplicates-from-sorted-array.jl" begin
    nums1 = [1, 1, 2]
    @test remove_duplicates1!(nums1) == 2 && nums1[1: 2] == [1, 2]
    nums2 = [0, 0, 1, 1, 1, 2, 2, 3, 3, 4]
    @test remove_duplicates1!(nums2) == 5 && nums2[1: 5] == [0, 1, 2, 3, 4]
end


text:
# AUTO GENERATED FILE - DO NOT EDIT

export dropdown

"""
    dropdown(;kwargs...)

A Dropdown component.
Dropdown component
Keyword arguments:
- `disabled` (Bool; optional): Disable the control
- `options` (optional): List of items. options has the following type: Array of String | lists containing elements 'label', 'value'.
Those elements have the following types:
  - `label` (String; optional)
  - `value` (Bool | Real | String | Dict | Array; optional)s
- `id` (String; required): Specify a custom `id`
- `inline` (Bool; optional): Specify whether you want the inline version of this control
- `invalid` (Bool; optional): Specify if the currently selected value is invalid.
- `invalidText` (String; optional): Message which is displayed if the value is invalid.
- `label` (a list of or a singular dash component, string or number; required): Generic `label` that will be used as the textual representation of what
this field is for
- `ariaLabel` (String; optional): 'aria-label' of the ListBox component.
- `value` (Bool | Real | String | Dict | Array; optional): In the case you want to control the dropdown selection entirely.
- `light` (Bool; optional): `true` to use the light version.
- `titleText` (String | a list of or a singular dash component, string or number; optional): Provide the title text that will be read by a screen reader when
visiting this control
- `helperText` (String | a list of or a singular dash component, string or number; optional): Provide helper text that is used alongside the control label for
additional help
- `style` (Dict; optional): Style of the component
"""
function dropdown(; kwargs...)
        available_props = Symbol[:disabled, :options, :id, :inline, :invalid, :invalidText, :label, :ariaLabel, :value, :light, :titleText, :helperText, :style]
        wild_props = Symbol[]
        return Component("dropdown", "Dropdown", "dash_carbon_components", available_props, wild_props; kwargs...)
end

max_stars_repo_name: Matheus-Rangel/dash-carbon-components

max_issues_repo_name: Matheus-Rangel/dash-carbon-components

max_forks_repo_name: Matheus-Rangel/dash-carbon-components


text:
using Ipopt, ForwardDiff

#=
using ReverseDiff:
    GradientTape,
    GradientConfig,
    gradient,
    gradient!,
    JacobianTape,
    JacobianConfig,
    jacobian,
    jacobian!,
    hessian,
    hessian!,
    HessianTape,
    HessianConfig,
    compile,
    DiffResults
=#
# hs071
# min x1 * x4 * (x1 + x2 + x3) + x3
# st  x1 * x2 * x3 * x4 >= 25
#     x1^2 + x2^2 + x3^2 + x4^2 = 40
#     1 <= x1, x2, x3, x4 <= 5
# Start at (1,5,5,1)
# End at (1.000..., 4.743..., 3.821..., 1.379...)
function F(x)
    x[1] * x[4] * (x[1] + x[2] + x[3]) + x[3]
end

 xzero = [1., 2., 3., 4.]
 FgradTape = GradientTape(F, xzero)
 compFgradTape = compile(FgradTape)
function gradF(x)
    return gradient!(similar(xzero), compFgradTape, x)
end

function G(x)
    [x[1] * x[2] * x[3] * x[4],
     x[1]^2 + x[2]^2 + x[3]^2 + x[4]^2]
end

 GgradTape = [GradientTape(x -> G(x)[1], xzero), GradientTape(x -> G(x)[2], xzero)]
 compGgradTape = [compile(GgradTape[1]), compile(GgradTape[2])]
function jacG(x)
    results = similar(xzero, m, n)
    results[1,:] = gradient!(similar(xzero), compGgradTape[1], x)
    results[2,:] = gradient!(similar(xzero), compGgradTape[2], x)
    return results
end

FhessTape = HessianTape(F, xzero)
compFhessTape = compile(FhessTape)
function hessF(x)
    return hessian!(similar(xzero, n, n), compFhessTape, x)
end

GhessTape = [HessianTape(x -> G(x)[1], xzero), HessianTape(x -> G(x)[2], xzero)]
compGhessTape = [compile(GhessTape[1]), compile(GhessTape[2])]
function vHessG(x)
    return [hessian!(similar(xzero, n, n), compGhessTape[1], x),
            hessian!(similar(xzero, n, n), compGhessTape[2], x)]
end
#we now define the callback function for ipopt
function eval_f(x)
    F(x)
end

function eval_g(x, g)
  # Bad: g    = zeros(2)  # Allocates new array
  # OK:  g[:] = zeros(2)  # Modifies 'in place'
    g[1] = G(x)[1]
    g[2] = G(x)[2]
end

function eval_grad_f(x, grad_f)
  # Bad: grad_f    = zeros(4)  # Allocates new array
  # OK:  grad_f[:] = zeros(4)  # Modifies 'in place'
  grad_f[1] = gradF(x)[1]
  grad_f[2] = gradF(x)[2]
  grad_f[3] = gradF(x)[3]
  grad_f[4] = gradF(x)[4]
end

function eval_jac_g(x, mode, rows, cols, values)
  if mode == :Structure
    # Constraint (row) 1
    rows[1] = 1; cols[1] = 1
    rows[2] = 1; cols[2] = 2
    rows[3] = 1; cols[3] = 3
    rows[4] = 1; cols[4] = 4
    # Constraint (row) 2
    rows[5] = 2; cols[5] = 1
    rows[6] = 2; cols[6] = 2
    rows[7] = 2; cols[7] = 3
    rows[8] = 2; cols[8] = 4
  else
    # Constraint (row) 1
#    values[1:n] = jacG(x)[1,:]
#    values[1] = jacG(x)[1, 1]
#    values[2] = jacG(x)[1, 2]
#    values[3] = jacG(x)[1, 3]
#    values[4] = jacG(x)[1, 4]
    # Constraint (row) 2
#     values[n+1:2n] = jacG(x)[2,:]
#    values[5] = 2*x[1]  # 2,1
#    values[6] = 2*x[2]  # 2,2
#    values[7] = 2*x[3]  # 2,3
#    values[8] = 2*x[4]  # 2,4
      values[:] = vec(transpose(jacG(x)))
  end
end

function eval_h(x, mode, rows, cols, obj_factor, lambda, values)
  if mode == :Structure
    # Symmetric matrix, fill the lower left triangle only
    idx = 1
    for row = 1:4
      for col = 1:row
        rows[idx] = row
        cols[idx] = col
        idx += 1
      end
    end
  else
    # Again, only lower left triangle
    # Objective
    iter1 = 1
    for i in 1:n
        for j in 1:i
            values[iter1] = obj_factor * hessF(x)[i, j]
            iter1 += 1
        end
    end

#    values[:] = vec(hessF(x)[1:])
#    values[1] = obj_factor * (2*x[4])  # 1,1
#    values[2] = obj_factor * (  x[4])  # 2,1
#    values[3] = 0                      # 2,2
#    values[4] = obj_factor * (  x[4])  # 3,1
#    values[5] = 0                      # 3,2
#    values[6] = 0                      # 3,3
#    values[7] = obj_factor * (2*x[1] + x[2] + x[3])  # 4,1
#    values[8] = obj_factor * (  x[1])  # 4,2
#    values[9] = obj_factor * (  x[1])  # 4,3
#    values[10] = 0                     # 4,4
#
    # Both constraints
    iter1 = 1
    for i in 1:n
        for j in 1:i
            values[iter1] += lambda[1] * vHessG(x)[1][i, j] + lambda[2] * vHessG(x)[2][i, j]
            iter1 += 1
        end
    end
    # First constraint
#    values[2] += lambda[1] * (x[3] * x[4])  # 2,1
#    values[4] += lambda[1] * (x[2] * x[4])  # 3,1
#    values[5] += lambda[1] * (x[1] * x[4])  # 3,2
#    values[7] += lambda[1] * (x[2] * x[3])  # 4,1
#    values[8] += lambda[1] * (x[1] * x[3])  # 4,2
#    values[9] += lambda[1] * (x[1] * x[2])  # 4,3
#    for i in 1:n
#        for j in 1:i
#            values[iter1] += lambda[2] * vHessG(x)[i + n, j]
#            iter1 += 1
#        end
#    end

    # Second constraint
#    values[1]  += lambda[2] * 2  # 1,1
#    values[3]  += lambda[2] * 2  # 2,2
#    values[6]  += lambda[2] * 2  # 3,3
#    values[10] += lambda[2] * 2  # 4,4
  end
end

n = 4
x_L = [1.0, 1.0, 1.0, 1.0]
x_U = [5.0, 5.0, 5.0, 5.0]

m = 2
g_L = [25.0, 40.0]
g_U = [2.0e19, 40.0]

function probcall()
prob = createProblem(n, x_L, x_U, m, g_L, g_U, 8, 10,
                     eval_f, eval_g, eval_grad_f, eval_jac_g, eval_h);
prob.x = [1.0, 5.0, 5.0, 1.0];
status = solveProblem(prob);
println(Ipopt.ApplicationReturnStatus[status])
println(prob.x)
println(prob.obj_val)
end
#if @isdefined(obj)
#else
#    obj = Float64[]
#end
#if length(obj) == 1
#else
#   println(obj[length(obj)-1])
#end

max_stars_repo_name: uq-aibe/aim

max_issues_repo_name: uq-aibe/aim

max_forks_repo_name: uq-aibe/aim


text:
export pipe, resume, recover, Pipeline

struct Pipeline
    exec::Function
end # Pipeline

function resolve_future(continuation)
    isa(continuation, Future) ? fetch(continuation) : continuation
end # resolveContinuation

const pipeline_reducer = function(prevpipe, nextpipe)
    if (isa(prevpipe, Function))
        function(continuation)
            if isdone(continuation)
                continuation
            else
                continuation = resolve_future(prevpipe(continuation...))
                nextpipe(continuation)
            end
        end
    else
        function(continuation)
            nextpipe(prevpipe(continuation))
        end
    end
end

"""
    pipe(stages::Union{Function,Pipeline)...)::Pipeline

Create an http handler pipe.

```julia
p = pipe(
    (req::Request, res::Response) -> next(req, setheader(res, "X-Powered-By", "Spirit")),
    (req::Request, res::Response) -> done(req, respond_text(res, "A text response...")) )

run(p, req, res)
```
"""
function pipe(stages::Union{Function,Pipeline}...)::Pipeline
    exec = foldr(pipeline_reducer, stages; init=c -> c)
    Pipeline(exec)
end # pipe

function Base.run(p::Pipeline, data...)::Continuation
    p(next(data...))
end # run

function (pipe::Pipeline)(continuation::Continuation)::Continuation
    resolve_future(pipe.exec(continuation))
end # Pipeline()

"""
    resume(Pipeline, Pipeline|Function)

Continue a pipe that is done.

```julia
p = pipe(
    (req, res) -> done(req, respond_text("this is wrong")) )

p = resume(p, pipe(
    (req, res) -> done(req, respond_text("this is right")) ))
```
"""
function resume(first::Pipeline, stages::Union{Pipeline,Function}...; always::Bool=false)::Pipeline
    second = pipe(stages...)
    exec = function(continuation)
        continuation = first(continuation)
        if isnext(continuation) && !always
            continuation
        else
            second(next(continuation...))
        end
    end

    Pipeline(exec)
end # resume

"""
    recover(Pipeline, Function)

Recover from exceptions thrown within a pipeline
"""
function recover(first::Pipeline, recovery::Function)::Pipeline
    exec = function(continuation)
        try
            first(continuation)
        catch e
            recovery(e, continuation...)
        end
    end

    Pipeline(exec)
end # recover