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

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

Optimal result

Integrand size = 29, antiderivative size = 253 \[ \int \frac {\left (d+e x^n\right )^2}{x^4 \left (a+b x^n+c x^{2 n}\right )} \, dx=-\frac {e^2}{3 c x^3}-\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 ) \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 ) x^3}-\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 ) \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 ) x^3} \] Output:

-1/3*e^2/c/x^3-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))*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))/x^3-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))*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))/x^3
 

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(890\) vs. \(2(253)=506\).

Time = 3.70 (sec) , antiderivative size = 890, normalized size of antiderivative = 3.52 \[ \int \frac {\left (d+e x^n\right )^2}{x^4 \left (a+b x^n+c x^{2 n}\right )} \, dx=-\frac {\frac {e^2}{c}-\frac {8^{\frac {1}{n}} e (-2 c d+b e) \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 )}{c \sqrt {b^2-4 a c}}+\frac {8^{\frac {1}{n}} e (-2 c d+b e) \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 )}{c \sqrt {b^2-4 a c}}+\frac {3\ 2^{\frac {3+n}{n}} c d^2 \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}{n},\frac {3+n}{n},2+\frac {3}{n},\frac {b-\sqrt {b^2-4 a c}}{b-\sqrt {b^2-4 a c}+2 c x^n}\right )}{(3+n) \left (-b^2+4 a c+b \sqrt {b^2-4 a c}+2 c \sqrt {b^2-4 a c} x^n\right )}-\frac {3\ 2^{\frac {3+n}{n}} a e^2 \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}{n},\frac {3+n}{n},2+\frac {3}{n},\frac {b-\sqrt {b^2-4 a c}}{b-\sqrt {b^2-4 a c}+2 c x^n}\right )}{(3+n) \left (-b^2+4 a c+b \sqrt {b^2-4 a c}+2 c \sqrt {b^2-4 a c} x^n\right )}-\frac {3\ 2^{\frac {3+n}{n}} c d^2 \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}{n},\frac {3+n}{n},2+\frac {3}{n},\frac {b+\sqrt {b^2-4 a c}}{b+\sqrt {b^2-4 a c}+2 c x^n}\right )}{(3+n) \left (b^2-4 a c+b \sqrt {b^2-4 a c}+2 c \sqrt {b^2-4 a c} x^n\right )}+\frac {3\ 2^{\frac {3+n}{n}} a e^2 \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}{n},\frac {3+n}{n},2+\frac {3}{n},\frac {b+\sqrt {b^2-4 a c}}{b+\sqrt {b^2-4 a c}+2 c x^n}\right )}{(3+n) \left (b^2-4 a c+b \sqrt {b^2-4 a c}+2 c \sqrt {b^2-4 a c} x^n\right )}}{3 x^3} \] Input:

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

Output:

-1/3*(e^2/c - (8^n^(-1)*e*(-2*c*d + b*e)*((c*x^n)/(b - Sqrt[b^2 - 4*a*c] + 
 2*c*x^n))^(3/n)*Hypergeometric2F1[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*Sqrt[b^2 - 4*a*c]) + (8^n^(-1 
)*e*(-2*c*d + b*e)*((c*x^n)/(b + Sqrt[b^2 - 4*a*c] + 2*c*x^n))^(3/n)*Hyper 
geometric2F1[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*Sqrt[b^2 - 4*a*c]) + (3*2^((3 + n)/n)*c*d^2*((c*x^n 
)/(b - Sqrt[b^2 - 4*a*c] + 2*c*x^n))^(3/n)*Hypergeometric2F1[(3 + n)/n, (3 
 + n)/n, 2 + 3/n, (b - Sqrt[b^2 - 4*a*c])/(b - Sqrt[b^2 - 4*a*c] + 2*c*x^n 
)])/((3 + n)*(-b^2 + 4*a*c + b*Sqrt[b^2 - 4*a*c] + 2*c*Sqrt[b^2 - 4*a*c]*x 
^n)) - (3*2^((3 + n)/n)*a*e^2*((c*x^n)/(b - Sqrt[b^2 - 4*a*c] + 2*c*x^n))^ 
(3/n)*Hypergeometric2F1[(3 + n)/n, (3 + n)/n, 2 + 3/n, (b - Sqrt[b^2 - 4*a 
*c])/(b - Sqrt[b^2 - 4*a*c] + 2*c*x^n)])/((3 + n)*(-b^2 + 4*a*c + b*Sqrt[b 
^2 - 4*a*c] + 2*c*Sqrt[b^2 - 4*a*c]*x^n)) - (3*2^((3 + n)/n)*c*d^2*((c*x^n 
)/(b + Sqrt[b^2 - 4*a*c] + 2*c*x^n))^(3/n)*Hypergeometric2F1[(3 + n)/n, (3 
 + n)/n, 2 + 3/n, (b + Sqrt[b^2 - 4*a*c])/(b + Sqrt[b^2 - 4*a*c] + 2*c*x^n 
)])/((3 + n)*(b^2 - 4*a*c + b*Sqrt[b^2 - 4*a*c] + 2*c*Sqrt[b^2 - 4*a*c]*x^ 
n)) + (3*2^((3 + n)/n)*a*e^2*((c*x^n)/(b + Sqrt[b^2 - 4*a*c] + 2*c*x^n))^( 
3/n)*Hypergeometric2F1[(3 + n)/n, (3 + n)/n, 2 + 3/n, (b + Sqrt[b^2 - 4*a* 
c])/(b + Sqrt[b^2 - 4*a*c] + 2*c*x^n)])/((3 + n)*(b^2 - 4*a*c + b*Sqrt[b^2 
 - 4*a*c] + 2*c*Sqrt[b^2 - 4*a*c]*x^n)))/x^3
 

Rubi [A] (verified)

Time = 0.91 (sec) , antiderivative size = 453, normalized size of antiderivative = 1.79, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {1880, 1008, 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 {\left (d+e x^n\right )^2}{x^4 \left (a+b x^n+c x^{2 n}\right )} \, dx\)

\(\Big \downarrow \) 1880

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

\(\Big \downarrow \) 1008

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

\(\Big \downarrow \) 959

\(\displaystyle \frac {2 c \left (-\frac {\frac {e \left (2 c d (3-2 n)-e (3-n) \left (b-\sqrt {b^2-4 a c}\right )\right )}{6 c x^3}-\frac {(3-n) \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 {1}{x^4 \left (2 c x^n+b-\sqrt {b^2-4 a c}\right )}dx}{c}}{2 c (3-n)}-\frac {e \left (d+e x^n\right )}{2 c (3-n) x^3}\right )}{\sqrt {b^2-4 a c}}-\frac {2 c \left (-\frac {\frac {e \left (c d (6-4 n)-e (3-n) \left (\sqrt {b^2-4 a c}+b\right )\right )}{6 c x^3}-\frac {(3-n) \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 {1}{x^4 \left (2 c x^n+b+\sqrt {b^2-4 a c}\right )}dx}{c}}{2 c (3-n)}-\frac {e \left (d+e x^n\right )}{2 c (3-n) x^3}\right )}{\sqrt {b^2-4 a c}}\)

\(\Big \downarrow \) 888

\(\displaystyle \frac {2 c \left (-\frac {\frac {(3-n) \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 {3-n}{n},-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{3 c x^3 \left (b-\sqrt {b^2-4 a c}\right )}+\frac {e \left (2 c d (3-2 n)-e (3-n) \left (b-\sqrt {b^2-4 a c}\right )\right )}{6 c x^3}}{2 c (3-n)}-\frac {e \left (d+e x^n\right )}{2 c (3-n) x^3}\right )}{\sqrt {b^2-4 a c}}-\frac {2 c \left (-\frac {\frac {(3-n) \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 {3-n}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{3 c x^3 \left (\sqrt {b^2-4 a c}+b\right )}+\frac {e \left (c d (6-4 n)-e (3-n) \left (\sqrt {b^2-4 a c}+b\right )\right )}{6 c x^3}}{2 c (3-n)}-\frac {e \left (d+e x^n\right )}{2 c (3-n) x^3}\right )}{\sqrt {b^2-4 a c}}\)

Input:

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

Output:

(2*c*(-1/2*(e*(d + e*x^n))/(c*(3 - n)*x^3) - ((e*(2*c*d*(3 - 2*n) - (b - S 
qrt[b^2 - 4*a*c])*e*(3 - n)))/(6*c*x^3) + ((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)*Hypergeomet 
ric2F1[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])*x^3))/(2*c*(3 - n))))/Sqrt[b^2 - 4*a*c] - (2*c*(-1/2 
*(e*(d + e*x^n))/(c*(3 - n)*x^3) - ((e*(c*d*(6 - 4*n) - (b + Sqrt[b^2 - 4* 
a*c])*e*(3 - n)))/(6*c*x^3) + ((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)*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])*x^3))/(2*c*(3 - n))))/Sqrt[b^2 - 4*a*c]
 

Defintions of rubi rules used

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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