Exemple #1
0
def test_6():
    test = [
        [(S(1) + a*x)**(S(3)/S(2))/sqrt(S(1) - a*x), x, S(4), S(3)/S(2)*arcsin(a*x)/a - S(1)/S(2)*(S(1) + a*x)**(S(3)/S(2))*sqrt(S(1) - a*x)/a - S(3)/S(2)*sqrt(S(1) - a*x)*sqrt(S(1) + a*x)/a],
        [(S(1) - x)**(S(1)/S(2))/(S(1) + x)**(S(1)/S(2)), x, S(3), arcsin(x) + sqrt(S(1) - x)*sqrt(S(1) + x)],
        [S(1)/((S(1) - x)**(S(1)/S(2))*(S(1) + x)**(S(3)/S(2))), x, S(1), - sqrt(S(1) - x)/sqrt(S(1) + x)],
        [(a + a*x)**(S(5)/S(2))*(c - c*x)**(S(5)/S(2)), x, S(5), S(5)/S(24)*a*c*x*(a + a*x)**(S(3)/S(2))*(c - c*x)**(S(3)/S(2)) + S(1)/S(6)*x*(a + a*x)**(S(5)/S(2))*(c - c*x)**(S(5)/S(2)) + S(5)/S(8)*a**(S(5)/S(2))*c**(S(5)/S(2))*arctan(sqrt(c)*sqrt(a + a*x)/(sqrt(a)*sqrt(c - c*x))) + S(5)/S(16)*a**S(2)*c**S(2)*x*sqrt(a + a*x)*sqrt(c - c*x)],
        [S(1)/((a + a*x)**(S(5)/S(2))*(c - c*x)**(S(5)/S(2))), x, S(2), S(1)/S(3)*x/(a*c*(a + a*x)**(S(3)/S(2))*(c - c*x)**(S(3)/S(2))) + S(2)/S(3)*x/(a**S(2)*c**S(2)*sqrt(a + a*x)*sqrt(c - c*x))],
        [(S(3) - x)**(S(1)/S(2))*( - S(2) + x)**(S(1)/S(2)), x, S(5), - S(1)/S(8)*arcsin(S(5) - S(2)*x) - S(1)/S(2)*(S(3) - x)**(S(3)/S(2))*sqrt( - S(2) + x) + S(1)/S(4)*sqrt(S(3) - x)*sqrt( - S(2) + x)],
        [S(1)/(sqrt(a + b*x)*sqrt( - a*d + b*d*x)), x, S(2), S(2)*arctanh(sqrt(d)*sqrt(a + b*x)/sqrt( - a*d + b*d*x))/(b*sqrt(d))],
        [S(1)/((a - I*a*x)**(S(7)/S(4))*(a + I*a*x)**(S(1)/S(4))), x, S(1), - S(2)/S(3)*I*(a + I*a*x)**(S(3)/S(4))/(a**S(2)*(a - I*a*x)**(S(3)/S(4)))],
        [(a + b*x)**S(2)*(a*c - b*c*x)**n, x, S(2), - S(4)*a**S(2)*(a*c - b*c*x)**(S(1) + n)/(b*c*(S(1) + n)) + S(4)*a*(a*c - b*c*x)**(S(2) + n)/(b*c**S(2)*(S(2) + n)) - (a*c - b*c*x)**(S(3) + n)/(b*c**S(3)*(S(3) + n))],
        [(a + b*x)**S(4)*(c + d*x), x, S(2), S(1)/S(5)*(b*c - a*d)*(a + b*x)**S(5)/b**S(2) + S(1)/S(6)*d*(a + b*x)**S(6)/b**S(2)],
        [(a + b*x)*(c + d*x), x, S(2), a*c*x + S(1)/S(2)*(b*c + a*d)*x**S(2) + S(1)/S(3)*b*d*x**S(3)],
        [(a + b*x)**S(5)/(c + d*x), x, S(2), b*(b*c - a*d)**S(4)*x/d**S(5) - S(1)/S(2)*(b*c - a*d)**S(3)*(a + b*x)**S(2)/d**S(4) + S(1)/S(3)*(b*c - a*d)**S(2)*(a + b*x)**S(3)/d**S(3) - S(1)/S(4)*(b*c - a*d)*(a + b*x)**S(4)/d**S(2) + S(1)/S(5)*(a + b*x)**S(5)/d - (b*c - a*d)**S(5)*log(c + d*x)/d**S(6)],
        [(a + b*x)/(c + d*x)**S(3), x, S(1), S(1)/S(2)*(a + b*x)**S(2)/((b*c - a*d)*(c + d*x)**S(2))],
        [(a + b*x)**S(5)*(c + d*x)**(S(1)/S(2)), x, S(2), - S(2)/S(3)*(b*c - a*d)**S(5)*(c + d*x)**(S(3)/S(2))/d**S(6) + S(2)*b*(b*c - a*d)**S(4)*(c + d*x)**(S(5)/S(2))/d**S(6) - S(20)/S(7)*b**S(2)*(b*c - a*d)**S(3)*(c + d*x)**(S(7)/S(2))/d**S(6) + S(20)/S(9)*b**S(3)*(b*c - a*d)**S(2)*(c + d*x)**(S(9)/S(2))/d**S(6) - S(10)/S(11)*b**S(4)*(b*c - a*d)*(c + d*x)**(S(11)/S(2))/d**S(6) + S(2)/S(13)*b**S(5)*(c + d*x)**(S(13)/S(2))/d**S(6)],
        [(c + d*x)**(S(1)/S(2))/(a + b*x)**S(2), x, S(3), - d*arctanh(sqrt(b)*sqrt(c + d*x)/sqrt(b*c - a*d))/(b**(S(3)/S(2))*sqrt(b*c - a*d)) - sqrt(c + d*x)/(b*(a + b*x))],
        [(a + b*x)**S(4)/(c + d*x)**(S(1)/S(2)), x, S(2), - S(8)/S(3)*b*(b*c - a*d)**S(3)*(c + d*x)**(S(3)/S(2))/d**S(5) + S(12)/S(5)*b**S(2)*(b*c - a*d)**S(2)*(c + d*x)**(S(5)/S(2))/d**S(5) - S(8)/S(7)*b**S(3)*(b*c - a*d)*(c + d*x)**(S(7)/S(2))/d**S(5) + S(2)/S(9)*b**S(4)*(c + d*x)**(S(9)/S(2))/d**S(5) + S(2)*(b*c - a*d)**S(4)*sqrt(c + d*x)/d**S(5)],
        [(a + b*x)**S(2)/(c + d*x)**(S(1)/S(2)), x, S(2), - S(4)/S(3)*b*(b*c - a*d)*(c + d*x)**(S(3)/S(2))/d**S(3) + S(2)/S(5)*b**S(2)*(c + d*x)**(S(5)/S(2))/d**S(3) + S(2)*(b*c - a*d)**S(2)*sqrt(c + d*x)/d**S(3)],
        [(S(1) - x)**(S(1)/S(3))/(S(1) + x), x, S(5), S(3)*(S(1) - x)**(S(1)/S(3)) + S(3)*log(S(2)**(S(1)/S(3)) - (S(1) - x)**(S(1)/S(3)))/S(2)**(S(2)/S(3)) - log(S(1) + x)/S(2)**(S(2)/S(3)) - S(2)**(S(1)/S(3))*arctan((S(1) + S(2)**(S(2)/S(3))*(S(1) - x)**(S(1)/S(3)))/sqrt(S(3)))*sqrt(S(3))],
        [(c + d*x)**(S(1)/S(2))/(a + b*x)**(S(1)/S(2)), x, S(3), (b*c - a*d)*arctanh(sqrt(d)*sqrt(a + b*x)/(sqrt(b)*sqrt(c + d*x)))/(b**(S(3)/S(2))*sqrt(d)) + sqrt(a + b*x)*sqrt(c + d*x)/b],
        [(a + b*x)**(S(1)/S(2))*(c + d*x)**(S(3)/S(2)), x, S(5), S(1)/S(3)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(3)/S(2))/b - S(1)/S(8)*(b*c - a*d)**S(3)*arctanh(sqrt(d)*sqrt(a + b*x)/(sqrt(b)*sqrt(c + d*x)))/(b**(S(5)/S(2))*d**(S(3)/S(2))) + S(1)/S(4)*(b*c - a*d)*(a + b*x)**(S(3)/S(2))*sqrt(c + d*x)/b**S(2) + S(1)/S(8)*(b*c - a*d)**S(2)*sqrt(a + b*x)*sqrt(c + d*x)/(b**S(2)*d)],
        [(a + b*x)**(S(1)/S(2))/(c + d*x)**(S(1)/S(2)), x, S(3), - (b*c - a*d)*arctanh(sqrt(d)*sqrt(a + b*x)/(sqrt(b)*sqrt(c + d*x)))/(d**(S(3)/S(2))*sqrt(b)) + sqrt(a + b*x)*sqrt(c + d*x)/d],
        [S(1)/((a + b*x)**(S(1)/S(2))*(c + d*x)**(S(5)/S(2))), x, S(2), S(2)/S(3)*sqrt(a + b*x)/((b*c - a*d)*(c + d*x)**(S(3)/S(2))) + S(4)/S(3)*b*sqrt(a + b*x)/((b*c - a*d)**S(2)*sqrt(c + d*x))],
        [(a + b*x)**m*(c + d*x)**(S(1) + S(2)*n - S(2)*(S(1) + n)), x, S(2), (a + b*x)**(S(1) + m)*hypergeom([S(1), S(1) + m], [S(2) + m], - d*(a + b*x)/(b*c - a*d))/((b*c - a*d)*(S(1) + m))],
        [a + b*x + c*x**S(2) + d*x**S(3), x, S(1), a*x + S(1)/S(2)*b*x**S(2) + S(1)/S(3)*c*x**S(3) + S(1)/S(4)*d*x**S(4)],
        [a + d/x**S(3) + c/x**S(2) + b/x, x, S(1), - S(1)/S(2)*d/x**S(2) - c/x + a*x + b*log(x)],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #2
0
def test_1():
    test = [
        [-S(3) / S(2), x, S(1), -S(3) / S(2) * x],
        [Pi, x, S(1), Pi * x],
        [a, x, S(1), a * x],
        [x ** m, x, S(1), x ** (S(1) + m) / (S(1) + m)],
        [x ** S(100), x, S(1), S(1) / S(101) * x ** S(101)],
        [x ** (S(5) / S(2)), x, S(1), S(2) / S(7) * x ** (S(7) / S(2))],
        [x ** (S(5) / S(3)), x, S(1), S(3) / S(8) * x ** (S(8) / S(3))],
        [S(1) / x ** (S(1) / S(3)), x, S(1), S(3) / S(2) * x ** (S(2) / S(3))],
        [
            x ** S(3) * (a + b * x),
            x,
            S(2),
            S(1) / S(4) * a * x ** S(4) + S(1) / S(5) * b * x ** S(5),
        ],
        [
            (a + b * x) ** S(2) / x ** S(2),
            x,
            S(2),
            -(a ** S(2)) / x + b ** S(2) * x + S(2) * a * b * log(x),
        ],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(
                r, i[1], i[4], expand=True, _diff=True
            )
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #3
0
def test_3():
    test = [
        [x**m*(a + b*x), x, S(2), a*x**(S(1) + m)/(S(1) + m) + b*x**(S(2) + m)/(S(2) + m)],
        [x**(S(5)/S(2))*(a + b*x), x, S(2), S(2)/S(7)*a*x**(S(7)/S(2)) + S(2)/S(9)*b*x**(S(9)/S(2))],
        [x**(S(5)/S(2))/(a + b*x), x, S(5), - S(2)/S(3)*a*x**(S(3)/S(2))/b**S(2) + S(2)/S(5)*x**(S(5)/S(2))/b - S(2)*a**(S(5)/S(2))*arctan(sqrt(b)*sqrt(x)/sqrt(a))/b**(S(7)/S(2)) + S(2)*a**S(2)*sqrt(x)/b**S(3)],
        [x**(S(3)/S(2))/(a + b*x), x, S(4), S(2)/S(3)*x**(S(3)/S(2))/b + S(2)*a**(S(3)/S(2))*arctan(sqrt(b)*sqrt(x)/sqrt(a))/b**(S(5)/S(2)) - S(2)*a*sqrt(x)/b**S(2)],
        [x**(S(5)/S(2))/( - a + b*x), x, S(5), S(2)/S(3)*a*x**(S(3)/S(2))/b**S(2) + S(2)/S(5)*x**(S(5)/S(2))/b - S(2)*a**(S(5)/S(2))*arctanh(sqrt(b)*sqrt(x)/sqrt(a))/b**(S(7)/S(2)) + S(2)*a**S(2)*sqrt(x)/b**S(3)],
        [x**(S(5)/S(2))*sqrt(a + b*x), x, S(6), - S(5)/S(64)*a**S(4)*arctanh(sqrt(b)*sqrt(x)/sqrt(a + b*x))/b**(S(7)/S(2)) - S(5)/S(96)*a**S(2)*x**(S(3)/S(2))*sqrt(a + b*x)/b**S(2) + S(1)/S(24)*a*x**(S(5)/S(2))*sqrt(a + b*x)/b + S(1)/S(4)*x**(S(7)/S(2))*sqrt(a + b*x) + S(5)/S(64)*a**S(3)*sqrt(x)*sqrt(a + b*x)/b**S(3)],
        [x**(S(3)/S(2))*sqrt(a + b*x), x, S(5), S(1)/S(8)*a**S(3)*arctanh(sqrt(b)*sqrt(x)/sqrt(a + b*x))/b**(S(5)/S(2)) + S(1)/S(12)*a*x**(S(3)/S(2))*sqrt(a + b*x)/b + S(1)/S(3)*x**(S(5)/S(2))*sqrt(a + b*x) - S(1)/S(8)*a**S(2)*sqrt(x)*sqrt(a + b*x)/b**S(2)],
        [x**(S(5)/S(2))/sqrt(a + b*x), x, S(5), - S(5)/S(8)*a**S(3)*arctanh(sqrt(b)*sqrt(x)/sqrt(a + b*x))/b**(S(7)/S(2)) - S(5)/S(12)*a*x**(S(3)/S(2))*sqrt(a + b*x)/b**S(2) + S(1)/S(3)*x**(S(5)/S(2))*sqrt(a + b*x)/b + S(5)/S(8)*a**S(2)*sqrt(x)*sqrt(a + b*x)/b**S(3)],
        [sqrt(x)/sqrt(a + b*x), x, S(3), - a*arctanh(sqrt(b)*sqrt(x)/sqrt(a + b*x))/b**(S(3)/S(2)) + sqrt(x)*sqrt(a + b*x)/b],
        [x**(S(2)/S(3))*(a + b*x), x, S(2), S(3)/S(5)*a*x**(S(5)/S(3)) + S(3)/S(8)*b*x**(S(8)/S(3))],
        [x**(S(1)/S(3))*(a + b*x), x, S(2), S(3)/S(4)*a*x**(S(4)/S(3)) + S(3)/S(7)*b*x**(S(7)/S(3))],
        [x**(S(5)/S(3))/(a + b*x), x, S(6), - S(3)/S(2)*a*x**(S(2)/S(3))/b**S(2) + S(3)/S(5)*x**(S(5)/S(3))/b - S(3)/S(2)*a**(S(5)/S(3))*log(a**(S(1)/S(3)) + b**(S(1)/S(3))*x**(S(1)/S(3)))/b**(S(8)/S(3)) + S(1)/S(2)*a**(S(5)/S(3))*log(a + b*x)/b**(S(8)/S(3)) - a**(S(5)/S(3))*arctan((a**(S(1)/S(3)) - S(2)*b**(S(1)/S(3))*x**(S(1)/S(3)))/(a**(S(1)/S(3))*sqrt(S(3))))*sqrt(S(3))/b**(S(8)/S(3))],
        [x**(S(4)/S(3))/(a + b*x), x, S(6), - S(3)*a*x**(S(1)/S(3))/b**S(2) + S(3)/S(4)*x**(S(4)/S(3))/b + S(3)/S(2)*a**(S(4)/S(3))*log(a**(S(1)/S(3)) + b**(S(1)/S(3))*x**(S(1)/S(3)))/b**(S(7)/S(3)) - S(1)/S(2)*a**(S(4)/S(3))*log(a + b*x)/b**(S(7)/S(3)) - a**(S(4)/S(3))*arctan((a**(S(1)/S(3)) - S(2)*b**(S(1)/S(3))*x**(S(1)/S(3)))/(a**(S(1)/S(3))*sqrt(S(3))))*sqrt(S(3))/b**(S(7)/S(3))],
        [(S(1) - x)**(S(1)/S(4))/(S(1) + x), x, S(5), S(4)*(S(1) - x)**(S(1)/S(4)) - S(2)*S(2)**(S(1)/S(4))*arctan((S(1) - x)**(S(1)/S(4))/S(2)**(S(1)/S(4))) - S(2)*S(2)**(S(1)/S(4))*arctanh((S(1) - x)**(S(1)/S(4))/S(2)**(S(1)/S(4)))],
        [x**m*(a + b*x)**S(2), x, S(2), a**S(2)*x**(S(1) + m)/(S(1) + m) + S(2)*a*b*x**(S(2) + m)/(S(2) + m) + b**S(2)*x**(S(3) + m)/(S(3) + m)],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #4
0
def test_2():
    test = [
        [(a + b*x)/x, x, S(2), b*x + a*log(x)],
        [x**S(5)/(a + b*x), x, S(2), a**S(4)*x/b**S(5) - S(1)/S(2)*a**S(3)*x**S(2)/b**S(4) + S(1)/S(3)*a**S(2)*x**S(3)/b**S(3) - S(1)/S(4)*a*x**S(4)/b**S(2) + S(1)/S(5)*x**S(5)/b - a**S(5)*log(a + b*x)/b**S(6)],
        [S(1)/(a + b*x)**S(2), x, S(1), ( - S(1))/(b*(a + b*x))],
        [S(1)/(x*(a + b*x)**S(3)), x, S(2), S(1)/S(2)/(a*(a + b*x)**S(2)) + S(1)/(a**S(2)*(a + b*x)) + log(x)/a**S(3) - log(a + b*x)/a**S(3)],
        [S(1)/(S(2) + S(2)*x), x, S(1), S(1)/S(2)*log(S(1) + x)],
        [S(1)/(x*(S(1) + b*x)), x, S(3), log(x) - log(S(1) + b*x)],
        [x**S(3)*sqrt(a + b*x), x, S(2), - S(2)/S(3)*a**S(3)*(a + b*x)**(S(3)/S(2))/b**S(4) + S(6)/S(5)*a**S(2)*(a + b*x)**(S(5)/S(2))/b**S(4) - S(6)/S(7)*a*(a + b*x)**(S(7)/S(2))/b**S(4) + S(2)/S(9)*(a + b*x)**(S(9)/S(2))/b**S(4)],
        [(a + b*x)**(S(3)/S(2)), x, S(1), S(2)/S(5)*(a + b*x)**(S(5)/S(2))/b],
        [x**S(4)/sqrt(a + b*x), x, S(2), - S(8)/S(3)*a**S(3)*(a + b*x)**(S(3)/S(2))/b**S(5) + S(12)/S(5)*a**S(2)*(a + b*x)**(S(5)/S(2))/b**S(5) - S(8)/S(7)*a*(a + b*x)**(S(7)/S(2))/b**S(5) + S(2)/S(9)*(a + b*x)**(S(9)/S(2))/b**S(5) + S(2)*a**S(4)*sqrt(a + b*x)/b**S(5)],
        [S(1)/sqrt(a + b*x), x, S(1), S(2)*sqrt(a + b*x)/b],
        [S(1)/(x*(a + b*x)**(S(3)/S(2))), x, S(3), - S(2)*arctanh(sqrt(a + b*x)/sqrt(a))/a**(S(3)/S(2)) + S(2)/(a*sqrt(a + b*x))],
        [S(1)/(x**S(2)*( - a + b*x)**(S(3)/S(2))), x, S(4), - S(3)*b*arctan(sqrt( - a + b*x)/sqrt(a))/a**(S(5)/S(2)) + ( - S(2))/(a*x*sqrt( - a + b*x)) - S(3)*sqrt( - a + b*x)/(a**S(2)*x)],
        [x**S(3)*(a + b*x)**(S(1)/S(3)), x, S(2), - S(3)/S(4)*a**S(3)*(a + b*x)**(S(4)/S(3))/b**S(4) + S(9)/S(7)*a**S(2)*(a + b*x)**(S(7)/S(3))/b**S(4) - S(9)/S(10)*a*(a + b*x)**(S(10)/S(3))/b**S(4) + S(3)/S(13)*(a + b*x)**(S(13)/S(3))/b**S(4)],
        [x**S(2)*(a + b*x)**(S(2)/S(3)), x, S(2), S(3)/S(5)*a**S(2)*(a + b*x)**(S(5)/S(3))/b**S(3) - S(3)/S(4)*a*(a + b*x)**(S(8)/S(3))/b**S(3) + S(3)/S(11)*(a + b*x)**(S(11)/S(3))/b**S(3)],
        [x**S(2)/(a + b*x)**(S(1)/S(3)), x, S(2), S(3)/S(2)*a**S(2)*(a + b*x)**(S(2)/S(3))/b**S(3) - S(6)/S(5)*a*(a + b*x)**(S(5)/S(3))/b**S(3) + S(3)/S(8)*(a + b*x)**(S(8)/S(3))/b**S(3)],
        [x**S(3)/( - a + b*x)**(S(1)/S(3)), x, S(2), S(3)/S(2)*a**S(3)*( - a + b*x)**(S(2)/S(3))/b**S(4) + S(9)/S(5)*a**S(2)*( - a + b*x)**(S(5)/S(3))/b**S(4) + S(9)/S(8)*a*( - a + b*x)**(S(8)/S(3))/b**S(4) + S(3)/S(11)*( - a + b*x)**(S(11)/S(3))/b**S(4)],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #5
0
def test_3():
    test = [
        [x**m*(a + b*x), x, S(2), a*x**(S(1) + m)/(S(1) + m) + b*x**(S(2) + m)/(S(2) + m)],
        [x**(S(5)/S(2))*(a + b*x), x, S(2), S(2)/S(7)*a*x**(S(7)/S(2)) + S(2)/S(9)*b*x**(S(9)/S(2))],
        [x**(S(5)/S(2))/(a + b*x), x, S(5), - S(2)/S(3)*a*x**(S(3)/S(2))/b**S(2) + S(2)/S(5)*x**(S(5)/S(2))/b - S(2)*a**(S(5)/S(2))*arctan(sqrt(b)*sqrt(x)/sqrt(a))/b**(S(7)/S(2)) + S(2)*a**S(2)*sqrt(x)/b**S(3)],
        [x**(S(3)/S(2))/(a + b*x), x, S(4), S(2)/S(3)*x**(S(3)/S(2))/b + S(2)*a**(S(3)/S(2))*arctan(sqrt(b)*sqrt(x)/sqrt(a))/b**(S(5)/S(2)) - S(2)*a*sqrt(x)/b**S(2)],
        [x**(S(5)/S(2))/( - a + b*x), x, S(5), S(2)/S(3)*a*x**(S(3)/S(2))/b**S(2) + S(2)/S(5)*x**(S(5)/S(2))/b - S(2)*a**(S(5)/S(2))*arctanh(sqrt(b)*sqrt(x)/sqrt(a))/b**(S(7)/S(2)) + S(2)*a**S(2)*sqrt(x)/b**S(3)],
        [x**(S(5)/S(2))*sqrt(a + b*x), x, S(6), - S(5)/S(64)*a**S(4)*arctanh(sqrt(b)*sqrt(x)/sqrt(a + b*x))/b**(S(7)/S(2)) - S(5)/S(96)*a**S(2)*x**(S(3)/S(2))*sqrt(a + b*x)/b**S(2) + S(1)/S(24)*a*x**(S(5)/S(2))*sqrt(a + b*x)/b + S(1)/S(4)*x**(S(7)/S(2))*sqrt(a + b*x) + S(5)/S(64)*a**S(3)*sqrt(x)*sqrt(a + b*x)/b**S(3)],
        [x**(S(3)/S(2))*sqrt(a + b*x), x, S(5), S(1)/S(8)*a**S(3)*arctanh(sqrt(b)*sqrt(x)/sqrt(a + b*x))/b**(S(5)/S(2)) + S(1)/S(12)*a*x**(S(3)/S(2))*sqrt(a + b*x)/b + S(1)/S(3)*x**(S(5)/S(2))*sqrt(a + b*x) - S(1)/S(8)*a**S(2)*sqrt(x)*sqrt(a + b*x)/b**S(2)],
        [x**(S(5)/S(2))/sqrt(a + b*x), x, S(5), - S(5)/S(8)*a**S(3)*arctanh(sqrt(b)*sqrt(x)/sqrt(a + b*x))/b**(S(7)/S(2)) - S(5)/S(12)*a*x**(S(3)/S(2))*sqrt(a + b*x)/b**S(2) + S(1)/S(3)*x**(S(5)/S(2))*sqrt(a + b*x)/b + S(5)/S(8)*a**S(2)*sqrt(x)*sqrt(a + b*x)/b**S(3)],
        [sqrt(x)/sqrt(a + b*x), x, S(3), - a*arctanh(sqrt(b)*sqrt(x)/sqrt(a + b*x))/b**(S(3)/S(2)) + sqrt(x)*sqrt(a + b*x)/b],
        [x**(S(2)/S(3))*(a + b*x), x, S(2), S(3)/S(5)*a*x**(S(5)/S(3)) + S(3)/S(8)*b*x**(S(8)/S(3))],
        [x**(S(1)/S(3))*(a + b*x), x, S(2), S(3)/S(4)*a*x**(S(4)/S(3)) + S(3)/S(7)*b*x**(S(7)/S(3))],
        [x**(S(5)/S(3))/(a + b*x), x, S(6), - S(3)/S(2)*a*x**(S(2)/S(3))/b**S(2) + S(3)/S(5)*x**(S(5)/S(3))/b - S(3)/S(2)*a**(S(5)/S(3))*log(a**(S(1)/S(3)) + b**(S(1)/S(3))*x**(S(1)/S(3)))/b**(S(8)/S(3)) + S(1)/S(2)*a**(S(5)/S(3))*log(a + b*x)/b**(S(8)/S(3)) - a**(S(5)/S(3))*arctan((a**(S(1)/S(3)) - S(2)*b**(S(1)/S(3))*x**(S(1)/S(3)))/(a**(S(1)/S(3))*sqrt(S(3))))*sqrt(S(3))/b**(S(8)/S(3))],
        [x**(S(4)/S(3))/(a + b*x), x, S(6), - S(3)*a*x**(S(1)/S(3))/b**S(2) + S(3)/S(4)*x**(S(4)/S(3))/b + S(3)/S(2)*a**(S(4)/S(3))*log(a**(S(1)/S(3)) + b**(S(1)/S(3))*x**(S(1)/S(3)))/b**(S(7)/S(3)) - S(1)/S(2)*a**(S(4)/S(3))*log(a + b*x)/b**(S(7)/S(3)) - a**(S(4)/S(3))*arctan((a**(S(1)/S(3)) - S(2)*b**(S(1)/S(3))*x**(S(1)/S(3)))/(a**(S(1)/S(3))*sqrt(S(3))))*sqrt(S(3))/b**(S(7)/S(3))],
        [(S(1) - x)**(S(1)/S(4))/(S(1) + x), x, S(5), S(4)*(S(1) - x)**(S(1)/S(4)) - S(2)*S(2)**(S(1)/S(4))*arctan((S(1) - x)**(S(1)/S(4))/S(2)**(S(1)/S(4))) - S(2)*S(2)**(S(1)/S(4))*arctanh((S(1) - x)**(S(1)/S(4))/S(2)**(S(1)/S(4)))],
        [x**m*(a + b*x)**S(2), x, S(2), a**S(2)*x**(S(1) + m)/(S(1) + m) + S(2)*a*b*x**(S(2) + m)/(S(2) + m) + b**S(2)*x**(S(3) + m)/(S(3) + m)],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #6
0
def test_2():
    test = [
        [(a + b*x)/x, x, S(2), b*x + a*log(x)],
        [x**S(5)/(a + b*x), x, S(2), a**S(4)*x/b**S(5) - S(1)/S(2)*a**S(3)*x**S(2)/b**S(4) + S(1)/S(3)*a**S(2)*x**S(3)/b**S(3) - S(1)/S(4)*a*x**S(4)/b**S(2) + S(1)/S(5)*x**S(5)/b - a**S(5)*log(a + b*x)/b**S(6)],
        [S(1)/(a + b*x)**S(2), x, S(1), ( - S(1))/(b*(a + b*x))],
        [S(1)/(x*(a + b*x)**S(3)), x, S(2), S(1)/S(2)/(a*(a + b*x)**S(2)) + S(1)/(a**S(2)*(a + b*x)) + log(x)/a**S(3) - log(a + b*x)/a**S(3)],
        [S(1)/(S(2) + S(2)*x), x, S(1), S(1)/S(2)*log(S(1) + x)],
        [S(1)/(x*(S(1) + b*x)), x, S(3), log(x) - log(S(1) + b*x)],
        [x**S(3)*sqrt(a + b*x), x, S(2), - S(2)/S(3)*a**S(3)*(a + b*x)**(S(3)/S(2))/b**S(4) + S(6)/S(5)*a**S(2)*(a + b*x)**(S(5)/S(2))/b**S(4) - S(6)/S(7)*a*(a + b*x)**(S(7)/S(2))/b**S(4) + S(2)/S(9)*(a + b*x)**(S(9)/S(2))/b**S(4)],
        [(a + b*x)**(S(3)/S(2)), x, S(1), S(2)/S(5)*(a + b*x)**(S(5)/S(2))/b],
        [x**S(4)/sqrt(a + b*x), x, S(2), - S(8)/S(3)*a**S(3)*(a + b*x)**(S(3)/S(2))/b**S(5) + S(12)/S(5)*a**S(2)*(a + b*x)**(S(5)/S(2))/b**S(5) - S(8)/S(7)*a*(a + b*x)**(S(7)/S(2))/b**S(5) + S(2)/S(9)*(a + b*x)**(S(9)/S(2))/b**S(5) + S(2)*a**S(4)*sqrt(a + b*x)/b**S(5)],
        [S(1)/sqrt(a + b*x), x, S(1), S(2)*sqrt(a + b*x)/b],
        [S(1)/(x*(a + b*x)**(S(3)/S(2))), x, S(3), - S(2)*arctanh(sqrt(a + b*x)/sqrt(a))/a**(S(3)/S(2)) + S(2)/(a*sqrt(a + b*x))],
        [S(1)/(x**S(2)*( - a + b*x)**(S(3)/S(2))), x, S(4), - S(3)*b*arctan(sqrt( - a + b*x)/sqrt(a))/a**(S(5)/S(2)) + ( - S(2))/(a*x*sqrt( - a + b*x)) - S(3)*sqrt( - a + b*x)/(a**S(2)*x)],
        [x**S(3)*(a + b*x)**(S(1)/S(3)), x, S(2), - S(3)/S(4)*a**S(3)*(a + b*x)**(S(4)/S(3))/b**S(4) + S(9)/S(7)*a**S(2)*(a + b*x)**(S(7)/S(3))/b**S(4) - S(9)/S(10)*a*(a + b*x)**(S(10)/S(3))/b**S(4) + S(3)/S(13)*(a + b*x)**(S(13)/S(3))/b**S(4)],
        [x**S(2)*(a + b*x)**(S(2)/S(3)), x, S(2), S(3)/S(5)*a**S(2)*(a + b*x)**(S(5)/S(3))/b**S(3) - S(3)/S(4)*a*(a + b*x)**(S(8)/S(3))/b**S(3) + S(3)/S(11)*(a + b*x)**(S(11)/S(3))/b**S(3)],
        [x**S(2)/(a + b*x)**(S(1)/S(3)), x, S(2), S(3)/S(2)*a**S(2)*(a + b*x)**(S(2)/S(3))/b**S(3) - S(6)/S(5)*a*(a + b*x)**(S(5)/S(3))/b**S(3) + S(3)/S(8)*(a + b*x)**(S(8)/S(3))/b**S(3)],
        [x**S(3)/( - a + b*x)**(S(1)/S(3)), x, S(2), S(3)/S(2)*a**S(3)*( - a + b*x)**(S(2)/S(3))/b**S(4) + S(9)/S(5)*a**S(2)*( - a + b*x)**(S(5)/S(3))/b**S(4) + S(9)/S(8)*a*( - a + b*x)**(S(8)/S(3))/b**S(4) + S(3)/S(11)*( - a + b*x)**(S(11)/S(3))/b**S(4)],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #7
0
def test_6():
    test = [
        [(S(1) + a*x)**(S(3)/S(2))/sqrt(S(1) - a*x), x, S(4), S(3)/S(2)*arcsin(a*x)/a - S(1)/S(2)*(S(1) + a*x)**(S(3)/S(2))*sqrt(S(1) - a*x)/a - S(3)/S(2)*sqrt(S(1) - a*x)*sqrt(S(1) + a*x)/a],
        [(S(1) - x)**(S(1)/S(2))/(S(1) + x)**(S(1)/S(2)), x, S(3), arcsin(x) + sqrt(S(1) - x)*sqrt(S(1) + x)],
        [S(1)/((S(1) - x)**(S(1)/S(2))*(S(1) + x)**(S(3)/S(2))), x, S(1), - sqrt(S(1) - x)/sqrt(S(1) + x)],
        [(a + a*x)**(S(5)/S(2))*(c - c*x)**(S(5)/S(2)), x, S(5), S(5)/S(24)*a*c*x*(a + a*x)**(S(3)/S(2))*(c - c*x)**(S(3)/S(2)) + S(1)/S(6)*x*(a + a*x)**(S(5)/S(2))*(c - c*x)**(S(5)/S(2)) + S(5)/S(8)*a**(S(5)/S(2))*c**(S(5)/S(2))*arctan(sqrt(c)*sqrt(a + a*x)/(sqrt(a)*sqrt(c - c*x))) + S(5)/S(16)*a**S(2)*c**S(2)*x*sqrt(a + a*x)*sqrt(c - c*x)],
        [S(1)/((a + a*x)**(S(5)/S(2))*(c - c*x)**(S(5)/S(2))), x, S(2), S(1)/S(3)*x/(a*c*(a + a*x)**(S(3)/S(2))*(c - c*x)**(S(3)/S(2))) + S(2)/S(3)*x/(a**S(2)*c**S(2)*sqrt(a + a*x)*sqrt(c - c*x))],
        [(S(3) - x)**(S(1)/S(2))*( - S(2) + x)**(S(1)/S(2)), x, S(5), - S(1)/S(8)*arcsin(S(5) - S(2)*x) - S(1)/S(2)*(S(3) - x)**(S(3)/S(2))*sqrt( - S(2) + x) + S(1)/S(4)*sqrt(S(3) - x)*sqrt( - S(2) + x)],
        [S(1)/(sqrt(a + b*x)*sqrt( - a*d + b*d*x)), x, S(2), S(2)*arctanh(sqrt(d)*sqrt(a + b*x)/sqrt( - a*d + b*d*x))/(b*sqrt(d))],
        [S(1)/((a - I*a*x)**(S(7)/S(4))*(a + I*a*x)**(S(1)/S(4))), x, S(1), - S(2)/S(3)*I*(a + I*a*x)**(S(3)/S(4))/(a**S(2)*(a - I*a*x)**(S(3)/S(4)))],
        [(a + b*x)**S(2)*(a*c - b*c*x)**n, x, S(2), - S(4)*a**S(2)*(a*c - b*c*x)**(S(1) + n)/(b*c*(S(1) + n)) + S(4)*a*(a*c - b*c*x)**(S(2) + n)/(b*c**S(2)*(S(2) + n)) - (a*c - b*c*x)**(S(3) + n)/(b*c**S(3)*(S(3) + n))],
        [(a + b*x)**S(4)*(c + d*x), x, S(2), S(1)/S(5)*(b*c - a*d)*(a + b*x)**S(5)/b**S(2) + S(1)/S(6)*d*(a + b*x)**S(6)/b**S(2)],
        [(a + b*x)*(c + d*x), x, S(2), a*c*x + S(1)/S(2)*(b*c + a*d)*x**S(2) + S(1)/S(3)*b*d*x**S(3)],
        [(a + b*x)**S(5)/(c + d*x), x, S(2), b*(b*c - a*d)**S(4)*x/d**S(5) - S(1)/S(2)*(b*c - a*d)**S(3)*(a + b*x)**S(2)/d**S(4) + S(1)/S(3)*(b*c - a*d)**S(2)*(a + b*x)**S(3)/d**S(3) - S(1)/S(4)*(b*c - a*d)*(a + b*x)**S(4)/d**S(2) + S(1)/S(5)*(a + b*x)**S(5)/d - (b*c - a*d)**S(5)*log(c + d*x)/d**S(6)],
        [(a + b*x)/(c + d*x)**S(3), x, S(1), S(1)/S(2)*(a + b*x)**S(2)/((b*c - a*d)*(c + d*x)**S(2))],
        [(a + b*x)**S(5)*(c + d*x)**(S(1)/S(2)), x, S(2), - S(2)/S(3)*(b*c - a*d)**S(5)*(c + d*x)**(S(3)/S(2))/d**S(6) + S(2)*b*(b*c - a*d)**S(4)*(c + d*x)**(S(5)/S(2))/d**S(6) - S(20)/S(7)*b**S(2)*(b*c - a*d)**S(3)*(c + d*x)**(S(7)/S(2))/d**S(6) + S(20)/S(9)*b**S(3)*(b*c - a*d)**S(2)*(c + d*x)**(S(9)/S(2))/d**S(6) - S(10)/S(11)*b**S(4)*(b*c - a*d)*(c + d*x)**(S(11)/S(2))/d**S(6) + S(2)/S(13)*b**S(5)*(c + d*x)**(S(13)/S(2))/d**S(6)],
        [(c + d*x)**(S(1)/S(2))/(a + b*x)**S(2), x, S(3), - d*arctanh(sqrt(b)*sqrt(c + d*x)/sqrt(b*c - a*d))/(b**(S(3)/S(2))*sqrt(b*c - a*d)) - sqrt(c + d*x)/(b*(a + b*x))],
        [(a + b*x)**S(4)/(c + d*x)**(S(1)/S(2)), x, S(2), - S(8)/S(3)*b*(b*c - a*d)**S(3)*(c + d*x)**(S(3)/S(2))/d**S(5) + S(12)/S(5)*b**S(2)*(b*c - a*d)**S(2)*(c + d*x)**(S(5)/S(2))/d**S(5) - S(8)/S(7)*b**S(3)*(b*c - a*d)*(c + d*x)**(S(7)/S(2))/d**S(5) + S(2)/S(9)*b**S(4)*(c + d*x)**(S(9)/S(2))/d**S(5) + S(2)*(b*c - a*d)**S(4)*sqrt(c + d*x)/d**S(5)],
        [(a + b*x)**S(2)/(c + d*x)**(S(1)/S(2)), x, S(2), - S(4)/S(3)*b*(b*c - a*d)*(c + d*x)**(S(3)/S(2))/d**S(3) + S(2)/S(5)*b**S(2)*(c + d*x)**(S(5)/S(2))/d**S(3) + S(2)*(b*c - a*d)**S(2)*sqrt(c + d*x)/d**S(3)],
        [(S(1) - x)**(S(1)/S(3))/(S(1) + x), x, S(5), S(3)*(S(1) - x)**(S(1)/S(3)) + S(3)*log(S(2)**(S(1)/S(3)) - (S(1) - x)**(S(1)/S(3)))/S(2)**(S(2)/S(3)) - log(S(1) + x)/S(2)**(S(2)/S(3)) - S(2)**(S(1)/S(3))*arctan((S(1) + S(2)**(S(2)/S(3))*(S(1) - x)**(S(1)/S(3)))/sqrt(S(3)))*sqrt(S(3))],
        [(c + d*x)**(S(1)/S(2))/(a + b*x)**(S(1)/S(2)), x, S(3), (b*c - a*d)*arctanh(sqrt(d)*sqrt(a + b*x)/(sqrt(b)*sqrt(c + d*x)))/(b**(S(3)/S(2))*sqrt(d)) + sqrt(a + b*x)*sqrt(c + d*x)/b],
        [(a + b*x)**(S(1)/S(2))*(c + d*x)**(S(3)/S(2)), x, S(5), S(1)/S(3)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(3)/S(2))/b - S(1)/S(8)*(b*c - a*d)**S(3)*arctanh(sqrt(d)*sqrt(a + b*x)/(sqrt(b)*sqrt(c + d*x)))/(b**(S(5)/S(2))*d**(S(3)/S(2))) + S(1)/S(4)*(b*c - a*d)*(a + b*x)**(S(3)/S(2))*sqrt(c + d*x)/b**S(2) + S(1)/S(8)*(b*c - a*d)**S(2)*sqrt(a + b*x)*sqrt(c + d*x)/(b**S(2)*d)],
        [(a + b*x)**(S(1)/S(2))/(c + d*x)**(S(1)/S(2)), x, S(3), - (b*c - a*d)*arctanh(sqrt(d)*sqrt(a + b*x)/(sqrt(b)*sqrt(c + d*x)))/(d**(S(3)/S(2))*sqrt(b)) + sqrt(a + b*x)*sqrt(c + d*x)/d],
        [S(1)/((a + b*x)**(S(1)/S(2))*(c + d*x)**(S(5)/S(2))), x, S(2), S(2)/S(3)*sqrt(a + b*x)/((b*c - a*d)*(c + d*x)**(S(3)/S(2))) + S(4)/S(3)*b*sqrt(a + b*x)/((b*c - a*d)**S(2)*sqrt(c + d*x))],
        [(a + b*x)**m*(c + d*x)**(S(1) + S(2)*n - S(2)*(S(1) + n)), x, S(2), (a + b*x)**(S(1) + m)*hypergeom([S(1), S(1) + m], [S(2) + m], - d*(a + b*x)/(b*c - a*d))/((b*c - a*d)*(S(1) + m))],
        [a + b*x + c*x**S(2) + d*x**S(3), x, S(1), a*x + S(1)/S(2)*b*x**S(2) + S(1)/S(3)*c*x**S(3) + S(1)/S(4)*d*x**S(4)],
        [a + d/x**S(3) + c/x**S(2) + b/x, x, S(1), - S(1)/S(2)*d/x**S(2) - c/x + a*x + b*log(x)],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #8
0
def test_numerical():
    test = [
        #[S(1)/((a + b*x)*sqrt(c + d*x)*sqrt(e + f*x)*sqrt(g + h*x)), x, S(1), - S(2)*EllipticPi(sqrt( - f/(d*e - c*f))*sqrt(c + d*x), - b*(d*e - c*f)/((b*c - a*d)*f), sqrt((d*e - c*f)*h/(f*(d*g - c*h))))*sqrt(d*(e + f*x)/(d*e - c*f))*sqrt(d*(g + h*x)/(d*g - c*h))/((b*c - a*d)*sqrt( - f/(d*e - c*f))*sqrt(e + f*x)*sqrt(g + h*x))],
        #[S(1)/(sqrt(a + b*x)*sqrt(c + d*x)*sqrt(e + f*x)*sqrt(g + h*x)), x, S(2), - S(2)*(a + b*x)*sqrt(cos(arctan(sqrt(b*e - a*f)*sqrt(g + h*x)/(sqrt(f*g - e*h)*sqrt(a + b*x))))**S(2))/cos(arctan(sqrt(b*e - a*f)*sqrt(g + h*x)/(sqrt(f*g - e*h)*sqrt(a + b*x))))*EllipticF(sin(arctan(sqrt(b*e - a*f)*sqrt(g + h*x)/(sqrt(f*g - e*h)*sqrt(a + b*x)))), sqrt((d*e - c*f)*(b*g - a*h)/((b*e - a*f)*(d*g - c*h))))*sqrt(f*g - e*h)*sqrt((b*g - a*h)*(c + d*x)/((d*g - c*h)*(a + b*x)))*sqrt((b*g - a*h)*(e + f*x)/((f*g - e*h)*(a + b*x)))*sqrt(S(1) + (b*c - a*d)*(g + h*x)/((d*g - c*h)*(a + b*x)))/((b*g - a*h)*sqrt(b*e - a*f)*sqrt(c + d*x)*sqrt(e + f*x)*sqrt((S(1) + (b*c - a*d)*(g + h*x)/((d*g - c*h)*(a + b*x)))/(S(1) + (b*e - a*f)*(g + h*x)/((f*g - e*h)*(a + b*x))))*sqrt(S(1) + (b*e - a*f)*(g + h*x)/((f*g - e*h)*(a + b*x))))],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True, _numerical=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True, _numerical=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True, _numerical=True)
Exemple #9
0
def test_numerical():
    test = [
        [(a + b*x)**(S(1)/S(2))*(c + d*x)**(S(1)/S(4)), x, S(5), S(4)/S(7)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(1)/S(4))/b + S(4)/S(21)*(b*c - a*d)*(c + d*x)**(S(1)/S(4))*sqrt(a + b*x)/(b*d) - S(8)/S(21)*(b*c - a*d)**(S(9)/S(4))*EllipticF(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))/(b*c - a*d)**(S(1)/S(4)), I)*sqrt(S(1) - b*(c + d*x)/(b*c - a*d))/(b**(S(5)/S(4))*d**S(2)*sqrt(a - b*c/d + b*(c + d*x)/d))],
        [S(1)/((a + b*x)*(a*d/b + d*x)**S(3)), x, S(2), - S(1)/S(3)*b**S(2)/(d**S(3)*(a + b*x)**S(3))],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True, _numerical=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True, _numerical=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True, _numerical=True)
Exemple #10
0
def test_numerical():
    test = [
        [(a + b*x)**(S(1)/S(2))*(c + d*x)**(S(1)/S(4)), x, S(5), S(4)/S(7)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(1)/S(4))/b + S(4)/S(21)*(b*c - a*d)*(c + d*x)**(S(1)/S(4))*sqrt(a + b*x)/(b*d) - S(8)/S(21)*(b*c - a*d)**(S(9)/S(4))*EllipticF(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))/(b*c - a*d)**(S(1)/S(4)), I)*sqrt(S(1) - b*(c + d*x)/(b*c - a*d))/(b**(S(5)/S(4))*d**S(2)*sqrt(a - b*c/d + b*(c + d*x)/d))],
        [S(1)/((a + b*x)*(a*d/b + d*x)**S(3)), x, S(2), - S(1)/S(3)*b**S(2)/(d**S(3)*(a + b*x)**S(3))],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True, _numerical=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True, _numerical=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True, _numerical=True)
Exemple #11
0
def test_numerical():
    test = [
        #[S(1)/((a + b*x)*sqrt(c + d*x)*sqrt(e + f*x)*sqrt(g + h*x)), x, S(1), - S(2)*EllipticPi(sqrt( - f/(d*e - c*f))*sqrt(c + d*x), - b*(d*e - c*f)/((b*c - a*d)*f), sqrt((d*e - c*f)*h/(f*(d*g - c*h))))*sqrt(d*(e + f*x)/(d*e - c*f))*sqrt(d*(g + h*x)/(d*g - c*h))/((b*c - a*d)*sqrt( - f/(d*e - c*f))*sqrt(e + f*x)*sqrt(g + h*x))],
        #[S(1)/(sqrt(a + b*x)*sqrt(c + d*x)*sqrt(e + f*x)*sqrt(g + h*x)), x, S(2), - S(2)*(a + b*x)*sqrt(cos(arctan(sqrt(b*e - a*f)*sqrt(g + h*x)/(sqrt(f*g - e*h)*sqrt(a + b*x))))**S(2))/cos(arctan(sqrt(b*e - a*f)*sqrt(g + h*x)/(sqrt(f*g - e*h)*sqrt(a + b*x))))*EllipticF(sin(arctan(sqrt(b*e - a*f)*sqrt(g + h*x)/(sqrt(f*g - e*h)*sqrt(a + b*x)))), sqrt((d*e - c*f)*(b*g - a*h)/((b*e - a*f)*(d*g - c*h))))*sqrt(f*g - e*h)*sqrt((b*g - a*h)*(c + d*x)/((d*g - c*h)*(a + b*x)))*sqrt((b*g - a*h)*(e + f*x)/((f*g - e*h)*(a + b*x)))*sqrt(S(1) + (b*c - a*d)*(g + h*x)/((d*g - c*h)*(a + b*x)))/((b*g - a*h)*sqrt(b*e - a*f)*sqrt(c + d*x)*sqrt(e + f*x)*sqrt((S(1) + (b*c - a*d)*(g + h*x)/((d*g - c*h)*(a + b*x)))/(S(1) + (b*e - a*f)*(g + h*x)/((f*g - e*h)*(a + b*x))))*sqrt(S(1) + (b*e - a*f)*(g + h*x)/((f*g - e*h)*(a + b*x))))],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True, _numerical=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True, _numerical=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True, _numerical=True)
Exemple #12
0
def test_2():
    test = [
        [x**m*(e + f*x)**n/((a + b*x)*(c + d*x)), x, S(6), b*x**(S(1) + m)*(e + f*x)**n*AppellF1(S(1) + m, - n, S(1), S(2) + m, - f*x/e, - b*x/a)/(a*(b*c - a*d)*(S(1) + m)*(S(1) + f*x/e)**n) - d*x**(S(1) + m)*(e + f*x)**n*AppellF1(S(1) + m, - n, S(1), S(2) + m, - f*x/e, - d*x/c)/(c*(b*c - a*d)*(S(1) + m)*(S(1) + f*x/e)**n)],
        [(a + b*x)**m*(c + d*x)**n*(e + f*x)*(g + h*x), x, S(3), - (a + b*x)**(S(1) + m)*(c + d*x)**(S(1) + n)*(b*c*f*h*(S(2) + m) + a*d*f*h*(S(2) + n) - b*d*(f*g + e*h)*(S(3) + m + n) - b*d*f*h*(S(2) + m + n)*x)/(b**S(2)*d**S(2)*(S(2) + m + n)*(S(3) + m + n)) + (a**S(2)*d**S(2)*f*h*(S(1) + n)*(S(2) + n) + a*b*d*(S(1) + n)*(S(2)*c*f*h*(S(1) + m) - d*(f*g + e*h)*(S(3) + m + n)) + b**S(2)*(c**S(2)*f*h*(S(1) + m)*(S(2) + m) - c*d*(f*g + e*h)*(S(1) + m)*(S(3) + m + n) + d**S(2)*e*g*(S(2) + m + n)*(S(3) + m + n)))*(a + b*x)**(S(1) + m)*(c + d*x)**n*hypergeom([S(1) + m, - n], [S(2) + m], - d*(a + b*x)/(b*c - a*d))/(b**S(3)*d**S(2)*(S(1) + m)*(S(2) + m + n)*(S(3) + m + n)*(b*(c + d*x)/(b*c - a*d))**n)],
        [(a + b*x)**m*(A + B*x)*(c + d*x)**n*(e + f*x)**p, x, S(7), (A*b - a*B)*(a + b*x)**(S(1) + m)*(c + d*x)**n*(e + f*x)**p*AppellF1(S(1) + m, - n, - p, S(2) + m, - d*(a + b*x)/(b*c - a*d), - f*(a + b*x)/(b*e - a*f))/(b**S(2)*(S(1) + m)*(b*(c + d*x)/(b*c - a*d))**n*(b*(e + f*x)/(b*e - a*f))**p) + B*(a + b*x)**(S(2) + m)*(c + d*x)**n*(e + f*x)**p*AppellF1(S(2) + m, - n, - p, S(3) + m, - d*(a + b*x)/(b*c - a*d), - f*(a + b*x)/(b*e - a*f))/(b**S(2)*(S(2) + m)*(b*(c + d*x)/(b*c - a*d))**n*(b*(e + f*x)/(b*e - a*f))**p)],
        [(A + B*x)*(c + d*x)**n*(e + f*x)**p/(a + b*x), x, S(5), - (A*b - a*B)*(c + d*x)**(S(1) + n)*(e + f*x)**p*AppellF1(S(1) + n, S(1), - p, S(2) + n, b*(c + d*x)/(b*c - a*d), - f*(c + d*x)/(d*e - c*f))/(b*(b*c - a*d)*(S(1) + n)*(d*(e + f*x)/(d*e - c*f))**p) - B*(c + d*x)**(S(1) + n)*(e + f*x)**(S(1) + p)*hypergeom([S(1), S(2) + n + p], [S(2) + p], d*(e + f*x)/(d*e - c*f))/(b*(d*e - c*f)*(S(1) + p)), - (A*b - a*B)*(c + d*x)**(S(1) + n)*(e + f*x)**p*AppellF1(S(1) + n, - p, S(1), S(2) + n, - f*(c + d*x)/(d*e - c*f), b*(c + d*x)/(b*c - a*d))/(b*(b*c - a*d)*(S(1) + n)*(d*(e + f*x)/(d*e - c*f))**p) + B*(c + d*x)**(S(1) + n)*(e + f*x)**p*hypergeom([S(1) + n, - p], [S(2) + n], - f*(c + d*x)/(d*e - c*f))/(b*d*(S(1) + n)*(d*(e + f*x)/(d*e - c*f))**p)],
        [(c*i + d*i*x)/(sqrt(c + d*x)*sqrt(e + f*x)*sqrt(g + h*x)), x, S(3), S(2)*i*EllipticE(sqrt(h)*sqrt(e + f*x)/sqrt( - f*g + e*h), sqrt( - d*(f*g - e*h)/((d*e - c*f)*h)))*sqrt( - f*g + e*h)*sqrt(c + d*x)*sqrt(f*(g + h*x)/(f*g - e*h))/(f*sqrt(h)*sqrt( - f*(c + d*x)/(d*e - c*f))*sqrt(g + h*x))],
        [(a + b*x)**m*(c + d*x)**n*(e + f*x)**p, x, S(3), (a + b*x)**(S(1) + m)*(c + d*x)**n*(e + f*x)**p*AppellF1(S(1) + m, - n, - p, S(2) + m, - d*(a + b*x)/(b*c - a*d), - f*(a + b*x)/(b*e - a*f))/(b*(S(1) + m)*(b*(c + d*x)/(b*c - a*d))**n*(b*(e + f*x)/(b*e - a*f))**p)],
        [(a + b*x)**m*(c + d*x)**n*(e + f*x)**p/(g + h*x), x, S(0), Integrate((a + b*x)**m*(c + d*x)**n*(e + f*x)**p/(g + h*x), x)]
        [x**S(3)*(S(1) + a*x)/(sqrt(a*x)*sqrt(S(1) - a*x)), x, S(8), - S(75)/S(128)*arcsin(S(1) - S(2)*a*x)/a**S(4) - S(25)/S(32)*(a*x)**(S(3)/S(2))*sqrt(S(1) - a*x)/a**S(4) - S(5)/S(8)*(a*x)**(S(5)/S(2))*sqrt(S(1) - a*x)/a**S(4) - S(1)/S(4)*(a*x)**(S(7)/S(2))*sqrt(S(1) - a*x)/a**S(4) - S(75)/S(64)*sqrt(a*x)*sqrt(S(1) - a*x)/a**S(4)],
    ]
    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #13
0
def test_2():
    test = [
        [x**m*(e + f*x)**n/((a + b*x)*(c + d*x)), x, S(6), b*x**(S(1) + m)*(e + f*x)**n*AppellF1(S(1) + m, - n, S(1), S(2) + m, - f*x/e, - b*x/a)/(a*(b*c - a*d)*(S(1) + m)*(S(1) + f*x/e)**n) - d*x**(S(1) + m)*(e + f*x)**n*AppellF1(S(1) + m, - n, S(1), S(2) + m, - f*x/e, - d*x/c)/(c*(b*c - a*d)*(S(1) + m)*(S(1) + f*x/e)**n)],
        [(a + b*x)**m*(c + d*x)**n*(e + f*x)*(g + h*x), x, S(3), - (a + b*x)**(S(1) + m)*(c + d*x)**(S(1) + n)*(b*c*f*h*(S(2) + m) + a*d*f*h*(S(2) + n) - b*d*(f*g + e*h)*(S(3) + m + n) - b*d*f*h*(S(2) + m + n)*x)/(b**S(2)*d**S(2)*(S(2) + m + n)*(S(3) + m + n)) + (a**S(2)*d**S(2)*f*h*(S(1) + n)*(S(2) + n) + a*b*d*(S(1) + n)*(S(2)*c*f*h*(S(1) + m) - d*(f*g + e*h)*(S(3) + m + n)) + b**S(2)*(c**S(2)*f*h*(S(1) + m)*(S(2) + m) - c*d*(f*g + e*h)*(S(1) + m)*(S(3) + m + n) + d**S(2)*e*g*(S(2) + m + n)*(S(3) + m + n)))*(a + b*x)**(S(1) + m)*(c + d*x)**n*hypergeom([S(1) + m, - n], [S(2) + m], - d*(a + b*x)/(b*c - a*d))/(b**S(3)*d**S(2)*(S(1) + m)*(S(2) + m + n)*(S(3) + m + n)*(b*(c + d*x)/(b*c - a*d))**n)],
        [(a + b*x)**m*(A + B*x)*(c + d*x)**n*(e + f*x)**p, x, S(7), (A*b - a*B)*(a + b*x)**(S(1) + m)*(c + d*x)**n*(e + f*x)**p*AppellF1(S(1) + m, - n, - p, S(2) + m, - d*(a + b*x)/(b*c - a*d), - f*(a + b*x)/(b*e - a*f))/(b**S(2)*(S(1) + m)*(b*(c + d*x)/(b*c - a*d))**n*(b*(e + f*x)/(b*e - a*f))**p) + B*(a + b*x)**(S(2) + m)*(c + d*x)**n*(e + f*x)**p*AppellF1(S(2) + m, - n, - p, S(3) + m, - d*(a + b*x)/(b*c - a*d), - f*(a + b*x)/(b*e - a*f))/(b**S(2)*(S(2) + m)*(b*(c + d*x)/(b*c - a*d))**n*(b*(e + f*x)/(b*e - a*f))**p)],
        [(A + B*x)*(c + d*x)**n*(e + f*x)**p/(a + b*x), x, S(5), - (A*b - a*B)*(c + d*x)**(S(1) + n)*(e + f*x)**p*AppellF1(S(1) + n, S(1), - p, S(2) + n, b*(c + d*x)/(b*c - a*d), - f*(c + d*x)/(d*e - c*f))/(b*(b*c - a*d)*(S(1) + n)*(d*(e + f*x)/(d*e - c*f))**p) - B*(c + d*x)**(S(1) + n)*(e + f*x)**(S(1) + p)*hypergeom([S(1), S(2) + n + p], [S(2) + p], d*(e + f*x)/(d*e - c*f))/(b*(d*e - c*f)*(S(1) + p)), - (A*b - a*B)*(c + d*x)**(S(1) + n)*(e + f*x)**p*AppellF1(S(1) + n, - p, S(1), S(2) + n, - f*(c + d*x)/(d*e - c*f), b*(c + d*x)/(b*c - a*d))/(b*(b*c - a*d)*(S(1) + n)*(d*(e + f*x)/(d*e - c*f))**p) + B*(c + d*x)**(S(1) + n)*(e + f*x)**p*hypergeom([S(1) + n, - p], [S(2) + n], - f*(c + d*x)/(d*e - c*f))/(b*d*(S(1) + n)*(d*(e + f*x)/(d*e - c*f))**p)],
        [(c*i + d*i*x)/(sqrt(c + d*x)*sqrt(e + f*x)*sqrt(g + h*x)), x, S(3), S(2)*i*EllipticE(sqrt(h)*sqrt(e + f*x)/sqrt( - f*g + e*h), sqrt( - d*(f*g - e*h)/((d*e - c*f)*h)))*sqrt( - f*g + e*h)*sqrt(c + d*x)*sqrt(f*(g + h*x)/(f*g - e*h))/(f*sqrt(h)*sqrt( - f*(c + d*x)/(d*e - c*f))*sqrt(g + h*x))],
        [(a + b*x)**m*(c + d*x)**n*(e + f*x)**p, x, S(3), (a + b*x)**(S(1) + m)*(c + d*x)**n*(e + f*x)**p*AppellF1(S(1) + m, - n, - p, S(2) + m, - d*(a + b*x)/(b*c - a*d), - f*(a + b*x)/(b*e - a*f))/(b*(S(1) + m)*(b*(c + d*x)/(b*c - a*d))**n*(b*(e + f*x)/(b*e - a*f))**p)],
        [(a + b*x)**m*(c + d*x)**n*(e + f*x)**p/(g + h*x), x, S(0), Integrate((a + b*x)**m*(c + d*x)**n*(e + f*x)**p/(g + h*x), x)]
        [x**S(3)*(S(1) + a*x)/(sqrt(a*x)*sqrt(S(1) - a*x)), x, S(8), - S(75)/S(128)*arcsin(S(1) - S(2)*a*x)/a**S(4) - S(25)/S(32)*(a*x)**(S(3)/S(2))*sqrt(S(1) - a*x)/a**S(4) - S(5)/S(8)*(a*x)**(S(5)/S(2))*sqrt(S(1) - a*x)/a**S(4) - S(1)/S(4)*(a*x)**(S(7)/S(2))*sqrt(S(1) - a*x)/a**S(4) - S(75)/S(64)*sqrt(a*x)*sqrt(S(1) - a*x)/a**S(4)],
    ]
    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #14
0
def test_1():
    test = [
        [ - S(3)/S(2), x, S(1), - S(3)/S(2)*x],
        [Pi, x, S(1), Pi*x],
        [a, x, S(1), a*x],
        [x**m, x, S(1), x**(S(1) + m)/(S(1) + m)],
        [x**S(100), x, S(1), S(1)/S(101)*x**S(101)],
        [x**(S(5)/S(2)), x, S(1), S(2)/S(7)*x**(S(7)/S(2))],
        [x**(S(5)/S(3)), x, S(1), S(3)/S(8)*x**(S(8)/S(3))],
        [S(1)/x**(S(1)/S(3)), x, S(1), S(3)/S(2)*x**(S(2)/S(3))],
        [x**S(3)*(a + b*x), x, S(2), S(1)/S(4)*a*x**S(4) + S(1)/S(5)*b*x**S(5)],
        [(a + b*x)**S(2)/x**S(2), x, S(2), - a**S(2)/x + b**S(2)*x + S(2)*a*b*log(x)],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #15
0
def test_7():
    test = [
        #[(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(1)/S(3)), x, S(5), S(12)/S(187)*(b*c - a*d)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(1)/S(3))/(b*d) + S(6)/S(17)*(a + b*x)**(S(5)/S(2))*(c + d*x)**(S(1)/S(3))/b - S(108)/S(935)*(b*c - a*d)**S(2)*(c + d*x)**(S(1)/S(3))*sqrt(a + b*x)/(b*d**S(2)) - S(108)/S(935)*S(3)**(S(3)/S(4))*(b*c - a*d)**S(3)*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))*EllipticF(( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) + sqrt(S(3))))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3)))), sqrt( - S(7) + S(4)*sqrt(S(3))))*sqrt(((b*c - a*d)**(S(2)/S(3)) + b**(S(1)/S(3))*(b*c - a*d)**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + b**(S(2)/S(3))*(c + d*x)**(S(2)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2))*sqrt(S(2) - sqrt(S(3)))/(b**(S(4)/S(3))*d**S(3)*sqrt(a - b*c/d + b*(c + d*x)/d)*sqrt( - (b*c - a*d)**(S(1)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2)))],
        #[(a + b*x)**(S(3)/S(2))/(c + d*x)**(S(1)/S(3)), x, S(6), S(6)/S(13)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(2)/S(3))/d - S(54)/S(91)*(b*c - a*d)*(c + d*x)**(S(2)/S(3))*sqrt(a + b*x)/d**S(2) - S(162)/S(91)*(b*c - a*d)**S(2)*sqrt(a - b*c/d + b*(c + d*x)/d)/(b**(S(2)/S(3))*d**S(2)*( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))) - S(54)/S(91)*S(3)**(S(3)/S(4))*(b*c - a*d)**(S(7)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))*EllipticF(( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) + sqrt(S(3))))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3)))), sqrt( - S(7) + S(4)*sqrt(S(3))))*sqrt(S(2))*sqrt(((b*c - a*d)**(S(2)/S(3)) + b**(S(1)/S(3))*(b*c - a*d)**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + b**(S(2)/S(3))*(c + d*x)**(S(2)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2))/(b**(S(2)/S(3))*d**S(3)*sqrt(a - b*c/d + b*(c + d*x)/d)*sqrt( - (b*c - a*d)**(S(1)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2))) + S(81)/S(91)*S(3)**(S(1)/S(4))*(b*c - a*d)**(S(7)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))*EllipticE(( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) + sqrt(S(3))))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3)))), sqrt( - S(7) + S(4)*sqrt(S(3))))*sqrt(((b*c - a*d)**(S(2)/S(3)) + b**(S(1)/S(3))*(b*c - a*d)**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + b**(S(2)/S(3))*(c + d*x)**(S(2)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2))*sqrt(S(2) + sqrt(S(3)))/(b**(S(2)/S(3))*d**S(3)*sqrt(a - b*c/d + b*(c + d*x)/d)*sqrt( - (b*c - a*d)**(S(1)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2)))],
        [(a + b*x)**(S(2)/S(3))*(c + d*x)**(S(1)/S(3)), x, S(3), S(1)/S(6)*(b*c - a*d)*(a + b*x)**(S(2)/S(3))*(c + d*x)**(S(1)/S(3))/(b*d) + S(1)/S(2)*(a + b*x)**(S(5)/S(3))*(c + d*x)**(S(1)/S(3))/b + S(1)/S(18)*(b*c - a*d)**S(2)*log(c + d*x)/(b**(S(4)/S(3))*d**(S(5)/S(3))) + S(1)/S(6)*(b*c - a*d)**S(2)*log( - S(1) + d**(S(1)/S(3))*(a + b*x)**(S(1)/S(3))/(b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))))/(b**(S(4)/S(3))*d**(S(5)/S(3))) + S(1)/S(3)*(b*c - a*d)**S(2)*arctan(S(1)/sqrt(S(3)) + S(2)*d**(S(1)/S(3))*(a + b*x)**(S(1)/S(3))/(b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*sqrt(S(3))))/(b**(S(4)/S(3))*d**(S(5)/S(3))*sqrt(S(3)))],
        [(a + b*x)**(S(4)/S(3))/(c + d*x)**(S(1)/S(3)), x, S(3), - S(2)/S(3)*(b*c - a*d)*(a + b*x)**(S(1)/S(3))*(c + d*x)**(S(2)/S(3))/d**S(2) + S(1)/S(2)*(a + b*x)**(S(4)/S(3))*(c + d*x)**(S(2)/S(3))/d - S(1)/S(9)*(b*c - a*d)**S(2)*log(a + b*x)/(b**(S(2)/S(3))*d**(S(7)/S(3))) - S(1)/S(3)*(b*c - a*d)**S(2)*log( - S(1) + b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))/(d**(S(1)/S(3))*(a + b*x)**(S(1)/S(3))))/(b**(S(2)/S(3))*d**(S(7)/S(3))) - S(2)/S(3)*(b*c - a*d)**S(2)*arctan(S(1)/sqrt(S(3)) + S(2)*b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))/(d**(S(1)/S(3))*(a + b*x)**(S(1)/S(3))*sqrt(S(3))))/(b**(S(2)/S(3))*d**(S(7)/S(3))*sqrt(S(3)))],
        #[(a + b*x)**(S(5)/S(2))/(c + d*x)**(S(1)/S(4)), x, S(10), - S(40)/S(117)*(b*c - a*d)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(3)/S(4))/d**S(2) + S(4)/S(13)*(a + b*x)**(S(5)/S(2))*(c + d*x)**(S(3)/S(4))/d + S(16)/S(39)*(b*c - a*d)**S(2)*(c + d*x)**(S(3)/S(4))*sqrt(a + b*x)/d**S(3) - S(32)/S(39)*(b*c - a*d)**(S(15)/S(4))*EllipticE(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))/(b*c - a*d)**(S(1)/S(4)), I)*sqrt(S(1) - b*(c + d*x)/(b*c - a*d))/(b**(S(3)/S(4))*d**S(4)*sqrt(a - b*c/d + b*(c + d*x)/d)) + S(32)/S(39)*(b*c - a*d)**(S(15)/S(4))*EllipticF(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))/(b*c - a*d)**(S(1)/S(4)), I)*sqrt(S(1) - b*(c + d*x)/(b*c - a*d))/(b**(S(3)/S(4))*d**S(4)*sqrt(a - b*c/d + b*(c + d*x)/d))],
        [(c + d*x)**(S(5)/S(4))/(a + b*x)**(S(25)/S(4)), x, S(4), - S(4)/S(21)*(c + d*x)**(S(9)/S(4))/((b*c - a*d)*(a + b*x)**(S(21)/S(4))) + S(16)/S(119)*d*(c + d*x)**(S(9)/S(4))/((b*c - a*d)**S(2)*(a + b*x)**(S(17)/S(4))) - S(128)/S(1547)*d**S(2)*(c + d*x)**(S(9)/S(4))/((b*c - a*d)**S(3)*(a + b*x)**(S(13)/S(4))) + S(512)/S(13923)*d**S(3)*(c + d*x)**(S(9)/S(4))/((b*c - a*d)**S(4)*(a + b*x)**(S(9)/S(4)))],
        [(a + b*x)**(S(5)/S(4))/(c + d*x)**(S(1)/S(4)), x, S(6), - S(5)/S(8)*(b*c - a*d)*(a + b*x)**(S(1)/S(4))*(c + d*x)**(S(3)/S(4))/d**S(2) + S(1)/S(2)*(a + b*x)**(S(5)/S(4))*(c + d*x)**(S(3)/S(4))/d + S(5)/S(16)*(b*c - a*d)**S(2)*arctan(d**(S(1)/S(4))*(a + b*x)**(S(1)/S(4))/(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))))/(b**(S(3)/S(4))*d**(S(9)/S(4))) + S(5)/S(16)*(b*c - a*d)**S(2)*arctanh(d**(S(1)/S(4))*(a + b*x)**(S(1)/S(4))/(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))))/(b**(S(3)/S(4))*d**(S(9)/S(4)))],
        [S(1)/((a + b*x)**(S(3)/S(4))*(c + d*x)**(S(1)/S(4))), x, S(4), S(2)*arctan(d**(S(1)/S(4))*(a + b*x)**(S(1)/S(4))/(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))))/(b**(S(3)/S(4))*d**(S(1)/S(4))) + S(2)*arctanh(d**(S(1)/S(4))*(a + b*x)**(S(1)/S(4))/(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))))/(b**(S(3)/S(4))*d**(S(1)/S(4)))],
        #[(a + b*x)**(S(3)/S(2))/(c + d*x)**(S(1)/S(5)), x, S(2), S(2)/S(5)*(a + b*x)**(S(5)/S(2))*(b*(c + d*x)/(b*c - a*d))**(S(1)/S(5))*hypergeom([S(1)/S(5), S(5)/S(2)], [S(7)/S(2)], - d*(a + b*x)/(b*c - a*d))/(b*(c + d*x)**(S(1)/S(5)))],
        #[(a + b*x)**(S(5)/S(2))/(c + d*x)**(S(1)/S(6)), x, S(7), - S(9)/S(28)*(b*c - a*d)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(5)/S(6))/d**S(2) + S(3)/S(10)*(a + b*x)**(S(5)/S(2))*(c + d*x)**(S(5)/S(6))/d + S(81)/S(224)*(b*c - a*d)**S(2)*(c + d*x)**(S(5)/S(6))*sqrt(a + b*x)/d**S(3) + S(243)/S(448)*(b*c - a*d)**S(3)*(c + d*x)**(S(1)/S(6))*(S(1) + sqrt(S(3)))*sqrt(a - b*c/d + b*(c + d*x)/d)/(b**(S(2)/S(3))*d**S(3)*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))) + S(243)/S(448)*S(3)**(S(1)/S(4))*(b*c - a*d)**(S(10)/S(3))*(c + d*x)**(S(1)/S(6))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))*sqrt(cos(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))))**S(2))/cos(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))))*EllipticE(sin(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3)))))), sqrt(S(1)/S(4)*(S(2) + sqrt(S(3)))))*sqrt(((b*c - a*d)**(S(2)/S(3)) + b**(S(1)/S(3))*(b*c - a*d)**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + b**(S(2)/S(3))*(c + d*x)**(S(2)/S(3)))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))**S(2))/(b**(S(2)/S(3))*d**S(4)*sqrt(a - b*c/d + b*(c + d*x)/d)*sqrt( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))**S(2))) + S(81)/S(896)*S(3)**(S(3)/S(4))*(b*c - a*d)**(S(10)/S(3))*(c + d*x)**(S(1)/S(6))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))*sqrt(cos(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))))**S(2))/cos(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))))*EllipticF(sin(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3)))))), sqrt(S(1)/S(4)*(S(2) + sqrt(S(3)))))*(S(1) - sqrt(S(3)))*sqrt(((b*c - a*d)**(S(2)/S(3)) + b**(S(1)/S(3))*(b*c - a*d)**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + b**(S(2)/S(3))*(c + d*x)**(S(2)/S(3)))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))**S(2))/(b**(S(2)/S(3))*d**S(4)*sqrt(a - b*c/d + b*(c + d*x)/d)*sqrt( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))**S(2)))],
        #[(a + b*x)**m*(c + d*x)**n, x, S(2), - (a + b*x)**(S(1) + m)*(c + d*x)**(S(1) + n)*hypergeom([S(1), S(2) + m + n], [S(2) + n], b*(c + d*x)/(b*c - a*d))/((b*c - a*d)*(S(1) + n)), (a + b*x)**(S(1) + m)*(c + d*x)**n*hypergeom([S(1) + m, - n], [S(2) + m], - d*(a + b*x)/(b*c - a*d))/(b*(S(1) + m)*(b*(c + d*x)/(b*c - a*d))**n)],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #16
0
def test_7():
    test = [
        #[(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(1)/S(3)), x, S(5), S(12)/S(187)*(b*c - a*d)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(1)/S(3))/(b*d) + S(6)/S(17)*(a + b*x)**(S(5)/S(2))*(c + d*x)**(S(1)/S(3))/b - S(108)/S(935)*(b*c - a*d)**S(2)*(c + d*x)**(S(1)/S(3))*sqrt(a + b*x)/(b*d**S(2)) - S(108)/S(935)*S(3)**(S(3)/S(4))*(b*c - a*d)**S(3)*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))*EllipticF(( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) + sqrt(S(3))))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3)))), sqrt( - S(7) + S(4)*sqrt(S(3))))*sqrt(((b*c - a*d)**(S(2)/S(3)) + b**(S(1)/S(3))*(b*c - a*d)**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + b**(S(2)/S(3))*(c + d*x)**(S(2)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2))*sqrt(S(2) - sqrt(S(3)))/(b**(S(4)/S(3))*d**S(3)*sqrt(a - b*c/d + b*(c + d*x)/d)*sqrt( - (b*c - a*d)**(S(1)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2)))],
        #[(a + b*x)**(S(3)/S(2))/(c + d*x)**(S(1)/S(3)), x, S(6), S(6)/S(13)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(2)/S(3))/d - S(54)/S(91)*(b*c - a*d)*(c + d*x)**(S(2)/S(3))*sqrt(a + b*x)/d**S(2) - S(162)/S(91)*(b*c - a*d)**S(2)*sqrt(a - b*c/d + b*(c + d*x)/d)/(b**(S(2)/S(3))*d**S(2)*( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))) - S(54)/S(91)*S(3)**(S(3)/S(4))*(b*c - a*d)**(S(7)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))*EllipticF(( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) + sqrt(S(3))))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3)))), sqrt( - S(7) + S(4)*sqrt(S(3))))*sqrt(S(2))*sqrt(((b*c - a*d)**(S(2)/S(3)) + b**(S(1)/S(3))*(b*c - a*d)**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + b**(S(2)/S(3))*(c + d*x)**(S(2)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2))/(b**(S(2)/S(3))*d**S(3)*sqrt(a - b*c/d + b*(c + d*x)/d)*sqrt( - (b*c - a*d)**(S(1)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2))) + S(81)/S(91)*S(3)**(S(1)/S(4))*(b*c - a*d)**(S(7)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))*EllipticE(( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) + sqrt(S(3))))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3)))), sqrt( - S(7) + S(4)*sqrt(S(3))))*sqrt(((b*c - a*d)**(S(2)/S(3)) + b**(S(1)/S(3))*(b*c - a*d)**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + b**(S(2)/S(3))*(c + d*x)**(S(2)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2))*sqrt(S(2) + sqrt(S(3)))/(b**(S(2)/S(3))*d**S(3)*sqrt(a - b*c/d + b*(c + d*x)/d)*sqrt( - (b*c - a*d)**(S(1)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))/( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + (b*c - a*d)**(S(1)/S(3))*(S(1) - sqrt(S(3))))**S(2)))],
        [(a + b*x)**(S(2)/S(3))*(c + d*x)**(S(1)/S(3)), x, S(3), S(1)/S(6)*(b*c - a*d)*(a + b*x)**(S(2)/S(3))*(c + d*x)**(S(1)/S(3))/(b*d) + S(1)/S(2)*(a + b*x)**(S(5)/S(3))*(c + d*x)**(S(1)/S(3))/b + S(1)/S(18)*(b*c - a*d)**S(2)*log(c + d*x)/(b**(S(4)/S(3))*d**(S(5)/S(3))) + S(1)/S(6)*(b*c - a*d)**S(2)*log( - S(1) + d**(S(1)/S(3))*(a + b*x)**(S(1)/S(3))/(b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))))/(b**(S(4)/S(3))*d**(S(5)/S(3))) + S(1)/S(3)*(b*c - a*d)**S(2)*arctan(S(1)/sqrt(S(3)) + S(2)*d**(S(1)/S(3))*(a + b*x)**(S(1)/S(3))/(b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*sqrt(S(3))))/(b**(S(4)/S(3))*d**(S(5)/S(3))*sqrt(S(3)))],
        [(a + b*x)**(S(4)/S(3))/(c + d*x)**(S(1)/S(3)), x, S(3), - S(2)/S(3)*(b*c - a*d)*(a + b*x)**(S(1)/S(3))*(c + d*x)**(S(2)/S(3))/d**S(2) + S(1)/S(2)*(a + b*x)**(S(4)/S(3))*(c + d*x)**(S(2)/S(3))/d - S(1)/S(9)*(b*c - a*d)**S(2)*log(a + b*x)/(b**(S(2)/S(3))*d**(S(7)/S(3))) - S(1)/S(3)*(b*c - a*d)**S(2)*log( - S(1) + b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))/(d**(S(1)/S(3))*(a + b*x)**(S(1)/S(3))))/(b**(S(2)/S(3))*d**(S(7)/S(3))) - S(2)/S(3)*(b*c - a*d)**S(2)*arctan(S(1)/sqrt(S(3)) + S(2)*b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))/(d**(S(1)/S(3))*(a + b*x)**(S(1)/S(3))*sqrt(S(3))))/(b**(S(2)/S(3))*d**(S(7)/S(3))*sqrt(S(3)))],
        #[(a + b*x)**(S(5)/S(2))/(c + d*x)**(S(1)/S(4)), x, S(10), - S(40)/S(117)*(b*c - a*d)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(3)/S(4))/d**S(2) + S(4)/S(13)*(a + b*x)**(S(5)/S(2))*(c + d*x)**(S(3)/S(4))/d + S(16)/S(39)*(b*c - a*d)**S(2)*(c + d*x)**(S(3)/S(4))*sqrt(a + b*x)/d**S(3) - S(32)/S(39)*(b*c - a*d)**(S(15)/S(4))*EllipticE(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))/(b*c - a*d)**(S(1)/S(4)), I)*sqrt(S(1) - b*(c + d*x)/(b*c - a*d))/(b**(S(3)/S(4))*d**S(4)*sqrt(a - b*c/d + b*(c + d*x)/d)) + S(32)/S(39)*(b*c - a*d)**(S(15)/S(4))*EllipticF(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))/(b*c - a*d)**(S(1)/S(4)), I)*sqrt(S(1) - b*(c + d*x)/(b*c - a*d))/(b**(S(3)/S(4))*d**S(4)*sqrt(a - b*c/d + b*(c + d*x)/d))],
        [(c + d*x)**(S(5)/S(4))/(a + b*x)**(S(25)/S(4)), x, S(4), - S(4)/S(21)*(c + d*x)**(S(9)/S(4))/((b*c - a*d)*(a + b*x)**(S(21)/S(4))) + S(16)/S(119)*d*(c + d*x)**(S(9)/S(4))/((b*c - a*d)**S(2)*(a + b*x)**(S(17)/S(4))) - S(128)/S(1547)*d**S(2)*(c + d*x)**(S(9)/S(4))/((b*c - a*d)**S(3)*(a + b*x)**(S(13)/S(4))) + S(512)/S(13923)*d**S(3)*(c + d*x)**(S(9)/S(4))/((b*c - a*d)**S(4)*(a + b*x)**(S(9)/S(4)))],
        [(a + b*x)**(S(5)/S(4))/(c + d*x)**(S(1)/S(4)), x, S(6), - S(5)/S(8)*(b*c - a*d)*(a + b*x)**(S(1)/S(4))*(c + d*x)**(S(3)/S(4))/d**S(2) + S(1)/S(2)*(a + b*x)**(S(5)/S(4))*(c + d*x)**(S(3)/S(4))/d + S(5)/S(16)*(b*c - a*d)**S(2)*arctan(d**(S(1)/S(4))*(a + b*x)**(S(1)/S(4))/(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))))/(b**(S(3)/S(4))*d**(S(9)/S(4))) + S(5)/S(16)*(b*c - a*d)**S(2)*arctanh(d**(S(1)/S(4))*(a + b*x)**(S(1)/S(4))/(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))))/(b**(S(3)/S(4))*d**(S(9)/S(4)))],
        [S(1)/((a + b*x)**(S(3)/S(4))*(c + d*x)**(S(1)/S(4))), x, S(4), S(2)*arctan(d**(S(1)/S(4))*(a + b*x)**(S(1)/S(4))/(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))))/(b**(S(3)/S(4))*d**(S(1)/S(4))) + S(2)*arctanh(d**(S(1)/S(4))*(a + b*x)**(S(1)/S(4))/(b**(S(1)/S(4))*(c + d*x)**(S(1)/S(4))))/(b**(S(3)/S(4))*d**(S(1)/S(4)))],
        #[(a + b*x)**(S(3)/S(2))/(c + d*x)**(S(1)/S(5)), x, S(2), S(2)/S(5)*(a + b*x)**(S(5)/S(2))*(b*(c + d*x)/(b*c - a*d))**(S(1)/S(5))*hypergeom([S(1)/S(5), S(5)/S(2)], [S(7)/S(2)], - d*(a + b*x)/(b*c - a*d))/(b*(c + d*x)**(S(1)/S(5)))],
        #[(a + b*x)**(S(5)/S(2))/(c + d*x)**(S(1)/S(6)), x, S(7), - S(9)/S(28)*(b*c - a*d)*(a + b*x)**(S(3)/S(2))*(c + d*x)**(S(5)/S(6))/d**S(2) + S(3)/S(10)*(a + b*x)**(S(5)/S(2))*(c + d*x)**(S(5)/S(6))/d + S(81)/S(224)*(b*c - a*d)**S(2)*(c + d*x)**(S(5)/S(6))*sqrt(a + b*x)/d**S(3) + S(243)/S(448)*(b*c - a*d)**S(3)*(c + d*x)**(S(1)/S(6))*(S(1) + sqrt(S(3)))*sqrt(a - b*c/d + b*(c + d*x)/d)/(b**(S(2)/S(3))*d**S(3)*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))) + S(243)/S(448)*S(3)**(S(1)/S(4))*(b*c - a*d)**(S(10)/S(3))*(c + d*x)**(S(1)/S(6))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))*sqrt(cos(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))))**S(2))/cos(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))))*EllipticE(sin(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3)))))), sqrt(S(1)/S(4)*(S(2) + sqrt(S(3)))))*sqrt(((b*c - a*d)**(S(2)/S(3)) + b**(S(1)/S(3))*(b*c - a*d)**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + b**(S(2)/S(3))*(c + d*x)**(S(2)/S(3)))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))**S(2))/(b**(S(2)/S(3))*d**S(4)*sqrt(a - b*c/d + b*(c + d*x)/d)*sqrt( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))**S(2))) + S(81)/S(896)*S(3)**(S(3)/S(4))*(b*c - a*d)**(S(10)/S(3))*(c + d*x)**(S(1)/S(6))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))*sqrt(cos(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))))**S(2))/cos(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))))*EllipticF(sin(arccos(((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) - sqrt(S(3))))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3)))))), sqrt(S(1)/S(4)*(S(2) + sqrt(S(3)))))*(S(1) - sqrt(S(3)))*sqrt(((b*c - a*d)**(S(2)/S(3)) + b**(S(1)/S(3))*(b*c - a*d)**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)) + b**(S(2)/S(3))*(c + d*x)**(S(2)/S(3)))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))**S(2))/(b**(S(2)/S(3))*d**S(4)*sqrt(a - b*c/d + b*(c + d*x)/d)*sqrt( - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3)))/((b*c - a*d)**(S(1)/S(3)) - b**(S(1)/S(3))*(c + d*x)**(S(1)/S(3))*(S(1) + sqrt(S(3))))**S(2)))],
        #[(a + b*x)**m*(c + d*x)**n, x, S(2), - (a + b*x)**(S(1) + m)*(c + d*x)**(S(1) + n)*hypergeom([S(1), S(2) + m + n], [S(2) + n], b*(c + d*x)/(b*c - a*d))/((b*c - a*d)*(S(1) + n)), (a + b*x)**(S(1) + m)*(c + d*x)**n*hypergeom([S(1) + m, - n], [S(2) + m], - d*(a + b*x)/(b*c - a*d))/(b*(S(1) + m)*(b*(c + d*x)/(b*c - a*d))**n)],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #17
0
def test_rubi_integrate():
    from sympy.integrals.rubi.rubimain import rubi_integrate

    assert rubi_integrate(x, x) == x**2 / 2
    assert rubi_integrate(x**2, x) == x**3 / 3
    assert rubi_integrate(x**3, x) == x**4 / 4
    assert rubi_integrate(x**a, x) == x**(a + S(1)) / (a + S(1))
    assert rubi_integrate(S(1) / x, x) == log(x)
    assert rubi_integrate(a * x, x) == a * (S(1) / S(2)) * x**S(2)
    assert (rubi_integrate(1 / (x**2 * (a + b * x)**2),
                           x) == -b / (a**2 * (a + b * x)) - 1 / (a**2 * x) -
            2 * b * log(x) / a**3 + 2 * b * log(a + b * x) / a**3)
    assert rubi_integrate(
        x**6 / (a + b * x)**2,
        x) == (-(a**6) / (b**7 * (a + b * x)) -
               S(6) * a**5 * log(a + b * x) / b**7 + 5 * a**4 * x / b**6 -
               S(2) * a**3 * x**2 / b**5 + a**2 * x**3 / b**4 - a * x**4 /
               (S(2) * b**3) + x**5 / (S(5) * b**2))
    assert (rubi_integrate(1 / (x**2 * (a + b * x)**2),
                           x) == -b / (a**2 * (a + b * x)) - 1 / (a**2 * x) -
            2 * b * log(x) / a**3 + 2 * b * log(a + b * x) / a**3)
    assert rubi_integrate(a + S(1) / x, x) == a * x + log(x)
    assert rubi_integrate(
        (a + b * x)**2 / x**3,
        x) == -(a**2) / (2 * x**2) - 2 * a * b / x + b**2 * log(x)
    assert rubi_integrate(a**3 * x, x) == S(1) / S(2) * a**3 * x**2
    assert (rubi_integrate((a + b * x)**3 / x**3, x) == -(a**3) / (2 * x**2) -
            3 * a**2 * b / x + 3 * a * b**2 * log(x) + b**3 * x)
    assert rubi_integrate(x**3 * (a + b * x), x) == a * x**4 / 4 + b * x**5 / 5
    assert rubi_integrate(
        (b * x)**m * (d * x + 2)**n, x) == 2**n * (b * x)**(m + 1) * hyper(
            (-n, m + 1), (m + 2, ), -d * x / 2) / (b * (m + 1))
    assert rubi_test(
        rubi_integrate(1 / (1 + x**5), x),
        x,
        log(x + S(1)) / S(5) + S(2) * Sum(
            -log((S(2) * x - S(2) * cos(pi *
                                        (S(2) * k / S(5) + S(-1) / 5)))**S(2) -
                 S(4) * sin(S(2) * pi * k / S(5) + S(3) * pi / S(10))**S(2) +
                 S(4)) * cos(pi * (S(2) * k / S(5) + S(-1) / 5)) / S(2) -
            (-S(2) * cos(pi * (S(2) * k / S(5) + S(-1) / 5))**S(2) + S(2)) *
            atan((-x / cos(pi * (S(2) * k / S(5) + S(-1) / 5)) + S(1)) /
                 sqrt(-(cos(S(2) * pi * k / S(5) - pi / S(5)) + S(-1)) *
                      (cos(S(2) * pi * k / S(5) - pi / S(5)) + S(1)) /
                      cos(S(2) * pi * k / S(5) - pi / S(5))**S(2))) /
            (S(2) * sqrt(-(cos(S(2) * pi * k / S(5) - pi / S(5)) + S(-1)) *
                         (cos(S(2) * pi * k / S(5) - pi / S(5)) + S(1)) /
                         cos(S(2) * pi * k / S(5) - pi / S(5))**S(2)) *
             cos(pi * (S(2) * k / S(5) + S(-1) / 5))),
            (k, S(1), S(2)),
        ) / S(5),
        _numerical=True,
    )
Exemple #18
0
def test_4():
    test = [
        [x**m/(a + b*x)**S(2), x, S(1), x**(S(1) + m)*hypergeom([S(2), S(1) + m], [S(2) + m], - b*x/a)/(a**S(2)*(S(1) + m))],
        [x**m/sqrt(S(2) + S(3)*x), x, S(1), x**(S(1) + m)*hypergeom([S(1)/S(2), S(1) + m], [S(2) + m], - S(3)/S(2)*x)/((S(1) + m)*sqrt(S(2)))],
        [x**m*(a + b*x)**n, x, S(2), x**(S(1) + m)*(a + b*x)**n*hypergeom([S(1) + m, - n], [S(2) + m], - b*x/a)/((S(1) + m)*(S(1) + b*x/a)**n)],
        [x**( - S(1) + n)/(a + b*x)**n, x, S(2), x**n*(S(1) + b*x/a)**n*hypergeom([n, n], [S(1) + n], - b*x/a)/(n*(a + b*x)**n)],
        [(c + d*(a + b*x))**(S(5)/S(2)), x, S(2), S(2)/S(7)*(c + d*(a + b*x))**(S(7)/S(2))/(b*d)],
        [(c + d*(a + b*x))**(S(3)/S(2)), x, S(2), S(2)/S(5)*(c + d*(a + b*x))**(S(5)/S(2))/(b*d)],
        [(a + b*x)**S(3)/(a*d/b + d*x)**S(3), x, S(2), b**S(3)*x/d**S(3)],
        [(a + b*x)*(a*c - b*c*x)**S(3), x, S(2), - S(1)/S(2)*a*c**S(3)*(a - b*x)**S(4)/b + S(1)/S(5)*c**S(3)*(a - b*x)**S(5)/b],
        [(a*c - b*c*x)**S(3)/(a + b*x), x, S(2), - S(4)*a**S(2)*c**S(3)*x + a*c**S(3)*(a - b*x)**S(2)/b + S(1)/S(3)*c**S(3)*(a - b*x)**S(3)/b + S(8)*a**S(3)*c**S(3)*log(a + b*x)/b],
        [S(1)/((a + b*x)**S(2)*(a*c - b*c*x)), x, S(3), ( - S(1)/S(2))/(a*b*c*(a + b*x)) + S(1)/S(2)*arctanh(b*x/a)/(a**S(2)*b*c)],
        [(S(1) + x)**(S(1)/S(2))/(S(1) - x)**(S(9)/S(2)), x, S(3), S(1)/S(7)*(S(1) + x)**(S(3)/S(2))/(S(1) - x)**(S(7)/S(2)) + S(2)/S(35)*(S(1) + x)**(S(3)/S(2))/(S(1) - x)**(S(5)/S(2)) + S(2)/S(105)*(S(1) + x)**(S(3)/S(2))/(S(1) - x)**(S(3)/S(2))],
        [(S(1) + x)**(S(5)/S(2))/(S(1) - x)**(S(1)/S(2)), x, S(5), S(5)/S(2)*arcsin(x) - S(5)/S(6)*(S(1) + x)**(S(3)/S(2))*sqrt(S(1) - x) - S(1)/S(3)*(S(1) + x)**(S(5)/S(2))*sqrt(S(1) - x) - S(5)/S(2)*sqrt(S(1) - x)*sqrt(S(1) + x)],
    ]
    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #19
0
def test_4():
    test = [
        [x**m/(a + b*x)**S(2), x, S(1), x**(S(1) + m)*hypergeom([S(2), S(1) + m], [S(2) + m], - b*x/a)/(a**S(2)*(S(1) + m))],
        [x**m/sqrt(S(2) + S(3)*x), x, S(1), x**(S(1) + m)*hypergeom([S(1)/S(2), S(1) + m], [S(2) + m], - S(3)/S(2)*x)/((S(1) + m)*sqrt(S(2)))],
        [x**m*(a + b*x)**n, x, S(2), x**(S(1) + m)*(a + b*x)**n*hypergeom([S(1) + m, - n], [S(2) + m], - b*x/a)/((S(1) + m)*(S(1) + b*x/a)**n)],
        [x**( - S(1) + n)/(a + b*x)**n, x, S(2), x**n*(S(1) + b*x/a)**n*hypergeom([n, n], [S(1) + n], - b*x/a)/(n*(a + b*x)**n)],
        [(c + d*(a + b*x))**(S(5)/S(2)), x, S(2), S(2)/S(7)*(c + d*(a + b*x))**(S(7)/S(2))/(b*d)],
        [(c + d*(a + b*x))**(S(3)/S(2)), x, S(2), S(2)/S(5)*(c + d*(a + b*x))**(S(5)/S(2))/(b*d)],
        [(a + b*x)**S(3)/(a*d/b + d*x)**S(3), x, S(2), b**S(3)*x/d**S(3)],
        [(a + b*x)*(a*c - b*c*x)**S(3), x, S(2), - S(1)/S(2)*a*c**S(3)*(a - b*x)**S(4)/b + S(1)/S(5)*c**S(3)*(a - b*x)**S(5)/b],
        [(a*c - b*c*x)**S(3)/(a + b*x), x, S(2), - S(4)*a**S(2)*c**S(3)*x + a*c**S(3)*(a - b*x)**S(2)/b + S(1)/S(3)*c**S(3)*(a - b*x)**S(3)/b + S(8)*a**S(3)*c**S(3)*log(a + b*x)/b],
        [S(1)/((a + b*x)**S(2)*(a*c - b*c*x)), x, S(3), ( - S(1)/S(2))/(a*b*c*(a + b*x)) + S(1)/S(2)*arctanh(b*x/a)/(a**S(2)*b*c)],
        [(S(1) + x)**(S(1)/S(2))/(S(1) - x)**(S(9)/S(2)), x, S(3), S(1)/S(7)*(S(1) + x)**(S(3)/S(2))/(S(1) - x)**(S(7)/S(2)) + S(2)/S(35)*(S(1) + x)**(S(3)/S(2))/(S(1) - x)**(S(5)/S(2)) + S(2)/S(105)*(S(1) + x)**(S(3)/S(2))/(S(1) - x)**(S(3)/S(2))],
        [(S(1) + x)**(S(5)/S(2))/(S(1) - x)**(S(1)/S(2)), x, S(5), S(5)/S(2)*arcsin(x) - S(5)/S(6)*(S(1) + x)**(S(3)/S(2))*sqrt(S(1) - x) - S(1)/S(3)*(S(1) + x)**(S(5)/S(2))*sqrt(S(1) - x) - S(5)/S(2)*sqrt(S(1) - x)*sqrt(S(1) + x)],
    ]
    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #20
0
def test_1():
    '''
    Tests for Rubi Algebraic 1.2 rules. Parsed from Maple syntax
    All tests: http://www.apmaths.uwo.ca/~arich/IntegrationProblems/MapleSyntaxFiles/MapleSyntaxFiles.html
    Note: Some tests are commented since they depend rules other than Algebraic1.2.
    '''
    test = [
        [(a + b*x)**S(2)*(e + f*x)*sqrt(c + d*x)/x, x, S(5), S(2)/S(7)*f*(a + b*x)**S(2)*(c + d*x)**(S(3)/S(2))/d + S(2)/S(105)*(c + d*x)**(S(3)/S(2))*(S(2)*(S(10)*a**S(2)*d**S(2)*f - b**S(2)*c*(S(7)*d*e - S(4)*c*f) + S(7)*a*b*d*(S(5)*d*e - S(2)*c*f)) + S(3)*b*d*(S(7)*b*d*e - S(4)*b*c*f + S(4)*a*d*f)*x)/d**S(3) - S(2)*a**S(2)*e*arctanh(sqrt(c + d*x)/sqrt(c))*sqrt(c) + S(2)*a**S(2)*e*sqrt(c + d*x)],
        [(a + b*x)*(e + f*x)*sqrt(c + d*x)/x, x, S(4), - S(2)/S(15)*(c + d*x)**(S(3)/S(2))*(S(2)*b*c*f - S(5)*d*(b*e + a*f) - S(3)*b*d*f*x)/d**S(2) - S(2)*a*e*arctanh(sqrt(c + d*x)/sqrt(c))*sqrt(c) + S(2)*a*e*sqrt(c + d*x)],
        [(c + d*x)**S(2)*(e + f*x)*sqrt(a + b*x)/x, x, S(5), S(2)/S(7)*f*(a + b*x)**(S(3)/S(2))*(c + d*x)**S(2)/b + S(2)/S(105)*(a + b*x)**(S(3)/S(2))*(S(2)*(S(4)*a**S(2)*d**S(2)*f - S(7)*a*b*d*(d*e + S(2)*c*f) + S(5)*b**S(2)*c*(S(7)*d*e + S(2)*c*f)) + S(3)*b*d*(S(7)*b*d*e + S(4)*b*c*f - S(4)*a*d*f)*x)/b**S(3) - S(2)*c**S(2)*e*arctanh(sqrt(a + b*x)/sqrt(a))*sqrt(a) + S(2)*c**S(2)*e*sqrt(a + b*x)],
        [(c + d*x)*(e + f*x)*sqrt(a + b*x)/x, x, S(4), - S(2)/S(15)*(a + b*x)**(S(3)/S(2))*(S(2)*a*d*f - S(5)*b*(d*e + c*f) - S(3)*b*d*f*x)/b**S(2) - S(2)*c*e*arctanh(sqrt(a + b*x)/sqrt(a))*sqrt(a) + S(2)*c*e*sqrt(a + b*x)],
        [x**S(4)*(e + f*x)**n/((a + b*x)*(c + d*x)), x, S(8), e**S(2)*(e + f*x)**(S(1) + n)/(b*d*f**S(3)*(S(1) + n)) + (b*c + a*d)*e*(e + f*x)**(S(1) + n)/(b**S(2)*d**S(2)*f**S(2)*(S(1) + n)) + (b**S(2)*c**S(2) + a*b*c*d + a**S(2)*d**S(2))*(e + f*x)**(S(1) + n)/(b**S(3)*d**S(3)*f*(S(1) + n)) - S(2)*e*(e + f*x)**(S(2) + n)/(b*d*f**S(3)*(S(2) + n)) - (b*c + a*d)*(e + f*x)**(S(2) + n)/(b**S(2)*d**S(2)*f**S(2)*(S(2) + n)) + (e + f*x)**(S(3) + n)/(b*d*f**S(3)*(S(3) + n)) - a**S(4)*(e + f*x)**(S(1) + n)*hypergeom([S(1), S(1) + n], [S(2) + n], b*(e + f*x)/(b*e - a*f))/(b**S(3)*(b*c - a*d)*(b*e - a*f)*(S(1) + n)) + c**S(4)*(e + f*x)**(S(1) + n)*hypergeom([S(1), S(1) + n], [S(2) + n], d*(e + f*x)/(d*e - c*f))/(d**S(3)*(b*c - a*d)*(d*e - c*f)*(S(1) + n))],
        [(a + b*x)*(c + d*x)*(e + f*x)*(g + h*x), x, S(2), a*c*e*g*x + S(1)/S(2)*(b*c*e*g + a*(d*e*g + c*f*g + c*e*h))*x**S(2) + S(1)/S(3)*(b*(d*e*g + c*f*g + c*e*h) + a*(d*f*g + d*e*h + c*f*h))*x**S(3) + S(1)/S(4)*(a*d*f*h + b*(d*f*g + d*e*h + c*f*h))*x**S(4) + S(1)/S(5)*b*d*f*h*x**S(5)],
        [(a + b*x)*(c + d*x)*(e + f*x)/(g + h*x), x, S(2), (b*(d*g - c*h)*(f*g - e*h) - a*h*(d*f*g - d*e*h - c*f*h))*x/h**S(3) + S(1)/S(2)*(a*d*f*h - b*(d*f*g - d*e*h - c*f*h))*x**S(2)/h**S(2) + S(1)/S(3)*b*d*f*x**S(3)/h - (b*g - a*h)*(d*g - c*h)*(f*g - e*h)*log(g + h*x)/h**S(4)],
        [(a + b*x)**m*(c + d*x)*(e + f*x)*(g + h*x), x, S(2), (b*c - a*d)*(b*e - a*f)*(b*g - a*h)*(a + b*x)**(S(1) + m)/(b**S(4)*(S(1) + m)) + (S(3)*a**S(2)*d*f*h + b**S(2)*(d*e*g + c*f*g + c*e*h) - S(2)*a*b*(d*f*g + d*e*h + c*f*h))*(a + b*x)**(S(2) + m)/(b**S(4)*(S(2) + m)) - (S(3)*a*d*f*h - b*(d*f*g + d*e*h + c*f*h))*(a + b*x)**(S(3) + m)/(b**S(4)*(S(3) + m)) + d*f*h*(a + b*x)**(S(4) + m)/(b**S(4)*(S(4) + m))],
        [(c + d*x)**( - S(4) - m)*(e + f*x)**m*(g + h*x), x, S(3), - (d*g - c*h)*(c + d*x)**( - S(3) - m)*(e + f*x)**(S(1) + m)/(d*(d*e - c*f)*(S(3) + m)) + (c*f*h*(S(1) + m) + d*(S(2)*f*g - e*h*(S(3) + m)))*(c + d*x)**( - S(2) - m)*(e + f*x)**(S(1) + m)/(d*(d*e - c*f)**S(2)*(S(2) + m)*(S(3) + m)) - f*(c*f*h*(S(1) + m) + d*(S(2)*f*g - e*h*(S(3) + m)))*(c + d*x)**( - S(1) - m)*(e + f*x)**(S(1) + m)/(d*(d*e - c*f)**S(3)*(S(1) + m)*(S(2) + m)*(S(3) + m))],
    ]
    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #21
0
def test_1():
    '''
    Tests for Rubi Algebraic 1.2 rules. Parsed from Maple syntax
    All tests: http://www.apmaths.uwo.ca/~arich/IntegrationProblems/MapleSyntaxFiles/MapleSyntaxFiles.html
    Note: Some tests are commented since they depend rules other than Algebraic1.2.
    '''
    test = [
        [(a + b*x)**S(2)*(e + f*x)*sqrt(c + d*x)/x, x, S(5), S(2)/S(7)*f*(a + b*x)**S(2)*(c + d*x)**(S(3)/S(2))/d + S(2)/S(105)*(c + d*x)**(S(3)/S(2))*(S(2)*(S(10)*a**S(2)*d**S(2)*f - b**S(2)*c*(S(7)*d*e - S(4)*c*f) + S(7)*a*b*d*(S(5)*d*e - S(2)*c*f)) + S(3)*b*d*(S(7)*b*d*e - S(4)*b*c*f + S(4)*a*d*f)*x)/d**S(3) - S(2)*a**S(2)*e*arctanh(sqrt(c + d*x)/sqrt(c))*sqrt(c) + S(2)*a**S(2)*e*sqrt(c + d*x)],
        [(a + b*x)*(e + f*x)*sqrt(c + d*x)/x, x, S(4), - S(2)/S(15)*(c + d*x)**(S(3)/S(2))*(S(2)*b*c*f - S(5)*d*(b*e + a*f) - S(3)*b*d*f*x)/d**S(2) - S(2)*a*e*arctanh(sqrt(c + d*x)/sqrt(c))*sqrt(c) + S(2)*a*e*sqrt(c + d*x)],
        [(c + d*x)**S(2)*(e + f*x)*sqrt(a + b*x)/x, x, S(5), S(2)/S(7)*f*(a + b*x)**(S(3)/S(2))*(c + d*x)**S(2)/b + S(2)/S(105)*(a + b*x)**(S(3)/S(2))*(S(2)*(S(4)*a**S(2)*d**S(2)*f - S(7)*a*b*d*(d*e + S(2)*c*f) + S(5)*b**S(2)*c*(S(7)*d*e + S(2)*c*f)) + S(3)*b*d*(S(7)*b*d*e + S(4)*b*c*f - S(4)*a*d*f)*x)/b**S(3) - S(2)*c**S(2)*e*arctanh(sqrt(a + b*x)/sqrt(a))*sqrt(a) + S(2)*c**S(2)*e*sqrt(a + b*x)],
        [(c + d*x)*(e + f*x)*sqrt(a + b*x)/x, x, S(4), - S(2)/S(15)*(a + b*x)**(S(3)/S(2))*(S(2)*a*d*f - S(5)*b*(d*e + c*f) - S(3)*b*d*f*x)/b**S(2) - S(2)*c*e*arctanh(sqrt(a + b*x)/sqrt(a))*sqrt(a) + S(2)*c*e*sqrt(a + b*x)],
        [x**S(4)*(e + f*x)**n/((a + b*x)*(c + d*x)), x, S(8), e**S(2)*(e + f*x)**(S(1) + n)/(b*d*f**S(3)*(S(1) + n)) + (b*c + a*d)*e*(e + f*x)**(S(1) + n)/(b**S(2)*d**S(2)*f**S(2)*(S(1) + n)) + (b**S(2)*c**S(2) + a*b*c*d + a**S(2)*d**S(2))*(e + f*x)**(S(1) + n)/(b**S(3)*d**S(3)*f*(S(1) + n)) - S(2)*e*(e + f*x)**(S(2) + n)/(b*d*f**S(3)*(S(2) + n)) - (b*c + a*d)*(e + f*x)**(S(2) + n)/(b**S(2)*d**S(2)*f**S(2)*(S(2) + n)) + (e + f*x)**(S(3) + n)/(b*d*f**S(3)*(S(3) + n)) - a**S(4)*(e + f*x)**(S(1) + n)*hypergeom([S(1), S(1) + n], [S(2) + n], b*(e + f*x)/(b*e - a*f))/(b**S(3)*(b*c - a*d)*(b*e - a*f)*(S(1) + n)) + c**S(4)*(e + f*x)**(S(1) + n)*hypergeom([S(1), S(1) + n], [S(2) + n], d*(e + f*x)/(d*e - c*f))/(d**S(3)*(b*c - a*d)*(d*e - c*f)*(S(1) + n))],
        [(a + b*x)*(c + d*x)*(e + f*x)*(g + h*x), x, S(2), a*c*e*g*x + S(1)/S(2)*(b*c*e*g + a*(d*e*g + c*f*g + c*e*h))*x**S(2) + S(1)/S(3)*(b*(d*e*g + c*f*g + c*e*h) + a*(d*f*g + d*e*h + c*f*h))*x**S(3) + S(1)/S(4)*(a*d*f*h + b*(d*f*g + d*e*h + c*f*h))*x**S(4) + S(1)/S(5)*b*d*f*h*x**S(5)],
        [(a + b*x)*(c + d*x)*(e + f*x)/(g + h*x), x, S(2), (b*(d*g - c*h)*(f*g - e*h) - a*h*(d*f*g - d*e*h - c*f*h))*x/h**S(3) + S(1)/S(2)*(a*d*f*h - b*(d*f*g - d*e*h - c*f*h))*x**S(2)/h**S(2) + S(1)/S(3)*b*d*f*x**S(3)/h - (b*g - a*h)*(d*g - c*h)*(f*g - e*h)*log(g + h*x)/h**S(4)],
        [(a + b*x)**m*(c + d*x)*(e + f*x)*(g + h*x), x, S(2), (b*c - a*d)*(b*e - a*f)*(b*g - a*h)*(a + b*x)**(S(1) + m)/(b**S(4)*(S(1) + m)) + (S(3)*a**S(2)*d*f*h + b**S(2)*(d*e*g + c*f*g + c*e*h) - S(2)*a*b*(d*f*g + d*e*h + c*f*h))*(a + b*x)**(S(2) + m)/(b**S(4)*(S(2) + m)) - (S(3)*a*d*f*h - b*(d*f*g + d*e*h + c*f*h))*(a + b*x)**(S(3) + m)/(b**S(4)*(S(3) + m)) + d*f*h*(a + b*x)**(S(4) + m)/(b**S(4)*(S(4) + m))],
        [(c + d*x)**( - S(4) - m)*(e + f*x)**m*(g + h*x), x, S(3), - (d*g - c*h)*(c + d*x)**( - S(3) - m)*(e + f*x)**(S(1) + m)/(d*(d*e - c*f)*(S(3) + m)) + (c*f*h*(S(1) + m) + d*(S(2)*f*g - e*h*(S(3) + m)))*(c + d*x)**( - S(2) - m)*(e + f*x)**(S(1) + m)/(d*(d*e - c*f)**S(2)*(S(2) + m)*(S(3) + m)) - f*(c*f*h*(S(1) + m) + d*(S(2)*f*g - e*h*(S(3) + m)))*(c + d*x)**( - S(1) - m)*(e + f*x)**(S(1) + m)/(d*(d*e - c*f)**S(3)*(S(1) + m)*(S(2) + m)*(S(3) + m))],
    ]
    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(r, i[1], i[4], expand=True, _diff=True)
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #22
0
def test_rubi_integrate():
    assert rubi_integrate(x, x) == x**2/2
    assert rubi_integrate(x**a, x) == x**(a + S(1))/(a + S(1))
    assert rubi_integrate(S(1)/x, x) == log(x)
    assert rubi_integrate(a*x, x) == a*(S(1)/S(2))*x**S(2)
    assert rubi_integrate(1/(x**2*(a + b*x)**2), x) == -b/(a**2*(a + b*x)) - 1/(a**2*x) - 2*b*log(x)/a**3 + 2*b*log(a + b*x)/a**3
    assert rubi_integrate(x**6/(a + b*x)**2, x) == (-a**6/(b**7*(a + b*x)) - S(6)*a**5*log(a + b*x)/b**7 + 5*a**4*x/b**6 - S(2)*a**3*x**2/b**5 + a**2*x**3/b**4 - a*x**4/(S(2)*b**3) + x**5/(S(5)*b**2))
    assert rubi_integrate(1/(x**2*(a + b*x)**2), x) == -b/(a**2*(a + b*x)) - 1/(a**2*x) - 2*b*log(x)/a**3 + 2*b*log(a + b*x)/a**3
    assert rubi_integrate(a + S(1)/x, x) == a*x + log(x)
    assert rubi_integrate((a + b*x)**2/x**3, x) == -a**2/(2*x**2) - 2*a*b/x + b**2*log(x)
    assert rubi_integrate(a**3*x, x) == S(1)/S(2)*a**3*x**2
    assert rubi_integrate((a + b*x)**3/x**3, x) == -a**3/(2*x**2) - 3*a**2*b/x + 3*a*b**2*log(x) + b**3*x
    assert rubi_integrate(x**3*(a + b*x), x) == a*x**4/4 + b*x**5/5
    assert rubi_integrate((b*x)**m*(d*x + 2)**n, x) == 2**n*(b*x)**(m + 1)*hyper((-n, m + 1), (m + 2,), -d*x/2)/(b*(m + 1))
    assert rubi_test(rubi_integrate(1/(1 + x**5), x), x, log(x + S(1))/S(5) + S(2)*Sum(-log((S(2)*x - S(2)*cos(pi*(S(2)*k/S(5) + S(-1)/5)))**S(2) - S(4)*sin(S(2)*pi*k/S(5) + S(3)*pi/S(10))**S(2) + S(4))*cos(pi*(S(2)*k/S(5) + S(-1)/5))/S(2) - (-S(2)*cos(pi*(S(2)*k/S(5) + S(-1)/5))**S(2) + S(2))*atan((-x/cos(pi*(S(2)*k/S(5) + S(-1)/5)) + S(1))/sqrt(-(cos(S(2)*pi*k/S(5) - pi/S(5)) + S(-1))*(cos(S(2)*pi*k/S(5) - pi/S(5)) + S(1))/cos(S(2)*pi*k/S(5) - pi/S(5))**S(2)))/(S(2)*sqrt(-(cos(S(2)*pi*k/S(5) - pi/S(5)) + S(-1))*(cos(S(2)*pi*k/S(5) - pi/S(5)) + S(1))/cos(S(2)*pi*k/S(5) - pi/S(5))**S(2))*cos(pi*(S(2)*k/S(5) + S(-1)/5))), (k, S(1), S(2)))/S(5), _numerical=True)
def test_error_functions():

    assert rubi_test(rubi_integrate(x**S(5)*Erf(b*x)**S(2), x), x, x**S(6)*Erf(b*x)**S(2)/S(6) - S(5)*Erf(b*x)**S(2)/(S(16)*b**S(6)) + x**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*Pi*b**S(2)) + S(7)*x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(4)) + S(11)*exp(-S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(6)) + x**S(5)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) + S(5)*x**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*b**S(3)) + S(5)*x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erf(b*x)**S(2), x), x, x**S(5)*Erf(b*x)**S(2)/S(5) + x**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(5)*Pi*b**S(2)) + S(11)*x*exp(-S(2)*b**S(2)*x**S(2))/(S(20)*Pi*b**S(4)) + S(2)*x**S(4)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b) + S(4)*x**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(3)) + S(4)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(5)) - S(43)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(80)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erf(b*x)**S(2), x), x, x**S(4)*Erf(b*x)**S(2)/S(4) - S(3)*Erf(b*x)**S(2)/(S(16)*b**S(4)) + x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*Pi*b**S(2)) + exp(-S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(4)) + x**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b) + S(3)*x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erf(b*x)**S(2), x), x, x**S(3)*Erf(b*x)**S(2)/S(3) + x*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi*b**S(2)) + S(2)*x**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) + S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - S(5)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(12)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erf(b*x)**S(2), x), x, x**S(2)*Erf(b*x)**S(2)/S(2) - Erf(b*x)**S(2)/(S(4)*b**S(2)) + exp(-S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(2)) + x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2), x), x, x*Erf(b*x)**S(2) - sqrt(S(2))*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*b*x)/b + S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x, x), x, Integrate(Erf(b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(2), x), x, Integrate(Erf(b*x)**S(2)/x**S(2), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(3), x), x, -b**S(2)*Erf(b*x)**S(2) - Erf(b*x)**S(2)/(S(2)*x**S(2)) + S(2)*b**S(2)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/Pi - S(2)*b*Erf(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(4), x), x, Integrate(Erf(b*x)**S(2)/x**S(4), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(5), x), x, b**S(4)*Erf(b*x)**S(2)/S(3) - Erf(b*x)**S(2)/(S(4)*x**S(4)) - S(4)*b**S(4)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi) - b**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi*x**S(2)) + S(2)*b**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x) - b*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(6), x), x, Integrate(Erf(b*x)**S(2)/x**S(6), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(7), x), x, -S(4)*b**S(6)*Erf(b*x)**S(2)/S(45) - Erf(b*x)**S(2)/(S(6)*x**S(6)) + S(28)*b**S(6)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(45)*Pi) + S(2)*b**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(9)*Pi*x**S(2)) - b**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(15)*Pi*x**S(4)) - S(8)*b**S(5)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x) + S(4)*b**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x**S(3)) - S(2)*b*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*sqrt(Pi)*x**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(8), x), x, Integrate(Erf(b*x)**S(2)/x**S(8), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erf(a + b*x), x), x, -a**S(4)*Erf(a + b*x)/(S(4)*b**S(4)) - S(3)*a**S(2)*Erf(a + b*x)/(S(4)*b**S(4)) + x**S(4)*Erf(a + b*x)/S(4) - S(3)*Erf(a + b*x)/(S(16)*b**S(4)) - a**S(3)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) + S(3)*a**S(2)*(a + b*x)*exp(-(a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(4)) - a*(a + b*x)**S(2)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - a*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) + (a + b*x)**S(3)*exp(-(a + b*x)**S(2))/(S(4)*sqrt(Pi)*b**S(4)) + (S(3)*a + S(3)*b*x)*exp(-(a + b*x)**S(2))/(S(8)*sqrt(Pi)*b**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erf(a + b*x), x), x, a**S(3)*Erf(a + b*x)/(S(3)*b**S(3)) + a*Erf(a + b*x)/(S(2)*b**S(3)) + x**S(3)*Erf(a + b*x)/S(3) + a**S(2)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - a*(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + (a + b*x)**S(2)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) + exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erf(a + b*x), x), x, -a**S(2)*Erf(a + b*x)/(S(2)*b**S(2)) + x**S(2)*Erf(a + b*x)/S(2) - Erf(a + b*x)/(S(4)*b**S(2)) - a*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) + (a + b*x)*exp(-(a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x), x), x, (a + b*x)*Erf(a + b*x)/b + exp(-(a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x)/x, x), x, Integrate(Erf(a + b*x)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x)/x**S(2), x), x, -Erf(a + b*x)/x + S(2)*b*Integrate(exp(-(a + b*x)**S(2))/x, x)/sqrt(Pi), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erf(a + b*x)**S(2), x), x, a**S(2)*(a + b*x)*Erf(a + b*x)**S(2)/b**S(3) - sqrt(S(2))*a**S(2)*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b**S(3) - a*(a + b*x)**S(2)*Erf(a + b*x)**S(2)/b**S(3) + a*Erf(a + b*x)**S(2)/(S(2)*b**S(3)) + (a + b*x)**S(3)*Erf(a + b*x)**S(2)/(S(3)*b**S(3)) - a*exp(-S(2)*(a + b*x)**S(2))/(Pi*b**S(3)) + (a + b*x)*exp(-S(2)*(a + b*x)**S(2))/(S(3)*Pi*b**S(3)) + S(2)*a**S(2)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - S(2)*a*(a + b*x)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + S(2)*(a + b*x)**S(2)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - S(5)*sqrt(S(2))*Erf(sqrt(S(2))*(a + b*x))/(S(12)*sqrt(Pi)*b**S(3)) + S(2)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erf(a + b*x)**S(2), x), x, -a*(a + b*x)*Erf(a + b*x)**S(2)/b**S(2) + sqrt(S(2))*a*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b**S(2) + (a + b*x)**S(2)*Erf(a + b*x)**S(2)/(S(2)*b**S(2)) - Erf(a + b*x)**S(2)/(S(4)*b**S(2)) + exp(-S(2)*(a + b*x)**S(2))/(S(2)*Pi*b**S(2)) - S(2)*a*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) + (a + b*x)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x)**S(2), x), x, (a + b*x)*Erf(a + b*x)**S(2)/b - sqrt(S(2))*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b + S(2)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x)**S(2)/x, x), x, Integrate(Erf(a + b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x)**S(2)/x**S(2), x), x, Integrate(Erf(a + b*x)**S(2)/x**S(2), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(6)*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, S(15)*sqrt(Pi)*Erf(b*x)**S(2)/(S(32)*b**S(7)) - x**S(5)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(5)*x**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*b**S(4)) - S(15)*x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(8)*b**S(6)) - x**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) - S(7)*x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(5)) - S(11)*exp(-S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(7)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(5)*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, -x**S(4)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - x**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/b**S(4) - Erf(b*x)*exp(-b**S(2)*x**S(2))/b**S(6) + S(43)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(64)*b**S(6)) - x**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) - S(11)*x*exp(-S(2)*b**S(2)*x**S(2))/(S(16)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, S(3)*sqrt(Pi)*Erf(b*x)**S(2)/(S(16)*b**S(5)) - x**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(3)*x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*b**S(4)) - x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) - exp(-S(2)*b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, -x**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(4)) + S(5)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(16)*b**S(4)) - x*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, sqrt(Pi)*Erf(b*x)**S(2)/(S(8)*b**S(3)) - x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, -Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) + sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(4)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, sqrt(Pi)*Erf(b*x)**S(2)/(S(4)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x, x), x, Integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(2), x), x, -sqrt(Pi)*b*Erf(b*x)**S(2)/S(2) - Erf(b*x)*exp(-b**S(2)*x**S(2))/x + b*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/sqrt(Pi), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(3), x), x, -sqrt(S(2))*b**S(2)*Erf(sqrt(S(2))*b*x) - b**S(2)*Integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x, x) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*x**S(2)) - b*exp(-S(2)*b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(4), x), x, sqrt(Pi)*b**S(3)*Erf(b*x)**S(2)/S(3) + S(2)*b**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*x) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*x**S(3)) - S(4)*b**S(3)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)) - b*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(5), x), x, S(7)*sqrt(S(2))*b**S(4)*Erf(sqrt(S(2))*b*x)/S(6) + b**S(4)*Integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x, x)/S(2) + b**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*x**S(2)) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*x**S(4)) + S(7)*b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x) - b*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(6), x), x, -S(2)*sqrt(Pi)*b**S(5)*Erf(b*x)**S(2)/S(15) - S(4)*b**S(4)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*x) + S(2)*b**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*x**S(3)) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*x**S(5)) + S(14)*b**S(5)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(15)*sqrt(Pi)) + b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)) - b*exp(-S(2)*b**S(2)*x**S(2))/(S(10)*sqrt(Pi)*x**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(b**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/x + Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(3), x), x, -sqrt(S(2))*b**S(2)*Erf(sqrt(S(2))*b*x) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*x**S(2)) - b*exp(-S(2)*b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(8), x), x, Integrate(Erfc(b*x)**S(2)/x**S(8), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(7), x), x, -S(4)*b**S(6)*Erfc(b*x)**S(2)/S(45) - Erfc(b*x)**S(2)/(S(6)*x**S(6)) + S(28)*b**S(6)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(45)*Pi) + S(2)*b**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(9)*Pi*x**S(2)) - b**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(15)*Pi*x**S(4)) + S(8)*b**S(5)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x) - S(4)*b**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x**S(3)) + S(2)*b*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*sqrt(Pi)*x**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(6), x), x, Integrate(Erfc(b*x)**S(2)/x**S(6), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(5), x), x, b**S(4)*Erfc(b*x)**S(2)/S(3) - Erfc(b*x)**S(2)/(S(4)*x**S(4)) - S(4)*b**S(4)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi) - b**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi*x**S(2)) - S(2)*b**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x) + b*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(4), x), x, Integrate(Erfc(b*x)**S(2)/x**S(4), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(3), x), x, -b**S(2)*Erfc(b*x)**S(2) - Erfc(b*x)**S(2)/(S(2)*x**S(2)) + S(2)*b**S(2)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/Pi + S(2)*b*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(2), x), x, Integrate(Erfc(b*x)**S(2)/x**S(2), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x, x), x, Integrate(Erfc(b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2), x), x, x*Erfc(b*x)**S(2) - sqrt(S(2))*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*b*x)/b - S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfc(b*x)**S(2), x), x, x**S(2)*Erfc(b*x)**S(2)/S(2) - Erfc(b*x)**S(2)/(S(4)*b**S(2)) + exp(-S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(2)) - x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfc(b*x)**S(2), x), x, x**S(3)*Erfc(b*x)**S(2)/S(3) + x*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi*b**S(2)) - S(2)*x**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) - S(5)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(12)*sqrt(Pi)*b**S(3)) - S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfc(b*x)**S(2), x), x, x**S(4)*Erfc(b*x)**S(2)/S(4) - S(3)*Erfc(b*x)**S(2)/(S(16)*b**S(4)) + x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*Pi*b**S(2)) + exp(-S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(4)) - x**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b) - S(3)*x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erfc(b*x)**S(2), x), x, x**S(5)*Erfc(b*x)**S(2)/S(5) + x**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(5)*Pi*b**S(2)) + S(11)*x*exp(-S(2)*b**S(2)*x**S(2))/(S(20)*Pi*b**S(4)) - S(2)*x**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b) - S(4)*x**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(3)) - S(43)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(80)*sqrt(Pi)*b**S(5)) - S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(5)*Erfc(b*x)**S(2), x), x, x**S(6)*Erfc(b*x)**S(2)/S(6) - S(5)*Erfc(b*x)**S(2)/(S(16)*b**S(6)) + x**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*Pi*b**S(2)) + S(7)*x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(4)) + S(11)*exp(-S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(6)) - x**S(5)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) - S(5)*x**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*b**S(3)) - S(5)*x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(a + b*x)/x, x), x, Integrate(Erfc(a + b*x)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(a + b*x), x), x, (a + b*x)*Erfc(a + b*x)/b - exp(-(a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfc(a + b*x), x), x, a**S(2)*Erf(a + b*x)/(S(2)*b**S(2)) + x**S(2)*Erfc(a + b*x)/S(2) + Erf(a + b*x)/(S(4)*b**S(2)) + a*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) - (a + b*x)*exp(-(a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfc(a + b*x), x), x, -a**S(3)*Erf(a + b*x)/(S(3)*b**S(3)) - a*Erf(a + b*x)/(S(2)*b**S(3)) + x**S(3)*Erfc(a + b*x)/S(3) - a**S(2)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + a*(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - (a + b*x)**S(2)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfc(a + b*x), x), x, a**S(4)*Erf(a + b*x)/(S(4)*b**S(4)) + S(3)*a**S(2)*Erf(a + b*x)/(S(4)*b**S(4)) + x**S(4)*Erfc(a + b*x)/S(4) + S(3)*Erf(a + b*x)/(S(16)*b**S(4)) + a**S(3)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - S(3)*a**S(2)*(a + b*x)*exp(-(a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(4)) + a*(a + b*x)**S(2)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) + a*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - (a + b*x)**S(3)*exp(-(a + b*x)**S(2))/(S(4)*sqrt(Pi)*b**S(4)) - (S(3)*a + S(3)*b*x)*exp(-(a + b*x)**S(2))/(S(8)*sqrt(Pi)*b**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(a + b*x)**S(2)/x, x), x, Integrate(Erfc(a + b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(a + b*x)**S(2), x), x, (a + b*x)*Erfc(a + b*x)**S(2)/b - sqrt(S(2))*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b - S(2)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfc(a + b*x)**S(2), x), x, -a*(a + b*x)*Erfc(a + b*x)**S(2)/b**S(2) + sqrt(S(2))*a*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b**S(2) + (a + b*x)**S(2)*Erfc(a + b*x)**S(2)/(S(2)*b**S(2)) - Erfc(a + b*x)**S(2)/(S(4)*b**S(2)) + exp(-S(2)*(a + b*x)**S(2))/(S(2)*Pi*b**S(2)) + S(2)*a*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) - (a + b*x)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfc(a + b*x)**S(2), x), x, a**S(2)*(a + b*x)*Erfc(a + b*x)**S(2)/b**S(3) - sqrt(S(2))*a**S(2)*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b**S(3) - a*(a + b*x)**S(2)*Erfc(a + b*x)**S(2)/b**S(3) + a*Erfc(a + b*x)**S(2)/(S(2)*b**S(3)) + (a + b*x)**S(3)*Erfc(a + b*x)**S(2)/(S(3)*b**S(3)) - a*exp(-S(2)*(a + b*x)**S(2))/(Pi*b**S(3)) + (a + b*x)*exp(-S(2)*(a + b*x)**S(2))/(S(3)*Pi*b**S(3)) - S(2)*a**S(2)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + S(2)*a*(a + b*x)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - S(2)*(a + b*x)**S(2)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - S(5)*sqrt(S(2))*Erf(sqrt(S(2))*(a + b*x))/(S(12)*sqrt(Pi)*b**S(3)) - S(2)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(8), x), x, -S(4)*sqrt(Pi)*b**S(7)*Erfc(b*x)**S(2)/S(105) + S(8)*b**S(6)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(105)*x) - S(4)*b**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(105)*x**S(3)) + S(2)*b**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(35)*x**S(5)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(7)*x**S(7)) + S(16)*b**S(7)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(35)*sqrt(Pi)) + S(4)*b**S(5)*exp(-S(2)*b**S(2)*x**S(2))/(S(21)*sqrt(Pi)*x**S(2)) - S(8)*b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(105)*sqrt(Pi)*x**S(4)) + b*exp(-S(2)*b**S(2)*x**S(2))/(S(21)*sqrt(Pi)*x**S(6)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(7), x), x, S(67)*sqrt(S(2))*b**S(6)*Erf(sqrt(S(2))*b*x)/S(90) - b**S(6)*Integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x, x)/S(6) - b**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(12)*x**S(2)) + b**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(12)*x**S(4)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(6)*x**S(6)) + S(67)*b**S(5)*exp(-S(2)*b**S(2)*x**S(2))/(S(90)*sqrt(Pi)*x) - S(13)*b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(90)*sqrt(Pi)*x**S(3)) + b*exp(-S(2)*b**S(2)*x**S(2))/(S(15)*sqrt(Pi)*x**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(6), x), x, S(2)*sqrt(Pi)*b**S(5)*Erfc(b*x)**S(2)/S(15) - S(4)*b**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*x) + S(2)*b**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*x**S(3)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*x**S(5)) - S(14)*b**S(5)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(15)*sqrt(Pi)) - b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)) + b*exp(-S(2)*b**S(2)*x**S(2))/(S(10)*sqrt(Pi)*x**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(5), x), x, -S(7)*sqrt(S(2))*b**S(4)*Erf(sqrt(S(2))*b*x)/S(6) + b**S(4)*Integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x, x)/S(2) + b**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*x**S(2)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*x**S(4)) - S(7)*b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x) + b*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(4), x), x, -sqrt(Pi)*b**S(3)*Erfc(b*x)**S(2)/S(3) + S(2)*b**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*x) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*x**S(3)) + S(4)*b**S(3)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)) + b*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(3), x), x, sqrt(S(2))*b**S(2)*Erf(sqrt(S(2))*b*x) - b**S(2)*Integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x, x) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*x**S(2)) + b*exp(-S(2)*b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(2), x), x, sqrt(Pi)*b*Erfc(b*x)**S(2)/S(2) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/x - b*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/sqrt(Pi), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x, x), x, Integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -sqrt(Pi)*Erfc(b*x)**S(2)/(S(4)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(4)*b**S(2)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -sqrt(Pi)*Erfc(b*x)**S(2)/(S(8)*b**S(3)) - x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) + exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -x**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(5)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(16)*b**S(4)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(4)) + x*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -S(3)*sqrt(Pi)*Erfc(b*x)**S(2)/(S(16)*b**S(5)) - x**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(3)*x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*b**S(4)) + x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + exp(-S(2)*b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(5)*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -x**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - x**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/b**S(4) - S(43)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(64)*b**S(6)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/b**S(6) + x**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + S(11)*x*exp(-S(2)*b**S(2)*x**S(2))/(S(16)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(6)*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -S(15)*sqrt(Pi)*Erfc(b*x)**S(2)/(S(32)*b**S(7)) - x**S(5)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(5)*x**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*b**S(4)) - S(15)*x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(8)*b**S(6)) + x**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + S(7)*x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(5)) + S(11)*exp(-S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(7)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(8), x), x, Integrate(Erfi(b*x)**S(2)/x**S(8), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(7), x), x, S(4)*b**S(6)*Erfi(b*x)**S(2)/S(45) - Erfi(b*x)**S(2)/(S(6)*x**S(6)) + S(28)*b**S(6)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/(S(45)*Pi) - S(2)*b**S(4)*exp(S(2)*b**S(2)*x**S(2))/(S(9)*Pi*x**S(2)) - b**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(15)*Pi*x**S(4)) - S(8)*b**S(5)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x) - S(4)*b**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x**S(3)) - S(2)*b*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(15)*sqrt(Pi)*x**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(6), x), x, Integrate(Erfi(b*x)**S(2)/x**S(6), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(5), x), x, b**S(4)*Erfi(b*x)**S(2)/S(3) - Erfi(b*x)**S(2)/(S(4)*x**S(4)) + S(4)*b**S(4)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/(S(3)*Pi) - b**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(3)*Pi*x**S(2)) - S(2)*b**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x) - b*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(4), x), x, Integrate(Erfi(b*x)**S(2)/x**S(4), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(3), x), x, b**S(2)*Erfi(b*x)**S(2) - Erfi(b*x)**S(2)/(S(2)*x**S(2)) + S(2)*b**S(2)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/Pi - S(2)*b*Erfi(b*x)*exp(b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(2), x), x, Integrate(Erfi(b*x)**S(2)/x**S(2), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x, x), x, Integrate(Erfi(b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2), x), x, x*Erfi(b*x)**S(2) + sqrt(S(2))*sqrt(S(1)/Pi)*Erfi(sqrt(S(2))*b*x)/b - S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfi(b*x)**S(2), x), x, x**S(2)*Erfi(b*x)**S(2)/S(2) + Erfi(b*x)**S(2)/(S(4)*b**S(2)) + exp(S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(2)) - x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfi(b*x)**S(2), x), x, x**S(3)*Erfi(b*x)**S(2)/S(3) + x*exp(S(2)*b**S(2)*x**S(2))/(S(3)*Pi*b**S(2)) - S(2)*x**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) + S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - S(5)*sqrt(S(2))*Erfi(sqrt(S(2))*b*x)/(S(12)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfi(b*x)**S(2), x), x, x**S(4)*Erfi(b*x)**S(2)/S(4) - S(3)*Erfi(b*x)**S(2)/(S(16)*b**S(4)) + x**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(4)*Pi*b**S(2)) - exp(S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(4)) - x**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b) + S(3)*x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erfi(b*x)**S(2), x), x, x**S(5)*Erfi(b*x)**S(2)/S(5) + x**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(5)*Pi*b**S(2)) - S(11)*x*exp(S(2)*b**S(2)*x**S(2))/(S(20)*Pi*b**S(4)) - S(2)*x**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b) + S(4)*x**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(3)) - S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(5)) + S(43)*sqrt(S(2))*Erfi(sqrt(S(2))*b*x)/(S(80)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(5)*Erfi(b*x)**S(2), x), x, x**S(6)*Erfi(b*x)**S(2)/S(6) + S(5)*Erfi(b*x)**S(2)/(S(16)*b**S(6)) + x**S(4)*exp(S(2)*b**S(2)*x**S(2))/(S(6)*Pi*b**S(2)) - S(7)*x**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(4)) + S(11)*exp(S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(6)) - x**S(5)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) + S(5)*x**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*b**S(3)) - S(5)*x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(a + b*x)/x, x), x, Integrate(Erfi(a + b*x)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(a + b*x), x), x, (a + b*x)*Erfi(a + b*x)/b - exp((a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfi(a + b*x), x), x, -a**S(2)*Erfi(a + b*x)/(S(2)*b**S(2)) + x**S(2)*Erfi(a + b*x)/S(2) + Erfi(a + b*x)/(S(4)*b**S(2)) + a*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) - (a + b*x)*exp((a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfi(a + b*x), x), x, a**S(3)*Erfi(a + b*x)/(S(3)*b**S(3)) - a*Erfi(a + b*x)/(S(2)*b**S(3)) + x**S(3)*Erfi(a + b*x)/S(3) - a**S(2)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + a*(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - (a + b*x)**S(2)*exp((a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) + exp((a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfi(a + b*x), x), x, -a**S(4)*Erfi(a + b*x)/(S(4)*b**S(4)) + S(3)*a**S(2)*Erfi(a + b*x)/(S(4)*b**S(4)) + x**S(4)*Erfi(a + b*x)/S(4) - S(3)*Erfi(a + b*x)/(S(16)*b**S(4)) + a**S(3)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - S(3)*a**S(2)*(a + b*x)*exp((a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(4)) + a*(a + b*x)**S(2)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - a*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - (a + b*x)**S(3)*exp((a + b*x)**S(2))/(S(4)*sqrt(Pi)*b**S(4)) + S(3)*(a + b*x)*exp((a + b*x)**S(2))/(S(8)*sqrt(Pi)*b**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(a + b*x)**S(2)/x, x), x, Integrate(Erfi(a + b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(a + b*x)**S(2), x), x, (a + b*x)*Erfi(a + b*x)**S(2)/b + sqrt(S(2))*sqrt(S(1)/Pi)*Erfi(sqrt(S(2))*(a + b*x))/b - S(2)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfi(a + b*x)**S(2), x), x, -a*(a + b*x)*Erfi(a + b*x)**S(2)/b**S(2) - sqrt(S(2))*a*sqrt(S(1)/Pi)*Erfi(sqrt(S(2))*(a + b*x))/b**S(2) + (a + b*x)**S(2)*Erfi(a + b*x)**S(2)/(S(2)*b**S(2)) + Erfi(a + b*x)**S(2)/(S(4)*b**S(2)) + exp(S(2)*(a + b*x)**S(2))/(S(2)*Pi*b**S(2)) + S(2)*a*Erfi(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) - (a + b*x)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfi(a + b*x)**S(2), x), x, a**S(2)*(a + b*x)*Erfi(a + b*x)**S(2)/b**S(3) + sqrt(S(2))*a**S(2)*sqrt(S(1)/Pi)*Erfi(sqrt(S(2))*(a + b*x))/b**S(3) - a*(a + b*x)**S(2)*Erfi(a + b*x)**S(2)/b**S(3) - a*Erfi(a + b*x)**S(2)/(S(2)*b**S(3)) + (a + b*x)**S(3)*Erfi(a + b*x)**S(2)/(S(3)*b**S(3)) - a*exp(S(2)*(a + b*x)**S(2))/(Pi*b**S(3)) + (a + b*x)*exp(S(2)*(a + b*x)**S(2))/(S(3)*Pi*b**S(3)) - S(2)*a**S(2)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + S(2)*a*(a + b*x)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - S(2)*(a + b*x)**S(2)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - S(5)*sqrt(S(2))*Erfi(sqrt(S(2))*(a + b*x))/(S(12)*sqrt(Pi)*b**S(3)) + S(2)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(8), x), x, S(4)*sqrt(Pi)*b**S(7)*Erfi(b*x)**S(2)/S(105) - S(8)*b**S(6)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(105)*x) - S(4)*b**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(105)*x**S(3)) - S(2)*b**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(35)*x**S(5)) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(7)*x**S(7)) + S(16)*b**S(7)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/(S(35)*sqrt(Pi)) - S(4)*b**S(5)*exp(S(2)*b**S(2)*x**S(2))/(S(21)*sqrt(Pi)*x**S(2)) - S(8)*b**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(105)*sqrt(Pi)*x**S(4)) - b*exp(S(2)*b**S(2)*x**S(2))/(S(21)*sqrt(Pi)*x**S(6)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(7), x), x, S(67)*sqrt(S(2))*b**S(6)*Erfi(sqrt(S(2))*b*x)/S(90) + b**S(6)*Integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x, x)/S(6) - b**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(12)*x**S(2)) - b**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(12)*x**S(4)) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(6)*x**S(6)) - S(67)*b**S(5)*exp(S(2)*b**S(2)*x**S(2))/(S(90)*sqrt(Pi)*x) - S(13)*b**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(90)*sqrt(Pi)*x**S(3)) - b*exp(S(2)*b**S(2)*x**S(2))/(S(15)*sqrt(Pi)*x**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(6), x), x, S(2)*sqrt(Pi)*b**S(5)*Erfi(b*x)**S(2)/S(15) - S(4)*b**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(15)*x) - S(2)*b**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(15)*x**S(3)) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(5)*x**S(5)) + S(14)*b**S(5)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/(S(15)*sqrt(Pi)) - b**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)) - b*exp(S(2)*b**S(2)*x**S(2))/(S(10)*sqrt(Pi)*x**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(5), x), x, S(7)*sqrt(S(2))*b**S(4)*Erfi(sqrt(S(2))*b*x)/S(6) + b**S(4)*Integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x, x)/S(2) - b**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*x**S(2)) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*x**S(4)) - S(7)*b**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x) - b*exp(S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(4), x), x, sqrt(Pi)*b**S(3)*Erfi(b*x)**S(2)/S(3) - S(2)*b**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*x) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*x**S(3)) + S(4)*b**S(3)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)) - b*exp(S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(3), x), x, sqrt(S(2))*b**S(2)*Erfi(sqrt(S(2))*b*x) + b**S(2)*Integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x, x) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*x**S(2)) - b*exp(S(2)*b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(2), x), x, sqrt(Pi)*b*Erfi(b*x)**S(2)/S(2) - Erfi(b*x)*exp(b**S(2)*x**S(2))/x + b*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/sqrt(Pi), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x, x), x, Integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, sqrt(Pi)*Erfi(b*x)**S(2)/(S(4)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - sqrt(S(2))*Erfi(sqrt(S(2))*b*x)/(S(4)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, -sqrt(Pi)*Erfi(b*x)**S(2)/(S(8)*b**S(3)) + x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - exp(S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, x**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(4)) + S(5)*sqrt(S(2))*Erfi(sqrt(S(2))*b*x)/(S(16)*b**S(4)) - x*exp(S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, S(3)*sqrt(Pi)*Erfi(b*x)**S(2)/(S(16)*b**S(5)) + x**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(3)*x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*b**S(4)) - x**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + exp(S(2)*b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(5)*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, x**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - x**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/b**S(4) + Erfi(b*x)*exp(b**S(2)*x**S(2))/b**S(6) - S(43)*sqrt(S(2))*Erfi(sqrt(S(2))*b*x)/(S(64)*b**S(6)) - x**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + S(11)*x*exp(S(2)*b**S(2)*x**S(2))/(S(16)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(6)*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, -S(15)*sqrt(Pi)*Erfi(b*x)**S(2)/(S(32)*b**S(7)) + x**S(5)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(5)*x**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*b**S(4)) + S(15)*x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(8)*b**S(6)) - x**S(4)*exp(S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + S(7)*x**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(5)) - S(11)*exp(S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(7)), expand=True, _diff=True, _numerical=True)
Exemple #24
0
def test_5():
    test = [
        [
            (S(1) + a * x) ** (S(3) / S(2)) / sqrt(S(1) - a * x),
            x,
            S(4),
            S(3) / S(2) * arcsin(a * x) / a
            - S(1) / S(2) * (S(1) + a * x) ** (S(3) / S(2)) * sqrt(S(1) - a * x) / a
            - S(3) / S(2) * sqrt(S(1) - a * x) * sqrt(S(1) + a * x) / a,
        ],
        [
            (S(1) - x) ** (S(1) / S(2)) / (S(1) + x) ** (S(1) / S(2)),
            x,
            S(3),
            arcsin(x) + sqrt(S(1) - x) * sqrt(S(1) + x),
        ],
        [
            S(1) / ((S(1) - x) ** (S(1) / S(2)) * (S(1) + x) ** (S(3) / S(2))),
            x,
            S(1),
            -sqrt(S(1) - x) / sqrt(S(1) + x),
        ],
        [
            (a + a * x) ** (S(5) / S(2)) * (c - c * x) ** (S(5) / S(2)),
            x,
            S(5),
            S(5)
            / S(24)
            * a
            * c
            * x
            * (a + a * x) ** (S(3) / S(2))
            * (c - c * x) ** (S(3) / S(2))
            + S(1)
            / S(6)
            * x
            * (a + a * x) ** (S(5) / S(2))
            * (c - c * x) ** (S(5) / S(2))
            + S(5)
            / S(8)
            * a ** (S(5) / S(2))
            * c ** (S(5) / S(2))
            * arctan(sqrt(c) * sqrt(a + a * x) / (sqrt(a) * sqrt(c - c * x)))
            + S(5)
            / S(16)
            * a ** S(2)
            * c ** S(2)
            * x
            * sqrt(a + a * x)
            * sqrt(c - c * x),
        ],
        [
            S(1) / ((a + a * x) ** (S(5) / S(2)) * (c - c * x) ** (S(5) / S(2))),
            x,
            S(2),
            S(1)
            / S(3)
            * x
            / (a * c * (a + a * x) ** (S(3) / S(2)) * (c - c * x) ** (S(3) / S(2)))
            + S(2)
            / S(3)
            * x
            / (a ** S(2) * c ** S(2) * sqrt(a + a * x) * sqrt(c - c * x)),
        ],
        [
            (S(3) - x) ** (S(1) / S(2)) * (-S(2) + x) ** (S(1) / S(2)),
            x,
            S(5),
            -S(1) / S(8) * arcsin(S(5) - S(2) * x)
            - S(1) / S(2) * (S(3) - x) ** (S(3) / S(2)) * sqrt(-S(2) + x)
            + S(1) / S(4) * sqrt(S(3) - x) * sqrt(-S(2) + x),
        ],
        [
            S(1) / (sqrt(a + b * x) * sqrt(-a * d + b * d * x)),
            x,
            S(2),
            S(2)
            * arctanh(sqrt(d) * sqrt(a + b * x) / sqrt(-a * d + b * d * x))
            / (b * sqrt(d)),
        ],
        [
            S(1)
            / ((a - I * a * x) ** (S(7) / S(4)) * (a + I * a * x) ** (S(1) / S(4))),
            x,
            S(1),
            -S(2)
            / S(3)
            * I
            * (a + I * a * x) ** (S(3) / S(4))
            / (a ** S(2) * (a - I * a * x) ** (S(3) / S(4))),
        ],
        [
            (a + b * x) ** S(2) * (a * c - b * c * x) ** n,
            x,
            S(2),
            -S(4) * a ** S(2) * (a * c - b * c * x) ** (S(1) + n) / (b * c * (S(1) + n))
            + S(4)
            * a
            * (a * c - b * c * x) ** (S(2) + n)
            / (b * c ** S(2) * (S(2) + n))
            - (a * c - b * c * x) ** (S(3) + n) / (b * c ** S(3) * (S(3) + n)),
        ],
        [
            (a + b * x) ** S(4) * (c + d * x),
            x,
            S(2),
            S(1) / S(5) * (b * c - a * d) * (a + b * x) ** S(5) / b ** S(2)
            + S(1) / S(6) * d * (a + b * x) ** S(6) / b ** S(2),
        ],
        [
            (a + b * x) * (c + d * x),
            x,
            S(2),
            a * c * x
            + S(1) / S(2) * (b * c + a * d) * x ** S(2)
            + S(1) / S(3) * b * d * x ** S(3),
        ],
        [
            (a + b * x) ** S(5) / (c + d * x),
            x,
            S(2),
            b * (b * c - a * d) ** S(4) * x / d ** S(5)
            - S(1) / S(2) * (b * c - a * d) ** S(3) * (a + b * x) ** S(2) / d ** S(4)
            + S(1) / S(3) * (b * c - a * d) ** S(2) * (a + b * x) ** S(3) / d ** S(3)
            - S(1) / S(4) * (b * c - a * d) * (a + b * x) ** S(4) / d ** S(2)
            + S(1) / S(5) * (a + b * x) ** S(5) / d
            - (b * c - a * d) ** S(5) * log(c + d * x) / d ** S(6),
        ],
        [
            (a + b * x) / (c + d * x) ** S(3),
            x,
            S(1),
            S(1) / S(2) * (a + b * x) ** S(2) / ((b * c - a * d) * (c + d * x) ** S(2)),
        ],
        [
            (a + b * x) ** S(5) * (c + d * x) ** (S(1) / S(2)),
            x,
            S(2),
            -S(2)
            / S(3)
            * (b * c - a * d) ** S(5)
            * (c + d * x) ** (S(3) / S(2))
            / d ** S(6)
            + S(2)
            * b
            * (b * c - a * d) ** S(4)
            * (c + d * x) ** (S(5) / S(2))
            / d ** S(6)
            - S(20)
            / S(7)
            * b ** S(2)
            * (b * c - a * d) ** S(3)
            * (c + d * x) ** (S(7) / S(2))
            / d ** S(6)
            + S(20)
            / S(9)
            * b ** S(3)
            * (b * c - a * d) ** S(2)
            * (c + d * x) ** (S(9) / S(2))
            / d ** S(6)
            - S(10)
            / S(11)
            * b ** S(4)
            * (b * c - a * d)
            * (c + d * x) ** (S(11) / S(2))
            / d ** S(6)
            + S(2) / S(13) * b ** S(5) * (c + d * x) ** (S(13) / S(2)) / d ** S(6),
        ],
        [
            (c + d * x) ** (S(1) / S(2)) / (a + b * x) ** S(2),
            x,
            S(3),
            -d
            * arctanh(sqrt(b) * sqrt(c + d * x) / sqrt(b * c - a * d))
            / (b ** (S(3) / S(2)) * sqrt(b * c - a * d))
            - sqrt(c + d * x) / (b * (a + b * x)),
        ],
    ]

    for i in test:
        r = rubi_integrate(i[0], i[1])
        if len(i) == 5:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True) or rubi_test(
                r, i[1], i[4], expand=True, _diff=True
            )
        else:
            assert rubi_test(r, i[1], i[3], expand=True, _diff=True)
Exemple #25
0
def test_error_functions():

    assert rubi_test(rubi_integrate(x**S(5)*Erf(b*x)**S(2), x), x, x**S(6)*Erf(b*x)**S(2)/S(6) - S(5)*Erf(b*x)**S(2)/(S(16)*b**S(6)) + x**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*Pi*b**S(2)) + S(7)*x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(4)) + S(11)*exp(-S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(6)) + x**S(5)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) + S(5)*x**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*b**S(3)) + S(5)*x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erf(b*x)**S(2), x), x, x**S(5)*Erf(b*x)**S(2)/S(5) + x**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(5)*Pi*b**S(2)) + S(11)*x*exp(-S(2)*b**S(2)*x**S(2))/(S(20)*Pi*b**S(4)) + S(2)*x**S(4)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b) + S(4)*x**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(3)) + S(4)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(5)) - S(43)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(80)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erf(b*x)**S(2), x), x, x**S(4)*Erf(b*x)**S(2)/S(4) - S(3)*Erf(b*x)**S(2)/(S(16)*b**S(4)) + x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*Pi*b**S(2)) + exp(-S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(4)) + x**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b) + S(3)*x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erf(b*x)**S(2), x), x, x**S(3)*Erf(b*x)**S(2)/S(3) + x*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi*b**S(2)) + S(2)*x**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) + S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - S(5)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(12)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erf(b*x)**S(2), x), x, x**S(2)*Erf(b*x)**S(2)/S(2) - Erf(b*x)**S(2)/(S(4)*b**S(2)) + exp(-S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(2)) + x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2), x), x, x*Erf(b*x)**S(2) - sqrt(S(2))*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*b*x)/b + S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x, x), x, Integrate(Erf(b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(2), x), x, Integrate(Erf(b*x)**S(2)/x**S(2), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(3), x), x, -b**S(2)*Erf(b*x)**S(2) - Erf(b*x)**S(2)/(S(2)*x**S(2)) + S(2)*b**S(2)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/Pi - S(2)*b*Erf(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(4), x), x, Integrate(Erf(b*x)**S(2)/x**S(4), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(5), x), x, b**S(4)*Erf(b*x)**S(2)/S(3) - Erf(b*x)**S(2)/(S(4)*x**S(4)) - S(4)*b**S(4)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi) - b**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi*x**S(2)) + S(2)*b**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x) - b*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(6), x), x, Integrate(Erf(b*x)**S(2)/x**S(6), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(7), x), x, -S(4)*b**S(6)*Erf(b*x)**S(2)/S(45) - Erf(b*x)**S(2)/(S(6)*x**S(6)) + S(28)*b**S(6)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(45)*Pi) + S(2)*b**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(9)*Pi*x**S(2)) - b**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(15)*Pi*x**S(4)) - S(8)*b**S(5)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x) + S(4)*b**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x**S(3)) - S(2)*b*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*sqrt(Pi)*x**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)**S(2)/x**S(8), x), x, Integrate(Erf(b*x)**S(2)/x**S(8), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erf(a + b*x), x), x, -a**S(4)*Erf(a + b*x)/(S(4)*b**S(4)) - S(3)*a**S(2)*Erf(a + b*x)/(S(4)*b**S(4)) + x**S(4)*Erf(a + b*x)/S(4) - S(3)*Erf(a + b*x)/(S(16)*b**S(4)) - a**S(3)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) + S(3)*a**S(2)*(a + b*x)*exp(-(a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(4)) - a*(a + b*x)**S(2)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - a*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) + (a + b*x)**S(3)*exp(-(a + b*x)**S(2))/(S(4)*sqrt(Pi)*b**S(4)) + (S(3)*a + S(3)*b*x)*exp(-(a + b*x)**S(2))/(S(8)*sqrt(Pi)*b**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erf(a + b*x), x), x, a**S(3)*Erf(a + b*x)/(S(3)*b**S(3)) + a*Erf(a + b*x)/(S(2)*b**S(3)) + x**S(3)*Erf(a + b*x)/S(3) + a**S(2)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - a*(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + (a + b*x)**S(2)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) + exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erf(a + b*x), x), x, -a**S(2)*Erf(a + b*x)/(S(2)*b**S(2)) + x**S(2)*Erf(a + b*x)/S(2) - Erf(a + b*x)/(S(4)*b**S(2)) - a*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) + (a + b*x)*exp(-(a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x), x), x, (a + b*x)*Erf(a + b*x)/b + exp(-(a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x)/x, x), x, Integrate(Erf(a + b*x)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x)/x**S(2), x), x, -Erf(a + b*x)/x + S(2)*b*Integrate(exp(-(a + b*x)**S(2))/x, x)/sqrt(Pi), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erf(a + b*x)**S(2), x), x, a**S(2)*(a + b*x)*Erf(a + b*x)**S(2)/b**S(3) - sqrt(S(2))*a**S(2)*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b**S(3) - a*(a + b*x)**S(2)*Erf(a + b*x)**S(2)/b**S(3) + a*Erf(a + b*x)**S(2)/(S(2)*b**S(3)) + (a + b*x)**S(3)*Erf(a + b*x)**S(2)/(S(3)*b**S(3)) - a*exp(-S(2)*(a + b*x)**S(2))/(Pi*b**S(3)) + (a + b*x)*exp(-S(2)*(a + b*x)**S(2))/(S(3)*Pi*b**S(3)) + S(2)*a**S(2)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - S(2)*a*(a + b*x)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + S(2)*(a + b*x)**S(2)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - S(5)*sqrt(S(2))*Erf(sqrt(S(2))*(a + b*x))/(S(12)*sqrt(Pi)*b**S(3)) + S(2)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erf(a + b*x)**S(2), x), x, -a*(a + b*x)*Erf(a + b*x)**S(2)/b**S(2) + sqrt(S(2))*a*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b**S(2) + (a + b*x)**S(2)*Erf(a + b*x)**S(2)/(S(2)*b**S(2)) - Erf(a + b*x)**S(2)/(S(4)*b**S(2)) + exp(-S(2)*(a + b*x)**S(2))/(S(2)*Pi*b**S(2)) - S(2)*a*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) + (a + b*x)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x)**S(2), x), x, (a + b*x)*Erf(a + b*x)**S(2)/b - sqrt(S(2))*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b + S(2)*Erf(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x)**S(2)/x, x), x, Integrate(Erf(a + b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(a + b*x)**S(2)/x**S(2), x), x, Integrate(Erf(a + b*x)**S(2)/x**S(2), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(6)*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, S(15)*sqrt(Pi)*Erf(b*x)**S(2)/(S(32)*b**S(7)) - x**S(5)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(5)*x**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*b**S(4)) - S(15)*x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(8)*b**S(6)) - x**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) - S(7)*x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(5)) - S(11)*exp(-S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(7)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(5)*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, -x**S(4)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - x**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/b**S(4) - Erf(b*x)*exp(-b**S(2)*x**S(2))/b**S(6) + S(43)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(64)*b**S(6)) - x**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) - S(11)*x*exp(-S(2)*b**S(2)*x**S(2))/(S(16)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, S(3)*sqrt(Pi)*Erf(b*x)**S(2)/(S(16)*b**S(5)) - x**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(3)*x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*b**S(4)) - x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) - exp(-S(2)*b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, -x**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(4)) + S(5)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(16)*b**S(4)) - x*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, sqrt(Pi)*Erf(b*x)**S(2)/(S(8)*b**S(3)) - x*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, -Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) + sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(4)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2)), x), x, sqrt(Pi)*Erf(b*x)**S(2)/(S(4)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x, x), x, Integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(2), x), x, -sqrt(Pi)*b*Erf(b*x)**S(2)/S(2) - Erf(b*x)*exp(-b**S(2)*x**S(2))/x + b*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/sqrt(Pi), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(3), x), x, -sqrt(S(2))*b**S(2)*Erf(sqrt(S(2))*b*x) - b**S(2)*Integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x, x) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*x**S(2)) - b*exp(-S(2)*b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(4), x), x, sqrt(Pi)*b**S(3)*Erf(b*x)**S(2)/S(3) + S(2)*b**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*x) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*x**S(3)) - S(4)*b**S(3)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)) - b*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(5), x), x, S(7)*sqrt(S(2))*b**S(4)*Erf(sqrt(S(2))*b*x)/S(6) + b**S(4)*Integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x, x)/S(2) + b**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*x**S(2)) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*x**S(4)) + S(7)*b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x) - b*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(6), x), x, -S(2)*sqrt(Pi)*b**S(5)*Erf(b*x)**S(2)/S(15) - S(4)*b**S(4)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*x) + S(2)*b**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*x**S(3)) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*x**S(5)) + S(14)*b**S(5)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(15)*sqrt(Pi)) + b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)) - b*exp(-S(2)*b**S(2)*x**S(2))/(S(10)*sqrt(Pi)*x**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(b**S(2)*Erf(b*x)*exp(-b**S(2)*x**S(2))/x + Erf(b*x)*exp(-b**S(2)*x**S(2))/x**S(3), x), x, -sqrt(S(2))*b**S(2)*Erf(sqrt(S(2))*b*x) - Erf(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*x**S(2)) - b*exp(-S(2)*b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(8), x), x, Integrate(Erfc(b*x)**S(2)/x**S(8), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(7), x), x, -S(4)*b**S(6)*Erfc(b*x)**S(2)/S(45) - Erfc(b*x)**S(2)/(S(6)*x**S(6)) + S(28)*b**S(6)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(45)*Pi) + S(2)*b**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(9)*Pi*x**S(2)) - b**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(15)*Pi*x**S(4)) + S(8)*b**S(5)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x) - S(4)*b**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x**S(3)) + S(2)*b*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*sqrt(Pi)*x**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(6), x), x, Integrate(Erfc(b*x)**S(2)/x**S(6), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(5), x), x, b**S(4)*Erfc(b*x)**S(2)/S(3) - Erfc(b*x)**S(2)/(S(4)*x**S(4)) - S(4)*b**S(4)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi) - b**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi*x**S(2)) - S(2)*b**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x) + b*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(4), x), x, Integrate(Erfc(b*x)**S(2)/x**S(4), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(3), x), x, -b**S(2)*Erfc(b*x)**S(2) - Erfc(b*x)**S(2)/(S(2)*x**S(2)) + S(2)*b**S(2)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/Pi + S(2)*b*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x**S(2), x), x, Integrate(Erfc(b*x)**S(2)/x**S(2), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2)/x, x), x, Integrate(Erfc(b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)**S(2), x), x, x*Erfc(b*x)**S(2) - sqrt(S(2))*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*b*x)/b - S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfc(b*x)**S(2), x), x, x**S(2)*Erfc(b*x)**S(2)/S(2) - Erfc(b*x)**S(2)/(S(4)*b**S(2)) + exp(-S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(2)) - x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfc(b*x)**S(2), x), x, x**S(3)*Erfc(b*x)**S(2)/S(3) + x*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*Pi*b**S(2)) - S(2)*x**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) - S(5)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(12)*sqrt(Pi)*b**S(3)) - S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfc(b*x)**S(2), x), x, x**S(4)*Erfc(b*x)**S(2)/S(4) - S(3)*Erfc(b*x)**S(2)/(S(16)*b**S(4)) + x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*Pi*b**S(2)) + exp(-S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(4)) - x**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b) - S(3)*x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erfc(b*x)**S(2), x), x, x**S(5)*Erfc(b*x)**S(2)/S(5) + x**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(5)*Pi*b**S(2)) + S(11)*x*exp(-S(2)*b**S(2)*x**S(2))/(S(20)*Pi*b**S(4)) - S(2)*x**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b) - S(4)*x**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(3)) - S(43)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(80)*sqrt(Pi)*b**S(5)) - S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(5)*Erfc(b*x)**S(2), x), x, x**S(6)*Erfc(b*x)**S(2)/S(6) - S(5)*Erfc(b*x)**S(2)/(S(16)*b**S(6)) + x**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*Pi*b**S(2)) + S(7)*x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(4)) + S(11)*exp(-S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(6)) - x**S(5)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) - S(5)*x**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*b**S(3)) - S(5)*x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(a + b*x)/x, x), x, Integrate(Erfc(a + b*x)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(a + b*x), x), x, (a + b*x)*Erfc(a + b*x)/b - exp(-(a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfc(a + b*x), x), x, a**S(2)*Erf(a + b*x)/(S(2)*b**S(2)) + x**S(2)*Erfc(a + b*x)/S(2) + Erf(a + b*x)/(S(4)*b**S(2)) + a*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) - (a + b*x)*exp(-(a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfc(a + b*x), x), x, -a**S(3)*Erf(a + b*x)/(S(3)*b**S(3)) - a*Erf(a + b*x)/(S(2)*b**S(3)) + x**S(3)*Erfc(a + b*x)/S(3) - a**S(2)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + a*(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - (a + b*x)**S(2)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfc(a + b*x), x), x, a**S(4)*Erf(a + b*x)/(S(4)*b**S(4)) + S(3)*a**S(2)*Erf(a + b*x)/(S(4)*b**S(4)) + x**S(4)*Erfc(a + b*x)/S(4) + S(3)*Erf(a + b*x)/(S(16)*b**S(4)) + a**S(3)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - S(3)*a**S(2)*(a + b*x)*exp(-(a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(4)) + a*(a + b*x)**S(2)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) + a*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - (a + b*x)**S(3)*exp(-(a + b*x)**S(2))/(S(4)*sqrt(Pi)*b**S(4)) - (S(3)*a + S(3)*b*x)*exp(-(a + b*x)**S(2))/(S(8)*sqrt(Pi)*b**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(a + b*x)**S(2)/x, x), x, Integrate(Erfc(a + b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(a + b*x)**S(2), x), x, (a + b*x)*Erfc(a + b*x)**S(2)/b - sqrt(S(2))*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b - S(2)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfc(a + b*x)**S(2), x), x, -a*(a + b*x)*Erfc(a + b*x)**S(2)/b**S(2) + sqrt(S(2))*a*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b**S(2) + (a + b*x)**S(2)*Erfc(a + b*x)**S(2)/(S(2)*b**S(2)) - Erfc(a + b*x)**S(2)/(S(4)*b**S(2)) + exp(-S(2)*(a + b*x)**S(2))/(S(2)*Pi*b**S(2)) + S(2)*a*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) - (a + b*x)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfc(a + b*x)**S(2), x), x, a**S(2)*(a + b*x)*Erfc(a + b*x)**S(2)/b**S(3) - sqrt(S(2))*a**S(2)*sqrt(S(1)/Pi)*Erf(sqrt(S(2))*(a + b*x))/b**S(3) - a*(a + b*x)**S(2)*Erfc(a + b*x)**S(2)/b**S(3) + a*Erfc(a + b*x)**S(2)/(S(2)*b**S(3)) + (a + b*x)**S(3)*Erfc(a + b*x)**S(2)/(S(3)*b**S(3)) - a*exp(-S(2)*(a + b*x)**S(2))/(Pi*b**S(3)) + (a + b*x)*exp(-S(2)*(a + b*x)**S(2))/(S(3)*Pi*b**S(3)) - S(2)*a**S(2)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + S(2)*a*(a + b*x)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - S(2)*(a + b*x)**S(2)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - S(5)*sqrt(S(2))*Erf(sqrt(S(2))*(a + b*x))/(S(12)*sqrt(Pi)*b**S(3)) - S(2)*Erfc(a + b*x)*exp(-(a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(8), x), x, -S(4)*sqrt(Pi)*b**S(7)*Erfc(b*x)**S(2)/S(105) + S(8)*b**S(6)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(105)*x) - S(4)*b**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(105)*x**S(3)) + S(2)*b**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(35)*x**S(5)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(7)*x**S(7)) + S(16)*b**S(7)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(35)*sqrt(Pi)) + S(4)*b**S(5)*exp(-S(2)*b**S(2)*x**S(2))/(S(21)*sqrt(Pi)*x**S(2)) - S(8)*b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(105)*sqrt(Pi)*x**S(4)) + b*exp(-S(2)*b**S(2)*x**S(2))/(S(21)*sqrt(Pi)*x**S(6)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(7), x), x, S(67)*sqrt(S(2))*b**S(6)*Erf(sqrt(S(2))*b*x)/S(90) - b**S(6)*Integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x, x)/S(6) - b**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(12)*x**S(2)) + b**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(12)*x**S(4)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(6)*x**S(6)) + S(67)*b**S(5)*exp(-S(2)*b**S(2)*x**S(2))/(S(90)*sqrt(Pi)*x) - S(13)*b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(90)*sqrt(Pi)*x**S(3)) + b*exp(-S(2)*b**S(2)*x**S(2))/(S(15)*sqrt(Pi)*x**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(6), x), x, S(2)*sqrt(Pi)*b**S(5)*Erfc(b*x)**S(2)/S(15) - S(4)*b**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*x) + S(2)*b**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(15)*x**S(3)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(5)*x**S(5)) - S(14)*b**S(5)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(15)*sqrt(Pi)) - b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)) + b*exp(-S(2)*b**S(2)*x**S(2))/(S(10)*sqrt(Pi)*x**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(5), x), x, -S(7)*sqrt(S(2))*b**S(4)*Erf(sqrt(S(2))*b*x)/S(6) + b**S(4)*Integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x, x)/S(2) + b**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*x**S(2)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*x**S(4)) - S(7)*b**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x) + b*exp(-S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(4), x), x, -sqrt(Pi)*b**S(3)*Erfc(b*x)**S(2)/S(3) + S(2)*b**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*x) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(3)*x**S(3)) + S(4)*b**S(3)*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)) + b*exp(-S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(3), x), x, sqrt(S(2))*b**S(2)*Erf(sqrt(S(2))*b*x) - b**S(2)*Integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x, x) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*x**S(2)) + b*exp(-S(2)*b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x**S(2), x), x, sqrt(Pi)*b*Erfc(b*x)**S(2)/S(2) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/x - b*ExpIntegralEi(-S(2)*b**S(2)*x**S(2))/sqrt(Pi), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x, x), x, Integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2))/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -sqrt(Pi)*Erfc(b*x)**S(2)/(S(4)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(4)*b**S(2)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -sqrt(Pi)*Erfc(b*x)**S(2)/(S(8)*b**S(3)) - x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) + exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -x**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(5)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(16)*b**S(4)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(4)) + x*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -S(3)*sqrt(Pi)*Erfc(b*x)**S(2)/(S(16)*b**S(5)) - x**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(3)*x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*b**S(4)) + x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + exp(-S(2)*b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(5)*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -x**S(4)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - x**S(2)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/b**S(4) - S(43)*sqrt(S(2))*Erf(sqrt(S(2))*b*x)/(S(64)*b**S(6)) - Erfc(b*x)*exp(-b**S(2)*x**S(2))/b**S(6) + x**S(3)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + S(11)*x*exp(-S(2)*b**S(2)*x**S(2))/(S(16)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(6)*Erfc(b*x)*exp(-b**S(2)*x**S(2)), x), x, -S(15)*sqrt(Pi)*Erfc(b*x)**S(2)/(S(32)*b**S(7)) - x**S(5)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(5)*x**S(3)*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(4)*b**S(4)) - S(15)*x*Erfc(b*x)*exp(-b**S(2)*x**S(2))/(S(8)*b**S(6)) + x**S(4)*exp(-S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + S(7)*x**S(2)*exp(-S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(5)) + S(11)*exp(-S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(7)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(8), x), x, Integrate(Erfi(b*x)**S(2)/x**S(8), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(7), x), x, S(4)*b**S(6)*Erfi(b*x)**S(2)/S(45) - Erfi(b*x)**S(2)/(S(6)*x**S(6)) + S(28)*b**S(6)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/(S(45)*Pi) - S(2)*b**S(4)*exp(S(2)*b**S(2)*x**S(2))/(S(9)*Pi*x**S(2)) - b**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(15)*Pi*x**S(4)) - S(8)*b**S(5)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x) - S(4)*b**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(45)*sqrt(Pi)*x**S(3)) - S(2)*b*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(15)*sqrt(Pi)*x**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(6), x), x, Integrate(Erfi(b*x)**S(2)/x**S(6), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(5), x), x, b**S(4)*Erfi(b*x)**S(2)/S(3) - Erfi(b*x)**S(2)/(S(4)*x**S(4)) + S(4)*b**S(4)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/(S(3)*Pi) - b**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(3)*Pi*x**S(2)) - S(2)*b**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x) - b*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(4), x), x, Integrate(Erfi(b*x)**S(2)/x**S(4), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(3), x), x, b**S(2)*Erfi(b*x)**S(2) - Erfi(b*x)**S(2)/(S(2)*x**S(2)) + S(2)*b**S(2)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/Pi - S(2)*b*Erfi(b*x)*exp(b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x**S(2), x), x, Integrate(Erfi(b*x)**S(2)/x**S(2), x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2)/x, x), x, Integrate(Erfi(b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)**S(2), x), x, x*Erfi(b*x)**S(2) + sqrt(S(2))*sqrt(S(1)/Pi)*Erfi(sqrt(S(2))*b*x)/b - S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfi(b*x)**S(2), x), x, x**S(2)*Erfi(b*x)**S(2)/S(2) + Erfi(b*x)**S(2)/(S(4)*b**S(2)) + exp(S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(2)) - x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfi(b*x)**S(2), x), x, x**S(3)*Erfi(b*x)**S(2)/S(3) + x*exp(S(2)*b**S(2)*x**S(2))/(S(3)*Pi*b**S(2)) - S(2)*x**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) + S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - S(5)*sqrt(S(2))*Erfi(sqrt(S(2))*b*x)/(S(12)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfi(b*x)**S(2), x), x, x**S(4)*Erfi(b*x)**S(2)/S(4) - S(3)*Erfi(b*x)**S(2)/(S(16)*b**S(4)) + x**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(4)*Pi*b**S(2)) - exp(S(2)*b**S(2)*x**S(2))/(S(2)*Pi*b**S(4)) - x**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b) + S(3)*x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erfi(b*x)**S(2), x), x, x**S(5)*Erfi(b*x)**S(2)/S(5) + x**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(5)*Pi*b**S(2)) - S(11)*x*exp(S(2)*b**S(2)*x**S(2))/(S(20)*Pi*b**S(4)) - S(2)*x**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b) + S(4)*x**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(3)) - S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(5)*sqrt(Pi)*b**S(5)) + S(43)*sqrt(S(2))*Erfi(sqrt(S(2))*b*x)/(S(80)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(5)*Erfi(b*x)**S(2), x), x, x**S(6)*Erfi(b*x)**S(2)/S(6) + S(5)*Erfi(b*x)**S(2)/(S(16)*b**S(6)) + x**S(4)*exp(S(2)*b**S(2)*x**S(2))/(S(6)*Pi*b**S(2)) - S(7)*x**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(4)) + S(11)*exp(S(2)*b**S(2)*x**S(2))/(S(12)*Pi*b**S(6)) - x**S(5)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*b) + S(5)*x**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*b**S(3)) - S(5)*x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(a + b*x)/x, x), x, Integrate(Erfi(a + b*x)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(a + b*x), x), x, (a + b*x)*Erfi(a + b*x)/b - exp((a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfi(a + b*x), x), x, -a**S(2)*Erfi(a + b*x)/(S(2)*b**S(2)) + x**S(2)*Erfi(a + b*x)/S(2) + Erfi(a + b*x)/(S(4)*b**S(2)) + a*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) - (a + b*x)*exp((a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfi(a + b*x), x), x, a**S(3)*Erfi(a + b*x)/(S(3)*b**S(3)) - a*Erfi(a + b*x)/(S(2)*b**S(3)) + x**S(3)*Erfi(a + b*x)/S(3) - a**S(2)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + a*(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - (a + b*x)**S(2)*exp((a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) + exp((a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfi(a + b*x), x), x, -a**S(4)*Erfi(a + b*x)/(S(4)*b**S(4)) + S(3)*a**S(2)*Erfi(a + b*x)/(S(4)*b**S(4)) + x**S(4)*Erfi(a + b*x)/S(4) - S(3)*Erfi(a + b*x)/(S(16)*b**S(4)) + a**S(3)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - S(3)*a**S(2)*(a + b*x)*exp((a + b*x)**S(2))/(S(2)*sqrt(Pi)*b**S(4)) + a*(a + b*x)**S(2)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - a*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(4)) - (a + b*x)**S(3)*exp((a + b*x)**S(2))/(S(4)*sqrt(Pi)*b**S(4)) + S(3)*(a + b*x)*exp((a + b*x)**S(2))/(S(8)*sqrt(Pi)*b**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(a + b*x)**S(2)/x, x), x, Integrate(Erfi(a + b*x)**S(2)/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(a + b*x)**S(2), x), x, (a + b*x)*Erfi(a + b*x)**S(2)/b + sqrt(S(2))*sqrt(S(1)/Pi)*Erfi(sqrt(S(2))*(a + b*x))/b - S(2)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfi(a + b*x)**S(2), x), x, -a*(a + b*x)*Erfi(a + b*x)**S(2)/b**S(2) - sqrt(S(2))*a*sqrt(S(1)/Pi)*Erfi(sqrt(S(2))*(a + b*x))/b**S(2) + (a + b*x)**S(2)*Erfi(a + b*x)**S(2)/(S(2)*b**S(2)) + Erfi(a + b*x)**S(2)/(S(4)*b**S(2)) + exp(S(2)*(a + b*x)**S(2))/(S(2)*Pi*b**S(2)) + S(2)*a*Erfi(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(2)) - (a + b*x)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfi(a + b*x)**S(2), x), x, a**S(2)*(a + b*x)*Erfi(a + b*x)**S(2)/b**S(3) + sqrt(S(2))*a**S(2)*sqrt(S(1)/Pi)*Erfi(sqrt(S(2))*(a + b*x))/b**S(3) - a*(a + b*x)**S(2)*Erfi(a + b*x)**S(2)/b**S(3) - a*Erfi(a + b*x)**S(2)/(S(2)*b**S(3)) + (a + b*x)**S(3)*Erfi(a + b*x)**S(2)/(S(3)*b**S(3)) - a*exp(S(2)*(a + b*x)**S(2))/(Pi*b**S(3)) + (a + b*x)*exp(S(2)*(a + b*x)**S(2))/(S(3)*Pi*b**S(3)) - S(2)*a**S(2)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) + S(2)*a*(a + b*x)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(sqrt(Pi)*b**S(3)) - S(2)*(a + b*x)**S(2)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)) - S(5)*sqrt(S(2))*Erfi(sqrt(S(2))*(a + b*x))/(S(12)*sqrt(Pi)*b**S(3)) + S(2)*Erfi(a + b*x)*exp((a + b*x)**S(2))/(S(3)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(8), x), x, S(4)*sqrt(Pi)*b**S(7)*Erfi(b*x)**S(2)/S(105) - S(8)*b**S(6)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(105)*x) - S(4)*b**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(105)*x**S(3)) - S(2)*b**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(35)*x**S(5)) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(7)*x**S(7)) + S(16)*b**S(7)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/(S(35)*sqrt(Pi)) - S(4)*b**S(5)*exp(S(2)*b**S(2)*x**S(2))/(S(21)*sqrt(Pi)*x**S(2)) - S(8)*b**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(105)*sqrt(Pi)*x**S(4)) - b*exp(S(2)*b**S(2)*x**S(2))/(S(21)*sqrt(Pi)*x**S(6)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(7), x), x, S(67)*sqrt(S(2))*b**S(6)*Erfi(sqrt(S(2))*b*x)/S(90) + b**S(6)*Integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x, x)/S(6) - b**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(12)*x**S(2)) - b**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(12)*x**S(4)) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(6)*x**S(6)) - S(67)*b**S(5)*exp(S(2)*b**S(2)*x**S(2))/(S(90)*sqrt(Pi)*x) - S(13)*b**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(90)*sqrt(Pi)*x**S(3)) - b*exp(S(2)*b**S(2)*x**S(2))/(S(15)*sqrt(Pi)*x**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(6), x), x, S(2)*sqrt(Pi)*b**S(5)*Erfi(b*x)**S(2)/S(15) - S(4)*b**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(15)*x) - S(2)*b**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(15)*x**S(3)) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(5)*x**S(5)) + S(14)*b**S(5)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/(S(15)*sqrt(Pi)) - b**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)) - b*exp(S(2)*b**S(2)*x**S(2))/(S(10)*sqrt(Pi)*x**S(4)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(5), x), x, S(7)*sqrt(S(2))*b**S(4)*Erfi(sqrt(S(2))*b*x)/S(6) + b**S(4)*Integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x, x)/S(2) - b**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*x**S(2)) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*x**S(4)) - S(7)*b**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x) - b*exp(S(2)*b**S(2)*x**S(2))/(S(6)*sqrt(Pi)*x**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(4), x), x, sqrt(Pi)*b**S(3)*Erfi(b*x)**S(2)/S(3) - S(2)*b**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*x) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(3)*x**S(3)) + S(4)*b**S(3)*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)) - b*exp(S(2)*b**S(2)*x**S(2))/(S(3)*sqrt(Pi)*x**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(3), x), x, sqrt(S(2))*b**S(2)*Erfi(sqrt(S(2))*b*x) + b**S(2)*Integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x, x) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*x**S(2)) - b*exp(S(2)*b**S(2)*x**S(2))/(sqrt(Pi)*x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x**S(2), x), x, sqrt(Pi)*b*Erfi(b*x)**S(2)/S(2) - Erfi(b*x)*exp(b**S(2)*x**S(2))/x + b*ExpIntegralEi(S(2)*b**S(2)*x**S(2))/sqrt(Pi), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x, x), x, Integrate(Erfi(b*x)*exp(b**S(2)*x**S(2))/x, x), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, sqrt(Pi)*Erfi(b*x)**S(2)/(S(4)*b), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - sqrt(S(2))*Erfi(sqrt(S(2))*b*x)/(S(4)*b**S(2)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, -sqrt(Pi)*Erfi(b*x)**S(2)/(S(8)*b**S(3)) + x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - exp(S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, x**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(4)) + S(5)*sqrt(S(2))*Erfi(sqrt(S(2))*b*x)/(S(16)*b**S(4)) - x*exp(S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, S(3)*sqrt(Pi)*Erfi(b*x)**S(2)/(S(16)*b**S(5)) + x**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(3)*x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*b**S(4)) - x**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + exp(S(2)*b**S(2)*x**S(2))/(S(2)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(5)*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, x**S(4)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - x**S(2)*Erfi(b*x)*exp(b**S(2)*x**S(2))/b**S(4) + Erfi(b*x)*exp(b**S(2)*x**S(2))/b**S(6) - S(43)*sqrt(S(2))*Erfi(sqrt(S(2))*b*x)/(S(64)*b**S(6)) - x**S(3)*exp(S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + S(11)*x*exp(S(2)*b**S(2)*x**S(2))/(S(16)*sqrt(Pi)*b**S(5)), expand=True, _diff=True, _numerical=True)
    assert rubi_test(rubi_integrate(x**S(6)*Erfi(b*x)*exp(b**S(2)*x**S(2)), x), x, -S(15)*sqrt(Pi)*Erfi(b*x)**S(2)/(S(32)*b**S(7)) + x**S(5)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(2)*b**S(2)) - S(5)*x**S(3)*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(4)*b**S(4)) + S(15)*x*Erfi(b*x)*exp(b**S(2)*x**S(2))/(S(8)*b**S(6)) - x**S(4)*exp(S(2)*b**S(2)*x**S(2))/(S(4)*sqrt(Pi)*b**S(3)) + S(7)*x**S(2)*exp(S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(5)) - S(11)*exp(S(2)*b**S(2)*x**S(2))/(S(8)*sqrt(Pi)*b**S(7)), expand=True, _diff=True, _numerical=True)