\(\int (a+b x^n+c x^{2 n})^p (A+B x^n+C x^{2 n}+D x^{3 n}) \, dx\) [35]

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

Optimal result

Integrand size = 38, antiderivative size = 556 \[ \int \left (a+b x^n+c x^{2 n}\right )^p \left (A+B x^n+C x^{2 n}+D x^{3 n}\right ) \, dx=-\frac {(b D (1+n (2+p))-c C (1+n (3+2 p))) x \left (a+b x^n+c x^{2 n}\right )^{1+p}}{c^2 (1+2 n (1+p)) (1+n (3+2 p))}+\frac {D x^{1+n} \left (a+b x^n+c x^{2 n}\right )^{1+p}}{c (1+3 n+2 n p)}-\frac {(c (1+2 n (1+p)) (a D (1+n)-B c (1+n (3+2 p)))-b (1+n+n p) (b D (1+n (2+p))-c C (1+n (3+2 p)))) x^{1+n} \left (1+\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )^{-p} \left (1+\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )^{-p} \left (a+b x^n+c x^{2 n}\right )^p \operatorname {AppellF1}\left (1+\frac {1}{n},-p,-p,2+\frac {1}{n},-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{c^2 (1+n) (1+2 n (1+p)) (1+n (3+2 p))}+\frac {\left (A c^2 (1+2 n (1+p)) (1+n (3+2 p))+a (b D (1+n (2+p))-c C (1+n (3+2 p)))\right ) x \left (1+\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )^{-p} \left (1+\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )^{-p} \left (a+b x^n+c x^{2 n}\right )^p \operatorname {AppellF1}\left (\frac {1}{n},-p,-p,1+\frac {1}{n},-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{c^2 (1+2 n (1+p)) (1+n (3+2 p))} \] Output:

-(b*D*(1+n*(2+p))-c*C*(1+n*(3+2*p)))*x*(a+b*x^n+c*x^(2*n))^(p+1)/c^2/(1+2* 
n*(p+1))/(1+n*(3+2*p))+D*x^(1+n)*(a+b*x^n+c*x^(2*n))^(p+1)/c/(2*n*p+3*n+1) 
-(c*(1+2*n*(p+1))*(a*D*(1+n)-B*c*(1+n*(3+2*p)))-b*(n*p+n+1)*(b*D*(1+n*(2+p 
))-c*C*(1+n*(3+2*p))))*x^(1+n)*(a+b*x^n+c*x^(2*n))^p*AppellF1(1+1/n,-p,-p, 
2+1/n,-2*c*x^n/(b-(-4*a*c+b^2)^(1/2)),-2*c*x^n/(b+(-4*a*c+b^2)^(1/2)))/c^2 
/(1+n)/(1+2*n*(p+1))/(1+n*(3+2*p))/((1+2*c*x^n/(b-(-4*a*c+b^2)^(1/2)))^p)/ 
((1+2*c*x^n/(b+(-4*a*c+b^2)^(1/2)))^p)+(A*c^2*(1+2*n*(p+1))*(1+n*(3+2*p))+ 
a*(b*D*(1+n*(2+p))-c*C*(1+n*(3+2*p))))*x*(a+b*x^n+c*x^(2*n))^p*AppellF1(1/ 
n,-p,-p,1+1/n,-2*c*x^n/(b-(-4*a*c+b^2)^(1/2)),-2*c*x^n/(b+(-4*a*c+b^2)^(1/ 
2)))/c^2/(1+2*n*(p+1))/(1+n*(3+2*p))/((1+2*c*x^n/(b-(-4*a*c+b^2)^(1/2)))^p 
)/((1+2*c*x^n/(b+(-4*a*c+b^2)^(1/2)))^p)
 

Mathematica [A] (warning: unable to verify)

Time = 1.55 (sec) , antiderivative size = 426, normalized size of antiderivative = 0.77 \[ \int \left (a+b x^n+c x^{2 n}\right )^p \left (A+B x^n+C x^{2 n}+D x^{3 n}\right ) \, dx=\frac {x \left (\frac {b-\sqrt {b^2-4 a c}+2 c x^n}{b-\sqrt {b^2-4 a c}}\right )^{-p} \left (\frac {b+\sqrt {b^2-4 a c}+2 c x^n}{b+\sqrt {b^2-4 a c}}\right )^{-p} \left (a+x^n \left (b+c x^n\right )\right )^p \left (B \left (1+5 n+6 n^2\right ) x^n \operatorname {AppellF1}\left (1+\frac {1}{n},-p,-p,2+\frac {1}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}},\frac {2 c x^n}{-b+\sqrt {b^2-4 a c}}\right )+(1+n) \left (C (1+3 n) x^{2 n} \operatorname {AppellF1}\left (2+\frac {1}{n},-p,-p,3+\frac {1}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}},\frac {2 c x^n}{-b+\sqrt {b^2-4 a c}}\right )+(1+2 n) \left (D x^{3 n} \operatorname {AppellF1}\left (3+\frac {1}{n},-p,-p,4+\frac {1}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}},\frac {2 c x^n}{-b+\sqrt {b^2-4 a c}}\right )+A (1+3 n) \operatorname {AppellF1}\left (\frac {1}{n},-p,-p,1+\frac {1}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}},\frac {2 c x^n}{-b+\sqrt {b^2-4 a c}}\right )\right )\right )\right )}{(1+n) (1+2 n) (1+3 n)} \] Input:

Integrate[(a + b*x^n + c*x^(2*n))^p*(A + B*x^n + C*x^(2*n) + D*x^(3*n)),x]
 

Output:

(x*(a + x^n*(b + c*x^n))^p*(B*(1 + 5*n + 6*n^2)*x^n*AppellF1[1 + n^(-1), - 
p, -p, 2 + n^(-1), (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c]), (2*c*x^n)/(-b + Sqr 
t[b^2 - 4*a*c])] + (1 + n)*(C*(1 + 3*n)*x^(2*n)*AppellF1[2 + n^(-1), -p, - 
p, 3 + n^(-1), (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c]), (2*c*x^n)/(-b + Sqrt[b^ 
2 - 4*a*c])] + (1 + 2*n)*(D*x^(3*n)*AppellF1[3 + n^(-1), -p, -p, 4 + n^(-1 
), (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c]), (2*c*x^n)/(-b + Sqrt[b^2 - 4*a*c])] 
 + A*(1 + 3*n)*AppellF1[n^(-1), -p, -p, 1 + n^(-1), (-2*c*x^n)/(b + Sqrt[b 
^2 - 4*a*c]), (2*c*x^n)/(-b + Sqrt[b^2 - 4*a*c])]))))/((1 + n)*(1 + 2*n)*( 
1 + 3*n)*((b - Sqrt[b^2 - 4*a*c] + 2*c*x^n)/(b - Sqrt[b^2 - 4*a*c]))^p*((b 
 + Sqrt[b^2 - 4*a*c] + 2*c*x^n)/(b + Sqrt[b^2 - 4*a*c]))^p)
 

Rubi [F]

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 \left (a+b x^n+c x^{2 n}\right )^p \left (A+B x^n+C x^{2 n}+D x^{3 n}\right ) \, dx\)

\(\Big \downarrow \) 2329

\(\displaystyle \int \left (a+b x^n+c x^{2 n}\right )^p \left (A+B x^n+C x^{2 n}+D x^{3 n}\right )dx\)

Input:

Int[(a + b*x^n + c*x^(2*n))^p*(A + B*x^n + C*x^(2*n) + D*x^(3*n)),x]
 

Output:

$Aborted
 

Defintions of rubi rules used

rule 2329
Int[(Pq_)*((a_) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.))^(p_.), x_Symbol] :> 
 Unintegrable[Pq*(a + b*x^n + c*x^(2*n))^p, x] /; FreeQ[{a, b, c, n, p}, x] 
 && EqQ[n2, 2*n] && (PolyQ[Pq, x] || PolyQ[Pq, x^n])
 
Maple [F]

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

Input:

int((a+b*x^n+c*x^(2*n))^p*(A+B*x^n+C*x^(2*n)+D*x^(3*n)),x)
 

Output:

int((a+b*x^n+c*x^(2*n))^p*(A+B*x^n+C*x^(2*n)+D*x^(3*n)),x)
 

Fricas [F]

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

integrate((a+b*x^n+c*x^(2*n))^p*(A+B*x^n+C*x^(2*n)+D*x^(3*n)),x, algorithm 
="fricas")
 

Output:

integral((D*x^(3*n) + C*x^(2*n) + B*x^n + A)*(c*x^(2*n) + b*x^n + a)^p, x)
 

Sympy [F(-1)]

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

integrate((a+b*x**n+c*x**(2*n))**p*(A+B*x**n+C*x**(2*n)+D*x**(3*n)),x)
 

Output:

Timed out
 

Maxima [F]

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

integrate((a+b*x^n+c*x^(2*n))^p*(A+B*x^n+C*x^(2*n)+D*x^(3*n)),x, algorithm 
="maxima")
 

Output:

integrate((D*x^(3*n) + C*x^(2*n) + B*x^n + A)*(c*x^(2*n) + b*x^n + a)^p, x 
)
 

Giac [F(-2)]

Exception generated. \[ \int \left (a+b x^n+c x^{2 n}\right )^p \left (A+B x^n+C x^{2 n}+D x^{3 n}\right ) \, dx=\text {Exception raised: TypeError} \] Input:

integrate((a+b*x^n+c*x^(2*n))^p*(A+B*x^n+C*x^(2*n)+D*x^(3*n)),x, algorithm 
="giac")
 

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Unable to divide, perhaps due to ro 
unding error%%%{512,[1,0,7,4,9,5,1,8,0,0,0,1]%%%}+%%%{-1024,[1,0,7,4,9,5,0 
,9,0,0,1,
 

Mupad [F(-1)]

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

int((a + b*x^n + c*x^(2*n))^p*(A + C*x^(2*n) + x^(3*n)*D + B*x^n),x)
 

Output:

int((a + b*x^n + c*x^(2*n))^p*(A + C*x^(2*n) + x^(3*n)*D + B*x^n), x)
 

Reduce [F]

\[ \int \left (a+b x^n+c x^{2 n}\right )^p \left (A+B x^n+C x^{2 n}+D x^{3 n}\right ) \, dx=\text {too large to display} \] Input:

int((a+b*x^n+c*x^(2*n))^p*(A+B*x^n+C*x^(2*n)+D*x^(3*n)),x)
 

Output:

(4*x**(3*n)*(x**(2*n)*c + x**n*b + a)**p*b*c**2*d*n**3*p**3*x + 6*x**(3*n) 
*(x**(2*n)*c + x**n*b + a)**p*b*c**2*d*n**3*p**2*x + 2*x**(3*n)*(x**(2*n)* 
c + x**n*b + a)**p*b*c**2*d*n**3*p*x + 8*x**(3*n)*(x**(2*n)*c + x**n*b + a 
)**p*b*c**2*d*n**2*p**2*x + 9*x**(3*n)*(x**(2*n)*c + x**n*b + a)**p*b*c**2 
*d*n**2*p*x + 2*x**(3*n)*(x**(2*n)*c + x**n*b + a)**p*b*c**2*d*n**2*x + 5* 
x**(3*n)*(x**(2*n)*c + x**n*b + a)**p*b*c**2*d*n*p*x + 3*x**(3*n)*(x**(2*n 
)*c + x**n*b + a)**p*b*c**2*d*n*x + x**(3*n)*(x**(2*n)*c + x**n*b + a)**p* 
b*c**2*d*x + 2*x**(2*n)*(x**(2*n)*c + x**n*b + a)**p*b**2*c*d*n**3*p**3*x 
+ x**(2*n)*(x**(2*n)*c + x**n*b + a)**p*b**2*c*d*n**3*p**2*x + 3*x**(2*n)* 
(x**(2*n)*c + x**n*b + a)**p*b**2*c*d*n**2*p**2*x + x**(2*n)*(x**(2*n)*c + 
 x**n*b + a)**p*b**2*c*d*n**2*p*x + x**(2*n)*(x**(2*n)*c + x**n*b + a)**p* 
b**2*c*d*n*p*x + 4*x**(2*n)*(x**(2*n)*c + x**n*b + a)**p*b*c**3*n**3*p**3* 
x + 8*x**(2*n)*(x**(2*n)*c + x**n*b + a)**p*b*c**3*n**3*p**2*x + 3*x**(2*n 
)*(x**(2*n)*c + x**n*b + a)**p*b*c**3*n**3*p*x + 8*x**(2*n)*(x**(2*n)*c + 
x**n*b + a)**p*b*c**3*n**2*p**2*x + 12*x**(2*n)*(x**(2*n)*c + x**n*b + a)* 
*p*b*c**3*n**2*p*x + 3*x**(2*n)*(x**(2*n)*c + x**n*b + a)**p*b*c**3*n**2*x 
 + 5*x**(2*n)*(x**(2*n)*c + x**n*b + a)**p*b*c**3*n*p*x + 4*x**(2*n)*(x**( 
2*n)*c + x**n*b + a)**p*b*c**3*n*x + x**(2*n)*(x**(2*n)*c + x**n*b + a)**p 
*b*c**3*x + 4*x**n*(x**(2*n)*c + x**n*b + a)**p*a*b*c*d*n**3*p**3*x + 4*x* 
*n*(x**(2*n)*c + x**n*b + a)**p*a*b*c*d*n**3*p**2*x + 6*x**n*(x**(2*n)*...