text:
using Statistics
using Plots
using BenchmarkTools
#using Profile
using LinearAlgebra

# put the cwd on the path so Julia can find the module
push!(LOAD_PATH, "/Users/saydjari/Dropbox/GradSchool_AKS/Doug/Projects/DHC/main")
using DHC_2DUtils
using MLDatasets
using Images

# read the MNIST training data, x=image, y=class
train_x, train_y = MNIST.traindata()
test_x, test_y   = MNIST.testdata()
# To view, heatmap(train_x[:,:,6]',yaxis=(:flip),aspect_ratio=1)

# transpose and flip, pad to 32, rebin to 64
function mnist_pad(im; θ=0.0)
    impad = zeros(Float64,32,32)
    impad[30:-1:3,3:30] = im'
    imbig = imresize(impad,(64,64))
    if θ != 0.0
        imrot = imrotate(imbig, θ, axes(imbig))
        imrot[findall(imrot .!= imrot)] .= 0.0
        return imrot
    end
    return imbig
end

filter_hash = fink_filter_hash(1,8,nx=64,wd=2)
# call DHC WST transform
# θ in radians
function mnist_DHC(x, y; θ=0.0)
    # filter bank
    filter_hash = fink_filter_hash(1,8,nx=64,wd=2)

    # get transform size}
    Nimage = size(x)[end]
    println("theta", θ)
    image  = mnist_pad(x[:,:,1], θ=θ)
    test   = DHC_compute(image, filter_hash,filter_hash)
    Ncoeff = length(test)
    # allocate output arrays
    WST    = zeros(Ncoeff, Nimage)
    for i=1:Nimage
        image    = mnist_pad(x[:,:,i], θ=θ)
        WST[:,i] = DHC_compute(image, filter_hash,filter_hash)
    end
    return WST
end

nuse = 20000   # this takes 8.5 mins for 20000
@time wst = mnist_DHC(train_x[:,:,1:nuse],train_y[1:nuse])

nuse = 40000   # this takes 17 mins for 40000
@time wst4 = mnist_DHC(train_x[:,:,1:nuse],train_y[1:nuse])

nfilt = 33
S1  = wst4[1:2+nfilt,:]
S20 = wst4[3+nfilt:2+nfilt+nfilt^2,:]
S2  = wst4[3+nfilt+nfilt^2:end,:]

nuse = 100   # this takes 8.5 mins for 20000
@time wstrot1 = mnist_DHC(train_x[:,:,1:nuse],train_y[1:nuse], θ=0.0)

nuse = 100   # this takes 8.5 mins for 20000
@time wstrot2 = mnist_DHC(train_x[:,:,1:nuse],train_y[1:nuse], θ=1.9)

function tryit(train_x, train_y)
    nuse = 100   # this takes 8.5 mins for 20000
    wstrot1 = mnist_DHC(train_x[:,:,1:nuse],train_y[1:nuse], θ=0.0)
    S20 = wstrot1[3+nfilt:2+nfilt+nfilt^2,:]
    len20 = length(make_iso(filter_hash, S20))  # yuck
    S20iso1 = reshape(make_iso(filter_hash, S20), len20÷nuse, nuse)

    wstrot2 = mnist_DHC(train_x[:,:,1:nuse],train_y[1:nuse], θ=1.9)
    S20 = wstrot2[3+nfilt:2+nfilt+nfilt^2,:]
    S20iso2 = reshape(make_iso(filter_hash, S20), len20÷nuse, nuse)
    heatmap([S20iso1 S20iso2 S20iso2-S20iso1], clim=(-0.1,0.1))
    outim = [S20iso1 S20iso2 S20iso2-S20iso1]
    return outim
end

# Compute the mean and covariance of a set of vectors, x
function get_covar(x; cut=0.0)
    (Nd,Nx) = size(x)
    xx = x
    if cut != 0.0
        xmean, cov = get_covar(x)
        chi2 = get_chi2(x, xmean, cov)
        ind = findall(chi2 .< cut)
        println(Nd)
        xx = x[:,ind]
    end

    (Nd,Nx) = size(xx)
    if Nx < Nd println("Warning: Matrix not full rank") end
    x̄     = mean(xx,dims=2)[:,1]
    xsub  = xx.-x̄
    cov   = (xsub * xsub') ./ Nx
    println(Nx)
    return x̄, cov
end

# Compute chi2 of x given mean and covariance
function get_chi2(x, x̄, cov)
    Δx = x.-x̄
    χ2 = sum(Δx .* (inv(cov)*Δx), dims=1)[1,:]
end

# Arrange a stack of images in a grid
function imgrid(dat)
    (Ny,Nx,Nd) = size(dat)
    Ng = ceil(Int32,sqrt(Nd))
    grid = zeros(Float32,Ng*Ny,Ng*Nx)
    for i=1:Ng
        x0 = (i-1)*Nx
        for j=1:Ng
            y0 = (j-1)*Ny
            ii = (i-1)*Ng+j
            #println("i $i j $j x0=$x0 y0=$y0")
            if ii <= Nd grid[y0+1:y0+Ny, x0+1:x0+Nx] = dat[:,:,ii] end
        end
    end
    return grid
end

function mdisp(x, ind)
    dat = x[:,:,ind]
    grid = imgrid(dat)
    heatmap(grid',yaxis=(:flip))  # transpose and flip
end

function get_all_covar(train_x, train_y, wst; noise=1e-7)
    # select a class
    println("bar ",size(wst))
    (nk, Nd) = size(wst)
    #cut = 1.5*nk # ?????????
    cut=0

    clist = []
    mlist = []
    for i = 1:10
        class = mod(i, 10)
        ind   = findall(train_y[1:Nd] .== class)
        println("Class: ",class,"  ",length(ind))

        mn,cov = get_covar(wst[:,ind]+noise.*randn(nk,length(ind)),cut=cut)
        push!(clist, cov)
        push!(mlist, mn)
    end
    return mlist, clist
end

# mdisp(train_x,1:100)

function mnist_2class_plot(y, wst, mlist, clist, classes)
    # select a class
    Nd = (size(wst))[end]
    class1 = classes[1]
    class2 = classes[2]

    i1 = mod1(class1,10)
    i2 = mod1(class2,10)
    χ2_1   = get_chi2(wst, mlist[i1], clist[i1])
    χ2_2   = get_chi2(wst, mlist[i2], clist[i2])

    ind1 = findall(y[1:Nd] .== class1)
    ind2 = findall(y[1:Nd] .== class2)
    scatter(χ2_1[ind1],χ2_2[ind1],msize=2,label=class1)
    scatter!(χ2_1[ind2],χ2_2[ind2],msize=2,label=class2)
    #plot!([0,1000],[0,1000],label=nothing)
end

function make_iso(filter_hash,wst)
    (nk, Nd) = size(wst)
    Nf      = length(filter_hash["filt_value"])
    Nj      = length(filter_hash["j_value"])
    Nl      = length(filter_hash["theta_value"])

    jlind   = filter_hash["psi_index"]

    S       = reshape(wst, Nf, Nf, Nd)[jlind,jlind,:]
    Siso    = zeros(Nj, Nj, Nl, Nd)

    for j1 = 1:Nj
        for j2 = 1:Nj
            for l1 = 1:Nl
                for l2 = 1:Nl
                    DeltaL = mod(l1-l2, Nl)
                    Siso[j1,j2,DeltaL+1,:] += S[j1,l1,j2,l2,:]
                end
            end
        end
    end
    # Need to add phi part as well!!
    return Siso
end

S2iso = make_iso(filter_hash,S20)

mlist, clist = get_all_covar(train_x, train_y, S20)
mnist_2class_plot(train_y, S20, mlist, clist, [3,4])

#S2iso = reshape(make_iso(filter_hash, S20), length(S2iso)÷Nd, Nd)
mlist, clist = get_all_covar(train_x, train_y, S2iso)
mnist_2class_plot(train_y, S2iso, mlist, clist, [3,4])

S20iso = reshape(make_iso(filter_hash, S20), length(S20iso)÷Nd, Nd)
mlist, clist = get_all_covar(train_x, train_y, S20iso)
mnist_2class_plot(train_y, S20iso, mlist, clist, [3,4])

Siso = [S20iso;S2iso]
mlist, clist = get_all_covar(train_x, train_y, Siso)
mnist_2class_plot(train_y, Siso, mlist, clist, [3,4])

Siso = log.([S20iso;S2iso])
mlist, clist = get_all_covar(train_x, train_y, Siso)
mnist_2class_plot(train_y, Siso, mlist, clist, [3,4])

Siso = [S20iso; log.(S20iso)]
mlist, clist = get_all_covar(train_x, train_y, Siso)
mnist_2class_plot(train_y, Siso, mlist, clist, [3,4])

Nd = 40000
class1 = 4
nk = 600
ind1 = findall(train_y[1:Nd] .== class1)
mn1,cov1 = get_covar(wst4[200+1:200+nk,ind1]+1e-5 .*randn(nk,length(ind1)),cut=1000)
c1 = get_chi2(wst4[200+1:200+nk,:], mn1, cov1)
histogram((c1[ind1]./nk))
println("Median: ",median(c1[ind1]), "   Mean: ",mean(c1[ind1]))

ind2 = findall((train_y[1:Nd] .== class1) .& (c1 .< 1.5*nk))
println("Keeping ",100*length(ind2)/length(ind1), " %")
mn2,cov2 = get_covar(wst4[200+1:200+nk,ind2]+1e-5 .*randn(nk,length(ind2)))
c2 = get_chi2(wst4[200+1:200+nk,:], mn2, cov2)
histogram((c2[ind2]./nk))
println("Median: ",median(c2[ind2]), "   Mean: ",mean(c2[ind2]))

cc = get_chi2(wst4[200+1:200+nk,20001:40000], mn1, cov1)
indc = findall(train_y[20001:20000+Nd] .== class1)

dc2 = c1-c2
histogram(c1-c2,xlims=(0,1500),bins=1000)

histogram(foo2,xlims=(0,1500))
histogram!(foo,bins=1000)

max_stars_repo_name: andrew-saydjari/DHC

max_issues_repo_name: andrew-saydjari/DHC

max_forks_repo_name: andrew-saydjari/DHC


text:
"""
State objects are used to represent the state of the search at any given moment.
We choose to implement separate state objects, rather than having an implicit
state embedded within an algorithm instance, in order to make state
interactions cleaner, and not dependent on the exact nature of the algorithm
used.
"""
module state
  using population
  export State, reset!

  """
  Represents the state of an evolutionary algorithm at a given moment in time.
  """
  type State
    population::Population
    iterations::Int
    evaluations::Int

    State() = State(Population())
    State(p::Population) = new(p, 0, 0)
  end

  """
  Resets a given state, setting its iteration and evaluation counters to zero.
  """
  function reset!(s::State)
    s.iterations = s.evaluations = 0
  end
end

ext: jl


text:
@testset "passmanager" begin

let
    mpm = ModulePassManager()
    dispose(mpm)
end

Context() do ctx
LLVM.Module("SomeModule", ctx) do mod
ModulePassManager() do mpm
    @test !run!(mpm, mod)
end
end
end

Context() do ctx
LLVM.Module("SomeModule", ctx) do mod
FunctionPassManager(mod) do fpm
    ft = LLVM.FunctionType(LLVM.VoidType(), [LLVM.Int32Type()])
    fn = LLVM.Function(mod, "SomeFunction", ft)

    @test !initialize!(fpm)
    @test !run!(fpm, fn)
    @test !finalize!(fpm)
end
end
end

end


text:
@testset "I/O" begin
  c0 = Clause(Int[])
  c1 = Clause(1, 2, -3)
  c1_ref = "(-3 ∨ 1 ∨ 2)"
  c2 = Clause(4, 2, 3)
  c2_ref = "(2 ∨ 3 ∨ 4)"
  c3 = Clause(999)
  c3_ref = "(999)"
  c4 = Clause(-123)

  @testset "Pretty printing of clauses" begin
    function test_case(cl::Clause, ref::String)
      io = IOBuffer()
      print(io, cl)
      res = String(take!(io))
      @test res == ref
      close(io)
    end

    test_case(c0, "()")
    test_case(c1, c1_ref)
    test_case(c2, c2_ref)
    test_case(c3, c3_ref)
    test_case(c4, "(-123)")
  end

  f0 = Formula(0)
  f1 = Formula(c1)
  f2 = Formula(c1, c2, c3)

  @testset "Pretty printing of formulas" begin
    function test_case(fla::Formula, ref::String)
      io = IOBuffer()
      print(io, fla)
      res = String(take!(io))
      @test res == ref
      close(io)
    end

    test_case(f0, "()")
    test_case(f1, "($c1_ref)")
    test_case(f2, "($c1_ref ∧ $c2_ref ∧ $c3_ref)")
  end
end


text:
#!/usr/bin/env julia
include("src/WordErrorRate.jl")
using WordErrorRate

cd("test")

include("test/runtests.jl")


text:
export copy_elementtype

    copy_elementtype(T, x::R) where R<:AbstractArray = T.(x)
    copy_elementtype(T, x::UpperTriangular) = UpperTriangular(copy_elementtype(T, parent(x)))
    copy_elementtype(T, x::LowerTriangular) = LowerTriangular(copy_elementtype(T, parent(x)))
    copy_elementtype(T, x::R) where R<:Transpose = Transpose(copy_elementtype(T, parent(x)))
    copy_elementtype(T, x::R) where R<:Adjoint = Adjoint(copy_elementtype(T, parent(x)))
    copy_elementtype(T, x::R) where R<:Symmetric = Symmetric(copy_elementtype(T, parent(x)), Symbol(x.uplo))
    copy_elementtype(T, x::R) where R<:Hermitian = Hermitian(copy_elementtype(T, parent(x)), Symbol(x.uplo))

if isdefined(@__MODULE__, :BandedMatrices)
    copy_elementtype(T, a::BandedMatrix) = BandedMatrix((d -> d => T.(diag(a, d))).(-a.l:a.u)...)
end


text:
using Pkg
Pkg.add("CPUTime")

using CPUTime

function random_int()
    # Call into C, because Julia does not handle UInts well...
    return ccall((:random_int, "random_int.dll"), Int32, ())
end

function calc_partial_result(values, num_of_values_to_process)
    result = 0.0

    @inbounds  begin
        @fastmath begin
            for i in 1:num_of_values_to_process
                for j in 1:i
                    result += values[i] * (j - 2)
                end
            end
        end
    end

    return result
end

function calc_partial_conditional_result(values, values_conditional, num_of_values_to_process, min_conditional_value)
    result = 0.0

    @inbounds  begin
        @fastmath begin
            for i in 1:num_of_values_to_process
                for j in 1:i
                    if values_conditional[j] >= min_conditional_value
                        result += values[i] * (j - 2)
                    end
                end
            end
        end
    end

    return result
end

function mean(data, n)
    sum = 0.0

    for i in 1:n
        sum += data[i]
    end

    return sum / n
end

function standard_deviation(data, n)
    sum_of_data_squared_minus_data = 0.0

    avg = mean(data, n)

    for i in 1:n
        sum_of_data_squared_minus_data += (data[i] - avg) ^ 2
    end

    return (sum_of_data_squared_minus_data / (n - 1)) ^ (1 / 2)
end

function main(argc, argv)
    num_of_values = parse(Int32, argv[1])

    num_of_executions = 10
    num_of_values_to_process = num_of_values ÷ 2
    min_conditional_value = 10

    result = 0.0
    execution_times_in_seconds = zeros(num_of_executions)

    values = zeros(num_of_values)
    values_conditional = zeros(num_of_values)

    for i in 1:num_of_values
        values[i] = i + 1 - 1
        values_conditional[i] = random_int()
    end

    # Warm up
    calc_partial_result(values, num_of_values_to_process)
    calc_partial_conditional_result(values, values_conditional, num_of_values_to_process, min_conditional_value)

    for i in 1:num_of_executions
        clock_start = CPUtime_us()
        result = calc_partial_result(values, num_of_values_to_process)
        clock_end = CPUtime_us()

        clock_diff = clock_end - clock_start

        execution_times_in_seconds[i] = clock_diff / 10^6
    end

    println("calc_partial_result: ")
    println("num_of_values_to_process: = $num_of_values_to_process")
    println("$(mean(execution_times_in_seconds, num_of_executions)) s ± $(standard_deviation(execution_times_in_seconds, num_of_executions)) s per loop (mean ± std. dev. of $num_of_executions runs, 1 loop each)")
    println("result = $result")

    println("")

    for i in 1:num_of_executions
        clock_start = CPUtime_us()
        result = calc_partial_conditional_result(values, values_conditional, num_of_values_to_process, min_conditional_value)
        clock_end = CPUtime_us()

        clock_diff = clock_end - clock_start

        execution_times_in_seconds[i] = clock_diff / 10^6
    end

    println("calc_partial_conditional_result: ")
    println("num_of_values_to_process: = $num_of_values_to_process")
    println("$(mean(execution_times_in_seconds, num_of_executions)) s ± $(standard_deviation(execution_times_in_seconds, num_of_executions)) s per loop (mean ± std. dev. of $num_of_executions runs, 1 loop each)")
    println("result = $result")

    return 0
end

main(length(ARGS), ARGS)


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

@test integrate(cosh(a+b*x), x) == :(b^-1*sinh(a+b*x))
@test integrate(cosh(a+b*x)^2, x) == :((1/2)*x+(1/2)*b^-1*cosh(a+b*x)*sinh(a+b*x))
@test integrate(cosh(a+b*x)^3, x) == :(b^-1*sinh(a+b*x)+1//3*b^-1*sinh(a+b*x)^3)
@test integrate(cosh(a+b*x)^4, x) == :(3//8*x+1//4*b^-1*cosh(a+b*x)^3*sinh(a+b*x)+3//8*b^-1*cosh(a+b*x)*sinh(a+b*x))
@test integrate(cosh(a+b*x)^5, x) == :(b^-1*sinh(a+b*x)+1//5*b^-1*sinh(a+b*x)^5+2//3*b^-1*sinh(a+b*x)^3)
@test integrate(cosh(a+b*x)^6, x) == :(5//16*x+1//6*b^-1*cosh(a+b*x)^5*sinh(a+b*x)+5//16*b^-1*cosh(a+b*x)*sinh(a+b*x)+5//24*b^-1*cosh(a+b*x)^3*sinh(a+b*x))
@test integrate(cosh(a+b*x)^7//2, x) == :(-10//21*im*b^-1*Elliptic.F((1/2)*im*(a+b*x),2)+2//7*b^-1*cosh(a+b*x)^5//2*sinh(a+b*x)+10//21*b^-1*cosh(a+b*x)^(1/2)*sinh(a+b*x))
@test integrate(cosh(a+b*x)^5//2, x) == :(-6//5*im*b^-1*Elliptic.E((1/2)*im*(a+b*x),2)+2//5*b^-1*cosh(a+b*x)^3//2*sinh(a+b*x))
@test integrate(cosh(a+b*x)^3//2, x) == :(-2//3*im*b^-1*Elliptic.F((1/2)*im*(a+b*x),2)+2//3*b^-1*cosh(a+b*x)^(1/2)*sinh(a+b*x))
@test integrate(cosh(a+b*x)^(1/2), x) == :(-2*im*b^-1*Elliptic.E((1/2)*im*(a+b*x),2))
@test integrate(cosh(a+b*x)^-1//2, x) == :(-2*im*b^-1*Elliptic.F((1/2)*im*(a+b*x),2))
@test integrate(cosh(a+b*x)^-3//2, x) == :(2*im*b^-1*Elliptic.E((1/2)*im*(a+b*x),2)+2*b^-1*cosh(a+b*x)^-1//2*sinh(a+b*x))
@test integrate(cosh(a+b*x)^-5//2, x) == :(-2//3*im*b^-1*Elliptic.F((1/2)*im*(a+b*x),2)+2//3*b^-1*cosh(a+b*x)^-3//2*sinh(a+b*x))
@test integrate(cosh(a+b*x)^-7//2, x) == :(2//5*b^-1*cosh(a+b*x)^-5//2*sinh(a+b*x)+6//5*im*b^-1*Elliptic.E((1/2)*im*(a+b*x),2)+6//5*b^-1*cosh(a+b*x)^-1//2*sinh(a+b*x))
@test integrate((a*cosh(x))^7//2, x) == :(2//7*a*(a*cosh(x))^5//2*sinh(x)+10//21*a^3*(a*cosh(x))^(1/2)*sinh(x)+-10//21*im*a^4*(a*cosh(x))^-1//2*cosh(x)^(1/2)*Elliptic.F((1/2)*im*x,2))
@test integrate((a*cosh(x))^5//2, x) == :(2//5*a*(a*cosh(x))^3//2*sinh(x)+-6//5*im*a^2*(a*cosh(x))^(1/2)*cosh(x)^-1//2*Elliptic.E((1/2)*im*x,2))
@test integrate((a*cosh(x))^3//2, x) == :(2//3*a*(a*cosh(x))^(1/2)*sinh(x)+-2//3*im*a^2*(a*cosh(x))^-1//2*cosh(x)^(1/2)*Elliptic.F((1/2)*im*x,2))
@test integrate((a*cosh(x))^(1/2), x) == :(-2*im*(a*cosh(x))^(1/2)*cosh(x)^-1//2*Elliptic.E((1/2)*im*x,2))
@test integrate((a*cosh(x))^-1//2, x) == :(-2*im*(a*cosh(x))^-1//2*cosh(x)^(1/2)*Elliptic.F((1/2)*im*x,2))
@test integrate((a*cosh(x))^-3//2, x) == :(2*a^-1*(a*cosh(x))^-1//2*sinh(x)+2*im*a^-2*(a*cosh(x))^(1/2)*cosh(x)^-1//2*Elliptic.E((1/2)*im*x,2))
@test integrate((a*cosh(x))^-5//2, x) == :(2//3*a^-1*(a*cosh(x))^-3//2*sinh(x)+-2//3*im*a^-2*(a*cosh(x))^-1//2*cosh(x)^(1/2)*Elliptic.F((1/2)*im*x,2))
@test integrate((a*cosh(x))^-7//2, x) == :(2//5*a^-1*(a*cosh(x))^-5//2*sinh(x)+6//5*a^-3*(a*cosh(x))^-1//2*sinh(x)+6//5*im*a^-4*(a*cosh(x))^(1/2)*cosh(x)^-1//2*Elliptic.E((1/2)*im*x,2))
@test integrate((a+a*cosh(x))^-1*cosh(x)^4, x) == :(4*a^-1*sinh(x)+-3//2*x*a^-1+4//3*a^-1*sinh(x)^3+-1*(a+a*cosh(x))^-1*cosh(x)^3*sinh(x)+-3//2*a^-1*cosh(x)*sinh(x))
@test integrate((a+a*cosh(x))^-1*cosh(x)^3, x) == :(-2*a^-1*sinh(x)+3//2*x*a^-1+-1*(a+a*cosh(x))^-1*cosh(x)^2*sinh(x)+3//2*a^-1*cosh(x)*sinh(x))
@test integrate((a+a*cosh(x))^-1*cosh(x)^2, x) == :(a^-1*sinh(x)+-1*x*a^-1+a^-1*(1+cosh(x))^-1*sinh(x))
@test integrate((a+a*cosh(x))^-1*cosh(x), x) == :(x*a^-1+-1*(a+a*cosh(x))^-1*sinh(x))
@test integrate((a+a*cosh(x))^-1*sech(x), x) == :(a^-1*arctan(sinh(x))+-1*(a+a*cosh(x))^-1*sinh(x))
@test integrate((a+a*cosh(x))^-1*sech(x)^2, x) == :(-1*a^-1*arctan(sinh(x))+-1*(a+a*cosh(x))^-1*tanh(x)+2*a^-1*tanh(x))
@test integrate((a+a*cosh(x))^-1*sech(x)^3, x) == :(-2*a^-1*tanh(x)+3//2*a^-1*arctan(sinh(x))+-1*(a+a*cosh(x))^-1*sech(x)*tanh(x)+3//2*a^-1*sech(x)*tanh(x))
@test integrate((a+a*cosh(x))^-1*sech(x)^4, x) == :(4*a^-1*tanh(x)+-4//3*a^-1*tanh(x)^3+-3//2*a^-1*arctan(sinh(x))+-1*(a+a*cosh(x))^-1*sech(x)^2*tanh(x)+-3//2*a^-1*sech(x)*tanh(x))
@test integrate((1+cosh(c+d*x))^-1, x) == :(d^-1*(1+cosh(c+d*x))^-1*sinh(c+d*x))
@test integrate((1+cosh(c+d*x))^-2, x) == :(1//3*d^-1*(1+cosh(c+d*x))^-1*sinh(c+d*x)+1//3*d^-1*(1+cosh(c+d*x))^-2*sinh(c+d*x))
@test integrate((1+cosh(c+d*x))^-3, x) == :(1//5*d^-1*(1+cosh(c+d*x))^-3*sinh(c+d*x)+2//15*d^-1*(1+cosh(c+d*x))^-1*sinh(c+d*x)+2//15*d^-1*(1+cosh(c+d*x))^-2*sinh(c+d*x))
@test integrate((1+cosh(c+d*x))^-4, x) == :(1//7*d^-1*(1+cosh(c+d*x))^-4*sinh(c+d*x)+2//35*d^-1*(1+cosh(c+d*x))^-1*sinh(c+d*x)+2//35*d^-1*(1+cosh(c+d*x))^-2*sinh(c+d*x)+3//35*d^-1*(1+cosh(c+d*x))^-3*sinh(c+d*x))
@test integrate((1+-1*cosh(c+d*x))^-1, x) == :(-1*d^-1*(1+-1*cosh(c+d*x))^-1*sinh(c+d*x))
@test integrate((1+-1*cosh(c+d*x))^-2, x) == :(-1//3*d^-1*(1+-1*cosh(c+d*x))^-1*sinh(c+d*x)+-1//3*d^-1*(1+-1*cosh(c+d*x))^-2*sinh(c+d*x))
@test integrate((1+-1*cosh(c+d*x))^-3, x) == :(-2//15*d^-1*(1+-1*cosh(c+d*x))^-1*sinh(c+d*x)+-2//15*d^-1*(1+-1*cosh(c+d*x))^-2*sinh(c+d*x)+-1//5*d^-1*(1+-1*cosh(c+d*x))^-3*sinh(c+d*x))
@test integrate((1+-1*cosh(c+d*x))^-4, x) == :(-3//35*d^-1*(1+-1*cosh(c+d*x))^-3*sinh(c+d*x)+-2//35*d^-1*(1+-1*cosh(c+d*x))^-1*sinh(c+d*x)+-2//35*d^-1*(1+-1*cosh(c+d*x))^-2*sinh(c+d*x)+-1//7*d^-1*(1+-1*cosh(c+d*x))^-4*sinh(c+d*x))
@test integrate((a+a*cosh(x))^-1//2*cosh(x), x) == :(2*(a+a*cosh(x))^-1//2*sinh(x)+-1*2^(1/2)*a^-1//2*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*cosh(x))^-1//2*sinh(x)))
@test integrate((a+-1*a*cosh(x))^-1//2*cosh(x), x) == :(2*(a+-1*a*cosh(x))^-1//2*sinh(x)+-1*2^(1/2)*a^-1//2*arctan((1/2)*2^(1/2)*a^(1/2)*(a+-1*a*cosh(x))^-1//2*sinh(x)))
@test integrate((a+a*cosh(c+d*x))^5//2, x) == :(2//5*a*d^-1*(a+a*cosh(c+d*x))^3//2*sinh(c+d*x)+16//15*a^2*d^-1*(a+a*cosh(c+d*x))^(1/2)*sinh(c+d*x)+64//15*a^3*d^-1*(a+a*cosh(c+d*x))^-1//2*sinh(c+d*x))
@test integrate((a+a*cosh(c+d*x))^3//2, x) == :(2//3*a*d^-1*(a+a*cosh(c+d*x))^(1/2)*sinh(c+d*x)+8//3*a^2*d^-1*(a+a*cosh(c+d*x))^-1//2*sinh(c+d*x))
@test integrate((a+a*cosh(c+d*x))^(1/2), x) == :(2*a*d^-1*(a+a*cosh(c+d*x))^-1//2*sinh(c+d*x))
@test integrate((a+a*cosh(c+d*x))^-1//2, x) == :(2^(1/2)*a^-1//2*d^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*cosh(c+d*x))^-1//2*sinh(c+d*x)))
@test integrate((a+a*cosh(c+d*x))^-3//2, x) == :((1/2)*d^-1*(a+a*cosh(c+d*x))^-3//2*sinh(c+d*x)+1//4*2^(1/2)*a^-3//2*d^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*cosh(c+d*x))^-1//2*sinh(c+d*x)))
@test integrate((a+a*cosh(c+d*x))^-5//2, x) == :(1//4*d^-1*(a+a*cosh(c+d*x))^-5//2*sinh(c+d*x)+3//16*a^-1*d^-1*(a+a*cosh(c+d*x))^-3//2*sinh(c+d*x)+3//32*2^(1/2)*a^-5//2*d^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*cosh(c+d*x))^-1//2*sinh(c+d*x)))
@test integrate((a+-1*a*cosh(c+d*x))^5//2, x) == :(-64//15*a^3*d^-1*(a+-1*a*cosh(c+d*x))^-1//2*sinh(c+d*x)+-16//15*a^2*d^-1*(a+-1*a*cosh(c+d*x))^(1/2)*sinh(c+d*x)+-2//5*a*d^-1*(a+-1*a*cosh(c+d*x))^3//2*sinh(c+d*x))
@test integrate((a+-1*a*cosh(c+d*x))^3//2, x) == :(-8//3*a^2*d^-1*(a+-1*a*cosh(c+d*x))^-1//2*sinh(c+d*x)+-2//3*a*d^-1*(a+-1*a*cosh(c+d*x))^(1/2)*sinh(c+d*x))
@test integrate((a+-1*a*cosh(c+d*x))^(1/2), x) == :(-2*a*d^-1*(a+-1*a*cosh(c+d*x))^-1//2*sinh(c+d*x))
@test integrate((a+-1*a*cosh(c+d*x))^-1//2, x) == :(-1*2^(1/2)*a^-1//2*d^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+-1*a*cosh(c+d*x))^-1//2*sinh(c+d*x)))
@test integrate((a+-1*a*cosh(c+d*x))^-3//2, x) == :(-1//2*d^-1*(a+-1*a*cosh(c+d*x))^-3//2*sinh(c+d*x)+-1//4*2^(1/2)*a^-3//2*d^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+-1*a*cosh(c+d*x))^-1//2*sinh(c+d*x)))
@test integrate((a+-1*a*cosh(c+d*x))^-5//2, x) == :(-1//4*d^-1*(a+-1*a*cosh(c+d*x))^-5//2*sinh(c+d*x)+-3//16*a^-1*d^-1*(a+-1*a*cosh(c+d*x))^-3//2*sinh(c+d*x)+-3//32*2^(1/2)*a^-5//2*d^-1*arctan((1/2)*2^(1/2)*a^(1/2)*(a+-1*a*cosh(c+d*x))^-1//2*sinh(c+d*x)))
@test integrate((a+b*cosh(x))^-1*cosh(x)^4, x) == :(1//3*b^-1*cosh(x)^2*sinh(x)+1//3*b^-3*(2*b^2+3*a^2)*sinh(x)+-1//2*a*x*b^-4*(b^2+2*a^2)+-1//2*a*b^-2*cosh(x)*sinh(x)+2*a^4*b^-4*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*cosh(x)^3, x) == :((1/2)*x*b^-3*(b^2+2*a^2)+(1/2)*b^-1*cosh(x)*sinh(x)+-1*a*b^-2*sinh(x)+-2*a^3*b^-3*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*cosh(x)^2, x) == :(b^-1*sinh(x)+-1*a*x*b^-2+2*a^2*b^-2*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*cosh(x), x) == :(x*b^-1+-2*a*b^-1*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*sech(x), x) == :(a^-1*arctan(sinh(x))+-2*b*a^-1*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*sech(x)^2, x) == :(a^-1*tanh(x)+-1*b*a^-2*arctan(sinh(x))+2*a^-2*b^2*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*sech(x)^3, x) == :((1/2)*a^-1*sech(x)*tanh(x)+(1/2)*a^-3*(a^2+2*b^2)*arctan(sinh(x))+-1*b*a^-2*tanh(x)+-2*a^-3*b^3*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*sech(x)^4, x) == :(1//3*a^-1*sech(x)^2*tanh(x)+1//3*a^-3*(2*a^2+3*b^2)*tanh(x)+-1//2*b*a^-4*(a^2+2*b^2)*arctan(sinh(x))+-1//2*b*a^-2*sech(x)*tanh(x)+2*a^-4*b^4*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(c+d*x))^5, x) == :(1//8*a*x*(8*a^4+15*b^4+40*a^2*b^2)+1//5*b*d^-1*(a+b*cosh(c+d*x))^4*sinh(c+d*x)+1//30*b*d^-1*(16*b^4+107*a^4+192*a^2*b^2)*sinh(c+d*x)+1//60*b*d^-1*(a+b*cosh(c+d*x))^2*(16*b^2+47*a^2)*sinh(c+d*x)+9//20*a*b*d^-1*(a+b*cosh(c+d*x))^3*sinh(c+d*x)+7//120*a*b^2*d^-1*(22*a^2+23*b^2)*cosh(c+d*x)*sinh(c+d*x))
@test integrate((a+b*cosh(c+d*x))^4, x) == :(x*(a^4+3//8*b^4+3*a^2*b^2)+1//4*b*d^-1*(a+b*cosh(c+d*x))^3*sinh(c+d*x)+1//6*a*b*d^-1*(16*b^2+19*a^2)*sinh(c+d*x)+1//24*b^2*d^-1*(9*b^2+26*a^2)*cosh(c+d*x)*sinh(c+d*x)+7//12*a*b*d^-1*(a+b*cosh(c+d*x))^2*sinh(c+d*x))
@test integrate((a+b*cosh(c+d*x))^3, x) == :((1/2)*a*x*(2*a^2+3*b^2)+1//3*b*d^-1*(a+b*cosh(c+d*x))^2*sinh(c+d*x)+2//3*b*d^-1*(b^2+4*a^2)*sinh(c+d*x)+5//6*a*b^2*d^-1*cosh(c+d*x)*sinh(c+d*x))
@test integrate((a+b*cosh(c+d*x))^2, x) == :(x*(a^2+(1/2)*b^2)+(1/2)*b^2*d^-1*cosh(c+d*x)*sinh(c+d*x)+2*a*b*d^-1*sinh(c+d*x))
@test integrate(a+b*cosh(c+d*x), x) == :(a*x+b*d^-1*sinh(c+d*x))
@test integrate((a+b*cosh(c+d*x))^-1, x) == :(2*d^-1*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*c+(1/2)*d*x)))
@test integrate((a+b*cosh(c+d*x))^-2, x) == :(-1*b*d^-1*(a+b*cosh(c+d*x))^-1*(a^2+-1*b^2)^-1*sinh(c+d*x)+2*a*d^-1*(a+b)^-3//2*(a+-1b)^-3//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*c+(1/2)*d*x)))
@test integrate((a+b*cosh(c+d*x))^-3, x) == :(d^-1*(a+b)^-5//2*(a+-1b)^-5//2*(b^2+2*a^2)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*c+(1/2)*d*x))+-1*b*d^-1*(a+b*cosh(c+d*x))^-2*(-2*b^2+2*a^2)^-1*sinh(c+d*x)+-3//2*a*b*d^-1*(a+b*cosh(c+d*x))^-1*(a^2+-1*b^2)^-2*sinh(c+d*x))
@test integrate((a+b*cosh(c+d*x))^-4, x) == :(-1*b*d^-1*(a+b*cosh(c+d*x))^-3*(-3*b^2+3*a^2)^-1*sinh(c+d*x)+a*d^-1*(a+b)^-7//2*(a+-1b)^-7//2*(2*a^2+3*b^2)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*c+(1/2)*d*x))+-5//6*a*b*d^-1*(a+b*cosh(c+d*x))^-2*(a^2+-1*b^2)^-2*sinh(c+d*x)+-1//6*b*d^-1*(a+b*cosh(c+d*x))^-1*(a^2+-1*b^2)^-3*(4*b^2+11*a^2)*sinh(c+d*x))
@test integrate((3+5*cosh(c+d*x))^-1, x) == :((1/2)*d^-1*arctan((1/2)*tanh((1/2)*c+(1/2)*d*x)))
@test integrate((3+5*cosh(c+d*x))^-2, x) == :(-3//32*d^-1*arctan((1/2)*tanh((1/2)*c+(1/2)*d*x))+5//16*d^-1*(3+5*cosh(c+d*x))^-1*sinh(c+d*x))
@test integrate((3+5*cosh(c+d*x))^-3, x) == :(43//1024*d^-1*arctan((1/2)*tanh((1/2)*c+(1/2)*d*x))+-45//512*d^-1*(3+5*cosh(c+d*x))^-1*sinh(c+d*x)+5//32*d^-1*(3+5*cosh(c+d*x))^-2*sinh(c+d*x))
@test integrate((3+5*cosh(c+d*x))^-4, x) == :(-279//16384*d^-1*arctan((1/2)*tanh((1/2)*c+(1/2)*d*x))+-25//512*d^-1*(3+5*cosh(c+d*x))^-2*sinh(c+d*x)+5//48*d^-1*(3+5*cosh(c+d*x))^-3*sinh(c+d*x)+995//24576*d^-1*(3+5*cosh(c+d*x))^-1*sinh(c+d*x))
@test integrate((5+3*cosh(c+d*x))^-1, x) == :(1//4*x+-1//2*d^-1*arctanh((3+cosh(c+d*x))^-1*sinh(c+d*x)))
@test integrate((5+3*cosh(c+d*x))^-2, x) == :(5//64*x+-5//32*d^-1*arctanh((3+cosh(c+d*x))^-1*sinh(c+d*x))+-3//16*d^-1*(5+3*cosh(c+d*x))^-1*sinh(c+d*x))
@test integrate((5+3*cosh(c+d*x))^-3, x) == :(59//2048*x+-59//1024*d^-1*arctanh((3+cosh(c+d*x))^-1*sinh(c+d*x))+-45//512*d^-1*(5+3*cosh(c+d*x))^-1*sinh(c+d*x)+-3//32*d^-1*(5+3*cosh(c+d*x))^-2*sinh(c+d*x))
@test integrate((5+3*cosh(c+d*x))^-4, x) == :(385//32768*x+-385//16384*d^-1*arctanh((3+cosh(c+d*x))^-1*sinh(c+d*x))+-311//8192*d^-1*(5+3*cosh(c+d*x))^-1*sinh(c+d*x)+-25//512*d^-1*(5+3*cosh(c+d*x))^-2*sinh(c+d*x)+-1//16*d^-1*(5+3*cosh(c+d*x))^-3*sinh(c+d*x))
@test integrate((a+b*cosh(x))^5//2, x) == :(2//5*b*(a+b*cosh(x))^3//2*sinh(x)+16//15*a*b*(a+b*cosh(x))^(1/2)*sinh(x)+-2//15*im*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*(9*b^2+23*a^2)*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1)+16//15*im*a*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+b*cosh(x))^3//2, x) == :(2//3*b*(a+b*cosh(x))^(1/2)*sinh(x)+-8//3*im*a*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1)+2//3*im*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+b*cosh(c+d*x))^(1/2), x) == :(-2*im*d^-1*((a+b)^-1*(a+b*cosh(c+d*x)))^-1//2*(a+b*cosh(c+d*x))^(1/2)*Elliptic.E((1/2)*im*(c+d*x),2*b*(a+b)^-1))
@test integrate((a+b*cosh(x))^-1//2, x) == :(-2*im*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+b*cosh(x))^-3//2, x) == :(-2*b*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)^-1*sinh(x)+-2*im*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*(a^2+-1*b^2)^-1*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+b*cosh(x))^-5//2, x) == :(-2*b*(a+b*cosh(x))^-3//2*(-3*b^2+3*a^2)^-1*sinh(x)+2*im*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*(-3*b^2+3*a^2)^-1*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1)+-8//3*a*b*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)^-2*sinh(x)+-8//3*im*a*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*(a^2+-1*b^2)^-2*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+b*cosh(x))^-7//2, x) == :(-2*b*(a+b*cosh(x))^-5//2*(-5*b^2+5*a^2)^-1*sinh(x)+-16//15*a*b*(a+b*cosh(x))^-3//2*(a^2+-1*b^2)^-2*sinh(x)+-2//15*b*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)^-3*(9*b^2+23*a^2)*sinh(x)+-2//15*im*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*(a^2+-1*b^2)^-3*(9*b^2+23*a^2)*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1)+16//15*im*a*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)^-2*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+b*cosh(x))^-1//2*cosh(x), x) == :(-2*im*b^-1*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1)+2*im*a*b^-1*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+a*cosh(x))^5//2*(A+B*cosh(x)), x) == :(2//7*B*(a+a*cosh(x))^5//2*sinh(x)+2//35*a*(a+a*cosh(x))^3//2*(5B+7A)*sinh(x)+16//105*a^2*(a+a*cosh(x))^(1/2)*(5B+7A)*sinh(x)+64//105*a^3*(a+a*cosh(x))^-1//2*(5B+7A)*sinh(x))
@test integrate((a+a*cosh(x))^3//2*(A+B*cosh(x)), x) == :(2//5*B*(a+a*cosh(x))^3//2*sinh(x)+2//15*a*(a+a*cosh(x))^(1/2)*(3B+5A)*sinh(x)+8//15*a^2*(a+a*cosh(x))^-1//2*(3B+5A)*sinh(x))
@test integrate((a+a*cosh(x))^(1/2)*(A+B*cosh(x)), x) == :(2//3*B*(a+a*cosh(x))^(1/2)*sinh(x)+2//3*a*(a+a*cosh(x))^-1//2*(B+3A)*sinh(x))
@test integrate((a+-1*a*cosh(x))^5//2*(A+B*cosh(x)), x) == :(2//7*B*(a+-1*a*cosh(x))^5//2*sinh(x)+-64//105*a^3*(a+-1*a*cosh(x))^-1//2*(-5B+7A)*sinh(x)+-16//105*a^2*(a+-1*a*cosh(x))^(1/2)*(-5B+7A)*sinh(x)+-2//35*a*(a+-1*a*cosh(x))^3//2*(-5B+7A)*sinh(x))
@test integrate((a+-1*a*cosh(x))^3//2*(A+B*cosh(x)), x) == :(2//5*B*(a+-1*a*cosh(x))^3//2*sinh(x)+-8//15*a^2*(a+-1*a*cosh(x))^-1//2*(-3B+5A)*sinh(x)+-2//15*a*(a+-1*a*cosh(x))^(1/2)*(-3B+5A)*sinh(x))
@test integrate((a+-1*a*cosh(x))^(1/2)*(A+B*cosh(x)), x) == :(2//3*B*(a+-1*a*cosh(x))^(1/2)*sinh(x)+-2//3*a*(a+-1*a*cosh(x))^-1//2*(-1B+3A)*sinh(x))
@test integrate((1+cosh(x))^-1*(A+B*cosh(x)), x) == :(B*x+(1+cosh(x))^-1*(A+-1B)*sinh(x))
@test integrate((1+cosh(x))^-2*(A+B*cosh(x)), x) == :((3+3*cosh(x))^-1*(A+2B)*sinh(x)+1//3*(1+cosh(x))^-2*(A+-1B)*sinh(x))
@test integrate((1+cosh(x))^-3*(A+B*cosh(x)), x) == :((15+15*cosh(x))^-1*(2A+3B)*sinh(x)+1//5*(1+cosh(x))^-3*(A+-1B)*sinh(x)+1//15*(1+cosh(x))^-2*(2A+3B)*sinh(x))
@test integrate((1+cosh(x))^-4*(A+B*cosh(x)), x) == :((105+105*cosh(x))^-1*(6A+8B)*sinh(x)+1//7*(1+cosh(x))^-4*(A+-1B)*sinh(x)+1//35*(1+cosh(x))^-3*(3A+4B)*sinh(x)+1//105*(1+cosh(x))^-2*(6A+8B)*sinh(x))
@test integrate((1+-1*cosh(x))^-1*(A+B*cosh(x)), x) == :(-1*B*x+-1*(1+-1*cosh(x))^-1*(A+B)*sinh(x))
@test integrate((1+-1*cosh(x))^-2*(A+B*cosh(x)), x) == :(-1*(3+-3*cosh(x))^-1*(A+-2B)*sinh(x)+-1//3*(1+-1*cosh(x))^-2*(A+B)*sinh(x))
@test integrate((1+-1*cosh(x))^-3*(A+B*cosh(x)), x) == :(-1*(15+-15*cosh(x))^-1*(-3B+2A)*sinh(x)+-1//5*(1+-1*cosh(x))^-3*(A+B)*sinh(x)+-1//15*(1+-1*cosh(x))^-2*(-3B+2A)*sinh(x))
@test integrate((1+-1*cosh(x))^-4*(A+B*cosh(x)), x) == :(-1*(105+-105*cosh(x))^-1*(-8B+6A)*sinh(x)+-1//7*(1+-1*cosh(x))^-4*(A+B)*sinh(x)+-1//35*(1+-1*cosh(x))^-3*(-4B+3A)*sinh(x)+-1//105*(1+-1*cosh(x))^-2*(-8B+6A)*sinh(x))
@test integrate((a+a*cosh(x))^-1//2*(A+B*cosh(x)), x) == :(2*B*(a+a*cosh(x))^-1//2*sinh(x)+2^(1/2)*a^-1//2*(A+-1B)*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*cosh(x))^-1//2*sinh(x)))
@test integrate((a+a*cosh(x))^-3//2*(A+B*cosh(x)), x) == :((1/2)*(a+a*cosh(x))^-3//2*(A+-1B)*sinh(x)+1//4*2^(1/2)*a^-3//2*(A+3B)*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*cosh(x))^-1//2*sinh(x)))
@test integrate((a+a*cosh(x))^-5//2*(A+B*cosh(x)), x) == :(1//4*(a+a*cosh(x))^-5//2*(A+-1B)*sinh(x)+1//16*a^-1*(a+a*cosh(x))^-3//2*(3A+5B)*sinh(x)+1//32*2^(1/2)*a^-5//2*(3A+5B)*arctan((1/2)*2^(1/2)*a^(1/2)*(a+a*cosh(x))^-1//2*sinh(x)))
@test integrate((a+-1*a*cosh(x))^-1//2*(A+B*cosh(x)), x) == :(2*B*(a+-1*a*cosh(x))^-1//2*sinh(x)+-1*2^(1/2)*a^-1//2*(A+B)*arctan((1/2)*2^(1/2)*a^(1/2)*(a+-1*a*cosh(x))^-1//2*sinh(x)))
@test integrate((a+-1*a*cosh(x))^-3//2*(A+B*cosh(x)), x) == :(-1//2*(a+-1*a*cosh(x))^-3//2*(A+B)*sinh(x)+-1//4*2^(1/2)*a^-3//2*(A+-3B)*arctan((1/2)*2^(1/2)*a^(1/2)*(a+-1*a*cosh(x))^-1//2*sinh(x)))
@test integrate((a+-1*a*cosh(x))^-5//2*(A+B*cosh(x)), x) == :(-1//4*(a+-1*a*cosh(x))^-5//2*(A+B)*sinh(x)+-1//16*a^-1*(a+-1*a*cosh(x))^-3//2*(-5B+3A)*sinh(x)+-1//32*2^(1/2)*a^-5//2*(-5B+3A)*arctan((1/2)*2^(1/2)*a^(1/2)*(a+-1*a*cosh(x))^-1//2*sinh(x)))
@test integrate((a+b*cosh(x))^5//2*(A+B*cosh(x)), x) == :((a+b*cosh(x))^(1/2)*(2//7*B*a^2+10//21*B*b^2+16//15*A*a*b)*sinh(x)+(a+b*cosh(x))^3//2*(2//5*A*b+2//7*B*a)*sinh(x)+2//7*B*(a+b*cosh(x))^5//2*sinh(x)+-2//105*im*b^-1*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*(15*B*a^3+63*A*b^3+145*B*a*b^2+161*A*b*a^2)*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1)+2//105*im*b^-1*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)*(15*B*a^2+25*B*b^2+56*A*a*b)*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+b*cosh(x))^3//2*(A+B*cosh(x)), x) == :((a+b*cosh(x))^(1/2)*(2//3*A*b+2//5*B*a)*sinh(x)+2//5*B*(a+b*cosh(x))^3//2*sinh(x)+-2//15*im*b^-1*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*(3*B*a^2+9*B*b^2+20*A*a*b)*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1)+2//15*im*b^-1*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)*(3*B*a+5*A*b)*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+b*cosh(x))^(1/2)*(A+B*cosh(x)), x) == :(2//3*B*(a+b*cosh(x))^(1/2)*sinh(x)+-2//3*im*b^-1*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*(B*a+3*A*b)*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1)+2//3*im*B*b^-1*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+b*cosh(x))^-1*(A+B*cosh(x)), x) == :(B*x*b^-1+b^-1*(a+b)^-1//2*(a+-1b)^-1//2*(-2*B*a+2*A*b)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-2*(A+B*cosh(x)), x) == :((a+b)^-3//2*(a+-1b)^-3//2*(-2*B*b+2*A*a)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x))+-1*(a+b*cosh(x))^-1*(a^2+-1*b^2)^-1*(A*b+-1*B*a)*sinh(x))
@test integrate((a+b*cosh(x))^-3*(A+B*cosh(x)), x) == :((a+b)^-5//2*(a+-1b)^-5//2*(A*b^2+2*A*a^2+-3*B*a*b)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x))+-1*(a+b*cosh(x))^-2*(-2*b^2+2*a^2)^-1*(A*b+-1*B*a)*sinh(x)+-1//2*(a+b*cosh(x))^-1*(a^2+-1*b^2)^-2*(-1*B*a^2+-2*B*b^2+3*A*a*b)*sinh(x))
@test integrate((a+b*cosh(x))^-4*(A+B*cosh(x)), x) == :((a+b)^-7//2*(a+-1b)^-7//2*(-1*B*b^3+2*A*a^3+-4*B*b*a^2+3*A*a*b^2)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x))+-1*(a+b*cosh(x))^-3*(-3*b^2+3*a^2)^-1*(A*b+-1*B*a)*sinh(x)+-1//6*(a+b*cosh(x))^-1*(a^2+-1*b^2)^-3*(-2*B*a^3+4*A*b^3+-13*B*a*b^2+11*A*b*a^2)*sinh(x)+-1//6*(a+b*cosh(x))^-2*(a^2+-1*b^2)^-2*(-3*B*b^2+-2*B*a^2+5*A*a*b)*sinh(x))
@test integrate((a+b*cosh(x))^-1*(B*cosh(x)+B*b*a^-1), x) == :(B*x*b^-1+-2*B*a^-1*b^-1*(a+b)^(1/2)*(a+-1b)^(1/2)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*(B*cosh(x)+B*a*b^-1), x) == :(B*x*b^-1)
@test integrate((b+a*cosh(x))^-2*(a+b*cosh(x)), x) == :((b+a*cosh(x))^-1*sinh(x))
@test integrate((2+-1*cosh(x))^-1*(3+cosh(x)), x) == :(-1x+5//3*x*3^(1/2)+10//3*3^(1/2)*arctanh((2+3^(1/2)+-1*cosh(x))^-1*sinh(x)))
@test integrate((a+b*cosh(x))^-1//2*(A+B*cosh(x)), x) == :(-2*im*B*b^-1*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1)+-2*im*b^-1*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*(A*b+-1*B*a)*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+b*cosh(x))^-3//2*(A+B*cosh(x)), x) == :(-1*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)^-1*(-2*B*a+2*A*b)*sinh(x)+-2*im*B*b^-1*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1)+-2*im*b^-1*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*(a^2+-1*b^2)^-1*(A*b+-1*B*a)*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a+b*cosh(x))^-5//2*(A+B*cosh(x)), x) == :(-1*(a+b*cosh(x))^-3//2*(-3*b^2+3*a^2)^-1*(-2*B*a+2*A*b)*sinh(x)+-1//3*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)^-2*(-6*B*b^2+-2*B*a^2+8*A*a*b)*sinh(x)+-2//3*im*b^-1*((a+b)^-1*(a+b*cosh(x)))^-1//2*(a+b*cosh(x))^(1/2)*(a^2+-1*b^2)^-2*(-1*B*a^2+-3*B*b^2+4*A*a*b)*Elliptic.E((1/2)*im*x,2*b*(a+b)^-1)+2//3*im*b^-1*((a+b)^-1*(a+b*cosh(x)))^(1/2)*(a+b*cosh(x))^-1//2*(a^2+-1*b^2)^-1*(A*b+-1*B*a)*Elliptic.F((1/2)*im*x,2*b*(a+b)^-1))
@test integrate((a*cosh(x)^2)^7//2, x) == :(1//7*(a*cosh(x)^2)^7//2*tanh(x)+6//35*a*(a*cosh(x)^2)^5//2*tanh(x)+8//35*a^2*(a*cosh(x)^2)^3//2*tanh(x)+16//35*a^3*(a*cosh(x)^2)^(1/2)*tanh(x))
@test integrate((a*cosh(x)^2)^5//2, x) == :(1//5*(a*cosh(x)^2)^5//2*tanh(x)+4//15*a*(a*cosh(x)^2)^3//2*tanh(x)+8//15*a^2*(a*cosh(x)^2)^(1/2)*tanh(x))
@test integrate((a*cosh(x)^2)^3//2, x) == :(1//3*(a*cosh(x)^2)^3//2*tanh(x)+2//3*a*(a*cosh(x)^2)^(1/2)*tanh(x))
@test integrate((a*cosh(x)^2)^(1/2), x) == :((a*cosh(x)^2)^(1/2)*tanh(x))
@test integrate((a*cosh(x)^2)^-1//2, x) == :((a*cosh(x)^2)^-1//2*arctan(sinh(x))*cosh(x))
@test integrate((a*cosh(x)^2)^-3//2, x) == :((1/2)*a^-1*(a*cosh(x)^2)^-1//2*tanh(x)+(1/2)*a^-1*(a*cosh(x)^2)^-1//2*arctan(sinh(x))*cosh(x))
@test integrate((a*cosh(x)^2)^-5//2, x) == :(1//4*a^-1*(a*cosh(x)^2)^-3//2*tanh(x)+3//8*a^-2*(a*cosh(x)^2)^-1//2*tanh(x)+3//8*a^-2*(a*cosh(x)^2)^-1//2*arctan(sinh(x))*cosh(x))
@test integrate((a*cosh(x)^3)^5//2, x) == :(26//77*a^2*(a*cosh(x)^3)^(1/2)*tanh(x)+2//15*a^2*(a*cosh(x)^3)^(1/2)*cosh(x)^5*sinh(x)+26//165*a^2*(a*cosh(x)^3)^(1/2)*cosh(x)^3*sinh(x)+78//385*a^2*(a*cosh(x)^3)^(1/2)*cosh(x)*sinh(x)+-26//77*im*a^2*(a*cosh(x)^3)^(1/2)*cosh(x)^-3//2*Elliptic.F((1/2)*im*x,2))
@test integrate((a*cosh(x)^3)^3//2, x) == :(14//45*a*(a*cosh(x)^3)^(1/2)*sinh(x)+2//9*a*(a*cosh(x)^3)^(1/2)*cosh(x)^2*sinh(x)+-14//15*im*a*(a*cosh(x)^3)^(1/2)*cosh(x)^-3//2*Elliptic.E((1/2)*im*x,2))
@test integrate((a*cosh(x)^3)^(1/2), x) == :(2//3*(a*cosh(x)^3)^(1/2)*tanh(x)+-2//3*im*(a*cosh(x)^3)^(1/2)*cosh(x)^-3//2*Elliptic.F((1/2)*im*x,2))
@test integrate((a*cosh(x)^3)^-1//2, x) == :(2*(a*cosh(x)^3)^-1//2*cosh(x)*sinh(x)+2*im*(a*cosh(x)^3)^-1//2*cosh(x)^3//2*Elliptic.E((1/2)*im*x,2))
@test integrate((a*cosh(x)^3)^-3//2, x) == :(10//21*a^-1*(a*cosh(x)^3)^-1//2*sinh(x)+2//7*a^-1*(a*cosh(x)^3)^-1//2*sech(x)*tanh(x)+-10//21*im*a^-1*(a*cosh(x)^3)^-1//2*cosh(x)^3//2*Elliptic.F((1/2)*im*x,2))
@test integrate((a*cosh(x)^3)^-5//2, x) == :(154//585*a^-2*(a*cosh(x)^3)^-1//2*tanh(x)+2//13*a^-2*(a*cosh(x)^3)^-1//2*sech(x)^4*tanh(x)+22//117*a^-2*(a*cosh(x)^3)^-1//2*sech(x)^2*tanh(x)+154//195*a^-2*(a*cosh(x)^3)^-1//2*cosh(x)*sinh(x)+154//195*im*a^-2*(a*cosh(x)^3)^-1//2*cosh(x)^3//2*Elliptic.E((1/2)*im*x,2))
@test integrate((a*cosh(x)^4)^5//2, x) == :(63//256*a^2*(a*cosh(x)^4)^(1/2)*tanh(x)+1//10*a^2*(a*cosh(x)^4)^(1/2)*cosh(x)^7*sinh(x)+9//80*a^2*(a*cosh(x)^4)^(1/2)*cosh(x)^5*sinh(x)+21//128*a^2*(a*cosh(x)^4)^(1/2)*cosh(x)*sinh(x)+21//160*a^2*(a*cosh(x)^4)^(1/2)*cosh(x)^3*sinh(x)+63//256*x*a^2*(a*cosh(x)^4)^(1/2)*sech(x)^2)
@test integrate((a*cosh(x)^4)^3//2, x) == :(5//16*a*(a*cosh(x)^4)^(1/2)*tanh(x)+1//6*a*(a*cosh(x)^4)^(1/2)*cosh(x)^3*sinh(x)+5//16*a*x*(a*cosh(x)^4)^(1/2)*sech(x)^2+5//24*a*(a*cosh(x)^4)^(1/2)*cosh(x)*sinh(x))
@test integrate((a*cosh(x)^4)^(1/2), x) == :((1/2)*(a*cosh(x)^4)^(1/2)*tanh(x)+(1/2)*x*(a*cosh(x)^4)^(1/2)*sech(x)^2)
@test integrate((a*cosh(x)^4)^-1//2, x) == :((a*cosh(x)^4)^-1//2*cosh(x)*sinh(x))
@test integrate((a*cosh(x)^4)^-3//2, x) == :(a^-1*(a*cosh(x)^4)^-1//2*cosh(x)*sinh(x)+-2//3*a^-1*(a*cosh(x)^4)^-1//2*sinh(x)^2*tanh(x)+1//5*a^-1*(a*cosh(x)^4)^-1//2*sinh(x)^2*tanh(x)^3)
@test integrate((a*cosh(x)^4)^-5//2, x) == :(a^-2*(a*cosh(x)^4)^-1//2*cosh(x)*sinh(x)+-4//3*a^-2*(a*cosh(x)^4)^-1//2*sinh(x)^2*tanh(x)+-4//7*a^-2*(a*cosh(x)^4)^-1//2*sinh(x)^2*tanh(x)^5+1//9*a^-2*(a*cosh(x)^4)^-1//2*sinh(x)^2*tanh(x)^7+6//5*a^-2*(a*cosh(x)^4)^-1//2*sinh(x)^2*tanh(x)^3)
@test integrate((1+cosh(x))^-2*sinh(x), x) == :(-1*(1+cosh(x))^-1)
@test integrate((1+-1*cosh(x))^-2*sinh(x), x) == :((1+-1*cosh(x))^-1)
@test integrate((1+cosh(x))^-2*sinh(x)^2, x) == :(x+-2*(1+cosh(x))^-1*sinh(x))
@test integrate((1+-1*cosh(x))^-2*sinh(x)^2, x) == :(x+2*(1+-1*cosh(x))^-1*sinh(x))
@test integrate((1+cosh(x))^-2*sinh(x)^3, x) == :(-2*log(1+cosh(x))+cosh(x))
@test integrate((1+-1*cosh(x))^-2*sinh(x)^3, x) == :(2*log(1+-1*cosh(x))+cosh(x))
@test integrate((1+cosh(x))^-3*sinh(x), x) == :(-1//2*(1+cosh(x))^-2)
@test integrate((1+-1*cosh(x))^-3*sinh(x), x) == :((1/2)*(1+-1*cosh(x))^-2)
@test integrate((1+cosh(x))^-3*sinh(x)^2, x) == :(1//3*(1+cosh(x))^-3*sinh(x)^3)
@test integrate((1+-1*cosh(x))^-3*sinh(x)^2, x) == :(-1//3*(1+-1*cosh(x))^-3*sinh(x)^3)
@test integrate((1+cosh(x))^-3*sinh(x)^3, x) == :(2*(1+cosh(x))^-1+log(1+cosh(x)))
@test integrate((1+-1*cosh(x))^-3*sinh(x)^3, x) == :(-1*log(1+-1*cosh(x))+-2*(1+-1*cosh(x))^-1)
@test integrate((a+a*cosh(x))^-1*sinh(x)^8, x) == :(1//7*a^-1*sinh(x)^7+5//16*x*a^-1+-5//16*a^-1*cosh(x)*sinh(x)+-1//6*a^-1*sinh(x)^5*cosh(x)+5//24*a^-1*sinh(x)^3*cosh(x))
@test integrate((a+a*cosh(x))^-1*sinh(x)^7, x) == :(a^-5*(a+-1*a*cosh(x))^4+-4//5*a^-6*(a+-1*a*cosh(x))^5+1//6*a^-7*(a+-1*a*cosh(x))^6)
@test integrate((a+a*cosh(x))^-1*sinh(x)^6, x) == :(-3//8*x*a^-1+1//5*a^-1*sinh(x)^5+-1//4*a^-1*sinh(x)^3*cosh(x)+3//8*a^-1*cosh(x)*sinh(x))
@test integrate((a+a*cosh(x))^-1*sinh(x)^5, x) == :(-2//3*a^-4*(a+-1*a*cosh(x))^3+1//4*a^-5*(a+-1*a*cosh(x))^4)
@test integrate((a+a*cosh(x))^-1*sinh(x)^4, x) == :((1/2)*x*a^-1+1//3*a^-1*sinh(x)^3+-1//2*a^-1*cosh(x)*sinh(x))
@test integrate((a+a*cosh(x))^-1*sinh(x)^3, x) == :((1/2)*a^-1*cosh(x)^2+-1*a^-1*cosh(x))
@test integrate((a+a*cosh(x))^-1*sinh(x)^2, x) == :(a^-1*sinh(x)+-1*x*a^-1)
@test integrate((a+a*cosh(x))^-1*sinh(x), x) == :(a^-1*log(1+cosh(x)))
@test integrate((a+a*cosh(x))^-1*csch(x), x) == :((2a+2*a*cosh(x))^-1+-1//2*a^-1*arctanh(cosh(x)))
@test integrate((a+a*cosh(x))^-1*csch(x)^2, x) == :((3a+3*a*cosh(x))^-1*csch(x)+-2//3*a^-1*coth(x))
@test integrate((a+a*cosh(x))^-1*csch(x)^3, x) == :((8a+-8*a*cosh(x))^-1+-1*(4a+4*a*cosh(x))^-1+-1//8*a*(a+a*cosh(x))^-2+3//8*a^-1*arctanh(cosh(x)))
@test integrate((a+a*cosh(x))^-1*csch(x)^4, x) == :((5a+5*a*cosh(x))^-1*csch(x)^3+-4//15*a^-1*coth(x)^3+4//5*a^-1*coth(x))
@test integrate((a+a*cosh(x))^-1*csch(x)^5, x) == :(-1*(8a+-8*a*cosh(x))^-1+3*(16a+16*a*cosh(x))^-1+-5//16*a^-1*arctanh(cosh(x))+-1//32*a*(a+-1*a*cosh(x))^-2+1//24*a^2*(a+a*cosh(x))^-3+3//32*a*(a+a*cosh(x))^-2)
@test integrate((a+b*cosh(x))^-1*sinh(x)^7, x) == :(1//6*b^-1*cosh(x)^6+b^-7*(a^2+-1*b^2)^3*log(a+b*cosh(x))+(1/2)*b^-5*cosh(x)^2*(a^4+3*b^4+-3*a^2*b^2)+-1//5*a*b^-2*cosh(x)^5+1//4*b^-3*cosh(x)^4*(a^2+-3*b^2)+-1*a*b^-6*(a^4+3*b^4+-3*a^2*b^2)*cosh(x)+-1//3*a*b^-4*cosh(x)^3*(a^2+-3*b^2))
@test integrate((a+b*cosh(x))^-1*sinh(x)^6, x) == :(1//5*b^-1*sinh(x)^5+1//8*b^-5*(8*(a^2+-1*b^2)^2+-1*a*b*(-7*b^2+4*a^2)*cosh(x))*sinh(x)+1//12*b^-3*sinh(x)^3*(-4*b^2+4*a^2+-3*a*b*cosh(x))+2*b^-6*(a+b)^5//2*(a+-1b)^5//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x))+-1//8*a*x*b^-6*(8*a^4+15*b^4+-20*a^2*b^2))
@test integrate((a+b*cosh(x))^-1*sinh(x)^5, x) == :(1//4*b^-1*cosh(x)^4+b^-5*(a^2+-1*b^2)^2*log(a+b*cosh(x))+(1/2)*b^-3*cosh(x)^2*(a^2+-2*b^2)+-1//3*a*b^-2*cosh(x)^3+-1*a*b^-4*(a^2+-2*b^2)*cosh(x))
@test integrate((a+b*cosh(x))^-1*sinh(x)^4, x) == :(1//3*b^-1*sinh(x)^3+(1/2)*b^-3*(-2*b^2+2*a^2+-1*a*b*cosh(x))*sinh(x)+2*b^-4*(a+b)^3//2*(a+-1b)^3//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x))+-1//2*a*x*b^-4*(-3*b^2+2*a^2))
@test integrate((a+b*cosh(x))^-1*sinh(x)^3, x) == :((1/2)*b^-1*cosh(x)^2+b^-3*(a^2+-1*b^2)*log(a+b*cosh(x))+-1*a*b^-2*cosh(x))
@test integrate((a+b*cosh(x))^-1*sinh(x)^2, x) == :(b^-1*sinh(x)+-1*a*x*b^-2+2*b^-2*(a+b)^(1/2)*(a+-1b)^(1/2)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*sinh(x), x) == :(b^-1*log(a+b*cosh(x)))
@test integrate((a+b*cosh(x))^-1*csch(x), x) == :((2a+2b)^-1*log(1+-1*cosh(x))+-1*(-2b+2a)^-1*log(1+cosh(x))+b*(a^2+-1*b^2)^-1*log(a+b*cosh(x)))
@test integrate((a+b*cosh(x))^-1*csch(x)^2, x) == :((a^2+-1*b^2)^-1*(b+-1*a*cosh(x))*csch(x)+2*b^2*(a+b)^-3//2*(a+-1b)^-3//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*csch(x)^3, x) == :(b^3*(a^2+-1*b^2)^-2*log(a+b*cosh(x))+(-2*b^2+2*a^2)^-1*csch(x)^2*(b+-1*a*cosh(x))+-1//4*(a+b)^-2*(a+2b)*log(1+-1*cosh(x))+1//4*(a+-1b)^-2*(a+-2b)*log(1+cosh(x)))
@test integrate((a+b*cosh(x))^-1*csch(x)^4, x) == :((-3*b^2+3*a^2)^-1*csch(x)^3*(b+-1*a*cosh(x))+1//3*(a^2+-1*b^2)^-2*(3*b^3+a*(-5*b^2+2*a^2)*cosh(x))*csch(x)+2*b^4*(a+b)^-5//2*(a+-1b)^-5//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*csch(x)^5, x) == :(b^5*(a^2+-1*b^2)^-3*log(a+b*cosh(x))+(-4*b^2+4*a^2)^-1*csch(x)^4*(b+-1*a*cosh(x))+-1//16*(a+-1b)^-3*(3*a^2+8*b^2+-9*a*b)*log(1+cosh(x))+1//8*(a^2+-1*b^2)^-2*csch(x)^2*(4*b^3+a*(-7*b^2+3*a^2)*cosh(x))+1//16*(a+b)^-3*(3*a^2+8*b^2+9*a*b)*log(1+-1*cosh(x)))
@test integrate((a+b*cosh(x))^-1*csch(x)^6, x) == :((-5*b^2+5*a^2)^-1*csch(x)^5*(b+-1*a*cosh(x))+1//15*(a^2+-1*b^2)^-3*(15*b^5+-1*a*(8*a^4+33*b^4+-26*a^2*b^2)*cosh(x))*csch(x)+1//15*(a^2+-1*b^2)^-2*csch(x)^3*(5*b^3+a*(-9*b^2+4*a^2)*cosh(x))+2*b^6*(a+b)^-7//2*(a+-1b)^-7//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-2*sinh(x)^2, x) == :(x*b^-2+-1*b^-1*(a+b*cosh(x))^-1*sinh(x)+-2*a*b^-2*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*tanh(x)^4, x) == :(-1//3*a^-3*(-3*b^2+4*a^2)*tanh(x)+1//3*a^-1*sech(x)^2*tanh(x)+(1/2)*b*a^-4*(-2*b^2+3*a^2)*arctan(sinh(x))+2*a^-4*(a+b)^3//2*(a+-1b)^3//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x))+-1//2*b*a^-2*sech(x)*tanh(x))
@test integrate((a+b*cosh(x))^-1*tanh(x)^3, x) == :((1/2)*a^-1*sech(x)^2+a^-3*(a^2+-1*b^2)*log(cosh(x))+-1*b*a^-2*sech(x)+-1*a^-3*(a^2+-1*b^2)*log(a+b*cosh(x)))
@test integrate((a+b*cosh(x))^-1*tanh(x)^2, x) == :(-1*a^-1*tanh(x)+b*a^-2*arctan(sinh(x))+2*a^-2*(a+b)^(1/2)*(a+-1b)^(1/2)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*tanh(x), x) == :(a^-1*log(cosh(x))+-1*a^-1*log(a+b*cosh(x)))
@test integrate((a+b*cosh(x))^-1*coth(x), x) == :((-2b+2a)^-1*log(1+cosh(x))+(2a+2b)^-1*log(1+-1*cosh(x))+-1*a*(a^2+-1*b^2)^-1*log(a+b*cosh(x)))
@test integrate((a+b*cosh(x))^-1*coth(x)^2, x) == :(b*(a^2+-1*b^2)^-1*csch(x)+-1*a*(a^2+-1*b^2)^-1*coth(x)+2*a^2*(a+b)^-3//2*(a+-1b)^-3//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*coth(x)^3, x) == :(-1*a^3*(a^2+-1*b^2)^-2*log(a+b*cosh(x))+-1*(-2*b^2+2*a^2)^-1*csch(x)^2*(a+-1*b*cosh(x))+1//4*(a+b)^-2*(b+2a)*log(1+-1*cosh(x))+1//4*(a+-1b)^-2*(-1b+2a)*log(1+cosh(x)))
@test integrate((a+b*cosh(x))^-1*coth(x)^4, x) == :(b*(a^2+-1*b^2)^-1*csch(x)+b*(-3*b^2+3*a^2)^-1*csch(x)^3+-1*a*(-3*b^2+3*a^2)^-1*coth(x)^3+-1*a^3*(a^2+-1*b^2)^-2*coth(x)+b*a^2*(a^2+-1*b^2)^-2*csch(x)+2*a^4*(a+b)^-5//2*(a+-1b)^-5//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+a*cosh(x))^-1*tanh(x)^6, x) == :(-1//5*a^-1*tanh(x)^5+3//8*a^-1*arctan(sinh(x))+-3//8*a^-1*sech(x)*tanh(x)+-1//4*a^-1*tanh(x)^3*sech(x))
@test integrate((a+a*cosh(x))^-1*tanh(x)^5, x) == :(-1*a^-1*sech(x)+-1//4*a^-1*tanh(x)^4+1//3*a^-1*sech(x)^3)
@test integrate((a+a*cosh(x))^-1*tanh(x)^4, x) == :((1/2)*a^-1*arctan(sinh(x))+-1//3*a^-1*tanh(x)^3+-1//2*a^-1*sech(x)*tanh(x))
@test integrate((a+a*cosh(x))^-1*tanh(x)^3, x) == :((1/2)*a^-1*sech(x)^2+-1*a^-1*sech(x))
@test integrate((a+a*cosh(x))^-1*tanh(x)^2, x) == :(a^-1*arctan(sinh(x))+-1*a^-1*tanh(x))
@test integrate((a+a*cosh(x))^-1*tanh(x), x) == :(a^-1*log(cosh(x))+-1*a^-1*log(1+cosh(x)))
@test integrate((a+a*cosh(x))^-1*coth(x), x) == :((1/2)*a^-1*csch(x)^2+-1//2*a^-1*arctanh(cosh(x))+-1//2*a^-1*coth(x)*csch(x))
@test integrate((a+a*cosh(x))^-1*coth(x)^2, x) == :(-1*a^-1*csch(x)+-1//3*a^-1*csch(x)^3+1//3*a^-1*coth(x)^3)
@test integrate((a+a*cosh(x))^-1*coth(x)^3, x) == :(-3//8*a^-1*arctanh(cosh(x))+1//4*a^-1*coth(x)^4+-3//8*a^-1*coth(x)*csch(x)+-1//4*a^-1*coth(x)^3*csch(x))
@test integrate((a+a*cosh(x))^-1*coth(x)^4, x) == :(-1*a^-1*csch(x)+-2//3*a^-1*csch(x)^3+-1//5*a^-1*csch(x)^5+1//5*a^-1*coth(x)^5)
@test integrate((a+b*cosh(x))^(1/2)*tanh(x), x) == :(2*(a+b*cosh(x))^(1/2)+-2*a^(1/2)*arctanh(a^-1//2*(a+b*cosh(x))^(1/2)))
@test integrate((a+b*cosh(x))^-1//2*tanh(x), x) == :(-2*a^-1//2*arctanh(a^-1//2*(a+b*cosh(x))^(1/2)))
@test integrate((a+b*cosh(x))^-1*(A+B*sinh(x)), x) == :(B*b^-1*log(a+b*cosh(x))+2*A*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((1+cosh(x))^-1*(A+B*sinh(x)), x) == :(B*log(1+cosh(x))+A*(1+cosh(x))^-1*sinh(x))
@test integrate((1+-1*cosh(x))^-1*(A+B*sinh(x)), x) == :(-1*B*log(1+-1*cosh(x))+-1*A*(1+-1*cosh(x))^-1*sinh(x))
@test integrate((a+b*cosh(x))^-1*(A+B*tanh(x)), x) == :(B*a^-1*log(cosh(x))+-1*B*a^-1*log(a+b*cosh(x))+2*A*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*(A+B*coth(x)), x) == :(B*(-2b+2a)^-1*log(1+cosh(x))+B*(2a+2b)^-1*log(1+-1*cosh(x))+-1*B*a*(a^2+-1*b^2)^-1*log(a+b*cosh(x))+2*A*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*(A+B*sech(x)), x) == :(B*a^-1*arctan(sinh(x))+a^-1*(a+b)^-1//2*(a+-1b)^-1//2*(-2*B*b+2*A*a)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(x))^-1*(A+B*csch(x)), x) == :(B*(2a+2b)^-1*log(1+-1*cosh(x))+-1*B*(-2b+2a)^-1*log(1+cosh(x))+B*b*(a^2+-1*b^2)^-1*log(a+b*cosh(x))+2*A*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate((a+b*cosh(d+e*x))^-1*(A+B*cosh(d+e*x)+C*sinh(d+e*x)), x) == :(B*x*b^-1+C*b^-1*e^-1*log(a+b*cosh(d+e*x))+b^-1*e^-1*(a+b)^-1//2*(a+-1b)^-1//2*(-2*B*a+2*A*b)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*d+(1/2)*e*x)))
@test integrate((a+b*cosh(d+e*x))^-2*(A+B*cosh(d+e*x)+C*sinh(d+e*x)), x) == :(-1*C*b^-1*e^-1*(a+b*cosh(d+e*x))^-1+e^-1*(a+b)^-3//2*(a+-1b)^-3//2*(-2*B*b+2*A*a)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*d+(1/2)*e*x))+-1*e^-1*(a+b*cosh(d+e*x))^-1*(a^2+-1*b^2)^-1*(A*b+-1*B*a)*sinh(d+e*x))
@test integrate((a+b*cosh(d+e*x))^-3*(A+B*cosh(d+e*x)+C*sinh(d+e*x)), x) == :(-1//2*C*b^-1*e^-1*(a+b*cosh(d+e*x))^-2+e^-1*(a+b)^-5//2*(a+-1b)^-5//2*(A*b^2+2*A*a^2+-3*B*a*b)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*d+(1/2)*e*x))+-1*e^-1*(a+b*cosh(d+e*x))^-2*(-2*b^2+2*a^2)^-1*(A*b+-1*B*a)*sinh(d+e*x)+-1//2*e^-1*(a+b*cosh(d+e*x))^-1*(a^2+-1*b^2)^-2*(-1*B*a^2+-2*B*b^2+3*A*a*b)*sinh(d+e*x))
@test integrate((a+b*cosh(d+e*x))^-4*(A+B*cosh(d+e*x)+C*sinh(d+e*x)), x) == :(-1//3*C*b^-1*e^-1*(a+b*cosh(d+e*x))^-3+e^-1*(a+b)^-7//2*(a+-1b)^-7//2*(-1*B*b^3+2*A*a^3+-4*B*b*a^2+3*A*a*b^2)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*d+(1/2)*e*x))+-1*e^-1*(a+b*cosh(d+e*x))^-3*(-3*b^2+3*a^2)^-1*(A*b+-1*B*a)*sinh(d+e*x)+-1//6*e^-1*(a+b*cosh(d+e*x))^-1*(a^2+-1*b^2)^-3*(-2*B*a^3+4*A*b^3+-13*B*a*b^2+11*A*b*a^2)*sinh(d+e*x)+-1//6*e^-1*(a+b*cosh(d+e*x))^-2*(a^2+-1*b^2)^-2*(-3*B*b^2+-2*B*a^2+5*A*a*b)*sinh(d+e*x))
@test integrate(x*(a+b*cosh(x)^2)^-1, x) == :(-1//4*a^-1//2*(a+b)^-1//2*Polylogarithms.polylog(2,-1*b*(b+2a+2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+1//4*a^-1//2*(a+b)^-1//2*Polylogarithms.polylog(2,-1*b*(b+2a+-2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+(1/2)*x*a^-1//2*(a+b)^-1//2*log(1+b*(b+2a+-2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+-1//2*x*a^-1//2*(a+b)^-1//2*log(1+b*(b+2a+2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x)))
@test integrate(x^2*(a+b*cosh(x)^2)^-1, x) == :(-1//4*a^-1//2*(a+b)^-1//2*Polylogarithms.polylog(3,-1*b*(b+2a+-2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+1//4*a^-1//2*(a+b)^-1//2*Polylogarithms.polylog(3,-1*b*(b+2a+2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+(1/2)*x*a^-1//2*(a+b)^-1//2*Polylogarithms.polylog(2,-1*b*(b+2a+-2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+(1/2)*a^-1//2*x^2*(a+b)^-1//2*log(1+b*(b+2a+-2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+-1//2*x*a^-1//2*(a+b)^-1//2*Polylogarithms.polylog(2,-1*b*(b+2a+2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+-1//2*a^-1//2*x^2*(a+b)^-1//2*log(1+b*(b+2a+2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x)))
@test integrate(x^3*(a+b*cosh(x)^2)^-1, x) == :(-3//8*a^-1//2*(a+b)^-1//2*Polylogarithms.polylog(4,-1*b*(b+2a+2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+3//8*a^-1//2*(a+b)^-1//2*Polylogarithms.polylog(4,-1*b*(b+2a+-2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+(1/2)*a^-1//2*x^3*(a+b)^-1//2*log(1+b*(b+2a+-2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+-3//4*x*a^-1//2*(a+b)^-1//2*Polylogarithms.polylog(3,-1*b*(b+2a+-2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+-3//4*a^-1//2*x^2*(a+b)^-1//2*Polylogarithms.polylog(2,-1*b*(b+2a+2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+-1//2*a^-1//2*x^3*(a+b)^-1//2*log(1+b*(b+2a+2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+3//4*x*a^-1//2*(a+b)^-1//2*Polylogarithms.polylog(3,-1*b*(b+2a+2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x))+3//4*a^-1//2*x^2*(a+b)^-1//2*Polylogarithms.polylog(2,-1*b*(b+2a+-2*a^(1/2)*(a+b)^(1/2))^-1*exp(2x)))
@test integrate((1+-1*a^2*x^2)^-1*cosh((1+a*x)^-1//2*(1+-1*a*x)^(1/2))^3, x) == :(-3//4*a^-1*coshintegral((1+a*x)^-1//2*(1+-1*a*x)^(1/2))+-1//4*a^-1*coshintegral(3*(1+a*x)^-1//2*(1+-1*a*x)^(1/2)))
@test integrate((1+-1*a^2*x^2)^-1*cosh((1+a*x)^-1//2*(1+-1*a*x)^(1/2))^2, x) == :(-1//2*a^-1*coshintegral(2*(1+a*x)^-1//2*(1+-1*a*x)^(1/2))+-1//2*a^-1*log((1+a*x)^-1//2*(1+-1*a*x)^(1/2)))
@test integrate((1+-1*a^2*x^2)^-1*cosh((1+a*x)^-1//2*(1+-1*a*x)^(1/2)), x) == :(-1*a^-1*coshintegral((1+a*x)^-1//2*(1+-1*a*x)^(1/2)))
@test integrate(x*(a+b*cosh(x))^-2*sinh(x), x) == :(-1*x*b^-1*(a+b*cosh(x))^-1+2*b^-1*(a+b)^-1//2*(a+-1b)^-1//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate(x*(a+b*cosh(x))^-3*sinh(x), x) == :(-1*(a+b*cosh(x))^-1*(-2*b^2+2*a^2)^-1*sinh(x)+-1//2*x*b^-1*(a+b*cosh(x))^-2+a*b^-1*(a+b)^-3//2*(a+-1b)^-3//2*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*x)))
@test integrate(x^-1*(2+cosh(a+b*x)^2)*sinh(a+b*x), x) == :(1//4*cosh(3a)*sinhintegral(3*b*x)+1//4*coshintegral(3*b*x)*sinh(3a)+9//4*cosh(a)*sinhintegral(b*x)+9//4*coshintegral(b*x)*sinh(a))
@test integrate(x^3*(a+b*cosh(c+d*x))^-1*sinh(c+d*x), x) == :(-1//4*b^-1*x^4+6*b^-1*d^-4*Polylogarithms.polylog(4,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+6*b^-1*d^-4*Polylogarithms.polylog(4,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-1*d^-1*x^3*log(1+b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-1*d^-1*x^3*log(1+b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-6*x*b^-1*d^-3*Polylogarithms.polylog(3,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-6*x*b^-1*d^-3*Polylogarithms.polylog(3,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+3*b^-1*d^-2*x^2*Polylogarithms.polylog(2,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+3*b^-1*d^-2*x^2*Polylogarithms.polylog(2,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x)))
@test integrate(x^2*(a+b*cosh(c+d*x))^-1*sinh(c+d*x), x) == :(-1//3*b^-1*x^3+-2*b^-1*d^-3*Polylogarithms.polylog(3,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-2*b^-1*d^-3*Polylogarithms.polylog(3,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-1*d^-1*x^2*log(1+b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-1*d^-1*x^2*log(1+b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+2*x*b^-1*d^-2*Polylogarithms.polylog(2,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+2*x*b^-1*d^-2*Polylogarithms.polylog(2,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x)))
@test integrate(x*(a+b*cosh(c+d*x))^-1*sinh(c+d*x), x) == :(-1//2*b^-1*x^2+b^-1*d^-2*Polylogarithms.polylog(2,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-1*d^-2*Polylogarithms.polylog(2,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+x*b^-1*d^-1*log(1+b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+x*b^-1*d^-1*log(1+b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x)))
@test integrate((a+b*cosh(c+d*x))^-1*sinh(c+d*x), x) == :(b^-1*d^-1*log(a+b*cosh(c+d*x)))
@test integrate(x^3*(a+b*cosh(c+d*x))^-1*sinh(c+d*x)^2, x) == :(-6*b^-1*d^-4*cosh(c+d*x)+-1//4*a*b^-2*x^4+b^-1*d^-1*x^3*sinh(c+d*x)+-6*b^-2*d^-4*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(4,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-3*b^-1*d^-2*x^2*cosh(c+d*x)+6*x*b^-1*d^-3*sinh(c+d*x)+6*b^-2*d^-4*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(4,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-2*d^-1*x^3*(a^2+-1*b^2)^(1/2)*log(1+b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-1*b^-2*d^-1*x^3*(a^2+-1*b^2)^(1/2)*log(1+b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-6*x*b^-2*d^-3*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(3,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-3*b^-2*d^-2*x^2*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(2,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+3*b^-2*d^-2*x^2*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(2,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+6*x*b^-2*d^-3*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(3,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x)))
@test integrate(x^2*(a+b*cosh(c+d*x))^-1*sinh(c+d*x)^2, x) == :(2*b^-1*d^-3*sinh(c+d*x)+-1//3*a*b^-2*x^3+b^-1*d^-1*x^2*sinh(c+d*x)+-2*x*b^-1*d^-2*cosh(c+d*x)+-2*b^-2*d^-3*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(3,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+2*b^-2*d^-3*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(3,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-2*d^-1*x^2*(a^2+-1*b^2)^(1/2)*log(1+b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-1*b^-2*d^-1*x^2*(a^2+-1*b^2)^(1/2)*log(1+b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-2*x*b^-2*d^-2*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(2,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+2*x*b^-2*d^-2*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(2,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x)))
@test integrate(x*(a+b*cosh(c+d*x))^-1*sinh(c+d*x)^2, x) == :(-1*b^-1*d^-2*cosh(c+d*x)+-1//2*a*b^-2*x^2+x*b^-1*d^-1*sinh(c+d*x)+b^-2*d^-2*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(2,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-1*b^-2*d^-2*(a^2+-1*b^2)^(1/2)*Polylogarithms.polylog(2,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+x*b^-2*d^-1*(a^2+-1*b^2)^(1/2)*log(1+b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-1*x*b^-2*d^-1*(a^2+-1*b^2)^(1/2)*log(1+b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x)))
@test integrate((a+b*cosh(c+d*x))^-1*sinh(c+d*x)^2, x) == :(b^-1*d^-1*sinh(c+d*x)+-1*a*x*b^-2+2*b^-2*d^-1*(a+b)^(1/2)*(a+-1b)^(1/2)*arctanh((a+b)^-1//2*(a+-1b)^(1/2)*tanh((1/2)*c+(1/2)*d*x)))
@test integrate(x^3*(a+b*cosh(c+d*x))^-1*sinh(c+d*x)^3, x) == :(-1//4*b^-3*x^4*(a^2+-1*b^2)+1//4*b^-1*d^-1*x^3+3//8*x*b^-1*d^-3+b^-3*d^-4*(-6*b^2+6*a^2)*Polylogarithms.polylog(4,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-3*d^-4*(-6*b^2+6*a^2)*Polylogarithms.polylog(4,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+(1/2)*b^-1*d^-1*x^3*sinh(c+d*x)^2+6*a*b^-2*d^-4*sinh(c+d*x)+-3//8*b^-1*d^-4*cosh(c+d*x)*sinh(c+d*x)+3//4*x*b^-1*d^-3*sinh(c+d*x)^2+b^-3*d^-1*x^3*(a^2+-1*b^2)*log(1+b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-3*d^-1*x^3*(a^2+-1*b^2)*log(1+b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-3*d^-2*x^2*(-3*b^2+3*a^2)*Polylogarithms.polylog(2,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-3*d^-2*x^2*(-3*b^2+3*a^2)*Polylogarithms.polylog(2,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-1*a*b^-2*d^-1*x^3*cosh(c+d*x)+-1*x*b^-3*d^-3*(-6*b^2+6*a^2)*Polylogarithms.polylog(3,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-1*x*b^-3*d^-3*(-6*b^2+6*a^2)*Polylogarithms.polylog(3,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-6*a*x*b^-2*d^-3*cosh(c+d*x)+3*a*b^-2*d^-2*x^2*sinh(c+d*x)+-3//4*b^-1*d^-2*x^2*cosh(c+d*x)*sinh(c+d*x))
@test integrate(x^2*(a+b*cosh(c+d*x))^-1*sinh(c+d*x)^3, x) == :(-1//3*b^-3*x^3*(a^2+-1*b^2)+1//4*b^-1*d^-1*x^2+1//4*b^-1*d^-3*sinh(c+d*x)^2+(1/2)*b^-1*d^-1*x^2*sinh(c+d*x)^2+-1*b^-3*d^-3*(-2*b^2+2*a^2)*Polylogarithms.polylog(3,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-1*b^-3*d^-3*(-2*b^2+2*a^2)*Polylogarithms.polylog(3,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-2*a*b^-2*d^-3*cosh(c+d*x)+x*b^-3*d^-2*(-2*b^2+2*a^2)*Polylogarithms.polylog(2,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+x*b^-3*d^-2*(-2*b^2+2*a^2)*Polylogarithms.polylog(2,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-3*d^-1*x^2*(a^2+-1*b^2)*log(1+b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-3*d^-1*x^2*(a^2+-1*b^2)*log(1+b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-1*a*b^-2*d^-1*x^2*cosh(c+d*x)+2*a*x*b^-2*d^-2*sinh(c+d*x)+-1//2*x*b^-1*d^-2*cosh(c+d*x)*sinh(c+d*x))
@test integrate(x*(a+b*cosh(c+d*x))^-1*sinh(c+d*x)^3, x) == :(-1//2*b^-3*x^2*(a^2+-1*b^2)+1//4*x*b^-1*d^-1+a*b^-2*d^-2*sinh(c+d*x)+b^-3*d^-2*(a^2+-1*b^2)*Polylogarithms.polylog(2,-1*b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+b^-3*d^-2*(a^2+-1*b^2)*Polylogarithms.polylog(2,-1*b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+(1/2)*x*b^-1*d^-1*sinh(c+d*x)^2+-1//4*b^-1*d^-2*cosh(c+d*x)*sinh(c+d*x)+x*b^-3*d^-1*(a^2+-1*b^2)*log(1+b*(a+(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+x*b^-3*d^-1*(a^2+-1*b^2)*log(1+b*(a+-1*(a^2+-1*b^2)^(1/2))^-1*exp(c+d*x))+-1*a*x*b^-2*d^-1*cosh(c+d*x))
@test integrate((a+b*cosh(c+d*x))^-1*sinh(c+d*x)^3, x) == :((1/2)*b^-1*d^-1*cosh(c+d*x)^2+b^-3*d^-1*(a^2+-1*b^2)*log(a+b*cosh(c+d*x))+-1*a*b^-2*d^-1*cosh(c+d*x))
@test integrate(cosh(a+b*log(c*x^n)), x) == :(x*(1+-1*b^2*n^2)^-1*cosh(a+b*log(c*x^n))+-1*b*n*x*(1+-1*b^2*n^2)^-1*sinh(a+b*log(c*x^n)))
@test integrate(cosh(a+b*log(c*x^n))^2, x) == :(x*(1+-4*b^2*n^2)^-1*cosh(a+b*log(c*x^n))^2+-2*x*b^2*n^2*(1+-4*b^2*n^2)^-1+-2*b*n*x*(1+-4*b^2*n^2)^-1*cosh(a+b*log(c*x^n))*sinh(a+b*log(c*x^n)))
@test integrate(cosh(a+b*log(c*x^n))^3, x) == :(x*(1+-9*b^2*n^2)^-1*cosh(a+b*log(c*x^n))^3+-6*x*b^2*n^2*(1+-10*b^2*n^2+9*b^4*n^4)^-1*cosh(a+b*log(c*x^n))+6*x*b^3*n^3*(1+-10*b^2*n^2+9*b^4*n^4)^-1*sinh(a+b*log(c*x^n))+-3*b*n*x*(1+-9*b^2*n^2)^-1*cosh(a+b*log(c*x^n))^2*sinh(a+b*log(c*x^n)))
@test integrate(cosh(a+b*log(c*x^n))^4, x) == :(x*(1+-16*b^2*n^2)^-1*cosh(a+b*log(c*x^n))^4+24*x*b^4*n^4*(1+-20*b^2*n^2+64*b^4*n^4)^-1+-12*x*b^2*n^2*(1+-20*b^2*n^2+64*b^4*n^4)^-1*cosh(a+b*log(c*x^n))^2+-4*b*n*x*(1+-16*b^2*n^2)^-1*cosh(a+b*log(c*x^n))^3*sinh(a+b*log(c*x^n))+24*x*b^3*n^3*(1+-20*b^2*n^2+64*b^4*n^4)^-1*cosh(a+b*log(c*x^n))*sinh(a+b*log(c*x^n)))
@test integrate(x^m*cosh(a+b*log(c*x^n)), x) == :(x^(1+m)*((1+m)^2+-1*b^2*n^2)^-1*(1+m)*cosh(a+b*log(c*x^n))+-1*b*n*x^(1+m)*((1+m)^2+-1*b^2*n^2)^-1*sinh(a+b*log(c*x^n)))
@test integrate(x^m*cosh(a+b*log(c*x^n))^2, x) == :(x^(1+m)*((1+m)^2+-4*b^2*n^2)^-1*cosh(a+b*log(c*x^n))^2*(1+m)+-2*b^2*n^2*x^(1+m)*(1+m)^-1*((1+m)^2+-4*b^2*n^2)^-1+-2*b*n*x^(1+m)*((1+m)^2+-4*b^2*n^2)^-1*cosh(a+b*log(c*x^n))*sinh(a+b*log(c*x^n)))
@test integrate(x^m*cosh(a+b*log(c*x^n))^3, x) == :(x^(1+m)*((1+m)^2+-9*b^2*n^2)^-1*cosh(a+b*log(c*x^n))^3*(1+m)+-3*b*n*x^(1+m)*((1+m)^2+-9*b^2*n^2)^-1*cosh(a+b*log(c*x^n))^2*sinh(a+b*log(c*x^n))+6*b^3*n^3*x^(1+m)*((1+m)^2+-1*b^2*n^2)^-1*((1+m)^2+-9*b^2*n^2)^-1*sinh(a+b*log(c*x^n))+-6*b^2*n^2*x^(1+m)*((1+m)^2+-1*b^2*n^2)^-1*((1+m)^2+-9*b^2*n^2)^-1*(1+m)*cosh(a+b*log(c*x^n)))
@test integrate(x^m*cosh(a+b*log(c*x^n))^4, x) == :(x^(1+m)*((1+m)^2+-16*b^2*n^2)^-1*cosh(a+b*log(c*x^n))^4*(1+m)+-4*b*n*x^(1+m)*((1+m)^2+-16*b^2*n^2)^-1*cosh(a+b*log(c*x^n))^3*sinh(a+b*log(c*x^n))+24*b^4*n^4*x^(1+m)*(1+m)^-1*((1+m)^2+-16*b^2*n^2)^-1*((1+m)^2+-4*b^2*n^2)^-1+-12*b^2*n^2*x^(1+m)*((1+m)^2+-16*b^2*n^2)^-1*((1+m)^2+-4*b^2*n^2)^-1*cosh(a+b*log(c*x^n))^2*(1+m)+24*b^3*n^3*x^(1+m)*((1+m)^2+-16*b^2*n^2)^-1*((1+m)^2+-4*b^2*n^2)^-1*cosh(a+b*log(c*x^n))*sinh(a+b*log(c*x^n)))
@test integrate(x^-1*cosh(a+b*log(c*x^n)), x) == :(b^-1*n^-1*sinh(a+b*log(c*x^n)))
@test integrate(x^-1*cosh(a+b*log(c*x^n))^2, x) == :((1/2)*log(x)+(1/2)*b^-1*n^-1*cosh(a+b*log(c*x^n))*sinh(a+b*log(c*x^n)))
@test integrate(x^-1*cosh(a+b*log(c*x^n))^3, x) == :(b^-1*n^-1*sinh(a+b*log(c*x^n))+1//3*b^-1*n^-1*sinh(a+b*log(c*x^n))^3)
@test integrate(x^-1*cosh(a+b*log(c*x^n))^4, x) == :(3//8*log(x)+1//4*b^-1*n^-1*cosh(a+b*log(c*x^n))^3*sinh(a+b*log(c*x^n))+3//8*b^-1*n^-1*cosh(a+b*log(c*x^n))*sinh(a+b*log(c*x^n)))
@test integrate(x^-1*cosh(a+b*log(c*x^n))^5, x) == :(b^-1*n^-1*sinh(a+b*log(c*x^n))+1//5*b^-1*n^-1*sinh(a+b*log(c*x^n))^5+2//3*b^-1*n^-1*sinh(a+b*log(c*x^n))^3)
@test integrate(x^-1*cosh(a+b*log(c*x^n))^5//2, x) == :(-6//5*im*b^-1*n^-1*Elliptic.E((1/2)*im*(a+b*log(c*x^n)),2)+2//5*b^-1*n^-1*cosh(a+b*log(c*x^n))^3//2*sinh(a+b*log(c*x^n)))
@test integrate(x^-1*cosh(a+b*log(c*x^n))^3//2, x) == :(-2//3*im*b^-1*n^-1*Elliptic.F((1/2)*im*(a+b*log(c*x^n)),2)+2//3*b^-1*n^-1*cosh(a+b*log(c*x^n))^(1/2)*sinh(a+b*log(c*x^n)))
@test integrate(x^-1*cosh(a+b*log(c*x^n))^(1/2), x) == :(-2*im*b^-1*n^-1*Elliptic.E((1/2)*im*(a+b*log(c*x^n)),2))
@test integrate(x^-1*cosh(a+b*log(c*x^n))^-1//2, x) == :(-2*im*b^-1*n^-1*Elliptic.F((1/2)*im*(a+b*log(c*x^n)),2))
@test integrate(x^-1*cosh(a+b*log(c*x^n))^-3//2, x) == :(2*im*b^-1*n^-1*Elliptic.E((1/2)*im*(a+b*log(c*x^n)),2)+2*b^-1*n^-1*cosh(a+b*log(c*x^n))^-1//2*sinh(a+b*log(c*x^n)))
@test integrate(x^-1*cosh(a+b*log(c*x^n))^-5//2, x) == :(-2//3*im*b^-1*n^-1*Elliptic.F((1/2)*im*(a+b*log(c*x^n)),2)+2//3*b^-1*n^-1*cosh(a+b*log(c*x^n))^-3//2*sinh(a+b*log(c*x^n)))
@test integrate(cosh(a+2*n^-1*log(c*x^n))^5//2, x) == :(-1//4*x*cosh(a+2*n^-1*log(c*x^n))^5//2+5*x*(12+12*(c*x^n)^(-4*n^-1)*exp(-2a))^-1*cosh(a+2*n^-1*log(c*x^n))^5//2+5//4*x*(c*x^n)^(-4*n^-1)*(1+(c*x^n)^(-4*n^-1)*exp(-2a))^-2*cosh(a+2*n^-1*log(c*x^n))^5//2*exp(-2a)+-5//4*x*(c*x^n)^(-6*n^-1)*(1+(c*x^n)^(-4*n^-1)*exp(-2a))^-5//2*cosh(a+2*n^-1*log(c*x^n))^5//2*arccsch((c*x^n)^(2*n^-1)*exp(a))*exp(-3a))
@test integrate(cosh(a+2*n^-1*log(c*x^n))^(1/2), x) == :((1/2)*x*cosh(a+2*n^-1*log(c*x^n))^(1/2)+-1//2*x*(c*x^n)^(-2*n^-1)*(1+(c*x^n)^(-4*n^-1)*exp(-2a))^-1//2*cosh(a+2*n^-1*log(c*x^n))^(1/2)*arccsch((c*x^n)^(2*n^-1)*exp(a))*exp(-1a))
@test integrate(cosh(a+2*n^-1*log(c*x^n))^-3//2, x) == :(-1//2*x*cosh(a+2*n^-1*log(c*x^n))^-3//2*(1+(c*x^n)^(-4*n^-1)*exp(-2a)))
@test integrate(cosh(a+2*n^-1*log(c*x^n))^-7//2, x) == :(-1//6*x*cosh(a+2*n^-1*log(c*x^n))^-7//2*(1+(c*x^n)^(-4*n^-1)*exp(-2a))+-1//15*x*(c*x^n)^(-4*n^-1)*cosh(a+2*n^-1*log(c*x^n))^-7//2*(1+(c*x^n)^(-4*n^-1)*exp(-2a))*exp(-2a))
@test integrate(cosh((c+d*x)^-1*(a+b*x)), x) == :(d^-1*(c+d*x)*cosh((c+d*x)^-1*(a+b*x))+d^-2*(b*c+-1*a*d)*coshintegral(d^-1*(c+d*x)^-1*(b*c+-1*a*d))*sinh(b*d^-1)+-1*d^-2*(b*c+-1*a*d)*cosh(b*d^-1)*sinhintegral(d^-1*(c+d*x)^-1*(b*c+-1*a*d)))
@test integrate(cosh((c+d*x)^-1*(a+b*x))^2, x) == :(d^-1*cosh((c+d*x)^-1*(a+b*x))^2*(c+d*x)+d^-2*(b*c+-1*a*d)*coshintegral(d^-1*(c+d*x)^-1*(-2*a*d+2*b*c))*sinh(2*b*d^-1)+-1*d^-2*(b*c+-1*a*d)*cosh(2*b*d^-1)*sinhintegral(d^-1*(c+d*x)^-1*(-2*a*d+2*b*c)))
@test integrate(cosh(a+b*x)^4*exp(a+b*x), x) == :(-1//4*b^-1*exp(-1a+-1*b*x)+-1//48*b^-1*exp(-3a+-3*b*x)+1//12*b^-1*exp(3a+3*b*x)+1//80*b^-1*exp(5a+5*b*x)+3//8*b^-1*exp(a+b*x))
@test integrate(cosh(a+b*x)^3*exp(a+b*x), x) == :(3//8*x+-1//16*b^-1*exp(-2a+-2*b*x)+1//32*b^-1*exp(4a+4*b*x)+3//16*b^-1*exp(2a+2*b*x))
@test integrate(cosh(a+b*x)^2*exp(a+b*x), x) == :((1/2)*b^-1*exp(a+b*x)+-1//4*b^-1*exp(-1a+-1*b*x)+1//12*b^-1*exp(3a+3*b*x))
@test integrate(cosh(a+b*x)*exp(a+b*x), x) == :((1/2)*x+1//4*b^-1*exp(2a+2*b*x))
@test integrate(exp(a+b*x)*sech(a+b*x), x) == :(b^-1*log(1+exp(2a+2*b*x)))
@test integrate(sech(a+b*x)^2*exp(a+b*x), x) == :(2*b^-1*arctan(exp(a+b*x))+-2*b^-1*(1+exp(2a+2*b*x))^-1*exp(a+b*x))
@test integrate(sech(a+b*x)^3*exp(a+b*x), x) == :(2*b^-1*(1+exp(2a+2*b*x))^-2*exp(4a+4*b*x))
@test integrate(sech(a+b*x)^4*exp(a+b*x), x) == :(b^-1*arctan(exp(a+b*x))+b^-1*(1+exp(2a+2*b*x))^-1*exp(a+b*x)+-2*b^-1*(1+exp(2a+2*b*x))^-2*exp(a+b*x)+-8//3*b^-1*(1+exp(2a+2*b*x))^-3*exp(3a+3*b*x))
@test integrate(sech(a+b*x)^5*exp(a+b*x), x) == :(-8*b^-1*(1+exp(2a+2*b*x))^-2+-4*b^-1*(1+exp(2a+2*b*x))^-4+32//3*b^-1*(1+exp(2a+2*b*x))^-3)
@test integrate(cosh(2x)^2*exp(x), x) == :((1/2)*exp(x)+-1//12*exp(-3x)+1//20*exp(5x))
@test integrate(cosh(2x)*exp(x), x) == :(-1//2*exp(-1x)+1//6*exp(3x))
@test integrate(exp(x)*sech(2x), x) == :((1/2)*2^(1/2)*arctan(1+2^(1/2)*exp(x))+-1//2*2^(1/2)*arctan(1+-1*2^(1/2)*exp(x))+-1//4*2^(1/2)*log(1+2^(1/2)*exp(x)+exp(2x))+1//4*2^(1/2)*log(1+-1*2^(1/2)*exp(x)+exp(2x)))
@test integrate(sech(2x)^2*exp(x), x) == :(-1*(1+exp(4x))^-1*exp(x)+-1//4*2^(1/2)*arctan(1+-1*2^(1/2)*exp(x))+-1//8*2^(1/2)*log(1+-1*2^(1/2)*exp(x)+exp(2x))+1//4*2^(1/2)*arctan(1+2^(1/2)*exp(x))+1//8*2^(1/2)*log(1+2^(1/2)*exp(x)+exp(2x)))
@test integrate(cosh(3x)^2*exp(x), x) == :((1/2)*exp(x)+-1//20*exp(-5x)+1//28*exp(7x))
@test integrate(cosh(3x)*exp(x), x) == :(-1//4*exp(-2x)+1//8*exp(4x))
@test integrate(exp(x)*sech(3x), x) == :(-1//3*log(1+exp(2x))+1//6*log(1+-1*exp(2x)+exp(4x))+-1//3*3^(1/2)*arctan(1//3*3^(1/2)*(1+-2*exp(2x))))
@test integrate(sech(3x)^2*exp(x), x) == :(-1//9*arctan(3^(1/2)+-2*exp(x))+1//9*arctan(3^(1/2)+2*exp(x))+2//9*arctan(exp(x))+-2*(3+3*exp(6x))^-1*exp(x)+-1//18*3^(1/2)*log(1+-1*3^(1/2)*exp(x)+exp(2x))+1//18*3^(1/2)*log(1+3^(1/2)*exp(x)+exp(2x)))
@test integrate(cosh(4x)^2*exp(x), x) == :((1/2)*exp(x)+-1//28*exp(-7x)+1//36*exp(9x))
@test integrate(cosh(4x)*exp(x), x) == :(-1//6*exp(-3x)+1//10*exp(5x))
@test integrate(exp(x)*sech(4x), x) == :((1/2)*(4+-2*2^(1/2))^-1//2*arctan((2+-1*2^(1/2))^-1//2*((2+2^(1/2))^(1/2)+2*exp(x)))+(1/2)*(4+2*2^(1/2))^-1//2*arctan((2+2^(1/2))^-1//2*((2+-1*2^(1/2))^(1/2)+-2*exp(x)))+-1//2*(4+-2*2^(1/2))^-1//2*arctan((2+-1*2^(1/2))^-1//2*((2+2^(1/2))^(1/2)+-2*exp(x)))+-1//2*(4+2*2^(1/2))^-1//2*arctan((2+2^(1/2))^-1//2*((2+-1*2^(1/2))^(1/2)+2*exp(x)))+-1//4*(4+-2*2^(1/2))^-1//2*log(1+-1*(2+-1*2^(1/2))^(1/2)*exp(x)+exp(2x))+-1//4*(4+2*2^(1/2))^-1//2*log(1+(2+2^(1/2))^(1/2)*exp(x)+exp(2x))+1//4*(4+-2*2^(1/2))^-1//2*log(1+(2+-1*2^(1/2))^(1/2)*exp(x)+exp(2x))+1//4*(4+2*2^(1/2))^-1//2*log(1+-1*(2+2^(1/2))^(1/2)*exp(x)+exp(2x)))
@test integrate(sech(4x)^2*exp(x), x) == :(-1*(2+2*exp(8x))^-1*exp(x)+-1//8*(4+-2*2^(1/2))^-1//2*arctan((2+2^(1/2))^-1//2*((2+-1*2^(1/2))^(1/2)+-2*exp(x)))+-1//8*(4+2*2^(1/2))^-1//2*arctan((2+-1*2^(1/2))^-1//2*((2+2^(1/2))^(1/2)+-2*exp(x)))+-1//32*(2+2^(1/2))^(1/2)*log(1+-1*(2+2^(1/2))^(1/2)*exp(x)+exp(2x))+-1//32*(2+-1*2^(1/2))^(1/2)*log(1+-1*(2+-1*2^(1/2))^(1/2)*exp(x)+exp(2x))+1//8*(4+-2*2^(1/2))^-1//2*arctan((2+2^(1/2))^-1//2*((2+-1*2^(1/2))^(1/2)+2*exp(x)))+1//8*(4+2*2^(1/2))^-1//2*arctan((2+-1*2^(1/2))^-1//2*((2+2^(1/2))^(1/2)+2*exp(x)))+1//32*(2+2^(1/2))^(1/2)*log(1+(2+2^(1/2))^(1/2)*exp(x)+exp(2x))+1//32*(2+-1*2^(1/2))^(1/2)*log(1+(2+-1*2^(1/2))^(1/2)*exp(x)+exp(2x)))
@test integrate(F^(c*(a+b*x))*cosh(d+e*x)^3, x) == :(6*F^(c*(a+b*x))*e^3*(9*e^4+b^4*c^4*log(F)^4+-10*b^2*c^2*e^2*log(F)^2)^-1*sinh(d+e*x)+3*e*F^(c*(a+b*x))*(9*e^2+-1*b^2*c^2*log(F)^2)^-1*cosh(d+e*x)^2*sinh(d+e*x)+-1*b*c*F^(c*(a+b*x))*(9*e^2+-1*b^2*c^2*log(F)^2)^-1*cosh(d+e*x)^3*log(F)+-6*b*c*F^(c*(a+b*x))*e^2*(9*e^4+b^4*c^4*log(F)^4+-10*b^2*c^2*e^2*log(F)^2)^-1*cosh(d+e*x)*log(F))
@test integrate(F^(c*(a+b*x))*cosh(d+e*x)^2, x) == :(2*e*F^(c*(a+b*x))*(4*e^2+-1*b^2*c^2*log(F)^2)^-1*cosh(d+e*x)*sinh(d+e*x)+-1*b*c*F^(c*(a+b*x))*(4*e^2+-1*b^2*c^2*log(F)^2)^-1*cosh(d+e*x)^2*log(F)+2*F^(c*(a+b*x))*b^-1*c^-1*e^2*(4*e^2+-1*b^2*c^2*log(F)^2)^-1*log(F)^-1)
@test integrate(F^(c*(a+b*x))*cosh(d+e*x), x) == :(e*F^(c*(a+b*x))*(e^2+-1*b^2*c^2*log(F)^2)^-1*sinh(d+e*x)+-1*b*c*F^(c*(a+b*x))*(e^2+-1*b^2*c^2*log(F)^2)^-1*cosh(d+e*x)*log(F))
@test integrate((cosh(a*c+b*c*x)^2)^5//2*exp(c*(a+b*x)), x) == :(5//16*x*(cosh(a*c+b*c*x)^2)^(1/2)*sech(a*c+b*c*x)+-5//64*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^(1/2)*exp(-2*c*(a+b*x))*sech(a*c+b*c*x)+-1//128*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^(1/2)*exp(-4*c*(a+b*x))*sech(a*c+b*c*x)+1//192*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^(1/2)*exp(6*c*(a+b*x))*sech(a*c+b*c*x)+5//32*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^(1/2)*exp(2*c*(a+b*x))*sech(a*c+b*c*x)+5//128*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^(1/2)*exp(4*c*(a+b*x))*sech(a*c+b*c*x))
@test integrate((cosh(a*c+b*c*x)^2)^3//2*exp(c*(a+b*x)), x) == :(3//8*x*(cosh(a*c+b*c*x)^2)^(1/2)*sech(a*c+b*c*x)+-1//16*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^(1/2)*exp(-2*c*(a+b*x))*sech(a*c+b*c*x)+1//32*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^(1/2)*exp(4*c*(a+b*x))*sech(a*c+b*c*x)+3//16*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^(1/2)*exp(2*c*(a+b*x))*sech(a*c+b*c*x))
@test integrate((cosh(a*c+b*c*x)^2)^(1/2)*exp(c*(a+b*x)), x) == :((1/2)*x*(cosh(a*c+b*c*x)^2)^(1/2)*sech(a*c+b*c*x)+1//4*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^(1/2)*exp(2*c*(a+b*x))*sech(a*c+b*c*x))
@test integrate((cosh(a*c+b*c*x)^2)^-1//2*exp(c*(a+b*x)), x) == :(b^-1*c^-1*(cosh(a*c+b*c*x)^2)^-1//2*cosh(a*c+b*c*x)*log(1+exp(2*c*(a+b*x))))
@test integrate((cosh(a*c+b*c*x)^2)^-3//2*exp(c*(a+b*x)), x) == :(2*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^-1//2*(1+exp(2*c*(a+b*x)))^-2*cosh(a*c+b*c*x)*exp(4*c*(a+b*x)))
@test integrate((cosh(a*c+b*c*x)^2)^-5//2*exp(c*(a+b*x)), x) == :(-8*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^-1//2*(1+exp(2*c*(a+b*x)))^-2*cosh(a*c+b*c*x)+-4*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^-1//2*(1+exp(2*c*(a+b*x)))^-4*cosh(a*c+b*c*x)+32//3*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^-1//2*(1+exp(2*c*(a+b*x)))^-3*cosh(a*c+b*c*x))
@test integrate((cosh(a*c+b*c*x)^2)^-7//2*exp(c*(a+b*x)), x) == :(48*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^-1//2*(1+exp(2*c*(a+b*x)))^-4*cosh(a*c+b*c*x)+-192//5*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^-1//2*(1+exp(2*c*(a+b*x)))^-5*cosh(a*c+b*c*x)+-64//3*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^-1//2*(1+exp(2*c*(a+b*x)))^-3*cosh(a*c+b*c*x)+32//3*b^-1*c^-1*(cosh(a*c+b*c*x)^2)^-1//2*(1+exp(2*c*(a+b*x)))^-6*cosh(a*c+b*c*x))
@test integrate(cosh(a+b*x)*exp(x), x) == :((1+-1*b^2)^-1*cosh(a+b*x)*exp(x)+-1*b*(1+-1*b^2)^-1*exp(x)*sinh(a+b*x))
@test integrate(cosh(a+c*x^2)*exp(x), x) == :(-1//4*pi^(1/2)*c^-1//2*erf((1/2)*c^-1//2*(1+-2*c*x))*exp(-1a+1//4*c^-1)+1//4*pi^(1/2)*c^-1//2*erfi((1/2)*c^-1//2*(1+2*c*x))*exp(a+-1//4*c^-1))
@test integrate(cosh(a+b*x+c*x^2)*exp(x), x) == :(-1//4*pi^(1/2)*c^-1//2*erf((1/2)*c^-1//2*(1+-1b+-2*c*x))*exp(-1a+1//4*c^-1*(1+-1b)^2)+1//4*pi^(1/2)*c^-1//2*erfi((1/2)*c^-1//2*(1+b+2*c*x))*exp(a+-1//4*c^-1*(1+b)^2))
@test integrate(cosh(a+b*x)*exp(x^2), x) == :(-1//4*pi^(1/2)*erfi((1/2)*b+-1x)*exp(-1a+-1//4*b^2)+1//4*pi^(1/2)*erfi(x+(1/2)*b)*exp(a+-1//4*b^2))
@test integrate(cosh(a+c*x^2)*exp(x^2), x) == :(1//4*pi^(1/2)*(1+c)^-1//2*erfi(x*(1+c)^(1/2))*exp(a)+1//4*pi^(1/2)*(1+-1c)^-1//2*erfi(x*(1+-1c)^(1/2))*exp(-1a))
@test integrate(cosh(a+b*x+c*x^2)*exp(x^2), x) == :(-1//4*pi^(1/2)*(1+-1c)^-1//2*erfi((1/2)*(1+-1c)^-1//2*(b+-1*x*(2+-2c)))*exp(-1a+-1*b^2*(4+-4c)^-1)+1//4*pi^(1/2)*(1+c)^-1//2*erfi((1/2)*(1+c)^-1//2*(b+x*(2+2c)))*exp(a+-1*b^2*(4+4c)^-1))
@test integrate(f^(a+b*x)*cosh(d+f*x^2), x) == :(1//4*pi^(1/2)*f^(-1//2+a)*erf((1/2)*f^-1//2*(-1*b*log(f)+2*f*x))*exp(-1d+1//4*b^2*f^-1*log(f)^2)+1//4*pi^(1/2)*f^(-1//2+a)*erfi((1/2)*f^-1//2*(b*log(f)+2*f*x))*exp(d+-1//4*b^2*f^-1*log(f)^2))
@test integrate(f^(a+b*x)*cosh(d+f*x^2)^2, x) == :((1/2)*b^-1*f^(a+b*x)*log(f)^-1+1//16*2^(1/2)*pi^(1/2)*f^(-1//2+a)*erf(1//4*2^(1/2)*f^-1//2*(-1*b*log(f)+4*f*x))*exp(-2d+1//8*b^2*f^-1*log(f)^2)+1//16*2^(1/2)*pi^(1/2)*f^(-1//2+a)*erfi(1//4*2^(1/2)*f^-1//2*(b*log(f)+4*f*x))*exp(2d+-1//8*b^2*f^-1*log(f)^2))
@test integrate(f^(a+b*x)*cosh(d+f*x^2)^3, x) == :(3//16*pi^(1/2)*f^(-1//2+a)*erf((1/2)*f^-1//2*(-1*b*log(f)+2*f*x))*exp(-1d+1//4*b^2*f^-1*log(f)^2)+3//16*pi^(1/2)*f^(-1//2+a)*erfi((1/2)*f^-1//2*(b*log(f)+2*f*x))*exp(d+-1//4*b^2*f^-1*log(f)^2)+1//48*3^(1/2)*pi^(1/2)*f^(-1//2+a)*erf(1//6*3^(1/2)*f^-1//2*(-1*b*log(f)+6*f*x))*exp(-3d+1//12*b^2*f^-1*log(f)^2)+1//48*3^(1/2)*pi^(1/2)*f^(-1//2+a)*erfi(1//6*3^(1/2)*f^-1//2*(b*log(f)+6*f*x))*exp(3d+-1//12*b^2*f^-1*log(f)^2))
@test integrate(f^(a+b*x)*cosh(d+e*x+f*x^2), x) == :(1//4*pi^(1/2)*f^(-1//2+a)*erf((1/2)*f^-1//2*(e+-1*b*log(f)+2*f*x))*exp(-1d+1//4*f^-1*(e+-1*b*log(f))^2)+1//4*pi^(1/2)*f^(-1//2+a)*erfi((1/2)*f^-1//2*(e+b*log(f)+2*f*x))*exp(d+-1//4*f^-1*(e+b*log(f))^2))
@test integrate(f^(a+b*x)*cosh(d+e*x+f*x^2)^2, x) == :((1/2)*b^-1*f^(a+b*x)*log(f)^-1+1//16*2^(1/2)*pi^(1/2)*f^(-1//2+a)*erf(1//4*2^(1/2)*f^-1//2*(2*e+-1*b*log(f)+4*f*x))*exp(-2d+1//8*f^-1*(2*e+-1*b*log(f))^2)+1//16*2^(1/2)*pi^(1/2)*f^(-1//2+a)*erfi(1//4*2^(1/2)*f^-1//2*(2*e+b*log(f)+4*f*x))*exp(2d+-1//8*f^-1*(2*e+b*log(f))^2))
@test integrate(f^(a+b*x)*cosh(d+e*x+f*x^2)^3, x) == :(3//16*pi^(1/2)*f^(-1//2+a)*erf((1/2)*f^-1//2*(e+-1*b*log(f)+2*f*x))*exp(-1d+1//4*f^-1*(e+-1*b*log(f))^2)+3//16*pi^(1/2)*f^(-1//2+a)*erfi((1/2)*f^-1//2*(e+b*log(f)+2*f*x))*exp(d+-1//4*f^-1*(e+b*log(f))^2)+1//48*3^(1/2)*pi^(1/2)*f^(-1//2+a)*erf(1//6*3^(1/2)*f^-1//2*(3*e+-1*b*log(f)+6*f*x))*exp(-3d+1//12*f^-1*(3*e+-1*b*log(f))^2)+1//48*3^(1/2)*pi^(1/2)*f^(-1//2+a)*erfi(1//6*3^(1/2)*f^-1//2*(3*e+b*log(f)+6*f*x))*exp(3d+-1//12*f^-1*(3*e+b*log(f))^2))
@test integrate(f^(a+c*x^2)*cosh(d+f*x^2), x) == :(1//4*pi^(1/2)*f^a*(f+c*log(f))^-1//2*erfi(x*(f+c*log(f))^(1/2))*exp(d)+1//4*pi^(1/2)*f^a*(f+-1*c*log(f))^-1//2*erf(x*(f+-1*c*log(f))^(1/2))*exp(-1d))
@test integrate(f^(a+c*x^2)*cosh(d+f*x^2)^2, x) == :(1//4*pi^(1/2)*c^-1//2*f^a*log(f)^-1//2*erfi(x*c^(1/2)*log(f)^(1/2))+1//8*pi^(1/2)*f^a*(2*f+c*log(f))^-1//2*erfi(x*(2*f+c*log(f))^(1/2))*exp(2d)+1//8*pi^(1/2)*f^a*(2*f+-1*c*log(f))^-1//2*erf(x*(2*f+-1*c*log(f))^(1/2))*exp(-2d))
@test integrate(f^(a+c*x^2)*cosh(d+f*x^2)^3, x) == :(1//16*pi^(1/2)*f^a*(3*f+c*log(f))^-1//2*erfi(x*(3*f+c*log(f))^(1/2))*exp(3d)+1//16*pi^(1/2)*f^a*(3*f+-1*c*log(f))^-1//2*erf(x*(3*f+-1*c*log(f))^(1/2))*exp(-3d)+3//16*pi^(1/2)*f^a*(f+c*log(f))^-1//2*erfi(x*(f+c*log(f))^(1/2))*exp(d)+3//16*pi^(1/2)*f^a*(f+-1*c*log(f))^-1//2*erf(x*(f+-1*c*log(f))^(1/2))*exp(-1d))
@test integrate(f^(a+c*x^2)*cosh(d+e*x+f*x^2), x) == :(1//4*pi^(1/2)*f^a*(f+c*log(f))^-1//2*erfi((1/2)*(f+c*log(f))^-1//2*(e+2*x*(f+c*log(f))))*exp(d+-1*e^2*(4*f+4*c*log(f))^-1)+1//4*pi^(1/2)*f^a*(f+-1*c*log(f))^-1//2*erf((1/2)*(f+-1*c*log(f))^-1//2*(e+2*x*(f+-1*c*log(f))))*exp(-1d+e^2*(4*f+-4*c*log(f))^-1))
@test integrate(f^(a+c*x^2)*cosh(d+e*x+f*x^2)^2, x) == :(1//4*pi^(1/2)*c^-1//2*f^a*log(f)^-1//2*erfi(x*c^(1/2)*log(f)^(1/2))+1//8*pi^(1/2)*f^a*(2*f+c*log(f))^-1//2*erfi((2*f+c*log(f))^-1//2*(e+x*(2*f+c*log(f))))*exp(2d+-1*e^2*(2*f+c*log(f))^-1)+1//8*pi^(1/2)*f^a*(2*f+-1*c*log(f))^-1//2*erf((2*f+-1*c*log(f))^-1//2*(e+x*(2*f+-1*c*log(f))))*exp(-2d+e^2*(2*f+-1*c*log(f))^-1))
@test integrate(f^(a+c*x^2)*cosh(d+e*x+f*x^2)^3, x) == :(1//16*pi^(1/2)*f^a*(3*f+c*log(f))^-1//2*erfi((1/2)*(3*f+c*log(f))^-1//2*(3*e+2*x*(3*f+c*log(f))))*exp(3d+-9*e^2*(12*f+4*c*log(f))^-1)+1//16*pi^(1/2)*f^a*(3*f+-1*c*log(f))^-1//2*erf((1/2)*(3*f+-1*c*log(f))^-1//2*(3*e+2*x*(3*f+-1*c*log(f))))*exp(-3d+9*e^2*(12*f+-4*c*log(f))^-1)+3//16*pi^(1/2)*f^a*(f+c*log(f))^-1//2*erfi((1/2)*(f+c*log(f))^-1//2*(e+2*x*(f+c*log(f))))*exp(d+-1*e^2*(4*f+4*c*log(f))^-1)+3//16*pi^(1/2)*f^a*(f+-1*c*log(f))^-1//2*erf((1/2)*(f+-1*c*log(f))^-1//2*(e+2*x*(f+-1*c*log(f))))*exp(-1d+e^2*(4*f+-4*c*log(f))^-1))
@test integrate(f^(a+b*x+c*x^2)*cosh(d+f*x^2), x) == :(-1//4*pi^(1/2)*f^a*(f+-1*c*log(f))^-1//2*erf((1/2)*(f+-1*c*log(f))^-1//2*(b*log(f)+-2*x*(f+-1*c*log(f))))*exp(-1d+b^2*(4*f+-4*c*log(f))^-1*log(f)^2)+1//4*pi^(1/2)*f^a*(f+c*log(f))^-1//2*erfi((1/2)*(f+c*log(f))^-1//2*(b*log(f)+2*x*(f+c*log(f))))*exp(d+-1*b^2*(4*f+4*c*log(f))^-1*log(f)^2))
@test integrate(f^(a+b*x+c*x^2)*cosh(d+f*x^2)^2, x) == :(-1//8*pi^(1/2)*f^a*(2*f+-1*c*log(f))^-1//2*erf((1/2)*(2*f+-1*c*log(f))^-1//2*(b*log(f)+-2*x*(2*f+-1*c*log(f))))*exp(-2d+b^2*(8*f+-4*c*log(f))^-1*log(f)^2)+1//4*pi^(1/2)*c^-1//2*f^(a+-1//4*b^2*c^-1)*log(f)^-1//2*erfi((1/2)*c^-1//2*log(f)^(1/2)*(b+2*c*x))+1//8*pi^(1/2)*f^a*(2*f+c*log(f))^-1//2*erfi((1/2)*(2*f+c*log(f))^-1//2*(b*log(f)+2*x*(2*f+c*log(f))))*exp(2d+-1*b^2*(8*f+4*c*log(f))^-1*log(f)^2))
@test integrate(f^(a+b*x+c*x^2)*cosh(d+f*x^2)^3, x) == :(-3//16*pi^(1/2)*f^a*(f+-1*c*log(f))^-1//2*erf((1/2)*(f+-1*c*log(f))^-1//2*(b*log(f)+-2*x*(f+-1*c*log(f))))*exp(-1d+b^2*(4*f+-4*c*log(f))^-1*log(f)^2)+-1//16*pi^(1/2)*f^a*(3*f+-1*c*log(f))^-1//2*erf((1/2)*(3*f+-1*c*log(f))^-1//2*(b*log(f)+-2*x*(3*f+-1*c*log(f))))*exp(-3d+b^2*(12*f+-4*c*log(f))^-1*log(f)^2)+1//16*pi^(1/2)*f^a*(3*f+c*log(f))^-1//2*erfi((1/2)*(3*f+c*log(f))^-1//2*(b*log(f)+2*x*(3*f+c*log(f))))*exp(3d+-1*b^2*(12*f+4*c*log(f))^-1*log(f)^2)+3//16*pi^(1/2)*f^a*(f+c*log(f))^-1//2*erfi((1/2)*(f+c*log(f))^-1//2*(b*log(f)+2*x*(f+c*log(f))))*exp(d+-1*b^2*(4*f+4*c*log(f))^-1*log(f)^2))
@test integrate(f^(a+b*x+c*x^2)*cosh(d+e*x+f*x^2), x) == :(1//4*pi^(1/2)*f^a*(f+c*log(f))^-1//2*erfi((1/2)*(f+c*log(f))^-1//2*(e+b*log(f)+2*x*(f+c*log(f))))*exp(d+-1*(e+b*log(f))^2*(4*f+4*c*log(f))^-1)+1//4*pi^(1/2)*f^a*(f+-1*c*log(f))^-1//2*erf((1/2)*(f+-1*c*log(f))^-1//2*(e+-1*b*log(f)+2*x*(f+-1*c*log(f))))*exp(-1d+(e+-1*b*log(f))^2*(4*f+-4*c*log(f))^-1))
@test integrate(f^(a+b*x+c*x^2)*cosh(d+e*x+f*x^2)^2, x) == :(1//4*pi^(1/2)*c^-1//2*f^(a+-1//4*b^2*c^-1)*log(f)^-1//2*erfi((1/2)*c^-1//2*log(f)^(1/2)*(b+2*c*x))+1//8*pi^(1/2)*f^a*(2*f+c*log(f))^-1//2*erfi((1/2)*(2*f+c*log(f))^-1//2*(2*e+b*log(f)+2*x*(2*f+c*log(f))))*exp(2d+-1*(2*e+b*log(f))^2*(8*f+4*c*log(f))^-1)+1//8*pi^(1/2)*f^a*(2*f+-1*c*log(f))^-1//2*erf((1/2)*(2*f+-1*c*log(f))^-1//2*(2*e+-1*b*log(f)+2*x*(2*f+-1*c*log(f))))*exp(-2d+(2*e+-1*b*log(f))^2*(8*f+-4*c*log(f))^-1))
@test integrate(f^(a+b*x+c*x^2)*cosh(d+e*x+f*x^2)^3, x) == :(1//16*pi^(1/2)*f^a*(3*f+c*log(f))^-1//2*erfi((1/2)*(3*f+c*log(f))^-1//2*(3*e+b*log(f)+2*x*(3*f+c*log(f))))*exp(3d+-1*(3*e+b*log(f))^2*(12*f+4*c*log(f))^-1)+1//16*pi^(1/2)*f^a*(3*f+-1*c*log(f))^-1//2*erf((1/2)*(3*f+-1*c*log(f))^-1//2*(3*e+-1*b*log(f)+2*x*(3*f+-1*c*log(f))))*exp(-3d+(3*e+-1*b*log(f))^2*(12*f+-4*c*log(f))^-1)+3//16*pi^(1/2)*f^a*(f+c*log(f))^-1//2*erfi((1/2)*(f+c*log(f))^-1//2*(e+b*log(f)+2*x*(f+c*log(f))))*exp(d+-1*(e+b*log(f))^2*(4*f+4*c*log(f))^-1)+3//16*pi^(1/2)*f^a*(f+-1*c*log(f))^-1//2*erf((1/2)*(f+-1*c*log(f))^-1//2*(e+-1*b*log(f)+2*x*(f+-1*c*log(f))))*exp(-1d+(e+-1*b*log(f))^2*(4*f+-4*c*log(f))^-1))
@test integrate(x*cosh(x)^(1/2)+x*cosh(x)^-3//2, x) == :(-4*cosh(x)^(1/2)+2*x*cosh(x)^-1//2*sinh(x))
@test integrate(x*cosh(x)^-5//2+-1//3*x*cosh(x)^-1//2, x) == :(4//3*cosh(x)^-1//2+2//3*x*cosh(x)^-3//2*sinh(x))
@test integrate(x*cosh(x)^-7//2+3//5*x*cosh(x)^(1/2), x) == :(-12//5*cosh(x)^(1/2)+4//15*cosh(x)^-3//2+2//5*x*cosh(x)^-5//2*sinh(x)+6//5*x*cosh(x)^-1//2*sinh(x))
@test integrate(x^2*cosh(x)^(1/2)+x^2*cosh(x)^-3//2, x) == :(-16*im*Elliptic.E((1/2)*im*x,2)+-8*x*cosh(x)^(1/2)+2*x^2*cosh(x)^-1//2*sinh(x))
@test integrate((x+cosh(x))^2, x) == :((1/2)*x+-2*cosh(x)+1//3*x^3+(1/2)*cosh(x)*sinh(x)+2*x*sinh(x))
@test integrate((x+cosh(x))^3, x) == :(7*sinh(x)+-3//4*cosh(x)^2+1//3*sinh(x)^3+1//4*x^4+3//4*x^2+-6*x*cosh(x)+3*x^2*sinh(x)+3//2*x*cosh(x)*sinh(x))
@test integrate((c+d*x^2)^-1*cosh(a+b*x), x) == :((1/2)*d^-1//2*(-1c)^-1//2*cosh(a+b*d^-1//2*(-1c)^(1/2))*coshintegral(-1*b*x+b*d^-1//2*(-1c)^(1/2))+-1//2*d^-1//2*(-1c)^-1//2*cosh(a+-1*b*d^-1//2*(-1c)^(1/2))*coshintegral(b*x+b*d^-1//2*(-1c)^(1/2))+-1//2*d^-1//2*(-1c)^-1//2*sinh(a+b*d^-1//2*(-1c)^(1/2))*sinhintegral(-1*b*x+b*d^-1//2*(-1c)^(1/2))+-1//2*d^-1//2*(-1c)^-1//2*sinh(a+-1*b*d^-1//2*(-1c)^(1/2))*sinhintegral(b*x+b*d^-1//2*(-1c)^(1/2)))
@test integrate((c+d*x+e*x^2)^-1*cosh(a+b*x), x) == :((d^2+-4*c*e)^-1//2*cosh(a+-1//2*b*e^-1*(d+-1*(d^2+-4*c*e)^(1/2)))*coshintegral(b*x+(1/2)*b*e^-1*(d+-1*(d^2+-4*c*e)^(1/2)))+(d^2+-4*c*e)^-1//2*sinh(a+-1//2*b*e^-1*(d+-1*(d^2+-4*c*e)^(1/2)))*sinhintegral(b*x+(1/2)*b*e^-1*(d+-1*(d^2+-4*c*e)^(1/2)))+-1*(d^2+-4*c*e)^-1//2*cosh(a+-1//2*b*e^-1*(d+(d^2+-4*c*e)^(1/2)))*coshintegral(b*x+(1/2)*b*e^-1*(d+(d^2+-4*c*e)^(1/2)))+-1*(d^2+-4*c*e)^-1//2*sinh(a+-1//2*b*e^-1*(d+(d^2+-4*c*e)^(1/2)))*sinhintegral(b*x+(1/2)*b*e^-1*(d+(d^2+-4*c*e)^(1/2))))

max_stars_repo_path: test/6 Hyperbolic functions/6.2 Hyperbolic cosine/6.2.5 Hyperbolic cosine functions.jl


text:
module FractalRender

  using CSFML.LibCSFML

  include("./state.jl")
  include("./colors.jl")
  include("./simulate.jl")
  include("./render.jl")

  function main()
    width = 1000
    height = 1000
    zoom = 0.5
    iterations=100
    renderState = RenderState(width=width, height=height)
    simState = State(res=(width,height), iterations=iterations)

    i = 0

    step!(simState)
    update!(simState, renderState)

    event = Ref{sfEvent}()
    while Bool(sfRenderWindow_isOpen(renderState.window))

      while Bool(sfRenderWindow_pollEvent(renderState.window, event))
        if event.x.type == sfEvtClosed
          sfImage_saveToFile(sfRenderWindow_capture(renderState.window), "output/output.png")
          sfRenderWindow_close(renderState.window)
        end
      end

      if Bool(sfMouse_isButtonPressed(sfMouseLeft))
        pos = sfMouse_getPositionRenderWindow(renderState.window)

        println("Mouse event registered at: ", pos)

        if pos.x in 1:width && pos.y in 1:height
          println("Valid mouse event. Zooming...")
          dx = pos.x / width
          dy = pos.y / height

          newbounds = (
          (
            simState.bounds[1][1] + zoom * dx * simState.lengths[1],
            simState.bounds[1][2] - zoom * (1 - dx) * simState.lengths[1]
          ),
          (
            simState.bounds[2][1] + zoom * dy * simState.lengths[2],
            simState.bounds[2][2] - zoom * (1 - dy) * simState.lengths[2]
          ))

          simState.bounds = newbounds
          updateState!(simState)
          step!(simState)
          update!(simState, renderState)
        end
      end

      render!(simState, renderState)

      i += 1
    end
  end
end

FractalRender.main()

max_stars_repo_name: benchislett/Skunkworks

max_issues_repo_name: benchislett/Skunkworks

max_forks_repo_name: benchislett/Skunkworks


text:
function TestAnnulusGrid()
close all
nx=10;
ny=10;
RadI=1;
RadO=2;
Boundary.X='Period';
Param.Grid=AnnulusGrid(nx,ny,RadI,RadO,OrientFaceCart,Boundary);
fig=1;
PlotFaceGrid(Param.Grid,4,@JacobiAnnulus,fig)
DG.OrdPoly=2;
[DG.w,DG.xw]=GaussLobattoQuad(DG.OrdPoly);
[DG.DS,DG.DW]=DerivativeMatrix(DG);

Param.X=zeros(DG.OrdPoly+1,DG.OrdPoly+1,2,Param.Grid.NumFaces);
Param.dXdx=zeros(DG.OrdPoly+1,DG.OrdPoly+1,2,2,Param.Grid.NumFaces);
Param.J=zeros(DG.OrdPoly+1,DG.OrdPoly+1,Param.Grid.NumFaces);
for iF=1:Param.Grid.NumFaces
  [Param.J(:,:,iF),Param.dXdx(:,:,:,:,iF),Param.X(:,:,:,iF)]=...
    JacobiDG(DG,Param.Grid.Faces(iF),Param.Grid,@Annulus);
end
end


text:
module PropertyCheck

import Distributions
import Distributions: UnivariateDistribution, Bernoulli, Uniform, DiscreteUniform
const dist = Distributions

# package code goes here
include("general.jl")
include("Number.jl")
include("Just.jl")
include("Collections.jl")

end # module

max_stars_repo_name: cpritcha/PropertyCheck

max_issues_repo_name: cpritcha/PropertyCheck

max_forks_repo_name: cpritcha/PropertyCheck


text:
module RadioactiveHeat

# If you want to add a new method here, feel free to do so.
# Remember to also export the function name in GeoParams.jl (in addition to here)

using Parameters, LaTeXStrings, Unitful
using ..Units
using GeoParams: AbstractMaterialParam
using ..MaterialParameters: MaterialParamsInfo
import Base.show, GeoParams.param_info

abstract type AbstractRadioactiveHeat{T} <: AbstractMaterialParam end

export  compute_radioactive_heat,                  # calculation routines
        param_info,
        ConstantRadioactiveHeat                  # constant

# Constant  -------------------------------------------------------
"""
    ConstantRadioactiveHeat(H_r=1e-6Watt/m^3)

Set a constant radioactive heat:
```math
    H_r  = cst
```
where ``H_r`` is the radioactive heat source [``Watt/m^3``].
"""
@with_kw_noshow struct ConstantRadioactiveHeat{T,U} <: AbstractRadioactiveHeat{T}
    H_r::GeoUnit{T,U}         =   1e-6Watt/m^3
end
ConstantRadioactiveHeat(a...) = ConstantRadioactiveHeat(convert.(GeoUnit,a)...)

function param_info(s::ConstantRadioactiveHeat) # info about the struct
    return MaterialParamsInfo(Equation = L"H_r = cst")
end

# Calculation routine
function compute_radioactive_heat(s::ConstantRadioactiveHeat)
    @unpack_val H_r   = s

    return H_r
end

# Print info
function show(io::IO, g::ConstantRadioactiveHeat)
    print(io, "Constant radioactive heat: H_r=$(g.H_r.val)")
end
#-------------------------------------------------------------------------

# Help info for the calculation routines
"""
    H_r = compute_radioactive_heat(s:<AbstractRadioactiveHeat)

Returns the radioactive heat `H_r`

"""
compute_radioactive_heat()

end


text:
# ---
# title: "`extreme_filter`"
# id: op_extreme_filter
# cover: assets/extreme_filter.png
# ---

# The `extreme_filter` function is the core operation in ImageMorphology. Many other
# morphological operations such as [`dilate`](@ref) and [`erode`](@ref) are direct usages of
# it. The cover image shows a pixel jitter using random select function.

# This page gives an overview of the `extreme_filter` function as a tutorial. It might not
# exactly show every details. For a comprehensive and more accurate documentation, please
# check the [`extreme_filter`](@ref) page.

using ImageMorphology
using ImageFiltering
using TestImages
using ImageBase
using ImageShow
using Random #hide
Random.seed!(1234); #hide

# ## Definition
#
# Below is the basic interface for this function
#
# ```julia
# extreme_filter(f, A, se)
# ```
#
# For each pixel `p` in A, a select function `f(x, y)` will be applied iteratively to the
# its neighborhood. The neighborhood is defined by the structuring element `se`. In plain
# Julia codes, this is as simple as:
#
# ```julia
# # For illustration purposes only; you should use `extreme_filter` in practice
# function simple_extreme_filter(f, A, se)
#     se = strel(CartesianIndex, se)
#     R = CartesianIndices(A)
#     for p in R
#         x = A[p]
#         for o in se
#             q = p + o
#             q in R || continue
#             x = f(x, A[q])
#         end
#         A[p] = x
#     end
# end
# ```
#
# !!! tip "structuring element"
#     Structuring element defines the shape of each pixel's neighborhood. If you haven't
#     used [`strel`](@ref) before or don't know what `se` means. It is recommended to read
#     the concept introduction page "[Structuring element](@ref concept_se)" first.

# The name "extreme" comes from the fact that `max` and `min` are typical examples of the
# select function `f`.

# ## Examples

# To illustrate how it works, let's load the wirebond mask image and apply the extreme
# filter to it.

img = restrict(testimage_dip3e("fig1005")) # wirebond mask

#-

se = strel_diamond((3, 3)) # a dimond shape structuring element

# We use `max` as the select function -- applying `max` gives the [dilation](@ref op_dilate) operation:

extreme_filter(max, img, se)

# with the SE size controls the degree of dilation:

imgs = [extreme_filter(max, img, strel_diamond((n, n))) for n in 3:2:13]
mosaic(imgs; nrow=1)

# and `dims` controls the dimension to be dilated:

img_d1 = extreme_filter(max, img, strel_diamond((13, 13), (1,)))
img_d2 = extreme_filter(max, img, strel_diamond((13, 13), (2,)))
img_d12 = extreme_filter(max, img, strel_diamond((13, 13))) # (1, 2)
mosaic(img, img_d1, img_d2, img_d12; nrow=1)

# The `extreme_filter` can be used to build many operations, including the basic dilation,
# erosion, and some other operators. Here we just list a few for inspiration:

se = strel_diamond((7, 7))
img_1 = extreme_filter(max, img, se) # dilate
img_2 = extreme_filter(min, img, se) # erode
img_3 = extreme_filter((x, y) -> rand() > 0.5 ? x : y, img, se) # jitter
## or pipe the filters
img_4 = extreme_filter(max, extreme_filter(min, img), se) # opening
img_5 = extreme_filter(min, extreme_filter(max, img), se) # closing
mosaic(img, img_1, img_2, img_3, img_4, img_5; nrow=1)

# Many of the above operations are already implemented in ImageMorphology.

## the `mapwindow` function

# There is a very similar function to `extreme_filter` called `mapwindow(f, img, window)`
# from [ImageFiltering.jl](https://github.com/JuliaImages/ImageFiltering.jl). The main
# difference is that `f` in `mapwindow` applies to the entire neighborhood instead of two
# points in `extreme_filter`.

## currently, mapwindow only supports the box-shaped neighborhood
img1 = extreme_filter(max, img, strel_box((7, 7)))
img2 = mapwindow(maximum, img, (7, 7))
img1 == img2

# save cover image #src
using FileIO #src
mkpath("assets") #src
img = Gray.(restrict(testimage("blobs"))) #src
save("assets/extreme_filter.png", extreme_filter((x, y) -> rand() > 0.5 ? x : y, img; r=1)) #src


text:
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.

mutable struct Location <: SwaggerModel
    id::Any # spec type: Union{ Nothing, String } # spec name: id
    subscriptionId::Any # spec type: Union{ Nothing, String } # spec name: subscriptionId
    name::Any # spec type: Union{ Nothing, String } # spec name: name
    displayName::Any # spec type: Union{ Nothing, String } # spec name: displayName
    latitude::Any # spec type: Union{ Nothing, String } # spec name: latitude
    longitude::Any # spec type: Union{ Nothing, String } # spec name: longitude

    function Location(;id=nothing, subscriptionId=nothing, name=nothing, displayName=nothing, latitude=nothing, longitude=nothing)
        o = new()
        validate_property(Location, Symbol("id"), id)
        setfield!(o, Symbol("id"), id)
        validate_property(Location, Symbol("subscriptionId"), subscriptionId)
        setfield!(o, Symbol("subscriptionId"), subscriptionId)
        validate_property(Location, Symbol("name"), name)
        setfield!(o, Symbol("name"), name)
        validate_property(Location, Symbol("displayName"), displayName)
        setfield!(o, Symbol("displayName"), displayName)
        validate_property(Location, Symbol("latitude"), latitude)
        setfield!(o, Symbol("latitude"), latitude)
        validate_property(Location, Symbol("longitude"), longitude)
        setfield!(o, Symbol("longitude"), longitude)
        o
    end
end # type Location

const _property_map_Location = Dict{Symbol,Symbol}(Symbol("id")=>Symbol("id"), Symbol("subscriptionId")=>Symbol("subscriptionId"), Symbol("name")=>Symbol("name"), Symbol("displayName")=>Symbol("displayName"), Symbol("latitude")=>Symbol("latitude"), Symbol("longitude")=>Symbol("longitude"))
const _property_types_Location = Dict{Symbol,String}(Symbol("id")=>"String", Symbol("subscriptionId")=>"String", Symbol("name")=>"String", Symbol("displayName")=>"String", Symbol("latitude")=>"String", Symbol("longitude")=>"String")
Base.propertynames(::Type{ Location }) = collect(keys(_property_map_Location))
Swagger.property_type(::Type{ Location }, name::Symbol) = Union{Nothing,eval(Meta.parse(_property_types_Location[name]))}
Swagger.field_name(::Type{ Location }, property_name::Symbol) =  _property_map_Location[property_name]

function check_required(o::Location)
    true
end

function validate_property(::Type{ Location }, name::Symbol, val)
end


text:
m = AnSchorfheide()

# settings
# settings - boolean, string, and number. adding to model. overwriting. filestrings. testing/not testing.
n_mh_blocks = Setting(:n_mh_blocks, 22) # short constructor
reoptimize = Setting(:reoptimize, false)
vint = Setting(:data_vintage, "REF", true, "vint", "Date of data") # full constructor

@testset "Check settings corresponding to parameters" begin
    @test promote_rule(Setting{Float64}, Float16) == Float64
    @test promote_rule(Setting{Bool}, Bool) == Bool
    @test promote_rule(Setting{String}, String) == String
    @test convert(Int64, n_mh_blocks) == 22
    @test convert(String, vint) == "REF"

    @test get_setting(m, :n_mh_blocks) == m.settings[:n_mh_blocks].value
    m.testing = true
    @test get_setting(m, :n_mh_blocks) == m.test_settings[:n_mh_blocks].value
    @test ModelConstructors.filestring(m) == "_test"

    m.testing = false
    m <= Setting(:n_mh_blocks, 5, true, "mhbk", "Number of blocks for Metropolis-Hastings")
    @test m.settings[:n_mh_blocks].value == 5
    @test occursin(r"^\s*_mhbk=5_vint=(\d{6})", ModelConstructors.filestring(m))
    ModelConstructors.filestring(m, "key=val")
    ModelConstructors.filestring(m, ["key=val", "foo=bar"])
    m.testing = true

  # Overwriting settings
    a = gensym() # unlikely to clash
    b = gensym()
    m <= Setting(a, 0, true, "abcd", "a")
    m <= Setting(a, 1)
    @test m.test_settings[a].value == 1
    @test m.test_settings[a].print == true
    @test m.test_settings[a].code == "abcd"
    @test m.test_settings[a].description == "a"
    m <= Setting(b, 2, false, "", "b")
    m <= Setting(b, 3, true, "abcd", "b1")
    @test m.test_settings[b].value == 3
    @test m.test_settings[b].print == true
    @test m.test_settings[b].code == "abcd"
    @test m.test_settings[b].description == "b1"
end


text:
function title!(v::VegaVisualization;
                        title::AbstractString = "", y::Int = -40, fill::AbstractString = "black", fontSize::Int = 16,
                        align::AbstractString = "center", baseline::AbstractString = "top", fontWeight::AbstractString = "bold",
                        font::AbstractString = "", x::Int = 0)

	titlemark = VegaMark(_type = "text",
                       from = VegaMarkFrom(value = title),
                       properties = VegaMarkProperties(enter = VegaMarkPropertySet(x = VegaValueRef(value = (x == 0 ? (v.width / 2) : x)),
                                                                                y = VegaValueRef(value = y),
                                                                                text = VegaValueRef(value = title),
                                                                                fill = VegaValueRef(value = fill),
                                                                                fontSize = VegaValueRef(value = fontSize),
                                                                                align = VegaValueRef(value = align),
                                                                                baseline = VegaValueRef(value = baseline),
                                                                                fontWeight = VegaValueRef(value = fontWeight),
                                                                                font = VegaValueRef(value = font)
                                                                                )
))

	push!(v.marks, titlemark)

	return v
end

#Same function as title, just with different name and defaults for a different conceptual feel
text!(v::VegaVisualization; title::AbstractString = "", y::Int = 50, fill::AbstractString = "black", fontSize::Int = 12,
      align::AbstractString = "center", baseline::AbstractString = "top", fontWeight::AbstractString = "",
      font::AbstractString = "", x::Int = 50) =

      title!(v, title = title, y = y, fill = fill, fontSize = fontSize, align = align, baseline = baseline, fontWeight = fontWeight, font = font, x = x)

max_stars_repo_name: jpthor/vega


text:
include("ode.jl")
include("dae.jl")
nothing


text:
using Statistics: mean, median

function instance_mean(scores)
    dropdims(mean(scores, dims=1:ndims(scores) - 1), dims=1)
end

const _ae_params = """    encoder::Chain
Transforms the input data into a latent state with a fixed shape.

    decoder::Chain
Transforms the latent state back into the shape of the input data.

    batchsize::Integer
The number of samples to work through before updating the internal model parameters.

    epochs::Integer
The number of passes of the entire training dataset the machine learning algorithm has completed.

    shuffle::Bool
If `shuffle=true`, shuffles the observations each time iterations are re-started, else no shuffling is performed.

    partial::Bool
If `partial=false`, drops the last mini-batch if it is smaller than the batchsize.

    opt::Any
Any Flux-compatibale optimizer, typically a `struct`  that holds all the optimiser parameters along with a definition of
`apply!` that defines how to apply the update rule associated with the optimizer."""

const _ae_loss = """    loss::Function
The loss function used to calculate the reconstruction error, see <https://fluxml.ai/Flux.jl/stable/models/losses/>
for examples."""