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

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 1.98 (sec) , antiderivative size = 306, normalized size of antiderivative = 0.89 \[ \int \frac {A+B x^n+C x^{2 n}}{\left (d+e x^n\right ) \left (a+b x^n+c x^{2 n}\right )} \, dx=\frac {x \left (\frac {\left (B c d-b C d-A c e+a C e+\frac {b^2 C d+2 c (A c d-a C d+a B e)-b (B c d+A c e+a C e)}{\sqrt {b^2-4 a c}}\right ) \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},\frac {2 c x^n}{-b+\sqrt {b^2-4 a c}}\right )}{b-\sqrt {b^2-4 a c}}+\frac {\left (B c d-b C d-A c e+a C e+\frac {-b^2 C d-2 c (A c d-a C d+a B e)+b (B c d+A c e+a C e)}{\sqrt {b^2-4 a c}}\right ) \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{b+\sqrt {b^2-4 a c}}+\frac {\left (C d^2+e (-B d+A e)\right ) \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},-\frac {e x^n}{d}\right )}{d}\right )}{c d^2+e (-b d+a e)} \] Input:

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

Output:

(x*(((B*c*d - b*C*d - A*c*e + a*C*e + (b^2*C*d + 2*c*(A*c*d - a*C*d + a*B* 
e) - b*(B*c*d + A*c*e + a*C*e))/Sqrt[b^2 - 4*a*c])*Hypergeometric2F1[1, n^ 
(-1), 1 + n^(-1), (2*c*x^n)/(-b + Sqrt[b^2 - 4*a*c])])/(b - Sqrt[b^2 - 4*a 
*c]) + ((B*c*d - b*C*d - A*c*e + a*C*e + (-(b^2*C*d) - 2*c*(A*c*d - a*C*d 
+ a*B*e) + b*(B*c*d + A*c*e + a*C*e))/Sqrt[b^2 - 4*a*c])*Hypergeometric2F1 
[1, n^(-1), 1 + n^(-1), (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])/(b + Sqrt[b^2 
 - 4*a*c]) + ((C*d^2 + e*(-(B*d) + A*e))*Hypergeometric2F1[1, n^(-1), 1 + 
n^(-1), -((e*x^n)/d)])/d))/(c*d^2 + e*(-(b*d) + a*e))
 

Rubi [A] (verified)

Time = 1.25 (sec) , antiderivative size = 345, 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.050, Rules used = {7293, 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 {A+B x^n+C x^{2 n}}{\left (d+e x^n\right ) \left (a+b x^n+c x^{2 n}\right )} \, dx\)

\(\Big \downarrow \) 7293

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

((B*c*d - b*C*d - A*c*e + a*C*e + (b^2*C*d + 2*c*(A*c*d - a*C*d + a*B*e) - 
 b*(B*c*d + A*c*e + a*C*e))/Sqrt[b^2 - 4*a*c])*x*Hypergeometric2F1[1, n^(- 
1), 1 + n^(-1), (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c])])/((b - Sqrt[b^2 - 4*a* 
c])*(c*d^2 - b*d*e + a*e^2)) + ((B*c*d - b*C*d - A*c*e + a*C*e - (b^2*C*d 
+ 2*c*(A*c*d - a*C*d + a*B*e) - b*(B*c*d + A*c*e + a*C*e))/Sqrt[b^2 - 4*a* 
c])*x*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), (-2*c*x^n)/(b + Sqrt[b^2 - 
4*a*c])])/((b + Sqrt[b^2 - 4*a*c])*(c*d^2 - b*d*e + a*e^2)) + ((C*d^2 - e* 
(B*d - A*e))*x*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), -((e*x^n)/d)])/(d* 
(c*d^2 - b*d*e + a*e^2))
 

Defintions of rubi rules used

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

rule 7293
Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v] 
]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F(-2)]

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

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

Output:

Exception raised: HeuristicGCDFailed >> no luck
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

int(1/(x**n*e + d),x)