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

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

max_stars_repo_path: test/6 Hyperbolic functions/6.1 Hyperbolic sine/6.1.5 Hyperbolic sine functions.jl


text:
module wgregseq

include("enzyme_list.jl")

module promoter_finder
include("promoter_finder.jl")
end

using .promoter_finder
module design
include("design.jl")
end

module plotting_style
include("plotting_style.jl")
end

module quality_control
include("qc.jl")
end

module utils
include("utils.jl")
export parse
end

end # module

ext: jl


text:
using DSGE

for T in subtypes(Transform)
    u = parameter(:σ_pist, 2.5230, (1e-8, 5.), (1e-8, 5.), T(), fixed=false)
    @test ( transform_to_real_line(u) |> x -> transform_to_model_space(u,x) ) == u.value

    if !isa(T,Type{DSGE.Untransformed})
        # check transform_to_real_line and transform_to_model_space to different things if T is not DSGE.Untransformed
        @test transform_to_real_line(u,u.value) != transform_to_model_space(u,u.value)
    end
end

# probability
N = 10^2
u = parameter(:bloop, 2.5230, (1e-8, 5.), (1e-8, 5.), DSGE.SquareRoot(); fixed = true)
v = parameter(:cat, 2.5230, (1e-8, 5.), (1e-8, 5.), DSGE.Exponential(), Gamma(2.00, 0.1))

pvec =  ParameterVector{Float64}(N)
for i in 1:length(pvec)
	pvec[i] = (i%2 == 0) ? u : v
end
@test_approx_eq logpdf(pvec) 50*logpdf(v)
@test_approx_eq pdf(pvec) exp(50*logpdf(v))

updated = update(pvec, ones(length(pvec)))
update!(pvec, ones(length(pvec)))

@test all(updated .== pvec)
@test logpdf(pvec) == logpdf(updated)

# test we only update unfixed parameters
for p in pvec
	if p.fixed
		@test p.value == 2.5230
	elseif isa(p, Parameter)
		@test p.value == one(Float64)
	end
end

# vector of new values must be the same length
@test_throws AssertionError update!(pvec, ones(length(pvec)-1))

for w in [parameter(:moop, 3.0, fixed=false), parameter(:moop, 3.0; scaling = log, fixed=false)]
	# new values must be of the same type
	@test_throws MethodError parameter(w, one(Int))

	# new value is out of bounds
	@test_throws ParamBoundsError parameter(w, -1.)
end

# subspecs
function sstest(m::Model990)

    # Change all the fields of an unfixed parameter
    m <= parameter(:ι_w, 0.000, (0.0, .9999), (0.0,0.9999), DSGE.Untransformed(), Normal(0.0,1.0), fixed=false,
                   description="ι_w: No description available.",
                   tex_label="\\iota_w")

    # Change an unfixed parameter to be fixed
    m <= parameter(:ι_p, 0.000, fixed=true,
                   description= "ι_p: The persistence of last period's inflation in
                   the equation that describes the intertemporal
                   change in prices for intermediate goods producers
                   who cannot adjust prices. The change in prices is a
                   geometric average of steady-state inflation
                   (π_star, with weight (1-ι_p)) and last period's
                   inflation (π_{t-1})).",
                   tex_label="\\iota_p")

    # Change a fixed parameter
    m <= parameter(:δ, 0.02,  fixed=true,
                   description="δ: The capital depreciation rate.", tex_label="\\delta" )

    # Overwrite a fixed parameter with an unfixed parameter
    m <= parameter(:ϵ_p, 0.750, (1e-5, 10.),   (1e-5, 10.),     DSGE.Exponential(),    GammaAlt(0.75, 0.4),        fixed=false,  scaling = x -> 1 + x/100,
                   description="ϵ_p: No description available.",
                   tex_label="\\varepsilon_{p}")

    steadystate!(m)
end

m = Model990()
sstest(m)

@test m[:ι_w].value == 0.0
@test m[:ι_w].valuebounds == (0.0, .9999)
@test m[:ι_w].transform == DSGE.Untransformed()
@test m[:ι_w].transform_parameterization == (0.0,0.9999)
@test isa(m[:ι_w].prior.value, Normal)

@test m[:ι_p].value == 0.0
@test m[:ι_p].valuebounds == (0.0, 0.0)
@test isnull(m[:ι_p].prior)
@test m[:ι_p].fixed == true

@test m[:δ].value == 0.02
@test m[:δ].valuebounds == (0.02, 0.02)
@test isnull(m[:δ].prior)
@test m[:δ].fixed == true

@test m[:ϵ_p].value == 0.750
@test m[:ϵ_p].transform == DSGE.Exponential()
@test isa(m[:ϵ_p].prior.value, Gamma)
@test m[:ϵ_p].fixed==false

nothing


text:
function para_jset(img)
   yrange = img[1]
   xrange = img[2]
   array_slice = (size(yrange, 1), size(xrange, 1))
   jset = Array(Uint8, array_slice)
   x0 = xrange[1]
   y0 = yrange[1]

   for x = xrange, y = yrange
     pix = 256
     z = complex(  (x-width/2)/(height/2),
			(y-height/2)/(height/2))
     for n = 1:256
       if abs(z) > 2
         pix = n-1
         break
       end
       z = z^2 + C
     end
     jset[y - y0 + 1, x - x0 + 1] = uint8(pix)
   end
   return jset
end

max_stars_repo_path: Module 3/Chapter09/para_jset.jl

max_issues_repo_path: Module 3/Chapter09/para_jset.jl

max_forks_repo_path: Module 3/Chapter09/para_jset.jl


text:
# Generate the d-Neighborhood of a String

const NUCLEOTIDES = ['A', 'C', 'G', 'T']

function calc_immediate_neighbours(pattern)
    neighbours = Set{String}()
    for (ix, letter) in enumerate(pattern)
        for nucleotide in NUCLEOTIDES
            if nucleotide != letter
                pattern_array = collect(pattern)
                pattern_array[ix] = nucleotide
                push!(neighbours, join(pattern_array))
            end
        end
    end
    neighbours
end

function generate_neighbourhood(text, d)
    neighbourhood = Set{String}([text])
    for _ in 1:d
        neighbours_of_neighbours = Set{String}()
        for pattern in neighbourhood
            immediate_neighbours = calc_immediate_neighbours(pattern)
            union!(neighbours_of_neighbours, immediate_neighbours)
        end
        union!(neighbourhood, neighbours_of_neighbours)
    end
    neighbourhood
end

function main()
    pattern = readline()
    d = parse(Int64, readline())
    result = generate_neighbourhood(pattern, d)
    foreach(println, result)
end

main()


text:
### Reference state
using DocStringExtensions
export NoReferenceState,
    HydrostaticState,
    IsothermalProfile,
    LinearTemperatureProfile,
    DryAdiabaticProfile

"""
    ReferenceState

Reference state, for example, used as initial
condition or for linearization.
"""
abstract type ReferenceState end

vars_state(m::ReferenceState, FT) = @vars()
vars_gradient(m::ReferenceState, FT) = @vars()
vars_diffusive(m::ReferenceState, FT) = @vars()
vars_aux(m::ReferenceState, FT) = @vars()
atmos_init_aux!(
    ::ReferenceState,
    ::AtmosModel,
    aux::Vars,
    geom::LocalGeometry,
) = nothing

"""
    NoReferenceState <: ReferenceState

No reference state used
"""
struct NoReferenceState <: ReferenceState end

"""
    HydrostaticState{P,T} <: ReferenceState

A hydrostatic state specified by a temperature profile and relative humidity.
"""
struct HydrostaticState{P, F} <: ReferenceState
    temperatureprofile::P
    relativehumidity::F
end

vars_aux(m::HydrostaticState, FT) =
    @vars(ρ::FT, p::FT, T::FT, ρe::FT, ρq_tot::FT)

function atmos_init_aux!(
    m::HydrostaticState{P, F},
    atmos::AtmosModel,
    aux::Vars,
    geom::LocalGeometry,
) where {P, F}
    T, p = m.temperatureprofile(atmos.orientation, aux)
    aux.ref_state.T = T
    aux.ref_state.p = p
    aux.ref_state.ρ = ρ = p / (R_d * T)
    q_vap_sat = q_vap_saturation(T, ρ, atmos.param_set)
    aux.ref_state.ρq_tot = ρq_tot = ρ * m.relativehumidity * q_vap_sat

    q_pt = PhasePartition(ρq_tot)
    aux.ref_state.ρe = ρ * internal_energy(T, q_pt, atmos.param_set)

    e_kin = F(0)
    e_pot = gravitational_potential(atmos.orientation, aux)
    aux.ref_state.ρe = ρ * total_energy(e_kin, e_pot, T, q_pt, atmos.param_set)
end

"""
    TemperatureProfile

Specifies the temperature profile for a reference state.

Instances of this type are required to be callable objects with the following signature

    T,p = (::TemperatureProfile)(orientation::Orientation, aux::Vars)

where `T` is the temperature (in K), and `p` is the pressure (in hPa).
"""
abstract type TemperatureProfile end

"""
    IsothermalProfile{F} <: TemperatureProfile

A uniform temperature profile.

# Fields

$(DocStringExtensions.FIELDS)
"""
struct IsothermalProfile{F} <: TemperatureProfile
    "temperature (K)"
    T::F
end

function (profile::IsothermalProfile)(orientation::Orientation, aux::Vars)
    p =
        MSLP *
        exp(-gravitational_potential(orientation, aux) / (R_d * profile.T))
    return (profile.T, p)
end

"""
    DryAdiabaticProfile{F} <: TemperatureProfile

A temperature profile that has uniform potential temperature θ until it
reaches the minimum specified temperature `T_min`

# Fields

$(DocStringExtensions.FIELDS)
"""
struct DryAdiabaticProfile{F} <: TemperatureProfile
    "minimum temperature (K)"
    T_min::F
    "potential temperature (K)"
    θ::F
end

function (profile::DryAdiabaticProfile)(orientation::Orientation, aux::Vars)
    FT = eltype(aux)
    LinearTemperatureProfile(profile.T_min, profile.θ, FT(grav / cp_d))(
        orientation,
        aux,
    )
end

"""
    LinearTemperatureProfile{F} <: TemperatureProfile

A temperature profile which decays linearly with height `z`, until it reaches a minimum specified temperature.

```math
T(z) = \\max(T_{\\text{surface}} − Γ z, T_{\\text{min}})
```

# Fields

$(DocStringExtensions.FIELDS)
"""
struct LinearTemperatureProfile{FT} <: TemperatureProfile
    "minimum temperature (K)"
    T_min::FT
    "surface temperature (K)"
    T_surface::FT
    "lapse rate (K/m)"
    Γ::FT
end

function (profile::LinearTemperatureProfile)(
    orientation::Orientation,
    aux::Vars,
)
    z = altitude(orientation, aux)
    T = max(profile.T_surface - profile.Γ * z, profile.T_min)

    p = MSLP * (T / profile.T_surface)^(grav / (R_d * profile.Γ))
    if T == profile.T_min
        z_top = (profile.T_surface - profile.T_min) / profile.Γ
        H_min = R_d * profile.T_min / grav
        p *= exp(-(z - z_top) / H_min)
    end
    return (T, p)
end

max_stars_repo_name: trontrytel/CLIMA

max_issues_repo_name: trontrytel/CLIMA

max_forks_repo_name: trontrytel/CLIMA


text:
export depth_wise, lossguide

using ..JLBoostTrees: AbstractJLBoostTree, get_leaf_nodes

# Note the naming conventions here come from xgboost
# see https://xgboost.readthedocs.io/en/latest/parameter.html -- grow_policy

"""
    A function that select leaf-node for further growth in a balanced manner, i.e. left and right
    at the same time

* jlt - A JLBoostTree
"""
function depth_wise(jlt::AbstractJLBoostTree)
    return get_leaf_nodes(jlt)
end

function lossguide(jlt::AbstractJLBoostTree)::Vector{JLBoostTree}
    leaf_nodes = filter(x->!ismissing(x.gain), get_leaf_nodes(jlt))
    leaf_nodes = filter(x->x.gain > 0, leaf_nodes)

    if length(leaf_nodes) == 0
        return JLBoostTree[]
    else
        # the gains are stored in the parents
        _, pos = findmax(map(x->x.gain, leaf_nodes))
        return [leaf_nodes[pos]]
    end
end


text:
"""
    convmixer(planes, depth; inchannels = 3, kernel_size = (9, 9), patch_size::Dims{2} = 7,
              activation = gelu, nclasses = 1000)

Creates a ConvMixer model.
([reference](https://arxiv.org/abs/2201.09792))

# Arguments

  - `planes`: number of planes in the output of each block
  - `depth`: number of layers
  - `inchannels`: number of channels in the input
  - `kernel_size`: kernel size of the convolutional layers
  - `patch_size`: size of the patches
  - `activation`: activation function used after the convolutional layers
  - `nclasses`: number of classes in the output
"""
function convmixer(planes, depth; inchannels = 3, kernel_size = (9, 9),
                   patch_size::Dims{2} = (7, 7), activation = gelu, nclasses = 1000)
    stem = conv_bn(patch_size, inchannels, planes, activation; preact = true,
                   stride = patch_size[1])
    blocks = [Chain(SkipConnection(Chain(conv_bn(kernel_size, planes, planes, activation;
                                                 preact = true, groups = planes,
                                                 pad = SamePad())), +),
                    conv_bn((1, 1), planes, planes, activation; preact = true)...)
              for _ in 1:depth]
    head = Chain(AdaptiveMeanPool((1, 1)), MLUtils.flatten, Dense(planes, nclasses))
    return Chain(Chain(stem..., Chain(blocks)), head)
end

convmixer_config = Dict(:base => Dict(:planes => 1536, :depth => 20, :kernel_size => (9, 9),
                                      :patch_size => (7, 7)),
                        :small => Dict(:planes => 768, :depth => 32, :kernel_size => (7, 7),
                                       :patch_size => (7, 7)),
                        :large => Dict(:planes => 1024, :depth => 20,
                                       :kernel_size => (9, 9),
                                       :patch_size => (7, 7)))

"""
    ConvMixer(mode::Symbol = :base; inchannels = 3, activation = gelu, nclasses = 1000)

Creates a ConvMixer model.
([reference](https://arxiv.org/abs/2201.09792))

# Arguments

  - `mode`: the mode of the model, either `:base`, `:small` or `:large`
  - `inchannels`: number of channels in the input
  - `activation`: activation function used after the convolutional layers
  - `nclasses`: number of classes in the output
"""
struct ConvMixer
    layers::Any
end

function ConvMixer(mode::Symbol = :base; inchannels = 3, activation = gelu, nclasses = 1000)
    planes = convmixer_config[mode][:planes]
    depth = convmixer_config[mode][:depth]
    kernel_size = convmixer_config[mode][:kernel_size]
    patch_size = convmixer_config[mode][:patch_size]
    layers = convmixer(planes, depth; inchannels, kernel_size, patch_size, activation,
                       nclasses)
    return ConvMixer(layers)
end

@functor ConvMixer

(m::ConvMixer)(x) = m.layers(x)

backbone(m::ConvMixer) = m.layers[1]
classifier(m::ConvMixer) = m.layers[2]


text:
packer = GuillotinePacker(1024, 1024)
rects = [Rect(0, 0, rand(10:100), rand(10:100)) for i in 1:300]
push!(packer, rects)
push!(packer, Rect(0, 0, 100, 100))

# using Makie
# linesegments(Rectf(0, 0, 1024, 1024))
# poly!(packer.used_rectangles, color = (:red, 0.1), strokewidth=1, strokecolor=:black)


text:
using Gadfly

set_default_plot_size(6inch, 3inch)

# make sure Stat.ticks work for categorical Geom.rectbin.

J=[-11.0935 -35.9819 12.2814; -9.71891 -31.852 11.2673; -8.51878 -28.1954 10.3279; -7.47033 -24.9582 9.45931; -6.55385 -22.0925 8.65728]
plotlabels=Any["n","vx","ax"]
spy(J, Gadfly.Scale.x_discrete(labels = i->plotlabels[i]))


text:
using Test
using Canopy

anyerrors = false

tests = [
    "test_constants.jl",
    "test_water.jl",
    "test_radtrans.jl",
]

println("Running tests:")

for t in tests
    try
        include(t)
        println("\t\033[1m\033[32mPASSED\033[0m: $(t)")
    catch e
        global anyerrors = true
        println("\t\033[1m\033[31mFAILED\033[0m: $(t)")
        showerror(stdout, e, backtrace())
    end
end

if anyerrors
    error("Tests failed")
end


text:
"
  Name     : c4_21_plot_julia.jl
  Book     : Hands-on Data Science with Anaconda )
  Publisher: Packt Publishing Ltd.
  Author   : Yuxing Yan and James Yan
  Date     : 1/25/2018
  email    : yany@canisius.edu
             paulyxy@hotmail.com
"

using PyPlot
x = linspace(0, 10, 200)
y = sin.(x)
name=L"$y = \sin(x)$"
fig, ax = subplots()
ax[:plot](x, y, "r-", linewidth=2, label=name,alpha=0.6)
ax[:legend](loc="upper center")


text:
function gausslobatto( n )
# Gauss-Legendre-Lobatto Quadrature Nodes and Weights

    if ( n == 1 )
        error("Lobatto undefined for n = 1.")
    elseif ( n == 2 )
        x = ([-1.0,1.0],[1.0,1.0])
    elseif ( n == 3 )
        x = ([-1.0, 0.0, 1.0], [1.0, 4.0, 1.0]/3)
    else
        # Compute via GaussJacobi:
        x = gaussjacobi(n - 2, 1.0, 1.0)
        w = x[2]; x = x[1];
        x = [-1.0, x, 1.0]
        w = [-1.0, w, 1.0]
        w = w./(1-x.^2)
        w[1] = 2/(n*(n - 1))
        w[n] = 2/(n*(n - 1))
        x = (x,w)
    end
    return x
end


text:
@testset "70.climbing-stairs.jl" begin
    @test climbing_stairs(1) == 1
    @test climbing_stairs(2) == 2
    @test climbing_stairs(3) == 3
    @test climbing_stairs(8) == 34
    @test climbing_stairs(45) == 1836311903
end


text:
module OneVision

using Reexport

include("utils.jl")
include("SymbolMaps.jl")
include("interface.jl")
include("simulation.jl")
include("forward_prediction.jl")
include("traj_planning.jl")
include("frameworks/frameworks.jl")
include("examples/Examples.jl")
include("Benchmarks.jl")

# include("ros_integration.jl")

end # OneVision

if isdefined(@__MODULE__, :LanguageServer)  # hack to make vscode linter work properly
    include("../scripts/runner.jl")
    include("../scripts/run_experiments.jl")
    include("../test/runtests.jl")
end


text:
# Julia translation of http://nbviewer.jupyter.org/github/barbagroup/AeroPython/blob/master/lessons/01_Lesson01_sourceSink.ipynb
# Lession 1 Source and sink

using PyPlot
using Distributions

close("all")
meshgrid(x,y) = (repmat(x',length(y),1),repmat(y,1,length(x)))

N = 40                                # number of points in each direction
x_start, x_end = -2.0, 2.0            # boundaries in the x-direction
y_start, y_end = -1.0, 1.0            # boundaries in the y-direction
x = linspace(x_start, x_end, N)    # creates a 1D-array with the x-coordinates
y = linspace(y_start, y_end, N)    # creates a 1D-array with the y-coordinates

# print("x = ", x)
# print("y = ", y)

X,Y=meshgrid(x,y)
# X = repmat(x',N,1)
# Y= repmat(y,1,N)

# plots the grid of points
size = 10
PyPlot.figure(figsize=(size, (y_end-y_start)/(x_end-x_start)*size))
PyPlot.xlabel('x', fontsize=16)
PyPlot.ylabel('y', fontsize=16)
PyPlot.xlim(x_start, x_end)
PyPlot.ylim(y_start, y_end)
PyPlot.scatter(X, Y)

strength_source = 5.0                      # source strength
x_source, y_source = -1.0, 0.0             # location of the source

# computes the velocity field on the mesh grid

u_source = strength_source/(2*pi) .* (X-x_source)./((X-x_source).^2 + (Y-y_source).^2)
v_source = strength_source/(2*pi) .* (Y-y_source)./((X-x_source).^2 + (Y-y_source).^2)

# plotting the streamlines
size = 10
PyPlot.figure(figsize=(size, (y_end-y_start)/(x_end-x_start)*size))
PyPlot.xlabel('x', fontsize=16)
PyPlot.ylabel('y', fontsize=16)
PyPlot.xlim(x_start, x_end)
PyPlot.ylim(y_start, y_end)
PyPlot.streamplot(X, Y, u_source, v_source, density=2, linewidth=1, arrowsize=2, arrowstyle="->")
PyPlot.scatter(x_source, y_source, color="#CD2305", s=80, marker="o", linewidth=0);

strength_sink = -5.0                     # strength of the sink
x_sink, y_sink = 1.0, 0.0                # location of the sink

# computes the velocity on the mesh grid
u_sink = strength_sink/(2*pi) .* (X-x_sink)./((X-x_sink).^2 + (Y-y_sink).^2)
v_sink = strength_sink/(2*pi) .* (Y-y_sink)./((X-x_sink).^2 + (Y-y_sink).^2)

# plots the streamlines
size = 10
PyPlot.figure(figsize=(size, (y_end-y_start)/(x_end-x_start)*size))
PyPlot.xlabel('x', fontsize=16)
PyPlot.ylabel('y', fontsize=16)
PyPlot.xlim(x_start, x_end)
PyPlot.ylim(y_start, y_end)
PyPlot.streamplot(X, Y, u_sink, v_sink, density=2, linewidth=1, arrowsize=2, arrowstyle="->")
PyPlot.scatter(x_sink, y_sink, color="#CD2305", s=80, marker="o", linewidth=0);

# computes the velocity of the pair source/sink by superposition
u_pair = u_source + u_sink
v_pair = v_source + v_sink

# plots the streamlines of the pair source/sink
size = 10
PyPlot.figure(figsize=(size, (y_end-y_start)/(x_end-x_start)*size))
PyPlot.xlabel('x', fontsize=16)
PyPlot.ylabel('y', fontsize=16)
PyPlot.xlim(x_start, x_end)
PyPlot.ylim(y_start, y_end)
PyPlot.streamplot(X, Y, u_pair, v_pair, density=2.0, linewidth=1, arrowsize=2, arrowstyle="->")
PyPlot.scatter([x_source, x_sink], [y_source, y_sink],
             color="#CD2305", s=80, marker="o", linewidth=0);


text:
"""
```julia
arguments(call_expr::Expr)
```
For internal use.

Retrieves the argument expressions from a call expression.
"""
function arguments(call_expr::Expr)
  if call_expr.head != :call
    throw(ErrorException("Malformed function declaration"))
  end
  call_expr = copy(call_expr)
  call_expr.head = :tuple
  shift!(call_expr.args)
  return call_expr
end

"""
```julia
@GtkBuilderAid directives()... begin
  # ... implementation ...
end
```

This macro is meant to make using glade with Julia as easy as working with
Glade in C is. From a staticly compiled language the function names are just
pulled from a compiled file but that option isn't available in Julia, at least
not cleanly.

Type annotations are necessary for this case as the macro needs to compile the
functions to cfunctions with minimal information.
"""
macro GtkBuilderAid(args...)
  if length(args) < 1
    throw(ArgumentError("GtkBuilderAid macro requires at least one argument"))
  end

  user_block = args[end]::Expr
  if user_block.head != :block
    throw(ArgumentError("The last argument to this macro must be a block"))
  end

  directives = Set{Symbol}()

  lastDirective = length(args) - 1
  if length(args) >= 2 && isa(args[end - 1], AbstractString)
    lastDirective -= 1
    # Enables the pre-bound version
    filename = args[end - 1]
    if !isfile(filename)
      throw(ErrorException("Provided UI file, $filename, does not exist"))
    end
    push!(directives, :filename)
  end

  userdata = ()
  generated_function_name = :genned_function
  for directive in args[1:lastDirective]
    # Only support expression-style directives
    if typeof(directive) <: Expr && directive.head == :call
      # A function call style directive
      push!(directives, directive.args[1])
      if directive.args[1] == :function_name
        generated_function_name = directive.args[2]
      end

      if directive.args[1] == :userdata
        userdata = arguments(directive).args[1]
      end

      if directive.args[1] == :userdata_tuple
        # Creates a tuple from the arguments
        # and uses that as the userinfo argument
        push!(directives, :userdata)
        userdata = arguments(directive)
      end

    else
      throw(ErrorException("Directives must be in the format of a function call"))
    end
  end

  # Analogous to function declarations of a C header file
  callbacks = Set{Symbol}();
  # Necessary for pass-through
  passthroughs = Set{Int}()

  line = 0
  for entry in user_block.args

    if isa(entry, Expr)
      if entry.head == :line
        line = entry.args[1]
      end

      if entry.head == :macrocall
        # expand the macro
        expanded = macroexpand(entry)
        if expanded.head == :function
          entry.head = expanded.head
          entry.args = expanded.args
        end
      end
      if entry.head == :function && length(entry.args[1].args) >= 3
        fcall = entry.args[1]
        fname = fcall.args[1]
        push!(callbacks, fname)
        push!(passthroughs, length(fcall.args) - 1)
      end

      if entry.head == :(=)
        left = entry.args[1]
        if isa(left, Expr) && left.head == :call && length(left.args) >= 3
          fname = left.args[1]
          push!(callbacks, fname)
          push!(passthroughs, length(left.args) - 1)
        end
      end
    end
  end

  # Extend the curly to get things by argument type
  base_passthrough_decl = :(passthrough{T, O, P}(object, userdata::PassthroughData{T, O, P}))
  base_passthrough_expr = :(ccall(userdata.func, T, (Ref{O}, Ref{P}), GObject(object), userdata.data))
  passthrough_expr = quote
    passthrough() = nothing
  end
  for passthrough in passthroughs
    new_passthrough_decl = deepcopy(base_passthrough_decl)
    new_passthrough_expr = deepcopy(base_passthrough_expr)

    # passthrough{T, O, P, X1 ... XN}(object, x_1::X1 ... x_n::XN, userdata::PassthroughData{T, O, P}) =
    #   ccall(userdata.func, T, (O, X1 ... XN, P), GObject(object), x_1 ... x_n, GObject(userdata.data))
    # Inserts additional arguments
    for i in 1:passthrough - 2
      var = Symbol("x_", i)
      typ = Symbol("X", i)
      insert!(new_passthrough_decl.args, 3, :($var::$typ))
      insert!(new_passthrough_expr.args, 5, var)
      push!(new_passthrough_decl.args[1].args, typ)
      insert!(new_passthrough_expr.args[3].args, 2, typ)
    end
    # Provides types for the arguments

    append!(passthrough_expr.args, (quote
      $new_passthrough_decl = begin
        $new_passthrough_expr
      end
    end).args)
  end

  funcdata = Expr(:vect)
  for fname in callbacks
    push!(funcdata.args, Expr(:tuple, fname, string(fname)))
  end

  # Escape the modified user block
  block = quote
    $(esc(user_block))
    $passthrough_expr

    handlers = Dict{String, Function}()
    for func in $(esc(funcdata))
      handlers[string(func[2])] = func[1]
    end

    connect_signals(built, handlers, userdata, passthrough; wpipe=wpipe)

    return built
  end

  if :function_name in directives
    final_function_name = esc(generated_function_name)
  else
    final_function_name = generated_function_name
  end

  filename_arg = :(filename::AbstractString)
  userdata_arg = Expr(:kw, :userdata, esc(userdata))

  if :filename in directives
    filename_arg = Expr(:kw, filename_arg, filename)
  end

  funcdef = Expr(:function, :($final_function_name(built::GtkBuilderLeaf, $userdata_arg; wpipe=Base.STDERR)), block)

  quote
    $funcdef
    $final_function_name($filename_arg, $userdata_arg; wpipe=Base.STDERR) =
      $final_function_name(@GtkBuilder(filename=filename), userdata; wpipe=wpipe)
    $final_function_name
  end
end