Integrand size = 21, antiderivative size = 73 \[ \int \frac {\left (c+\frac {d}{x}\right )^2}{\sqrt {a+\frac {b}{x}}} \, dx=-\frac {2 d^2 \sqrt {a+\frac {b}{x}}}{b}+\frac {c^2 \sqrt {a+\frac {b}{x}} x}{a}-\frac {c (b c-4 a d) \text {arctanh}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{a^{3/2}} \] Output:
-2*d^2*(a+b/x)^(1/2)/b+c^2*(a+b/x)^(1/2)*x/a-c*(-4*a*d+b*c)*arctanh((a+b/x )^(1/2)/a^(1/2))/a^(3/2)
Time = 0.24 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.90 \[ \int \frac {\left (c+\frac {d}{x}\right )^2}{\sqrt {a+\frac {b}{x}}} \, dx=\frac {\sqrt {a+\frac {b}{x}} \left (-2 a d^2+b c^2 x\right )}{a b}+\frac {c (-b c+4 a d) \text {arctanh}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{a^{3/2}} \] Input:
Integrate[(c + d/x)^2/Sqrt[a + b/x],x]
Output:
(Sqrt[a + b/x]*(-2*a*d^2 + b*c^2*x))/(a*b) + (c*(-(b*c) + 4*a*d)*ArcTanh[S qrt[a + b/x]/Sqrt[a]])/a^(3/2)
Time = 0.37 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.12, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {899, 100, 27, 90, 73, 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 {\left (c+\frac {d}{x}\right )^2}{\sqrt {a+\frac {b}{x}}} \, dx\) |
\(\Big \downarrow \) 899 |
\(\displaystyle -\int \frac {\left (c+\frac {d}{x}\right )^2 x^2}{\sqrt {a+\frac {b}{x}}}d\frac {1}{x}\) |
\(\Big \downarrow \) 100 |
\(\displaystyle \frac {c^2 x \sqrt {a+\frac {b}{x}}}{a}-\frac {\int -\frac {\left (c (b c-4 a d)-\frac {2 a d^2}{x}\right ) x}{2 \sqrt {a+\frac {b}{x}}}d\frac {1}{x}}{a}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\int \frac {\left (c (b c-4 a d)-\frac {2 a d^2}{x}\right ) x}{\sqrt {a+\frac {b}{x}}}d\frac {1}{x}}{2 a}+\frac {c^2 x \sqrt {a+\frac {b}{x}}}{a}\) |
\(\Big \downarrow \) 90 |
\(\displaystyle \frac {c (b c-4 a d) \int \frac {x}{\sqrt {a+\frac {b}{x}}}d\frac {1}{x}-\frac {4 a d^2 \sqrt {a+\frac {b}{x}}}{b}}{2 a}+\frac {c^2 x \sqrt {a+\frac {b}{x}}}{a}\) |
\(\Big \downarrow \) 73 |
\(\displaystyle \frac {\frac {2 c (b c-4 a d) \int \frac {1}{\frac {1}{b x^2}-\frac {a}{b}}d\sqrt {a+\frac {b}{x}}}{b}-\frac {4 a d^2 \sqrt {a+\frac {b}{x}}}{b}}{2 a}+\frac {c^2 x \sqrt {a+\frac {b}{x}}}{a}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle \frac {-\frac {2 c \text {arctanh}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right ) (b c-4 a d)}{\sqrt {a}}-\frac {4 a d^2 \sqrt {a+\frac {b}{x}}}{b}}{2 a}+\frac {c^2 x \sqrt {a+\frac {b}{x}}}{a}\) |
Input:
Int[(c + d/x)^2/Sqrt[a + b/x],x]
Output:
(c^2*Sqrt[a + b/x]*x)/a + ((-4*a*d^2*Sqrt[a + b/x])/b - (2*c*(b*c - 4*a*d) *ArcTanh[Sqrt[a + b/x]/Sqrt[a]])/Sqrt[a])/(2*a)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
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]
Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p _.), x_] :> Simp[b*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] + Simp[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(d*f*(n + p + 2)) Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2, 0]
Int[((a_.) + (b_.)*(x_))^2*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^( p_), x_] :> Simp[(b*c - a*d)^2*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d^2*(d *e - c*f)*(n + 1))), x] - Simp[1/(d^2*(d*e - c*f)*(n + 1)) Int[(c + d*x)^ (n + 1)*(e + f*x)^p*Simp[a^2*d^2*f*(n + p + 2) + b^2*c*(d*e*(n + 1) + c*f*( p + 1)) - 2*a*b*d*(d*e*(n + 1) + c*f*(p + 1)) - b^2*d*(d*e - c*f)*(n + 1)*x , x], x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && (LtQ[n, -1] || (EqQ[n + p + 3, 0] && NeQ[n, -1] && (SumSimplerQ[n, 1] || !SumSimplerQ[p, 1])))
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]
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]
Time = 0.32 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.44
method | result | size |
risch | \(-\frac {\left (a x +b \right ) \left (-b x \,c^{2}+2 a \,d^{2}\right )}{b a x \sqrt {\frac {a x +b}{x}}}+\frac {\left (4 a d -b c \right ) c \ln \left (\frac {\frac {b}{2}+a x}{\sqrt {a}}+\sqrt {a \,x^{2}+b x}\right ) \sqrt {x \left (a x +b \right )}}{2 a^{\frac {3}{2}} x \sqrt {\frac {a x +b}{x}}}\) | \(105\) |
default | \(-\frac {\sqrt {\frac {a x +b}{x}}\, \left (-2 \sqrt {a \,x^{2}+b x}\, a^{\frac {5}{2}} d^{2} x^{2}-4 \sqrt {a \,x^{2}+b x}\, a^{\frac {3}{2}} b c d \,x^{2}-\ln \left (\frac {2 \sqrt {a \,x^{2}+b x}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a^{2} b \,d^{2} x^{2}-2 \ln \left (\frac {2 \sqrt {a \,x^{2}+b x}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a \,b^{2} c d \,x^{2}-2 a^{\frac {5}{2}} \sqrt {x \left (a x +b \right )}\, d^{2} x^{2}+4 a^{\frac {3}{2}} \sqrt {x \left (a x +b \right )}\, b c d \,x^{2}-2 \sqrt {a}\, \sqrt {x \left (a x +b \right )}\, b^{2} c^{2} x^{2}+\ln \left (\frac {2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a^{2} b \,d^{2} x^{2}-2 \ln \left (\frac {2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a \,b^{2} c d \,x^{2}+\ln \left (\frac {2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) b^{3} c^{2} x^{2}+4 \left (a \,x^{2}+b x \right )^{\frac {3}{2}} a^{\frac {3}{2}} d^{2}\right )}{2 x \sqrt {x \left (a x +b \right )}\, b^{2} a^{\frac {3}{2}}}\) | \(348\) |
Input:
int((c+1/x*d)^2/(a+b/x)^(1/2),x,method=_RETURNVERBOSE)
Output:
-(a*x+b)*(-b*c^2*x+2*a*d^2)/b/a/x/((a*x+b)/x)^(1/2)+1/2*(4*a*d-b*c)*c/a^(3 /2)*ln((1/2*b+a*x)/a^(1/2)+(a*x^2+b*x)^(1/2))/x/((a*x+b)/x)^(1/2)*(x*(a*x+ b))^(1/2)
Time = 0.14 (sec) , antiderivative size = 163, normalized size of antiderivative = 2.23 \[ \int \frac {\left (c+\frac {d}{x}\right )^2}{\sqrt {a+\frac {b}{x}}} \, dx=\left [-\frac {{\left (b^{2} c^{2} - 4 \, a b c d\right )} \sqrt {a} \log \left (2 \, a x + 2 \, \sqrt {a} x \sqrt {\frac {a x + b}{x}} + b\right ) - 2 \, {\left (a b c^{2} x - 2 \, a^{2} d^{2}\right )} \sqrt {\frac {a x + b}{x}}}{2 \, a^{2} b}, \frac {{\left (b^{2} c^{2} - 4 \, a b c d\right )} \sqrt {-a} \arctan \left (\frac {\sqrt {-a} x \sqrt {\frac {a x + b}{x}}}{a x + b}\right ) + {\left (a b c^{2} x - 2 \, a^{2} d^{2}\right )} \sqrt {\frac {a x + b}{x}}}{a^{2} b}\right ] \] Input:
integrate((c+d/x)^2/(a+b/x)^(1/2),x, algorithm="fricas")
Output:
[-1/2*((b^2*c^2 - 4*a*b*c*d)*sqrt(a)*log(2*a*x + 2*sqrt(a)*x*sqrt((a*x + b )/x) + b) - 2*(a*b*c^2*x - 2*a^2*d^2)*sqrt((a*x + b)/x))/(a^2*b), ((b^2*c^ 2 - 4*a*b*c*d)*sqrt(-a)*arctan(sqrt(-a)*x*sqrt((a*x + b)/x)/(a*x + b)) + ( a*b*c^2*x - 2*a^2*d^2)*sqrt((a*x + b)/x))/(a^2*b)]
Time = 11.76 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.63 \[ \int \frac {\left (c+\frac {d}{x}\right )^2}{\sqrt {a+\frac {b}{x}}} \, dx=- 2 c d \left (\begin {cases} \frac {2 \operatorname {atan}{\left (\frac {\sqrt {a + \frac {b}{x}}}{\sqrt {- a}} \right )}}{\sqrt {- a}} & \text {for}\: b \neq 0 \\- \frac {\log {\left (x \right )}}{\sqrt {a}} & \text {otherwise} \end {cases}\right ) + d^{2} \left (\begin {cases} - \frac {1}{\sqrt {a} x} & \text {for}\: b = 0 \\- \frac {2 \sqrt {a + \frac {b}{x}}}{b} & \text {otherwise} \end {cases}\right ) + \frac {\sqrt {b} c^{2} \sqrt {x} \sqrt {\frac {a x}{b} + 1}}{a} - \frac {b c^{2} \operatorname {asinh}{\left (\frac {\sqrt {a} \sqrt {x}}{\sqrt {b}} \right )}}{a^{\frac {3}{2}}} \] Input:
integrate((c+d/x)**2/(a+b/x)**(1/2),x)
Output:
-2*c*d*Piecewise((2*atan(sqrt(a + b/x)/sqrt(-a))/sqrt(-a), Ne(b, 0)), (-lo g(x)/sqrt(a), True)) + d**2*Piecewise((-1/(sqrt(a)*x), Eq(b, 0)), (-2*sqrt (a + b/x)/b, True)) + sqrt(b)*c**2*sqrt(x)*sqrt(a*x/b + 1)/a - b*c**2*asin h(sqrt(a)*sqrt(x)/sqrt(b))/a**(3/2)
Leaf count of result is larger than twice the leaf count of optimal. 129 vs. \(2 (63) = 126\).
Time = 0.11 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.77 \[ \int \frac {\left (c+\frac {d}{x}\right )^2}{\sqrt {a+\frac {b}{x}}} \, dx=\frac {1}{2} \, c^{2} {\left (\frac {2 \, \sqrt {a + \frac {b}{x}} b}{{\left (a + \frac {b}{x}\right )} a - a^{2}} + \frac {b \log \left (\frac {\sqrt {a + \frac {b}{x}} - \sqrt {a}}{\sqrt {a + \frac {b}{x}} + \sqrt {a}}\right )}{a^{\frac {3}{2}}}\right )} - \frac {2 \, c d \log \left (\frac {\sqrt {a + \frac {b}{x}} - \sqrt {a}}{\sqrt {a + \frac {b}{x}} + \sqrt {a}}\right )}{\sqrt {a}} - \frac {2 \, \sqrt {a + \frac {b}{x}} d^{2}}{b} \] Input:
integrate((c+d/x)^2/(a+b/x)^(1/2),x, algorithm="maxima")
Output:
1/2*c^2*(2*sqrt(a + b/x)*b/((a + b/x)*a - a^2) + b*log((sqrt(a + b/x) - sq rt(a))/(sqrt(a + b/x) + sqrt(a)))/a^(3/2)) - 2*c*d*log((sqrt(a + b/x) - sq rt(a))/(sqrt(a + b/x) + sqrt(a)))/sqrt(a) - 2*sqrt(a + b/x)*d^2/b
Exception generated. \[ \int \frac {\left (c+\frac {d}{x}\right )^2}{\sqrt {a+\frac {b}{x}}} \, dx=\text {Exception raised: TypeError} \] Input:
integrate((c+d/x)^2/(a+b/x)^(1/2),x, algorithm="giac")
Output:
Exception raised: TypeError >> an error occurred running a Giac command:IN PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Limit: Max order reached or unable to make series expansion Error: Bad Argument Value
Time = 0.94 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.86 \[ \int \frac {\left (c+\frac {d}{x}\right )^2}{\sqrt {a+\frac {b}{x}}} \, dx=\frac {c^2\,x\,\sqrt {a+\frac {b}{x}}}{a}-\frac {2\,d^2\,\sqrt {a+\frac {b}{x}}}{b}+\frac {c\,\mathrm {atanh}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )\,\left (4\,a\,d-b\,c\right )}{a^{3/2}} \] Input:
int((c + d/x)^2/(a + b/x)^(1/2),x)
Output:
(c^2*x*(a + b/x)^(1/2))/a - (2*d^2*(a + b/x)^(1/2))/b + (c*atanh((a + b/x) ^(1/2)/a^(1/2))*(4*a*d - b*c))/a^(3/2)
Time = 0.22 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.67 \[ \int \frac {\left (c+\frac {d}{x}\right )^2}{\sqrt {a+\frac {b}{x}}} \, dx=\frac {-8 \sqrt {x}\, \sqrt {a x +b}\, a^{2} d^{2}+4 \sqrt {x}\, \sqrt {a x +b}\, a b \,c^{2} x +16 \sqrt {a}\, \mathrm {log}\left (\frac {\sqrt {a x +b}+\sqrt {x}\, \sqrt {a}}{\sqrt {b}}\right ) a b c d x -4 \sqrt {a}\, \mathrm {log}\left (\frac {\sqrt {a x +b}+\sqrt {x}\, \sqrt {a}}{\sqrt {b}}\right ) b^{2} c^{2} x -8 \sqrt {a}\, a^{2} d^{2} x -\sqrt {a}\, b^{2} c^{2} x}{4 a^{2} b x} \] Input:
int((c+d/x)^2/(a+b/x)^(1/2),x)
Output:
( - 8*sqrt(x)*sqrt(a*x + b)*a**2*d**2 + 4*sqrt(x)*sqrt(a*x + b)*a*b*c**2*x + 16*sqrt(a)*log((sqrt(a*x + b) + sqrt(x)*sqrt(a))/sqrt(b))*a*b*c*d*x - 4 *sqrt(a)*log((sqrt(a*x + b) + sqrt(x)*sqrt(a))/sqrt(b))*b**2*c**2*x - 8*sq rt(a)*a**2*d**2*x - sqrt(a)*b**2*c**2*x)/(4*a**2*b*x)