Optimal. Leaf size=62 \[ \frac {\sqrt {4+2 x+x^2}}{1-x}+\sinh ^{-1}\left (\frac {1+x}{\sqrt {3}}\right )-\frac {2 \tanh ^{-1}\left (\frac {5+2 x}{\sqrt {7} \sqrt {4+2 x+x^2}}\right )}{\sqrt {7}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {746, 857, 633,
221, 738, 212} \begin {gather*} \frac {\sqrt {x^2+2 x+4}}{1-x}-\frac {2 \tanh ^{-1}\left (\frac {2 x+5}{\sqrt {7} \sqrt {x^2+2 x+4}}\right )}{\sqrt {7}}+\sinh ^{-1}\left (\frac {x+1}{\sqrt {3}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 221
Rule 633
Rule 738
Rule 746
Rule 857
Rubi steps
\begin {align*} \int \frac {\sqrt {4+2 x+x^2}}{(-1+x)^2} \, dx &=\frac {\sqrt {4+2 x+x^2}}{1-x}+\frac {1}{2} \int \frac {2+2 x}{(-1+x) \sqrt {4+2 x+x^2}} \, dx\\ &=\frac {\sqrt {4+2 x+x^2}}{1-x}+2 \int \frac {1}{(-1+x) \sqrt {4+2 x+x^2}} \, dx+\int \frac {1}{\sqrt {4+2 x+x^2}} \, dx\\ &=\frac {\sqrt {4+2 x+x^2}}{1-x}-4 \text {Subst}\left (\int \frac {1}{28-x^2} \, dx,x,\frac {10+4 x}{\sqrt {4+2 x+x^2}}\right )+\frac {\text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{12}}} \, dx,x,2+2 x\right )}{2 \sqrt {3}}\\ &=\frac {\sqrt {4+2 x+x^2}}{1-x}+\sinh ^{-1}\left (\frac {1+x}{\sqrt {3}}\right )-\frac {2 \tanh ^{-1}\left (\frac {5+2 x}{\sqrt {7} \sqrt {4+2 x+x^2}}\right )}{\sqrt {7}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.20, size = 71, normalized size = 1.15 \begin {gather*} -\frac {\sqrt {4+2 x+x^2}}{-1+x}-\frac {4 \tanh ^{-1}\left (\frac {1-x+\sqrt {4+2 x+x^2}}{\sqrt {7}}\right )}{\sqrt {7}}-\log \left (-1-x+\sqrt {4+2 x+x^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.19, size = 91, normalized size = 1.47
method | result | size |
risch | \(-\frac {\sqrt {x^{2}+2 x +4}}{-1+x}+\arcsinh \left (\frac {\left (1+x \right ) \sqrt {3}}{3}\right )-\frac {2 \sqrt {7}\, \arctanh \left (\frac {\left (10+4 x \right ) \sqrt {7}}{14 \sqrt {\left (-1+x \right )^{2}+3+4 x}}\right )}{7}\) | \(56\) |
trager | \(-\frac {\sqrt {x^{2}+2 x +4}}{-1+x}+\ln \left (x +1+\sqrt {x^{2}+2 x +4}\right )+\frac {2 \RootOf \left (\textit {\_Z}^{2}-7\right ) \ln \left (-\frac {-2 \RootOf \left (\textit {\_Z}^{2}-7\right ) x +7 \sqrt {x^{2}+2 x +4}-5 \RootOf \left (\textit {\_Z}^{2}-7\right )}{-1+x}\right )}{7}\) | \(79\) |
default | \(-\frac {\left (\left (-1+x \right )^{2}+3+4 x \right )^{\frac {3}{2}}}{7 \left (-1+x \right )}+\frac {2 \sqrt {\left (-1+x \right )^{2}+3+4 x}}{7}+\arcsinh \left (\frac {\left (1+x \right ) \sqrt {3}}{3}\right )-\frac {2 \sqrt {7}\, \arctanh \left (\frac {\left (10+4 x \right ) \sqrt {7}}{14 \sqrt {\left (-1+x \right )^{2}+3+4 x}}\right )}{7}+\frac {\left (2+2 x \right ) \sqrt {\left (-1+x \right )^{2}+3+4 x}}{14}\) | \(91\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 2.48, size = 61, normalized size = 0.98 \begin {gather*} -\frac {2}{7} \, \sqrt {7} \operatorname {arsinh}\left (\frac {2 \, \sqrt {3} x}{3 \, {\left | x - 1 \right |}} + \frac {5 \, \sqrt {3}}{3 \, {\left | x - 1 \right |}}\right ) - \frac {\sqrt {x^{2} + 2 \, x + 4}}{x - 1} + \operatorname {arsinh}\left (\frac {1}{3} \, \sqrt {3} x + \frac {1}{3} \, \sqrt {3}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.48, size = 92, normalized size = 1.48 \begin {gather*} \frac {2 \, \sqrt {7} {\left (x - 1\right )} \log \left (\frac {\sqrt {7} {\left (2 \, x + 5\right )} + \sqrt {x^{2} + 2 \, x + 4} {\left (2 \, \sqrt {7} - 7\right )} - 4 \, x - 10}{x - 1}\right ) - 7 \, {\left (x - 1\right )} \log \left (-x + \sqrt {x^{2} + 2 \, x + 4} - 1\right ) - 7 \, x - 7 \, \sqrt {x^{2} + 2 \, x + 4} + 7}{7 \, {\left (x - 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {x^{2} + 2 x + 4}}{\left (x - 1\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 149 vs.
\(2 (53) = 106\).
time = 1.13, size = 149, normalized size = 2.40 \begin {gather*} -\frac {2}{7} \, \sqrt {7} \log \left (\sqrt {7} {\left (\sqrt {\frac {4}{x - 1} + \frac {7}{{\left (x - 1\right )}^{2}} + 1} + \frac {\sqrt {7}}{x - 1}\right )} + 2\right ) \mathrm {sgn}\left (\frac {1}{x - 1}\right ) + \log \left (\sqrt {\frac {4}{x - 1} + \frac {7}{{\left (x - 1\right )}^{2}} + 1} + \frac {\sqrt {7}}{x - 1} + 1\right ) \mathrm {sgn}\left (\frac {1}{x - 1}\right ) - \log \left ({\left | \sqrt {\frac {4}{x - 1} + \frac {7}{{\left (x - 1\right )}^{2}} + 1} + \frac {\sqrt {7}}{x - 1} - 1 \right |}\right ) \mathrm {sgn}\left (\frac {1}{x - 1}\right ) - \sqrt {\frac {4}{x - 1} + \frac {7}{{\left (x - 1\right )}^{2}} + 1} \mathrm {sgn}\left (\frac {1}{x - 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {\sqrt {x^2+2\,x+4}}{{\left (x-1\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________