Optimal. Leaf size=40 \[ -\frac {\sqrt {\left (1+x^2\right )^2} \tanh ^{-1}\left (\frac {\sqrt {2} x}{1+x^2}\right )}{\sqrt {2} \left (1+x^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [C] Result contains complex when optimal does not.
time = 0.38, antiderivative size = 74, normalized size of antiderivative = 1.85, number of steps
used = 12, number of rules used = 7, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.206, Rules used = {6857, 1161, 8,
1162, 396, 212, 209} \begin {gather*} \frac {\sqrt {x^4+2 x^2+1} \tanh ^{-1}\left ((-1)^{3/4} x\right )}{\sqrt {2} \left (x^2+1\right )}+\frac {i \sqrt {x^4+2 x^2+1} \text {ArcTan}\left ((-1)^{3/4} x\right )}{\sqrt {2} \left (x^2+1\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 209
Rule 212
Rule 396
Rule 1161
Rule 1162
Rule 6857
Rubi steps
\begin {align*} \int \frac {\left (-1+x^2\right ) \sqrt {1+2 x^2+x^4}}{\left (1+x^2\right ) \left (1+x^4\right )} \, dx &=\int \left (\frac {\sqrt {1+2 x^2+x^4}}{-1-x^2}+\frac {x^2 \sqrt {1+2 x^2+x^4}}{1+x^4}\right ) \, dx\\ &=\int \frac {\sqrt {1+2 x^2+x^4}}{-1-x^2} \, dx+\int \frac {x^2 \sqrt {1+2 x^2+x^4}}{1+x^4} \, dx\\ &=\frac {\sqrt {1+2 x^2+x^4} \int 1 \, dx}{-1-x^2}+\int \left (-\frac {\sqrt {1+2 x^2+x^4}}{2 \left (i-x^2\right )}+\frac {\sqrt {1+2 x^2+x^4}}{2 \left (i+x^2\right )}\right ) \, dx\\ &=-\frac {x \sqrt {1+2 x^2+x^4}}{1+x^2}-\frac {1}{2} \int \frac {\sqrt {1+2 x^2+x^4}}{i-x^2} \, dx+\frac {1}{2} \int \frac {\sqrt {1+2 x^2+x^4}}{i+x^2} \, dx\\ &=-\frac {x \sqrt {1+2 x^2+x^4}}{1+x^2}-\frac {\sqrt {1+2 x^2+x^4} \int \frac {1+x^2}{i-x^2} \, dx}{2 \left (1+x^2\right )}+\frac {\sqrt {1+2 x^2+x^4} \int \frac {1+x^2}{i+x^2} \, dx}{2 \left (1+x^2\right )}\\ &=\frac {\left (\left (\frac {1}{2}-\frac {i}{2}\right ) \sqrt {1+2 x^2+x^4}\right ) \int \frac {1}{i+x^2} \, dx}{1+x^2}-\frac {\left (\left (\frac {1}{2}+\frac {i}{2}\right ) \sqrt {1+2 x^2+x^4}\right ) \int \frac {1}{i-x^2} \, dx}{1+x^2}\\ &=\frac {i \sqrt {1+2 x^2+x^4} \tan ^{-1}\left ((-1)^{3/4} x\right )}{\sqrt {2} \left (1+x^2\right )}+\frac {\sqrt {1+2 x^2+x^4} \tanh ^{-1}\left ((-1)^{3/4} x\right )}{\sqrt {2} \left (1+x^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 58, normalized size = 1.45 \begin {gather*} \frac {\sqrt {\left (1+x^2\right )^2} \left (\log \left (-1+\sqrt {2} x-x^2\right )-\log \left (1+\sqrt {2} x+x^2\right )\right )}{2 \sqrt {2} \left (1+x^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(78\) vs.
\(2(34)=68\).
time = 0.43, size = 79, normalized size = 1.98
method | result | size |
risch | \(\frac {\sqrt {\left (x^{2}+1\right )^{2}}\, \sqrt {2}\, \ln \left (x^{2}-\sqrt {2}\, x +1\right )}{4 x^{2}+4}-\frac {\sqrt {\left (x^{2}+1\right )^{2}}\, \sqrt {2}\, \ln \left (x^{2}+\sqrt {2}\, x +1\right )}{4 \left (x^{2}+1\right )}\) | \(67\) |
default | \(-\frac {\sqrt {\left (x^{2}+1\right )^{2}}\, \sqrt {2}\, \left (\ln \left (-\frac {x^{2}+\sqrt {2}\, x +1}{\sqrt {2}\, x -x^{2}-1}\right )-\ln \left (-\frac {\sqrt {2}\, x -x^{2}-1}{x^{2}+\sqrt {2}\, x +1}\right )\right )}{8 \left (x^{2}+1\right )}\) | \(79\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.47, size = 34, normalized size = 0.85 \begin {gather*} -\frac {1}{4} \, \sqrt {2} \log \left (x^{2} + \sqrt {2} x + 1\right ) + \frac {1}{4} \, \sqrt {2} \log \left (x^{2} - \sqrt {2} x + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 34, normalized size = 0.85 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (\frac {x^{4} + 4 \, x^{2} - 2 \, \sqrt {2} {\left (x^{3} + x\right )} + 1}{x^{4} + 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.05, size = 49, normalized size = 1.22 \begin {gather*} \frac {\sqrt {2} \log {\left (- \sqrt {2} x + \sqrt {\left (x^{2} + 1\right )^{2}} \right )}}{4} - \frac {\sqrt {2} \log {\left (\sqrt {2} x + \sqrt {\left (x^{2} + 1\right )^{2}} \right )}}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 34, normalized size = 0.85 \begin {gather*} -\frac {1}{4} \, \sqrt {2} \log \left (x^{2} + \sqrt {2} x + 1\right ) + \frac {1}{4} \, \sqrt {2} \log \left (x^{2} - \sqrt {2} x + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.09, size = 18, normalized size = 0.45 \begin {gather*} -\frac {\sqrt {2}\,\mathrm {atanh}\left (\frac {\sqrt {2}\,x}{x^2+1}\right )}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________