\(\int \frac {x^4 (A+B x^2+C x^4+D x^6)}{a+b x^2} \, dx\) [161]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [B] (verification not implemented)
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [F(-1)]
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 30, antiderivative size = 172 \[ \int \frac {x^4 \left (A+B x^2+C x^4+D x^6\right )}{a+b x^2} \, dx=-\frac {a \left (A b^3-a \left (b^2 B-a b C+a^2 D\right )\right ) x}{b^5}+\frac {\left (A b^3-a \left (b^2 B-a b C+a^2 D\right )\right ) x^3}{3 b^4}+\frac {\left (b^2 B-a b C+a^2 D\right ) x^5}{5 b^3}+\frac {(b C-a D) x^7}{7 b^2}+\frac {D x^9}{9 b}+\frac {a^{3/2} \left (A b^3-a \left (b^2 B-a b C+a^2 D\right )\right ) \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{b^{11/2}} \] Output:

-a*(A*b^3-a*(B*b^2-C*a*b+D*a^2))*x/b^5+1/3*(A*b^3-a*(B*b^2-C*a*b+D*a^2))*x 
^3/b^4+1/5*(B*b^2-C*a*b+D*a^2)*x^5/b^3+1/7*(C*b-D*a)*x^7/b^2+1/9*D*x^9/b+a 
^(3/2)*(A*b^3-a*(B*b^2-C*a*b+D*a^2))*arctan(b^(1/2)*x/a^(1/2))/b^(11/2)
 

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 162, normalized size of antiderivative = 0.94 \[ \int \frac {x^4 \left (A+B x^2+C x^4+D x^6\right )}{a+b x^2} \, dx=\frac {x \left (315 a^4 D-105 a^3 b \left (3 C+D x^2\right )+21 a^2 b^2 \left (15 B+5 C x^2+3 D x^4\right )-3 a b^3 \left (105 A+35 B x^2+21 C x^4+15 D x^6\right )+b^4 x^2 \left (105 A+63 B x^2+45 C x^4+35 D x^6\right )\right )}{315 b^5}-\frac {a^{3/2} \left (-A b^3+a \left (b^2 B-a b C+a^2 D\right )\right ) \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{b^{11/2}} \] Input:

Integrate[(x^4*(A + B*x^2 + C*x^4 + D*x^6))/(a + b*x^2),x]
 

Output:

(x*(315*a^4*D - 105*a^3*b*(3*C + D*x^2) + 21*a^2*b^2*(15*B + 5*C*x^2 + 3*D 
*x^4) - 3*a*b^3*(105*A + 35*B*x^2 + 21*C*x^4 + 15*D*x^6) + b^4*x^2*(105*A 
+ 63*B*x^2 + 45*C*x^4 + 35*D*x^6)))/(315*b^5) - (a^(3/2)*(-(A*b^3) + a*(b^ 
2*B - a*b*C + a^2*D))*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/b^(11/2)
 

Rubi [A] (verified)

Time = 0.39 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {2333, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {x^4 \left (A+B x^2+C x^4+D x^6\right )}{a+b x^2} \, dx\)

\(\Big \downarrow \) 2333

\(\displaystyle \int \left (-\frac {a \left (A b^3-a \left (a^2 D-a b C+b^2 B\right )\right )}{b^5}+\frac {x^2 \left (A b^3-a \left (a^2 D-a b C+b^2 B\right )\right )}{b^4}+\frac {x^4 \left (a^2 D-a b C+b^2 B\right )}{b^3}+\frac {a^5 (-D)+a^4 b C-a^3 b^2 B+a^2 A b^3}{b^5 \left (a+b x^2\right )}+\frac {x^6 (b C-a D)}{b^2}+\frac {D x^8}{b}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {a x \left (A b^3-a \left (a^2 D-a b C+b^2 B\right )\right )}{b^5}+\frac {x^3 \left (A b^3-a \left (a^2 D-a b C+b^2 B\right )\right )}{3 b^4}+\frac {x^5 \left (a^2 D-a b C+b^2 B\right )}{5 b^3}+\frac {a^{3/2} \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right ) \left (A b^3-a \left (a^2 D-a b C+b^2 B\right )\right )}{b^{11/2}}+\frac {x^7 (b C-a D)}{7 b^2}+\frac {D x^9}{9 b}\)

Input:

Int[(x^4*(A + B*x^2 + C*x^4 + D*x^6))/(a + b*x^2),x]
 

Output:

-((a*(A*b^3 - a*(b^2*B - a*b*C + a^2*D))*x)/b^5) + ((A*b^3 - a*(b^2*B - a* 
b*C + a^2*D))*x^3)/(3*b^4) + ((b^2*B - a*b*C + a^2*D)*x^5)/(5*b^3) + ((b*C 
 - a*D)*x^7)/(7*b^2) + (D*x^9)/(9*b) + (a^(3/2)*(A*b^3 - a*(b^2*B - a*b*C 
+ a^2*D))*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/b^(11/2)
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2333
Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ 
ExpandIntegrand[(c*x)^m*Pq*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] 
&& PolyQ[Pq, x] && IGtQ[p, -2]
 
Maple [A] (verified)

Time = 0.46 (sec) , antiderivative size = 185, normalized size of antiderivative = 1.08

method result size
default \(-\frac {-\frac {1}{9} D x^{9} b^{4}-\frac {1}{7} C \,b^{4} x^{7}+\frac {1}{7} D a \,b^{3} x^{7}-\frac {1}{5} B \,b^{4} x^{5}+\frac {1}{5} C a \,b^{3} x^{5}-\frac {1}{5} D a^{2} b^{2} x^{5}-\frac {1}{3} A \,x^{3} b^{4}+\frac {1}{3} B \,x^{3} a \,b^{3}-\frac {1}{3} C \,a^{2} b^{2} x^{3}+\frac {1}{3} D a^{3} b \,x^{3}+A a \,b^{3} x -B \,a^{2} b^{2} x +C \,a^{3} b x -D a^{4} x}{b^{5}}+\frac {a^{2} \left (b^{3} A -a \,b^{2} B +a^{2} b C -a^{3} D\right ) \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{b^{5} \sqrt {a b}}\) \(185\)

Input:

int(x^4*(D*x^6+C*x^4+B*x^2+A)/(b*x^2+a),x,method=_RETURNVERBOSE)
 

Output:

-1/b^5*(-1/9*D*x^9*b^4-1/7*C*b^4*x^7+1/7*D*a*b^3*x^7-1/5*B*b^4*x^5+1/5*C*a 
*b^3*x^5-1/5*D*a^2*b^2*x^5-1/3*A*x^3*b^4+1/3*B*x^3*a*b^3-1/3*C*a^2*b^2*x^3 
+1/3*D*a^3*b*x^3+A*a*b^3*x-B*a^2*b^2*x+C*a^3*b*x-D*a^4*x)+a^2*(A*b^3-B*a*b 
^2+C*a^2*b-D*a^3)/b^5/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 368, normalized size of antiderivative = 2.14 \[ \int \frac {x^4 \left (A+B x^2+C x^4+D x^6\right )}{a+b x^2} \, dx=\left [\frac {70 \, D b^{4} x^{9} - 90 \, {\left (D a b^{3} - C b^{4}\right )} x^{7} + 126 \, {\left (D a^{2} b^{2} - C a b^{3} + B b^{4}\right )} x^{5} - 210 \, {\left (D a^{3} b - C a^{2} b^{2} + B a b^{3} - A b^{4}\right )} x^{3} - 315 \, {\left (D a^{4} - C a^{3} b + B a^{2} b^{2} - A a b^{3}\right )} \sqrt {-\frac {a}{b}} \log \left (\frac {b x^{2} + 2 \, b x \sqrt {-\frac {a}{b}} - a}{b x^{2} + a}\right ) + 630 \, {\left (D a^{4} - C a^{3} b + B a^{2} b^{2} - A a b^{3}\right )} x}{630 \, b^{5}}, \frac {35 \, D b^{4} x^{9} - 45 \, {\left (D a b^{3} - C b^{4}\right )} x^{7} + 63 \, {\left (D a^{2} b^{2} - C a b^{3} + B b^{4}\right )} x^{5} - 105 \, {\left (D a^{3} b - C a^{2} b^{2} + B a b^{3} - A b^{4}\right )} x^{3} - 315 \, {\left (D a^{4} - C a^{3} b + B a^{2} b^{2} - A a b^{3}\right )} \sqrt {\frac {a}{b}} \arctan \left (\frac {b x \sqrt {\frac {a}{b}}}{a}\right ) + 315 \, {\left (D a^{4} - C a^{3} b + B a^{2} b^{2} - A a b^{3}\right )} x}{315 \, b^{5}}\right ] \] Input:

integrate(x^4*(D*x^6+C*x^4+B*x^2+A)/(b*x^2+a),x, algorithm="fricas")
 

Output:

[1/630*(70*D*b^4*x^9 - 90*(D*a*b^3 - C*b^4)*x^7 + 126*(D*a^2*b^2 - C*a*b^3 
 + B*b^4)*x^5 - 210*(D*a^3*b - C*a^2*b^2 + B*a*b^3 - A*b^4)*x^3 - 315*(D*a 
^4 - C*a^3*b + B*a^2*b^2 - A*a*b^3)*sqrt(-a/b)*log((b*x^2 + 2*b*x*sqrt(-a/ 
b) - a)/(b*x^2 + a)) + 630*(D*a^4 - C*a^3*b + B*a^2*b^2 - A*a*b^3)*x)/b^5, 
 1/315*(35*D*b^4*x^9 - 45*(D*a*b^3 - C*b^4)*x^7 + 63*(D*a^2*b^2 - C*a*b^3 
+ B*b^4)*x^5 - 105*(D*a^3*b - C*a^2*b^2 + B*a*b^3 - A*b^4)*x^3 - 315*(D*a^ 
4 - C*a^3*b + B*a^2*b^2 - A*a*b^3)*sqrt(a/b)*arctan(b*x*sqrt(a/b)/a) + 315 
*(D*a^4 - C*a^3*b + B*a^2*b^2 - A*a*b^3)*x)/b^5]
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 337 vs. \(2 (158) = 316\).

Time = 0.49 (sec) , antiderivative size = 337, normalized size of antiderivative = 1.96 \[ \int \frac {x^4 \left (A+B x^2+C x^4+D x^6\right )}{a+b x^2} \, dx=\frac {D x^{9}}{9 b} + x^{7} \left (\frac {C}{7 b} - \frac {D a}{7 b^{2}}\right ) + x^{5} \left (\frac {B}{5 b} - \frac {C a}{5 b^{2}} + \frac {D a^{2}}{5 b^{3}}\right ) + x^{3} \left (\frac {A}{3 b} - \frac {B a}{3 b^{2}} + \frac {C a^{2}}{3 b^{3}} - \frac {D a^{3}}{3 b^{4}}\right ) + x \left (- \frac {A a}{b^{2}} + \frac {B a^{2}}{b^{3}} - \frac {C a^{3}}{b^{4}} + \frac {D a^{4}}{b^{5}}\right ) + \frac {\sqrt {- \frac {a^{3}}{b^{11}}} \left (- A b^{3} + B a b^{2} - C a^{2} b + D a^{3}\right ) \log {\left (- \frac {b^{5} \sqrt {- \frac {a^{3}}{b^{11}}} \left (- A b^{3} + B a b^{2} - C a^{2} b + D a^{3}\right )}{- A a b^{3} + B a^{2} b^{2} - C a^{3} b + D a^{4}} + x \right )}}{2} - \frac {\sqrt {- \frac {a^{3}}{b^{11}}} \left (- A b^{3} + B a b^{2} - C a^{2} b + D a^{3}\right ) \log {\left (\frac {b^{5} \sqrt {- \frac {a^{3}}{b^{11}}} \left (- A b^{3} + B a b^{2} - C a^{2} b + D a^{3}\right )}{- A a b^{3} + B a^{2} b^{2} - C a^{3} b + D a^{4}} + x \right )}}{2} \] Input:

integrate(x**4*(D*x**6+C*x**4+B*x**2+A)/(b*x**2+a),x)
                                                                                    
                                                                                    
 

Output:

D*x**9/(9*b) + x**7*(C/(7*b) - D*a/(7*b**2)) + x**5*(B/(5*b) - C*a/(5*b**2 
) + D*a**2/(5*b**3)) + x**3*(A/(3*b) - B*a/(3*b**2) + C*a**2/(3*b**3) - D* 
a**3/(3*b**4)) + x*(-A*a/b**2 + B*a**2/b**3 - C*a**3/b**4 + D*a**4/b**5) + 
 sqrt(-a**3/b**11)*(-A*b**3 + B*a*b**2 - C*a**2*b + D*a**3)*log(-b**5*sqrt 
(-a**3/b**11)*(-A*b**3 + B*a*b**2 - C*a**2*b + D*a**3)/(-A*a*b**3 + B*a**2 
*b**2 - C*a**3*b + D*a**4) + x)/2 - sqrt(-a**3/b**11)*(-A*b**3 + B*a*b**2 
- C*a**2*b + D*a**3)*log(b**5*sqrt(-a**3/b**11)*(-A*b**3 + B*a*b**2 - C*a* 
*2*b + D*a**3)/(-A*a*b**3 + B*a**2*b**2 - C*a**3*b + D*a**4) + x)/2
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 173, normalized size of antiderivative = 1.01 \[ \int \frac {x^4 \left (A+B x^2+C x^4+D x^6\right )}{a+b x^2} \, dx=-\frac {{\left (D a^{5} - C a^{4} b + B a^{3} b^{2} - A a^{2} b^{3}\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} b^{5}} + \frac {35 \, D b^{4} x^{9} - 45 \, {\left (D a b^{3} - C b^{4}\right )} x^{7} + 63 \, {\left (D a^{2} b^{2} - C a b^{3} + B b^{4}\right )} x^{5} - 105 \, {\left (D a^{3} b - C a^{2} b^{2} + B a b^{3} - A b^{4}\right )} x^{3} + 315 \, {\left (D a^{4} - C a^{3} b + B a^{2} b^{2} - A a b^{3}\right )} x}{315 \, b^{5}} \] Input:

integrate(x^4*(D*x^6+C*x^4+B*x^2+A)/(b*x^2+a),x, algorithm="maxima")
 

Output:

-(D*a^5 - C*a^4*b + B*a^3*b^2 - A*a^2*b^3)*arctan(b*x/sqrt(a*b))/(sqrt(a*b 
)*b^5) + 1/315*(35*D*b^4*x^9 - 45*(D*a*b^3 - C*b^4)*x^7 + 63*(D*a^2*b^2 - 
C*a*b^3 + B*b^4)*x^5 - 105*(D*a^3*b - C*a^2*b^2 + B*a*b^3 - A*b^4)*x^3 + 3 
15*(D*a^4 - C*a^3*b + B*a^2*b^2 - A*a*b^3)*x)/b^5
 

Giac [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 196, normalized size of antiderivative = 1.14 \[ \int \frac {x^4 \left (A+B x^2+C x^4+D x^6\right )}{a+b x^2} \, dx=-\frac {{\left (D a^{5} - C a^{4} b + B a^{3} b^{2} - A a^{2} b^{3}\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} b^{5}} + \frac {35 \, D b^{8} x^{9} - 45 \, D a b^{7} x^{7} + 45 \, C b^{8} x^{7} + 63 \, D a^{2} b^{6} x^{5} - 63 \, C a b^{7} x^{5} + 63 \, B b^{8} x^{5} - 105 \, D a^{3} b^{5} x^{3} + 105 \, C a^{2} b^{6} x^{3} - 105 \, B a b^{7} x^{3} + 105 \, A b^{8} x^{3} + 315 \, D a^{4} b^{4} x - 315 \, C a^{3} b^{5} x + 315 \, B a^{2} b^{6} x - 315 \, A a b^{7} x}{315 \, b^{9}} \] Input:

integrate(x^4*(D*x^6+C*x^4+B*x^2+A)/(b*x^2+a),x, algorithm="giac")
 

Output:

-(D*a^5 - C*a^4*b + B*a^3*b^2 - A*a^2*b^3)*arctan(b*x/sqrt(a*b))/(sqrt(a*b 
)*b^5) + 1/315*(35*D*b^8*x^9 - 45*D*a*b^7*x^7 + 45*C*b^8*x^7 + 63*D*a^2*b^ 
6*x^5 - 63*C*a*b^7*x^5 + 63*B*b^8*x^5 - 105*D*a^3*b^5*x^3 + 105*C*a^2*b^6* 
x^3 - 105*B*a*b^7*x^3 + 105*A*b^8*x^3 + 315*D*a^4*b^4*x - 315*C*a^3*b^5*x 
+ 315*B*a^2*b^6*x - 315*A*a*b^7*x)/b^9
 

Mupad [F(-1)]

Timed out. \[ \int \frac {x^4 \left (A+B x^2+C x^4+D x^6\right )}{a+b x^2} \, dx=\int \frac {x^4\,\left (A+B\,x^2+C\,x^4+x^6\,D\right )}{b\,x^2+a} \,d x \] Input:

int((x^4*(A + B*x^2 + C*x^4 + x^6*D))/(a + b*x^2),x)
 

Output:

int((x^4*(A + B*x^2 + C*x^4 + x^6*D))/(a + b*x^2), x)
 

Reduce [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 151, normalized size of antiderivative = 0.88 \[ \int \frac {x^4 \left (A+B x^2+C x^4+D x^6\right )}{a+b x^2} \, dx=\frac {-315 \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {b x}{\sqrt {b}\, \sqrt {a}}\right ) a^{4} d +315 \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {b x}{\sqrt {b}\, \sqrt {a}}\right ) a^{3} b c +315 a^{4} b d x -315 a^{3} b^{2} c x -105 a^{3} b^{2} d \,x^{3}+105 a^{2} b^{3} c \,x^{3}+63 a^{2} b^{3} d \,x^{5}-63 a \,b^{4} c \,x^{5}-45 a \,b^{4} d \,x^{7}+63 b^{6} x^{5}+45 b^{5} c \,x^{7}+35 b^{5} d \,x^{9}}{315 b^{6}} \] Input:

int(x^4*(D*x^6+C*x^4+B*x^2+A)/(b*x^2+a),x)
 

Output:

( - 315*sqrt(b)*sqrt(a)*atan((b*x)/(sqrt(b)*sqrt(a)))*a**4*d + 315*sqrt(b) 
*sqrt(a)*atan((b*x)/(sqrt(b)*sqrt(a)))*a**3*b*c + 315*a**4*b*d*x - 315*a** 
3*b**2*c*x - 105*a**3*b**2*d*x**3 + 105*a**2*b**3*c*x**3 + 63*a**2*b**3*d* 
x**5 - 63*a*b**4*c*x**5 - 45*a*b**4*d*x**7 + 63*b**6*x**5 + 45*b**5*c*x**7 
 + 35*b**5*d*x**9)/(315*b**6)