\(\int (a+\frac {b}{x})^p (c+\frac {d}{x})^q \, dx\) [49]

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

Optimal result

Integrand size = 19, antiderivative size = 95 \[ \int \left (a+\frac {b}{x}\right )^p \left (c+\frac {d}{x}\right )^q \, dx=-\frac {b \left (a+\frac {b}{x}\right )^{1+p} \left (c+\frac {d}{x}\right )^q \left (\frac {b \left (c+\frac {d}{x}\right )}{b c-a d}\right )^{-q} \operatorname {AppellF1}\left (1+p,2,-q,2+p,1+\frac {b}{a x},-\frac {d \left (a+\frac {b}{x}\right )}{b c-a d}\right )}{a^2 (1+p)} \] Output:

-b*(a+b/x)^(p+1)*(c+d/x)^q*AppellF1(p+1,-q,2,2+p,-d*(a+b/x)/(-a*d+b*c),1+b 
/a/x)/a^2/(p+1)/((b*(c+d/x)/(-a*d+b*c))^q)
 

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(206\) vs. \(2(95)=190\).

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

Integrate[(a + b/x)^p*(c + d/x)^q,x]
 

Output:

(b*d*(-2 + p + q)*(a + b/x)^p*(c + d/x)^q*x*AppellF1[1 - p - q, -p, -q, 2 
- p - q, -((a*x)/b), -((c*x)/d)])/((-1 + p + q)*(-(b*d*(-2 + p + q)*Appell 
F1[1 - p - q, -p, -q, 2 - p - q, -((a*x)/b), -((c*x)/d)]) + x*(a*d*p*Appel 
lF1[2 - p - q, 1 - p, -q, 3 - p - q, -((a*x)/b), -((c*x)/d)] + b*c*q*Appel 
lF1[2 - p - q, -p, 1 - q, 3 - p - q, -((a*x)/b), -((c*x)/d)])))
 

Rubi [A] (verified)

Time = 0.39 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.01, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {899, 154, 153}

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+\frac {b}{x}\right )^p \left (c+\frac {d}{x}\right )^q \, dx\)

\(\Big \downarrow \) 899

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

\(\Big \downarrow \) 154

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

\(\Big \downarrow \) 153

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

Input:

Int[(a + b/x)^p*(c + d/x)^q,x]
 

Output:

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

Defintions of rubi rules used

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

rule 154
Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_)) 
^(p_), x_] :> Simp[(c + d*x)^FracPart[n]/(Simplify[b/(b*c - a*d)]^IntPart[n 
]*(b*((c + d*x)/(b*c - a*d)))^FracPart[n])   Int[(a + b*x)^m*Simp[b*(c/(b*c 
 - a*d)) + b*d*(x/(b*c - a*d)), x]^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, 
 d, e, f, m, n}, x] &&  !IntegerQ[m] &&  !IntegerQ[n] && IntegerQ[p] &&  !G 
tQ[Simplify[b/(b*c - a*d)], 0] &&  !SimplerQ[c + d*x, a + b*x]
 

rule 899
Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol 
] :> -Subst[Int[(a + b/x^n)^p*((c + d/x^n)^q/x^2), x], x, 1/x] /; FreeQ[{a, 
 b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && ILtQ[n, 0]
 
Maple [F]

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

Input:

int((a+b/x)^p*(c+1/x*d)^q,x)
 

Output:

int((a+b/x)^p*(c+1/x*d)^q,x)
 

Fricas [F]

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

integrate((a+b/x)^p*(c+d/x)^q,x, algorithm="fricas")
 

Output:

integral(((a*x + b)/x)^p*((c*x + d)/x)^q, x)
 

Sympy [F]

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

integrate((a+b/x)**p*(c+d/x)**q,x)
 

Output:

Integral((a + b/x)**p*(c + d/x)**q, x)
 

Maxima [F]

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

integrate((a+b/x)^p*(c+d/x)^q,x, algorithm="maxima")
 

Output:

integrate((a + b/x)^p*(c + d/x)^q, x)
 

Giac [F]

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

integrate((a+b/x)^p*(c+d/x)^q,x, algorithm="giac")
 

Output:

integrate((a + b/x)^p*(c + d/x)^q, x)
 

Mupad [F(-1)]

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

int((a + b/x)^p*(c + d/x)^q,x)
 

Output:

int((a + b/x)^p*(c + d/x)^q, x)
 

Reduce [F]

\[ \int \left (a+\frac {b}{x}\right )^p \left (c+\frac {d}{x}\right )^q \, dx=\text {too large to display} \] Input:

int((a+b/x)^p*(c+d/x)^q,x)
 

Output:

((c*x + d)**q*(a*x + b)**p*a*d*q*x + (c*x + d)**q*(a*x + b)**p*b*c*p*x - ( 
c*x + d)**q*(a*x + b)**p*b*d*p - (c*x + d)**q*(a*x + b)**p*b*d*q + x**(p + 
 q)*int(((c*x + d)**q*(a*x + b)**p*x)/(x**(p + q)*a**2*c*d*q*x**2 + x**(p 
+ q)*a**2*d**2*q*x + x**(p + q)*a*b*c**2*p*x**2 + x**(p + q)*a*b*c*d*p*x + 
 x**(p + q)*a*b*c*d*q*x + x**(p + q)*a*b*d**2*q + x**(p + q)*b**2*c**2*p*x 
 + x**(p + q)*b**2*c*d*p),x)*a**3*d**3*q**3 + 3*x**(p + q)*int(((c*x + d)* 
*q*(a*x + b)**p*x)/(x**(p + q)*a**2*c*d*q*x**2 + x**(p + q)*a**2*d**2*q*x 
+ x**(p + q)*a*b*c**2*p*x**2 + x**(p + q)*a*b*c*d*p*x + x**(p + q)*a*b*c*d 
*q*x + x**(p + q)*a*b*d**2*q + x**(p + q)*b**2*c**2*p*x + x**(p + q)*b**2* 
c*d*p),x)*a**2*b*c*d**2*p*q**2 + 3*x**(p + q)*int(((c*x + d)**q*(a*x + b)* 
*p*x)/(x**(p + q)*a**2*c*d*q*x**2 + x**(p + q)*a**2*d**2*q*x + x**(p + q)* 
a*b*c**2*p*x**2 + x**(p + q)*a*b*c*d*p*x + x**(p + q)*a*b*c*d*q*x + x**(p 
+ q)*a*b*d**2*q + x**(p + q)*b**2*c**2*p*x + x**(p + q)*b**2*c*d*p),x)*a*b 
**2*c**2*d*p**2*q + x**(p + q)*int(((c*x + d)**q*(a*x + b)**p*x)/(x**(p + 
q)*a**2*c*d*q*x**2 + x**(p + q)*a**2*d**2*q*x + x**(p + q)*a*b*c**2*p*x**2 
 + x**(p + q)*a*b*c*d*p*x + x**(p + q)*a*b*c*d*q*x + x**(p + q)*a*b*d**2*q 
 + x**(p + q)*b**2*c**2*p*x + x**(p + q)*b**2*c*d*p),x)*b**3*c**3*p**3 - x 
**(p + q)*int(((c*x + d)**q*(a*x + b)**p)/(x**(p + q)*a**2*c*d*q*x**3 + x* 
*(p + q)*a**2*d**2*q*x**2 + x**(p + q)*a*b*c**2*p*x**3 + x**(p + q)*a*b*c* 
d*p*x**2 + x**(p + q)*a*b*c*d*q*x**2 + x**(p + q)*a*b*d**2*q*x + x**(p ...