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

@test integrate((a^2+-1*b^2*x^2)^-1, x) == :(a^-1*b^-1*arctanh(b*x*a^-1))
@test integrate((a^2+b^2*x^2)^-1, x) == :(a^-1*b^-1*arctan(b*x*a^-1))
@test integrate(sec(2*a*x), x) == :((1/2)*a^-1*arctanh(sin(2*a*x)))
@test integrate(1//4*sin(1//3*x)^-1, x) == :(-3//4*arctanh(cos(1//3*x)))
@test integrate(-1*cos(2x+1//4*pi)^-1, x) == :(-1//2*arctanh(sin(2x+1//4*pi)))
@test integrate(sec(x)*tan(x), x) == :(sec(x))
@test integrate(cot(x)*csc(x), x) == :(-1*csc(x))
@test integrate(sin(2x)^-1*tan(x), x) == :((1/2)*tan(x))
@test integrate((1+cos(x))^-1, x) == :((1+cos(x))^-1*sin(x))
@test integrate((1+-1*cos(x))^-1, x) == :(-1*(1+-1*cos(x))^-1*sin(x))
@test integrate((a+-1*b*cos(x))^-1*sin(x), x) == :(b^-1*log(a+-1*b*cos(x)))
@test integrate((a^2+b^2*sin(x)^2)^-1*cos(x), x) == :(a^-1*b^-1*arctan(b*a^-1*sin(x)))
@test integrate((a^2+-1*b^2*sin(x)^2)^-1*cos(x), x) == :(a^-1*b^-1*arctanh(b*a^-1*sin(x)))
@test integrate((a^2+b^2*sin(x)^2)^-1*sin(2x), x) == :(b^-2*log(a^2+b^2*sin(x)^2))
@test integrate((a^2+-1*b^2*sin(x)^2)^-1*sin(2x), x) == :(-1*b^-2*log(a^2+-1*b^2*sin(x)^2))
@test integrate((4+-1*cos(x)^2)^-1, x) == :(1//6*x*3^(1/2)+1//6*3^(1/2)*arctan((3+sin(x)^2+2*3^(1/2))^-1*cos(x)*sin(x)))
@test integrate((-1+exp(2x))^-1*exp(x), x) == :(-1*arctanh(exp(x)))
@test integrate(x^-1*log(x)^-1, x) == :(log(log(x)))
@test integrate(x^-1*(1+log(x)^2)^-1, x) == :(arctan(log(x)))
@test integrate(x^-1*(1+-1*log(x))^-1, x) == :(-1*log(1+-1*log(x)))
@test integrate(x^-1*(1+log(x*a^-1))^-1, x) == :(log(1+log(x*a^-1)))
@test integrate(x^-2*(1+x+-1*x^(1/2))^2, x) == :(x+-1*x^-1+-4*x^(1/2)+3*log(x)+4*x^-1//2)
@test integrate(x^-3//2*(2+-1*x^2//3)*(x+x^(1/2)), x) == :(2*log(x)+4*x^(1/2)+-6//7*x^7//6+-3//2*x^2//3)
@test integrate((3+2x)^-1*(-1+2x), x) == :(x+-2*log(3+2x))
@test integrate((-2+3*x^2)^-1*(-5+2x), x) == :((1//3+-5//12*6^(1/2))*log(6^(1/2)+-3x)+(1//3+5//12*6^(1/2))*log(6^(1/2)+3x))
@test integrate((2+3*x^2)^-1*(-5+2x), x) == :(1//3*log(2+3*x^2)+-5//6*6^(1/2)*arctan((1/2)*x*6^(1/2)))
@test integrate(sin(x)*sin(1//4*x), x) == :(-2//5*sin(5//4*x)+2//3*sin(3//4*x))
@test integrate(cos(3x)*cos(4x), x) == :((1/2)*sin(x)+1//14*sin(7x))
@test integrate(-1*tan(x)*tan(a+-1x), x) == :(-1x+cot(a)*log(cos(a+-1x))+-1*cot(a)*log(cos(x)))
@test integrate(sin(x)^2, x) == :((1/2)*x+-1//2*cos(x)*sin(x))
@test integrate(cos(x)^2, x) == :((1/2)*x+(1/2)*cos(x)*sin(x))
@test integrate(cos(x)^3*sin(x), x) == :(-1//4*cos(x)^4)
@test integrate(cos(x)^3*sin(x)^-4, x) == :(sin(x)^-1+-1//3*sin(x)^-3)
@test integrate(cos(x)^-2*sin(x)^-2, x) == :(-1*cot(x)+tan(x))
@test integrate(cot(3//4*x)^2, x) == :(-1x+-4//3*cot(3//4*x))
@test integrate((1+tan(2x))^2, x) == :((1/2)*tan(2x)+-1*log(cos(2x)))
@test integrate((-1*cot(x)+tan(x))^2, x) == :(-1*cot(x)+-4x+tan(x))
@test integrate((-1*sec(x)+tan(x))^2, x) == :(-1x+-2*(1+sin(x))^-1*cos(x))
@test integrate((1+sin(x))^-1*sin(x), x) == :(x+(1+sin(x))^-1*cos(x))
@test integrate((1+-1*cos(x))^-1*cos(x), x) == :(-1x+-1*(1+-1*cos(x))^-1*sin(x))
@test integrate((-1+exp((1/2)*x))^3*exp(-1//2*x), x) == :(-6*exp((1/2)*x)+2*exp(-1//2*x)+3x+exp(x))
@test integrate((5+x^2+-6x)^-1, x) == :(-1//4*log(1+-1x)+1//4*log(5+-1x))
@test integrate(x^2*(13+x^6+-6*x^3)^-1, x) == :(1//6*arctan(-3//2+(1/2)*x^3))
@test integrate((-1+x^2+-4x)^-1*(2+x), x) == :(1//10*(5+-4*5^(1/2))*log(2+-1x+-1*5^(1/2))+1//10*(5+4*5^(1/2))*log(2+5^(1/2)+-1x))
@test integrate((1+(1+x)^1//3)^-1, x) == :(-3*(1+x)^1//3+3*log(1+(1+x)^1//3)+3//2*(1+x)^2//3)
@test integrate(x^-1//2*(b+a*x)^-1, x) == :(2*a^-1//2*b^-1//2*arctan(a^(1/2)*b^-1//2*x^(1/2)))
@test integrate(x^3*(1+x^2)^(1/2), x) == :(-1//3*(1+x^2)^3//2+1//5*(1+x^2)^5//2)
@test integrate(x*(a^4+-1*x^4)^-1//2, x) == :((1/2)*arctan(x^2*(a^4+-1*x^4)^-1//2))
@test integrate(x^-1*(x^2+-1*a^2)^-1//2, x) == :(a^-1*arctan(a^-1*(x^2+-1*a^2)^(1/2)))
@test integrate(x^-1*(a^2+-1*x^2)^-1//2, x) == :(-1*a^-1*arctanh(a^-1*(a^2+-1*x^2)^(1/2)))
@test integrate(x^-1*(a^2+x^2)^-1//2, x) == :(-1*a^-1*arctanh(a^-1*(a^2+x^2)^(1/2)))
@test integrate((2+x+-1*x^2)^-1//2, x) == :(-1*arcsin(1//3+-2//3*x))
@test integrate((5+-4x+3*x^2)^-1//2, x) == :(-1//3*3^(1/2)*arcsinh(1//11*11^(1/2)*(2+-3x)))
@test integrate((x+-1*x^2)^-1//2, x) == :(-1*arcsin(1+-2x))
@test integrate((2+x+-1*x^2)^-1//2*(1+2x), x) == :(-2*(2+x+-1*x^2)^(1/2)+-2*arcsin(1//3+-2//3*x))
@test integrate(x^-1*(2+x+-1*x^2)^-1//2, x) == :(-1//2*2^(1/2)*arctanh(1//4*2^(1/2)*(2+x+-1*x^2)^-1//2*(4+x)))
@test integrate((1+-1*cos(x))^-1*sin(x)^-1*(2+3*sin(x)), x) == :(-1*(1+-1*cos(x))^-1+-1*arctanh(cos(x))+-3*(1+-1*cos(x))^-1*sin(x))
@test integrate(sin(2x)^-1*(1+-1*tan(x)), x) == :((1/2)*log(tan(x))+-1//2*tan(x))
@test integrate((1+-1*tan(x)^2)^-1*(1+tan(x)^2), x) == :((1/2)*arctanh(2*cos(x)*sin(x)))
@test integrate((a^2+-4*sin(x)^2)^-1//3*sin(2x), x) == :(-3//8*(a^2+-4*sin(x)^2)^2//3)
@test integrate((-1+a^(2x))^-1//2, x) == :(log(a)^-1*arctan((-1+a^(2x))^(1/2)))
@test integrate((-1+exp(x))^-1//2*exp((1/2)*x), x) == :(2*arctanh((-1+exp(x))^-1//2*exp((1/2)*x)))
@test integrate((1+x^2)^-1*arctan(x)^n, x) == :((1+n)^-1*arctan(x)^(1+n))
@test integrate((a^2+-1*x^2)^-1//2*arcsin(x*a^-1)^3//2, x) == :(2//5*a*(1+-1*a^-2*x^2)^(1/2)*(a^2+-1*x^2)^-1//2*arcsin(x*a^-1)^5//2)
@test integrate((1+-1*x^2)^-1//2*arccos(x)^-3, x) == :((1/2)*arccos(x)^-2)
@test integrate(x*log(x)^2, x) == :(1//4*x^2+(1/2)*x^2*log(x)^2+-1//2*x^2*log(x))
@test integrate(x^-5*log(x), x) == :(-1//16*x^-4+-1//4*x^-4*log(x))
@test integrate(cos(x)^5, x) == :(-2//3*sin(x)^3+1//5*sin(x)^5+sin(x))
@test integrate(cos(x)^4*sin(x)^2, x) == :(1//16*x+-1//6*cos(x)^5*sin(x)+1//16*cos(x)*sin(x)+1//24*cos(x)^3*sin(x))
@test integrate(sin(x)^-5, x) == :(-3//8*arctanh(cos(x))+-3//8*cot(x)*csc(x)+-1//4*csc(x)^3*cot(x))
@test integrate(exp(-1x)*sin(x), x) == :(-1//2*cos(x)*exp(-1x)+-1//2*exp(-1x)*sin(x))
@test integrate(exp(2x)*sin(3x), x) == :(-3//13*cos(3x)*exp(2x)+2//13*exp(2x)*sin(3x))
@test integrate(a^x*cos(x), x) == :(a^x*(1+log(a)^2)^-1*sin(x)+a^x*(1+log(a)^2)^-1*cos(x)*log(a))
@test integrate(cos(log(x)), x) == :((1/2)*x*cos(log(x))+(1/2)*x*sin(log(x)))
@test integrate(sec(x)^2*log(cos(x)), x) == :(-1x+log(cos(x))*tan(x)+tan(x))
@test integrate(x*tan(x)^2, x) == :(-1//2*x^2+x*tan(x)+log(cos(x)))
@test integrate(x^-2*arcsin(x), x) == :(-1*arctanh((1+-1*x^2)^(1/2))+-1*x^-1*arcsin(x))
@test integrate(arcsin(x)^2, x) == :(-2x+x*arcsin(x)^2+2*(1+-1*x^2)^(1/2)*arcsin(x))
@test integrate(x^2*(1+x^2)^-1*arctan(x), x) == :(-1//2*arctan(x)^2+-1//2*log(1+x^2)+x*arctan(x))
@test integrate((2x+3*x^2)^3, x) == :(2*x^4+9*x^6+27//7*x^7+36//5*x^5)
@test integrate((-1+2x+3*x^2)^2*(-1+x), x) == :(-1x+-7//2*x^4+-2//3*x^3+3//2*x^6+3//5*x^5+5//2*x^2)
@test integrate(x^(-1+k)*(a+b*x^k)^n, x) == :(b^-1*k^-1*(1+n)^-1*(a+b*x^k)^(1+n))
@test integrate(x^3*(1+2x)^-1, x) == :(-1//8*x^2+-1//16*log(1+2x)+1//6*x^3+1//8*x)
@test integrate(x^6*(2+3*x^2)^-1, x) == :(-2//27*x^3+1//15*x^5+4//27*x+-4//81*6^(1/2)*arctan((1/2)*x*6^(1/2)))
@test integrate((2+-7x+3*x^2)^-1, x) == :(-1//5*log(1+-3x)+1//5*log(2+-1x))
@test integrate((1+x^2+-1x)^-1*(-1+3x), x) == :(3//2*log(1+x^2+-1x)+-1//3*3^(1/2)*arctan(1//3*3^(1/2)*(1+-2x)))
@test integrate(x^2*(5+x^2+2x)^-1, x) == :(x+-1*log(5+x^2+2x)+-3//2*arctan(1/2+(1/2)*x))
@test integrate((1+-1x+2*x^2)^-1*(-5*x^3+4*x^2+6*x^4), x) == :(x^3+-1//2*x^2+1//4*log(1+-1x+2*x^2)+-1//14*7^(1/2)*arctan(1//7*7^(1/2)*(1+-4x)))
@test integrate((x^2+x^3+-6x)^-1*(-1+x+x^2), x) == :((1/2)*log(2+-1x)+1//3*log(3+x)+1//6*log(x))
@test integrate((x^3+-6*a^3+-6*a*x^2+11*x*a^2)^-1*(5*x^2+11*a^2+-7*a*x), x) == :(-17*log(-1x+2a)+9//2*log(a+-1x)+35//2*log(-1x+3a))
@test integrate((6+x^4+-5*x^2)^-1*(-5+2*x^2), x) == :(-1//2*2^(1/2)*arctanh((1/2)*x*2^(1/2))+-1//3*3^(1/2)*arctanh(1//3*x*3^(1/2)))
@test integrate((-1+x)^-1*(-4+x)^-1*(-3+x)^-1*(-2+x)^-1, x) == :((1/2)*log(2+-1x)+-1//2*log(3+-1x)+-1//6*log(1+-1x)+1//6*log(4+-1x))
@test integrate((-1+x)^-3*(1+x^2), x) == :(-1*(1+-1x)^-2+2*(1+-1x)^-1+log(1+-1x))
@test integrate(x^5*(3+x)^-2, x) == :(-108x+-2*x^3+243*(3+x)^-1+405*log(3+x)+1//4*x^4+27//2*x^2)
@test integrate((-27+x^4+-8*x^3+18*x^2)^-1*(-2+5*x^3), x) == :(407*(48+-16x)^-1+-133//8*(3+-1x)^-2+7//64*log(1+x)+313//64*log(3+-1x))
@test integrate((3+x)^-2*(4+x)^-2*(-9+x^3+-6*x^2+3x), x) == :(-263*log(4+x)+99*(3+x)^-1+181*(4+x)^-1+264*log(3+x))
@test integrate(x^-1*(-1+x^2)^-2*(2+x^2+x^3), x) == :(2*log(x)+-5//4*log(1+x)+-3//4*log(1+-1x)+(2+-2*x^2)^-1*(3+x))
@test integrate((x^3+x^6+-1*x^4+-1*x^5)^-1, x) == :((2+-2x)^-1+-1*x^-1+2*log(x)+-7//4*log(1+-1x)+-1//2*x^-2+-1//4*log(1+x))
@test integrate((-1+x+x^3+-1*x^2)^-1*(1+x^4), x) == :(x+(1/2)*x^2+-1*arctan(x)+-1//2*log(1+x^2)+log(1+-1x))
@test integrate(x^-1*(1+x)^-1*(1+x^2)^-1, x) == :(-1//2*arctan(x)+-1//2*log(1+x)+-1//4*log(1+x^2)+log(x))
@test integrate(x^2*(-2+x^2+x^4)^-1, x) == :(-1//3*arctanh(x)+1//3*2^(1/2)*arctan((1/2)*x*2^(1/2)))
@test integrate((2+x^4+2*x^3+3*x^2+4x)^-1*(x^3+4*x^2+6x), x) == :((1+x)^-1+-1//3*log(1+x)+2//3*log(2+x^2)+4//3*2^(1/2)*arctan((1/2)*x*2^(1/2)))
@test integrate(x*(1+x)^-1*(1+x^2)^-1*(1+2x)^-2, x) == :(2*(5+10x)^-1+-7//100*log(1+x^2)+-1//2*log(1+x)+1//50*arctan(x)+16//25*log(1+2x))
@test integrate((1+x^2)^-1*(-1+x)^-3*(-2+x+3*x^2), x) == :(-1*arctan(x)+5*(2+-2x)^-1+-3//2*log(1+-1x)+-1//2*(1+-1x)^-2+3//4*log(1+x^2))
@test integrate((1+x^2+x^4)^-1, x) == :(-1//4*log(1+x^2+-1x)+1//4*log(1+x+x^2)+-1//6*3^(1/2)*arctan(1//3*3^(1/2)*(1+-2x))+1//6*3^(1/2)*arctan(1//3*3^(1/2)*(1+2x)))
@test integrate((x^5+-9x)^-1*(3+2*x^3), x) == :(-1//3*log(x)+1//12*log(9+-1*x^4)+-1//3*3^(1/2)*arctanh(1//3*x*3^(1/2))+1//3*3^(1/2)*arctan(1//3*x*3^(1/2)))
@test integrate((-4+x)^-3*(8+x^2+-4x)^-1*(-20+5*x^3+8x), x) == :(41*(16+-4x)^-1+-83//4*(4+-1x)^-2+-45//16*log(4+-1x)+-3//16*arctan(1+-1//2*x)+45//32*log(8+x^2+-4x))
@test integrate((1+x^2)^-1*(2+x^2)^-1*(3+x^2)^-1*(4+x^2)^-1, x) == :(-1//12*arctan((1/2)*x)+1//6*arctan(x)+-1//4*2^(1/2)*arctan((1/2)*x*2^(1/2))+1//6*3^(1/2)*arctan(1//3*x*3^(1/2)))
@test integrate(x*(1+x^2)^-1*(2+x^2)^-1*(3+x^2)^-1*(4+x^2)^-1, x) == :(-1//4*log(2+x^2)+-1//12*log(4+x^2)+1//4*log(3+x^2)+1//12*log(1+x^2))
@test integrate((a^3+x^3)^-1, x) == :(-1//6*a^-2*log(a^2+x^2+-1*a*x)+1//3*a^-2*log(a+x)+-1//3*3^(1/2)*a^-2*arctan(1//3*3^(1/2)*a^-1*(a+-2x)))
@test integrate(x*(a^3+x^3)^-1, x) == :(-1//3*a^-1*log(a+x)+1//6*a^-1*log(a^2+x^2+-1*a*x)+-1//3*3^(1/2)*a^-1*arctan(1//3*3^(1/2)*a^-1*(a+-2x)))
@test integrate(x^2*(a^3+x^3)^-1, x) == :(1//3*log(a^3+x^3))
@test integrate(x^-1*(a^3+x^3)^-1, x) == :(a^-3*log(x)+-1//3*a^-3*log(a^3+x^3))
@test integrate(x^-2*(a^3+x^3)^-1, x) == :(-1*a^-3*x^-1+-1//6*a^-4*log(a^2+x^2+-1*a*x)+1//3*a^-4*log(a+x)+1//3*3^(1/2)*a^-4*arctan(1//3*3^(1/2)*a^-1*(a+-2x)))
@test integrate(x^-3*(a^3+x^3)^-1, x) == :(-1//2*a^-3*x^-2+-1//3*a^-5*log(a+x)+1//6*a^-5*log(a^2+x^2+-1*a*x)+1//3*3^(1/2)*a^-5*arctan(1//3*3^(1/2)*a^-1*(a+-2x)))
@test integrate(x^-4*(a^3+x^3)^-1, x) == :(-1*a^-6*log(x)+-1//3*a^-3*x^-3+1//3*a^-6*log(a^3+x^3))
@test integrate(x^-5*(a^3+x^3)^-1, x) == :(a^-6*x^-1+-1//3*a^-7*log(a+x)+-1//4*a^-3*x^-4+1//6*a^-7*log(a^2+x^2+-1*a*x)+-1//3*3^(1/2)*a^-7*arctan(1//3*3^(1/2)*a^-1*(a+-2x)))
@test integrate((a^4+-1*x^4)^-1, x) == :((1/2)*a^-3*arctan(x*a^-1)+(1/2)*a^-3*arctanh(x*a^-1))
@test integrate(x*(a^4+-1*x^4)^-1, x) == :((1/2)*a^-2*arctanh(a^-2*x^2))
@test integrate(x^-1*(a^4+-1*x^4)^-1, x) == :(a^-4*log(x)+-1//4*a^-4*log(a^4+-1*x^4))
@test integrate(x^-2*(a^4+-1*x^4)^-1, x) == :((1/2)*a^-5*arctanh(x*a^-1)+-1*a^-4*x^-1+-1//2*a^-5*arctan(x*a^-1))
@test integrate(x^-3*(a^4+-1*x^4)^-1, x) == :((1/2)*a^-6*arctanh(a^-2*x^2)+-1//2*a^-4*x^-2)
@test integrate(x^-4*(a^4+-1*x^4)^-1, x) == :((1/2)*a^-7*arctan(x*a^-1)+(1/2)*a^-7*arctanh(x*a^-1)+-1//3*a^-4*x^-3)
@test integrate(x*(a^4+x^4)^-1, x) == :((1/2)*a^-2*arctan(a^-2*x^2))
@test integrate(x^2*(a^4+x^4)^-1, x) == :(-1//4*2^(1/2)*a^-1*arctan(1+-1*x*2^(1/2)*a^-1)+-1//8*2^(1/2)*a^-1*log(a^2+x^2+a*x*2^(1/2))+1//4*2^(1/2)*a^-1*arctan(1+x*2^(1/2)*a^-1)+1//8*2^(1/2)*a^-1*log(a^2+x^2+-1*a*x*2^(1/2)))
@test integrate((a^5+x^5)^-1, x) == :(1//5*a^-4*log(a+x)+-1//5*a^-4*(5//2+(1/2)*5^(1/2))^(1/2)*arctan(a^-1*(10+2*5^(1/2))^-1//2*(-4x+a*(1+-1*5^(1/2))))+-1//5*a^-4*(5//2+-1//2*5^(1/2))^(1/2)*arctan((1/2)*a^-1*(1/2+1//10*5^(1/2))^(1/2)*(-4x+a*(1+5^(1/2))))+-1//20*a^-4*(1+5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+(1/2)*5^(1/2)))+-1//20*a^-4*(1+-1*5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+-1//2*5^(1/2))))
@test integrate(x*(a^5+x^5)^-1, x) == :(-1//5*a^-3*log(a+x)+-1//5*a^-3*(5//2+(1/2)*5^(1/2))^(1/2)*arctan((1/2)*a^-1*(1/2+1//10*5^(1/2))^(1/2)*(-4x+a*(1+5^(1/2))))+1//5*a^-3*(5//2+-1//2*5^(1/2))^(1/2)*arctan(a^-1*(10+2*5^(1/2))^-1//2*(-4x+a*(1+-1*5^(1/2))))+1//20*a^-3*(1+5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+-1//2*5^(1/2)))+1//20*a^-3*(1+-1*5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+(1/2)*5^(1/2))))
@test integrate(x^2*(a^5+x^5)^-1, x) == :(1//5*a^-2*log(a+x)+-1//5*a^-2*(5//2+(1/2)*5^(1/2))^(1/2)*arctan((1/2)*a^-1*(1/2+1//10*5^(1/2))^(1/2)*(-4x+a*(1+5^(1/2))))+-1//20*a^-2*(1+5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+-1//2*5^(1/2)))+-1//20*a^-2*(1+-1*5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+(1/2)*5^(1/2)))+1//5*a^-2*(5//2+-1//2*5^(1/2))^(1/2)*arctan(a^-1*(10+2*5^(1/2))^-1//2*(-4x+a*(1+-1*5^(1/2)))))
@test integrate(x^3*(a^5+x^5)^-1, x) == :(-1//5*a^-1*log(a+x)+-1//5*a^-1*(5//2+(1/2)*5^(1/2))^(1/2)*arctan(a^-1*(10+2*5^(1/2))^-1//2*(-4x+a*(1+-1*5^(1/2))))+-1//5*a^-1*(5//2+-1//2*5^(1/2))^(1/2)*arctan((1/2)*a^-1*(1/2+1//10*5^(1/2))^(1/2)*(-4x+a*(1+5^(1/2))))+1//20*a^-1*(1+5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+(1/2)*5^(1/2)))+1//20*a^-1*(1+-1*5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+-1//2*5^(1/2))))
@test integrate(x^4*(a^5+x^5)^-1, x) == :(1//5*log(a^5+x^5))
@test integrate(x^-1*(a^5+x^5)^-1, x) == :(a^-5*log(x)+-1//5*a^-5*log(a^5+x^5))
@test integrate(x^-2*(a^5+x^5)^-1, x) == :(-1*a^-5*x^-1+1//5*a^-6*log(a+x)+-1//20*a^-6*(1+5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+(1/2)*5^(1/2)))+-1//20*a^-6*(1+-1*5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+-1//2*5^(1/2)))+1//5*a^-6*(5//2+(1/2)*5^(1/2))^(1/2)*arctan(a^-1*(10+2*5^(1/2))^-1//2*(-4x+a*(1+-1*5^(1/2))))+1//5*a^-6*(5//2+-1//2*5^(1/2))^(1/2)*arctan((1/2)*a^-1*(1/2+1//10*5^(1/2))^(1/2)*(-4x+a*(1+5^(1/2)))))
@test integrate(x^-3*(a^5+x^5)^-1, x) == :(-1//2*a^-5*x^-2+-1//5*a^-7*log(a+x)+-1//5*a^-7*(5//2+-1//2*5^(1/2))^(1/2)*arctan(a^-1*(10+2*5^(1/2))^-1//2*(-4x+a*(1+-1*5^(1/2))))+1//5*a^-7*(5//2+(1/2)*5^(1/2))^(1/2)*arctan((1/2)*a^-1*(1/2+1//10*5^(1/2))^(1/2)*(-4x+a*(1+5^(1/2))))+1//20*a^-7*(1+5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+-1//2*5^(1/2)))+1//20*a^-7*(1+-1*5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+(1/2)*5^(1/2))))
@test integrate(x^-4*(a^5+x^5)^-1, x) == :(-1//3*a^-5*x^-3+1//5*a^-8*log(a+x)+-1//5*a^-8*(5//2+-1//2*5^(1/2))^(1/2)*arctan(a^-1*(10+2*5^(1/2))^-1//2*(-4x+a*(1+-1*5^(1/2))))+-1//20*a^-8*(1+5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+-1//2*5^(1/2)))+-1//20*a^-8*(1+-1*5^(1/2))*log(a^2+x^2+-1*a*x*(1/2+(1/2)*5^(1/2)))+1//5*a^-8*(5//2+(1/2)*5^(1/2))^(1/2)*arctan((1/2)*a^-1*(1/2+1//10*5^(1/2))^(1/2)*(-4x+a*(1+5^(1/2)))))
@test integrate((1+x^6)^-1*(1+x^4), x) == :(-1//3*arctan(3^(1/2)+-2x)+1//3*arctan(3^(1/2)+2x)+2//3*arctan(x))
@test integrate((5+x^2+3x)^-3, x) == :((605+121*x^2+363x)^-1*(9+6x)+1//22*(5+x^2+3x)^-2*(3+2x)+12//1331*11^(1/2)*arctan(1//11*11^(1/2)*(3+2x)))
@test integrate((1+x^2)^-4*(1+x^2+x^4), x) == :(7//16*arctan(x)+7*x*(16+16*x^2)^-1+-1//24*x*(1+x^2)^-2+1//6*x*(1+x^2)^-3)
@test integrate((c+a*x^2+2*b*x)^-2*(B+A*x), x) == :(-1*(2*b^2+-2*a*c)^-1*(c+a*x^2+2*b*x)^-1*(B*b+-1*A*c+-1*x*(A*b+-1*B*a))+-1//2*(b^2+-1*a*c)^-3//2*(A*b+-1*B*a)*arctanh((b^2+-1*a*c)^-1//2*(b+a*x)))
@test integrate((5+x^2+-4x)^-2*(-41+-27*x^2+5*x^3+55x), x) == :(-2*arctan(2+-1x)+5//2*log(5+x^2+-4x)+(5+x^2+-4x)^-1*(1+-1x))
@test integrate((-1+x^3)^-2, x) == :(-2//9*log(1+-1x)+1//9*log(1+x+x^2)+x*(3+-3*x^3)^-1+2//9*3^(1/2)*arctan(1//3*3^(1/2)*(1+2x)))
@test integrate(x^-2*(1+x^2)^-3*(4+3*x^4), x) == :(-4*x^-1+-57//8*arctan(x)+-25*x*(8+8*x^2)^-1+-7//4*x*(1+x^2)^-2)
@test integrate(x*(1+x^6)^-1, x) == :(-1//12*log(1+x^4+-1*x^2)+1//6*log(1+x^2)+-1//6*3^(1/2)*arctan(1//3*3^(1/2)*(1+-2*x^2)))
@test integrate(x^3*(1+-2*x^2+3*x^4)^-1, x) == :(1//12*log(1+-2*x^2+3*x^4)+-1//12*2^(1/2)*arctan((1/2)*2^(1/2)*(1+-3*x^2)))
@test integrate(x^5*(-4+x^2+3*x^4)^-1, x) == :(-8//63*log(4+3*x^2)+1//6*x^2+1//14*log(1+-1*x^2))
@test integrate(x^2*(9+x^6+-10*x^3)^-1, x) == :(-1//24*log(1+-1*x^3)+1//24*log(9+-1*x^3))
@test integrate((-2+x)^-4*(1+x^3+-4*x^2), x) == :(2*(2+-1x)^-1+2*(2+-1x)^-2+-7//3*(2+-1x)^-3+log(2+-1x))
@test integrate(x^3*(-1+x)^-12, x) == :(-3//10*(1+-1x)^-10+-1//8*(1+-1x)^-8+1//3*(1+-1x)^-9+1//11*(1+-1x)^-11)
@test integrate((1+2x)^-5*(x^4+-3x), x) == :((8+16x)^-1+-25//128*(1+2x)^-4+-3//32*(1+2x)^-2+1//32*log(1+2x)+7//24*(1+2x)^-3)
@test integrate((1+x)^-3*(-1+x)^-2, x) == :((8+-8x)^-1+-1*(4+4x)^-1+-1//8*(1+x)^-2+3//8*arctanh(x))
@test integrate(x^-2*(5+-6x)^-2, x) == :(6*(125+-150x)^-1+-12//125*log(5+-6x)+-1//25*x^-1+12//125*log(x))
@test integrate((-3+x^2+-2x)^-3, x) == :(-3//512*log(1+x)+3//512*log(3+-1x)+(384+-128*x^2+256x)^-1*(3+-3x)+1//16*(3+-1*x^2+2x)^-2*(1+-1x))
@test integrate((13+x^2+-4x)^-3, x) == :(1//648*arctan(-2//3+1//3*x)+-1*(2808+-864x+216*x^2)^-1*(2+-1x)+-1//36*(13+x^2+-4x)^-2*(2+-1x))
@test integrate((2+x)^-3*(3+x)^-4, x) == :(-10*log(3+x)+4*(2+x)^-1+6*(3+x)^-1+10*log(2+x)+-1//2*(2+x)^-2+1//3*(3+x)^-3+3//2*(3+x)^-2)
@test integrate(x^8*(4+x^2)^-4, x) == :(-35//8*arctan((1/2)*x)+35//16*x+-35*x^3*(192+48*x^2)^-1+-7//24*x^5*(4+x^2)^-2+-1//6*x^7*(4+x^2)^-3)
@test integrate((5+2x+3*x^2)^-2*(-4+7x), x) == :(-1*(140+56x+84*x^2)^-1*(39+19x)+-19//392*14^(1/2)*arctan(1//14*14^(1/2)*(1+3x)))
@test integrate((-2+-4x+3*x^2)^-2*(5+-4x), x) == :(-1*(40+-60*x^2+80x)^-1*(18+-7x)+-7//200*10^(1/2)*arctanh(1//10*10^(1/2)*(2+-3x)))
@test integrate(x^5*(1+x^4)^-3, x) == :(1//16*arctan(x^2)+x^2*(16+16*x^4)^-1+-1//8*x^2*(1+x^4)^-2)
@test integrate(x^3*(a^4+x^4)^-3, x) == :(-1//8*(a^4+x^4)^-2)
@test integrate(x^-1*(a^4+x^4)^-3, x) == :(a^-12*log(x)+-1//4*a^-12*log(a^4+x^4)+1//4*a^-8*(a^4+x^4)^-1+1//8*a^-4*(a^4+x^4)^-2)
@test integrate(x^-2*(a^4+x^4)^-3, x) == :(-45//32*a^-12*x^-1+-45//128*2^(1/2)*a^-13*arctan(1+x*2^(1/2)*a^-1)+-45//256*2^(1/2)*a^-13*log(a^2+x^2+-1*a*x*2^(1/2))+1//8*a^-4*x^-1*(a^4+x^4)^-2+9//32*a^-8*x^-1*(a^4+x^4)^-1+45//128*2^(1/2)*a^-13*arctan(1+-1*x*2^(1/2)*a^-1)+45//256*2^(1/2)*a^-13*log(a^2+x^2+a*x*2^(1/2)))
@test integrate(x^-3*(a^4+x^4)^-3, x) == :(-15//16*a^-14*arctan(a^-2*x^2)+-15//16*a^-12*x^-2+1//8*a^-4*x^-2*(a^4+x^4)^-2+5//16*a^-8*x^-2*(a^4+x^4)^-1)
@test integrate(x^14*(3+2*x^5)^-3, x) == :(3*(60+40*x^5)^-1+-9//80*(3+2*x^5)^-2+1//40*log(3+2*x^5))
@test integrate(9//5*x^-2*(3+-2*x^2)^-3, x) == :(-1//8*x^-1+1//8*x^-1*(3+-2*x^2)^-1+1//24*6^(1/2)*arctanh(1//3*x*6^(1/2))+3//20*x^-1*(3+-2*x^2)^-2)
@test integrate(x^-2*(1+x^2)^-3*(4+3*x^4), x) == :(-4*x^-1+-57//8*arctan(x)+-25*x*(8+8*x^2)^-1+-7//4*x*(1+x^2)^-2)
@test integrate((-1+x+x^5+-1*x^4+-2*x^3+2*x^2)^-1*(5+-1*x^4+-3x+5*x^3+6*x^2), x) == :((1+x)^-1+-2*log(1+x)+2*(1+-1x)^-1+-3//2*(1+-1x)^-2+log(1+-1x))
@test integrate(x^-1*(1+x^3)^-2*(1+x^2), x) == :(-5//18*log(1+x^2+-1x)+-4//9*log(1+x)+-1//9*3^(1/2)*arctan(1//3*3^(1/2)*(1+-2x))+x*(3+3*x^3)^-1*(x+-1*x^2)+log(x))
@test integrate((1+x)^-2*(1+x+x^2)^-2*(-2+x^2+-3x), x) == :((1/2)*log(1+x+x^2)+-1*log(1+x)+-2*(1+x)^-1+-1*(3+3x+3*x^2)^-1*(7+5x)+-25//9*3^(1/2)*arctan(1//3*3^(1/2)*(1+2x)))
@test integrate((1+-4x)^-3*(2+-3x)^-1, x) == :(-3*(25+-100x)^-1+-9//125*log(1+-4x)+1//10*(1+-4x)^-2+9//125*log(2+-3x))
@test integrate(x^3*(2+-5*x^2)^-7, x) == :(-1//250*(2+-5*x^2)^-5+1//150*(2+-5*x^2)^-6)
@test integrate(x^7*(2+-5*x^2)^-3, x) == :(-6*(1250+-3125*x^2)^-1+-3//625*log(2+-5*x^2)+-1//250*x^2+2//625*(2+-5*x^2)^-2)
@test integrate((2+x)^-3*(3+x)^-4, x) == :(-10*log(3+x)+4*(2+x)^-1+6*(3+x)^-1+10*log(2+x)+-1//2*(2+x)^-2+1//3*(3+x)^-3+3//2*(3+x)^-2)
@test integrate(x^5*(3+x)^-2, x) == :(-108x+-2*x^3+243*(3+x)^-1+405*log(3+x)+1//4*x^4+27//2*x^2)
@test integrate((b1+c1*x)*(a+c*x^2+2*b*x), x) == :(x^2*(b*b1+(1/2)*a*c1)+x^3*(1//3*b1*c+2//3*b*c1)+a*b1*x+1//4*c*c1*x^4)
@test integrate((a+c*x^2+2*b*x)^2*(b1+c1*x), x) == :(x^3*(4//3*b1*b^2+2//3*a*b1*c+4//3*a*b*c1)+x^4*(c1*b^2+b*b1*c+(1/2)*a*c*c1)+b1*x*a^2+(1/2)*a*x^2*(a*c1+4*b*b1)+1//5*c*x^5*(b1*c+4*b*c1)+1//6*c1*c^2*x^6)
@test integrate((a+c*x^2+2*b*x)^3*(b1+c1*x), x) == :(x^4*(2*b1*b^3+3*a*c1*b^2+3//4*c*c1*a^2+3*a*b*b1*c)+x^5*(8//5*c1*b^3+3//5*a*b1*c^2+12//5*b1*c*b^2+12//5*a*b*c*c1)+a*x^3*(4*b1*b^2+a*b1*c+2*a*b*c1)+b1*x*a^3+(1/2)*c*x^6*(4*c1*b^2+a*c*c1+2*b*b1*c)+(1/2)*a^2*x^2*(a*c1+6*b*b1)+1//7*c^2*x^7*(b1*c+6*b*c1)+1//8*c1*c^3*x^8)
@test integrate((a+c*x^2+2*b*x)^4*(b1+c1*x), x) == :(x^5*(16//5*b1*b^4+6//5*b1*a^2*c^2+32//5*a*c1*b^3+24//5*b*c*c1*a^2+48//5*a*b1*c*b^2)+x^6*(8//3*c1*b^4+c1*a^2*c^2+16//3*b1*c*b^3+4*a*b*b1*c^2+8*a*c*c1*b^2)+a*x^4*(8*b1*b^3+c*c1*a^2+6*a*c1*b^2+6*a*b*b1*c)+b1*x*a^4+(1/2)*a^3*x^2*(a*c1+8*b*b1)+(1/2)*c^2*x^8*(6*c1*b^2+a*c*c1+2*b*b1*c)+1//9*c^3*x^9*(b1*c+8*b*c1)+1//10*c1*c^4*x^10+4//3*a^2*x^3*(6*b1*b^2+a*b1*c+2*a*b*c1)+4//7*c*x^7*(8*c1*b^3+a*b1*c^2+6*b1*c*b^2+6*a*b*c*c1))
@test integrate((a+c*x^2+2*b*x)^-1*(b1+c1*x), x) == :((1/2)*c1*c^-1*log(a+c*x^2+2*b*x)+-1*c^-1*(b^2+-1*a*c)^-1//2*(b1*c+-1*b*c1)*arctanh((b^2+-1*a*c)^-1//2*(b+c*x)))
@test integrate((a+c*x^2+2*b*x)^-2*(b1+c1*x), x) == :((1/2)*(b^2+-1*a*c)^-3//2*(b1*c+-1*b*c1)*arctanh((b^2+-1*a*c)^-1//2*(b+c*x))+-1*(2*b^2+-2*a*c)^-1*(a+c*x^2+2*b*x)^-1*(b*b1+x*(b1*c+-1*b*c1)+-1*a*c1))
@test integrate((a+c*x^2+2*b*x)^-3*(b1+c1*x), x) == :(-1*(4*b^2+-4*a*c)^-1*(a+c*x^2+2*b*x)^-2*(b*b1+x*(b1*c+-1*b*c1)+-1*a*c1)+-3//8*c*(b^2+-1*a*c)^-5//2*(b1*c+-1*b*c1)*arctanh((b^2+-1*a*c)^-1//2*(b+c*x))+1//8*(b^2+-1*a*c)^-2*(a+c*x^2+2*b*x)^-1*(b+c*x)*(-3*b*c1+3*b1*c))
@test integrate((a+c*x^2+2*b*x)^-4*(b1+c1*x), x) == :(-1*(6*b^2+-6*a*c)^-1*(a+c*x^2+2*b*x)^-3*(b*b1+x*(b1*c+-1*b*c1)+-1*a*c1)+1//24*(b^2+-1*a*c)^-2*(a+c*x^2+2*b*x)^-2*(b+c*x)*(-5*b*c1+5*b1*c)+5//16*c^2*(b^2+-1*a*c)^-7//2*(b1*c+-1*b*c1)*arctanh((b^2+-1*a*c)^-1//2*(b+c*x))+-5//16*c*(b^2+-1*a*c)^-3*(a+c*x^2+2*b*x)^-1*(b+c*x)*(b1*c+-1*b*c1))
@test integrate(x*(3+2*x^2+6x)^-1, x) == :((1//4+-1//4*3^(1/2))*log(3+-1*3^(1/2)+2x)+(1//4+1//4*3^(1/2))*log(3+3^(1/2)+2x))
@test integrate((3+2*x^2+6x)^-3*(-3+2x), x) == :(-1*(6+4*x^2+12x)^-1*(3+2x)+1//3*3^(1/2)*arctanh(1//3*3^(1/2)*(3+2x))+1//4*(3+2*x^2+6x)^-2*(5+4x))
@test integrate((4+x^2+5x)^-2*(-1+x), x) == :(-7//27*log(4+x)+7//27*log(1+x)+(36+9*x^2+45x)^-1*(13+7x))
@test integrate((2+x^2+3x)^-5, x) == :(-70*log(2+x)+70*log(1+x)+(2+x^2+3x)^-1*(105+70x)+-1//6*(2+x^2+3x)^-2*(105+70x)+1//4*(2+x^2+3x)^-4*(-3+-2x)+1//6*(2+x^2+3x)^-3*(21+14x))
@test integrate(x^-3*(7+-6x+2*x^2)^-2, x) == :(-69//1715*x^-1+-40//2401*log(7+-6x+2*x^2)+-1//490*x^-2+80//2401*log(x)+-234//60025*5^(1/2)*arctan(1//5*5^(1/2)*(3+-2x))+-1//35*x^-2*(7+-6x+2*x^2)^-1*(2+-3x))
@test integrate(x^9*(2+x^2+3x)^-5, x) == :(-1471*log(1+x)+735x+1472*log(2+x)+(1/2)*x^4*(2+x^2+3x)^-2*(184+135x)+-1*x^2*(4+2*x^2+6x)^-1*(2206+1593x)+-1//12*x^6*(2+x^2+3x)^-3*(110+81x)+1//4*x^8*(2+x^2+3x)^-4*(4+3x))
@test integrate((1+2x)^2*(3+2*x^2+5x)^-5, x) == :(-2480*log(3+2x)+2480*log(1+x)+(3+2*x^2+5x)^-1*(3100+2480x)+-1//3*(3+2*x^2+5x)^-2*(775+620x)+1//3*(3+2*x^2+5x)^-3*(73+62x)+1//4*(3+2*x^2+5x)^-4*(1+2x)*(7+6x))
@test integrate(x^-7*(a+-1*b*x^2)^3, x) == :(-1*b^3*log(x)+-1//6*a^3*x^-6+-3//2*a*b^2*x^-2+3//4*b*a^2*x^-4)
@test integrate(x^13*(a^4+x^4)^-5, x) == :(-5//96*x^6*(a^4+x^4)^-3+-5//128*x^2*(a^4+x^4)^-2+-1//16*x^10*(a^4+x^4)^-4+5//256*a^-6*arctan(a^-2*x^2)+5//256*a^-4*x^2*(a^4+x^4)^-1)
@test integrate(x^3//2*(-1x+2*x^(1/2))^2*(1+x^2), x) == :(-1*x^4+-2//3*x^6+2//9*x^9//2+2//13*x^13//2+8//7*x^7//2+8//11*x^11//2)
@test integrate((x^3//2+-3*x^3//5)^2*(4*x^3//2+-1//3*x^2//3), x) == :(-120//23*x^23//5+-45//43*x^43//15+-1//14*x^14//3+8//11*x^11//2+60//113*x^113//30+360//37*x^37//10)
@test integrate((1+(1+x)^(1/2))^-1, x) == :(-2*log(1+(1+x)^(1/2))+2*(1+x)^(1/2))
@test integrate(x*(1+(1+x)^(1/2))^-1, x) == :(-1x+2//3*(1+x)^3//2)
@test integrate((-1+(1+x)^(1/2))^-1*(1+(1+x)^(1/2)), x) == :(x+4*(1+x)^(1/2)+4*log(1+-1*(1+x)^(1/2)))
@test integrate(((1+x)^2//3+-1*(1+x)^(1/2))^-1, x) == :(3*(1+x)^1//3+6*(1+x)^1//6+6*log(1+-1*(1+x)^1//6))
@test integrate(x^-1//2*(1+x^1//4)^1//3, x) == :(-3*(1+x^1//4)^4//3+12//7*(1+x^1//4)^7//3)
@test integrate(x^-3*(1+x)^-3//2, x) == :(-15//4*arctanh((1+x)^(1/2))+15//4*(1+x)^-1//2+-1//2*x^-2*(1+x)^-1//2+5//4*x^-1*(1+x)^-1//2)
@test integrate(x^-5*(1+-1x)^-7//2, x) == :(-3003//64*arctanh((1+-1x)^(1/2))+1001//64*(1+-1x)^-3//2+3003//64*(1+-1x)^-1//2+3003//320*(1+-1x)^-5//2+-429//64*x^-1*(1+-1x)^-5//2+-143//96*x^-2*(1+-1x)^-5//2+-13//24*x^-3*(1+-1x)^-5//2+-1//4*x^-4*(1+-1x)^-5//2)
@test integrate(x^-5*(-1+x)^-2//3, x) == :(-55//243*log(x)+55//81*log(1+(-1+x)^1//3)+-110//243*3^(1/2)*arctan(1//3*3^(1/2)*(1+-2*(-1+x)^1//3))+1//4*x^-4*(-1+x)^1//3+11//27*x^-2*(-1+x)^1//3+11//36*x^-3*(-1+x)^1//3+55//81*x^-1*(-1+x)^1//3)
@test integrate(((1+x)^-1*(1+-1x))^(1/2), x) == :(-2*arctan(((1+x)^-1*(1+-1x))^(1/2))+((1+x)^-1*(1+-1x))^(1/2)*(1+x))
@test integrate((-1+x)^-1*(-25+x^2)^-1*(-5+x)^(1/2)*(3+x)^(1/2), x) == :(1//6*arctan(1//4*(-5+x)^(1/2)*(3+x)^(1/2))+1//15*5^(1/2)*arctanh(5^(1/2)*(-5+x)^-1//2*(3+x)^(1/2)))
@test integrate(x*(1+x)^2//3*(1+-1x)^(1/2)*((1+x)^(1/2)*(1+-1x)^2//3+-1*(1+x)^1//3*(1+-1x)^5//6)^-1, x) == :(-5//6*arctan((1+x)^-1//6*(1+-1x)^-1//6*((1+-1x)^1//3+-1*(1+x)^1//3))+1//6*arctan((1+x)^1//6*(1+-1x)^-1//6)+-1*(3+x)*(1//4+-1//4*x)+-4//9*3^(1/2)*arctan(1//3*3^(1/2)*(1+-1x)^-1//3*((1+-1x)^1//3+-2*(1+x)^1//3))+1//18*3^(1/2)*arctanh(3^(1/2)*(1+x)^1//6*(1+-1x)^1//6*((1+x)^1//3+(1+-1x)^1//3)^-1)+(1+x)^1//3*(1+-1x)^2//3*(-1//12+1//4*x)+-1//12*(1+x)^1//6*(1+-1x)^5//6*(10+3x)+1//4*x*(1+x)^(1/2)*(1+-1x)^(1/2)+1//12*(1+x)^2//3*(1+-1x)^1//3*(1+3x)+1//12*(1+x)^5//6*(1+-1x)^1//6*(2+3x))
@test integrate(((-1+x)^2*(1+x))^-1//3, x) == :(-3//2*log(1+-1*((-1+x)^2*(1+x))^-1//3*(-1+x))+-1//2*log(1+x)+3^(1/2)*arctan(1//3*3^(1/2)*(1+((-1+x)^2*(1+x))^-1//3*(-2+2x))))
@test integrate(x^-2*((-1+x)^2*(1+x))^1//3, x) == :(-3//2*log(1+-1*((-1+x)^2*(1+x))^-1//3*(-1+x))+-2//3*log(1+x)+-1//2*log(1+((-1+x)^2*(1+x))^-1//3*(-1+x))+1//6*log(x)+-1*3^(1/2)*arctan(1//3*3^(1/2)*(1+((-1+x)^2*(1+x))^-1//3*(-2+2x)))+-1*x^-1*((-1+x)^2*(1+x))^1//3+-1//3*3^(1/2)*arctan(1//3*3^(1/2)*(1+-1*((-1+x)^2*(1+x))^-1//3*(-2+2x))))
@test integrate((-3+x^2+-2x)^-5//2, x) == :(-1//24*(-3+x^2+-2x)^-1//2*(1+-1x)+1//12*(-3+x^2+-2x)^-3//2*(1+-1x))
@test integrate((9+x^3+-5*x^2+3x)^-1//2, x) == :((1+x)^(1/2)*(9+x^3+-5*x^2+3x)^-1//2*(3+-1x)*arctanh((1/2)*(1+x)^(1/2)))
@test integrate((9+x^3+-5*x^2+3x)^-3//2, x) == :(-15//256*(3+-1x)^3*(9+x^3+-5*x^2+3x)^-3//2*(1+x)+1//8*(9+x^3+-5*x^2+3x)^-3//2*(1+x)*(3+-1x)+5//64*(3+-1x)^2*(9+x^3+-5*x^2+3x)^-3//2*(1+x)+15//512*(1+x)^3//2*(3+-1x)^3*(9+x^3+-5*x^2+3x)^-3//2*arctanh((1/2)*(1+x)^(1/2)))
@test integrate((9+x^3+-5*x^2+3x)^-1//3, x) == :(-3//2*log(1+-1*(9+x^3+-5*x^2+3x)^-1//3*(-3+x))+-1//2*log(1+x)+3^(1/2)*arctan(1//3*3^(1/2)*(1+(9+x^3+-5*x^2+3x)^-1//3*(-6+2x))))
@test integrate((9+x^3+-5*x^2+3x)^-2//3, x) == :(1//4*(9+x^3+-5*x^2+3x)^-2//3*(1+x)*(9+-3x))
@test integrate((9+x^3+-5*x^2+3x)^-4//3, x) == :(-27//320*(3+-1x)^3*(9+x^3+-5*x^2+3x)^-4//3*(1+x)+1//20*(9+x^3+-5*x^2+3x)^-4//3*(1+x)*(9+-3x)+9//80*(3+-1x)^2*(9+x^3+-5*x^2+3x)^-4//3*(1+x))
@test integrate((4+-2*x^2+3x)^-1//2, x) == :(-1//2*2^(1/2)*arcsin(1//41*41^(1/2)*(3+-4x)))
@test integrate((-3+-1*x^2+4x)^-1//2, x) == :(-1*arcsin(2+-1x))
@test integrate((-2+-5x+-3*x^2)^-1//2, x) == :(1//3*3^(1/2)*arcsin(5+6x))
@test integrate((1+-1*x^2)^-1//2*(4+x^2)^-1, x) == :(1//10*5^(1/2)*arctan((1/2)*x*5^(1/2)*(1+-1*x^2)^-1//2))
@test integrate((1+4*x^2)^-1//2*(4+x^2)^-1, x) == :(1//30*15^(1/2)*arctanh((1/2)*x*15^(1/2)*(1+4*x^2)^-1//2))
@test integrate(x*(3+-1*x^2)^-1*(5+-1*x^2)^-1//2, x) == :((1/2)*2^(1/2)*arctanh((1/2)*2^(1/2)*(5+-1*x^2)^(1/2)))
@test integrate(x*(3+-1*x^2)^-1//2*(5+-1*x^2)^-1, x) == :(-1//2*2^(1/2)*arctan((1/2)*2^(1/2)*(3+-1*x^2)^(1/2)))
@test integrate((-1+x^4)^-1*(2+x^2)^-1//2, x) == :(-1//2*arctan(x*(2+x^2)^-1//2)+-1//6*3^(1/2)*arctanh(x*3^(1/2)*(2+x^2)^-1//2))
@test integrate(x*(-1+x^2)^-1*(4+x^2+2x)^-1//2, x) == :(-1//6*3^(1/2)*arctanh(1//3*3^(1/2)*(4+x^2+2x)^(1/2))+-1//14*7^(1/2)*arctanh(1//7*7^(1/2)*(4+x^2+2x)^-1//2*(5+2x)))
@test integrate((-8+x^3)^-1*(5+x^2+2x)^-1//2, x) == :(1//12*arctanh((5+x^2+2x)^(1/2))+-1//12*3^(1/2)*arctan(1//3*3^(1/2)*(5+x^2+2x)^-1//2*(1+x))+-1//156*13^(1/2)*arctanh(1//13*13^(1/2)*(5+x^2+2x)^-1//2*(7+3x)))
@test integrate(x*(4+x+x^2)^-1*(5+4x+4*x^2)^-1//2, x) == :(-1//165*165^(1/2)*arctanh(1//15*165^(1/2)*(5+4x+4*x^2)^-1//2*(1+2x))+1//11*11^(1/2)*arctan(1//11*11^(1/2)*(5+4x+4*x^2)^(1/2)))
@test integrate((1+x^2)^-1*(1+x+x^2)^-1//2*(3+x), x) == :(2^(1/2)*arctanh((1/2)*2^(1/2)*(1+x+x^2)^-1//2*(1+x))+-2*2^(1/2)*arctan((1/2)*2^(1/2)*(1+x+x^2)^-1//2*(1+-1x)))
@test integrate((-1+x^2+6x)^-1//2*(4+3*x^2+4x)^-1*(1+2x), x) == :(-5//84*14^(1/2)*arctan(1//4*14^(1/2)*(-1+x^2+6x)^-1//2*(2+-1x))+-1//21*7^(1/2)*arctanh(7^(1/2)*(-1+x^2+6x)^-1//2*(1+x)))
@test integrate((13+-22x+10*x^2)^-1//2*(17+-18x+5*x^2)^-1*(-2+x), x) == :(1//70*35^(1/2)*arctanh((1/2)*35^(1/2)*(13+-22x+10*x^2)^-1//2*(1+-1x)))
@test integrate(x^4*(5+-1*x^2)^(1/2), x) == :(125//16*arcsin(1//5*x*5^(1/2))+-25//16*x*(5+-1*x^2)^(1/2)+-5//24*x^3*(5+-1*x^2)^(1/2)+1//6*x^5*(5+-1*x^2)^(1/2))
@test integrate(x^-6*(2+x^2)^-1//2, x) == :(-1//10*x^-5*(2+x^2)^(1/2)+-1//15*x^-1*(2+x^2)^(1/2)+1//15*x^-3*(2+x^2)^(1/2))
@test integrate((3+2*x^2)^-7//2, x) == :(1//15*x*(3+2*x^2)^-5//2+4//135*x*(3+2*x^2)^-3//2+8//405*x*(3+2*x^2)^-1//2)
@test integrate(x*(1+x^2+a*(1+x^2)^(1/2))^-1, x) == :(log(a+(1+x^2)^(1/2)))
@test integrate((1+x^2)^-3//2*(1+x^2+-1x), x) == :((1+x^2)^-1//2+arcsinh(x))
@test integrate((1+x^2)^(1/2)*(2+x^2)^-1, x) == :(-1//2*2^(1/2)*arctanh((1/2)*x*2^(1/2)*(1+x^2)^-1//2)+arcsinh(x))
@test integrate((1+x^2)^-1//2*(2+x^2)^-2, x) == :(3//8*2^(1/2)*arctanh((1/2)*x*2^(1/2)*(1+x^2)^-1//2)+-1*x*(1+x^2)^(1/2)*(8+4*x^2)^-1)
@test integrate(x^2*(-6+x^2)^-1*(-2+x^2)^-1//2, x) == :(-1//2*6^(1/2)*arctanh(1//3*x*6^(1/2)*(-2+x^2)^-1//2)+arctanh(x*(-2+x^2)^-1//2))
@test integrate((1+x^2)^-2*(1+-1*x^2)^-1//2*(5+x^2), x) == :(2*2^(1/2)*arctan(x*2^(1/2)*(1+-1*x^2)^-1//2)+x*(1+x^2)^-1*(1+-1*x^2)^(1/2))
@test integrate((5+(1+-1*x^2)^(1/2))^-1*(-1*(1+-1*x^2)^(1/2)+4x), x) == :(-1x+-4*(1+-1*x^2)^(1/2)+5*arcsin(x)+20*log(5+(1+-1*x^2)^(1/2))+-25//12*6^(1/2)*arctan(5//12*x*6^(1/2)*(1+-1*x^2)^-1//2)+25//12*6^(1/2)*arctan(1//12*x*6^(1/2)))
@test integrate(x^2*(1+x^2)^-1//2*(1+(1+x^2)^3//2+-1*x^3)^-1*(2+-1*(1+x^2)^(1/2)), x) == :(-41//54*arcsinh(x)+-7//54*log(3+2x+3*x^2)+-1//6*x^2+7//27*arctanh((1/2)*(1+x^2)^-1//2*(1+-1x))+8//9*x+8//9*(1+x^2)^(1/2)+-1//6*x*(1+x^2)^(1/2)+4//27*2^(1/2)*arctan(1//4*2^(1/2)*(1+3x))+4//27*2^(1/2)*arctan((1/2)*2^(1/2)*(1+x^2)^-1//2*(1+x)))
@test integrate(x*(-1*x^2+2*r*x)^(1/2), x) == :(-1//3*(-1*x^2+2*r*x)^3//2+r^3*arctan(x*(-1*x^2+2*r*x)^-1//2)+-1//2*r*(-1*x^2+2*r*x)^(1/2)*(r+-1x))
@test integrate(x^2*(-1*x^2+2*r*x)^(1/2), x) == :(-5//12*r*(-1*x^2+2*r*x)^3//2+-1//4*x*(-1*x^2+2*r*x)^3//2+5//4*r^4*arctan(x*(-1*x^2+2*r*x)^-1//2)+-5//8*r^2*(-1*x^2+2*r*x)^(1/2)*(r+-1x))
@test integrate(x^3*(-1*x^2+2*r*x)^(1/2), x) == :(-7//12*r^2*(-1*x^2+2*r*x)^3//2+-1//5*x^2*(-1*x^2+2*r*x)^3//2+7//4*r^5*arctan(x*(-1*x^2+2*r*x)^-1//2)+-7//8*r^3*(-1*x^2+2*r*x)^(1/2)*(r+-1x)+-7//20*r*x*(-1*x^2+2*r*x)^3//2)
@test integrate((-1+x^2)^-1*(x^2+2x)^-1//2, x) == :(-1//2*arctan((x^2+2x)^(1/2))+-1//6*3^(1/2)*arctanh(1//3*3^(1/2)*(x^2+2x)^-1//2*(1+2x)))
@test integrate((1+x)^-3*(-1*x^2+2x)^-1//2*(-2+3x), x) == :(-2*(3+3x)^-1*(-1*x^2+2x)^(1/2)+-5//6*(1+x)^-2*(-1*x^2+2x)^(1/2)+1//6*3^(1/2)*arctan(1//3*3^(1/2)*(-1*x^2+2x)^-1//2*(1+-2x)))
@test integrate((1+x+x^2)^-1//2, x) == :(arcsinh(1//3*3^(1/2)*(1+2x)))
@test integrate(x^3*(1+x+x^2)^-1//2, x) == :(7//16*arcsinh(1//3*3^(1/2)*(1+2x))+-1*(1+x+x^2)^(1/2)*(1//24+5//12*x)+1//3*x^2*(1+x+x^2)^(1/2))
@test integrate((1+x+x^2)^-3//2, x) == :(1//3*(1+x+x^2)^-1//2*(2+4x))
@test integrate(x*(1+x+x^2)^-3//2, x) == :(-1//3*(1+x+x^2)^-1//2*(4+2x))
@test integrate(x^3*(1+x+x^2)^-3//2, x) == :(-3//2*arcsinh(1//3*3^(1/2)*(1+2x))+(1+x+x^2)^(1/2)*(5//3+2//3*x)+-2//3*x^2*(1+x+x^2)^-1//2*(2+x))
@test integrate(x^2*(1+x+x^2)^(1/2), x) == :(-5//24*(1+x+x^2)^3//2+3//128*arcsinh(1//3*3^(1/2)*(1+2x))+(1+x+x^2)^(1/2)*(1//64+1//32*x)+1//4*x*(1+x+x^2)^3//2)
@test integrate((1+x+x^2)^3//2, x) == :(27//128*arcsinh(1//3*3^(1/2)*(1+2x))+(1+x+x^2)^(1/2)*(9//64+9//32*x)+(1+x+x^2)^3//2*(1//8+1//4*x))
@test integrate((1+x+x^2)^5//2, x) == :(135//1024*arcsinh(1//3*3^(1/2)*(1+2x))+(1+x+x^2)^(1/2)*(45//512+45//256*x)+(1+x+x^2)^3//2*(5//64+5//32*x)+(1+x+x^2)^5//2*(1//12+1//6*x))
@test integrate(x^-2*(1+x+x^2)^-1//2, x) == :((1/2)*arctanh((1/2)*(1+x+x^2)^-1//2*(2+x))+-1*x^-1*(1+x+x^2)^(1/2))
@test integrate(x^-3*(1+x+x^2)^-1//2, x) == :(1//8*arctanh((1/2)*(1+x+x^2)^-1//2*(2+x))+-1//2*x^-2*(1+x+x^2)^(1/2)+3//4*x^-1*(1+x+x^2)^(1/2))
@test integrate(x^-2*(1+x+x^2)^-3//2, x) == :(3//2*arctanh((1/2)*(1+x+x^2)^-1//2*(2+x))+-5//3*x^-1*(1+x+x^2)^(1/2)+1//3*x^-1*(1+x+x^2)^-1//2*(2+-2x))
@test integrate(x^-3*(1+x+x^2)^-3//2, x) == :(-3//8*arctanh((1/2)*(1+x+x^2)^-1//2*(2+x))+-7//6*x^-2*(1+x+x^2)^(1/2)+37//12*x^-1*(1+x+x^2)^(1/2)+1//3*x^-2*(1+x+x^2)^-1//2*(2+-2x))
@test integrate((1+x)^-1*(1+x+x^2)^-1//2, x) == :(-1*arctanh((1/2)*(1+x+x^2)^-1//2*(1+-1x)))
@test integrate((x^3+-1x)^-1*(4+x^2+2x)^-1//2, x) == :((1/2)*arctanh((1/2)*(4+x^2+2x)^-1//2*(4+x))+-1//6*3^(1/2)*arctanh(1//3*3^(1/2)*(4+x^2+2x)^(1/2))+-1//14*7^(1/2)*arctanh(1//7*7^(1/2)*(4+x^2+2x)^-1//2*(5+2x)))
@test integrate((-1+x)^-2*(4+x^2+2x)^(1/2), x) == :((1+-1x)^-1*(4+x^2+2x)^(1/2)+-2//7*7^(1/2)*arctanh(1//7*7^(1/2)*(4+x^2+2x)^-1//2*(5+2x))+arcsinh(1//3*3^(1/2)*(1+x)))
@test integrate((3+x^2+2x)^-2*(4+x^2+2x)^-1//2*(3+2x), x) == :(-1//8*2^(1/2)*arctan((1/2)*2^(1/2)*(4+x^2+2x)^-1//2*(1+x))+-1*(4+x^2+2x)^(1/2)*(12+4*x^2+8x)^-1*(3+-1x)+arctanh((4+x^2+2x)^(1/2)))
@test integrate((-3+x+2*x^2)^-1*(-3+x^2+2x)^-1//2*(2*x^3+3*x^2), x) == :((-3+x^2+2x)^(1/2)+(2+-2x)^-1*(-3+x^2+2x)^(1/2))
@test integrate((1+x+x^2)^-1*(2+x+x^2)^-1//2*(1+x^4), x) == :(-1*arctanh((2+x+x^2)^(1/2))+-7//4*(2+x+x^2)^(1/2)+-1//8*arcsinh(1//7*7^(1/2)*(1+2x))+(1/2)*x*(2+x+x^2)^(1/2)+1//3*3^(1/2)*arctan(1//3*3^(1/2)*(2+x+x^2)^-1//2*(1+2x)))
@test integrate((4+x^2+2x)^-7//2, x) == :(1//15*(4+x^2+2x)^-5//2*(1+x)+1//135*(4+x^2+2x)^-3//2*(4+4x)+1//405*(4+x^2+2x)^-1//2*(8+8x))
@test integrate((1+3*x^2+8x)^-5//2, x) == :(-1//39*(1+3*x^2+8x)^-3//2*(4+3x)+1//169*(1+3*x^2+8x)^-1//2*(8+6x))
@test integrate((5+-3*x^2+4x)^-5//2, x) == :(-1//57*(5+-3*x^2+4x)^-3//2*(2+-3x)+-1//361*(5+-3*x^2+4x)^-1//2*(4+-6x))
@test integrate((1+(2+x^2+2x)^(1/2))^-1, x) == :((1+x)^-1+-1*(1+x)^-1*(2+x^2+2x)^(1/2)+arcsinh(1+x))
@test integrate((x+(1+x+x^2)^(1/2))^-1, x) == :((1+x+x^2)^(1/2)+-1x+2*log(x+(1+x+x^2)^(1/2))+-3//2*arcsinh(1//3*3^(1/2)*(1+2x)))
@test integrate(x^2*(1+2x+2*(1+x+x^2)^(1/2))^-1, x) == :(-5//36*(1+x+x^2)^3//2+-1//6*x^4+-1//9*x^3+1//64*arcsinh(1//3*3^(1/2)*(1+2x))+(1+x+x^2)^(1/2)*(1//96+1//48*x)+1//6*x*(1+x+x^2)^3//2)
@test integrate((-1+(1+x+x^2)^(1/2))^-1*((1+x+x^2)^(1/2)+-3x), x) == :(x+-1*arctanh((1/2)*(1+x+x^2)^-1//2*(2+x))+-4*log(1+x)+-3*(1+x+x^2)^(1/2)+4*arctanh((1/2)*(1+x+x^2)^-1//2*(1+-1x))+5//2*arcsinh(1//3*3^(1/2)*(1+2x))+log(x))
@test integrate(((4+x^2+2x)^(1/2)+-1*(1+x+x^2)^(1/2))^-1*(1+x), x) == :(-2*(1+x+x^2)^(1/2)+-2*(4+x^2+2x)^(1/2)+11//2*arcsinh(1//3*3^(1/2)*(1+x))+43//8*arcsinh(1//3*3^(1/2)*(1+2x))+(1+x+x^2)^(1/2)*(1//4+(1/2)*x)+(4+x^2+2x)^(1/2)*(1/2+(1/2)*x)+-2*7^(1/2)*arctanh(1//14*7^(1/2)*(1+x+x^2)^-1//2*(1+5x))+2*7^(1/2)*arctanh(1//7*7^(1/2)*(4+x^2+2x)^-1//2*(1+-2x)))
@test integrate(x^-3*(-1+x)^-1//2, x) == :(3//4*arctan((-1+x)^(1/2))+(1/2)*x^-2*(-1+x)^(1/2)+3//4*x^-1*(-1+x)^(1/2))
@test integrate(x^-2*(1+-3*x^-1)^-4//3, x) == :(-1*(1+-3*x^-1)^-1//3)
@test integrate(x^-2*(-1+3x)^4//3, x) == :(-6*log(1+(-1+3x)^1//3)+2*log(x)+12*(-1+3x)^1//3+-1*x^-1*(-1+3x)^4//3+4*3^(1/2)*arctan(1//3*3^(1/2)*(1+-2*(-1+3x)^1//3)))
@test integrate(x^2*(4+-3x)^4//3, x) == :(-16//63*(4+-3x)^7//3+-1//117*(4+-3x)^13//3+4//45*(4+-3x)^10//3)
@test integrate(x^-1*(1+-2*x^1//3)^3//4, x) == :(-6*arctanh((1+-2*x^1//3)^1//4)+4*(1+-2*x^1//3)^3//4+6*arctan((1+-2*x^1//3)^1//4))
@test integrate(x*(3+-2*x^(1/2))^-3//4, x) == :(-27//2*(3+-2*x^(1/2))^1//4+-1//2*(3+-2*x^(1/2))^9//4+1//26*(3+-2*x^(1/2))^13//4+27//10*(3+-2*x^(1/2))^5//4)
@test integrate(x^-2*(-1+2*x^(1/2))^5//4, x) == :(-1*x^-1*(-1+2*x^(1/2))^5//4+-5//2*x^-1//2*(-1+2*x^(1/2))^1//4+-5//4*2^(1/2)*arctan(1+-1*2^(1/2)*(-1+2*x^(1/2))^1//4)+-5//8*2^(1/2)*log(1+(-1+2*x^(1/2))^(1/2)+-1*2^(1/2)*(-1+2*x^(1/2))^1//4)+5//4*2^(1/2)*arctan(1+2^(1/2)*(-1+2*x^(1/2))^1//4)+5//8*2^(1/2)*log(1+(-1+2*x^(1/2))^(1/2)+2^(1/2)*(-1+2*x^(1/2))^1//4))
@test integrate(x^6*(1+x^7)^1//3, x) == :(3//28*(1+x^7)^4//3)
@test integrate(x^6*(1+x^7)^-5//3, x) == :(-3//14*(1+x^7)^-2//3)
@test integrate(x^-1*(-27+2*x^7)^-2//3, x) == :(-1//18*log(x)+1//42*log(3+(-27+2*x^7)^1//3)+-1//63*3^(1/2)*arctan(1//9*3^(1/2)*(3+-2*(-27+2*x^7)^1//3)))
@test integrate(x^-8*(1+x^7)^2//3, x) == :(-1//3*log(x)+1//7*log(1+-1*(1+x^7)^1//3)+-1//7*x^-7*(1+x^7)^2//3+2//21*3^(1/2)*arctan(1//3*3^(1/2)*(1+2*(1+x^7)^1//3)))
@test integrate(x^-2*(3+4*x^4)^1//4, x) == :((1/2)*2^(1/2)*arctanh(x*2^(1/2)*(3+4*x^4)^-1//4)+-1*x^-1*(3+4*x^4)^1//4+-1//2*2^(1/2)*arctan(x*2^(1/2)*(3+4*x^4)^-1//4))
@test integrate(x^2*(3+4*x^4)^5//4, x) == :(-45//256*2^(1/2)*arctan(x*2^(1/2)*(3+4*x^4)^-1//4)+1//8*x^3*(3+4*x^4)^5//4+15//32*x^3*(3+4*x^4)^1//4+45//256*2^(1/2)*arctanh(x*2^(1/2)*(3+4*x^4)^-1//4))
@test integrate(x^6*(3+4*x^4)^1//4, x) == :(-27//1024*2^(1/2)*arctanh(x*2^(1/2)*(3+4*x^4)^-1//4)+1//8*x^7*(3+4*x^4)^1//4+3//128*x^3*(3+4*x^4)^1//4+27//1024*2^(1/2)*arctan(x*2^(1/2)*(3+4*x^4)^-1//4))
@test integrate((x*(1+-1*x^2))^1//3, x) == :(-1//4*log(x+(x*(1+-1*x^2))^1//3)+1//12*log(x)+(1/2)*x*(x*(1+-1*x^2))^1//3+1//6*3^(1/2)*arctan(1//3*3^(1/2)*(x*(1+-1*x^2))^-1//3*(-1*(x*(1+-1*x^2))^1//3+2x)))
@test integrate(x^3*(1+2*x^8)^-1//2*(-1+x^4)^-1, x) == :(-1//12*3^(1/2)*arctanh(1//3*3^(1/2)*(1+2*x^8)^-1//2*(1+2*x^4)))
@test integrate(x^9*(1+x^5+x^10)^(1/2), x) == :(-3//80*arcsinh(1//3*3^(1/2)*(1+2*x^5))+1//15*(1+x^5+x^10)^3//2+(1+x^5+x^10)^(1/2)*(-1//40+-1//20*x^5))
@test integrate(x^-5*(4+x^4+2*x^2)^-1//2, x) == :(1//128*arctanh((1/2)*(4+x^4+2*x^2)^-1//2*(4+x^2))+-1//16*x^-4*(4+x^4+2*x^2)^(1/2)+3//64*x^-2*(4+x^4+2*x^2)^(1/2))
@test integrate(x^-1*(1+x^4+3*x^2)^-1//2*(-1+x^2), x) == :(arctanh((1+x^4+3*x^2)^-1//2*(1+x^2)))
@test integrate((x^4+-3*x^2)^3//5*(-3x+2*x^3), x) == :(5//16*(x^4+-3*x^2)^8//5)
@test integrate((-1+3*x^3)^-3//4*(-2*x^5+3*x^8+-1*x^2*(-1+3*x^3)^2//3), x) == :(-4//27*(-1+3*x^3)^1//4+-4//33*(-1+3*x^3)^11//12+4//243*(-1+3*x^3)^9//4)
@test integrate((-1+x^3)^-1*(2+x^3)^-1//3, x) == :(-1//3*3^1//6*arctan(1//3*3^(1/2)+2//3*x*3^5//6*(2+x^3)^-1//3)+-1//18*3^2//3*log(1+x*3^1//3*(2+x^3)^-1//3+3^2//3*x^2*(2+x^3)^-2//3)+1//9*3^2//3*log(1+-1*x*3^1//3*(2+x^3)^-1//3))
@test integrate((1+x^4)^-1*(2+x^4)^-1//4, x) == :(-1//4*2^(1/2)*arctan(1+-1*x*2^(1/2)*(2+x^4)^-1//4)+-1//8*2^(1/2)*log(1+x^2*(2+x^4)^-1//2+-1*x*2^(1/2)*(2+x^4)^-1//4)+1//4*2^(1/2)*arctan(1+x*2^(1/2)*(2+x^4)^-1//4)+1//8*2^(1/2)*log(1+x^2*(2+x^4)^-1//2+x*2^(1/2)*(2+x^4)^-1//4))
@test integrate((2+x^3)^-1//3*(-1+x^3), x) == :(5//6*log((2+x^3)^1//3+-1x)+-5//9*3^(1/2)*arctan(1//3*3^(1/2)*(1+2*x*(2+x^3)^-1//3))+1//3*x*(2+x^3)^2//3)
@test integrate((1+x^4)^3//4*(2+x^4)^-2, x) == :(3//32*2^1//4*arctan((1/2)*x*2^3//4*(1+x^4)^-1//4)+3//32*2^1//4*arctanh((1/2)*x*2^3//4*(1+x^4)^-1//4)+x*(1+x^4)^3//4*(16+8*x^4)^-1)
@test integrate((x^3+3x+3*x^2)^-1*(3+x^3+3x+3*x^2)^-1//3, x) == :(-1//3*3^1//6*arctan(1//3*3^(1/2)+1//3*3^5//6*(2+(1+x)^3)^-1//3*(2+2x))+-1//18*3^2//3*log(1+3^1//3*(2+(1+x)^3)^-1//3*(1+x)+3^2//3*(1+x)^2*(2+(1+x)^3)^-2//3)+1//9*3^2//3*log(1+-1*3^1//3*(2+(1+x)^3)^-1//3*(1+x)))
@test integrate((1+x^2)^-1*(1+x^4)^-1//2*(1+-1*x^2), x) == :((1/2)*2^(1/2)*arctan(x*2^(1/2)*(1+x^4)^-1//2))
@test integrate((1+x^4)^-1//2*(1+-1*x^2)^-1*(1+x^2), x) == :((1/2)*2^(1/2)*arctanh(x*2^(1/2)*(1+x^4)^-1//2))
@test integrate((1+-1*x^2)^-1*(1+x^2+x^4)^-1//2*(1+x^2), x) == :(1//3*3^(1/2)*arctanh(x*3^(1/2)*(1+x^2+x^4)^-1//2))
@test integrate((1+x^2)^-1*(1+x^2+x^4)^-1//2*(1+-1*x^2), x) == :(arctan(x*(1+x^2+x^4)^-1//2))
@test integrate(x^-2*(1+x^2+x^4)^-1//2*(-1+x^4), x) == :(x^-1*(1+x^2+x^4)^(1/2))
@test integrate((1+x^2+2*a*x)^-1*(1+x^4+2*a*x+2*a*x^3+2*b*x^2)^-1//2*(1+-1*x^2), x) == :((1/2)*2^(1/2)*(1+-1b)^-1//2*arctan((1/2)*2^(1/2)*(1+-1b)^-1//2*(1+x^4+2*a*x+2*a*x^3+2*b*x^2)^-1//2*(a+a*x^2+x*(2+-2b+2*a^2))))
@test integrate((1+x^4)^-1*((1+x^4)^(1/2)+-1*x^2)^-1//2, x) == :(arctan(x*((1+x^4)^(1/2)+-1*x^2)^-1//2))
@test integrate((1+x^(2n))^-1*((1+x^(2n))^(n^-1)+-1*x^2)^-1//2, x) == :(arctan(x*((1+x^(2n))^(n^-1)+-1*x^2)^-1//2))
@test integrate(cos(x)^2, x) == :((1/2)*x+(1/2)*cos(x)*sin(x))
@test integrate(cos(x)^3, x) == :(-1//3*sin(x)^3+sin(x))
@test integrate(sin(x)^4, x) == :(3//8*x+-3//8*cos(x)*sin(x)+-1//4*sin(x)^3*cos(x))
@test integrate(cos(x)^6, x) == :(5//16*x+1//6*cos(x)^5*sin(x)+5//16*cos(x)*sin(x)+5//24*cos(x)^3*sin(x))
@test integrate(sin(x)^8, x) == :(35//128*x+-35//128*cos(x)*sin(x)+-35//192*sin(x)^3*cos(x)+-7//48*sin(x)^5*cos(x)+-1//8*sin(x)^7*cos(x))
@test integrate(-1*cos(3x+5//12*pi)^3, x) == :(-1//3*sin(3x+5//12*pi)+1//9*sin(3x+5//12*pi)^3)
@test integrate(sin(x)^-6, x) == :(-1*cot(x)+-2//3*cot(x)^3+-1//5*cot(x)^5)
@test integrate(csc(x)^7, x) == :(-5//16*arctanh(cos(x))+-5//16*cot(x)*csc(x)+-5//24*csc(x)^3*cot(x)+-1//6*csc(x)^5*cot(x))
@test integrate(cos(x)^-12, x) == :(2*tan(x)^5+1//11*tan(x)^11+5//3*tan(x)^3+5//9*tan(x)^9+10//7*tan(x)^7+tan(x))
@test integrate(cos(3x+1//4*pi)^-3, x) == :(1//6*arctanh(sin(3x+1//4*pi))+1//6*sec(3x+1//4*pi)*tan(3x+1//4*pi))
@test integrate(tan(x)^6, x) == :(-1x+-1//3*tan(x)^3+1//5*tan(x)^5+tan(x))
@test integrate(tan(x)^-5, x) == :((1/2)*cot(x)^2+-1//4*cot(x)^4+log(sin(x)))
@test integrate(cot(1//3*x+1//4*pi)^4, x) == :(x+-1*cot(1//3*x+1//4*pi)^3+3*cot(1//3*x+1//4*pi))
@test integrate(cos(x)^6*sin(x)^4, x) == :(3//256*x+-3//80*cos(x)^7*sin(x)+-1//10*cos(x)^7*sin(x)^3+1//128*cos(x)^3*sin(x)+1//160*cos(x)^5*sin(x)+3//256*cos(x)*sin(x))
@test integrate(cos(x)^6*sin(x)^7, x) == :(-3//11*cos(x)^11+-1//7*cos(x)^7+1//3*cos(x)^9+1//13*cos(x)^13)
@test integrate(cos(x)^-1*sin(x)^11, x) == :(-1*log(cos(x))+-5//2*cos(x)^4+-5//8*cos(x)^8+1//10*cos(x)^10+5//2*cos(x)^2+5//3*cos(x)^6)
@test integrate(cos(x)^-6*sin(x)^-6, x) == :(-10*cot(x)+10*tan(x)+-5//3*cot(x)^3+-1//5*cot(x)^5+1//5*tan(x)^5+5//3*tan(x)^3)
@test integrate(cos(x)^2*sin(x)^2, x) == :(1//8*x+-1//4*cos(x)^3*sin(x)+1//8*cos(x)*sin(x))
@test integrate(cos(x)^4*sin(x)^4, x) == :(3//128*x+-1//8*cos(x)^5*sin(x)^3+-1//16*cos(x)^5*sin(x)+1//64*cos(x)^3*sin(x)+3//128*cos(x)*sin(x))
@test integrate(cos(x)^6*sin(x)^6, x) == :(5//1024*x+-1//12*cos(x)^7*sin(x)^5+-1//24*cos(x)^7*sin(x)^3+-1//64*cos(x)^7*sin(x)+1//384*cos(x)^5*sin(x)+5//1024*cos(x)*sin(x)+5//1536*cos(x)^3*sin(x))
@test integrate(cos(x)^8*sin(x)^8, x) == :(35//32768*x+-5//384*cos(x)^9*sin(x)^3+-1//16*cos(x)^9*sin(x)^7+-1//32*cos(x)^9*sin(x)^5+-1//256*cos(x)^9*sin(x)+1//2048*cos(x)^7*sin(x)+7//12288*cos(x)^5*sin(x)+35//32768*cos(x)*sin(x)+35//49152*cos(x)^3*sin(x))
@test integrate(cos(2x+1//4*pi)^-1*sin(2x+1//4*pi)^-3, x) == :((1/2)*log(tan(2x+1//4*pi))+-1//4*cot(2x+1//4*pi)^2)
@test integrate(sec(x)^2*tan(x)^2, x) == :(1//3*tan(x)^3)
@test integrate(cot(x)^3*csc(x), x) == :(-1//3*csc(x)^3+csc(x))
@test integrate(sec(x)^3*tan(x), x) == :(1//3*sec(x)^3)
@test integrate(cot(x)^2*csc(x)^3, x) == :(1//8*arctanh(cos(x))+-1//4*csc(x)^3*cot(x)+1//8*cot(x)*csc(x))
@test integrate(cos(x)^3*sin(x)^-7, x) == :(-1//6*csc(x)^6+1//4*csc(x)^4)
@test integrate(sec(x)^3//2*tan(x)^5, x) == :(-4//7*sec(x)^7//2+2//3*sec(x)^3//2+2//11*sec(x)^11//2)
@test integrate(sec(x)^4*tan(x)^3//2, x) == :(2//5*tan(x)^5//2+2//9*tan(x)^9//2)
@test integrate(cot(x)^4*csc(x)^3, x) == :(-1//16*arctanh(cos(x))+-1//6*cot(x)^3*csc(x)^3+-1//16*cot(x)*csc(x)+1//8*csc(x)^3*cot(x))
@test integrate(sec((1/2)*x+1//4*pi)^3*tan((1/2)*x+1//4*pi)^2, x) == :(-1//4*arctanh(sin((1/2)*x+1//4*pi))+(1/2)*sec((1/2)*x+1//4*pi)^3*tan((1/2)*x+1//4*pi)+-1//4*sec((1/2)*x+1//4*pi)*tan((1/2)*x+1//4*pi))
@test integrate((1+-1//2*sin(x))^4*(4+-3*cos(x)), x) == :(-3*cos(x)^2+-3*sin(x)+10*cos(x)+-3//2*sin(x)^3+-3//80*sin(x)^5+-2//3*cos(x)^3+3//8*sin(x)^4+227//32*x+-99//32*cos(x)*sin(x)+-1//16*sin(x)^3*cos(x))
@test integrate((3+-2*cot(x))^3*(1/2+-3*cot(x)), x) == :((3+-2*cot(x))^3+-42*cot(x)+4*log(sin(x))+5*(3+-2*cot(x))^2+-285//2*x)
@test integrate(cos(x)^-5*cos(5x), x) == :(-15*tan(x)+16x+5//3*tan(x)^3)
@test integrate(cos(x)^-1*cos(4x), x) == :(-8//3*sin(x)^3+arctanh(sin(x)))
@test integrate(cos(x)*cos(4x), x) == :(1//6*sin(3x)+1//10*sin(5x))
@test integrate(cos(x)^-5*cos(4x), x) == :(35//8*arctanh(sin(x))+-29//8*sec(x)*tan(x)+1//4*sec(x)^3*tan(x))
@test integrate(cos(x)^4*cos(4x), x) == :(1//8*sin(2x)+1//16*x+1//24*sin(6x)+1//128*sin(8x)+3//32*sin(4x))
@test integrate(sin(x)^-5*cos(5x), x) == :(6*csc(x)^2+16*log(sin(x))+-1//4*csc(x)^4)
@test integrate(sin(x)^-4*sin(4x), x) == :(-8*log(sin(x))+-2*csc(x)^2)
@test integrate((cos(x)^4+sin(x)^4)^-1*sin(2x), x) == :(-1*arctan(cos(2x)))
@test integrate((4+-3*cos(x)^2+5*sin(x)^2)^-1, x) == :(1//3*x+1//3*arctan(2*(1+2*sin(x)^2)^-1*cos(x)*sin(x)))
@test integrate((4+4*cot(x)+tan(x))^-1, x) == :(2*(10+5*tan(x))^-1+-3//25*log(2*cos(x)+sin(x))+4//25*x)
@test integrate((2*sec(x)+sin(x))^-2, x) == :((30+15*tan(x)+30*tan(x)^2)^-1*(1+4*tan(x))+-8//225*15^(1/2)*arctan((4+15^(1/2)+2*cos(x)*sin(x))^-1*(1+-2*cos(x)^2))+8//225*x*15^(1/2))
@test integrate((2*sec(x)+cos(x))^-2, x) == :((18+12*tan(x)^2)^-1*tan(x)+-1//36*6^(1/2)*arctan((2+6^(1/2)+cos(x)^2)^-1*cos(x)*sin(x))+1//36*x*6^(1/2))
@test integrate((1+3*tan(x))^-3*(5+-1*tan(x)+-6*tan(x)^2), x) == :(-29*(50+150*tan(x))^-1+-67//250*x+-28//125*log(3*sin(x)+cos(x))+-7//10*(1+3*tan(x))^-2)
@test integrate(cos(x)^2*cos(3x)^-1, x) == :((1/2)*arctanh(2*sin(x)))
@test integrate(cos(2x)^-1*sin(x), x) == :((1/2)*2^(1/2)*arctanh(2^(1/2)*cos(x)))
@test integrate(cos(2x)^-1*sin(x)^2, x) == :(-1//2*x+1//4*arctanh(2*cos(x)*sin(x)))
@test integrate(cos(3x)^-1*sin(x)^3, x) == :(-1//24*log(3+-4*cos(x)^2)+1//3*log(cos(x)))
@test integrate(sin(3x)^-1*cos(x), x) == :(-1//6*log(3+-4*sin(x)^2)+1//3*log(sin(x)))
@test integrate(sin(4x)^-1*sin(x), x) == :(-1//4*arctanh(sin(x))+1//4*2^(1/2)*arctanh(2^(1/2)*sin(x)))
@test integrate(sin(x)^3*sin(4x)^-1, x) == :(-1//4*arctanh(sin(x))+1//8*2^(1/2)*arctanh(2^(1/2)*sin(x)))
@test integrate((1+sin(2x))^(1/2), x) == :(-1*(1+sin(2x))^-1//2*cos(2x))
@test integrate((1+-1*sin(2x))^(1/2), x) == :((1+-1*sin(2x))^-1//2*cos(2x))
@test integrate((1+cos(2x))^-1//2, x) == :((1/2)*2^(1/2)*arctanh((1/2)*2^(1/2)*(1+cos(2x))^-1//2*sin(2x)))
@test integrate((1+-1*cos(2x))^-1//2, x) == :(-1//2*2^(1/2)*arctanh((1/2)*2^(1/2)*(1+-1*cos(2x))^-1//2*sin(2x)))
@test integrate((1+-1*cos(3x))^-3//2, x) == :(-1//6*(1+-1*cos(3x))^-3//2*sin(3x)+-1//12*2^(1/2)*arctanh((1/2)*2^(1/2)*(1+-1*cos(3x))^-1//2*sin(3x)))
@test integrate((1+-1*sin(2//3*x))^5//2, x) == :(3//5*(1+-1*sin(2//3*x))^3//2*cos(2//3*x)+8//5*(1+-1*sin(2//3*x))^(1/2)*cos(2//3*x)+32//5*(1+-1*sin(2//3*x))^-1//2*cos(2//3*x))
@test integrate((1+2*sin(x))^-3//2*(-1*cos(x)^2+2*(1+2*sin(x))^1//4)*cos(x), x) == :(-4*(1+2*sin(x))^-1//4+-1//2*(1+2*sin(x))^(1/2)+1//12*(1+2*sin(x))^3//2+3//4*(1+2*sin(x))^-1//2)
@test integrate(tan(x)^(1/2), x) == :((1/2)*2^(1/2)*arctan(1+2^(1/2)*tan(x)^(1/2))+-1//2*2^(1/2)*arctan(1+-1*2^(1/2)*tan(x)^(1/2))+-1//4*2^(1/2)*log(1+2^(1/2)*tan(x)^(1/2)+tan(x))+1//4*2^(1/2)*log(1+-1*2^(1/2)*tan(x)^(1/2)+tan(x)))
@test integrate((4+3*tan(2x))^-3//2, x) == :(-3//25*(4+3*tan(2x))^-1//2+-9//500*2^(1/2)*arctan((1/2)*2^(1/2)*(4+3*tan(2x))^-1//2*(1+-3*tan(2x)))+13//500*2^(1/2)*arctanh((1/2)*2^(1/2)*(4+3*tan(2x))^-1//2*(3+tan(2x))))
@test integrate((4+-3*tan(x))^-3//2*cos(x)^-2*(-1*(4+-3*tan(x))^(1/2)+3*tan(x)), x) == :(1//3*log(4+-3*tan(x))+2//3*(4+-3*tan(x))^(1/2)+8//3*(4+-3*tan(x))^-1//2)
@test integrate((-1+tan(x)^(1/2))^-2*tan(x), x) == :((1+-1*tan(x)^(1/2))^-1+(1/2)*log(cos(x))+-1//2*x+(1/2)*2^(1/2)*arctan((1/2)*2^(1/2)*tan(x)^-1//2*(1+-1*tan(x)))+(1/2)*2^(1/2)*arctanh((1/2)*2^(1/2)*tan(x)^-1//2*(1+tan(x)))+log(1+-1*tan(x)^(1/2)))
@test integrate(sin(2x)^-1//2*sin(x), x) == :(-1//2*arcsin(-1*sin(x)+cos(x))+-1//2*log(sin(2x)^(1/2)+cos(x)+sin(x)))
@test integrate(sin(2x)^-1//2*cos(x), x) == :((1/2)*log(sin(2x)^(1/2)+cos(x)+sin(x))+-1//2*arcsin(-1*sin(x)+cos(x)))
@test integrate(sin(2x)^(1/2)*sin(x), x) == :(-1//4*arcsin(-1*sin(x)+cos(x))+1//4*log(sin(2x)^(1/2)+cos(x)+sin(x))+-1//2*sin(2x)^(1/2)*cos(x))
@test integrate(sin(2x)^(1/2)*(-1*sin(x)+cos(x)), x) == :(-1//2*log(sin(2x)^(1/2)+cos(x)+sin(x))+(1/2)*sin(2x)^(1/2)*cos(x)+(1/2)*sin(2x)^(1/2)*sin(x))
@test integrate(sin(x)^7*sin(2x)^-7//2, x) == :(-1//16*arcsin(-1*sin(x)+cos(x))+1//16*log(sin(2x)^(1/2)+cos(x)+sin(x))+-1//4*sin(2x)^-1//2*sin(x)+1//5*sin(x)^5*sin(2x)^-5//2)
@test integrate(cos(x)^7*sin(2x)^-7//2, x) == :(-1//16*arcsin(-1*sin(x)+cos(x))+-1//16*log(sin(2x)^(1/2)+cos(x)+sin(x))+-1//5*cos(x)^5*sin(2x)^-5//2+1//4*sin(2x)^-1//2*cos(x))
@test integrate(sin(x)^-5*sin(2x)^3//2, x) == :(-1//5*csc(x)^5*sin(2x)^5//2)
@test integrate(cos(x)^-3*sin(2x)^-1//2, x) == :(1//5*sec(x)^3*sin(2x)^(1/2)+4//5*sin(2x)^(1/2)*sec(x))
@test integrate(sin(x)^-1*sin(2x)^-3//2, x) == :(-2//3*sin(2x)^-3//2*cos(x)+4//3*sin(2x)^-1//2*sin(x))
@test integrate((cos(x)^-14*sin(x)^2)^1//3, x) == :(3//5*(sec(x)^12*tan(x)^2)^1//3*cos(x)^3*sin(x)+3//11*(sec(x)^12*tan(x)^2)^1//3*sin(x)^3*cos(x))
@test integrate((cos(x)^11*sin(x)^13)^-1//4, x) == :(-8*(cos(x)^11*sin(x)^13)^-1//4*cos(x)^3*sin(x)^3+-4//9*(cos(x)^11*sin(x)^13)^-1//4*cos(x)^5*sin(x)+4//7*(cos(x)^11*sin(x)^13)^-1//4*sin(x)^5*cos(x))
@test integrate((cos(x)^3*sin(x))^-1//2*(-1*sin(2x)^(1/2)+cos(2x)), x) == :(-1*2^(1/2)*log(-1*2^(1/2)*(cos(x)^3*sin(x))^(1/2)*sec(x)+cos(x)+sin(x))+-1*(cos(x)^3*sin(x))^-1//2*sin(2x)+-1*(cos(x)^3*sin(x))^-1//2*sin(2x)^(1/2)*arcsin(-1*sin(x)+cos(x))*cos(x)+-1*(cos(x)^3*sin(x))^-1//2*sin(2x)^(1/2)*arctanh(sin(x))*cos(x))
@test integrate((sin(x)^2+5*cos(x)^2)^5//2*cos(x), x) == :(625//32*arcsin(2//5*5^(1/2)*sin(x))+1//6*(5+-4*sin(x)^2)^5//2*sin(x)+25//24*(5+-4*sin(x)^2)^3//2*sin(x)+125//16*(5+-4*sin(x)^2)^(1/2)*sin(x))
@test integrate((-1*cos(x)^2+-5*sin(x)^2)^3//2*cos(x), x) == :(3//16*arctan(2*(-1+-4*sin(x)^2)^-1//2*sin(x))+-3//8*(-1+-4*sin(x)^2)^(1/2)*sin(x)+1//4*(-1+-4*sin(x)^2)^3//2*sin(x))
@test integrate((-2*sin(x)^2+5*cos(x)^2)^-7//2*sin(x), x) == :(-1//15*(-2+7*cos(x)^2)^-3//2*cos(x)+1//10*(-2+7*cos(x)^2)^-5//2*cos(x)+1//15*(-2+7*cos(x)^2)^-1//2*cos(x))
@test integrate((2+-5*sin(x)^2)^-3//2*cos(x)*cos(2x), x) == :(1//10*(2+-5*sin(x)^2)^-1//2*sin(x)+2//25*5^(1/2)*arcsin((1/2)*10^(1/2)*sin(x)))
@test integrate((5*cos(x)^2+9*sin(x)^2)^-5//2*sin(5x), x) == :(-1//2*arcsin(2//3*cos(x))+-55//27*(9+-4*cos(x)^2)^-3//2*cos(x)+295//243*(9+-4*cos(x)^2)^-1//2*cos(x))
@test integrate((-5+4*sin(x)^2)^-5//2*cos(x)*cos(2x)*sin(3x), x) == :(-5//8*(-5+4*sin(x)^2)^-1//2+-1//4*(-5+4*sin(x)^2)^-3//2+1//8*(-5+4*sin(x)^2)^(1/2))
@test integrate((2+-3*sin(x)^2)^3//5*sin(4x), x) == :(-20//117*(2+-3*sin(x)^2)^13//5+5//36*(2+-3*sin(x)^2)^8//5)
@test integrate(cos(2x)^(1/2)*cos(x), x) == :((1/2)*cos(2x)^(1/2)*sin(x)+1//4*2^(1/2)*arcsin(2^(1/2)*sin(x)))
@test integrate(cos(2x)^3//2*sin(x), x) == :(-3//16*2^(1/2)*arctanh(2^(1/2)*cos(2x)^-1//2*cos(x))+-1//4*cos(2x)^3//2*cos(x)+3//8*cos(2x)^(1/2)*cos(x))
@test integrate(cos(2x)^-5//2*sin(x), x) == :(-1//3*cos(2x)^-3//2*cos(3x))
@test integrate(cos(x)^-3*cos(2x)^3//2, x) == :(-5//2*arctan(cos(2x)^-1//2*sin(x))+2*2^(1/2)*arcsin(2^(1/2)*sin(x))+-1//2*cos(2x)^(1/2)*sec(x)*tan(x))
@test integrate((4+-5*sec(x)^2)^3//2, x) == :(8*arctan(2*(-1+-5*tan(x)^2)^-1//2*tan(x))+-7//2*5^(1/2)*arctan(5^(1/2)*(-1+-5*tan(x)^2)^-1//2*tan(x))+-5//2*(-1+-5*tan(x)^2)^(1/2)*tan(x))
@test integrate((4+-5*sec(x)^2)^-3//2, x) == :(1//8*arctan(2*(-1+-5*tan(x)^2)^-1//2*tan(x))+-5//4*(-1+-5*tan(x)^2)^-1//2*tan(x))
@test integrate((4+-1*cot(x)^2)^-1//2*cos(x)^-4*(-3+cos(2x)), x) == :(-2//3*(4+-1*cot(x)^2)^(1/2)*tan(x)+-1//3*(4+-1*cot(x)^2)^(1/2)*tan(x)^3)
@test integrate((-2+cos(x)^2)^-1*(5+-4*sec(x)^2)^-3//2*tan(x)^3*(3+sin(x)^2), x) == :(-2//15*(5+-4*sec(x)^2)^-1//2+-1//18*3^(1/2)*arctanh(1//3*3^(1/2)*(5+-4*sec(x)^2)^(1/2))+-1//25*5^(1/2)*arctanh(1//5*5^(1/2)*(5+-4*sec(x)^2)^(1/2)))
@test integrate((4*sec(x)^2+5*tan(x)^2)^-3//2*sin(x)^-2*(sec(x)^2+-3*(4*sec(x)^2+5*tan(x)^2)^(1/2)*tan(x)), x) == :(-3//4*log(tan(x))+3//8*log(4+9*tan(x)^2)+-7//8*(4+9*tan(x)^2)^-1//2*tan(x)+-1//4*(4+9*tan(x)^2)^-1//2*cot(x))
@test integrate((1+5*tan(x)^2)^5//2*tan(x), x) == :(-32*arctan((1/2)*(1+5*tan(x)^2)^(1/2))+16*(1+5*tan(x)^2)^(1/2)+-4//3*(1+5*tan(x)^2)^3//2+1//5*(1+5*tan(x)^2)^5//2)
@test integrate((1+5*tan(x)^2)^-5//2*tan(x), x) == :(-1//12*(1+5*tan(x)^2)^-3//2+1//16*(1+5*tan(x)^2)^-1//2+1//32*arctan((1/2)*(1+5*tan(x)^2)^(1/2)))
@test integrate((a^3+b^3*tan(x)^2)^-1//3*tan(x), x) == :((1/2)*(a^3+-1*b^3)^-1//3*log(cos(x))+3//4*(a^3+-1*b^3)^-1//3*log((a^3+-1*b^3)^1//3+-1*(a^3+b^3*tan(x)^2)^1//3)+(1/2)*3^(1/2)*(a^3+-1*b^3)^-1//3*arctan(1//3*3^(1/2)*(1+2*(a^3+-1*b^3)^-1//3*(a^3+b^3*tan(x)^2)^1//3)))
@test integrate((1+-7*tan(x)^2)^2//3*tan(x), x) == :(2*log(cos(x))+3*log(2+-1*(1+-7*tan(x)^2)^1//3)+3//4*(1+-7*tan(x)^2)^2//3+2*3^(1/2)*arctan(1//3*3^(1/2)*(1+(1+-7*tan(x)^2)^1//3)))
@test integrate((a^4+b^4*csc(x)^2)^-1//4*cot(x), x) == :(a^-1*arctanh(a^-1*(a^4+b^4*csc(x)^2)^1//4)+-1*a^-1*arctan(a^-1*(a^4+b^4*csc(x)^2)^1//4))
@test integrate((a^4+-1*b^4*csc(x)^2)^-1//4*cot(x), x) == :(a^-1*arctanh(a^-1*(a^4+-1*b^4*csc(x)^2)^1//4)+-1*a^-1*arctan(a^-1*(a^4+-1*b^4*csc(x)^2)^1//4))
@test integrate((tan(x)*tan(2x))^-3//2*cos(x)^-2*(-1*cos(2x)+2*tan(x)^2), x) == :(2*arctanh((tan(x)*tan(2x))^-1//2*tan(x))+(1/2)*(tan(x)*tan(2x))^-3//2*tan(x)+-11//8*2^(1/2)*arctanh(2^(1/2)*(tan(x)*tan(2x))^-1//2*tan(x))+2//3*(tan(x)*tan(2x))^-3//2*tan(x)^3+3//4*(tan(x)*tan(2x))^-1//2*tan(x))
@test integrate((a^3+-1*b^3*cos(x)^n)^-4//3*tan(x), x) == :((1/2)*a^-4*log(cos(x))+-3*a^-3*n^-1*(a^3+-1*b^3*cos(x)^n)^-1//3+-3//2*a^-4*n^-1*log(a+-1*(a^3+-1*b^3*cos(x)^n)^1//3)+-1*3^(1/2)*a^-4*n^-1*arctan(1//3*3^(1/2)*a^-1*(a+2*(a^3+-1*b^3*cos(x)^n)^1//3)))
@test integrate((2+-5*sin(x)^3)^-4//3*sin(x)^9*cot(x), x) == :(-1//625*(2+-5*sin(x)^3)^5//3+2//125*(2+-5*sin(x)^3)^2//3+4//125*(2+-5*sin(x)^3)^-1//3)
@test integrate((1+-8*tan(x)^2)^-2//3*cos(x)^-2*(1+(1+-8*tan(x)^2)^1//3)*tan(x), x) == :(-3//32*(1+(1+-8*tan(x)^2)^1//3)^2)
@test integrate(cos(x)^4*cos(2x)^2//3*tan(x), x) == :(-3//40*cos(2x)^5//3+-3//64*cos(2x)^8//3)
@test integrate(cos(2x)^-3//4*sin(x)^6*tan(x), x) == :(-1//5*cos(2x)^5//4+1//36*cos(2x)^9//4+7//4*cos(2x)^1//4+(1/2)*2^(1/2)*arctan((1/2)*2^(1/2)*cos(2x)^-1//4*(1+-1*cos(2x)^(1/2)))+-1//2*2^(1/2)*arctanh((1/2)*2^(1/2)*cos(2x)^-1//4*(1+cos(2x)^(1/2))))
@test integrate((cot(x)^-1*cot(2x))^(1/2), x) == :(-1//2*2^(1/2)*arcsin(tan(x))+arctan(2^(1/2)*(1+-1*tan(x)^2)^-1//2*tan(x)))
@test integrate(x^-5*(5+x^2)^-1, x) == :(-1//20*x^-4+-1//250*log(5+x^2)+1//50*x^-2+1//125*log(x))
@test integrate(x^-6*(5+x^2)^-1, x) == :(-1//25*x^-5+-1//125*x^-1+1//75*x^-3+-1//625*5^(1/2)*arctan(1//5*x*5^(1/2)))
@test integrate(x^-1*(-4+x^2)^-4, x) == :((512+-128*x^2)^-1+-1//512*log(4+-1*x^2)+1//24*(4+-1*x^2)^-3+1//64*(4+-1*x^2)^-2+1//256*log(x))
@test integrate(x^-1*(-2+x^2)^-5//2, x) == :(-1//6*(-2+x^2)^-3//2+1//4*(-2+x^2)^-1//2+1//8*2^(1/2)*arctan((1/2)*2^(1/2)*(-2+x^2)^(1/2)))
@test integrate(x^-1*(-10+x^2)^5//2, x) == :(100*(-10+x^2)^(1/2)+-10//3*(-10+x^2)^3//2+1//5*(-10+x^2)^5//2+-100*10^(1/2)*arctan(1//10*10^(1/2)*(-10+x^2)^(1/2)))
@test integrate(x^(1+2n), x) == :(x^(2+2n)*(2+2n)^-1)
@test integrate(x^7*(-5+x^2)^-3, x) == :((1/2)*x^2+75*(10+-2*x^2)^-1+-125//4*(5+-1*x^2)^-2+15//2*log(5+-1*x^2))
@test integrate((-1+x^2)^-5*(-4*x^3+3*x^5), x) == :(-3//4*(1+-1*x^2)^-2+1//3*(1+-1*x^2)^-3+1//8*(1+-1*x^2)^-4)
@test integrate(x^3*(1+x^2)^9//14, x) == :(-7//23*(1+x^2)^23//14+7//37*(1+x^2)^37//14)
@test integrate(x^5*(-4+x^2)^-13//6, x) == :(-24*(-4+x^2)^-1//6+-48//7*(-4+x^2)^-7//6+3//5*(-4+x^2)^5//6)
@test integrate((1+2*x^2)^-5//2, x) == :(1//3*x*(1+2*x^2)^-3//2+2//3*x*(1+2*x^2)^-1//2)
@test integrate((-1+x^2+-2x)^-5//2, x) == :(-1//6*(-1+x^2+-2x)^-1//2*(1+-1x)+1//6*(-1+x^2+-2x)^-3//2*(1+-1x))
@test integrate(x^-4*(-8+x^2)^-3//2, x) == :(-1//192*x*(-8+x^2)^-1//2+1//24*x^-3*(-8+x^2)^-1//2+1//48*x^-1*(-8+x^2)^-1//2)
@test integrate(x^-13//3*(5+x^2)^2, x) == :(-15//2*x^-10//3+-15//2*x^-4//3+3//2*x^2//3)
@test integrate(x^-7*(1+x^2)^-3, x) == :(-10*log(x)+-3*x^-2+-2*(1+x^2)^-1+5*log(1+x^2)+-1//4*(1+x^2)^-2+-1//6*x^-6+3//4*x^-4)
@test integrate((x^-2*(2+x^2))^7//9*(2+x^2)^-3//2, x) == :(-9//10*x*(1+2*x^-2)^7//9*(2+x^2)^-1//2)
@test integrate(x^2*(3+-1*x^2)^-3//2, x) == :(-1*arcsin(1//3*x*3^(1/2))+x*(3+-1*x^2)^-1//2)
@test integrate(x^-4*(25+-1*x^2)^3//2, x) == :(x^-1*(25+-1*x^2)^(1/2)+-1//3*x^-3*(25+-1*x^2)^3//2+arcsin(1//5*x))
@test integrate((1+-2*x^2)^-7//2, x) == :(1//5*x*(1+-2*x^2)^-5//2+4//15*x*(1+-2*x^2)^-3//2+8//15*x*(1+-2*x^2)^-1//2)
@test integrate((-7+-1*x^2+6x)^-5//2, x) == :(-1//6*(-7+-1*x^2+6x)^-3//2*(3+-1x)+-1//6*(-7+-1*x^2+6x)^-1//2*(3+-1x))
@test integrate((1+-2x+-2*x^2)^3, x) == :(x+-4*x^6+-3*x^2+2*x^3+4*x^4+-12//5*x^5+-8//7*x^7)
@test integrate((-1+x^2+-1x)^2*(-1+5x), x) == :(-1x+-11//5*x^5+-3//4*x^4+3//2*x^2+5//6*x^6+11//3*x^3)
@test integrate((1+-8x+2*x^2)^-5//2*(1+3x), x) == :(-1//21*(1+-8x+2*x^2)^-1//2*(4+-2x)+1//6*(1+-8x+2*x^2)^-3//2*(1+-2x))
@test integrate((1+-4*x^2+2x)^-5//2*(-1+-8x+8*x^3), x) == :(-1//15*(1+-4*x^2+2x)^-3//2*(4+4x)+-1//75*(1+-4*x^2+2x)^-1//2*(7+122x))
@test integrate(x^2*cos(x)^5, x) == :(-298//225*sin(x)+-2//125*sin(x)^5+76//675*sin(x)^3+2//25*x*cos(x)^5+8//15*x^2*sin(x)+8//45*x*cos(x)^3+16//15*x*cos(x)+1//5*x^2*cos(x)^4*sin(x)+4//15*x^2*cos(x)^2*sin(x))
@test integrate(x^3*sin(x)^3, x) == :(-40//9*sin(x)+-2//27*sin(x)^3+2*x^2*sin(x)+-2//3*x^3*cos(x)+1//3*x^2*sin(x)^3+40//9*x*cos(x)+-1//3*x^3*sin(x)^2*cos(x)+2//9*x*sin(x)^2*cos(x))
@test integrate(x^2*sin(x)^6, x) == :(-245//1152*x+5//48*x^3+1//18*x*sin(x)^6+1//108*sin(x)^5*cos(x)+5//16*x*sin(x)^2+5//48*x*sin(x)^4+65//1728*sin(x)^3*cos(x)+245//1152*cos(x)*sin(x)+-5//16*x^2*cos(x)*sin(x)+-5//24*x^2*sin(x)^3*cos(x)+-1//6*x^2*sin(x)^5*cos(x))
@test integrate(x^2*sin(x)^2*cos(x), x) == :(-4//9*sin(x)+-2//27*sin(x)^3+1//3*x^2*sin(x)^3+4//9*x*cos(x)+2//9*x*sin(x)^2*cos(x))
@test integrate(x*cos(x)^4*sin(x)^-2, x) == :(-3//4*x^2+-1//4*cos(x)^2+-1*x*cot(x)+-1//2*x*cos(x)*sin(x)+log(sin(x)))
@test integrate(x*cos(x)^-4*sin(x)^3, x) == :(5//6*arctanh(sin(x))+-1*x*sec(x)+-1//6*sec(x)*tan(x)+1//3*x*sec(x)^3)
@test integrate(x*cos(x)^-3*sin(x), x) == :(-1//2*tan(x)+(1/2)*x*sec(x)^2)
@test integrate(x*cos(x)^-1*sin(x)^3, x) == :(1//4*x+(1/2)*im*x^2+(1/2)*im*Polylogarithms.polylog(2,-1*exp(2*im*x))+-1*x*log(1+exp(2*im*x))+-1//2*x*sin(x)^2+-1//4*cos(x)*sin(x))
@test integrate(x*cos(x)^-3*sin(x)^3, x) == :((1/2)*x+-1//2*tan(x)+x*log(1+exp(2*im*x))+(1/2)*x*tan(x)^2+-1//2*im*x^2+-1//2*im*Polylogarithms.polylog(2,-1*exp(2*im*x)))
@test integrate((x*sin(x)+cos(x))^-2*(2x+sin(2x)), x) == :(2*(1+x^-1*cot(x))^-1)
@test integrate(x^2*(-1*sin(x)+x*cos(x))^-2, x) == :(-1*cot(x)+x*(-1*sin(x)+x*cos(x))^-1*csc(x))
@test integrate(a^(m*x)*b^(n*x), x) == :(a^(m*x)*b^(n*x)*(m*log(a)+n*log(b))^-1)
@test integrate(-1*exp(-1x)+exp(x), x) == :(exp(x)+exp(-1x))
@test integrate((-1*exp(-1x)+exp(x))^2, x) == :((1/2)*exp(2x)+-2x+-1//2*exp(-2x))
@test integrate((-1*exp(-1x)+exp(x))^3, x) == :(-3*exp(x)+-3*exp(-1x)+1//3*exp(-3x)+1//3*exp(3x))
@test integrate((-1*exp(-1x)+exp(x))^4, x) == :(-2*exp(2x)+2*exp(-2x)+6x+-1//4*exp(-4x)+1//4*exp(4x))
@test integrate((a^(-4x)+-1*a^(2x))^3, x) == :(3x+(1/2)*a^(-6x)*log(a)^-1+-1//6*a^(6x)*log(a)^-1+-1//12*a^(-12x)*log(a)^-1)
@test integrate(a^(k*x)+a^(l*x), x) == :(a^(k*x)*k^-1*log(a)^-1+a^(l*x)*l^-1*log(a)^-1)
@test integrate((a^(k*x)+a^(l*x))^2, x) == :((1/2)*a^(2*k*x)*k^-1*log(a)^-1+(1/2)*a^(2*l*x)*l^-1*log(a)^-1+2*a^(x*(k+l))*(k+l)^-1*log(a)^-1)
@test integrate((a^(k*x)+a^(l*x))^3, x) == :(3*a^(x*(k+2l))*(k+2l)^-1*log(a)^-1+3*a^(x*(l+2k))*(l+2k)^-1*log(a)^-1+1//3*a^(3*k*x)*k^-1*log(a)^-1+1//3*a^(3*l*x)*l^-1*log(a)^-1)
@test integrate((a^(k*x)+a^(l*x))^4, x) == :(3*a^(x*(2k+2l))*(k+l)^-1*log(a)^-1+4*a^(x*(k+3l))*(k+3l)^-1*log(a)^-1+4*a^(x*(l+3k))*(l+3k)^-1*log(a)^-1+1//4*a^(4*k*x)*k^-1*log(a)^-1+1//4*a^(4*l*x)*l^-1*log(a)^-1)
@test integrate(a^(k*x)+-1*a^(l*x), x) == :(a^(k*x)*k^-1*log(a)^-1+-1*a^(l*x)*l^-1*log(a)^-1)
@test integrate((a^(k*x)+-1*a^(l*x))^2, x) == :((1/2)*a^(2*k*x)*k^-1*log(a)^-1+(1/2)*a^(2*l*x)*l^-1*log(a)^-1+-2*a^(x*(k+l))*(k+l)^-1*log(a)^-1)
@test integrate((a^(k*x)+-1*a^(l*x))^3, x) == :(-3*a^(x*(l+2k))*(l+2k)^-1*log(a)^-1+3*a^(x*(k+2l))*(k+2l)^-1*log(a)^-1+-1//3*a^(3*l*x)*l^-1*log(a)^-1+1//3*a^(3*k*x)*k^-1*log(a)^-1)
@test integrate((a^(k*x)+-1*a^(l*x))^4, x) == :(-4*a^(x*(k+3l))*(k+3l)^-1*log(a)^-1+-4*a^(x*(l+3k))*(l+3k)^-1*log(a)^-1+3*a^(x*(2k+2l))*(k+l)^-1*log(a)^-1+1//4*a^(4*k*x)*k^-1*log(a)^-1+1//4*a^(4*l*x)*l^-1*log(a)^-1)
@test integrate(1+a^(m*x), x) == :(x+a^(m*x)*m^-1*log(a)^-1)
@test integrate((1+a^(m*x))^2, x) == :(x+(1/2)*a^(2*m*x)*m^-1*log(a)^-1+2*a^(m*x)*m^-1*log(a)^-1)
@test integrate((1+a^(m*x))^3, x) == :(x+3*a^(m*x)*m^-1*log(a)^-1+1//3*a^(3*m*x)*m^-1*log(a)^-1+3//2*a^(2*m*x)*m^-1*log(a)^-1)
@test integrate((1+a^(m*x))^4, x) == :(x+3*a^(2*m*x)*m^-1*log(a)^-1+4*a^(m*x)*m^-1*log(a)^-1+1//4*a^(4*m*x)*m^-1*log(a)^-1+4//3*a^(3*m*x)*m^-1*log(a)^-1)
@test integrate(1+-1*a^(m*x), x) == :(x+-1*a^(m*x)*m^-1*log(a)^-1)
@test integrate((1+-1*a^(m*x))^2, x) == :(x+(1/2)*a^(2*m*x)*m^-1*log(a)^-1+-2*a^(m*x)*m^-1*log(a)^-1)
@test integrate((1+-1*a^(m*x))^3, x) == :(x+-3*a^(m*x)*m^-1*log(a)^-1+-1//3*a^(3*m*x)*m^-1*log(a)^-1+3//2*a^(2*m*x)*m^-1*log(a)^-1)
@test integrate((1+-1*a^(m*x))^4, x) == :(x+-4*a^(m*x)*m^-1*log(a)^-1+3*a^(2*m*x)*m^-1*log(a)^-1+-4//3*a^(3*m*x)*m^-1*log(a)^-1+1//4*a^(4*m*x)*m^-1*log(a)^-1)
@test integrate((b+a*exp(n*x))^-1, x) == :(x*b^-1+-1*b^-1*n^-1*log(b+a*exp(n*x)))
@test integrate((1+exp(x))^-1*(-1+exp(x)), x) == :(-1x+2*log(1+exp(x)))
@test integrate((1+-2*exp(2x)+3*exp(4x))^-1*exp(4x), x) == :(1//12*log(1+-2*exp(2x)+3*exp(4x))+-1//12*2^(1/2)*arctan((1/2)*2^(1/2)*(1+-3*exp(2x))))
@test integrate((-1+-1*exp(2x)+exp(x)+exp(3x))^-1*(exp(x)+exp(5x)), x) == :((1/2)*exp(2x)+-1*arctan(exp(x))+-1//2*log(1+exp(2x))+exp(x)+log(1+-1*exp(x)))
@test integrate((a+b*exp(n*x))^(r*s^-1)*exp(n*x), x) == :(s*b^-1*n^-1*(a+b*exp(n*x))^(s^-1*(r+s))*(r+s)^-1)
@test integrate((1+-2*exp(1//3*x))^1//4, x) == :(-6*arctan((1+-2*exp(1//3*x))^1//4)+-6*arctanh((1+-2*exp(1//3*x))^1//4)+12*(1+-2*exp(1//3*x))^1//4)
@test integrate((a^2+exp(2x))^-1//2*exp(x), x) == :(arctanh((a^2+exp(2x))^-1//2*exp(x)))
@test integrate((-1*a^2+exp(2x))^-1//2*exp(x), x) == :(arctanh((-1*a^2+exp(2x))^-1//2*exp(x)))
@test integrate((-2+exp(3//4*x))^-1*(-2+exp(3//2*x)+exp(3//4*x))^-1//2*exp(3//4*x), x) == :(2//3*arctanh(1//4*(-2+exp(3//2*x)+exp(3//4*x))^-1//2*(2+-5*exp(3//4*x))))
@test integrate((3+-1*exp((1/2)*x))^-3//4*exp(2x), x) == :(-216*(3+-1*exp((1/2)*x))^1//4+-8*(3+-1*exp((1/2)*x))^9//4+8//13*(3+-1*exp((1/2)*x))^13//4+216//5*(3+-1*exp((1/2)*x))^5//4)
@test integrate(x^3*exp(-1//2*x), x) == :(-96*exp(-1//2*x)+-48*x*exp(-1//2*x)+-12*x^2*exp(-1//2*x)+-2*x^3*exp(-1//2*x))
@test integrate(x^-3*exp(-1//2*x), x) == :(1//8*expintegralei(-1//2*x)+-1//2*x^-2*exp(-1//2*x)+1//4*x^-1*exp(-1//2*x))
@test integrate(a^(3x)*x^2, x) == :(2//27*a^(3x)*log(a)^-3+-2//9*x*a^(3x)*log(a)^-2+1//3*a^(3x)*x^2*log(a)^-1)
@test integrate(x*(1+x^2)*exp(x^2), x) == :((1/2)*x^2*exp(x^2))
@test integrate(x*(exp(x)+exp(-1x))^-2, x) == :((1/2)*x+-1//4*log(1+exp(2x))+-1*x*(2+2*exp(2x))^-1)
@test integrate((1+-1*x^2)^-1//2*(1+-1x+-1*x^2)*exp(x), x) == :((1+-1*x^2)^(1/2)*exp(x))
@test integrate(cos(2x)*exp(-3x), x) == :(-3//13*cos(2x)*exp(-3x)+2//13*exp(-3x)*sin(2x))
@test integrate(exp(x)^-1//3*(cos((1/2)*x)+sin((1/2)*x)), x) == :(-30//13*exp(x)^-1//3*cos((1/2)*x)+6//13*exp(x)^-1//3*sin((1/2)*x))
@test integrate((3^(3x))^-1//4*cos(3//2*x), x) == :(8//3*(3^(3x))^-1//4*(4+log(3)^2)^-1*sin(3//2*x)+-4//3*(3^(3x))^-1//4*(4+log(3)^2)^-1*cos(3//2*x)*log(3))
@test integrate(cos(x)^2*exp(m*x), x) == :(2*m^-1*(4+m^2)^-1*exp(m*x)+m*(4+m^2)^-1*cos(x)^2*exp(m*x)+2*(4+m^2)^-1*cos(x)*exp(m*x)*sin(x))
@test integrate(sin(x)^3*exp(m*x), x) == :(-6*(9+m^4+10*m^2)^-1*cos(x)*exp(m*x)+m*(9+m^2)^-1*sin(x)^3*exp(m*x)+-3*(9+m^2)^-1*sin(x)^2*cos(x)*exp(m*x)+6*m*(9+m^4+10*m^2)^-1*exp(m*x)*sin(x))
@test integrate(cos(1//3*x)^3*exp(x)^-1//2, x) == :(-48//65*exp(x)^-1//2*cos(1//3*x)+-2//5*cos(1//3*x)^3*exp(x)^-1//2+32//65*exp(x)^-1//2*sin(1//3*x)+4//5*cos(1//3*x)^2*exp(x)^-1//2*sin(1//3*x))
@test integrate(cos(x)^2*sin(x)^2*exp(2x), x) == :(1//16*exp(2x)+-1//40*exp(2x)*sin(4x)+-1//80*cos(4x)*exp(2x))
@test integrate(cos(3//2*x)^2*sin(3//2*x)^2*exp(3x), x) == :(1//24*exp(3x)+-1//60*exp(3x)*sin(6x)+-1//120*cos(6x)*exp(3x))
@test integrate((1+-1*cos(x))^-1*(1+-1*sin(x))*exp(x), x) == :(-1*(1+-1*cos(x))^-1*exp(x)*sin(x))
@test integrate((1+cos(x))^-1*(1+sin(x))*exp(x), x) == :((1+cos(x))^-1*exp(x)*sin(x))
@test integrate((1+-1*sin(x))^-1*(1+cos(x))*exp(x), x) == :((1+-1*sin(x))^-1*cos(x)*exp(x))
@test integrate((1+sin(x))^-1*(1+-1*cos(x))*exp(x), x) == :(-1*(1+sin(x))^-1*cos(x)*exp(x))
@test integrate(x*cos(x)*exp(x), x) == :(-1//2*exp(x)*sin(x)+(1/2)*x*cos(x)*exp(x)+(1/2)*x*exp(x)*sin(x))
@test integrate(x^2*exp(x)*sin(x), x) == :(-1//2*cos(x)*exp(x)+-1//2*exp(x)*sin(x)+x*cos(x)*exp(x)+(1/2)*x^2*exp(x)*sin(x)+-1//2*x^2*cos(x)*exp(x))
@test integrate(x^2*exp(-3x)*sin(x), x) == :(-13//250*cos(x)*exp(-3x)+-9//250*exp(-3x)*sin(x)+-4//25*x*exp(-3x)*sin(x)+-3//10*x^2*exp(-3x)*sin(x)+-3//25*x*cos(x)*exp(-3x)+-1//10*x^2*cos(x)*exp(-3x))
@test integrate(x^2*cos(x)^3*exp((1/2)*x), x) == :(-792//50653*exp((1/2)*x)*sin(3x)+-428//50653*cos(3x)*exp((1/2)*x)+-132//125*cos(x)*exp((1/2)*x)+-24//125*exp((1/2)*x)*sin(x)+-24//25*x*exp((1/2)*x)*sin(x)+-24//1369*x*exp((1/2)*x)*sin(3x)+2//37*x^2*cos(x)^3*exp((1/2)*x)+18//25*x*cos(x)*exp((1/2)*x)+48//185*x^2*cos(x)*exp((1/2)*x)+70//1369*x*cos(3x)*exp((1/2)*x)+96//185*x^2*exp((1/2)*x)*sin(x)+12//37*x^2*cos(x)^2*exp((1/2)*x)*sin(x))
@test integrate(x^2*exp(2x)*sin(4x), x) == :(-11//500*exp(2x)*sin(4x)+1//250*cos(4x)*exp(2x)+-1//5*x^2*cos(4x)*exp(2x)+1//10*x^2*exp(2x)*sin(4x)+2//25*x*cos(4x)*exp(2x)+3//50*x*exp(2x)*sin(4x))
@test integrate(x^2*sin(x)^2*cos(x)*exp((1/2)*x), x) == :(-44//125*cos(x)*exp((1/2)*x)+-8//125*exp((1/2)*x)*sin(x)+428//50653*cos(3x)*exp((1/2)*x)+792//50653*exp((1/2)*x)*sin(3x)+-70//1369*x*cos(3x)*exp((1/2)*x)+-8//25*x*exp((1/2)*x)*sin(x)+-3//37*x^2*exp((1/2)*x)*sin(3x)+-1//74*x^2*cos(3x)*exp((1/2)*x)+1//5*x^2*exp((1/2)*x)*sin(x)+1//10*x^2*cos(x)*exp((1/2)*x)+6//25*x*cos(x)*exp((1/2)*x)+24//1369*x*exp((1/2)*x)*sin(3x))
@test integrate(cosh(x), x) == :(sinh(x))
@test integrate(sinh(x), x) == :(cosh(x))
@test integrate(tanh(x), x) == :(log(cosh(x)))
@test integrate(coth(x), x) == :(log(sinh(x)))
@test integrate(sech(x), x) == :(arctan(sinh(x)))
@test integrate(csch(x), x) == :(-1*arctanh(cosh(x)))
@test integrate(cosh(x)^2, x) == :((1/2)*x+(1/2)*cosh(x)*sinh(x))
@test integrate(sinh(x)^5, x) == :(-2//3*cosh(x)^3+1//5*cosh(x)^5+cosh(x))
@test integrate(tanh(x)^4, x) == :(x+-1*tanh(x)+-1//3*tanh(x)^3)
@test integrate(csch(x)^3, x) == :((1/2)*arctanh(cosh(x))+-1//2*coth(x)*csch(x))
@test integrate(cosh(x)^-5, x) == :(3//8*arctan(sinh(x))+1//4*sech(x)^3*tanh(x)+3//8*sech(x)*tanh(x))
@test integrate(sech(x)^-4*tanh(x)^5, x) == :(-1*cosh(x)^2+1//4*cosh(x)^4+log(cosh(x)))
@test integrate(sech(x)^3//4*tanh(x)^5, x) == :(-4//3*sech(x)^3//4+-4//19*sech(x)^19//4+8//11*sech(x)^11//4)
@test integrate((1+cosh(x))^-2, x) == :((3+3*cosh(x))^-1*sinh(x)+1//3*(1+cosh(x))^-2*sinh(x))
@test integrate((a+b*tanh(x))^-1, x) == :(a*x*(a^2+-1*b^2)^-1+-1*b*(a^2+-1*b^2)^-1*log(a*cosh(x)+b*sinh(x)))
@test integrate((a^2+b^2*cosh(x)^2)^-1, x) == :(a^-1*(a^2+b^2)^-1//2*arctanh(a*(a^2+b^2)^-1//2*tanh(x)))
@test integrate((a^2+-1*b^2*cosh(x)^2)^-1, x) == :(a^-1*(a^2+-1*b^2)^-1//2*arctanh(a*(a^2+-1*b^2)^-1//2*tanh(x)))
@test integrate((1+-1*sinh(x)^4)^-1, x) == :((1/2)*tanh(x)+1//4*2^(1/2)*arctanh(2^(1/2)*tanh(x)))
@test integrate((cosh(x)^3+sinh(x)^3)^-1*(cosh(x)^3+-1*sinh(x)^3), x) == :(-1*(3+3*tanh(x))^-1+-4//9*3^(1/2)*arctan(1//3*3^(1/2)*(1+-2*tanh(x))))
@test integrate(cosh(x)*cosh(2x)*cosh(3x), x) == :(1//4*x+1//8*sinh(2x)+1//16*sinh(4x)+1//24*sinh(6x))
@test integrate(cosh(3//2*x)*sinh(x)*sinh(5//2*x), x) == :(-1//4*x+-1//12*sinh(3x)+1//8*sinh(2x)+1//20*sinh(5x))
@test integrate((-9+4*cosh(x)^2)^-5//2*sinh(x), x) == :(-1//27*(-9+4*cosh(x)^2)^-3//2*cosh(x)+2//243*(-9+4*cosh(x)^2)^-1//2*cosh(x))
@test integrate((1+-1*sinh(x)^2)^-3//2*sinh(x)^2*sinh(2x), x) == :(2*(1+-1*sinh(x)^2)^(1/2)+2*(1+-1*sinh(x)^2)^-1//2)
@test integrate(cosh(2x)^-1//2*cosh(x), x) == :((1/2)*2^(1/2)*arcsinh(2^(1/2)*sinh(x)))
@test integrate(x*tanh(x)^2, x) == :((1/2)*x^2+-1*x*tanh(x)+log(cosh(x)))
@test integrate(x*coth(x)^2, x) == :((1/2)*x^2+-1*x*coth(x)+log(sinh(x)))
@test integrate((-1*sinh(x)+cosh(x))^-1*(x+cosh(x)+sinh(x)), x) == :((1/2)*exp(2x)+-1*exp(x)+x*exp(x))
@test integrate((1+cosh(x))^-1*(x+cosh(x)+sinh(x)), x) == :(x+-1*(1+-1x)*tanh((1/2)*x))
@test integrate(sinh(x)^-4*exp(2x), x) == :(8//3*(1+-1*exp(2x))^-3*exp(6x))
@test integrate(cosh(x)^-4*exp(-2x), x) == :(-8//3*(1+exp(2x))^-3)
@test integrate((-1*sinh(x)+cosh(x))^-1*exp(x), x) == :((1/2)*exp(2x))
@test integrate((cosh(x)+sinh(x))^-1*exp(x), x) == :(x)
@test integrate((1+-1*cosh(x))^-1*exp(x), x) == :(-2*(1+-1*exp(x))^-1+-2*log(1+-1*exp(x)))
@test integrate((1+cosh(x))^-1*(1+sinh(x))*exp(x), x) == :(2*(1+exp(x))^-1+exp(x))
@test integrate((1+-1*cosh(x))^-1*(1+-1*sinh(x))*exp(x), x) == :(-2*(1+-1*exp(x))^-1+exp(x))
@test integrate(x^m*log(x), x) == :(-1*x^(1+m)*(1+m)^-2+x^(1+m)*(1+m)^-1*log(x))
@test integrate(x^m*log(x)^2, x) == :(2*x^(1+m)*(1+m)^-3+x^(1+m)*(1+m)^-1*log(x)^2+-2*x^(1+m)*(1+m)^-2*log(x))
@test integrate(x^-5//2*log(x)^2, x) == :(-16//27*x^-3//2+-8//9*x^-3//2*log(x)+-2//3*x^-3//2*log(x)^2)
@test integrate((a+b*x)*log(x), x) == :(-1*a*x+-1//4*b*x^2+a*x*log(x)+(1/2)*b*x^2*log(x))
@test integrate((a+b*x)^3*log(x), x) == :(-1*x*a^3+-1//16*b^3*x^4+-3//4*b*a^2*x^2+-1//3*a*b^2*x^3+-1//4*a^4*b^-1*log(x)+1//4*b^-1*(a+b*x)^4*log(x))
@test integrate(-1+-8*log(x)^2+3*log(x)^3, x) == :(-35x+-17*x*log(x)^2+3*x*log(x)^3+34*x*log(x))
@test integrate((1+x^4)*(1+log(x)^3+-2*log(x)), x) == :(-3x+169//625*x^5+x*log(x)^3+-3*x*log(x)^2+4*x*log(x)+-44//125*x^5*log(x)+-3//25*x^5*log(x)^2+1//5*x^5*log(x)^3)
@test integrate(x^-3*log(x)^-4, x) == :(-4//3*expintegralei(-2*log(x))+-2//3*x^-2*log(x)^-1+-1//3*x^-2*log(x)^-3+1//3*x^-2*log(x)^-2)
@test integrate((a+b*x)^-1*log(x), x) == :(b^-1*Polylogarithms.polylog(2,-1*b*x*a^-1)+b^-1*log(x)*log(1+b*x*a^-1))
@test integrate((a+b*x)^-2*log(x), x) == :(-1*a^-1*b^-1*log(a+b*x)+x*a^-1*(a+b*x)^-1*log(x))
@test integrate(x^-1*log(x)^n, x) == :((1+n)^-1*log(x)^(1+n))
@test integrate(x^-1*(a+b*log(x))^n, x) == :(b^-1*(1+n)^-1*(a+b*log(x))^(1+n))
@test integrate(x^-1*(a+b*log(x))^-1, x) == :(b^-1*log(a+b*log(x)))
@test integrate(x^-1*(a+b*log(x))^(-1n), x) == :(b^-1*(1+-1n)^-1*(a+b*log(x))^(1+-1n))
@test integrate(x^-1*(a^2+log(x)^2)^-1//2, x) == :(arctanh((a^2+log(x)^2)^-1//2*log(x)))
@test integrate(x^-1*(log(x)^2+-1*a^2)^-1//2, x) == :(arctanh((log(x)^2+-1*a^2)^-1//2*log(x)))
@test integrate(x^-1*(a^2+-1*log(x)^2)^-1//2, x) == :(arctan((a^2+-1*log(x)^2)^-1//2*log(x)))
@test integrate(x^-1*(a^2+log(x)^2)^-1//2*log(x)^-1, x) == :(-1*a^-1*arctanh(a^-1*(a^2+log(x)^2)^(1/2)))
@test integrate(x^-1*(a^2+-1*log(x)^2)^-1//2*log(x)^-1, x) == :(-1*a^-1*arctanh(a^-1*(a^2+-1*log(x)^2)^(1/2)))
@test integrate(x^-1*(log(x)^2+-1*a^2)^-1//2*log(x)^-1, x) == :(a^-1*arctan(a^-1*(log(x)^2+-1*a^2)^(1/2)))
@test integrate(x^-1*log(log(x)), x) == :(-1*log(x)+log(x)*log(log(x)))
@test integrate(x^-1*log(log(x))^2, x) == :(2*log(x)+log(log(x))^2*log(x)+-2*log(x)*log(log(x)))
@test integrate(x^-1*log(log(x))^3, x) == :(-6*log(x)+log(log(x))^3*log(x)+-3*log(log(x))^2*log(x)+6*log(x)*log(log(x)))
@test integrate(x^-1*log(log(x))^4, x) == :(24*log(x)+log(log(x))^4*log(x)+-24*log(x)*log(log(x))+-4*log(log(x))^3*log(x)+12*log(log(x))^2*log(x))
@test integrate(x^-1*log(log(x))^n, x) == :((-1*log(log(x)))^(-1n)*log(log(x))^n*SpecialFunctions.gamma(1+n,-1*log(log(x))))
@test integrate(log(sin(x))^-1*cot(x), x) == :(log(log(sin(x))))
@test integrate((cos(x)^-1+cos(x))*tan(x), x) == :(-1*cos(x)+sec(x))
@test integrate(log(cosh(x))*sinh(x), x) == :(-1*cosh(x)+cosh(x)*log(cosh(x)))
@test integrate(log(cosh(x))*tanh(x), x) == :((1/2)*log(cosh(x))^2)
@test integrate(log(x+-1*(1+x^2)^(1/2)), x) == :((1+x^2)^(1/2)+x*log(x+-1*(1+x^2)^(1/2)))
@test integrate(x^-3*log(-1+x), x) == :((1/2)*x^-1+(1/2)*log(1+-1x)+-1//2*log(x)+-1//2*x^-2*log(-1+x))
@test integrate((-1*exp(-1x)+exp(x))*log(1+exp(2x)), x) == :(-2*exp(x)+exp(x)*log(1+exp(2x))+exp(-1x)*log(1+exp(2x)))
@test integrate(exp(3//2*x)*log(-1+exp(x)), x) == :(-4//3*exp((1/2)*x)+-4//9*exp(3//2*x)+4//3*arctanh(exp((1/2)*x))+2//3*exp(3//2*x)*log(-1+exp(x)))
@test integrate(cos(x)^3*log(sin(x)), x) == :(-1*sin(x)+1//9*sin(x)^3+log(sin(x))*sin(x)+-1//3*sin(x)^3*log(sin(x)))
@test integrate(cos(x)^-4*log(tan(x)), x) == :(-1*tan(x)+-1//9*tan(x)^3+log(tan(x))*tan(x)+1//3*tan(x)^3*log(tan(x)))
@test integrate((1+cos(x))^-1*log(cos((1/2)*x)), x) == :(-1//2*x+(1+cos(x))^-1*log(cos((1/2)*x))*sin(x)+tan((1/2)*x))
@test integrate((1+cos(x))^-2*cos(x)*log(sin(x)), x) == :(-2//3*x+8*(9+9*cos(x))^-1*sin(x)+-1//9*(1+cos(x))^-2*sin(x)+2*(3+3*cos(x))^-1*log(sin(x))*sin(x)+-1//3*(1+cos(x))^-2*log(sin(x))*sin(x))
@test integrate(x^-5*arccos(x)^2, x) == :(-1//12*x^-2+1//3*log(x)+-1//4*x^-4*arccos(x)^2+1//3*x^-1*(1+-1*x^2)^(1/2)*arccos(x)+1//6*x^-3*(1+-1*x^2)^(1/2)*arccos(x))
@test integrate(x^2*arcsin(x)^2, x) == :(-4//9*x+-2//27*x^3+1//3*x^3*arcsin(x)^2+4//9*(1+-1*x^2)^(1/2)*arcsin(x)+2//9*x^2*(1+-1*x^2)^(1/2)*arcsin(x))
@test integrate(x^3*arctan(x)^2, x) == :(-1//3*log(1+x^2)+-1//4*arctan(x)^2+1//12*x^2+(1/2)*x*arctan(x)+-1//6*x^3*arctan(x)+1//4*x^4*arctan(x)^2)
@test integrate(x^-5*arctan(x)^2, x) == :(-2//3*log(x)+-1//12*x^-2+1//3*log(1+x^2)+1//4*arctan(x)^2+(1/2)*x^-1*arctan(x)+-1//4*x^-4*arctan(x)^2+-1//6*x^-3*arctan(x))
@test integrate(x^3*arccsc(x)^2, x) == :(1//3*log(x)+1//12*x^2+1//4*x^4*arccsc(x)^2+1//3*x*(1+-1*x^-2)^(1/2)*arccsc(x)+1//6*x^3*(1+-1*x^-2)^(1/2)*arccsc(x))
@test integrate(x^-5*arcsec(x)^4, x) == :(-45//128*x^-2+-45//128*arcsec(x)^2+-3//128*x^-4+3//32*arcsec(x)^4+-1//4*x^-4*arcsec(x)^4+3//16*x^-4*arcsec(x)^2+9//16*x^-2*arcsec(x)^2+-45//64*x^-1*(1+-1*x^-2)^(1/2)*arcsec(x)+-3//32*x^-3*(1+-1*x^-2)^(1/2)*arcsec(x)+1//4*x^-3*(1+-1*x^-2)^(1/2)*arcsec(x)^3+3//8*x^-1*(1+-1*x^-2)^(1/2)*arcsec(x)^3)
@test integrate((1+-1*x^2)^(1/2)*arcsin(x), x) == :(-1//4*x^2+1//4*arcsin(x)^2+(1/2)*x*(1+-1*x^2)^(1/2)*arcsin(x))
@test integrate((1+-1*x^2)^(1/2)*arccos(x), x) == :(-1//4*arccos(x)^2+1//4*x^2+(1/2)*x*(1+-1*x^2)^(1/2)*arccos(x))
@test integrate(x*(1+-1*x^2)^(1/2)*arccos(x), x) == :(-1//3*x+1//9*x^3+-1//3*(1+-1*x^2)^3//2*arccos(x))
@test integrate((1+-1*x^2)^3//2*arcsin(x), x) == :(-5//16*x^2+1//16*x^4+3//16*arcsin(x)^2+1//4*x*(1+-1*x^2)^3//2*arcsin(x)+3//8*x*(1+-1*x^2)^(1/2)*arcsin(x))
@test integrate(x*(1+-1*x^2)^3//2*arcsin(x), x) == :(-2//15*x^3+1//5*x+1//25*x^5+-1//5*(1+-1*x^2)^5//2*arcsin(x))
@test integrate(x^3*(1+-1*x^2)^3//2*arccos(x), x) == :(-2//35*x+-1//49*x^7+-1//105*x^3+8//175*x^5+-1//5*(1+-1*x^2)^5//2*arccos(x)+1//7*(1+-1*x^2)^7//2*arccos(x))
@test integrate(x^-1*(1+-1*x^2)^3//2*arccos(x), x) == :(-1//9*x^3+4//3*x+im*Polylogarithms.polylog(2,im*exp(im*arccos(x)))+(1+-1*x^2)^(1/2)*arccos(x)+-1*im*Polylogarithms.polylog(2,-1*im*exp(im*arccos(x)))+1//3*(1+-1*x^2)^3//2*arccos(x)+2*im*arccos(x)*arctan(exp(im*arccos(x))))
@test integrate(x^-6*(1+-1*x^2)^3//2*arcsin(x), x) == :(-1//20*x^-4+1//5*x^-2+1//5*log(x)+-1//5*x^-5*(1+-1*x^2)^5//2*arcsin(x))
@test integrate(x^2*(1+-1*x^2)^-1//2*arcsin(x), x) == :(1//4*x^2+1//4*arcsin(x)^2+-1//2*x*(1+-1*x^2)^(1/2)*arcsin(x))
@test integrate(x^4*(1+-1*x^2)^-1//2*arcsin(x), x) == :(1//16*x^4+3//16*x^2+3//16*arcsin(x)^2+-3//8*x*(1+-1*x^2)^(1/2)*arcsin(x)+-1//4*x^3*(1+-1*x^2)^(1/2)*arcsin(x))
@test integrate(x*(1+-1*x^2)^-3//2*arcsin(x), x) == :(-1*arctanh(x)+(1+-1*x^2)^-1//2*arcsin(x))
@test integrate(x*(1+-1*x^2)^-3//2*arccos(x), x) == :((1+-1*x^2)^-1//2*arccos(x)+arctanh(x))
@test integrate((1+-1*x^2)^-5//2*arcsin(x), x) == :(-1*(6+-6*x^2)^-1+1//3*log(1+-1*x^2)+1//3*x*(1+-1*x^2)^-3//2*arcsin(x)+2//3*x*(1+-1*x^2)^-1//2*arcsin(x))
@test integrate(x^3*(1+-1*x^2)^-3//2*arcsin(x), x) == :(-1x+-1*arctanh(x)+(1+-1*x^2)^(1/2)*arcsin(x)+(1+-1*x^2)^-1//2*arcsin(x))
@test integrate(x^-1*(1+-1*x^2)^-3//2*arcsin(x), x) == :(-1*arctanh(x)+im*Polylogarithms.polylog(2,-1*exp(im*arcsin(x)))+(1+-1*x^2)^-1//2*arcsin(x)+-1*im*Polylogarithms.polylog(2,exp(im*arcsin(x)))+-2*arcsin(x)*arctanh(exp(im*arcsin(x))))
@test integrate(x^-4*(1+-1*x^2)^-1//2*arccos(x), x) == :(-2//3*log(x)+1//6*x^-2+-2//3*x^-1*(1+-1*x^2)^(1/2)*arccos(x)+-1//3*x^-3*(1+-1*x^2)^(1/2)*arccos(x))
@test integrate(x*(1+-1*x^2)^(1/2)*arccos(x)^2, x) == :(2//27*(1+-1*x^2)^3//2+4//9*(1+-1*x^2)^(1/2)+-2//3*x*arccos(x)+-1//3*(1+-1*x^2)^3//2*arccos(x)^2+2//9*x^3*arccos(x))
@test integrate(x^2*(1+-1*x^2)^-1//2*arcsin(x)^3, x) == :(-3//8*x^2+-3//8*arcsin(x)^2+1//8*arcsin(x)^4+3//4*x^2*arcsin(x)^2+-1//2*x*(1+-1*x^2)^(1/2)*arcsin(x)^3+3//4*x*(1+-1*x^2)^(1/2)*arcsin(x))
@test integrate(x*(1+x^2)^-2*arctan(x), x) == :(1//4*arctan(x)+x*(4+4*x^2)^-1+-1*(2+2*x^2)^-1*arctan(x))
@test integrate(x*(1+x^2)^-3*arctan(x), x) == :(3//32*arctan(x)+3*x*(32+32*x^2)^-1+-1//4*(1+x^2)^-2*arctan(x)+1//16*x*(1+x^2)^-2)
@test integrate(x^2*(1+x^2)^-1*arctan(x), x) == :(-1//2*arctan(x)^2+-1//2*log(1+x^2)+x*arctan(x))
@test integrate(x^3*(1+x^2)^-1*arctan(x), x) == :((1/2)*arctan(x)+-1//2*x+arctan(x)*log(2*(1+im*x)^-1)+(1/2)*im*arctan(x)^2+(1/2)*im*Polylogarithms.polylog(2,1+-2*(1+im*x)^-1)+(1/2)*x^2*arctan(x))
@test integrate(x^2*(1+x^2)^-2*arctan(x), x) == :(-1*(4+4*x^2)^-1+1//4*arctan(x)^2+-1*x*(2+2*x^2)^-1*arctan(x))
@test integrate(x^3*(1+x^2)^-2*arctan(x), x) == :(-1//4*arctan(x)+(2+2*x^2)^-1*arctan(x)+-1*x*(4+4*x^2)^-1+-1*arctan(x)*log(2*(1+im*x)^-1)+-1//2*im*arctan(x)^2+-1//2*im*Polylogarithms.polylog(2,1+-2*(1+im*x)^-1))
@test integrate(x^5*(1+x^2)^-2*arctan(x), x) == :(-1//2*x+3//4*arctan(x)+im*arctan(x)^2+im*Polylogarithms.polylog(2,1+-2*(1+im*x)^-1)+x*(4+4*x^2)^-1+(1/2)*x^2*arctan(x)+-1*(2+2*x^2)^-1*arctan(x)+2*arctan(x)*log(2*(1+im*x)^-1))
@test integrate(x^-2*(1+x^2)*arctan(x), x) == :(-1*log(1+x^2)+x*arctan(x)+-1*x^-1*arctan(x)+log(x))
@test integrate(x^-5*(1+x^2)*arctan(x), x) == :(-1//4*x^-1+-1//12*x^-3+-1//4*x^-4*(1+x^2)^2*arctan(x))
@test integrate(x^-5*(1+x^2)^2*arctan(x), x) == :(-3//4*x^-1+-3//4*arctan(x)+-1//12*x^-3+(1/2)*im*Polylogarithms.polylog(2,-1*im*x)+-1*x^-2*arctan(x)+-1//2*im*Polylogarithms.polylog(2,im*x)+-1//4*x^-4*arctan(x))
@test integrate(x^-2*(1+x^2)^-1*arctan(x), x) == :(-1//2*arctan(x)^2+-1//2*log(1+x^2)+-1*x^-1*arctan(x)+log(x))
@test integrate(x^-3*arctan(x)^2, x) == :(-1//2*arctan(x)^2+-1//2*log(1+x^2)+-1*x^-1*arctan(x)+-1//2*x^-2*arctan(x)^2+log(x))
@test integrate(x^-5*arctan(x)^2*(1+x^2), x) == :(-1//6*log(1+x^2)+-1//12*x^-2+1//3*log(x)+-1//2*x^-1*arctan(x)+-1//6*x^-3*arctan(x)+-1//4*x^-4*(1+x^2)^2*arctan(x)^2)
@test integrate(x^-4*(-1+x^2)^(1/2)*arcsec(x), x) == :(1//3*(x^2)^-1//2+-1//9*x^-2*(x^2)^-1//2+1//3*x^-3*(-1+x^2)^3//2*arcsec(x))
@test integrate(x^-2*(-1+x^2)^-1//2*arcsec(x), x) == :((x^2)^-1//2+x^-1*(-1+x^2)^(1/2)*arcsec(x))
@test integrate(arcsin(((a+x)^-1*(x+-1a))^(1/2)), x) == :((a+x)*arcsin(((a+x)^-1*(x+-1a))^(1/2))+-1*a*2^(1/2)*(a*(a+x)^-1)^-1//2*((a+x)^-1*(x+-1a))^(1/2))
@test integrate(arctan(((a+x)^-1*(x+-1a))^(1/2)), x) == :(x*arctan((-1*(a+x)^-1*(a+-1x))^(1/2))+-1*a*arctanh((-1*(a+x)^-1*(a+-1x))^(1/2)))
@test integrate((1+x)^-3*arctan(x), x) == :(-1*(4+4x)^-1+-1//8*log(1+x^2)+1//4*log(1+x)+-1//2*(1+x)^-2*arctan(x))
@test integrate((a+x)^-1*arctan(x+-1a), x) == :(arctan(a+-1x)*log(2*(1+-1*im*(a+-1x))^-1)+(1/2)*im*Polylogarithms.polylog(2,1+(1+-1*im*(a+-1x))^-1*(im+-2a)^-1*(2a+2x))+-1*arctan(a+-1x)*log(-1*(1+-1*im*(a+-1x))^-1*(im+-2a)^-1*(2a+2x))+-1//2*im*Polylogarithms.polylog(2,1+-2*(1+-1*im*(a+-1x))^-1))
@test integrate((1+-1*x^2)^-1//2*arcsin((1+-1*x^2)^(1/2)), x) == :(-1//2*x^-1*(x^2)^(1/2)*arcsin((1+-1*x^2)^(1/2))^2)
@test integrate(x*(1+x^2)^-1//2*arctan((1+x^2)^(1/2)), x) == :(-1//2*log(2+x^2)+(1+x^2)^(1/2)*arctan((1+x^2)^(1/2)))
@test integrate((1+-1x)^-5//2*arcsin(x), x) == :(-1*(1+x)^(1/2)*(3+-3x)^-1+-1//6*2^(1/2)*arctanh((1/2)*2^(1/2)*(1+x)^(1/2))+2//3*(1+-1x)^-3//2*arcsin(x))
@test integrate(sinh(x)^-4*arccot(cosh(x))*cosh(x), x) == :(1//6*coth(x)+-1//3*csch(x)^3*arccot(cosh(x))+1//12*2^(1/2)*arctanh((1/2)*2^(1/2)*tanh(x)))
@test integrate(arcsin(tanh(x))*exp(x), x) == :(arcsin(tanh(x))*exp(x)+-1*(sech(x)^2)^(1/2)*cosh(x)*log(1+exp(2x)))

max_stars_repo_path: test/0 Independent test suites/Timofeev Problems.jl


text:
using KernelCompiler

KernelCompiler.codegen(+, Tuple{Int, Int})

ext: jl


text:
using Plots
using LightGraphs
using LinearAlgebra
using StatsBase
using StatsFuns
using GraphPlot

include("estimating_functions.jl")
include("generators.jl")

n = 500
beta = zeros(n)
for i in sample(collect(1:n), Int(floor(n / 10)))
    beta[i] = sqrt(log(n))
end
mu = -log(n)

g = sparse_beta_graph(beta, mu)

i = rand((collect(1:500)[beta .> 0]))
i_not = rand((collect(1:500)[beta .== 0]))
beta_mi = beta[1:end .!= i]
beta_i = beta[i]
deg = degree(g)[i]

beta_mi_not = beta[1:end .!= i_not]
beta_i_not = beta[i_not]
deg2 = degree(g)[i_not]

partial_sparse_beta_conditional_loglik(beta_i) = sparse_beta_conditional_loglik(g::Graph, mu, beta_i, beta_mi, deg)
partial_sparse_beta_conditional_loglik2(beta_i) = sparse_beta_conditional_loglik(g::Graph, mu, beta_i, beta_mi_not, deg2)

l = @layout [ a  b ]
p1 = Plots.plot(collect(0:0.01:4), exp.(partial_sparse_beta_conditional_loglik.(collect(0:0.01:4))))
p2 = Plots.plot(collect(0:0.01:4), exp.(partial_sparse_beta_conditional_loglik2.(collect(0:0.01:4))))
plot(p1, p2, layout=l)

max_stars_repo_name: jacobusmmsmit/sparse-beta

max_issues_repo_name: jacobusmmsmit/sparse-beta

max_forks_repo_name: jacobusmmsmit/sparse-beta


text:
using REFPROPwrap
using Test

@testset "REFPROPwrap.jl" begin
    # Write your own tests here.
end


text:
### Reajuste salarial
# Leia o salário mensal atual de um funcionário e o percentual de reajuste.
# Calcular e escrever o valor do novo salário.

println("informe o valor do salário")
salary = parse(Float32, readline())

println("informe o percentual de reajuste")
readjustment = parse(Float32, readline())

salary += (salary*readjustment)
println(salary)

max_stars_repo_name: codinginbrazil/functional-programming

max_issues_repo_name: codinginbrazil/functional-programming

max_forks_repo_name: codinginbrazil/functional-programming


text:
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Description
# ==============================================================================
#
#   Tests related to ECI to ECI transformations using satellite state vector.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# References
# ==============================================================================
#
#   [1] Vallado, D. A (2013). Fundamentals of Astrodynamics and Applications.
#       Microcosm Press, Hawthorn, CA, USA.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

# Get the current EOP Data.
#
# TODO: The EOP data obtained from IERS website does not match the values in the
# examples in [1]. However, this should be enough, because 1) the individual
# functions at the low level are tested using the same values of [1], and 2) the
# difference is smaller than 30 cm.

eop_iau1980  = read_iers_eop("./eop_IAU1980.txt",  Val(:IAU1980))
eop_iau2000a = read_iers_eop("./eop_IAU2000A.txt", Val(:IAU2000A))

# File: ./src/transformations/sv_eci_to_eci.jl
# ============================================

################################################################################
#                                  IAU-76/FK5
################################################################################

# Functions: sv_eci_to_eci
# ------------------------

# The rotations functions were already heavily tested on `eci_to_eci.jl` file.
# Hence, here we will do only some minor testing involving the following
# transformations:
#
#   GCRF <=> J2000 (FK5)
#   MOD  <=> TOD   (FK5)
#   GCRF <=> CIRS  (IAU2006)

# GCRF <=> J2000
# ==============

################################################################################
#                                 Test Results
################################################################################
#
# Scenario 01
# ===========
#
# Example 3-15: Performing IAU-76/FK5 reduction.
#
# According to this example and Table 3-6, using:
#
#   UTC    = April 6, 2004, 07:51:28.386009
#   r_gcrf = 5102.50895790   i + 6123.01140070   j + 6378.13692820   k [km]
#   v_gcrf =   -4.7432201570 i +    0.7905364970 j +    5.5337557270 k [km/s]
#
# one gets:
#
#   r_j2000 = 5102.50960000   i + 6123.01152000   j + 6378.13630000   k [km]
#   v_j2000 =   -4.7432196000 i +    0.7905366000 j +    5.5337561900 k [km/s]
#
################################################################################

@testset "Function sv_eci_to_eci GCRF <=> J2000" begin
    JD_UTC = date_to_jd(2004, 4, 6, 7, 51, 28.386009)

    ## GCRF => J2000
    ## =============

    r_gcrf   = [5102.50895790; 6123.01140070; 6378.13692820]
    v_gcrf   = [-4.7432201570; 0.7905364970; 5.5337557270]
    sv_gcrf  = orbsv(JD_UTC, r_gcrf, v_gcrf)
    sv_j2000 = sv_eci_to_eci(sv_gcrf, GCRF(), J2000(), JD_UTC, eop_iau1980)

    @test sv_j2000.t === JD_UTC

    @test sv_j2000.r[1] ≈ +5102.50960000 atol=1e-4
    @test sv_j2000.r[2] ≈ +6123.01152000 atol=1e-4
    @test sv_j2000.r[3] ≈ +6378.13630000 atol=1e-4

    @test sv_j2000.v[1] ≈ -4.7432196000  atol=1e-7
    @test sv_j2000.v[2] ≈ +0.7905366000  atol=1e-7
    @test sv_j2000.v[3] ≈ +5.5337561900  atol=1e-7

    ## J2000 => GCRF
    ## =============

    r_j2000  = [5102.50960000; 6123.01152000; 6378.13630000]
    v_j2000  = [-4.7432196000; 0.7905366000; 5.5337561900]
    sv_j2000 = orbsv(JD_UTC, r_j2000, v_j2000)
    sv_gcrf  = sv_eci_to_eci(sv_j2000, J2000(), GCRF(), JD_UTC, eop_iau1980)

    @test sv_gcrf.t === JD_UTC

    @test sv_gcrf.r[1] ≈ +5102.50895790 atol=1e-4
    @test sv_gcrf.r[2] ≈ +6123.01140070 atol=1e-4
    @test sv_gcrf.r[3] ≈ +6378.13692820 atol=1e-4

    @test sv_gcrf.v[1] ≈ -4.7432201570  atol=1e-7
    @test sv_gcrf.v[2] ≈ +0.7905364970  atol=1e-7
    @test sv_gcrf.v[3] ≈ +5.5337557270  atol=1e-7

end

# MOD <=> TOD
# ============

################################################################################
#                                 Test Results
################################################################################
#
# Scenario 01
# ===========
#
# Example 3-15: Performing IAU-76/FK5 reduction.
#
# According to this example and Table 3-6, using:
#
#   UTC    = April 6, 2004, 07:51:28.386009
#   r_mod = 5094.02837450   i + 6127.87081640   j + 6380.24851640   k [km]
#   v_mod =   -4.7462630520 i +    0.7860140450 j +    5.5317905620 k [km/s]
#
# one gets:
#
#   r_tod = 5094.51620300   i + 6127.36527840   j + 6380.34453270   k [km]
#   v_tod =   -4.7460883850 i +    0.7860783240 j +    5.5319312880 k [km/s]
#
################################################################################

@testset "Function sv_eci_to_eci MOD <=> TOD" begin
    JD_UTC = date_to_jd(2004, 4, 6, 7, 51, 28.386009)

    ## MOD => TOD
    ## ===========

    r_mod  = [5094.02837450; 6127.87081640; 6380.24851640]
    v_mod  = [-4.7462630520; 0.7860140450; 5.5317905620]
    sv_mod = orbsv(JD_UTC, r_mod, v_mod)
    sv_tod = sv_eci_to_eci(sv_mod, MOD(), JD_UTC, TOD(), JD_UTC, eop_iau1980)

    @test sv_tod.t === JD_UTC

    @test sv_tod.r[1] ≈ +5094.51620300 atol=1e-4
    @test sv_tod.r[2] ≈ +6127.36527840 atol=1e-4
    @test sv_tod.r[3] ≈ +6380.34453270 atol=1e-4

    @test sv_tod.v[1] ≈ -4.7460883850  atol=1e-7
    @test sv_tod.v[2] ≈ +0.7860783240  atol=1e-7
    @test sv_tod.v[3] ≈ +5.5319312880  atol=1e-7

    ## TOD => MOD
    ## ===========

    r_tod  = [5094.51620300; 6127.36527840; 6380.34453270]
    v_tod  = [-4.7460883850; 0.7860783240; 5.5319312880]
    sv_tod = orbsv(JD_UTC, r_tod, v_tod)
    sv_mod = sv_eci_to_eci(sv_tod, TOD(), JD_UTC, MOD(), JD_UTC, eop_iau1980)

    @test sv_mod.t === JD_UTC

    @test sv_mod.r[1] ≈ +5094.02837450 atol=1e-4
    @test sv_mod.r[2] ≈ +6127.87081640 atol=1e-4
    @test sv_mod.r[3] ≈ +6380.24851640 atol=1e-4

    @test sv_mod.v[1] ≈ -4.7462630520  atol=1e-7
    @test sv_mod.v[2] ≈ +0.7860140450  atol=1e-7
    @test sv_mod.v[3] ≈ +5.5317905620  atol=1e-7

end

################################################################################
#                                IAU-2006/2010
################################################################################

## GCRF <=> CIRS
## =============

################################################################################
#                                 Test Results
################################################################################
#
# Scenario 01
# ===========
#
# Example 3-14: Performing an IAU-2000 reduction [1, p. 220]
#
# According to this example and Table 3-6, using:
#
# NOTE: It seems that the results in the Example 3-14 is computed **without**
# the `dX` and `dY` corrections, whereas in the Table 3-6 they are computed
# **with** the corrections.
#
#   UTC    = April 6, 2004, 07:51:28.386009
#   r_cirs = -5100.01840470   i + 6122.78636480   j + 6380.34453270   k [km]
#   v_cirs =    -4.7453803300 i -    0.7903414530 j +    5.5319312880 k [km/s]
#
# one gets the following (this is the result in Table 3-6):
#
#   r_gcrf = 5102.50895290  i + 6123.01139910 j + 6378.13693380 k [km]
#   v_gcrf =  -4.7432201610 i + 0.7905364950  j + 5.5337557240  k [km/s]
#
################################################################################

@testset "Function sv_eci_to_eci GCRF <=> CIRS" begin
    JD_UTC = date_to_jd(2004, 4, 6, 7, 51, 28.386009)

    ## GCRF => CIRS
    ## ===========

    r_gcrf  = [5102.50895290; 6123.01139910; 6378.13693380]
    v_gcrf  = [-4.7432201610; 0.7905364950; 5.5337557240]
    sv_gcrf = orbsv(JD_UTC, r_gcrf, v_gcrf)
    sv_cirs = sv_eci_to_eci(sv_gcrf, GCRF(), CIRS(), JD_UTC, eop_iau2000a)

    @test sv_cirs.t === JD_UTC

    @test sv_cirs.r[1] ≈ +5100.01840470 atol=1e-4
    @test sv_cirs.r[2] ≈ +6122.78636480 atol=1e-4
    @test sv_cirs.r[3] ≈ +6380.34453270 atol=1e-4

    @test sv_cirs.v[1] ≈ -4.7453803300  atol=1e-7
    @test sv_cirs.v[2] ≈ +0.7903414530  atol=1e-7
    @test sv_cirs.v[3] ≈ +5.5319312880  atol=1e-7

    ## CIRS => GCRF
    ## ===========

    r_cirs  = [+5100.01840470; +6122.78636480; +6380.34453270]
    v_cirs  = [-4.7453803300; +0.7903414530; +5.5319312880]
    sv_cirs = orbsv(JD_UTC, r_cirs, v_cirs)
    sv_gcrf = sv_eci_to_eci(sv_cirs, CIRS(), GCRF(), JD_UTC, eop_iau2000a)

    @test sv_gcrf.t === JD_UTC

    @test sv_gcrf.r[1] ≈ +5102.50895290 atol=1e-4
    @test sv_gcrf.r[2] ≈ +6123.01139910 atol=1e-4
    @test sv_gcrf.r[3] ≈ +6378.13693380 atol=1e-4

    @test sv_gcrf.v[1] ≈ -4.7432201610  atol=1e-7
    @test sv_gcrf.v[2] ≈ +0.7905364950  atol=1e-7
    @test sv_gcrf.v[3] ≈ +5.5337557240  atol=1e-7

end


text:
using Knet, CUDArt, CUSPARSE
using Knet: loss, back

m = 10
n = 1000
dy = sparse(rand(1:m,n), 1:n, 1.0, m, n)
y = rand(m,n)
dx = similar(y)

for (yT,dyT) in ((Array,Array),
                 (Array,SparseMatrixCSC),
                 (CudaArray,CudaArray),
                 (CudaArray,CudaSparseMatrixCSC))
    display((:softloss, loss(SoftLoss(), convert(dyT, dy); y=convert(yT, y)), yT, dyT))
end

for (yT,dyT) in ((Array,Array),
                 (Array,SparseMatrixCSC),
                 (CudaArray,CudaArray),
                 (CudaArray,CudaSparseMatrixCSC))
    display((:softlossback, vecnorm(back(SoftLoss(), convert(dyT, dy); y=convert(yT, y), dx=convert(yT, dx))), yT, dyT))
end

for (yT,dyT) in ((Array,Array), (CudaArray,CudaArray))
    display((:quadloss, loss(QuadLoss(), convert(dyT, dy); y=convert(yT, y)), yT, dyT))
end

for (yT,dyT) in ((Array,Array), (CudaArray,CudaArray))
    display((:quadlossback, vecnorm(back(QuadLoss(), convert(dyT, dy); y=convert(yT, y), dx=convert(yT, dx))), yT, dyT))
end


text:
function Base.rand(::Type{WithinRadius}, presences::T; distance::Number=1.0) where {T <: SimpleSDMLayer}
    @assert SimpleSDMLayers._inner_type(presences) <: Bool
    n_occ = sum(presences)
    iszero(n_occ) && throw(ArgumentError("The presences layer is empty"))
    _msk = mask(presences, presences)
    _radius_msk = similar(presences, Bool)
    for k in keys(_msk)
        _msk_keys = keys(mask(Circle(k, distance), presences))
        _radius_msk[_msk_keys] = fill(true, length(_msk_keys))
    end
    _radius_msk = mask(_radius_msk, _radius_msk)
    acceptable_cells = setdiff(keys(_radius_msk), keys(_msk))
    if length(acceptable_cells) < n_occ
        @warn "There are fewer acceptable pseudo-absences than occurrences"
    end
    pa_places = sample(acceptable_cells, min(length(acceptable_cells), n_occ), replace=false)
    pa = similar(presences, Bool)
    pa[pa_places] = fill(true, length(pa_places))
    return pa
end