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

@test integrate((a+b*x^4)^-1*(c+d*x^2), x) == :(-1//4*2^(1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+d*a^(1/2))*arctan(1+-1*x*2^(1/2)*a^-1//4*b^1//4)+-1//8*2^(1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+-1*d*a^(1/2))*log(a^(1/2)+b^(1/2)*x^2+-1*x*2^(1/2)*a^1//4*b^1//4)+1//4*2^(1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+d*a^(1/2))*arctan(1+x*2^(1/2)*a^-1//4*b^1//4)+1//8*2^(1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+-1*d*a^(1/2))*log(a^(1/2)+b^(1/2)*x^2+x*2^(1/2)*a^1//4*b^1//4))
@test integrate((a+b*x^4)^-1*(c+-1*d*x^2), x) == :(-1//4*2^(1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+-1*d*a^(1/2))*arctan(1+-1*x*2^(1/2)*a^-1//4*b^1//4)+-1//8*2^(1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+d*a^(1/2))*log(a^(1/2)+b^(1/2)*x^2+-1*x*2^(1/2)*a^1//4*b^1//4)+1//4*2^(1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+-1*d*a^(1/2))*arctan(1+x*2^(1/2)*a^-1//4*b^1//4)+1//8*2^(1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+d*a^(1/2))*log(a^(1/2)+b^(1/2)*x^2+x*2^(1/2)*a^1//4*b^1//4))
@test integrate((a+-1*b*x^4)^-1*(c+d*x^2), x) == :((1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+d*a^(1/2))*arctanh(x*a^-1//4*b^1//4)+(1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+-1*d*a^(1/2))*arctan(x*a^-1//4*b^1//4))
@test integrate((a+-1*b*x^4)^-1*(c+-1*d*x^2), x) == :((1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+d*a^(1/2))*arctan(x*a^-1//4*b^1//4)+(1/2)*a^-3//4*b^-3//4*(c*b^(1/2)+-1*d*a^(1/2))*arctanh(x*a^-1//4*b^1//4))
@test integrate((4+9*x^4)^-1*(2+3*x^2), x) == :(-1//6*3^(1/2)*arctan(1+-1*x*3^(1/2))+1//6*3^(1/2)*arctan(1+x*3^(1/2)))
@test integrate((4+9*x^4)^-1*(2+-3*x^2), x) == :(-1//12*3^(1/2)*log(2+3*x^2+-2*x*3^(1/2))+1//12*3^(1/2)*log(2+3*x^2+2*x*3^(1/2)))
@test integrate((4+-9*x^4)^-1*(2+3*x^2), x) == :(1//6*6^(1/2)*arctanh((1/2)*x*6^(1/2)))
@test integrate((4+-9*x^4)^-1*(2+-3*x^2), x) == :(1//6*6^(1/2)*arctan((1/2)*x*6^(1/2)))
@test integrate((a+b*x^4)^-1*(b*x^2+a^(1/2)*b^(1/2)), x) == :((1/2)*2^(1/2)*a^-1//4*b^1//4*arctan(1+x*2^(1/2)*a^-1//4*b^1//4)+-1//2*2^(1/2)*a^-1//4*b^1//4*arctan(1+-1*x*2^(1/2)*a^-1//4*b^1//4))
@test integrate((a+b*x^4)^-1*(a^(1/2)*b^(1/2)+-1*b*x^2), x) == :(-1//4*2^(1/2)*a^-1//4*b^1//4*log(a^(1/2)+b^(1/2)*x^2+-1*x*2^(1/2)*a^1//4*b^1//4)+1//4*2^(1/2)*a^-1//4*b^1//4*log(a^(1/2)+b^(1/2)*x^2+x*2^(1/2)*a^1//4*b^1//4))
@test integrate((d^2+e^2*x^4)^-1*(d+e*x^2), x) == :((1/2)*2^(1/2)*d^-1//2*e^-1//2*arctan(1+x*2^(1/2)*d^-1//2*e^(1/2))+-1//2*2^(1/2)*d^-1//2*e^-1//2*arctan(1+-1*x*2^(1/2)*d^-1//2*e^(1/2)))
@test integrate((d^2+e^2*x^4)^-1*(d+-1*e*x^2), x) == :(-1//4*2^(1/2)*d^-1//2*e^-1//2*log(d+e*x^2+-1*x*2^(1/2)*d^(1/2)*e^(1/2))+1//4*2^(1/2)*d^-1//2*e^-1//2*log(d+e*x^2+x*2^(1/2)*d^(1/2)*e^(1/2)))
@test integrate((-1+x^4)^-1*(5+2*x^2), x) == :(-7//2*arctanh(x)+-3//2*arctan(x))
@test integrate((1+-1*b^2*x^4)^-1//2*(1+b*x^2), x) == :(b^-1//2*Elliptic.E(arcsin(x*b^(1/2)),-1))
@test integrate((1+-1*b^2*x^4)^-1//2*(1+-1*b*x^2), x) == :(-1*b^-1//2*Elliptic.E(arcsin(x*b^(1/2)),-1)+2*b^-1//2*Elliptic.F(arcsin(x*b^(1/2)),-1))
@test integrate((-1+b^2*x^4)^-1//2*(1+b*x^2), x) == :(b^-1//2*(1+-1*b^2*x^4)^(1/2)*(-1+b^2*x^4)^-1//2*Elliptic.E(arcsin(x*b^(1/2)),-1))
@test integrate((-1+b^2*x^4)^-1//2*(1+-1*b*x^2), x) == :(-1*b^-1//2*(1+-1*b^2*x^4)^(1/2)*(-1+b^2*x^4)^-1//2*Elliptic.E(arcsin(x*b^(1/2)),-1)+2*b^-1//2*(1+-1*b^2*x^4)^(1/2)*(-1+b^2*x^4)^-1//2*Elliptic.F(arcsin(x*b^(1/2)),-1))
@test integrate((1+b^2*x^4)^-1//2*(1+-1*b*x^2), x) == :(-1*x*(1+b*x^2)^-1*(1+b^2*x^4)^(1/2)+b^-1//2*((1+b*x^2)^-2*(1+b^2*x^4))^(1/2)*(1+b^2*x^4)^-1//2*(1+b*x^2)*Elliptic.E(2*arctan(x*b^(1/2)),1/2))
@test integrate((1+b^2*x^4)^-1//2*(1+b*x^2), x) == :(x*(1+b*x^2)^-1*(1+b^2*x^4)^(1/2)+b^-1//2*((1+b*x^2)^-2*(1+b^2*x^4))^(1/2)*(1+b^2*x^4)^-1//2*(1+b*x^2)*Elliptic.F(2*arctan(x*b^(1/2)),1/2)+-1*b^-1//2*((1+b*x^2)^-2*(1+b^2*x^4))^(1/2)*(1+b^2*x^4)^-1//2*(1+b*x^2)*Elliptic.E(2*arctan(x*b^(1/2)),1/2))
@test integrate((-1+-1*b^2*x^4)^-1//2*(1+-1*b*x^2), x) == :(x*(1+b*x^2)^-1*(-1+-1*b^2*x^4)^(1/2)+b^-1//2*((1+b*x^2)^-2*(1+b^2*x^4))^(1/2)*(-1+-1*b^2*x^4)^-1//2*(1+b*x^2)*Elliptic.E(2*arctan(x*b^(1/2)),1/2))
@test integrate((-1+-1*b^2*x^4)^-1//2*(1+b*x^2), x) == :(-1*x*(1+b*x^2)^-1*(-1+-1*b^2*x^4)^(1/2)+b^-1//2*((1+b*x^2)^-2*(1+b^2*x^4))^(1/2)*(-1+-1*b^2*x^4)^-1//2*(1+b*x^2)*Elliptic.F(2*arctan(x*b^(1/2)),1/2)+-1*b^-1//2*((1+b*x^2)^-2*(1+b^2*x^4))^(1/2)*(-1+-1*b^2*x^4)^-1//2*(1+b*x^2)*Elliptic.E(2*arctan(x*b^(1/2)),1/2))
@test integrate((1+c^2*x^2)^(1/2)*(1+-1*c^2*x^2)^-1//2, x) == :(c^-1*Elliptic.E(arcsin(c*x),-1))
@test integrate((1+-1*c^4*x^4)^-1//2*(1+c^2*x^2), x) == :(c^-1*Elliptic.E(arcsin(c*x),-1))
@test integrate((1+c^2*x^2)^-1//2*(1+-1*c^2*x^2)^(1/2), x) == :(-1*c^-1*Elliptic.E(arcsin(c*x),-1)+2*c^-1*Elliptic.F(arcsin(c*x),-1))
@test integrate((1+-1*c^4*x^4)^-1//2*(1+-1*c^2*x^2), x) == :(-1*c^-1*Elliptic.E(arcsin(c*x),-1)+2*c^-1*Elliptic.F(arcsin(c*x),-1))
@test integrate((d^2+b*x^2+e^2*x^4)^-1*(d+e*x^2), x) == :((b+2*d*e)^-1//2*arctan((b+2*d*e)^-1//2*((-1b+2*d*e)^(1/2)+2*e*x))+-1*(b+2*d*e)^-1//2*arctan((b+2*d*e)^-1//2*((-1b+2*d*e)^(1/2)+-2*e*x)))
@test integrate((d^2+f*x^2+e^2*x^4)^-1*(d+e*x^2), x) == :((f+2*d*e)^-1//2*arctan((f+2*d*e)^-1//2*((-1*f+2*d*e)^(1/2)+2*e*x))+-1*(f+2*d*e)^-1//2*arctan((f+2*d*e)^-1//2*((-1*f+2*d*e)^(1/2)+-2*e*x)))
@test integrate((d^2+e^2*x^4+-1*b*x^2)^-1*(d+e*x^2), x) == :((b+-2*d*e)^-1//2*arctanh((b+-2*d*e)^-1//2*((b+2*d*e)^(1/2)+-2*e*x))+-1*(b+-2*d*e)^-1//2*arctanh((b+-2*d*e)^-1//2*((b+2*d*e)^(1/2)+2*e*x)))
@test integrate((d^2+e^2*x^4+-1*f*x^2)^-1*(d+e*x^2), x) == :((-1*f+2*d*e)^-1//2*arctan((-1*f+2*d*e)^-1//2*((f+2*d*e)^(1/2)+2*e*x))+-1*(-1*f+2*d*e)^-1//2*arctan((-1*f+2*d*e)^-1//2*((f+2*d*e)^(1/2)+-2*e*x)))
@test integrate((d^2+b*x^2+e^2*x^4)^-1*(d+-1*e*x^2), x) == :((1/2)*(-1b+2*d*e)^-1//2*log(d+e*x^2+x*(-1b+2*d*e)^(1/2))+-1//2*(-1b+2*d*e)^-1//2*log(d+e*x^2+-1*x*(-1b+2*d*e)^(1/2)))
@test integrate((d^2+f*x^2+e^2*x^4)^-1*(d+-1*e*x^2), x) == :((1/2)*(-1*f+2*d*e)^-1//2*log(d+e*x^2+x*(-1*f+2*d*e)^(1/2))+-1//2*(-1*f+2*d*e)^-1//2*log(d+e*x^2+-1*x*(-1*f+2*d*e)^(1/2)))
@test integrate((d^2+e^2*x^4+-1*b*x^2)^-1*(d+-1*e*x^2), x) == :((1/2)*(b+2*d*e)^-1//2*log(d+e*x^2+x*(b+2*d*e)^(1/2))+-1//2*(b+2*d*e)^-1//2*log(d+e*x^2+-1*x*(b+2*d*e)^(1/2)))
@test integrate((d^2+e^2*x^4+-1*f*x^2)^-1*(d+-1*e*x^2), x) == :((1/2)*(f+2*d*e)^-1//2*log(d+e*x^2+x*(f+2*d*e)^(1/2))+-1//2*(f+2*d*e)^-1//2*log(d+e*x^2+-1*x*(f+2*d*e)^(1/2)))
@test integrate((b*x^2+c*x^4+c*d^2*e^-2)^-1*(d+-1*e*x^2), x) == :((1/2)*c^-1//2*e^3//2*(-1*b*e+2*c*d)^-1//2*log(d*c^(1/2)+e*c^(1/2)*x^2+x*e^(1/2)*(-1*b*e+2*c*d)^(1/2))+-1//2*c^-1//2*e^3//2*(-1*b*e+2*c*d)^-1//2*log(d*c^(1/2)+e*c^(1/2)*x^2+-1*x*e^(1/2)*(-1*b*e+2*c*d)^(1/2)))
@test integrate((b*x^2+c*x^4+c*d^2*e^-2)^-1*(d+e*x^2), x) == :(c^-1//2*e^3//2*(b*e+2*c*d)^-1//2*arctan((b*e+2*c*d)^-1//2*((-1*b*e+2*c*d)^(1/2)+2*x*c^(1/2)*e^(1/2)))+-1*c^-1//2*e^3//2*(b*e+2*c*d)^-1//2*arctan((b*e+2*c*d)^-1//2*((-1*b*e+2*c*d)^(1/2)+-2*x*c^(1/2)*e^(1/2))))
@test integrate((b*x^2+c*(x^4+d^2*e^-2))^-1*(d+e*x^2), x) == :(c^-1//2*e^3//2*(b*e+2*c*d)^-1//2*arctan((b*e+2*c*d)^-1//2*((-1*b*e+2*c*d)^(1/2)+2*x*c^(1/2)*e^(1/2)))+-1*c^-1//2*e^3//2*(b*e+2*c*d)^-1//2*arctan((b*e+2*c*d)^-1//2*((-1*b*e+2*c*d)^(1/2)+-2*x*c^(1/2)*e^(1/2))))
@test integrate((a^2+b^2*x^4+x^2*(-1+2*a*b))^-1*(a+-1*b*x^2), x) == :((1/2)*log(a+x+b*x^2)+-1//2*log(a+-1x+b*x^2))
@test integrate((a^2+b^2*x^4+x^2*(-1+2*a*b))^-1*(a+b*x^2), x) == :((1+-4*a*b)^-1//2*arctanh((1+-4*a*b)^-1//2*(1+-2*b*x))+-1*(1+-4*a*b)^-1//2*arctanh((1+-4*a*b)^-1//2*(1+2*b*x)))
@test integrate((1+4*x^4+b*x^2)^-1*(1+2*x^2), x) == :((4+b)^-1//2*arctan((4+b)^-1//2*((4+-1b)^(1/2)+4x))+-1*(4+b)^-1//2*arctan((4+b)^-1//2*((4+-1b)^(1/2)+-4x)))
@test integrate((1+4*x^4+-1*b*x^2)^-1*(1+2*x^2), x) == :((4+-1b)^-1//2*arctan((4+-1b)^-1//2*((4+b)^(1/2)+4x))+-1*(4+-1b)^-1//2*arctan((4+-1b)^-1//2*((4+b)^(1/2)+-4x)))
@test integrate((1+4*x^4+6*x^2)^-1*(1+2*x^2), x) == :(1//10*10^(1/2)*arctan(2*x*(3+5^(1/2))^-1//2)+1//10*10^(1/2)*arctan(2*x*(3+-1*5^(1/2))^-1//2))
@test integrate((1+4*x^4+5*x^2)^-1*(1+2*x^2), x) == :(1//3*arctan(x)+1//3*arctan(2x))
@test integrate((1+4*x^2+4*x^4)^-1*(1+2*x^2), x) == :((1/2)*2^(1/2)*arctan(x*2^(1/2)))
@test integrate((1+3*x^2+4*x^4)^-1*(1+2*x^2), x) == :(-1//7*7^(1/2)*arctan(1//7*7^(1/2)*(1+-4x))+1//7*7^(1/2)*arctan(1//7*7^(1/2)*(1+4x)))
@test integrate((1+2*x^2+4*x^4)^-1*(1+2*x^2), x) == :(-1//6*6^(1/2)*arctan(1//3*3^(1/2)*(1+-2*x*2^(1/2)))+1//6*6^(1/2)*arctan(1//3*3^(1/2)*(1+2*x*2^(1/2))))
@test integrate((1+x^2+4*x^4)^-1*(1+2*x^2), x) == :(-1//5*5^(1/2)*arctan(1//5*5^(1/2)*(3^(1/2)+-4x))+1//5*5^(1/2)*arctan(1//5*5^(1/2)*(3^(1/2)+4x)))
@test integrate((1+4*x^4)^-1*(1+2*x^2), x) == :((1/2)*arctan(1+2x)+-1//2*arctan(1+-2x))
@test integrate((1+-1*x^2+4*x^4)^-1*(1+2*x^2), x) == :(-1//3*3^(1/2)*arctan(1//3*3^(1/2)*(5^(1/2)+-4x))+1//3*3^(1/2)*arctan(1//3*3^(1/2)*(5^(1/2)+4x)))
@test integrate((1+-2*x^2+4*x^4)^-1*(1+2*x^2), x) == :((1/2)*2^(1/2)*arctan(3^(1/2)+2*x*2^(1/2))+-1//2*2^(1/2)*arctan(3^(1/2)+-2*x*2^(1/2)))
@test integrate((1+-3*x^2+4*x^4)^-1*(1+2*x^2), x) == :(-1*arctan(7^(1/2)+-4x)+arctan(7^(1/2)+4x))
@test integrate((1+-4*x^2+4*x^4)^-1*(1+2*x^2), x) == :(x*(1+-2*x^2)^-1)
@test integrate((1+-5*x^2+4*x^4)^-1*(1+2*x^2), x) == :((1/2)*log(1+-1x)+(1/2)*log(1+2x)+-1//2*log(1+x)+-1//2*log(1+-2x))
@test integrate((1+-6*x^2+4*x^4)^-1*(1+2*x^2), x) == :((1/2)*2^(1/2)*arctanh(5^(1/2)+-2*x*2^(1/2))+-1//2*2^(1/2)*arctanh(5^(1/2)+2*x*2^(1/2)))
@test integrate((1+4*x^4+b*x^2)^-1*(1+-2*x^2), x) == :((1/2)*(4+-1b)^-1//2*log(1+2*x^2+x*(4+-1b)^(1/2))+-1//2*(4+-1b)^-1//2*log(1+2*x^2+-1*x*(4+-1b)^(1/2)))
@test integrate((1+4*x^4+6*x^2)^-1*(1+-2*x^2), x) == :((1/2)*2^(1/2)*arctan(2*x*(3+-1*5^(1/2))^-1//2)+-1//2*2^(1/2)*arctan(2*x*(3+5^(1/2))^-1//2))
@test integrate((1+4*x^4+5*x^2)^-1*(1+-2*x^2), x) == :(-1*arctan(x)+arctan(2x))
@test integrate((1+4*x^2+4*x^4)^-1*(1+-2*x^2), x) == :(x*(1+2*x^2)^-1)
@test integrate((1+3*x^2+4*x^4)^-1*(1+-2*x^2), x) == :((1/2)*log(1+x+2*x^2)+-1//2*log(1+-1x+2*x^2))
@test integrate((1+2*x^2+4*x^4)^-1*(1+-2*x^2), x) == :(-1//4*2^(1/2)*log(1+2*x^2+-1*x*2^(1/2))+1//4*2^(1/2)*log(1+2*x^2+x*2^(1/2)))
@test integrate((1+x^2+4*x^4)^-1*(1+-2*x^2), x) == :(-1//6*3^(1/2)*log(1+2*x^2+-1*x*3^(1/2))+1//6*3^(1/2)*log(1+2*x^2+x*3^(1/2)))
@test integrate((1+4*x^4)^-1*(1+-2*x^2), x) == :(-1//4*log(1+-2x+2*x^2)+1//4*log(1+2x+2*x^2))
@test integrate((1+-1*x^2+4*x^4)^-1*(1+-2*x^2), x) == :(-1//10*5^(1/2)*log(1+2*x^2+-1*x*5^(1/2))+1//10*5^(1/2)*log(1+2*x^2+x*5^(1/2)))
@test integrate((1+-2*x^2+4*x^4)^-1*(1+-2*x^2), x) == :(-1//12*6^(1/2)*log(1+2*x^2+-1*x*6^(1/2))+1//12*6^(1/2)*log(1+2*x^2+x*6^(1/2)))
@test integrate((1+-3*x^2+4*x^4)^-1*(1+-2*x^2), x) == :(-1//14*7^(1/2)*log(1+2*x^2+-1*x*7^(1/2))+1//14*7^(1/2)*log(1+2*x^2+x*7^(1/2)))
@test integrate((1+-4*x^2+4*x^4)^-1*(1+-2*x^2), x) == :((1/2)*2^(1/2)*arctanh(x*2^(1/2)))
@test integrate((1+-5*x^2+4*x^4)^-1*(1+-2*x^2), x) == :(-1//6*log(1+-1x)+-1//6*log(1+-2x)+1//6*log(1+x)+1//6*log(1+2x))
@test integrate((1+-6*x^2+4*x^4)^-1*(1+-2*x^2), x) == :(-1//10*10^(1/2)*arctanh(1//5*5^(1/2)*(1+-2*x*2^(1/2)))+1//10*10^(1/2)*arctanh(1//5*5^(1/2)*(1+2*x*2^(1/2))))
@test integrate((1+x^4+b*x^2)^-1*(1+x^2), x) == :((2+b)^-1//2*arctan((2+b)^-1//2*((2+-1b)^(1/2)+2x))+-1*(2+b)^-1//2*arctan((2+b)^-1//2*((2+-1b)^(1/2)+-2x)))
@test integrate((1+x^4+5*x^2)^-1*(1+x^2), x) == :(1//7*7^(1/2)*arctan(x*(5//2+(1/2)*21^(1/2))^(1/2))+1//7*7^(1/2)*arctan(x*2^(1/2)*(5+21^(1/2))^-1//2))
@test integrate((1+x^4+4*x^2)^-1*(1+x^2), x) == :(1//6*6^(1/2)*arctan(x*(2+3^(1/2))^-1//2)+1//6*6^(1/2)*arctan(x*(2+-1*3^(1/2))^-1//2))
@test integrate((1+x^4+3*x^2)^-1*(1+x^2), x) == :(1//5*5^(1/2)*arctan(x*(3//2+(1/2)*5^(1/2))^(1/2))+1//5*5^(1/2)*arctan(x*2^(1/2)*(3+5^(1/2))^-1//2))
@test integrate((1+x^4+2*x^2)^-1*(1+x^2), x) == :(arctan(x))
@test integrate((1+x^2+x^4)^-1*(1+x^2), x) == :(-1//3*3^(1/2)*arctan(1//3*3^(1/2)*(1+-2x))+1//3*3^(1/2)*arctan(1//3*3^(1/2)*(1+2x)))
@test integrate((1+x^4)^-1*(1+x^2), x) == :((1/2)*2^(1/2)*arctan(1+x*2^(1/2))+-1//2*2^(1/2)*arctan(1+-1*x*2^(1/2)))
@test integrate((1+x^4+-1*x^2)^-1*(1+x^2), x) == :(-1*arctan(3^(1/2)+-2x)+arctan(3^(1/2)+2x))
@test integrate((1+x^4+-2*x^2)^-1*(1+x^2), x) == :(x*(1+-1*x^2)^-1)
@test integrate((1+x^4+-3*x^2)^-1*(1+x^2), x) == :((1/2)*log(1+5^(1/2)+-2x)+(1/2)*log(1+-1*5^(1/2)+-2x)+-1//2*log(1+5^(1/2)+2x)+-1//2*log(1+-1*5^(1/2)+2x))
@test integrate((1+x^4+-4*x^2)^-1*(1+x^2), x) == :((1/2)*2^(1/2)*arctanh(3^(1/2)+-1*x*2^(1/2))+-1//2*2^(1/2)*arctanh(3^(1/2)+x*2^(1/2)))
@test integrate((1+x^4+-5*x^2)^-1*(1+x^2), x) == :(-1//3*3^(1/2)*arctanh(1//3*3^(1/2)*(7^(1/2)+2x))+1//3*3^(1/2)*arctanh(1//3*3^(1/2)*(7^(1/2)+-2x)))
@test integrate((1+x^4+b*x^2)^-1*(1+-1*x^2), x) == :((1/2)*(2+-1b)^-1//2*log(1+x^2+x*(2+-1b)^(1/2))+-1//2*(2+-1b)^-1//2*log(1+x^2+-1*x*(2+-1b)^(1/2)))
@test integrate((1+x^4+5*x^2)^-1*(1+-1*x^2), x) == :(-1//3*3^(1/2)*arctan(x*2^(1/2)*(5+21^(1/2))^-1//2)+1//3*3^(1/2)*arctan(x*(5//2+(1/2)*21^(1/2))^(1/2)))
@test integrate((1+x^4+4*x^2)^-1*(1+-1*x^2), x) == :((1/2)*2^(1/2)*arctan(x*(2+-1*3^(1/2))^-1//2)+-1//2*2^(1/2)*arctan(x*(2+3^(1/2))^-1//2))
@test integrate((1+x^4+3*x^2)^-1*(1+-1*x^2), x) == :(-1*arctan(x*2^(1/2)*(3+5^(1/2))^-1//2)+arctan(x*(3//2+(1/2)*5^(1/2))^(1/2)))
@test integrate((1+x^4+2*x^2)^-1*(1+-1*x^2), x) == :(x*(1+x^2)^-1)
@test integrate((1+x^2+x^4)^-1*(1+-1*x^2), x) == :((1/2)*log(1+x+x^2)+-1//2*log(1+x^2+-1x))
@test integrate((1+x^4)^-1*(1+-1*x^2), x) == :(-1//4*2^(1/2)*log(1+x^2+-1*x*2^(1/2))+1//4*2^(1/2)*log(1+x^2+x*2^(1/2)))
@test integrate((1+x^4+-1*x^2)^-1*(1+-1*x^2), x) == :(-1//6*3^(1/2)*log(1+x^2+-1*x*3^(1/2))+1//6*3^(1/2)*log(1+x^2+x*3^(1/2)))
@test integrate((1+x^4+-2*x^2)^-1*(1+-1*x^2), x) == :(arctanh(x))
@test integrate((1+x^4+-3*x^2)^-1*(1+-1*x^2), x) == :(-1//5*5^(1/2)*arctanh(1//5*5^(1/2)*(1+-2x))+1//5*5^(1/2)*arctanh(1//5*5^(1/2)*(1+2x)))
@test integrate((1+x^4+-4*x^2)^-1*(1+-1*x^2), x) == :(-1//6*6^(1/2)*arctanh(1//3*3^(1/2)*(1+-1*x*2^(1/2)))+1//6*6^(1/2)*arctanh(1//3*3^(1/2)*(1+x*2^(1/2))))
@test integrate((1+x^4+-5*x^2)^-1*(1+-1*x^2), x) == :(-1//7*7^(1/2)*arctanh(1//7*7^(1/2)*(3^(1/2)+-2x))+1//7*7^(1/2)*arctanh(1//7*7^(1/2)*(3^(1/2)+2x)))
@test integrate((1+2*x^2+9*x^4)^-1*(-1+-3*x^2), x) == :(-1//4*2^(1/2)*arctan((1/2)*2^(1/2)*(1+3x))+1//4*2^(1/2)*arctan((1/2)*2^(1/2)*(1+-3x)))
@test integrate((-1+-9*x^4+-2*x^2)^-1*(1+3*x^2), x) == :(-1//4*2^(1/2)*arctan((1/2)*2^(1/2)*(1+3x))+1//4*2^(1/2)*arctan((1/2)*2^(1/2)*(1+-3x)))
@test integrate((1+x^4+-2*x^2)^-1*(3+2*x^2), x) == :((1/2)*arctanh(x)+5*x*(2+-2*x^2)^-1)
@test integrate((5+-8*x^2+3*x^4)^-1*(2+3*x^2), x) == :(5//2*arctanh(x)+-7//10*15^(1/2)*arctanh(1//5*x*15^(1/2)))
@test integrate((5+-8*x^2+3*x^4)^-1*(d+e*x^2), x) == :(((1/2)*d+(1/2)*e)*arctanh(x)+-1//30*15^(1/2)*(3d+5*e)*arctanh(1//5*x*15^(1/2)))
@test integrate((1+x^4+3*x^2)^-1*(3+x^2), x) == :(-1//10*(180+-80*5^(1/2))^(1/2)*arctan(x*2^(1/2)*(3+5^(1/2))^-1//2)+1//20*10^(1/2)*(3+5^(1/2))^3//2*arctan(x*(3//2+(1/2)*5^(1/2))^(1/2)))
@test integrate((1+x^2+x^4)^-1*(a+b*x^2), x) == :((-1//4*b+1//4*a)*log(1+x+x^2)+-1*(-1//4*b+1//4*a)*log(1+x^2+-1x)+-1//6*3^(1/2)*(a+b)*arctan(1//3*3^(1/2)*(1+-2x))+1//6*3^(1/2)*(a+b)*arctan(1//3*3^(1/2)*(1+2x)))
@test integrate((1+x^2+x^4)^-2*(a+b*x^2), x) == :((-1//8*b+1//4*a)*log(1+x+x^2)+-1*(-1//8*b+1//4*a)*log(1+x^2+-1x)+x*(6+6*x^2+6*x^4)^-1*(a+b+-1*x^2*(a+-2b))+-1//36*3^(1/2)*(b+4a)*arctan(1//3*3^(1/2)*(1+-2x))+1//36*3^(1/2)*(b+4a)*arctan(1//3*3^(1/2)*(1+2x)))
@test integrate((2+x^2+x^4)^-1*(a+b*x^2), x) == :((1/2)*(-1//14+1//7*2^(1/2))^(1/2)*(a+b*2^(1/2))*arctan((1+2*2^(1/2))^-1//2*((-1+2*2^(1/2))^(1/2)+2x))+-1//2*(-1//14+1//7*2^(1/2))^(1/2)*(a+b*2^(1/2))*arctan((1+2*2^(1/2))^-1//2*((-1+2*2^(1/2))^(1/2)+-2x))+-1//4*(-2+4*2^(1/2))^-1//2*(a+-1*b*2^(1/2))*log(2^(1/2)+x^2+-1*x*(-1+2*2^(1/2))^(1/2))+1//4*(-2+4*2^(1/2))^-1//2*(a+-1*b*2^(1/2))*log(2^(1/2)+x^2+x*(-1+2*2^(1/2))^(1/2)))
@test integrate((2+x^2+x^4)^-2*(a+b*x^2), x) == :(x*(56+28*x^2+28*x^4)^-1*(2b+3a+-1*x^2*(a+-4b))+-1//56*(-1//14+1//7*2^(1/2))^(1/2)*(a*(11+-1*2^(1/2))+-1*b*(2+-4*2^(1/2)))*arctan((1+2*2^(1/2))^-1//2*((-1+2*2^(1/2))^(1/2)+-2x))+-1//112*(-2+4*2^(1/2))^-1//2*(-2b+11a+2^(1/2)*(a+-4b))*log(2^(1/2)+x^2+-1*x*(-1+2*2^(1/2))^(1/2))+1//56*(-1//14+1//7*2^(1/2))^(1/2)*(a*(11+-1*2^(1/2))+-1*b*(2+-4*2^(1/2)))*arctan((1+2*2^(1/2))^-1//2*((-1+2*2^(1/2))^(1/2)+2x))+1//112*(-2+4*2^(1/2))^-1//2*(-2b+a*(11+2^(1/2))+-4*b*2^(1/2))*log(2^(1/2)+x^2+x*(-1+2*2^(1/2))^(1/2)))
@test integrate((1+x^4+-1*2^(1/2)*x^2)^-1*(2^(1/2)+-1*x^2), x) == :((1/2)*(2+2^(1/2))^-1//2*arctan((2+-1*2^(1/2))^-1//2*((2+2^(1/2))^(1/2)+2x))+-1//2*(2+2^(1/2))^-1//2*arctan((2+-1*2^(1/2))^-1//2*((2+2^(1/2))^(1/2)+-2x))+-1//4*(1+(1/2)*2^(1/2))^(1/2)*log(1+x^2+-1*x*(2+2^(1/2))^(1/2))+1//4*(1+(1/2)*2^(1/2))^(1/2)*log(1+x^2+x*(2+2^(1/2))^(1/2)))
@test integrate((1+x^4+2^(1/2)*x^2)^-1*(2^(1/2)+x^2), x) == :((1/2)*(2+-1*2^(1/2))^-1//2*arctan((2+2^(1/2))^-1//2*((2+-1*2^(1/2))^(1/2)+2x))+-1//2*(2+-1*2^(1/2))^-1//2*arctan((2+2^(1/2))^-1//2*((2+-1*2^(1/2))^(1/2)+-2x))+-1//4*(1+-1//2*2^(1/2))^(1/2)*log(1+x^2+-1*x*(2+-1*2^(1/2))^(1/2))+1//4*(1+-1//2*2^(1/2))^(1/2)*log(1+x^2+x*(2+-1*2^(1/2))^(1/2)))
@test integrate((1+x^4+b*x^2)^-1*(2^(1/2)+-1*x^2), x) == :((1/2)*(2+b)^-1//2*(1+-1*2^(1/2))*arctan((2+b)^-1//2*((2+-1b)^(1/2)+-2x))+-1//2*(2+b)^-1//2*(1+-1*2^(1/2))*arctan((2+b)^-1//2*((2+-1b)^(1/2)+2x))+-1//4*(2+-1b)^-1//2*(1+2^(1/2))*log(1+x^2+-1*x*(2+-1b)^(1/2))+1//4*(2+-1b)^-1//2*(1+2^(1/2))*log(1+x^2+x*(2+-1b)^(1/2)))
@test integrate((1+x^4+b*x^2)^-1*(2^(1/2)+x^2), x) == :((1/2)*(2+b)^-1//2*(1+2^(1/2))*arctan((2+b)^-1//2*((2+-1b)^(1/2)+2x))+-1//2*(2+b)^-1//2*(1+2^(1/2))*arctan((2+b)^-1//2*((2+-1b)^(1/2)+-2x))+-1//4*(2+-1b)^-1//2*(1+-1*2^(1/2))*log(1+x^2+x*(2+-1b)^(1/2))+1//4*(2+-1b)^-1//2*(1+-1*2^(1/2))*log(1+x^2+-1*x*(2+-1b)^(1/2)))
@test integrate((a^2+x^4+-1*a*x^2)^-1*(-1*x^2+2a), x) == :((1/2)*a^-1//2*arctan(3^(1/2)+2*x*a^-1//2)+-1//2*a^-1//2*arctan(3^(1/2)+-2*x*a^-1//2)+-1//4*3^(1/2)*a^-1//2*log(a+x^2+-1*x*3^(1/2)*a^(1/2))+1//4*3^(1/2)*a^-1//2*log(a+x^2+x*3^(1/2)*a^(1/2)))
@test integrate((a+x^4+-1*a^(1/2)*x^2)^-1*(-1*x^2+2*a^(1/2)), x) == :((1/2)*a^-1//4*arctan(3^(1/2)+2*x*a^-1//4)+-1//2*a^-1//4*arctan(3^(1/2)+-2*x*a^-1//4)+-1//4*3^(1/2)*a^-1//4*log(a^(1/2)+x^2+-1*x*3^(1/2)*a^1//4)+1//4*3^(1/2)*a^-1//4*log(a^(1/2)+x^2+x*3^(1/2)*a^1//4))
@test integrate((b^4//3+x^4+b^2//3*x^2)^-1*(x^2+2*b^2//3), x) == :(-1//4*b^-1//3*log(b^2//3+x^2+-1*x*b^1//3)+1//4*b^-1//3*log(b^2//3+x^2+x*b^1//3)+(1/2)*3^(1/2)*b^-1//3*arctan(1//3*3^(1/2)*b^-1//3*(b^1//3+2x))+-1//2*3^(1/2)*b^-1//3*arctan(1//3*3^(1/2)*b^-1//3*(b^1//3+-2x)))
@test integrate((a^2+x^4+-1*a*x^2)^-1*(A+B*x^2), x) == :((1/2)*a^-3//2*(A+B*a)*arctan(3^(1/2)+2*x*a^-1//2)+-1//2*a^-3//2*(A+B*a)*arctan(3^(1/2)+-2*x*a^-1//2)+-1//12*3^(1/2)*a^-3//2*(A+-1*B*a)*log(a+x^2+-1*x*3^(1/2)*a^(1/2))+1//12*3^(1/2)*a^-3//2*(A+-1*B*a)*log(a+x^2+x*3^(1/2)*a^(1/2)))
@test integrate((a+x^4+-1*a^(1/2)*x^2)^-1*(A+B*x^2), x) == :((1/2)*a^-3//4*(A+B*a^(1/2))*arctan(3^(1/2)+2*x*a^-1//4)+-1//2*a^-3//4*(A+B*a^(1/2))*arctan(3^(1/2)+-2*x*a^-1//4)+-1//12*3^(1/2)*a^-3//4*(A+-1*B*a^(1/2))*log(a^(1/2)+x^2+-1*x*3^(1/2)*a^1//4)+1//12*3^(1/2)*a^-3//4*(A+-1*B*a^(1/2))*log(a^(1/2)+x^2+x*3^(1/2)*a^1//4))
@test integrate((a+c*x^4+-1*x^2*(a*c)^(1/2))^-1*(A+B*x^2), x) == :(-1//4*a^-1//2*((a*c)^(1/2)+2*a^(1/2)*c^(1/2))^-1//2*(A+-1*B*a^(1/2)*c^-1//2)*log(a^(1/2)+c^(1/2)*x^2+-1*x*((a*c)^(1/2)+2*a^(1/2)*c^(1/2))^(1/2))+1//4*a^-1//2*((a*c)^(1/2)+2*a^(1/2)*c^(1/2))^-1//2*(A+-1*B*a^(1/2)*c^-1//2)*log(a^(1/2)+x*((a*c)^(1/2)+2*a^(1/2)*c^(1/2))^(1/2)+c^(1/2)*x^2)+(1/2)*a^-1//2*c^-1//2*(-1*(a*c)^(1/2)+2*a^(1/2)*c^(1/2))^-1//2*(A*c^(1/2)+B*a^(1/2))*arctan((-1*(a*c)^(1/2)+2*a^(1/2)*c^(1/2))^-1//2*(((a*c)^(1/2)+2*a^(1/2)*c^(1/2))^(1/2)+2*x*c^(1/2)))+-1//2*a^-1//2*c^-1//2*(-1*(a*c)^(1/2)+2*a^(1/2)*c^(1/2))^-1//2*(A*c^(1/2)+B*a^(1/2))*arctan((-1*(a*c)^(1/2)+2*a^(1/2)*c^(1/2))^-1//2*(((a*c)^(1/2)+2*a^(1/2)*c^(1/2))^(1/2)+-2*x*c^(1/2))))
@test integrate((a+c*x^4+-1*a^(1/2)*c^(1/2)*x^2)^-1*(A+B*x^2), x) == :((1/2)*a^-3//4*c^-3//4*(A*c^(1/2)+B*a^(1/2))*arctan(3^(1/2)+2*x*a^-1//4*c^1//4)+-1//2*a^-3//4*c^-3//4*(A*c^(1/2)+B*a^(1/2))*arctan(3^(1/2)+-2*x*a^-1//4*c^1//4)+-1//12*3^(1/2)*a^-3//4*c^-1//4*(A+-1*B*a^(1/2)*c^-1//2)*log(a^(1/2)+c^(1/2)*x^2+-1*x*3^(1/2)*a^1//4*c^1//4)+1//12*3^(1/2)*a^-3//4*c^-1//4*(A+-1*B*a^(1/2)*c^-1//2)*log(a^(1/2)+c^(1/2)*x^2+x*3^(1/2)*a^1//4*c^1//4))
@test integrate((3+x^2+-1*x^4)^-1//2*(3+-1*x^2), x) == :((7+2*13^(1/2))^(1/2)*Elliptic.F(arcsin(x*2^(1/2)*(1+13^(1/2))^-1//2),-7//6+-1//6*13^(1/2))+-1*(-1//2+(1/2)*13^(1/2))^(1/2)*Elliptic.E(arcsin(x*2^(1/2)*(1+13^(1/2))^-1//2),-7//6+-1//6*13^(1/2)))
@test integrate((3+-1*x^4+2*x^2)^-1//2*(3+-1*x^2), x) == :(-1*Elliptic.E(arcsin(1//3*x*3^(1/2)),-3)+4*Elliptic.F(arcsin(1//3*x*3^(1/2)),-3))
@test integrate((3+-1*x^4+3*x^2)^-1//2*(3+-1*x^2), x) == :((9+2*21^(1/2))^(1/2)*Elliptic.F(arcsin(x*2^(1/2)*(3+21^(1/2))^-1//2),-5//2+-1//2*21^(1/2))+-1*(-3//2+(1/2)*21^(1/2))^(1/2)*Elliptic.E(arcsin(x*2^(1/2)*(3+21^(1/2))^-1//2),-5//2+-1//2*21^(1/2)))
@test integrate((3+-1*x^2+-1*x^4)^-1//2*(3+-1*x^2), x) == :((5+2*13^(1/2))^(1/2)*Elliptic.F(arcsin(x*2^(1/2)*(-1+13^(1/2))^-1//2),-7//6+1//6*13^(1/2))+-1*(1/2+(1/2)*13^(1/2))^(1/2)*Elliptic.E(arcsin(x*2^(1/2)*(-1+13^(1/2))^-1//2),-7//6+1//6*13^(1/2)))
@test integrate((3+-1*x^4+-2*x^2)^-1//2*(3+-1*x^2), x) == :(-1*3^(1/2)*Elliptic.E(arcsin(x),-1//3)+2*3^(1/2)*Elliptic.F(arcsin(x),-1//3))
@test integrate((3+-1*x^4+-3*x^2)^-1//2*(3+-1*x^2), x) == :((3+2*21^(1/2))^(1/2)*Elliptic.F(arcsin(x*2^(1/2)*(-3+21^(1/2))^-1//2),-5//2+(1/2)*21^(1/2))+-1*(3//2+(1/2)*21^(1/2))^(1/2)*Elliptic.E(arcsin(x*2^(1/2)*(-3+21^(1/2))^-1//2),-5//2+(1/2)*21^(1/2)))
@test integrate((a+b*x^2+c*x^4)^-1//2*(b+-1*(b^2+-4*a*c)^(1/2)+2*c*x^2), x) == :(2*x*c^(1/2)*(a^(1/2)+c^(1/2)*x^2)^-1*(a+b*x^2+c*x^4)^(1/2)+-2*a^1//4*c^1//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+b*x^2+c*x^4))^(1/2)*(a+b*x^2+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*Elliptic.E(2*arctan(x*a^-1//4*c^1//4),1/2+-1//4*b*a^-1//2*c^-1//2)+(1/2)*a^-1//4*c^-1//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+b*x^2+c*x^4))^(1/2)*(a+b*x^2+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*(b+-1*(b^2+-4*a*c)^(1/2)+2*a^(1/2)*c^(1/2))*Elliptic.F(2*arctan(x*a^-1//4*c^1//4),1/2+-1//4*b*a^-1//2*c^-1//2))
@test integrate((d+e*x^2)^4*(a+c*x^4), x) == :(a*x*d^4+1//5*d^2*x^5*(c*d^2+6*a*e^2)+1//9*e^2*x^9*(a*e^2+6*c*d^2)+1//13*c*e^4*x^13+4//3*a*e*d^3*x^3+4//7*d*e*x^7*(a*e^2+c*d^2)+4//11*c*d*e^3*x^11)
@test integrate((d+e*x^2)^3*(a+c*x^4), x) == :(a*x*d^3+1//5*d*x^5*(c*d^2+3*a*e^2)+1//7*e*x^7*(a*e^2+3*c*d^2)+1//11*c*e^3*x^11+a*e*d^2*x^3+1//3*c*d*e^2*x^9)
@test integrate((d+e*x^2)^2*(a+c*x^4), x) == :(1//5*x^5*(a*e^2+c*d^2)+a*x*d^2+1//9*c*e^2*x^9+2//3*a*d*e*x^3+2//7*c*d*e*x^7)
@test integrate((a+c*x^4)*(d+e*x^2), x) == :(a*d*x+1//3*a*e*x^3+1//5*c*d*x^5+1//7*c*e*x^7)
@test integrate((d+e*x^2)^-1*(a+c*x^4), x) == :(1//3*c*e^-1*x^3+d^-1//2*e^-5//2*(a*e^2+c*d^2)*arctan(x*d^-1//2*e^(1/2))+-1*c*d*x*e^-2)
@test integrate((d+e*x^2)^-2*(a+c*x^4), x) == :(c*x*e^-2+(1/2)*x*d^-1*(d+e*x^2)^-1*(a+c*d^2*e^-2)+-1//2*d^-3//2*e^-5//2*(-1*a*e^2+3*c*d^2)*arctan(x*d^-1//2*e^(1/2)))
@test integrate((d+e*x^2)^-3*(a+c*x^4), x) == :(x*(8d+8*e*x^2)^-1*(-5*c*e^-2+3*a*d^-2)+1//4*x*d^-1*(d+e*x^2)^-2*(a+c*d^2*e^-2)+1//8*d^-5//2*e^-5//2*(3*a*e^2+3*c*d^2)*arctan(x*d^-1//2*e^(1/2)))
@test integrate((d+e*x^2)^-4*(a+c*x^4), x) == :(1//24*x*(d+e*x^2)^-2*(-7*c*e^-2+5*a*d^-2)+1//6*x*d^-1*(d+e*x^2)^-3*(a+c*d^2*e^-2)+1//16*x*d^-1*(d+e*x^2)^-1*(c*e^-2+5*a*d^-2)+1//16*d^-7//2*e^-5//2*(c*d^2+5*a*e^2)*arctan(x*d^-1//2*e^(1/2)))
@test integrate((a+c*x^4)^2*(d+e*x^2)^3, x) == :(x*a^2*d^3+1//15*c^2*e^3*x^15+e*a^2*d^2*x^3+1//5*a*d*x^5*(2*c*d^2+3*a*e^2)+1//7*a*e*x^7*(a*e^2+6*c*d^2)+1//9*c*d*x^9*(c*d^2+6*a*e^2)+1//11*c*e*x^11*(2*a*e^2+3*c*d^2)+3//13*d*c^2*e^2*x^13)
@test integrate((a+c*x^4)^2*(d+e*x^2)^2, x) == :(x*a^2*d^2+1//5*a*x^5*(a*e^2+2*c*d^2)+1//9*c*x^9*(c*d^2+2*a*e^2)+1//13*c^2*e^2*x^13+2//3*d*e*a^2*x^3+2//11*d*e*c^2*x^11+4//7*a*c*d*e*x^7)
@test integrate((a+c*x^4)^2*(d+e*x^2), x) == :(d*x*a^2+1//3*e*a^2*x^3+1//9*d*c^2*x^9+1//11*e*c^2*x^11+2//5*a*c*d*x^5+2//7*a*c*e*x^7)
@test integrate((a+c*x^4)^2, x) == :(x*a^2+1//9*c^2*x^9+2//5*a*c*x^5)
@test integrate((a+c*x^4)^2*(d+e*x^2)^-1, x) == :(1//7*c^2*e^-1*x^7+d^-1//2*e^-9//2*(a*e^2+c*d^2)^2*arctan(x*d^-1//2*e^(1/2))+-1//5*d*c^2*e^-2*x^5+1//3*c*e^-3*x^3*(c*d^2+2*a*e^2)+-1*c*d*x*e^-4*(c*d^2+2*a*e^2))
@test integrate((a+c*x^4)^2*(d+e*x^2)^-2, x) == :(1//5*c^2*e^-2*x^5+c*x*e^-4*(2*a*e^2+3*c*d^2)+-2//3*d*c^2*e^-3*x^3+(1/2)*x*d^-1*e^-4*(d+e*x^2)^-1*(a*e^2+c*d^2)^2+-1//2*d^-3//2*e^-9//2*(a*e^2+c*d^2)*(-1*a*e^2+7*c*d^2)*arctan(x*d^-1//2*e^(1/2)))
@test integrate((a+c*x^4)^2*(d+e*x^2)^-3, x) == :(1//3*c^2*e^-3*x^3+-3*d*x*c^2*e^-4+1//8*x*d^-2*(d+e*x^2)^-1*(3*a^2+-13*c^2*d^4*e^-4+-10*a*c*d^2*e^-2)+1//8*d^-5//2*e^-9//2*(3*a^2*e^4+35*c^2*d^4+6*a*c*d^2*e^2)*arctan(x*d^-1//2*e^(1/2))+1//4*x*d^-1*e^-4*(d+e*x^2)^-2*(a*e^2+c*d^2)^2)
@test integrate((a+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/2)*c^(1/2))*log(a^(1/2)+c^(1/2)*x^2+-1*x*2^(1/2)*a^1//4*c^1//4)+1//4*2^(1/2)*a^-3//4*c^-5//4*(c*d^2+-1*a*e^2+2*d*e*a^(1/2)*c^(1/2))*arctan(1+x*2^(1/2)*a^-1//4*c^1//4)+1//8*2^(1/2)*a^-3//4*c^-5//4*(c*d^2+-1*a*e^2+-2*d*e*a^(1/2)*c^(1/2))*log(a^(1/2)+c^(1/2)*x^2+x*2^(1/2)*a^1//4*c^1//4))
@test integrate((a+c*x^4)^-1*(d+e*x^2), x) == :(-1//4*2^(1/2)*a^-3//4*c^-3//4*(d*c^(1/2)+e*a^(1/2))*arctan(1+-1*x*2^(1/2)*a^-1//4*c^1//4)+-1//8*2^(1/2)*a^-3//4*c^-3//4*(d*c^(1/2)+-1*e*a^(1/2))*log(a^(1/2)+c^(1/2)*x^2+-1*x*2^(1/2)*a^1//4*c^1//4)+1//4*2^(1/2)*a^-3//4*c^-3//4*(d*c^(1/2)+e*a^(1/2))*arctan(1+x*2^(1/2)*a^-1//4*c^1//4)+1//8*2^(1/2)*a^-3//4*c^-3//4*(d*c^(1/2)+-1*e*a^(1/2))*log(a^(1/2)+c^(1/2)*x^2+x*2^(1/2)*a^1//4*c^1//4))
@test integrate((a+c*x^4)^-1, x) == :(-1//4*2^(1/2)*a^-3//4*c^-1//4*arctan(1+-1*x*2^(1/2)*a^-1//4*c^1//4)+-1//8*2^(1/2)*a^-3//4*c^-1//4*log(a^(1/2)+c^(1/2)*x^2+-1*x*2^(1/2)*a^1//4*c^1//4)+1//4*2^(1/2)*a^-3//4*c^-1//4*arctan(1+x*2^(1/2)*a^-1//4*c^1//4)+1//8*2^(1/2)*a^-3//4*c^-1//4*log(a^(1/2)+c^(1/2)*x^2+x*2^(1/2)*a^1//4*c^1//4))
@test integrate((a+c*x^4)^-1*(d+e*x^2)^-1, x) == :(d^-1//2*e^3//2*(a*e^2+c*d^2)^-1*arctan(x*d^-1//2*e^(1/2))+-1//4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e*a^(1/2)*c^(1/2))*log(a^(1/2)+c^(1/2)*x^2+x*2^(1/2)*a^1//4*c^1//4))
@test integrate((a+c*x^4)^-2*(d+e*x^2)^3, x) == :(-1*c^-1*e^3*x^3*(a+c*x^4)^-1+1//4*x*a^-1*c^-1*(a+c*x^4)^-1*(d*(c*d^2+-3*a*e^2)+3*e*x^2*(a*e^2+c*d^2))+-1//16*2^(1/2)*a^-7//4*c^-7//4*(a*e^2+c*d^2)*(3*d*c^(1/2)+3*e*a^(1/2))*arctan(1+-1*x*2^(1/2)*a^-1//4*c^1//4)+-1//32*2^(1/2)*a^-7//4*c^-7//4*(a*e^2+c*d^2)*(-3*e*a^(1/2)+3*d*c^(1/2))*log(a^(1/2)+c^(1/2)*x^2+-1*x*2^(1/2)*a^1//4*c^1//4)+1//16*2^(1/2)*a^-7//4*c^-7//4*(a*e^2+c*d^2)*(3*d*c^(1/2)+3*e*a^(1/2))*arctan(1+x*2^(1/2)*a^-1//4*c^1//4)+1//32*2^(1/2)*a^-7//4*c^-7//4*(a*e^2+c*d^2)*(-3*e*a^(1/2)+3*d*c^(1/2))*log(a^(1/2)+c^(1/2)*x^2+x*2^(1/2)*a^1//4*c^1//4))
@test integrate((a+c*x^4)^-2*(d+e*x^2)^2, x) == :(-1//3*x*c^-1*e^2*(a+c*x^4)^-1+-1//16*2^(1/2)*a^-7//4*c^-5//4*(a*e^2+3*c*d^2+2*d*e*a^(1/2)*c^(1/2))*arctan(1+-1*x*2^(1/2)*a^-1//4*c^1//4)+-1//32*2^(1/2)*a^-7//4*c^-5//4*(a*e^2+3*c*d^2+-2*d*e*a^(1/2)*c^(1/2))*log(a^(1/2)+c^(1/2)*x^2+-1*x*2^(1/2)*a^1//4*c^1//4)+1//12*x*a^-1*c^-1*(a+c*x^4)^-1*(a*e^2+3*c*d^2+6*c*d*e*x^2)+1//16*2^(1/2)*a^-7//4*c^-5//4*(a*e^2+3*c*d^2+2*d*e*a^(1/2)*c^(1/2))*arctan(1+x*2^(1/2)*a^-1//4*c^1//4)+1//32*2^(1/2)*a^-7//4*c^-5//4*(a*e^2+3*c*d^2+-2*d*e*a^(1/2)*c^(1/2))*log(a^(1/2)+c^(1/2)*x^2+x*2^(1/2)*a^1//4*c^1//4))
@test integrate((a+c*x^4)^-2*(d+e*x^2), x) == :(1//4*x*a^-1*(a+c*x^4)^-1*(d+e*x^2)+-1//16*2^(1/2)*a^-7//4*c^-3//4*(e*a^(1/2)+3*d*c^(1/2))*arctan(1+-1*x*2^(1/2)*a^-1//4*c^1//4)+-1//32*2^(1/2)*a^-7//4*c^-3//4*(-1*e*a^(1/2)+3*d*c^(1/2))*log(a^(1/2)+c^(1/2)*x^2+-1*x*2^(1/2)*a^1//4*c^1//4)+1//16*2^(1/2)*a^-7//4*c^-3//4*(e*a^(1/2)+3*d*c^(1/2))*arctan(1+x*2^(1/2)*a^-1//4*c^1//4)+1//32*2^(1/2)*a^-7//4*c^-3//4*(-1*e*a^(1/2)+3*d*c^(1/2))*log(a^(1/2)+c^(1/2)*x^2+x*2^(1/2)*a^1//4*c^1//4))
@test integrate((a+c*x^4)^-2, x) == :(1//4*x*a^-1*(a+c*x^4)^-1+-3//16*2^(1/2)*a^-7//4*c^-1//4*arctan(1+-1*x*2^(1/2)*a^-1//4*c^1//4)+-3//32*2^(1/2)*a^-7//4*c^-1//4*log(a^(1/2)+c^(1/2)*x^2+-1*x*2^(1/2)*a^1//4*c^1//4)+3//16*2^(1/2)*a^-7//4*c^-1//4*arctan(1+x*2^(1/2)*a^-1//4*c^1//4)+3//32*2^(1/2)*a^-7//4*c^-1//4*log(a^(1/2)+c^(1/2)*x^2+x*2^(1/2)*a^1//4*c^1//4))
@test integrate((a+c*x^4)^-2*(d+e*x^2)^-1, x) == :(d^-1//2*e^7//2*(a*e^2+c*d^2)^-2*arctan(x*d^-1//2*e^(1/2))+-1//16*2^(1/2)*a^-7//4*c^1//4*(a*e^2+c*d^2)^-1*(-1*e*a^(1/2)+3*d*c^(1/2))*arctan(1+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/2))*log(a^(1/2)+c^(1/2)*x^2+x*2^(1/2)*a^1//4*c^1//4))
@test integrate((a+c*x^4)^-1//2*(d+e*x^2)^4, x) == :(1//7*c^-1*e^4*x^5*(a+c*x^4)^(1/2)+1//21*x*c^-2*e^2*(a+c*x^4)^(1/2)*(-5*a*e^2+42*c*d^2)+4//5*d*c^-1*e^3*x^3*(a+c*x^4)^(1/2)+1//210*a^-1//4*c^-9//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4))^(1/2)*(a+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*(25*a^2*e^4+105*c^2*d^4+-252*d*a^3//2*c^(1/2)*e^3+-210*a*c*d^2*e^2+420*e*a^(1/2)*c^3//2*d^3)*Elliptic.F(2*arctan(x*a^-1//4*c^1//4),1/2)+4//5*d*e*x*c^-3//2*(a+c*x^4)^(1/2)*(a^(1/2)+c^(1/2)*x^2)^-1*(-3*a*e^2+5*c*d^2)+-4//5*d*e*a^1//4*c^-7//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4))^(1/2)*(a+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*(-3*a*e^2+5*c*d^2)*Elliptic.E(2*arctan(x*a^-1//4*c^1//4),1/2))
@test integrate((a+c*x^4)^-1//2*(d+e*x^2)^3, x) == :(1//5*c^-1*e^3*x^3*(a+c*x^4)^(1/2)+d*x*c^-1*e^2*(a+c*x^4)^(1/2)+3//5*e*x*c^-3//2*(a+c*x^4)^(1/2)*(a^(1/2)+c^(1/2)*x^2)^-1*(-1*a*e^2+5*c*d^2)+1//10*a^1//4*c^-7//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4))^(1/2)*(a+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*(-3*a*e^3+15*c*e*d^2+5*d*a^-1//2*c^(1/2)*(c*d^2+-1*a*e^2))*Elliptic.F(2*arctan(x*a^-1//4*c^1//4),1/2)+-3//5*e*a^1//4*c^-7//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4))^(1/2)*(a+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*(-1*a*e^2+5*c*d^2)*Elliptic.E(2*arctan(x*a^-1//4*c^1//4),1/2))
@test integrate((a+c*x^4)^-1//2*(d+e*x^2)^2, x) == :(1//3*x*c^-1*e^2*(a+c*x^4)^(1/2)+2*d*e*x*c^-1//2*(a+c*x^4)^(1/2)*(a^(1/2)+c^(1/2)*x^2)^-1+1//6*a^-1//4*c^-5//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4))^(1/2)*(a+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*(-1*a*e^2+3*c*d^2+6*d*e*a^(1/2)*c^(1/2))*Elliptic.F(2*arctan(x*a^-1//4*c^1//4),1/2)+-2*d*e*a^1//4*c^-3//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4))^(1/2)*(a+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*Elliptic.E(2*arctan(x*a^-1//4*c^1//4),1/2))
@test integrate((a+c*x^4)^-1//2*(d+e*x^2), x) == :(e*x*c^-1//2*(a+c*x^4)^(1/2)*(a^(1/2)+c^(1/2)*x^2)^-1+(1/2)*a^1//4*c^-3//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4))^(1/2)*(a+c*x^4)^-1//2*(e+d*a^-1//2*c^(1/2))*(a^(1/2)+c^(1/2)*x^2)*Elliptic.F(2*arctan(x*a^-1//4*c^1//4),1/2)+-1*e*a^1//4*c^-3//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4))^(1/2)*(a+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*Elliptic.E(2*arctan(x*a^-1//4*c^1//4),1/2))
@test integrate((a+-1*c*x^4)^-1//2*(d+e*x^2)^3, x) == :(-1//5*c^-1*e^3*x^3*(a+-1*c*x^4)^(1/2)+-1*d*x*c^-1*e^2*(a+-1*c*x^4)^(1/2)+1//5*a^3//4*c^-7//4*(1+-1*c*a^-1*x^4)^(1/2)*(a+-1*c*x^4)^-1//2*(-3*e*(a*e^2+5*c*d^2)+5*d*a^-1//2*c^(1/2)*(a*e^2+c*d^2))*Elliptic.F(arcsin(x*a^-1//4*c^1//4),-1)+3//5*e*a^3//4*c^-7//4*(1+-1*c*a^-1*x^4)^(1/2)*(a+-1*c*x^4)^-1//2*(a*e^2+5*c*d^2)*Elliptic.E(arcsin(x*a^-1//4*c^1//4),-1))
@test integrate((a+-1*c*x^4)^-1//2*(d+e*x^2)^2, x) == :(-1//3*x*c^-1*e^2*(a+-1*c*x^4)^(1/2)+1//3*a^1//4*c^-5//4*(1+-1*c*a^-1*x^4)^(1/2)*(a+-1*c*x^4)^-1//2*(a*e^2+3*c*d^2+-6*d*e*a^(1/2)*c^(1/2))*Elliptic.F(arcsin(x*a^-1//4*c^1//4),-1)+2*d*e*a^3//4*c^-3//4*(1+-1*c*a^-1*x^4)^(1/2)*(a+-1*c*x^4)^-1//2*Elliptic.E(arcsin(x*a^-1//4*c^1//4),-1))
@test integrate((a+-1*c*x^4)^-1//2*(d+e*x^2), x) == :(e*a^3//4*c^-3//4*(1+-1*c*a^-1*x^4)^(1/2)*(a+-1*c*x^4)^-1//2*Elliptic.E(arcsin(x*a^-1//4*c^1//4),-1)+a^3//4*c^-3//4*(1+-1*c*a^-1*x^4)^(1/2)*(a+-1*c*x^4)^-1//2*(-1*e+d*a^-1//2*c^(1/2))*Elliptic.F(arcsin(x*a^-1//4*c^1//4),-1))
@test integrate((-1a+c*x^4)^-1//2*(d+e*x^2), x) == :(e*a^3//4*c^-3//4*(1+-1*c*a^-1*x^4)^(1/2)*(-1a+c*x^4)^-1//2*Elliptic.E(arcsin(x*a^-1//4*c^1//4),-1)+a^3//4*c^-3//4*(1+-1*c*a^-1*x^4)^(1/2)*(-1a+c*x^4)^-1//2*(-1*e+d*a^-1//2*c^(1/2))*Elliptic.F(arcsin(x*a^-1//4*c^1//4),-1))
@test integrate((-1a+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2), x) == :(a^3//4*c^-1//4*(1+-1*c*a^-1*x^4)^(1/2)*(-1a+c*x^4)^-1//2*Elliptic.E(arcsin(x*a^-1//4*c^1//4),-1))
@test integrate((-1a+c*x^4)^-1//2*(1+x^2*(c*a^-1)^(1/2)), x) == :((c*a^-1)^-1//4*(1+-1*c*a^-1*x^4)^(1/2)*(-1a+c*x^4)^-1//2*Elliptic.E(arcsin(x*(c*a^-1)^1//4),-1))
@test integrate((-1a+-1*c*x^4)^-1//2*(d+e*x^2), x) == :(-1*e*x*c^-1//2*(a^(1/2)+c^(1/2)*x^2)^-1*(-1a+-1*c*x^4)^(1/2)+(1/2)*a^1//4*c^-3//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4))^(1/2)*(-1a+-1*c*x^4)^-1//2*(e+d*a^-1//2*c^(1/2))*(a^(1/2)+c^(1/2)*x^2)*Elliptic.F(2*arctan(x*a^-1//4*c^1//4),1/2)+-1*e*a^1//4*c^-3//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4))^(1/2)*(-1a+-1*c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*Elliptic.E(2*arctan(x*a^-1//4*c^1//4),1/2))
@test integrate((d+e*x^2)^4*(d^2+-1*e^2*x^4)^-1, x) == :(-7*x*d^2+-1//5*e^2*x^5+8*d^5//2*e^-1//2*arctanh(x*d^-1//2*e^(1/2))+-4//3*d*e*x^3)
@test integrate((d+e*x^2)^3*(d^2+-1*e^2*x^4)^-1, x) == :(-3*d*x+-1//3*e*x^3+4*d^3//2*e^-1//2*arctanh(x*d^-1//2*e^(1/2)))
@test integrate((d+e*x^2)^2*(d^2+-1*e^2*x^4)^-1, x) == :(-1x+2*d^(1/2)*e^-1//2*arctanh(x*d^-1//2*e^(1/2)))
@test integrate((d^2+-1*e^2*x^4)^-1*(d+e*x^2), x) == :(d^-1//2*e^-1//2*arctanh(x*d^-1//2*e^(1/2)))
@test integrate((d+e*x^2)^-1*(d^2+-1*e^2*x^4)^-1, x) == :((1/2)*d^-5//2*e^-1//2*arctan(x*d^-1//2*e^(1/2))+1//4*x*d^-2*(d+e*x^2)^-1+1//4*d^-5//2*e^-1//2*arctanh(x*d^-1//2*e^(1/2)))
@test integrate((d+e*x^2)^-2*(d^2+-1*e^2*x^4)^-1, x) == :(1//8*x*d^-2*(d+e*x^2)^-2+1//8*d^-7//2*e^-1//2*arctanh(x*d^-1//2*e^(1/2))+5//16*x*d^-3*(d+e*x^2)^-1+7//16*d^-7//2*e^-1//2*arctan(x*d^-1//2*e^(1/2)))
@test integrate((d+e*x^2)^3//2*(d^2+-1*e^2*x^4)^-1, x) == :(-1*e^-1//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+2^(1/2)*e^-1//2*arctanh(x*2^(1/2)*e^(1/2)*(d+e*x^2)^-1//2))
@test integrate((d+e*x^2)^(1/2)*(d^2+-1*e^2*x^4)^-1, x) == :((1/2)*2^(1/2)*d^-1*e^-1//2*arctanh(x*2^(1/2)*e^(1/2)*(d+e*x^2)^-1//2))
@test integrate((d+e*x^2)^-1//2*(d^2+-1*e^2*x^4)^-1, x) == :((1/2)*x*d^-2*(d+e*x^2)^-1//2+1//4*2^(1/2)*d^-2*e^-1//2*arctanh(x*2^(1/2)*e^(1/2)*(d+e*x^2)^-1//2))
@test integrate((d+e*x^2)^-3//2*(d^2+-1*e^2*x^4)^-1, x) == :(1//6*x*d^-2*(d+e*x^2)^-3//2+7//12*x*d^-3*(d+e*x^2)^-1//2+1//8*2^(1/2)*d^-3*e^-1//2*arctanh(x*2^(1/2)*e^(1/2)*(d+e*x^2)^-1//2))
@test integrate((a+b*x^2)^5//2*(a^2+-1*b^2*x^4)^-1//2, x) == :(-1//4*x*(a+b*x^2)^3//2*(a^2+-1*b^2*x^4)^-1//2*(a+-1*b*x^2)+-9//8*a*x*(a+b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*(a+-1*b*x^2)+19//8*a^2*b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctan(x*b^(1/2)*(a+-1*b*x^2)^-1//2))
@test integrate((a+b*x^2)^3//2*(a^2+-1*b^2*x^4)^-1//2, x) == :(-1//2*x*(a+b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*(a+-1*b*x^2)+3//2*a*b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctan(x*b^(1/2)*(a+-1*b*x^2)^-1//2))
@test integrate((a+b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2, x) == :(b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctan(x*b^(1/2)*(a+-1*b*x^2)^-1//2))
@test integrate((a+b*x^2)^-1//2*(a^2+-1*b^2*x^4)^-1//2, x) == :((1/2)*2^(1/2)*a^-1*b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctan(x*2^(1/2)*b^(1/2)*(a+-1*b*x^2)^-1//2))
@test integrate((a+b*x^2)^-3//2*(a^2+-1*b^2*x^4)^-1//2, x) == :(1//4*x*a^-2*(a+b*x^2)^-1//2*(a^2+-1*b^2*x^4)^-1//2*(a+-1*b*x^2)+3//8*2^(1/2)*a^-2*b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctan(x*2^(1/2)*b^(1/2)*(a+-1*b*x^2)^-1//2))
@test integrate((a+b*x^2)^-5//2*(a^2+-1*b^2*x^4)^-1//2, x) == :(1//8*x*a^-2*(a+b*x^2)^-3//2*(a^2+-1*b^2*x^4)^-1//2*(a+-1*b*x^2)+9//32*x*a^-3*(a+b*x^2)^-1//2*(a^2+-1*b^2*x^4)^-1//2*(a+-1*b*x^2)+19//64*2^(1/2)*a^-3*b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctan(x*2^(1/2)*b^(1/2)*(a+-1*b*x^2)^-1//2))
@test integrate((a+-1*b*x^2)^5//2*(a^2+-1*b^2*x^4)^-1//2, x) == :(-1//4*x*(a+-1*b*x^2)^3//2*(a^2+-1*b^2*x^4)^-1//2*(a+b*x^2)+-9//8*a*x*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*(a+b*x^2)+19//8*a^2*b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctanh(x*b^(1/2)*(a+b*x^2)^-1//2))
@test integrate((a+-1*b*x^2)^3//2*(a^2+-1*b^2*x^4)^-1//2, x) == :(-1//2*x*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*(a+b*x^2)+3//2*a*b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctanh(x*b^(1/2)*(a+b*x^2)^-1//2))
@test integrate((a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2, x) == :(b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctanh(x*b^(1/2)*(a+b*x^2)^-1//2))
@test integrate((a+-1*b*x^2)^-1//2*(a^2+-1*b^2*x^4)^-1//2, x) == :((1/2)*2^(1/2)*a^-1*b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctanh(x*2^(1/2)*b^(1/2)*(a+b*x^2)^-1//2))
@test integrate((a+-1*b*x^2)^-3//2*(a^2+-1*b^2*x^4)^-1//2, x) == :(1//4*x*a^-2*(a+-1*b*x^2)^-1//2*(a^2+-1*b^2*x^4)^-1//2*(a+b*x^2)+3//8*2^(1/2)*a^-2*b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctanh(x*2^(1/2)*b^(1/2)*(a+b*x^2)^-1//2))
@test integrate((a+-1*b*x^2)^-5//2*(a^2+-1*b^2*x^4)^-1//2, x) == :(1//8*x*a^-2*(a+-1*b*x^2)^-3//2*(a^2+-1*b^2*x^4)^-1//2*(a+b*x^2)+9//32*x*a^-3*(a+-1*b*x^2)^-1//2*(a^2+-1*b^2*x^4)^-1//2*(a+b*x^2)+19//64*2^(1/2)*a^-3*b^-1//2*(a+b*x^2)^(1/2)*(a+-1*b*x^2)^(1/2)*(a^2+-1*b^2*x^4)^-1//2*arctanh(x*2^(1/2)*b^(1/2)*(a+b*x^2)^-1//2))
@test integrate((-1+x^2)^(1/2)*(-1+x^4)^-1//2, x) == :((1+x^2)^(1/2)*(-1+x^2)^(1/2)*(-1+x^4)^-1//2*arcsinh(x))
@test integrate((d+e*x^2)^4*(-1*c*d^2+b*d*e+b*e^2*x^2+c*e^2*x^4)^-1, x) == :(x*c^-3*(b^2*e^2+7*c^2*d^2+-5*b*c*d*e)+1//5*c^-1*e^2*x^5+1//3*e*c^-2*x^3*(-1*b*e+4*c*d)+-1*c^-7//2*e^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^3*arctanh(x*c^(1/2)*e^(1/2)*(c*d+-1*b*e)^-1//2))
@test integrate((d+e*x^2)^3*(-1*c*d^2+b*d*e+b*e^2*x^2+c*e^2*x^4)^-1, x) == :(x*c^-2*(-1*b*e+3*c*d)+1//3*e*c^-1*x^3+-1*c^-5//2*e^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^2*arctanh(x*c^(1/2)*e^(1/2)*(c*d+-1*b*e)^-1//2))
@test integrate((d+e*x^2)^2*(-1*c*d^2+b*d*e+b*e^2*x^2+c*e^2*x^4)^-1, x) == :(x*c^-1+-1*c^-3//2*e^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)*arctanh(x*c^(1/2)*e^(1/2)*(c*d+-1*b*e)^-1//2))
@test integrate((-1*c*d^2+b*d*e+b*e^2*x^2+c*e^2*x^4)^-1*(d+e*x^2), x) == :(-1*c^-1//2*e^-1//2*(c*d+-1*b*e)^-1//2*arctanh(x*c^(1/2)*e^(1/2)*(c*d+-1*b*e)^-1//2))
@test integrate((d+e*x^2)^-1*(-1*c*d^2+b*d*e+b*e^2*x^2+c*e^2*x^4)^-1, x) == :(-1//2*x*d^-1*(d+e*x^2)^-1*(-1*b*e+2*c*d)^-1+-1*c^3//2*e^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^-2*arctanh(x*c^(1/2)*e^(1/2)*(c*d+-1*b*e)^-1//2)+-1//2*d^-3//2*e^-1//2*(-1*b*e+2*c*d)^-2*(-1*b*e+4*c*d)*arctan(x*d^-1//2*e^(1/2)))
@test integrate((d+e*x^2)^-2*(-1*c*d^2+b*d*e+b*e^2*x^2+c*e^2*x^4)^-1, x) == :(-1//4*x*d^-1*(d+e*x^2)^-2*(-1*b*e+2*c*d)^-1+-1*c^5//2*e^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^-3*arctanh(x*c^(1/2)*e^(1/2)*(c*d+-1*b*e)^-1//2)+-1//8*x*d^-2*(d+e*x^2)^-1*(-1*b*e+2*c*d)^-2*(-3*b*e+10*c*d)+-1//8*d^-5//2*e^-1//2*(-1*b*e+2*c*d)^-3*(3*b^2*e^2+28*c^2*d^2+-16*b*c*d*e)*arctan(x*d^-1//2*e^(1/2)))
@test integrate((d+e*x^2)^5//2*(-1*c*d^2+b*d*e+b*e^2*x^2+c*e^2*x^4)^-1, x) == :((1/2)*x*c^-1*(d+e*x^2)^(1/2)+(1/2)*c^-2*e^-1//2*(-2*b*e+5*c*d)*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1*c^-2*e^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^3//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^(1/2)))
@test integrate((d+e*x^2)^3//2*(-1*c*d^2+b*d*e+b*e^2*x^2+c*e^2*x^4)^-1, x) == :(c^-1*e^-1//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1*c^-1*e^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^(1/2)*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^(1/2)))
@test integrate((d+e*x^2)^(1/2)*(-1*c*d^2+b*d*e+b*e^2*x^2+c*e^2*x^4)^-1, x) == :(-1*e^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^-1//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^(1/2)))
@test integrate((d+e*x^2)^-1//2*(-1*c*d^2+b*d*e+b*e^2*x^2+c*e^2*x^4)^-1, x) == :(-1*x*d^-1*(d+e*x^2)^-1//2*(-1*b*e+2*c*d)^-1+-1*c*e^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^-3//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^(1/2)))
@test integrate((d+e*x^2)^-3//2*(-1*c*d^2+b*d*e+b*e^2*x^2+c*e^2*x^4)^-1, x) == :(-1//3*x*d^-1*(d+e*x^2)^-3//2*(-1*b*e+2*c*d)^-1+-1*c^2*e^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^-5//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2*(c*d+-1*b*e)^-1//2*(-1*b*e+2*c*d)^(1/2))+-1//3*x*d^-2*(d+e*x^2)^-1//2*(-1*b*e+2*c*d)^-2*(-2*b*e+7*c*d))
@test integrate((1+x^2)^3*(1+x^2+x^4)^(1/2), x) == :(1//3*x*(1+x^2+x^4)^3//2+1//9*x^3*(1+x^2+x^4)^3//2+26*x*(45+45*x^2)^-1*(1+x^2+x^4)^(1/2)+2//45*x*(1+x^2+x^4)^(1/2)*(7+6*x^2)+-1//45*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(26+26*x^2)*Elliptic.E(2*arctan(x),1//4)+1//15*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(7+7*x^2)*Elliptic.F(2*arctan(x),1//4))
@test integrate((1+x^2)^2*(1+x^2+x^4)^(1/2), x) == :(1//7*x*(1+x^2+x^4)^3//2+2*x*(3+3*x^2)^-1*(1+x^2+x^4)^(1/2)+2//21*x*(1+x^2+x^4)^(1/2)*(4+3*x^2)+-1//3*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(2+2*x^2)*Elliptic.E(2*arctan(x),1//4)+1//7*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(4+4*x^2)*Elliptic.F(2*arctan(x),1//4))
@test integrate((1+x^2+x^4)^(1/2)*(1+x^2), x) == :(3*x*(5+5*x^2)^-1*(1+x^2+x^4)^(1/2)+1//5*x*(1+x^2+x^4)^(1/2)*(2+x^2)+-1//5*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(3+3*x^2)*Elliptic.E(2*arctan(x),1//4)+1//5*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(3+3*x^2)*Elliptic.F(2*arctan(x),1//4))
@test integrate((1+x^2)^-1*(1+x^2+x^4)^(1/2), x) == :((1/2)*arctan(x*(1+x^2+x^4)^-1//2)+x*(1+x^2)^-1*(1+x^2+x^4)^(1/2)+-1*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.E(2*arctan(x),1//4)+1//4*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(3+3*x^2)*Elliptic.F(2*arctan(x),1//4))
@test integrate((1+x^2)^-2*(1+x^2+x^4)^(1/2), x) == :((1/2)*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.E(2*arctan(x),1//4))
@test integrate((1+x^2)^-3*(1+x^2+x^4)^(1/2), x) == :(1//4*arctan(x*(1+x^2+x^4)^-1//2)+1//4*x*(1+x^2)^-2*(1+x^2+x^4)^(1/2)+1//4*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.E(2*arctan(x),1//4))
@test integrate((1+x^2)^-4*(1+x^2+x^4)^(1/2), x) == :(1//4*arctan(x*(1+x^2+x^4)^-1//2)+1//6*x*(1+x^2)^-3*(1+x^2+x^4)^(1/2)+1//6*x*(1+x^2)^-2*(1+x^2+x^4)^(1/2)+-1//8*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.F(2*arctan(x),1//4)+1//3*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.E(2*arctan(x),1//4))
@test integrate((1+x^2)^3*(1+x^2+x^4)^-1//2, x) == :(1//5*x^3*(1+x^2+x^4)^(1/2)+11//15*x*(1+x^2+x^4)^(1/2)+14*x*(15+15*x^2)^-1*(1+x^2+x^4)^(1/2)+-1//15*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(14+14*x^2)*Elliptic.E(2*arctan(x),1//4)+1//5*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(3+3*x^2)*Elliptic.F(2*arctan(x),1//4))
@test integrate((1+x^2)^2*(1+x^2+x^4)^-1//2, x) == :(1//3*x*(1+x^2+x^4)^(1/2)+4*x*(3+3*x^2)^-1*(1+x^2+x^4)^(1/2)+((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.F(2*arctan(x),1//4)+-1//3*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(4+4*x^2)*Elliptic.E(2*arctan(x),1//4))
@test integrate((1+x^2+x^4)^-1//2*(1+x^2), x) == :(x*(1+x^2)^-1*(1+x^2+x^4)^(1/2)+((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.F(2*arctan(x),1//4)+-1*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.E(2*arctan(x),1//4))
@test integrate((1+x^2)^-1*(1+x^2+x^4)^-1//2, x) == :((1/2)*arctan(x*(1+x^2+x^4)^-1//2)+1//4*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.F(2*arctan(x),1//4))
@test integrate((1+x^2)^-2*(1+x^2+x^4)^-1//2, x) == :((1/2)*arctan(x*(1+x^2+x^4)^-1//2)+(1/2)*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.E(2*arctan(x),1//4)+-1//4*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.F(2*arctan(x),1//4))
@test integrate((1+x^2)^-3*(1+x^2+x^4)^-1//2, x) == :(1//4*arctan(x*(1+x^2+x^4)^-1//2)+1//4*x*(1+x^2)^-2*(1+x^2+x^4)^(1/2)+-1//2*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.F(2*arctan(x),1//4)+1//4*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(3+3*x^2)*Elliptic.E(2*arctan(x),1//4))
@test integrate((1+x^2)^3*(1+x^2+x^4)^-3//2, x) == :(2*x*(3+3*x^2)^-1*(1+x^2+x^4)^(1/2)+-1//3*x*(1+x^2+x^4)^-1//2*(1+-1*x^2)+((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.F(2*arctan(x),1//4)+-1//3*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(2+2*x^2)*Elliptic.E(2*arctan(x),1//4))
@test integrate((1+x^2)^2*(1+x^2+x^4)^-3//2, x) == :(-2*x*(3+3*x^2)^-1*(1+x^2+x^4)^(1/2)+1//3*x*(1+x^2+x^4)^-1//2*(1+2*x^2)+1//3*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(2+2*x^2)*Elliptic.E(2*arctan(x),1//4))
@test integrate((1+x^2+x^4)^-3//2*(1+x^2), x) == :(-1*x*(3+3*x^2)^-1*(1+x^2+x^4)^(1/2)+1//3*x*(1+x^2+x^4)^-1//2*(2+x^2)+1//3*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.E(2*arctan(x),1//4))
@test integrate((1+x^2)^-1*(1+x^2+x^4)^-3//2, x) == :((1/2)*arctan(x*(1+x^2+x^4)^-1//2)+2*x*(3+3*x^2)^-1*(1+x^2+x^4)^(1/2)+-1//3*x*(1+x^2+x^4)^-1//2*(1+2*x^2)+-1//3*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(2+2*x^2)*Elliptic.E(2*arctan(x),1//4)+1//4*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(3+3*x^2)*Elliptic.F(2*arctan(x),1//4))
@test integrate((1+x^2)^-2*(1+x^2+x^4)^-3//2, x) == :(x*(3+3*x^2)^-1*(1+x^2+x^4)^(1/2)+-1//3*x*(1+x^2+x^4)^-1//2*(2+x^2)+1//6*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(1+x^2)*Elliptic.E(2*arctan(x),1//4)+arctan(x*(1+x^2+x^4)^-1//2))
@test integrate((1+x^2)^-3*(1+x^2+x^4)^-3//2, x) == :(3//4*arctan(x*(1+x^2+x^4)^-1//2)+-1*x*(3+3*x^2)^-1*(1+x^2+x^4)^(1/2)+-1//3*x*(1+x^2+x^4)^-1//2*(1+-1*x^2)+1//4*x*(1+x^2)^-2*(1+x^2+x^4)^(1/2)+-1//4*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(5+5*x^2)*Elliptic.F(2*arctan(x),1//4)+1//12*((1+x^2)^-2*(1+x^2+x^4))^(1/2)*(1+x^2+x^4)^-1//2*(19+19*x^2)*Elliptic.E(2*arctan(x),1//4))
@test integrate((d+e*x^2)^4*(a+b*x^2+c*x^4), x) == :(a*x*d^4+1//3*d^3*x^3*(b*d+4*a*e)+1//5*d^2*x^5*(c*d^2+6*a*e^2+4*b*d*e)+1//9*e^2*x^9*(e*(a*e+4*b*d)+6*c*d^2)+1//11*e^3*x^11*(b*e+4*c*d)+1//13*c*e^4*x^13+2//7*d*e*x^7*(e*(2*a*e+3*b*d)+2*c*d^2))
@test integrate((d+e*x^2)^3*(a+b*x^2+c*x^4), x) == :(a*x*d^3+1//3*d^2*x^3*(b*d+3*a*e)+1//5*d*x^5*(c*d^2+3*e*(a*e+b*d))+1//7*e*x^7*(e*(a*e+3*b*d)+3*c*d^2)+1//9*e^2*x^9*(b*e+3*c*d)+1//11*c*e^3*x^11)
@test integrate((d+e*x^2)^2*(a+b*x^2+c*x^4), x) == :(1//5*x^5*(c*d^2+e*(a*e+2*b*d))+a*x*d^2+1//3*d*x^3*(b*d+2*a*e)+1//7*e*x^7*(b*e+2*c*d)+1//9*c*e^2*x^9)
@test integrate((d+e*x^2)*(a+b*x^2+c*x^4), x) == :(1//3*x^3*(a*e+b*d)+1//5*x^5*(b*e+c*d)+a*d*x+1//7*c*e*x^7)
@test integrate((d+e*x^2)^-1*(a+b*x^2+c*x^4), x) == :(-1*x*e^-2*(c*d+-1*b*e)+1//3*c*e^-1*x^3+d^-1//2*e^-5//2*(a*e^2+c*d^2+-1*b*d*e)*arctan(x*d^-1//2*e^(1/2)))
@test integrate((d+e*x^2)^-2*(a+b*x^2+c*x^4), x) == :(c*x*e^-2+(1/2)*x*d^-1*(d+e*x^2)^-1*(a+d*e^-2*(c*d+-1*b*e))+-1//2*d^-3//2*e^-5//2*(-1*e*(a*e+b*d)+3*c*d^2)*arctan(x*d^-1//2*e^(1/2)))
@test integrate((d+e*x^2)^-3*(a+b*x^2+c*x^4), x) == :(1//4*x*d^-1*(d+e*x^2)^-2*(a+d*e^-2*(c*d+-1*b*e))+1//8*d^-5//2*e^-5//2*(e*(b*d+3*a*e)+3*c*d^2)*arctan(x*d^-1//2*e^(1/2))+-1//8*x*d^-2*e^-2*(d+e*x^2)^-1*(-1*e*(b*d+3*a*e)+5*c*d^2))
@test integrate((d+e*x^2)^-4*(a+b*x^2+c*x^4), x) == :(1//6*x*d^-1*(d+e*x^2)^-3*(a+d*e^-2*(c*d+-1*b*e))+1//16*d^-7//2*e^-5//2*(c*d^2+e*(b*d+5*a*e))*arctan(x*d^-1//2*e^(1/2))+-1//24*x*d^-2*e^-2*(d+e*x^2)^-2*(-1*e*(b*d+5*a*e)+7*c*d^2)+1//16*x*d^-3*e^-2*(d+e*x^2)^-1*(c*d^2+e*(b*d+5*a*e)))
@test integrate((d+e*x^2)^3*(a+b*x^2+c*x^4)^2, x) == :(x^7*(1//7*a^2*e^3+2//7*b*c*d^3+3//7*e*b^2*d^2+6//7*a*b*d*e^2+6//7*a*c*e*d^2)+x^9*(1//9*c^2*d^3+1//9*b*e^2*(2*a*e+3*b*d)+2//3*c*d*e*(a*e+b*d))+x*a^2*d^3+1//5*d*x^5*(a*(2*c*d^2+3*a*e^2)+b^2*d^2+6*a*b*d*e)+1//11*e*x^11*(b^2*e^2+3*c^2*d^2+2*c*e*(a*e+3*b*d))+1//15*c^2*e^3*x^15+1//3*a*d^2*x^3*(2*b*d+3*a*e)+1//13*c*e^2*x^13*(2*b*e+3*c*d))
@test integrate((d+e*x^2)^2*(a+b*x^2+c*x^4)^2, x) == :(x^5*(1//5*a*(a*e^2+2*c*d^2)+1//5*b^2*d^2+4//5*a*b*d*e)+x^7*(2//7*a*b*e^2+2//7*b*c*d^2+2//7*d*e*b^2+4//7*a*c*d*e)+x^9*(1//9*b^2*e^2+1//9*c^2*d^2+2//9*c*e*(a*e+2*b*d))+x*a^2*d^2+1//13*c^2*e^2*x^13+2//3*a*d*x^3*(a*e+b*d)+2//11*c*e*x^11*(b*e+c*d))
@test integrate((a+b*x^2+c*x^4)^2*(d+e*x^2), x) == :(x^5*(1//5*d*b^2+2//5*a*b*e+2//5*a*c*d)+x^7*(1//7*e*b^2+2//7*a*c*e+2//7*b*c*d)+d*x*a^2+1//3*a*x^3*(a*e+2*b*d)+1//9*c*x^9*(c*d+2*b*e)+1//11*e*c^2*x^11)
@test integrate((a+b*x^2+c*x^4)^2, x) == :(x*a^2+x^5*(1//5*b^2+2//5*a*c)+1//9*c^2*x^9+2//3*a*b*x^3+2//7*b*c*x^7)
@test integrate((d+e*x^2)^-1*(a+b*x^2+c*x^4)^2, x) == :(1//3*e^-3*x^3*(b^2*e^2+c^2*d^2+-2*c*e*(b*d+-1*a*e))+1//7*c^2*e^-1*x^7+d^-1//2*e^-9//2*(a*e^2+c*d^2+-1*b*d*e)^2*arctan(x*d^-1//2*e^(1/2))+-1*x*e^-4*(c*d+-1*b*e)*(c*d^2+-1*e*(b*d+-2*a*e))+-1//5*c*e^-2*x^5*(c*d+-2*b*e))
@test integrate((d+e*x^2)^-2*(a+b*x^2+c*x^4)^2, x) == :(x*e^-4*(b^2*e^2+3*c^2*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1/2))^-1//2*(e*(-1*b*e+2*c*d)+-1*(b^2+-4*a*c)^-1//2*(b^2*e^2+2*c^2*d^2+-2*c*e*(a*e+b*d)))*arctan(x*2^(1/2)*c^(1/2)*(b+(b^2+-4*a*c)^(1/2))^-1//2)+(1/2)*2^(1/2)*c^-3//2*(b+-1*(b^2+-4*a*c)^(1/2))^-1//2*(e*(-1*b*e+2*c*d)+(b^2+-4*a*c)^-1//2*(b^2*e^2+2*c^2*d^2+-2*c*e*(a*e+b*d)))*arctan(x*2^(1/2)*c^(1/2)*(b+-1*(b^2+-4*a*c)^(1/2))^-1//2))
@test integrate((a+b*x^2+c*x^4)^-1*(d+e*x^2), x) == :((1/2)*2^(1/2)*c^-1//2*(b+(b^2+-4*a*c)^(1/2))^-1//2*(e+-1*(b^2+-4*a*c)^-1//2*(-1*b*e+2*c*d))*arctan(x*2^(1/2)*c^(1/2)*(b+(b^2+-4*a*c)^(1/2))^-1//2)+(1/2)*2^(1/2)*c^-1//2*(b+-1*(b^2+-4*a*c)^(1/2))^-1//2*(e+(b^2+-4*a*c)^-1//2*(-1*b*e+2*c*d))*arctan(x*2^(1/2)*c^(1/2)*(b+-1*(b^2+-4*a*c)^(1/2))^-1//2))
@test integrate((a+b*x^2+c*x^4)^-1, x) == :(2^(1/2)*c^(1/2)*(b+-1*(b^2+-4*a*c)^(1/2))^-1//2*(b^2+-4*a*c)^-1//2*arctan(x*2^(1/2)*c^(1/2)*(b+-1*(b^2+-4*a*c)^(1/2))^-1//2)+-1*2^(1/2)*c^(1/2)*(b+(b^2+-4*a*c)^(1/2))^-1//2*(b^2+-4*a*c)^-1//2*arctan(x*2^(1/2)*c^(1/2)*(b+(b^2+-4*a*c)^(1/2))^-1//2))
@test integrate((d+e*x^2)^-1*(a+b*x^2+c*x^4)^-1, x) == :(d^-1//2*e^3//2*(a*e^2+c*d^2+-1*b*d*e)^-1*arctan(x*d^-1//2*e^(1/2))+-1//2*2^(1/2)*c^(1/2)*(b+(b^2+-4*a*c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)+1//10*c*e^-1*x^3*(d+e*x^2)^7//2+1//256*d^3*e^-5//2*(3*c*d^2+80*a*e^2+-10*b*d*e)*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+1//480*x*e^-2*(d+e*x^2)^5//2*(3*c*d^2+80*a*e^2+-10*b*d*e)+1//256*x*d^2*e^-2*(d+e*x^2)^(1/2)*(3*c*d^2+80*a*e^2+-10*b*d*e)+1//384*d*x*e^-2*(d+e*x^2)^3//2*(3*c*d^2+80*a*e^2+-10*b*d*e))
@test integrate((d+e*x^2)^3//2*(a+b*x^2+c*x^4), x) == :(-1//48*x*e^-2*(d+e*x^2)^5//2*(-8*b*e+3*c*d)+1//8*c*e^-1*x^3*(d+e*x^2)^5//2+1//128*d^2*e^-5//2*(3*c*d^2+48*a*e^2+-8*b*d*e)*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+1//192*x*e^-2*(d+e*x^2)^3//2*(3*c*d^2+48*a*e^2+-8*b*d*e)+1//128*d*x*e^-2*(d+e*x^2)^(1/2)*(3*c*d^2+48*a*e^2+-8*b*d*e))
@test integrate((d+e*x^2)^(1/2)*(a+b*x^2+c*x^4), x) == :(-1//8*x*e^-2*(d+e*x^2)^3//2*(c*d+-2*b*e)+1//6*c*e^-1*x^3*(d+e*x^2)^3//2+1//16*d*e^-5//2*(c*d^2+8*a*e^2+-2*b*d*e)*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+1//16*x*e^-2*(d+e*x^2)^(1/2)*(c*d^2+8*a*e^2+-2*b*d*e))
@test integrate((d+e*x^2)^-1//2*(a+b*x^2+c*x^4), x) == :(1//8*e^-5//2*(3*c*d^2+8*a*e^2+-4*b*d*e)*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+-1//8*x*e^-2*(d+e*x^2)^(1/2)*(-4*b*e+3*c*d)+1//4*c*e^-1*x^3*(d+e*x^2)^(1/2))
@test integrate((d+e*x^2)^-3//2*(a+b*x^2+c*x^4), x) == :(-1//2*e^-5//2*(-2*b*e+3*c*d)*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+x*d^-1*(d+e*x^2)^-1//2*(a+d*e^-2*(c*d+-1*b*e))+(1/2)*c*x*e^-2*(d+e*x^2)^(1/2))
@test integrate((d+e*x^2)^-5//2*(a+b*x^2+c*x^4), x) == :(c*e^-5//2*arctanh(x*e^(1/2)*(d+e*x^2)^-1//2)+1//3*x*d^-1*(d+e*x^2)^-3//2*(a+d*e^-2*(c*d+-1*b*e))+-1//3*x*d^-2*e^-2*(d+e*x^2)^-1//2*(-1*e*(b*d+2*a*e)+4*c*d^2))
@test integrate((d+e*x^2)^-7//2*(a+b*x^2+c*x^4), x) == :(a*x*d^-1*(d+e*x^2)^-5//2+1//3*d^-2*x^3*(d+e*x^2)^-5//2*(b*d+4*a*e)+1//15*d^-3*x^5*(d+e*x^2)^-5//2*(2*e*(b*d+4*a*e)+3*c*d^2))
@test integrate((d+e*x^2)^-9//2*(a+b*x^2+c*x^4), x) == :(a*x*d^-1*(d+e*x^2)^-7//2+1//3*d^-2*x^3*(d+e*x^2)^-7//2*(b*d+6*a*e)+1//15*d^-3*x^5*(d+e*x^2)^-7//2*(3*c*d^2+4*e*(b*d+6*a*e))+2//105*e*d^-4*x^7*(d+e*x^2)^-7//2*(3*c*d^2+4*e*(b*d+6*a*e)))
@test integrate((d+e*x^2)^-11//2*(a+b*x^2+c*x^4), x) == :(a*x*d^-1*(d+e*x^2)^-9//2+1//3*d^-2*x^3*(d+e*x^2)^-9//2*(b*d+8*a*e)+1//5*d^-3*x^5*(d+e*x^2)^-9//2*(c*d^2+2*e*(b*d+8*a*e))+4//35*e*d^-4*x^7*(d+e*x^2)^-9//2*(c*d^2+2*e*(b*d+8*a*e))+8//315*d^-5*e^2*x^9*(d+e*x^2)^-9//2*(c*d^2+2*e*(b*d+8*a*e)))
@test integrate((d+e*x^2)^-13//2*(a+b*x^2+c*x^4), x) == :(a*x*d^-1*(d+e*x^2)^-11//2+1//3*d^-2*x^3*(d+e*x^2)^-11//2*(b*d+10*a*e)+1//15*d^-3*x^5*(d+e*x^2)^-11//2*(3*c*d^2+8*e*(b*d+10*a*e))+2//35*e*d^-4*x^7*(d+e*x^2)^-11//2*(3*c*d^2+8*e*(b*d+10*a*e))+8//315*d^-5*e^2*x^9*(d+e*x^2)^-11//2*(3*c*d^2+8*e*(b*d+10*a*e))+16//3465*d^-6*e^3*x^11*(d+e*x^2)^-11//2*(3*c*d^2+8*e*(b*d+10*a*e)))
@test integrate((7+5*x^2)^3*(2+x^4+3*x^2)^(1/2), x) == :(125//9*x^3*(2+x^4+3*x^2)^3//2+275//7*x*(2+x^4+3*x^2)^3//2+1//21*x*(2+x^4+3*x^2)^(1/2)*(2608+757*x^2)+577//3*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+-577//3*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2)+2945//21*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((7+5*x^2)^2*(2+x^4+3*x^2)^(1/2), x) == :(25//7*x*(2+x^4+3*x^2)^3//2+31*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+1//21*x*(2+x^4+3*x^2)^(1/2)*(407+114*x^2)+-31*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2)+472//21*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((2+x^4+3*x^2)^(1/2)*(7+5*x^2), x) == :(5*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+1//3*x*(2+x^4+3*x^2)^(1/2)*(10+3*x^2)+-5*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2)+11//3*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((2+x^4+3*x^2)^(1/2), x) == :(1//3*x*(2+x^4+3*x^2)^(1/2)+x*(2+x^4+3*x^2)^-1//2*(2+x^2)+-1*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2)+2//3*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((7+5*x^2)^3*(2+x^4+3*x^2)^3//2, x) == :(125//13*x^3*(2+x^4+3*x^2)^5//2+3825//143*x*(2+x^4+3*x^2)^5//2+1//3003*x*(2+x^4+3*x^2)^3//2*(208212+65345*x^2)+1//5005*x*(2+x^4+3*x^2)^(1/2)*(1032541+297911*x^2)+20884//65*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+-20884//65*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2)+1171349//5005*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((7+5*x^2)^2*(2+x^4+3*x^2)^3//2, x) == :(25//11*x*(2+x^4+3*x^2)^5//2+1//693*x*(2+x^4+3*x^2)^3//2*(7281+2240*x^2)+1//1155*x*(2+x^4+3*x^2)^(1/2)*(36783+10643*x^2)+742//15*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+-742//15*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2)+13879//385*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((2+x^4+3*x^2)^3//2*(7+5*x^2), x) == :(1//63*x*(2+x^4+3*x^2)^3//2*(108+35*x^2)+1//105*x*(2+x^4+3*x^2)^(1/2)*(519+149*x^2)+116//15*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+-116//15*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2)+197//35*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((2+x^4+3*x^2)^3//2, x) == :(1//7*x*(2+x^4+3*x^2)^3//2+1//35*x*(2+x^4+3*x^2)^(1/2)*(29+9*x^2)+6//5*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+-6//5*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2)+31//35*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((7+5*x^2)^3*(2+x^4+3*x^2)^-1//2, x) == :(25*x^3*(2+x^4+3*x^2)^(1/2)+75*x*(2+x^4+3*x^2)^(1/2)+135*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+(1/2)*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(193+193*x^2)*Elliptic.F(arctan(x),1/2)+-135*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2))
@test integrate((7+5*x^2)^2*(2+x^4+3*x^2)^-1//2, x) == :(25//3*x*(2+x^4+3*x^2)^(1/2)+20*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+-20*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2)+1//6*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(97+97*x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((2+x^4+3*x^2)^-1//2*(7+5*x^2), x) == :(5*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+(1/2)*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(7+7*x^2)*Elliptic.F(arctan(x),1/2)+-5*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2))
@test integrate((2+x^4+3*x^2)^-1//2, x) == :((1/2)*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((7+5*x^2)^5*(2+x^4+3*x^2)^-3//2, x) == :(625*x^3*(2+x^4+3*x^2)^(1/2)+5000//3*x*(2+x^4+3*x^2)^(1/2)+-1//2*x*(2+x^4+3*x^2)^-1//2*(115+179*x^2)+7679//2*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+-1//2*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(7679+7679*x^2)*Elliptic.E(arctan(x),1/2)+1//6*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(15383+15383*x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((7+5*x^2)^4*(2+x^4+3*x^2)^-3//2, x) == :(625//3*x*(2+x^4+3*x^2)^(1/2)+(1/2)*x*(2+x^4+3*x^2)^-1//2*(145+113*x^2)+637//2*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+-1//2*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(637+637*x^2)*Elliptic.E(arctan(x),1/2)+1067//3*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((7+5*x^2)^3*(2+x^4+3*x^2)^-3//2, x) == :((1/2)*x*(2+x^4+3*x^2)^-1//2*(5+-11*x^2)+261//2*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+(1/2)*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(169+169*x^2)*Elliptic.F(arctan(x),1/2)+-1//2*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(261+261*x^2)*Elliptic.E(arctan(x),1/2))
@test integrate((7+5*x^2)^2*(2+x^4+3*x^2)^-3//2, x) == :((1/2)*x*(2+x^4+3*x^2)^-1//2*(25+17*x^2)+-17//2*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+(1/2)*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(17+17*x^2)*Elliptic.E(arctan(x),1/2)+6*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((2+x^4+3*x^2)^-3//2*(7+5*x^2), x) == :((1/2)*x*(2+x^4+3*x^2)^-1//2*(5+x^2)+-1//2*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+(1/2)*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2)+(1/2)*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((2+x^4+3*x^2)^-3//2, x) == :((1/2)*x*(2+x^4+3*x^2)^-1//2*(5+3*x^2)+-3//2*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+(1/2)*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(3+3*x^2)*Elliptic.E(arctan(x),1/2)+-1*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2))
@test integrate((7+5*x^2)^4*(2+x^2+-1*x^4)^(1/2), x) == :(-539419//77*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+3764813//231*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+-116100//77*x*(2+x^2+-1*x^4)^3//2+-14500//33*x^3*(2+x^2+-1*x^4)^3//2+-625//11*x^5*(2+x^2+-1*x^4)^3//2+1//231*x*(2+x^2+-1*x^4)^(1/2)*(177953+717372*x^2))
@test integrate((7+5*x^2)^3*(2+x^2+-1*x^4)^(1/2), x) == :(-8735//21*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+79411//63*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+-1825//21*x*(2+x^2+-1*x^4)^3//2+-125//9*x^3*(2+x^2+-1*x^4)^3//2+1//63*x*(2+x^2+-1*x^4)^(1/2)*(5956+14691*x^2))
@test integrate((7+5*x^2)^2*(2+x^2+-1*x^4)^(1/2), x) == :(-79//7*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+2045//21*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+-25//7*x*(2+x^2+-1*x^4)^3//2+1//21*x*(2+x^2+-1*x^4)^(1/2)*(275+354*x^2))
@test integrate((2+x^2+-1*x^4)^(1/2)*(7+5*x^2), x) == :(3*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+7*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+x*(2+x^2+-1*x^4)^(1/2)*(2+x^2))
@test integrate((2+x^2+-1*x^4)^(1/2), x) == :(1//3*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+1//3*x*(2+x^2+-1*x^4)^(1/2)+Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2))
@test integrate((7+5*x^2)^4*(2+x^2+-1*x^4)^3//2, x) == :(-50794416//5005*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+124141422//5005*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+-132300//143*x*(2+x^2+-1*x^4)^5//2+-11750//39*x^3*(2+x^2+-1*x^4)^5//2+-125//3*x^5*(2+x^2+-1*x^4)^5//2+-1//1001*x*(2+x^2+-1*x^4)^3//2*(69817+-1581440*x^2)+3//5005*x*(2+x^2+-1*x^4)^(1/2)*(2193559+7837383*x^2))
@test integrate((7+5*x^2)^3*(2+x^2+-1*x^4)^3//2, x) == :(-3199778//5005*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+31072528//15015*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+-7825//143*x*(2+x^2+-1*x^4)^5//2+-125//13*x^3*(2+x^2+-1*x^4)^5//2+1//3003*x*(2+x^2+-1*x^4)^3//2*(33792+374045*x^2)+1//15015*x*(2+x^2+-1*x^4)^(1/2)*(2512273+5712051*x^2))
@test integrate((7+5*x^2)^2*(2+x^2+-1*x^4)^3//2, x) == :(-3392//165*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+85942//495*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+-25//11*x*(2+x^2+-1*x^4)^5//2+1//99*x*(2+x^2+-1*x^4)^3//2*(363+920*x^2)+1//495*x*(2+x^2+-1*x^4)^(1/2)*(11497+14889*x^2))
@test integrate((2+x^2+-1*x^4)^3//2*(7+5*x^2), x) == :(418//105*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+4432//315*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+1//63*x*(2+x^2+-1*x^4)^3//2*(48+35*x^2)+1//315*x*(2+x^2+-1*x^4)^(1/2)*(1087+669*x^2))
@test integrate((2+x^2+-1*x^4)^3//2, x) == :(34//35*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+48//35*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+1//7*x*(2+x^2+-1*x^4)^3//2+1//35*x*(2+x^2+-1*x^4)^(1/2)*(19+3*x^2))
@test integrate((7+5*x^2)^3*(2+x^2+-1*x^4)^-1//2, x) == :(-542*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+3905//3*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+-25*x^3*(2+x^2+-1*x^4)^(1/2)+-625//3*x*(2+x^2+-1*x^4)^(1/2))
@test integrate((7+5*x^2)^2*(2+x^2+-1*x^4)^-1//2, x) == :(-21*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+260//3*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+-25//3*x*(2+x^2+-1*x^4)^(1/2))
@test integrate((2+x^2+-1*x^4)^-1//2*(7+5*x^2), x) == :(2*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+5*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2))
@test integrate((2+x^2+-1*x^4)^-1//2, x) == :(Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2))
@test integrate((7+5*x^2)^5*(2+x^2+-1*x^4)^-3//2, x) == :(-3482293//18*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+627857//6*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+625*x^3*(2+x^2+-1*x^4)^(1/2)+27500//3*x*(2+x^2+-1*x^4)^(1/2)+1//18*x*(2+x^2+-1*x^4)^-1//2*(1419985+1419793*x^2))
@test integrate((7+5*x^2)^4*(2+x^2+-1*x^4)^-3//2, x) == :(-165239//18*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+31921//6*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+625//3*x*(2+x^2+-1*x^4)^(1/2)+1//18*x*(2+x^2+-1*x^4)^-1//2*(83585+83489*x^2))
@test integrate((7+5*x^2)^3*(2+x^2+-1*x^4)^-3//2, x) == :(-7147//18*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+1763//6*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+1//18*x*(2+x^2+-1*x^4)^-1//2*(4945+4897*x^2))
@test integrate((7+5*x^2)^2*(2+x^2+-1*x^4)^-3//2, x) == :(-281//18*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+139//6*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+1//18*x*(2+x^2+-1*x^4)^-1//2*(305+281*x^2))
@test integrate((2+x^2+-1*x^4)^-3//2*(7+5*x^2), x) == :(-13//18*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+17//6*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+1//18*x*(2+x^2+-1*x^4)^-1//2*(25+13*x^2))
@test integrate((2+x^2+-1*x^4)^-3//2, x) == :(1//6*Elliptic.F(arcsin((1/2)*x*2^(1/2)),-2)+1//18*Elliptic.E(arcsin((1/2)*x*2^(1/2)),-2)+1//18*x*(2+x^2+-1*x^4)^-1//2*(5+-1*x^2))
@test integrate((7+5*x^2)^4*(4+x^4+3*x^2)^(1/2), x) == :(625//11*x^5*(4+x^4+3*x^2)^3//2+3050//11*x*(4+x^4+3*x^2)^3//2+23500//99*x^3*(4+x^4+3*x^2)^3//2+51665*x*(66+33*x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//33*x*(4+x^4+3*x^2)^(1/2)*(18727+4516*x^2)+-51665//33*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+1//22*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(66318+33159*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((7+5*x^2)^3*(4+x^4+3*x^2)^(1/2), x) == :(125//9*x^3*(4+x^4+3*x^2)^3//2+275//7*x*(4+x^4+3*x^2)^3//2+4717*x*(42+21*x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//21*x*(4+x^4+3*x^2)^(1/2)*(1708+407*x^2)+-4717//21*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+1//6*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2602+1301*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((7+5*x^2)^2*(4+x^4+3*x^2)^(1/2), x) == :(25//7*x*(4+x^4+3*x^2)^3//2+319*x*(14+7*x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//7*x*(4+x^4+3*x^2)^(1/2)*(119+38*x^2)+(1/2)*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(162+81*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8)+-319//7*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((4+x^4+3*x^2)^(1/2)*(7+5*x^2), x) == :(9*x*(2+x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//3*x*(4+x^4+3*x^2)^(1/2)*(10+3*x^2)+-9*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+1//6*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(98+49*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((4+x^4+3*x^2)^(1/2), x) == :(1//3*x*(4+x^4+3*x^2)^(1/2)+x*(2+x^2)^-1*(4+x^4+3*x^2)^(1/2)+-1*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+1//6*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(14+7*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((7+5*x^2)^4*(4+x^4+3*x^2)^3//2, x) == :(125//3*x^5*(4+x^4+3*x^2)^5//2+2250//13*x^3*(4+x^4+3*x^2)^5//2+92150//429*x*(4+x^4+3*x^2)^5//2+12665086*x*(4290+2145*x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//1287*x*(4+x^4+3*x^2)^3//2*(452001+131080*x^2)+7//2145*x*(4+x^4+3*x^2)^(1/2)*(661429+174989*x^2)+-12665086//2145*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+2383556//429*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((7+5*x^2)^3*(4+x^4+3*x^2)^3//2, x) == :(125//13*x^3*(4+x^4+3*x^2)^5//2+3825//143*x*(4+x^4+3*x^2)^5//2+4525662*x*(10010+5005*x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//1001*x*(4+x^4+3*x^2)^3//2*(53504+15365*x^2)+1//5005*x*(4+x^4+3*x^2)^(1/2)*(1653701+435441*x^2)+-4525662//5005*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+121826//143*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((7+5*x^2)^2*(4+x^4+3*x^2)^3//2, x) == :(25//11*x*(4+x^4+3*x^2)^5//2+175346*x*(2310+1155*x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//693*x*(4+x^4+3*x^2)^3//2*(6831+2240*x^2)+1//1155*x*(4+x^4+3*x^2)^(1/2)*(64533+18253*x^2)+-175346//1155*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+4628//33*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((4+x^4+3*x^2)^3//2*(7+5*x^2), x) == :(2798*x*(210+105*x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//63*x*(4+x^4+3*x^2)^3//2*(108+35*x^2)+1//105*x*(4+x^4+3*x^2)^(1/2)*(1029+289*x^2)+-2798//105*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+74//3*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((4+x^4+3*x^2)^3//2, x) == :(1//7*x*(4+x^4+3*x^2)^3//2+138*x*(70+35*x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//35*x*(4+x^4+3*x^2)^(1/2)*(49+9*x^2)+4*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8)+-138//35*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((7+5*x^2)^3*(4+x^4+3*x^2)^-1//2, x) == :(25*x^3*(4+x^4+3*x^2)^(1/2)+75*x*(4+x^4+3*x^2)^(1/2)+-15*x*(2+x^2)^-1*(4+x^4+3*x^2)^(1/2)+15*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+1//4*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(26+13*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((7+5*x^2)^2*(4+x^4+3*x^2)^-1//2, x) == :(25//3*x*(4+x^4+3*x^2)^(1/2)+20*x*(2+x^2)^-1*(4+x^4+3*x^2)^(1/2)+-20*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+1//12*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(334+167*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((4+x^4+3*x^2)^-1//2*(7+5*x^2), x) == :(5*x*(2+x^2)^-1*(4+x^4+3*x^2)^(1/2)+-5*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+1//4*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(34+17*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((4+x^4+3*x^2)^-1//2, x) == :(1//4*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((7+5*x^2)^5*(4+x^4+3*x^2)^-3//2, x) == :(625*x^3*(4+x^4+3*x^2)^(1/2)+5000//3*x*(4+x^4+3*x^2)^(1/2)+-220779*x*(56+28*x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//28*x*(4+x^4+3*x^2)^-1//2*(99493+45779*x^2)+-1//24*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(261458+130729*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8)+1//28*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(441558+220779*x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((7+5*x^2)^4*(4+x^4+3*x^2)^-3//2, x) == :(625//3*x*(4+x^4+3*x^2)^(1/2)+14523*x*(56+28*x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//28*x*(4+x^4+3*x^2)^-1//2*(2719+-4023*x^2)+-1//28*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(29046+14523*x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+1//24*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(8486+4243*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((7+5*x^2)^3*(4+x^4+3*x^2)^-3//2, x) == :(4449*x*(56+28*x^2)^-1*(4+x^4+3*x^2)^(1/2)+-1//28*x*(4+x^4+3*x^2)^-1//2*(2323+949*x^2)+-1//28*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(8898+4449*x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+1//8*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(1946+973*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((7+5*x^2)^2*(4+x^4+3*x^2)^-3//2, x) == :(-113*x*(56+28*x^2)^-1*(4+x^4+3*x^2)^(1/2)+-1//28*x*(4+x^4+3*x^2)^-1//2*(9+-113*x^2)+1//8*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(18+9*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8)+1//28*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(226+113*x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((4+x^4+3*x^2)^-3//2*(7+5*x^2), x) == :(-19*x*(56+28*x^2)^-1*(4+x^4+3*x^2)^(1/2)+1//28*x*(4+x^4+3*x^2)^-1//2*(53+19*x^2)+-1//8*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(6+3*x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8)+1//28*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(38+19*x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((4+x^4+3*x^2)^-3//2, x) == :(3*x*(56+28*x^2)^-1*(4+x^4+3*x^2)^(1/2)+-1//28*x*(4+x^4+3*x^2)^-1//2*(1+3*x^2)+-1//28*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(6+3*x^2)*Elliptic.E(2*arctan((1/2)*x*2^(1/2)),1//8)+1//8*2^(1/2)*((2+x^2)^-2*(4+x^4+3*x^2))^(1/2)*(4+x^4+3*x^2)^-1//2*(2+x^2)*Elliptic.F(2*arctan((1/2)*x*2^(1/2)),1//8))
@test integrate((d+e*x^2)^3*(a+b*x^2+c*x^4)^-1//2, x) == :(1//5*c^-1*e^3*x^3*(a+b*x^2+c*x^4)^(1/2)+1//15*x*c^-2*e^2*(a+b*x^2+c*x^4)^(1/2)*(-4*b*e+15*c*d)+1//15*e*x*c^-5//2*(a^(1/2)+c^(1/2)*x^2)^-1*(a+b*x^2+c*x^4)^(1/2)*(8*b^2*e^2+45*c^2*d^2+-3*c*e*(3*a*e+10*b*d))+1//30*a^1//4*c^-11//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+b*x^2+c*x^4))^(1/2)*(a+b*x^2+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*(e*(8*b^2*e^2+45*c^2*d^2+-3*c*e*(3*a*e+10*b*d))+a^-1//2*c^(1/2)*(15*c^2*d^3+4*a*b*e^3+-15*a*c*d*e^2))*Elliptic.F(2*arctan(x*a^-1//4*c^1//4),1/2+-1//4*b*a^-1//2*c^-1//2)+-1//15*e*a^1//4*c^-11//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+b*x^2+c*x^4))^(1/2)*(a+b*x^2+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*(8*b^2*e^2+45*c^2*d^2+-3*c*e*(3*a*e+10*b*d))*Elliptic.E(2*arctan(x*a^-1//4*c^1//4),1/2+-1//4*b*a^-1//2*c^-1//2))
@test integrate((d+e*x^2)^2*(a+b*x^2+c*x^4)^-1//2, x) == :(1//3*x*c^-1*e^2*(a+b*x^2+c*x^4)^(1/2)+2//3*e*x*c^-3//2*(a^(1/2)+c^(1/2)*x^2)^-1*(a+b*x^2+c*x^4)^(1/2)*(-1*b*e+3*c*d)+1//6*a^1//4*c^-7//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+b*x^2+c*x^4))^(1/2)*(a+b*x^2+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*(2*e*(-1*b*e+3*c*d)+a^-1//2*c^(1/2)*(-1*a*e^2+3*c*d^2))*Elliptic.F(2*arctan(x*a^-1//4*c^1//4),1/2+-1//4*b*a^-1//2*c^-1//2)+-2//3*e*a^1//4*c^-7//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+b*x^2+c*x^4))^(1/2)*(a+b*x^2+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*(-1*b*e+3*c*d)*Elliptic.E(2*arctan(x*a^-1//4*c^1//4),1/2+-1//4*b*a^-1//2*c^-1//2))
@test integrate((a+b*x^2+c*x^4)^-1//2*(d+e*x^2), x) == :(e*x*c^-1//2*(a^(1/2)+c^(1/2)*x^2)^-1*(a+b*x^2+c*x^4)^(1/2)+(1/2)*a^1//4*c^-3//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+b*x^2+c*x^4))^(1/2)*(a+b*x^2+c*x^4)^-1//2*(e+d*a^-1//2*c^(1/2))*(a^(1/2)+c^(1/2)*x^2)*Elliptic.F(2*arctan(x*a^-1//4*c^1//4),1/2+-1//4*b*a^-1//2*c^-1//2)+-1*e*a^1//4*c^-3//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+b*x^2+c*x^4))^(1/2)*(a+b*x^2+c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*Elliptic.E(2*arctan(x*a^-1//4*c^1//4),1/2+-1//4*b*a^-1//2*c^-1//2))
@test integrate((d+e*x^2)^3*(a+b*x^2+-1*c*x^4)^-1//2, x) == :(-1//5*c^-1*e^3*x^3*(a+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((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4+-1*b*x^2))^(1/2)*(-1a+b*x^2+-1*c*x^4)^-1//2*(e+d*a^-1//2*c^(1/2))*(a^(1/2)+c^(1/2)*x^2)*Elliptic.F(2*arctan(x*a^-1//4*c^1//4),1/2+1//4*b*a^-1//2*c^-1//2)+-1*e*a^1//4*c^-3//4*((a^(1/2)+c^(1/2)*x^2)^-2*(a+c*x^4+-1*b*x^2))^(1/2)*(-1a+b*x^2+-1*c*x^4)^-1//2*(a^(1/2)+c^(1/2)*x^2)*Elliptic.E(2*arctan(x*a^-1//4*c^1//4),1/2+1//4*b*a^-1//2*c^-1//2))
@test integrate((d+e*x^2)^3*(2+x^4+3*x^2)^-1//2, x) == :(1//5*e^3*x^3*(2+x^4+3*x^2)^(1/2)+x*e^2*(2+x^4+3*x^2)^(1/2)*(d+-4//5*e)+3//5*e*x*(2+x^4+3*x^2)^-1//2*(2+x^2)*(5*d^2+6*e^2+-10*d*e)+1//10*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*(5*d^3+8*e^3+-10*d*e^2)*Elliptic.F(arctan(x),1/2)+-3//5*e*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*(5*d^2+6*e^2+-10*d*e)*Elliptic.E(arctan(x),1/2))
@test integrate((d+e*x^2)^2*(2+x^4+3*x^2)^-1//2, x) == :(1//3*x*e^2*(2+x^4+3*x^2)^(1/2)+e*x*(2+x^4+3*x^2)^-1//2*(2+x^2)*(-2*e+2d)+1//6*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*(-2*e^2+3*d^2)*Elliptic.F(arctan(x),1/2)+-2*e*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*(d+-1*e)*Elliptic.E(arctan(x),1/2))
@test integrate((2+x^4+3*x^2)^-1//2*(d+e*x^2), x) == :(e*x*(2+x^4+3*x^2)^-1//2*(2+x^2)+(1/2)*d*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.F(arctan(x),1/2)+-1*e*2^(1/2)*((1+x^2)^-1*(2+x^2))^(1/2)*(2+x^4+3*x^2)^-1//2*(1+x^2)*Elliptic.E(arctan(x),1/2))
@test integrate((1+x+3^(1/2))^-1*(-4+x^4+4*3^(1/2)*x^2)^-1//2*(1+x+-1*3^(1/2)), x) == :(1//3*(-3+2*3^(1/2))^(1/2)*arctanh((-9+6*3^(1/2))^-1//2*(1+x+-1*3^(1/2))^2*(-4+x^4+4*3^(1/2)*x^2)^-1//2))
@test integrate((1+x+-1*3^(1/2))^-1*(-4+x^4+-4*3^(1/2)*x^2)^-1//2*(1+x+3^(1/2)), x) == :(-1//3*(3+2*3^(1/2))^(1/2)*arctan((9+6*3^(1/2))^-1//2*(1+x+3^(1/2))^2*(-4+x^4+-4*3^(1/2)*x^2)^-1//2))
@test integrate((1+3^(1/2)+2x)^-1*(-1+4*x^4+4*3^(1/2)*x^2)^-1//2*(1+-1*3^(1/2)+2x), x) == :(1//3*(-3+2*3^(1/2))^(1/2)*arctanh((1/2)*(-9+6*3^(1/2))^-1//2*(1+-1*3^(1/2)+2x)^2*(-1+4*x^4+4*3^(1/2)*x^2)^-1//2))
@test integrate((1+-1*3^(1/2)+2x)^-1*(-1+4*x^4+-4*3^(1/2)*x^2)^-1//2*(1+3^(1/2)+2x), x) == :(-1//3*(3+2*3^(1/2))^(1/2)*arctan((1/2)*(9+6*3^(1/2))^-1//2*(1+3^(1/2)+2x)^2*(-1+4*x^4+-4*3^(1/2)*x^2)^-1//2))

max_stars_repo_path: test/1 Algebraic functions/1.2 Trinomial products/1.2.2 Quartic/1.2.2.3 (d+e x^2)^m (a+b x^2+c x^4)^p.jl


text:
Pkg.add("ArgParse")
Pkg.add("LinearMaps")
Pkg.add("HDF5")
Pkg.add("JLD")
Pkg.update()

ext: jl

max_stars_repo_name: alewis/isingED

max_issues_repo_name: alewis/isingED

max_forks_repo_name: alewis/isingED


text:
# Test residual block
# Author: Philipp Witte, pwitte3@gatech.edu
# Date: January 2020

using LinearAlgebra, InvertibleNetworks, Test, Random
Random.seed!(2)

# Input
nx = 28
ny = 28
n_in = 4
n_hidden = 8
batchsize = 2
k1 = 3
k2 = 3

# Input
X = glorot_uniform(nx, ny, n_in, batchsize)
X0 = glorot_uniform(nx, ny, n_in, batchsize)
dX = (X - X0)/norm(X0)

# Weights
W1 = glorot_uniform(k1, k1, n_in, n_hidden)
W2 = glorot_uniform(k2, k2, n_hidden, n_hidden)
W3 = glorot_uniform(k1, k1, 2*n_in, n_hidden)
b1 = glorot_uniform(n_hidden)
b2 = glorot_uniform(n_hidden)

W01 = glorot_uniform(k1, k1, n_in, n_hidden)
W02 = glorot_uniform(k2, k2, n_hidden, n_hidden)
W03 = glorot_uniform(k1, k1, 2*n_in, n_hidden)
b01 = glorot_uniform(n_hidden)
b02 = glorot_uniform(n_hidden)

dW1 = W1 - W01; dW1 *= norm(W01)/norm(dW1)
dW2 = W2 - W02; dW2 *= norm(W02)/norm(dW2)
dW3 = W3 - W03; dW3 *= norm(W03)/norm(dW3)
db1 = b1 - b01; db1 *= norm(b01)/norm(db1)
db2 = b2 - b02; db2 *= norm(b02)/norm(db2)

# Residual blocks
RB = ResidualBlock(W1, W2, W3, b1, b2)   # true weights

# Observed data
Y = RB.forward(X)

function loss(RB, X, Y)
    Y_ = RB.forward(X)
    ΔY = Y_ - Y
    f = .5f0*norm(ΔY)^2
    ΔX = RB.backward(ΔY, X)
    return f, ΔX, RB.W1.grad, RB.W2.grad, RB.W3.grad, RB.b1.grad, RB.b2.grad
end

###################################################################################################
# Gradient tests

# Gradient test w.r.t. input
f0, ΔX = loss(RB, X0, Y)[1:2]
h = 0.1f0
maxiter = 5
err1 = zeros(Float32, maxiter)
err2 = zeros(Float32, maxiter)

print("\nGradient test convolutions\n")
for j=1:maxiter
    f = loss(RB, X0 + h*dX, Y)[1]
    err1[j] = abs(f - f0)
    err2[j] = abs(f - f0 - h*dot(dX, ΔX))
    print(err1[j], "; ", err2[j], "\n")
    global h = h/2f0
end

@test isapprox(err1[end] / (err1[1]/2^(maxiter-1)), 1f0; atol=1f1)
@test isapprox(err2[end] / (err2[1]/4^(maxiter-1)), 1f0; atol=1f1)

# Gradient test for weights
RB0 = ResidualBlock(W01, W02, W03, b1, b2)   # initial weights
f0, ΔX, ΔW1, ΔW2, ΔW3 = loss(RB0, X0, Y)[1:5]
h = 0.1f0
maxiter = 5
err3 = zeros(Float32, maxiter)
err4 = zeros(Float32, maxiter)

print("\nGradient test convolutions\n")
for j=1:maxiter
    RB0.W1.data = W01 + h*dW1
    RB0.W2.data = W02 + h*dW2
    RB0.W3.data = W03 + h*dW3
    f = loss(RB0, X0, Y)[1]
    err3[j] = abs(f - f0)
    err4[j] = abs(f - f0 - h*dot(dW1, ΔW1) - h*dot(dW2, ΔW2) - h*dot(dW3, ΔW3))
    print(err3[j], "; ", err4[j], "\n")
    global h = h/2f0
end

@test isapprox(err3[end] / (err3[1]/2^(maxiter-1)), 1f0; atol=1f1)
@test isapprox(err4[end] / (err4[1]/4^(maxiter-1)), 1f0; atol=1f1)

# Gradient test for bias
RB0 = ResidualBlock(W1, W2, W3, b01, b02)
f0, ΔX, ΔW1, ΔW2, ΔW3, Δb1, Δb2 = loss(RB0, X0, Y)
h = 0.1f0
maxiter = 5
err5 = zeros(Float32, maxiter)
err6 = zeros(Float32, maxiter)
print("\nGradient test convolutions\n")
for j=1:maxiter
    RB0.b1.data = b01 + h*db1
    RB0.b2.data = b02 + h*db2
    f = loss(RB0, X0, Y)[1]
    err5[j] = abs(f - f0)
    err6[j] = abs(f - f0 - h*dot(db1, Δb1) - h*dot(db2, Δb2))
    print(err5[j], "; ", err6[j], "\n")
    global h = h/2f0
end

@test isapprox(err5[end] / (err5[1]/2^(maxiter-1)), 1f0; atol=1f1)
@test isapprox(err6[end] / (err6[1]/4^(maxiter-1)), 1f0; atol=1f1)

###################################################################################################
# Jacobian-related tests

# Gradient test

# Initialization
W1 = glorot_uniform(k1, k1, n_in, n_hidden)
W2 = glorot_uniform(k2, k2, n_hidden, n_hidden)
W3 = glorot_uniform(k1, k1, 2*n_in, n_hidden)
b1 = glorot_uniform(n_hidden)
b2 = glorot_uniform(n_hidden)
RB = ResidualBlock(W1, W2, W3, b1, b2; fan=true)
θ = deepcopy(get_params(RB))
X = randn(Float32, nx, ny, n_in, batchsize)

# Perturbation (normalized)
dθ = [Parameter(dW1)/norm(W1), Parameter(dW2)/norm(W2), Parameter(dW3)/norm(W3), Parameter(db1)/norm(b1), Parameter(db2)/norm(b2)]
dX = randn(Float32, nx, ny, n_in, batchsize)/norm(X)

# Jacobian eval
dY, Y = RB.jacobian(dX, dθ, X)

# Test
print("\nJacobian test\n")
h = 0.1f0
maxiter = 5
err7 = zeros(Float32, maxiter)
err8 = zeros(Float32, maxiter)
for j=1:maxiter
    set_params!(RB, θ+h*dθ)
    Y_loc = RB.forward(X+h*dX)
    err7[j] = norm(Y_loc - Y)
    err8[j] = norm(Y_loc - Y - h*dY)
    print(err7[j], "; ", err8[j], "\n")
    global h = h/2f0
end

@test isapprox(err7[end] / (err7[1]/2^(maxiter-1)), 1f0; atol=1f1)
@test isapprox(err8[end] / (err8[1]/4^(maxiter-1)), 1f0; atol=1f1)

# Adjoint test

set_params!(RB, θ)
dY = RB.jacobian(dX, dθ, X)[1]
dY_ = randn(Float32, size(dY))
dX_, dθ_ = RB.adjointJacobian(dY_, X)
a = dot(dY, dY_)
b = dot(dX, dX_)+dot(dθ, dθ_)
@test isapprox(a, b; rtol=1f-3)