Optimal. Leaf size=54 \[ -\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 \left (1-x^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 8, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {6857, 266,
272, 45, 489, 12, 385, 213} \begin {gather*} -\frac {x^2}{4}+\frac {1}{4} \sqrt {2-x^2} x+\frac {1}{4} \log \left (1-x^2\right )-\frac {1}{2} \tanh ^{-1}\left (\frac {x}{\sqrt {2-x^2}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 45
Rule 213
Rule 266
Rule 272
Rule 385
Rule 489
Rule 6857
Rubi steps
\begin {align*} \int \frac {2 x-x^3+x^2 \sqrt {2-x^2}}{-2+2 x^2} \, dx &=\int \left (\frac {x}{-1+x^2}-\frac {x^3}{2 \left (-1+x^2\right )}+\frac {x^2 \sqrt {2-x^2}}{2 \left (-1+x^2\right )}\right ) \, dx\\ &=-\left (\frac {1}{2} \int \frac {x^3}{-1+x^2} \, dx\right )+\frac {1}{2} \int \frac {x^2 \sqrt {2-x^2}}{-1+x^2} \, dx+\int \frac {x}{-1+x^2} \, dx\\ &=\frac {1}{4} x \sqrt {2-x^2}+\frac {1}{2} \log \left (1-x^2\right )-\frac {1}{4} \int -\frac {2}{\sqrt {2-x^2} \left (-1+x^2\right )} \, dx-\frac {1}{4} \text {Subst}\left (\int \frac {x}{-1+x} \, dx,x,x^2\right )\\ &=\frac {1}{4} x \sqrt {2-x^2}+\frac {1}{2} \log \left (1-x^2\right )-\frac {1}{4} \text {Subst}\left (\int \left (1+\frac {1}{-1+x}\right ) \, dx,x,x^2\right )+\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 \left (1-x^2\right )+\frac {1}{2} \text {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 \left (1-x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 77, normalized size = 1.43 \begin {gather*} \frac {1}{4} \left (-x^2+x \sqrt {2-x^2}+\log (1-x)-\log (1+x)+\log \left (1-x^2\right )-\log \left (2-x+\sqrt {2-x^2}\right )+\log \left (2+x+\sqrt {2-x^2}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(110\) vs.
\(2(42)=84\).
time = 0.27, size = 111, normalized size = 2.06
method | result | size |
trager | \(-\frac {x^{2}}{4}+\frac {x \sqrt {-x^{2}+2}}{4}-\frac {\ln \left (-\frac {\sqrt {-x^{2}+2}+x}{\left (1+x \right ) \left (-1+x \right )}\right )}{2}\) | \(45\) |
default | \(\frac {x \sqrt {-x^{2}+2}}{4}+\frac {\sqrt {-\left (-1+x \right )^{2}+3-2 x}}{4}-\frac {\arctanh \left (\frac {4-2 x}{2 \sqrt {-\left (-1+x \right )^{2}+3-2 x}}\right )}{4}-\frac {\sqrt {-\left (1+x \right )^{2}+3+2 x}}{4}+\frac {\arctanh \left (\frac {4+2 x}{2 \sqrt {-\left (1+x \right )^{2}+3+2 x}}\right )}{4}-\frac {x^{2}}{4}+\frac {\ln \left (-1+x \right )}{4}+\frac {\ln \left (1+x \right )}{4}\) | \(111\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 94 vs.
\(2 (42) = 84\).
time = 0.50, size = 94, normalized size = 1.74 \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}{4} \, \log \left (\frac {2 \, \sqrt {-x^{2} + 2}}{{\left | 2 \, x + 2 \right |}} + \frac {2}{{\left | 2 \, x + 2 \right |}} + 1\right ) - \frac {1}{4} \, \log \left (\frac {2 \, \sqrt {-x^{2} + 2}}{{\left | 2 \, x - 2 \right |}} + \frac {2}{{\left | 2 \, x - 2 \right |}} - 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 67, normalized size = 1.24 \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]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {\int \left (- \frac {2 x}{x^{2} - 1}\right )\, dx + \int \frac {x^{3}}{x^{2} - 1}\, dx + \int \left (- \frac {x^{2} \sqrt {2 - x^{2}}}{x^{2} - 1}\right )\, dx}{2} \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. 117 vs.
\(2 (42) = 84\).
time = 3.99, size = 117, normalized size = 2.17 \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]
________________________________________________________________________________________
Mupad [B]
time = 3.33, size = 86, normalized size = 1.59 \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]
________________________________________________________________________________________