Optimal. Leaf size=122 \[ -\frac {4 (x-2) (x+1)}{3 \sqrt {(x-2) (x+1)^3}}-\frac {\sqrt {2} \sqrt {x-2} (x+1)^{3/2} \tan ^{-1}\left (\frac {\sqrt {2} \sqrt {x+1}}{\sqrt {x-2}}\right )}{\sqrt {(x-2) (x+1)^3}}+\frac {2 \sqrt {x-2} (x+1)^{3/2} \sinh ^{-1}\left (\frac {\sqrt {x-2}}{\sqrt {3}}\right )}{\sqrt {(x-2) (x+1)^3}} \]
________________________________________________________________________________________
Rubi [A] time = 0.35, antiderivative size = 133, normalized size of antiderivative = 1.09, number of steps used = 9, number of rules used = 9, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.474, Rules used = {1593, 6719, 1614, 21, 105, 54, 215, 93, 204} \[ \frac {4 (2-x) (x+1)}{3 \sqrt {-(2-x) (x+1)^3}}-\frac {\sqrt {2} \sqrt {x-2} (x+1)^{3/2} \tan ^{-1}\left (\frac {\sqrt {2} \sqrt {x+1}}{\sqrt {x-2}}\right )}{\sqrt {-(2-x) (x+1)^3}}+\frac {2 \sqrt {x-2} (x+1)^{3/2} \sinh ^{-1}\left (\frac {\sqrt {x-2}}{\sqrt {3}}\right )}{\sqrt {-(2-x) (x+1)^3}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 21
Rule 54
Rule 93
Rule 105
Rule 204
Rule 215
Rule 1593
Rule 1614
Rule 6719
Rubi steps
\begin {align*} \int \frac {\frac {1}{x}+x}{\sqrt {(-2+x) (1+x)^3}} \, dx &=\int \frac {1+x^2}{x \sqrt {(-2+x) (1+x)^3}} \, dx\\ &=\frac {\left (\sqrt {-2+x} (1+x)^{3/2}\right ) \int \frac {1+x^2}{\sqrt {-2+x} x (1+x)^{3/2}} \, dx}{\sqrt {(-2+x) (1+x)^3}}\\ &=\frac {4 (2-x) (1+x)}{3 \sqrt {-(2-x) (1+x)^3}}-\frac {\left (2 \sqrt {-2+x} (1+x)^{3/2}\right ) \int \frac {-\frac {3}{2}-\frac {3 x}{2}}{\sqrt {-2+x} x \sqrt {1+x}} \, dx}{3 \sqrt {(-2+x) (1+x)^3}}\\ &=\frac {4 (2-x) (1+x)}{3 \sqrt {-(2-x) (1+x)^3}}+\frac {\left (\sqrt {-2+x} (1+x)^{3/2}\right ) \int \frac {\sqrt {1+x}}{\sqrt {-2+x} x} \, dx}{\sqrt {(-2+x) (1+x)^3}}\\ &=\frac {4 (2-x) (1+x)}{3 \sqrt {-(2-x) (1+x)^3}}+\frac {\left (\sqrt {-2+x} (1+x)^{3/2}\right ) \int \frac {1}{\sqrt {-2+x} \sqrt {1+x}} \, dx}{\sqrt {(-2+x) (1+x)^3}}+\frac {\left (\sqrt {-2+x} (1+x)^{3/2}\right ) \int \frac {1}{\sqrt {-2+x} x \sqrt {1+x}} \, dx}{\sqrt {(-2+x) (1+x)^3}}\\ &=\frac {4 (2-x) (1+x)}{3 \sqrt {-(2-x) (1+x)^3}}+\frac {\left (2 \sqrt {-2+x} (1+x)^{3/2}\right ) \operatorname {Subst}\left (\int \frac {1}{-1-2 x^2} \, dx,x,\frac {\sqrt {1+x}}{\sqrt {-2+x}}\right )}{\sqrt {(-2+x) (1+x)^3}}+\frac {\left (2 \sqrt {-2+x} (1+x)^{3/2}\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {3+x^2}} \, dx,x,\sqrt {-2+x}\right )}{\sqrt {(-2+x) (1+x)^3}}\\ &=\frac {4 (2-x) (1+x)}{3 \sqrt {-(2-x) (1+x)^3}}+\frac {2 \sqrt {-2+x} (1+x)^{3/2} \sinh ^{-1}\left (\frac {\sqrt {-2+x}}{\sqrt {3}}\right )}{\sqrt {-(2-x) (1+x)^3}}-\frac {\sqrt {2} \sqrt {-2+x} (1+x)^{3/2} \tan ^{-1}\left (\frac {\sqrt {2} \sqrt {1+x}}{\sqrt {-2+x}}\right )}{\sqrt {-(2-x) (1+x)^3}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.15, size = 114, normalized size = 0.93 \[ -\frac {(x+1) \left (-4 (2-x)^{3/2}-6 (x-2) \sqrt {x+1} \sin ^{-1}\left (\frac {\sqrt {2-x}}{\sqrt {3}}\right )-3 \sqrt {2} \sqrt {-(x-2)^2} \sqrt {x+1} \tan ^{-1}\left (\frac {\sqrt {\frac {x-2}{x+1}}}{\sqrt {2}}\right )\right )}{3 \sqrt {2-x} \sqrt {(x-2) (x+1)^3}} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.37, size = 97, normalized size = 0.80 \[ -\frac {4 \sqrt {x^4+x^3-3 x^2-5 x-2}}{3 (x+1)^2}+\sqrt {2} \tan ^{-1}\left (\frac {\sqrt {x^4+x^3-3 x^2-5 x-2}}{\sqrt {2} (x+1)^2}\right )+2 \tanh ^{-1}\left (\frac {\sqrt {x^4+x^3-3 x^2-5 x-2}}{(x+1)^2}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.79, size = 142, normalized size = 1.16 \[ \frac {3 \, \sqrt {2} {\left (x^{2} + 2 \, x + 1\right )} \arctan \left (-\frac {\sqrt {2} {\left (x^{2} + x\right )} - \sqrt {2} \sqrt {x^{4} + x^{3} - 3 \, x^{2} - 5 \, x - 2}}{2 \, {\left (x + 1\right )}}\right ) - 4 \, x^{2} - 3 \, {\left (x^{2} + 2 \, x + 1\right )} \log \left (-\frac {2 \, x^{2} + x - 2 \, \sqrt {x^{4} + x^{3} - 3 \, x^{2} - 5 \, x - 2} - 1}{x + 1}\right ) - 8 \, x - 4 \, \sqrt {x^{4} + x^{3} - 3 \, x^{2} - 5 \, x - 2} - 4}{3 \, {\left (x^{2} + 2 \, x + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.83, size = 177, normalized size = 1.45 \[ -\frac {\sqrt {2} \arcsin \left (\frac {4}{3 \, x} + \frac {1}{3}\right )}{2 \, \mathrm {sgn}\left (\frac {1}{x^{2}} + \frac {1}{x^{3}}\right )} + \frac {\log \left ({\left | 2 \, \sqrt {2} + \frac {2 \, \sqrt {2} \sqrt {-\frac {1}{x} - \frac {2}{x^{2}} + 1} - 3}{\frac {4}{x} + 1} + 3 \right |}\right )}{\mathrm {sgn}\left (\frac {1}{x^{2}} + \frac {1}{x^{3}}\right )} - \frac {\log \left ({\left | -2 \, \sqrt {2} + \frac {2 \, \sqrt {2} \sqrt {-\frac {1}{x} - \frac {2}{x^{2}} + 1} - 3}{\frac {4}{x} + 1} + 3 \right |}\right )}{\mathrm {sgn}\left (\frac {1}{x^{2}} + \frac {1}{x^{3}}\right )} + \frac {8 \, \sqrt {2}}{3 \, {\left (\frac {2 \, \sqrt {2} \sqrt {-\frac {1}{x} - \frac {2}{x^{2}} + 1} - 3}{\frac {4}{x} + 1} - 1\right )} \mathrm {sgn}\left (\frac {1}{x^{2}} + \frac {1}{x^{3}}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.24, size = 86, normalized size = 0.70
method | result | size |
risch | \(-\frac {4 \left (-2+x \right ) \left (1+x \right )}{3 \sqrt {\left (-2+x \right ) \left (1+x \right )^{3}}}+\frac {\left (\ln \left (-\frac {1}{2}+x +\sqrt {x^{2}-x -2}\right )+\frac {\sqrt {2}\, \arctan \left (\frac {\left (-4-x \right ) \sqrt {2}}{4 \sqrt {x^{2}-x -2}}\right )}{2}\right ) \left (1+x \right ) \sqrt {\left (1+x \right ) \left (-2+x \right )}}{\sqrt {\left (-2+x \right ) \left (1+x \right )^{3}}}\) | \(86\) |
default | \(\frac {\left (-3 \sqrt {2}\, \arctan \left (\frac {\left (4+x \right ) \sqrt {2}}{4 \sqrt {x^{2}-x -2}}\right ) x +6 \ln \left (-\frac {1}{2}+x +\sqrt {x^{2}-x -2}\right ) x -3 \sqrt {2}\, \arctan \left (\frac {\left (4+x \right ) \sqrt {2}}{4 \sqrt {x^{2}-x -2}}\right )+6 \ln \left (-\frac {1}{2}+x +\sqrt {x^{2}-x -2}\right )-8 \sqrt {x^{2}-x -2}\right ) \sqrt {\left (1+x \right ) \left (-2+x \right )}}{6 \sqrt {\left (-2+x \right ) \left (1+x \right )^{3}}}\) | \(118\) |
trager | \(-\frac {4 \sqrt {x^{4}+x^{3}-3 x^{2}-5 x -2}}{3 \left (1+x \right )^{2}}+\ln \left (\frac {2 x^{2}+2 \sqrt {x^{4}+x^{3}-3 x^{2}-5 x -2}+x -1}{1+x}\right )+\frac {\RootOf \left (\textit {\_Z}^{2}+2\right ) \ln \left (\frac {\RootOf \left (\textit {\_Z}^{2}+2\right ) x^{2}+5 \RootOf \left (\textit {\_Z}^{2}+2\right ) x +4 \sqrt {x^{4}+x^{3}-3 x^{2}-5 x -2}+4 \RootOf \left (\textit {\_Z}^{2}+2\right )}{x \left (1+x \right )}\right )}{2}\) | \(128\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x + \frac {1}{x}}{\sqrt {{\left (x + 1\right )}^{3} {\left (x - 2\right )}}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {x+\frac {1}{x}}{\sqrt {{\left (x+1\right )}^3\,\left (x-2\right )}} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x^{2} + 1}{x \sqrt {\left (x - 2\right ) \left (x + 1\right )^{3}}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________