Optimal. Leaf size=69 \[ \frac{1}{2} \log \left (1-\sqrt{\frac{1}{x}+1}\right )-\frac{1}{3} \log \left (2-\sqrt{\frac{1}{x}+1}\right )-\frac{1}{6} \log \left (\sqrt{\frac{1}{x}+1}+1\right )+x \log \left (\sqrt{\frac{x+1}{x}}-2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0517545, antiderivative size = 69, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 4, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {2548, 706, 31, 633} \[ \frac{1}{2} \log \left (1-\sqrt{\frac{1}{x}+1}\right )-\frac{1}{3} \log \left (2-\sqrt{\frac{1}{x}+1}\right )-\frac{1}{6} \log \left (\sqrt{\frac{1}{x}+1}+1\right )+x \log \left (\sqrt{\frac{x+1}{x}}-2\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2548
Rule 706
Rule 31
Rule 633
Rubi steps
\begin{align*} \int \log \left (-2+\sqrt{\frac{1+x}{x}}\right ) \, dx &=x \log \left (-2+\sqrt{\frac{1+x}{x}}\right )-\int \frac{1}{-2+\left (-2+4 \sqrt{1+\frac{1}{x}}\right ) x} \, dx\\ &=x \log \left (-2+\sqrt{\frac{1+x}{x}}\right )-\operatorname{Subst}\left (\int \frac{1}{(-2+x) \left (-1+x^2\right )} \, dx,x,\sqrt{1+\frac{1}{x}}\right )\\ &=x \log \left (-2+\sqrt{\frac{1+x}{x}}\right )-\frac{1}{3} \operatorname{Subst}\left (\int \frac{1}{-2+x} \, dx,x,\sqrt{1+\frac{1}{x}}\right )-\frac{1}{3} \operatorname{Subst}\left (\int \frac{-2-x}{-1+x^2} \, dx,x,\sqrt{1+\frac{1}{x}}\right )\\ &=-\frac{1}{3} \log \left (2-\sqrt{1+\frac{1}{x}}\right )+x \log \left (-2+\sqrt{\frac{1+x}{x}}\right )-\frac{1}{6} \operatorname{Subst}\left (\int \frac{1}{1+x} \, dx,x,\sqrt{1+\frac{1}{x}}\right )+\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{-1+x} \, dx,x,\sqrt{1+\frac{1}{x}}\right )\\ &=\frac{1}{2} \log \left (1-\sqrt{1+\frac{1}{x}}\right )-\frac{1}{3} \log \left (2-\sqrt{1+\frac{1}{x}}\right )-\frac{1}{6} \log \left (1+\sqrt{1+\frac{1}{x}}\right )+x \log \left (-2+\sqrt{\frac{1+x}{x}}\right )\\ \end{align*}
Mathematica [A] time = 0.0265013, size = 64, normalized size = 0.93 \[ \frac{1}{6} \left (\log \left (2-\sqrt{\frac{1}{x}+1}\right )+6 x \log \left (\sqrt{\frac{1}{x}+1}-2\right )-\log \left (\sqrt{\frac{1}{x}+1}+1\right )-6 \tanh ^{-1}\left (3-2 \sqrt{\frac{1}{x}+1}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.036, size = 108, normalized size = 1.6 \begin{align*} x\ln \left ( -2+\sqrt{{\frac{1+x}{x}}} \right ) -{\frac{1}{18\,x} \left ( 3\,\sqrt{{\frac{1+x}{x}}}x\ln \left ( -3\,x+1 \right ) -\sqrt{9}\ln \left ({\frac{1}{9\,x-3} \left ( 4\,\sqrt{9}\sqrt{{x}^{2}+x}+15\,x+3 \right ) } \right ) \sqrt{x \left ( 1+x \right ) }+6\,\ln \left ( 1/2+x+\sqrt{{x}^{2}+x} \right ) \sqrt{x \left ( 1+x \right ) } \right ){\frac{1}{\sqrt{{\frac{1+x}{x}}}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.05914, size = 90, normalized size = 1.3 \begin{align*} \frac{\log \left (\sqrt{\frac{x + 1}{x}} - 2\right )}{\frac{x + 1}{x} - 1} - \frac{1}{6} \, \log \left (\sqrt{\frac{x + 1}{x}} + 1\right ) + \frac{1}{2} \, \log \left (\sqrt{\frac{x + 1}{x}} - 1\right ) - \frac{1}{3} \, \log \left (\sqrt{\frac{x + 1}{x}} - 2\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.19618, size = 138, normalized size = 2. \begin{align*} \frac{1}{3} \,{\left (3 \, x - 1\right )} \log \left (\sqrt{\frac{x + 1}{x}} - 2\right ) - \frac{1}{6} \, \log \left (\sqrt{\frac{x + 1}{x}} + 1\right ) + \frac{1}{2} \, \log \left (\sqrt{\frac{x + 1}{x}} - 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 153.419, size = 53, normalized size = 0.77 \begin{align*} x \log{\left (\sqrt{\frac{x + 1}{x}} - 2 \right )} - \frac{\log{\left (\sqrt{1 + \frac{1}{x}} - 2 \right )}}{3} + \frac{\log{\left (\sqrt{1 + \frac{1}{x}} - 1 \right )}}{2} - \frac{\log{\left (\sqrt{1 + \frac{1}{x}} + 1 \right )}}{6} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.38192, size = 157, normalized size = 2.28 \begin{align*} x \log \left (\sqrt{\frac{x + 1}{x}} - 2\right ) + \frac{1}{6} \,{\left (\frac{\log \left ({\left | -2 \,{\left (x - \sqrt{x^{2} + x}\right )} \mathrm{sgn}\left (x\right ) + x - \sqrt{x^{2} + x} + 1 \right |}\right )}{\mathrm{sgn}\left (x\right )} - \frac{\log \left ({\left | -2 \,{\left (x - \sqrt{x^{2} + x}\right )} \mathrm{sgn}\left (x\right ) - x + \sqrt{x^{2} + x} - 1 \right |}\right )}{\mathrm{sgn}\left (x\right )} + 2 \, \log \left ({\left | -2 \, x + 2 \, \sqrt{x^{2} + x} - 1 \right |}\right )\right )} \mathrm{sgn}\left (x\right ) - \frac{1}{6} \, \log \left ({\left | 3 \, x - 1 \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]