Optimal. Leaf size=61 \[ \frac {1}{5} \left (5-\sqrt {5}\right ) \log \left (1-\sqrt {5}-2 \sqrt {2+x}\right )+\frac {1}{5} \left (5+\sqrt {5}\right ) \log \left (1+\sqrt {5}-2 \sqrt {2+x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {646, 31}
\begin {gather*} \frac {1}{5} \left (5-\sqrt {5}\right ) \log \left (-2 \sqrt {x+2}-\sqrt {5}+1\right )+\frac {1}{5} \left (5+\sqrt {5}\right ) \log \left (-2 \sqrt {x+2}+\sqrt {5}+1\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 646
Rubi steps
\begin {align*} \int \frac {1}{1+x-\sqrt {2+x}} \, dx &=2 \text {Subst}\left (\int \frac {x}{-1-x+x^2} \, dx,x,\sqrt {2+x}\right )\\ &=\frac {1}{5} \left (5-\sqrt {5}\right ) \text {Subst}\left (\int \frac {1}{-\frac {1}{2}+\frac {\sqrt {5}}{2}+x} \, dx,x,\sqrt {2+x}\right )+\frac {1}{5} \left (5+\sqrt {5}\right ) \text {Subst}\left (\int \frac {1}{-\frac {1}{2}-\frac {\sqrt {5}}{2}+x} \, dx,x,\sqrt {2+x}\right )\\ &=\frac {1}{5} \left (5-\sqrt {5}\right ) \log \left (1-\sqrt {5}-2 \sqrt {2+x}\right )+\frac {1}{5} \left (5+\sqrt {5}\right ) \log \left (1+\sqrt {5}-2 \sqrt {2+x}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.06, size = 56, normalized size = 0.92 \begin {gather*} \frac {1}{5} \left (\left (5+\sqrt {5}\right ) \log \left (1+\sqrt {5}-2 \sqrt {2+x}\right )-\left (-5+\sqrt {5}\right ) \log \left (-1+\sqrt {5}+2 \sqrt {2+x}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.14, size = 91, normalized size = 1.49
method | result | size |
derivativedivides | \(\ln \left (1+x -\sqrt {x +2}\right )-\frac {2 \sqrt {5}\, \arctanh \left (\frac {\left (2 \sqrt {x +2}-1\right ) \sqrt {5}}{5}\right )}{5}\) | \(33\) |
default | \(-\frac {\arctanh \left (\frac {\left (2 x +1\right ) \sqrt {5}}{5}\right ) \sqrt {5}}{5}+\frac {\ln \left (x^{2}+x -1\right )}{2}-\frac {\ln \left (1+x +\sqrt {x +2}\right )}{2}-\frac {\sqrt {5}\, \arctanh \left (\frac {\left (2 \sqrt {x +2}+1\right ) \sqrt {5}}{5}\right )}{5}+\frac {\ln \left (1+x -\sqrt {x +2}\right )}{2}-\frac {\sqrt {5}\, \arctanh \left (\frac {\left (2 \sqrt {x +2}-1\right ) \sqrt {5}}{5}\right )}{5}\) | \(91\) |
trager | \(-\ln \left (-1-x +\sqrt {x +2}\right ) \RootOf \left (5 \textit {\_Z}^{2}-10 \textit {\_Z} +4\right )+\ln \left (150 \RootOf \left (5 \textit {\_Z}^{2}-10 \textit {\_Z} +4\right )^{2} x +450 \RootOf \left (5 \textit {\_Z}^{2}-10 \textit {\_Z} +4\right ) \sqrt {x +2}-445 \RootOf \left (5 \textit {\_Z}^{2}-10 \textit {\_Z} +4\right ) x -244 \sqrt {x +2}-660 \RootOf \left (5 \textit {\_Z}^{2}-10 \textit {\_Z} +4\right )+204 x +374\right ) \RootOf \left (5 \textit {\_Z}^{2}-10 \textit {\_Z} +4\right )+2 \ln \left (-1-x +\sqrt {x +2}\right )-\ln \left (150 \RootOf \left (5 \textit {\_Z}^{2}-10 \textit {\_Z} +4\right )^{2} x +450 \RootOf \left (5 \textit {\_Z}^{2}-10 \textit {\_Z} +4\right ) \sqrt {x +2}-445 \RootOf \left (5 \textit {\_Z}^{2}-10 \textit {\_Z} +4\right ) x -244 \sqrt {x +2}-660 \RootOf \left (5 \textit {\_Z}^{2}-10 \textit {\_Z} +4\right )+204 x +374\right )\) | \(201\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 46, normalized size = 0.75 \begin {gather*} \frac {1}{5} \, \sqrt {5} \log \left (-\frac {\sqrt {5} - 2 \, \sqrt {x + 2} + 1}{\sqrt {5} + 2 \, \sqrt {x + 2} - 1}\right ) + \log \left (x - \sqrt {x + 2} + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 63, normalized size = 1.03 \begin {gather*} \frac {1}{5} \, \sqrt {5} \log \left (\frac {2 \, x^{2} - \sqrt {5} {\left (x + 3\right )} - {\left (\sqrt {5} {\left (2 \, x + 1\right )} - 5\right )} \sqrt {x + 2} + 7 \, x + 3}{x^{2} + x - 1}\right ) + \log \left (x - \sqrt {x + 2} + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 1.00, size = 94, normalized size = 1.54 \begin {gather*} 4 \left (\begin {cases} - \frac {\sqrt {5} \operatorname {acoth}{\left (\frac {2 \sqrt {5} \left (\sqrt {x + 2} - \frac {1}{2}\right )}{5} \right )}}{10} & \text {for}\: \left (\sqrt {x + 2} - \frac {1}{2}\right )^{2} > \frac {5}{4} \\- \frac {\sqrt {5} \operatorname {atanh}{\left (\frac {2 \sqrt {5} \left (\sqrt {x + 2} - \frac {1}{2}\right )}{5} \right )}}{10} & \text {for}\: \left (\sqrt {x + 2} - \frac {1}{2}\right )^{2} < \frac {5}{4} \end {cases}\right ) + \log {\left (x - \sqrt {x + 2} + 1 \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 2.26, size = 50, normalized size = 0.82 \begin {gather*} \frac {1}{5} \, \sqrt {5} \log \left (\frac {{\left | -\sqrt {5} + 2 \, \sqrt {x + 2} - 1 \right |}}{{\left | \sqrt {5} + 2 \, \sqrt {x + 2} - 1 \right |}}\right ) + \log \left ({\left | x - \sqrt {x + 2} + 1 \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.24, size = 71, normalized size = 1.16 \begin {gather*} \ln \left (2\,\sqrt {x+2}-\left (\frac {\sqrt {5}}{5}+1\right )\,\left (2\,\sqrt {x+2}-1\right )\right )\,\left (\frac {\sqrt {5}}{5}+1\right )-\ln \left (2\,\sqrt {x+2}+\left (\frac {\sqrt {5}}{5}-1\right )\,\left (2\,\sqrt {x+2}-1\right )\right )\,\left (\frac {\sqrt {5}}{5}-1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________