\(\int x^{1+p} (a+b x)^p (a+2 b x)^q \, dx\) [622]

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

Optimal result

Integrand size = 21, antiderivative size = 164 \[ \int x^{1+p} (a+b x)^p (a+2 b x)^q \, dx=-\frac {a x^p (a+b x)^p (a+2 b x)^{1+q} \left (1-\frac {(a+2 b x)^2}{a^2}\right )^{-p} \operatorname {Hypergeometric2F1}\left (-p,\frac {1+q}{2},\frac {3+q}{2},\frac {(a+2 b x)^2}{a^2}\right )}{4 b^2 (1+q)}+\frac {x^p (a+b x)^p (a+2 b x)^{2+q} \left (1-\frac {(a+2 b x)^2}{a^2}\right )^{-p} \operatorname {Hypergeometric2F1}\left (-p,\frac {2+q}{2},\frac {4+q}{2},\frac {(a+2 b x)^2}{a^2}\right )}{4 b^2 (2+q)} \] Output:

-1/4*a*x^p*(b*x+a)^p*(2*b*x+a)^(1+q)*hypergeom([-p, 1/2+1/2*q],[3/2+1/2*q] 
,(2*b*x+a)^2/a^2)/b^2/(1+q)/((1-(2*b*x+a)^2/a^2)^p)+1/4*x^p*(b*x+a)^p*(2*b 
*x+a)^(2+q)*hypergeom([-p, 1+1/2*q],[2+1/2*q],(2*b*x+a)^2/a^2)/b^2/(2+q)/( 
(1-(2*b*x+a)^2/a^2)^p)
 

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 6 vs. order 5 in optimal.

Time = 0.10 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.49 \[ \int x^{1+p} (a+b x)^p (a+2 b x)^q \, dx=\frac {x^{2+p} (a+b x)^p \left (\frac {a+b x}{a}\right )^{-p} (a+2 b x)^q \left (\frac {a+2 b x}{a}\right )^{-q} \operatorname {AppellF1}\left (2+p,-p,-q,3+p,-\frac {b x}{a},-\frac {2 b x}{a}\right )}{2+p} \] Input:

Integrate[x^(1 + p)*(a + b*x)^p*(a + 2*b*x)^q,x]
 

Output:

(x^(2 + p)*(a + b*x)^p*(a + 2*b*x)^q*AppellF1[2 + p, -p, -q, 3 + p, -((b*x 
)/a), (-2*b*x)/a])/((2 + p)*((a + b*x)/a)^p*((a + 2*b*x)/a)^q)
 

Rubi [C] (verified)

Result contains higher order function than in optimal. Order 6 vs. order 5 in optimal.

Time = 0.25 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.48, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {152, 152, 150}

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 x^{p+1} (a+b x)^p (a+2 b x)^q \, dx\)

\(\Big \downarrow \) 152

\(\displaystyle (a+b x)^p \left (\frac {b x}{a}+1\right )^{-p} \int x^{p+1} (a+2 b x)^q \left (\frac {b x}{a}+1\right )^pdx\)

\(\Big \downarrow \) 152

\(\displaystyle (a+b x)^p \left (\frac {b x}{a}+1\right )^{-p} (a+2 b x)^q \left (\frac {2 b x}{a}+1\right )^{-q} \int x^{p+1} \left (\frac {b x}{a}+1\right )^p \left (\frac {2 b x}{a}+1\right )^qdx\)

\(\Big \downarrow \) 150

\(\displaystyle \frac {x^{p+2} (a+b x)^p \left (\frac {b x}{a}+1\right )^{-p} (a+2 b x)^q \left (\frac {2 b x}{a}+1\right )^{-q} \operatorname {AppellF1}\left (p+2,-p,-q,p+3,-\frac {b x}{a},-\frac {2 b x}{a}\right )}{p+2}\)

Input:

Int[x^(1 + p)*(a + b*x)^p*(a + 2*b*x)^q,x]
 

Output:

(x^(2 + p)*(a + b*x)^p*(a + 2*b*x)^q*AppellF1[2 + p, -p, -q, 3 + p, -((b*x 
)/a), (-2*b*x)/a])/((2 + p)*(1 + (b*x)/a)^p*(1 + (2*b*x)/a)^q)
 

Defintions of rubi rules used

rule 150
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_ 
] :> Simp[c^n*e^p*((b*x)^(m + 1)/(b*(m + 1)))*AppellF1[m + 1, -n, -p, m + 2 
, (-d)*(x/c), (-f)*(x/e)], x] /; FreeQ[{b, c, d, e, f, m, n, p}, x] &&  !In 
tegerQ[m] &&  !IntegerQ[n] && GtQ[c, 0] && (IntegerQ[p] || GtQ[e, 0])
 

rule 152
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_ 
] :> Simp[c^IntPart[n]*((c + d*x)^FracPart[n]/(1 + d*(x/c))^FracPart[n]) 
Int[(b*x)^m*(1 + d*(x/c))^n*(e + f*x)^p, x], x] /; FreeQ[{b, c, d, e, f, m, 
 n, p}, x] &&  !IntegerQ[m] &&  !IntegerQ[n] &&  !GtQ[c, 0]
 
Maple [F]

\[\int x^{p +1} \left (b x +a \right )^{p} \left (2 b x +a \right )^{q}d x\]

Input:

int(x^(p+1)*(b*x+a)^p*(2*b*x+a)^q,x)
 

Output:

int(x^(p+1)*(b*x+a)^p*(2*b*x+a)^q,x)
 

Fricas [F]

\[ \int x^{1+p} (a+b x)^p (a+2 b x)^q \, dx=\int { {\left (2 \, b x + a\right )}^{q} {\left (b x + a\right )}^{p} x^{p + 1} \,d x } \] Input:

integrate(x^(p+1)*(b*x+a)^p*(2*b*x+a)^q,x, algorithm="fricas")
 

Output:

integral((2*b*x + a)^q*(b*x + a)^p*x^(p + 1), x)
 

Sympy [F]

\[ \int x^{1+p} (a+b x)^p (a+2 b x)^q \, dx=\int x^{p + 1} \left (a + b x\right )^{p} \left (a + 2 b x\right )^{q}\, dx \] Input:

integrate(x**(p+1)*(b*x+a)**p*(2*b*x+a)**q,x)
 

Output:

Integral(x**(p + 1)*(a + b*x)**p*(a + 2*b*x)**q, x)
 

Maxima [F]

\[ \int x^{1+p} (a+b x)^p (a+2 b x)^q \, dx=\int { {\left (2 \, b x + a\right )}^{q} {\left (b x + a\right )}^{p} x^{p + 1} \,d x } \] Input:

integrate(x^(p+1)*(b*x+a)^p*(2*b*x+a)^q,x, algorithm="maxima")
 

Output:

integrate((2*b*x + a)^q*(b*x + a)^p*x^(p + 1), x)
 

Giac [F]

\[ \int x^{1+p} (a+b x)^p (a+2 b x)^q \, dx=\int { {\left (2 \, b x + a\right )}^{q} {\left (b x + a\right )}^{p} x^{p + 1} \,d x } \] Input:

integrate(x^(p+1)*(b*x+a)^p*(2*b*x+a)^q,x, algorithm="giac")
 

Output:

integrate((2*b*x + a)^q*(b*x + a)^p*x^(p + 1), x)
 

Mupad [F(-1)]

Timed out. \[ \int x^{1+p} (a+b x)^p (a+2 b x)^q \, dx=\int x^{p+1}\,{\left (a+b\,x\right )}^p\,{\left (a+2\,b\,x\right )}^q \,d x \] Input:

int(x^(p + 1)*(a + b*x)^p*(a + 2*b*x)^q,x)
 

Output:

int(x^(p + 1)*(a + b*x)^p*(a + 2*b*x)^q, x)
 

Reduce [F]

\[ \int x^{1+p} (a+b x)^p (a+2 b x)^q \, dx=\text {too large to display} \] Input:

int(x^(p+1)*(b*x+a)^p*(2*b*x+a)^q,x)
 

Output:

( - x**p*(a + 2*b*x)**q*(a + b*x)**p*a**2*p - x**p*(a + 2*b*x)**q*(a + b*x 
)**p*a**2 + 4*x**p*(a + 2*b*x)**q*(a + b*x)**p*a*b*p*x + 2*x**p*(a + 2*b*x 
)**q*(a + b*x)**p*a*b*q*x + 8*x**p*(a + 2*b*x)**q*(a + b*x)**p*b**2*p*x**2 
 + 4*x**p*(a + 2*b*x)**q*(a + b*x)**p*b**2*q*x**2 + 4*x**p*(a + 2*b*x)**q* 
(a + b*x)**p*b**2*x**2 - 16*int((x**p*(a + 2*b*x)**q*(a + b*x)**p*x)/(4*a* 
*2*p**2 + 4*a**2*p*q + 6*a**2*p + a**2*q**2 + 3*a**2*q + 2*a**2 + 12*a*b*p 
**2*x + 12*a*b*p*q*x + 18*a*b*p*x + 3*a*b*q**2*x + 9*a*b*q*x + 6*a*b*x + 8 
*b**2*p**2*x**2 + 8*b**2*p*q*x**2 + 12*b**2*p*x**2 + 2*b**2*q**2*x**2 + 6* 
b**2*q*x**2 + 4*b**2*x**2),x)*a**2*b**2*p**4 - 24*int((x**p*(a + 2*b*x)**q 
*(a + b*x)**p*x)/(4*a**2*p**2 + 4*a**2*p*q + 6*a**2*p + a**2*q**2 + 3*a**2 
*q + 2*a**2 + 12*a*b*p**2*x + 12*a*b*p*q*x + 18*a*b*p*x + 3*a*b*q**2*x + 9 
*a*b*q*x + 6*a*b*x + 8*b**2*p**2*x**2 + 8*b**2*p*q*x**2 + 12*b**2*p*x**2 + 
 2*b**2*q**2*x**2 + 6*b**2*q*x**2 + 4*b**2*x**2),x)*a**2*b**2*p**3*q - 40* 
int((x**p*(a + 2*b*x)**q*(a + b*x)**p*x)/(4*a**2*p**2 + 4*a**2*p*q + 6*a** 
2*p + a**2*q**2 + 3*a**2*q + 2*a**2 + 12*a*b*p**2*x + 12*a*b*p*q*x + 18*a* 
b*p*x + 3*a*b*q**2*x + 9*a*b*q*x + 6*a*b*x + 8*b**2*p**2*x**2 + 8*b**2*p*q 
*x**2 + 12*b**2*p*x**2 + 2*b**2*q**2*x**2 + 6*b**2*q*x**2 + 4*b**2*x**2),x 
)*a**2*b**2*p**3 - 12*int((x**p*(a + 2*b*x)**q*(a + b*x)**p*x)/(4*a**2*p** 
2 + 4*a**2*p*q + 6*a**2*p + a**2*q**2 + 3*a**2*q + 2*a**2 + 12*a*b*p**2*x 
+ 12*a*b*p*q*x + 18*a*b*p*x + 3*a*b*q**2*x + 9*a*b*q*x + 6*a*b*x + 8*b*...