\(\int \frac {x^2 (d+e x^n)^2}{a+b x^n+c x^{2 n}} \, dx\) [135]

Optimal result
Mathematica [A] (warning: unable to verify)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F(-2)]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 29, antiderivative size = 247 \[ \int \frac {x^2 \left (d+e x^n\right )^2}{a+b x^n+c x^{2 n}} \, dx=\frac {e^2 x^3}{3 c}+\frac {\left (e (2 c d-b e)+\frac {2 c^2 d^2+b^2 e^2-2 c e (b d+a e)}{\sqrt {b^2-4 a c}}\right ) x^3 \operatorname {Hypergeometric2F1}\left (1,\frac {3}{n},\frac {3+n}{n},-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{3 c \left (b-\sqrt {b^2-4 a c}\right )}+\frac {\left (e (2 c d-b e)-\frac {2 c^2 d^2+b^2 e^2-2 c e (b d+a e)}{\sqrt {b^2-4 a c}}\right ) x^3 \operatorname {Hypergeometric2F1}\left (1,\frac {3}{n},\frac {3+n}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{3 c \left (b+\sqrt {b^2-4 a c}\right )} \] Output:

1/3*e^2*x^3/c+1/3*(e*(-b*e+2*c*d)+(2*c^2*d^2+b^2*e^2-2*c*e*(a*e+b*d))/(-4* 
a*c+b^2)^(1/2))*x^3*hypergeom([1, 3/n],[(3+n)/n],-2*c*x^n/(b-(-4*a*c+b^2)^ 
(1/2)))/c/(b-(-4*a*c+b^2)^(1/2))+1/3*(e*(-b*e+2*c*d)-(2*c^2*d^2+b^2*e^2-2* 
c*e*(a*e+b*d))/(-4*a*c+b^2)^(1/2))*x^3*hypergeom([1, 3/n],[(3+n)/n],-2*c*x 
^n/(b+(-4*a*c+b^2)^(1/2)))/c/(b+(-4*a*c+b^2)^(1/2))
 

Mathematica [A] (warning: unable to verify)

Time = 1.19 (sec) , antiderivative size = 355, normalized size of antiderivative = 1.44 \[ \int \frac {x^2 \left (d+e x^n\right )^2}{a+b x^n+c x^{2 n}} \, dx=\frac {2^{-\frac {3+n}{n}} x^3 \left (2^{\frac {3+n}{n}} c \sqrt {b^2-4 a c} d^2-\left (-a \sqrt {b^2-4 a c} e^2+c d \left (\sqrt {b^2-4 a c} d-4 a e\right )+b \left (c d^2+a e^2\right )\right ) \left (\frac {c x^n}{b-\sqrt {b^2-4 a c}+2 c x^n}\right )^{-3/n} \operatorname {Hypergeometric2F1}\left (-\frac {3}{n},-\frac {3}{n},\frac {-3+n}{n},\frac {b-\sqrt {b^2-4 a c}}{b-\sqrt {b^2-4 a c}+2 c x^n}\right )+\left (a \sqrt {b^2-4 a c} e^2-c d \left (\sqrt {b^2-4 a c} d+4 a e\right )+b \left (c d^2+a e^2\right )\right ) \left (\frac {c x^n}{b+\sqrt {b^2-4 a c}+2 c x^n}\right )^{-3/n} \operatorname {Hypergeometric2F1}\left (-\frac {3}{n},-\frac {3}{n},\frac {-3+n}{n},\frac {b+\sqrt {b^2-4 a c}}{b+\sqrt {b^2-4 a c}+2 c x^n}\right )\right )}{3 a c \sqrt {b^2-4 a c}} \] Input:

Integrate[(x^2*(d + e*x^n)^2)/(a + b*x^n + c*x^(2*n)),x]
 

Output:

(x^3*(2^((3 + n)/n)*c*Sqrt[b^2 - 4*a*c]*d^2 - ((-(a*Sqrt[b^2 - 4*a*c]*e^2) 
 + c*d*(Sqrt[b^2 - 4*a*c]*d - 4*a*e) + b*(c*d^2 + a*e^2))*Hypergeometric2F 
1[-3/n, -3/n, (-3 + n)/n, (b - Sqrt[b^2 - 4*a*c])/(b - Sqrt[b^2 - 4*a*c] + 
 2*c*x^n)])/((c*x^n)/(b - Sqrt[b^2 - 4*a*c] + 2*c*x^n))^(3/n) + ((a*Sqrt[b 
^2 - 4*a*c]*e^2 - c*d*(Sqrt[b^2 - 4*a*c]*d + 4*a*e) + b*(c*d^2 + a*e^2))*H 
ypergeometric2F1[-3/n, -3/n, (-3 + n)/n, (b + Sqrt[b^2 - 4*a*c])/(b + Sqrt 
[b^2 - 4*a*c] + 2*c*x^n)])/((c*x^n)/(b + Sqrt[b^2 - 4*a*c] + 2*c*x^n))^(3/ 
n)))/(3*2^((3 + n)/n)*a*c*Sqrt[b^2 - 4*a*c])
 

Rubi [A] (verified)

Time = 0.89 (sec) , antiderivative size = 430, normalized size of antiderivative = 1.74, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {1880, 1008, 25, 959, 888}

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^2 \left (d+e x^n\right )^2}{a+b x^n+c x^{2 n}} \, dx\)

\(\Big \downarrow \) 1880

\(\displaystyle \frac {2 c \int \frac {x^2 \left (e x^n+d\right )^2}{2 c x^n+b-\sqrt {b^2-4 a c}}dx}{\sqrt {b^2-4 a c}}-\frac {2 c \int \frac {x^2 \left (e x^n+d\right )^2}{2 c x^n+b+\sqrt {b^2-4 a c}}dx}{\sqrt {b^2-4 a c}}\)

\(\Big \downarrow \) 1008

\(\displaystyle \frac {2 c \left (\frac {\int -\frac {x^2 \left (e \left (\left (b-\sqrt {b^2-4 a c}\right ) e (n+3)-2 c d (2 n+3)\right ) x^n+d \left (3 \left (b-\sqrt {b^2-4 a c}\right ) e-2 c d (n+3)\right )\right )}{2 c x^n+b-\sqrt {b^2-4 a c}}dx}{2 c (n+3)}+\frac {e x^3 \left (d+e x^n\right )}{2 c (n+3)}\right )}{\sqrt {b^2-4 a c}}-\frac {2 c \left (\frac {\int -\frac {x^2 \left (e \left (\left (b+\sqrt {b^2-4 a c}\right ) e (n+3)-2 c d (2 n+3)\right ) x^n+d \left (3 \left (b+\sqrt {b^2-4 a c}\right ) e-2 c d (n+3)\right )\right )}{2 c x^n+b+\sqrt {b^2-4 a c}}dx}{2 c (n+3)}+\frac {e x^3 \left (d+e x^n\right )}{2 c (n+3)}\right )}{\sqrt {b^2-4 a c}}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {2 c \left (\frac {e x^3 \left (d+e x^n\right )}{2 c (n+3)}-\frac {\int \frac {x^2 \left (e \left (\left (b-\sqrt {b^2-4 a c}\right ) e (n+3)-2 c d (2 n+3)\right ) x^n+d \left (3 \left (b-\sqrt {b^2-4 a c}\right ) e-2 c d (n+3)\right )\right )}{2 c x^n+b-\sqrt {b^2-4 a c}}dx}{2 c (n+3)}\right )}{\sqrt {b^2-4 a c}}-\frac {2 c \left (\frac {e x^3 \left (d+e x^n\right )}{2 c (n+3)}-\frac {\int \frac {x^2 \left (e \left (\left (b+\sqrt {b^2-4 a c}\right ) e (n+3)-2 c d (2 n+3)\right ) x^n+d \left (3 \left (b+\sqrt {b^2-4 a c}\right ) e-2 c d (n+3)\right )\right )}{2 c x^n+b+\sqrt {b^2-4 a c}}dx}{2 c (n+3)}\right )}{\sqrt {b^2-4 a c}}\)

\(\Big \downarrow \) 959

\(\displaystyle \frac {2 c \left (\frac {e x^3 \left (d+e x^n\right )}{2 c (n+3)}-\frac {\frac {e x^3 \left (e (n+3) \left (b-\sqrt {b^2-4 a c}\right )-2 c d (2 n+3)\right )}{6 c}-\frac {(n+3) \left (-2 c e \left (-d \sqrt {b^2-4 a c}+a e+b d\right )+b e^2 \left (b-\sqrt {b^2-4 a c}\right )+2 c^2 d^2\right ) \int \frac {x^2}{2 c x^n+b-\sqrt {b^2-4 a c}}dx}{c}}{2 c (n+3)}\right )}{\sqrt {b^2-4 a c}}-\frac {2 c \left (\frac {e x^3 \left (d+e x^n\right )}{2 c (n+3)}-\frac {\frac {e x^3 \left (e (n+3) \left (\sqrt {b^2-4 a c}+b\right )-2 c d (2 n+3)\right )}{6 c}-\frac {(n+3) \left (-2 c e \left (d \sqrt {b^2-4 a c}+a e+b d\right )+b e^2 \left (\sqrt {b^2-4 a c}+b\right )+2 c^2 d^2\right ) \int \frac {x^2}{2 c x^n+b+\sqrt {b^2-4 a c}}dx}{c}}{2 c (n+3)}\right )}{\sqrt {b^2-4 a c}}\)

\(\Big \downarrow \) 888

\(\displaystyle \frac {2 c \left (\frac {e x^3 \left (d+e x^n\right )}{2 c (n+3)}-\frac {\frac {e x^3 \left (e (n+3) \left (b-\sqrt {b^2-4 a c}\right )-2 c d (2 n+3)\right )}{6 c}-\frac {(n+3) x^3 \left (-2 c e \left (-d \sqrt {b^2-4 a c}+a e+b d\right )+b e^2 \left (b-\sqrt {b^2-4 a c}\right )+2 c^2 d^2\right ) \operatorname {Hypergeometric2F1}\left (1,\frac {3}{n},\frac {n+3}{n},-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{3 c \left (b-\sqrt {b^2-4 a c}\right )}}{2 c (n+3)}\right )}{\sqrt {b^2-4 a c}}-\frac {2 c \left (\frac {e x^3 \left (d+e x^n\right )}{2 c (n+3)}-\frac {\frac {e x^3 \left (e (n+3) \left (\sqrt {b^2-4 a c}+b\right )-2 c d (2 n+3)\right )}{6 c}-\frac {(n+3) x^3 \left (-2 c e \left (d \sqrt {b^2-4 a c}+a e+b d\right )+b e^2 \left (\sqrt {b^2-4 a c}+b\right )+2 c^2 d^2\right ) \operatorname {Hypergeometric2F1}\left (1,\frac {3}{n},\frac {n+3}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{3 c \left (\sqrt {b^2-4 a c}+b\right )}}{2 c (n+3)}\right )}{\sqrt {b^2-4 a c}}\)

Input:

Int[(x^2*(d + e*x^n)^2)/(a + b*x^n + c*x^(2*n)),x]
 

Output:

(2*c*((e*x^3*(d + e*x^n))/(2*c*(3 + n)) - ((e*((b - Sqrt[b^2 - 4*a*c])*e*( 
3 + n) - 2*c*d*(3 + 2*n))*x^3)/(6*c) - ((2*c^2*d^2 + b*(b - Sqrt[b^2 - 4*a 
*c])*e^2 - 2*c*e*(b*d - Sqrt[b^2 - 4*a*c]*d + a*e))*(3 + n)*x^3*Hypergeome 
tric2F1[1, 3/n, (3 + n)/n, (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c])])/(3*c*(b - 
Sqrt[b^2 - 4*a*c])))/(2*c*(3 + n))))/Sqrt[b^2 - 4*a*c] - (2*c*((e*x^3*(d + 
 e*x^n))/(2*c*(3 + n)) - ((e*((b + Sqrt[b^2 - 4*a*c])*e*(3 + n) - 2*c*d*(3 
 + 2*n))*x^3)/(6*c) - ((2*c^2*d^2 + b*(b + Sqrt[b^2 - 4*a*c])*e^2 - 2*c*e* 
(b*d + Sqrt[b^2 - 4*a*c]*d + a*e))*(3 + n)*x^3*Hypergeometric2F1[1, 3/n, ( 
3 + n)/n, (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])/(3*c*(b + Sqrt[b^2 - 4*a*c] 
)))/(2*c*(3 + n))))/Sqrt[b^2 - 4*a*c]
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 888
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p 
*((c*x)^(m + 1)/(c*(m + 1)))*Hypergeometric2F1[-p, (m + 1)/n, (m + 1)/n + 1 
, (-b)*(x^n/a)], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] && (ILt 
Q[p, 0] || GtQ[a, 0])
 

rule 959
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n 
_)), x_Symbol] :> Simp[d*(e*x)^(m + 1)*((a + b*x^n)^(p + 1)/(b*e*(m + n*(p 
+ 1) + 1))), x] - Simp[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m + n*(p 
 + 1) + 1))   Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, 
 n, p}, x] && NeQ[b*c - a*d, 0] && NeQ[m + n*(p + 1) + 1, 0]
 

rule 1008
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_ 
))^(q_), x_Symbol] :> Simp[d*(e*x)^(m + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n) 
^(q - 1)/(b*e*(m + n*(p + q) + 1))), x] + Simp[1/(b*(m + n*(p + q) + 1)) 
Int[(e*x)^m*(a + b*x^n)^p*(c + d*x^n)^(q - 2)*Simp[c*((c*b - a*d)*(m + 1) + 
 c*b*n*(p + q)) + (d*(c*b - a*d)*(m + 1) + d*n*(q - 1)*(b*c - a*d) + c*b*d* 
n*(p + q))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c 
 - a*d, 0] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]
 

rule 1880
Int[(((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(n_))^(q_))/((a_) + (c_.)*(x_)^( 
n2_.) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{r = Rt[b^2 - 4*a*c, 2]}, Simp[ 
2*(c/r)   Int[(f*x)^m*((d + e*x^n)^q/(b - r + 2*c*x^n)), x], x] - Simp[2*(c 
/r)   Int[(f*x)^m*((d + e*x^n)^q/(b + r + 2*c*x^n)), x], x]] /; FreeQ[{a, b 
, c, d, e, f, m, n, q}, x] && EqQ[n2, 2*n] && NeQ[b^2 - 4*a*c, 0] &&  !Rati 
onalQ[n]
 
Maple [F]

\[\int \frac {x^{2} \left (d +e \,x^{n}\right )^{2}}{a +b \,x^{n}+c \,x^{2 n}}d x\]

Input:

int(x^2*(d+e*x^n)^2/(a+b*x^n+c*x^(2*n)),x)
 

Output:

int(x^2*(d+e*x^n)^2/(a+b*x^n+c*x^(2*n)),x)
 

Fricas [F]

\[ \int \frac {x^2 \left (d+e x^n\right )^2}{a+b x^n+c x^{2 n}} \, dx=\int { \frac {{\left (e x^{n} + d\right )}^{2} x^{2}}{c x^{2 \, n} + b x^{n} + a} \,d x } \] Input:

integrate(x^2*(d+e*x^n)^2/(a+b*x^n+c*x^(2*n)),x, algorithm="fricas")
 

Output:

integral((e^2*x^2*x^(2*n) + 2*d*e*x^2*x^n + d^2*x^2)/(c*x^(2*n) + b*x^n + 
a), x)
 

Sympy [F(-2)]

Exception generated. \[ \int \frac {x^2 \left (d+e x^n\right )^2}{a+b x^n+c x^{2 n}} \, dx=\text {Exception raised: HeuristicGCDFailed} \] Input:

integrate(x**2*(d+e*x**n)**2/(a+b*x**n+c*x**(2*n)),x)
 

Output:

Exception raised: HeuristicGCDFailed >> no luck
 

Maxima [F]

\[ \int \frac {x^2 \left (d+e x^n\right )^2}{a+b x^n+c x^{2 n}} \, dx=\int { \frac {{\left (e x^{n} + d\right )}^{2} x^{2}}{c x^{2 \, n} + b x^{n} + a} \,d x } \] Input:

integrate(x^2*(d+e*x^n)^2/(a+b*x^n+c*x^(2*n)),x, algorithm="maxima")
 

Output:

1/3*e^2*x^3/c - integrate(-((2*c*d*e - b*e^2)*x^2*x^n + (c*d^2 - a*e^2)*x^ 
2)/(c^2*x^(2*n) + b*c*x^n + a*c), x)
 

Giac [F]

\[ \int \frac {x^2 \left (d+e x^n\right )^2}{a+b x^n+c x^{2 n}} \, dx=\int { \frac {{\left (e x^{n} + d\right )}^{2} x^{2}}{c x^{2 \, n} + b x^{n} + a} \,d x } \] Input:

integrate(x^2*(d+e*x^n)^2/(a+b*x^n+c*x^(2*n)),x, algorithm="giac")
 

Output:

integrate((e*x^n + d)^2*x^2/(c*x^(2*n) + b*x^n + a), x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {x^2 \left (d+e x^n\right )^2}{a+b x^n+c x^{2 n}} \, dx=\int \frac {x^2\,{\left (d+e\,x^n\right )}^2}{a+b\,x^n+c\,x^{2\,n}} \,d x \] Input:

int((x^2*(d + e*x^n)^2)/(a + b*x^n + c*x^(2*n)),x)
 

Output:

int((x^2*(d + e*x^n)^2)/(a + b*x^n + c*x^(2*n)), x)
 

Reduce [F]

\[ \int \frac {x^2 \left (d+e x^n\right )^2}{a+b x^n+c x^{2 n}} \, dx=\frac {-6 \left (\int \frac {x^{2}}{x^{2 n} c +x^{n} b +a}d x \right ) a d e +3 \left (\int \frac {x^{2}}{x^{2 n} c +x^{n} b +a}d x \right ) b \,d^{2}+3 \left (\int \frac {x^{2 n} x^{2}}{x^{2 n} c +x^{n} b +a}d x \right ) b \,e^{2}-6 \left (\int \frac {x^{2 n} x^{2}}{x^{2 n} c +x^{n} b +a}d x \right ) c d e +2 d e \,x^{3}}{3 b} \] Input:

int(x^2*(d+e*x^n)^2/(a+b*x^n+c*x^(2*n)),x)
 

Output:

( - 6*int(x**2/(x**(2*n)*c + x**n*b + a),x)*a*d*e + 3*int(x**2/(x**(2*n)*c 
 + x**n*b + a),x)*b*d**2 + 3*int((x**(2*n)*x**2)/(x**(2*n)*c + x**n*b + a) 
,x)*b*e**2 - 6*int((x**(2*n)*x**2)/(x**(2*n)*c + x**n*b + a),x)*c*d*e + 2* 
d*e*x**3)/(3*b)