Optimal. Leaf size=51 \[ -\frac {x}{2}-\frac {1}{2} \sqrt {2 x-x^2}+\frac {1}{2} \tanh ^{-1}\left (\sqrt {2 x-x^2}\right )-\frac {1}{2} \log (1-x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {6874, 45, 699,
702, 213} \begin {gather*} -\frac {1}{2} \sqrt {2 x-x^2}+\frac {1}{2} \tanh ^{-1}\left (\sqrt {2 x-x^2}\right )-\frac {x}{2}-\frac {1}{2} \log (1-x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 213
Rule 699
Rule 702
Rule 6874
Rubi steps
\begin {align*} \int \frac {x+\sqrt {2 x-x^2}}{2-2 x} \, dx &=\int \left (-\frac {x}{2 (-1+x)}+\frac {\sqrt {2 x-x^2}}{2 (1-x)}\right ) \, dx\\ &=-\left (\frac {1}{2} \int \frac {x}{-1+x} \, dx\right )+\frac {1}{2} \int \frac {\sqrt {2 x-x^2}}{1-x} \, dx\\ &=-\frac {1}{2} \sqrt {2 x-x^2}-\frac {1}{2} \int \left (1+\frac {1}{-1+x}\right ) \, dx+\frac {1}{2} \int \frac {1}{(1-x) \sqrt {2 x-x^2}} \, dx\\ &=-\frac {x}{2}-\frac {1}{2} \sqrt {2 x-x^2}-\frac {1}{2} \log (1-x)-2 \text {Subst}\left (\int \frac {1}{-4+4 x^2} \, dx,x,\sqrt {2 x-x^2}\right )\\ &=-\frac {x}{2}-\frac {1}{2} \sqrt {2 x-x^2}+\frac {1}{2} \tanh ^{-1}\left (\sqrt {2 x-x^2}\right )-\frac {1}{2} \log (1-x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.09, size = 45, normalized size = 0.88 \begin {gather*} \frac {1}{2} \left (i \pi -x-\sqrt {-((-2+x) x)}+\log (-2+x)-2 \log \left (-2+x+\sqrt {-((-2+x) x)}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.25, size = 38, normalized size = 0.75
method | result | size |
trager | \(-\frac {x}{2}+\frac {3}{2}-\frac {\sqrt {-x^{2}+2 x}}{2}-\frac {\ln \left (\sqrt {-x^{2}+2 x}-1\right )}{2}\) | \(35\) |
default | \(-\frac {x}{2}-\frac {\ln \left (-1+x \right )}{2}-\frac {\sqrt {-\left (-1+x \right )^{2}+1}}{2}+\frac {\arctanh \left (\frac {1}{\sqrt {-\left (-1+x \right )^{2}+1}}\right )}{2}\) | \(38\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 54, normalized size = 1.06 \begin {gather*} -\frac {1}{2} \, x - \frac {1}{2} \, \sqrt {-x^{2} + 2 \, x} - \frac {1}{2} \, \log \left (x - 1\right ) + \frac {1}{2} \, \log \left (\frac {2 \, \sqrt {-x^{2} + 2 \, x}}{{\left | x - 1 \right |}} + \frac {2}{{\left | x - 1 \right |}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.33, size = 66, normalized size = 1.29 \begin {gather*} -\frac {1}{2} \, x - \frac {1}{2} \, \sqrt {-x^{2} + 2 \, x} - \frac {1}{2} \, \log \left (x - 1\right ) + \frac {1}{2} \, \log \left (\frac {x + \sqrt {-x^{2} + 2 \, x}}{x}\right ) - \frac {1}{2} \, \log \left (-\frac {x - \sqrt {-x^{2} + 2 \, x}}{x}\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*} - \frac {\int \frac {x}{x - 1}\, dx + \int \frac {\sqrt {- x^{2} + 2 x}}{x - 1}\, dx}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 2.71, size = 50, normalized size = 0.98 \begin {gather*} -\frac {1}{2} \, x - \frac {1}{2} \, \sqrt {-x^{2} + 2 \, x} - \frac {1}{2} \, \log \left (-\frac {2 \, {\left (\sqrt {-x^{2} + 2 \, x} - 1\right )}}{{\left | -2 \, x + 2 \right |}}\right ) - \frac {1}{2} \, \log \left ({\left | x - 1 \right |}\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 {x+\sqrt {2\,x-x^2}}{2\,x-2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________