\(\int \frac {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx\) [8]

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

Optimal result

Integrand size = 21, antiderivative size = 104 \[ \int \frac {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx=\frac {\sqrt {a+\frac {b}{x}} x}{c}+\frac {2 \sqrt {d} \sqrt {b c-a d} \arctan \left (\frac {\sqrt {d} \sqrt {a+\frac {b}{x}}}{\sqrt {b c-a d}}\right )}{c^2}+\frac {(b c-2 a d) \text {arctanh}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{\sqrt {a} c^2} \] Output:

(a+b/x)^(1/2)*x/c+2*d^(1/2)*(-a*d+b*c)^(1/2)*arctan(d^(1/2)*(a+b/x)^(1/2)/ 
(-a*d+b*c)^(1/2))/c^2+(-2*a*d+b*c)*arctanh((a+b/x)^(1/2)/a^(1/2))/a^(1/2)/ 
c^2
                                                                                    
                                                                                    
 

Mathematica [A] (verified)

Time = 0.34 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.96 \[ \int \frac {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx=\frac {c \sqrt {a+\frac {b}{x}} x+2 \sqrt {d} \sqrt {b c-a d} \arctan \left (\frac {\sqrt {d} \sqrt {a+\frac {b}{x}}}{\sqrt {b c-a d}}\right )+\frac {(b c-2 a d) \text {arctanh}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{\sqrt {a}}}{c^2} \] Input:

Integrate[Sqrt[a + b/x]/(c + d/x),x]
 

Output:

(c*Sqrt[a + b/x]*x + 2*Sqrt[d]*Sqrt[b*c - a*d]*ArcTan[(Sqrt[d]*Sqrt[a + b/ 
x])/Sqrt[b*c - a*d]] + ((b*c - 2*a*d)*ArcTanh[Sqrt[a + b/x]/Sqrt[a]])/Sqrt 
[a])/c^2
 

Rubi [A] (verified)

Time = 0.50 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.09, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {899, 110, 27, 174, 73, 218, 221}

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 {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx\)

\(\Big \downarrow \) 899

\(\displaystyle -\int \frac {\sqrt {a+\frac {b}{x}} x^2}{c+\frac {d}{x}}d\frac {1}{x}\)

\(\Big \downarrow \) 110

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 174

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

\(\Big \downarrow \) 73

\(\displaystyle \frac {x \sqrt {a+\frac {b}{x}}}{c}-\frac {\frac {2 (b c-2 a d) \int \frac {1}{\frac {1}{b x^2}-\frac {a}{b}}d\sqrt {a+\frac {b}{x}}}{b c}-\frac {4 d (b c-a d) \int \frac {1}{c-\frac {a d}{b}+\frac {d}{b x^2}}d\sqrt {a+\frac {b}{x}}}{b c}}{2 c}\)

\(\Big \downarrow \) 218

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

\(\Big \downarrow \) 221

\(\displaystyle \frac {x \sqrt {a+\frac {b}{x}}}{c}-\frac {-\frac {4 \sqrt {d} \sqrt {b c-a d} \arctan \left (\frac {\sqrt {d} \sqrt {a+\frac {b}{x}}}{\sqrt {b c-a d}}\right )}{c}-\frac {2 \text {arctanh}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right ) (b c-2 a d)}{\sqrt {a} c}}{2 c}\)

Input:

Int[Sqrt[a + b/x]/(c + d/x),x]
 

Output:

(Sqrt[a + b/x]*x)/c - ((-4*Sqrt[d]*Sqrt[b*c - a*d]*ArcTan[(Sqrt[d]*Sqrt[a 
+ b/x])/Sqrt[b*c - a*d]])/c - (2*(b*c - 2*a*d)*ArcTanh[Sqrt[a + b/x]/Sqrt[ 
a]])/(Sqrt[a]*c))/(2*c)
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, x]
 

rule 110
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_), x_] :> Simp[(a + b*x)^(m + 1)*(c + d*x)^n*((e + f*x)^(p + 1)/((m + 
1)*(b*e - a*f))), x] - Simp[1/((m + 1)*(b*e - a*f))   Int[(a + b*x)^(m + 1) 
*(c + d*x)^(n - 1)*(e + f*x)^p*Simp[d*e*n + c*f*(m + p + 2) + d*f*(m + n + 
p + 2)*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && LtQ[m, -1] && Gt 
Q[n, 0] && (IntegersQ[2*m, 2*n, 2*p] || IntegersQ[m, n + p] || IntegersQ[p, 
 m + n])
 

rule 174
Int[(((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)))/(((a_.) + (b_.)*(x_))* 
((c_.) + (d_.)*(x_))), x_] :> Simp[(b*g - a*h)/(b*c - a*d)   Int[(e + f*x)^ 
p/(a + b*x), x], x] - Simp[(d*g - c*h)/(b*c - a*d)   Int[(e + f*x)^p/(c + d 
*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, h}, x]
 

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

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 [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(231\) vs. \(2(86)=172\).

Time = 0.51 (sec) , antiderivative size = 232, normalized size of antiderivative = 2.23

method result size
risch \(\frac {x \sqrt {\frac {a x +b}{x}}}{c}-\frac {\left (\frac {\left (2 a d -b c \right ) \ln \left (\frac {\frac {b}{2}+a x}{\sqrt {a}}+\sqrt {a \,x^{2}+b x}\right )}{c \sqrt {a}}+\frac {2 \left (a d -b c \right ) d \ln \left (\frac {\frac {2 \left (a d -b c \right ) d}{c^{2}}-\frac {\left (2 a d -b c \right ) \left (x +\frac {d}{c}\right )}{c}+2 \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}\, \sqrt {a \left (x +\frac {d}{c}\right )^{2}-\frac {\left (2 a d -b c \right ) \left (x +\frac {d}{c}\right )}{c}+\frac {\left (a d -b c \right ) d}{c^{2}}}}{x +\frac {d}{c}}\right )}{c^{2} \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}}\right ) \sqrt {\frac {a x +b}{x}}\, \sqrt {x \left (a x +b \right )}}{2 c \left (a x +b \right )}\) \(232\)
default \(-\frac {\sqrt {\frac {a x +b}{x}}\, x \left (2 a^{\frac {3}{2}} \ln \left (\frac {2 \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}\, \sqrt {x \left (a x +b \right )}\, c -2 a d x +b c x -b d}{c x +d}\right ) d^{2}-2 \sqrt {x \left (a x +b \right )}\, c^{2} \sqrt {a}\, \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}-2 \sqrt {a}\, \ln \left (\frac {2 \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}\, \sqrt {x \left (a x +b \right )}\, c -2 a d x +b c x -b d}{c x +d}\right ) b c d +2 \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}\, \ln \left (\frac {2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a c d -\sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}\, \ln \left (\frac {2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) b \,c^{2}\right )}{2 \sqrt {x \left (a x +b \right )}\, c^{3} \sqrt {a}\, \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}}\) \(287\)

Input:

int((a+b/x)^(1/2)/(c+1/x*d),x,method=_RETURNVERBOSE)
 

Output:

1/c*x*((a*x+b)/x)^(1/2)-1/2/c*((2*a*d-b*c)/c*ln((1/2*b+a*x)/a^(1/2)+(a*x^2 
+b*x)^(1/2))/a^(1/2)+2*(a*d-b*c)*d/c^2/((a*d-b*c)*d/c^2)^(1/2)*ln((2*(a*d- 
b*c)*d/c^2-(2*a*d-b*c)/c*(x+1/c*d)+2*((a*d-b*c)*d/c^2)^(1/2)*(a*(x+1/c*d)^ 
2-(2*a*d-b*c)/c*(x+1/c*d)+(a*d-b*c)*d/c^2)^(1/2))/(x+1/c*d)))*((a*x+b)/x)^ 
(1/2)*(x*(a*x+b))^(1/2)/(a*x+b)
 

Fricas [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 492, normalized size of antiderivative = 4.73 \[ \int \frac {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx=\left [\frac {2 \, a c x \sqrt {\frac {a x + b}{x}} - {\left (b c - 2 \, a d\right )} \sqrt {a} \log \left (2 \, a x - 2 \, \sqrt {a} x \sqrt {\frac {a x + b}{x}} + b\right ) + 2 \, \sqrt {-b c d + a d^{2}} a \log \left (\frac {b d - {\left (b c - 2 \, a d\right )} x + 2 \, \sqrt {-b c d + a d^{2}} x \sqrt {\frac {a x + b}{x}}}{c x + d}\right )}{2 \, a c^{2}}, \frac {2 \, a c x \sqrt {\frac {a x + b}{x}} - 4 \, \sqrt {b c d - a d^{2}} a \arctan \left (\frac {\sqrt {b c d - a d^{2}} x \sqrt {\frac {a x + b}{x}}}{a d x + b d}\right ) - {\left (b c - 2 \, a d\right )} \sqrt {a} \log \left (2 \, a x - 2 \, \sqrt {a} x \sqrt {\frac {a x + b}{x}} + b\right )}{2 \, a c^{2}}, \frac {a c x \sqrt {\frac {a x + b}{x}} - {\left (b c - 2 \, a d\right )} \sqrt {-a} \arctan \left (\frac {\sqrt {-a} x \sqrt {\frac {a x + b}{x}}}{a x + b}\right ) + \sqrt {-b c d + a d^{2}} a \log \left (\frac {b d - {\left (b c - 2 \, a d\right )} x + 2 \, \sqrt {-b c d + a d^{2}} x \sqrt {\frac {a x + b}{x}}}{c x + d}\right )}{a c^{2}}, \frac {a c x \sqrt {\frac {a x + b}{x}} - 2 \, \sqrt {b c d - a d^{2}} a \arctan \left (\frac {\sqrt {b c d - a d^{2}} x \sqrt {\frac {a x + b}{x}}}{a d x + b d}\right ) - {\left (b c - 2 \, a d\right )} \sqrt {-a} \arctan \left (\frac {\sqrt {-a} x \sqrt {\frac {a x + b}{x}}}{a x + b}\right )}{a c^{2}}\right ] \] Input:

integrate((a+b/x)^(1/2)/(c+d/x),x, algorithm="fricas")
 

Output:

[1/2*(2*a*c*x*sqrt((a*x + b)/x) - (b*c - 2*a*d)*sqrt(a)*log(2*a*x - 2*sqrt 
(a)*x*sqrt((a*x + b)/x) + b) + 2*sqrt(-b*c*d + a*d^2)*a*log((b*d - (b*c - 
2*a*d)*x + 2*sqrt(-b*c*d + a*d^2)*x*sqrt((a*x + b)/x))/(c*x + d)))/(a*c^2) 
, 1/2*(2*a*c*x*sqrt((a*x + b)/x) - 4*sqrt(b*c*d - a*d^2)*a*arctan(sqrt(b*c 
*d - a*d^2)*x*sqrt((a*x + b)/x)/(a*d*x + b*d)) - (b*c - 2*a*d)*sqrt(a)*log 
(2*a*x - 2*sqrt(a)*x*sqrt((a*x + b)/x) + b))/(a*c^2), (a*c*x*sqrt((a*x + b 
)/x) - (b*c - 2*a*d)*sqrt(-a)*arctan(sqrt(-a)*x*sqrt((a*x + b)/x)/(a*x + b 
)) + sqrt(-b*c*d + a*d^2)*a*log((b*d - (b*c - 2*a*d)*x + 2*sqrt(-b*c*d + a 
*d^2)*x*sqrt((a*x + b)/x))/(c*x + d)))/(a*c^2), (a*c*x*sqrt((a*x + b)/x) - 
 2*sqrt(b*c*d - a*d^2)*a*arctan(sqrt(b*c*d - a*d^2)*x*sqrt((a*x + b)/x)/(a 
*d*x + b*d)) - (b*c - 2*a*d)*sqrt(-a)*arctan(sqrt(-a)*x*sqrt((a*x + b)/x)/ 
(a*x + b)))/(a*c^2)]
 

Sympy [F]

\[ \int \frac {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx=\int \frac {x \sqrt {a + \frac {b}{x}}}{c x + d}\, dx \] Input:

integrate((a+b/x)**(1/2)/(c+d/x),x)
 

Output:

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

Maxima [F]

\[ \int \frac {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx=\int { \frac {\sqrt {a + \frac {b}{x}}}{c + \frac {d}{x}} \,d x } \] Input:

integrate((a+b/x)^(1/2)/(c+d/x),x, algorithm="maxima")
 

Output:

integrate(sqrt(a + b/x)/(c + d/x), x)
 

Giac [F(-2)]

Exception generated. \[ \int \frac {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx=\text {Exception raised: TypeError} \] Input:

integrate((a+b/x)^(1/2)/(c+d/x),x, algorithm="giac")
 

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Error: Bad Argument Type
 

Mupad [B] (verification not implemented)

Time = 0.96 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.43 \[ \int \frac {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx=\frac {x\,\sqrt {a+\frac {b}{x}}}{c}+\frac {\ln \left (\sqrt {a+\frac {b}{x}}-\sqrt {a}\right )\,\left (a\,d-\frac {b\,c}{2}\right )}{\sqrt {a}\,c^2}-\frac {\ln \left (\sqrt {a+\frac {b}{x}}+\sqrt {a}\right )\,\left (2\,a\,d-b\,c\right )}{2\,\sqrt {a}\,c^2}-\frac {\mathrm {atan}\left (\frac {b^4\,d^3\,\sqrt {a+\frac {b}{x}}\,\sqrt {a\,d^2-b\,c\,d}\,4{}\mathrm {i}}{4\,a\,b^4\,d^4-4\,b^5\,c\,d^3}\right )\,\sqrt {a\,d^2-b\,c\,d}\,2{}\mathrm {i}}{c^2} \] Input:

int((a + b/x)^(1/2)/(c + d/x),x)
 

Output:

(x*(a + b/x)^(1/2))/c - (atan((b^4*d^3*(a + b/x)^(1/2)*(a*d^2 - b*c*d)^(1/ 
2)*4i)/(4*a*b^4*d^4 - 4*b^5*c*d^3))*(a*d^2 - b*c*d)^(1/2)*2i)/c^2 + (log(( 
a + b/x)^(1/2) - a^(1/2))*(a*d - (b*c)/2))/(a^(1/2)*c^2) - (log((a + b/x)^ 
(1/2) + a^(1/2))*(2*a*d - b*c))/(2*a^(1/2)*c^2)
 

Reduce [B] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 231, normalized size of antiderivative = 2.22 \[ \int \frac {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx=\frac {\sqrt {d}\, \sqrt {a d -b c}\, \mathrm {log}\left (\sqrt {c}\, \sqrt {a x +b}-\sqrt {2 \sqrt {d}\, \sqrt {a}\, \sqrt {a d -b c}-2 a d +b c}+\sqrt {x}\, \sqrt {c}\, \sqrt {a}\right ) a +\sqrt {d}\, \sqrt {a d -b c}\, \mathrm {log}\left (\sqrt {c}\, \sqrt {a x +b}+\sqrt {2 \sqrt {d}\, \sqrt {a}\, \sqrt {a d -b c}-2 a d +b c}+\sqrt {x}\, \sqrt {c}\, \sqrt {a}\right ) a -\sqrt {d}\, \sqrt {a d -b c}\, \mathrm {log}\left (2 \sqrt {d}\, \sqrt {a}\, \sqrt {a d -b c}+2 \sqrt {x}\, \sqrt {a}\, \sqrt {a x +b}\, c +2 a c x +2 a d \right ) a +\sqrt {x}\, \sqrt {a x +b}\, a c -2 \sqrt {a}\, \mathrm {log}\left (\frac {\sqrt {a x +b}+\sqrt {x}\, \sqrt {a}}{\sqrt {b}}\right ) a d +\sqrt {a}\, \mathrm {log}\left (\frac {\sqrt {a x +b}+\sqrt {x}\, \sqrt {a}}{\sqrt {b}}\right ) b c}{a \,c^{2}} \] Input:

int((a+b/x)^(1/2)/(c+d/x),x)
 

Output:

(sqrt(d)*sqrt(a*d - b*c)*log(sqrt(c)*sqrt(a*x + b) - sqrt(2*sqrt(d)*sqrt(a 
)*sqrt(a*d - b*c) - 2*a*d + b*c) + sqrt(x)*sqrt(c)*sqrt(a))*a + sqrt(d)*sq 
rt(a*d - b*c)*log(sqrt(c)*sqrt(a*x + b) + sqrt(2*sqrt(d)*sqrt(a)*sqrt(a*d 
- b*c) - 2*a*d + b*c) + sqrt(x)*sqrt(c)*sqrt(a))*a - sqrt(d)*sqrt(a*d - b* 
c)*log(2*sqrt(d)*sqrt(a)*sqrt(a*d - b*c) + 2*sqrt(x)*sqrt(a)*sqrt(a*x + b) 
*c + 2*a*c*x + 2*a*d)*a + sqrt(x)*sqrt(a*x + b)*a*c - 2*sqrt(a)*log((sqrt( 
a*x + b) + sqrt(x)*sqrt(a))/sqrt(b))*a*d + sqrt(a)*log((sqrt(a*x + b) + sq 
rt(x)*sqrt(a))/sqrt(b))*b*c)/(a*c**2)