Optimal. Leaf size=60 \[ -\frac {x^2}{4}+\frac {1}{4} \sqrt {2-x^2} x-\frac {1}{2} \tanh ^{-1}\left (\frac {x}{\sqrt {2-x^2}}\right )+\frac {1}{4} \log (1-x)+\frac {1}{4} \log (x+1) \]
________________________________________________________________________________________
Rubi [A] time = 0.30, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 7, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.233, Rules used = {6742, 195, 216, 697, 402, 377, 207} \begin {gather*} -\frac {x^2}{4}+\frac {1}{4} \sqrt {2-x^2} x-\frac {1}{2} \tanh ^{-1}\left (\frac {x}{\sqrt {2-x^2}}\right )+\frac {1}{4} \log (1-x)+\frac {1}{4} \log (x+1) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 195
Rule 207
Rule 216
Rule 377
Rule 402
Rule 697
Rule 6742
Rubi steps
\begin {align*} \int \frac {x \sqrt {2-x^2}}{x-\sqrt {2-x^2}} \, dx &=\int \left (\frac {\sqrt {2-x^2}}{2}+\frac {2-x^2}{4 (-1+x)}+\frac {2-x^2}{4 (1+x)}+\frac {\sqrt {2-x^2}}{2 \left (-1+x^2\right )}\right ) \, dx\\ &=\frac {1}{4} \int \frac {2-x^2}{-1+x} \, dx+\frac {1}{4} \int \frac {2-x^2}{1+x} \, dx+\frac {1}{2} \int \sqrt {2-x^2} \, dx+\frac {1}{2} \int \frac {\sqrt {2-x^2}}{-1+x^2} \, dx\\ &=\frac {1}{4} x \sqrt {2-x^2}+\frac {1}{4} \int \left (-1+\frac {1}{-1+x}-x\right ) \, dx+\frac {1}{4} \int \left (1-x+\frac {1}{1+x}\right ) \, dx+\frac {1}{2} \int \frac {1}{\sqrt {2-x^2} \left (-1+x^2\right )} \, dx\\ &=-\frac {x^2}{4}+\frac {1}{4} x \sqrt {2-x^2}+\frac {1}{4} \log (1-x)+\frac {1}{4} \log (1+x)+\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\frac {x}{\sqrt {2-x^2}}\right )\\ &=-\frac {x^2}{4}+\frac {1}{4} x \sqrt {2-x^2}-\frac {1}{2} \tanh ^{-1}\left (\frac {x}{\sqrt {2-x^2}}\right )+\frac {1}{4} \log (1-x)+\frac {1}{4} \log (1+x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.09, size = 77, normalized size = 1.28 \begin {gather*} \frac {1}{4} \left (-x^2+\sqrt {2-x^2} x+\log \left (1-x^2\right )-\log \left (\sqrt {2-x^2}-x+2\right )+\log \left (\sqrt {2-x^2}+x+2\right )+\log (1-x)-\log (x+1)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [C] time = 0.10, size = 72, normalized size = 1.20 \begin {gather*} -\frac {x^2}{4}+\frac {1}{4} \sqrt {2-x^2} x+\frac {1}{2} \log \left (\sqrt {2-x^2}-i x+(1-i)\right )+\tanh ^{-1}\left (-(1+i) \sqrt {2-x^2}+(-1+i) x+1\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.63, size = 67, normalized size = 1.12 \begin {gather*} -\frac {1}{4} \, x^{2} + \frac {1}{4} \, \sqrt {-x^{2} + 2} x + \frac {1}{4} \, \log \left (x^{2} - 1\right ) - \frac {1}{8} \, \log \left (-\frac {\sqrt {-x^{2} + 2} x + 1}{x^{2}}\right ) + \frac {1}{8} \, \log \left (\frac {\sqrt {-x^{2} + 2} x - 1}{x^{2}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.51, size = 117, normalized size = 1.95 \begin {gather*} -\frac {1}{4} \, x^{2} + \frac {1}{4} \, \sqrt {-x^{2} + 2} x + \frac {1}{4} \, \log \left ({\left | x^{2} - 1 \right |}\right ) - \frac {1}{4} \, \log \left ({\left | \frac {x}{\sqrt {2} - \sqrt {-x^{2} + 2}} - \frac {\sqrt {2} - \sqrt {-x^{2} + 2}}{x} + 2 \right |}\right ) + \frac {1}{4} \, \log \left ({\left | \frac {x}{\sqrt {2} - \sqrt {-x^{2} + 2}} - \frac {\sqrt {2} - \sqrt {-x^{2} + 2}}{x} - 2 \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.02, size = 111, normalized size = 1.85 \begin {gather*} -\frac {x^{2}}{4}+\frac {\sqrt {-x^{2}+2}\, x}{4}-\frac {\arctanh \left (\frac {-2 x +4}{2 \sqrt {-2 x -\left (x -1\right )^{2}+3}}\right )}{4}+\frac {\arctanh \left (\frac {2 x +4}{2 \sqrt {2 x -\left (x +1\right )^{2}+3}}\right )}{4}+\frac {\ln \left (x -1\right )}{4}+\frac {\ln \left (x +1\right )}{4}+\frac {\sqrt {-2 x -\left (x -1\right )^{2}+3}}{4}-\frac {\sqrt {2 x -\left (x +1\right )^{2}+3}}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} -\frac {1}{2} \, x^{2} - \int -\frac {x^{2}}{x - \sqrt {-x^{2} + 2}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.38, size = 86, normalized size = 1.43 \begin {gather*} \frac {\ln \left (x-1\right )}{4}+\frac {\ln \left (x+1\right )}{4}-\frac {\ln \left (\frac {-x\,1{}\mathrm {i}+\sqrt {2-x^2}\,1{}\mathrm {i}+2{}\mathrm {i}}{x-1}\right )}{4}+\frac {\ln \left (\frac {x\,1{}\mathrm {i}+\sqrt {2-x^2}\,1{}\mathrm {i}+2{}\mathrm {i}}{x+1}\right )}{4}+\frac {x\,\sqrt {2-x^2}}{4}-\frac {x^2}{4} \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 {x \sqrt {2 - x^{2}}}{x - \sqrt {2 - x^{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________