Optimal. Leaf size=122 \[ -\frac {\tan ^{-1}\left (\frac {1-2 x^2}{\sqrt {3}}\right )}{\sqrt {3}}-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {-\frac {-\sqrt {3}+i}{\sqrt {3}+i}} \sqrt {1-x^2}}\right )}{\sqrt {3}}-\frac {\tan ^{-1}\left (\frac {\sqrt {-\frac {-\sqrt {3}+i}{\sqrt {3}+i}} x}{\sqrt {1-x^2}}\right )}{\sqrt {3}}+\sin ^{-1}(x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.39, antiderivative size = 149, normalized size of antiderivative = 1.22, number of steps used = 13, number of rules used = 10, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.303, Rules used = {6742, 1293, 216, 1174, 377, 205, 1251, 773, 618, 204} \[ -\frac {x^2}{2}-\frac {\tan ^{-1}\left (\frac {1-2 x^2}{\sqrt {3}}\right )}{\sqrt {3}}-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {-\frac {-\sqrt {3}+i}{\sqrt {3}+i}} \sqrt {1-x^2}}\right )}{\sqrt {3}}-\frac {\tan ^{-1}\left (\frac {\sqrt {-\frac {-\sqrt {3}+i}{\sqrt {3}+i}} x}{\sqrt {1-x^2}}\right )}{\sqrt {3}}+\frac {1}{4} (1-x)^2+\frac {1}{4} (x+1)^2+\sin ^{-1}(x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 205
Rule 216
Rule 377
Rule 618
Rule 773
Rule 1174
Rule 1251
Rule 1293
Rule 6742
Rubi steps
\begin {align*} \int \frac {x \sqrt {1-x^2}}{x-x^3+\sqrt {1-x^2}} \, dx &=\int \left (\frac {1}{2} (-1+x)+\frac {1+x}{2}-\frac {x^2 \sqrt {1-x^2}}{1-x^2+x^4}+\frac {x^3 \left (1-x^2\right )}{1-x^2+x^4}\right ) \, dx\\ &=\frac {1}{4} (1-x)^2+\frac {1}{4} (1+x)^2-\int \frac {x^2 \sqrt {1-x^2}}{1-x^2+x^4} \, dx+\int \frac {x^3 \left (1-x^2\right )}{1-x^2+x^4} \, dx\\ &=\frac {1}{4} (1-x)^2+\frac {1}{4} (1+x)^2+\frac {1}{2} \operatorname {Subst}\left (\int \frac {(1-x) x}{1-x+x^2} \, dx,x,x^2\right )+\int \frac {1}{\sqrt {1-x^2}} \, dx-\int \frac {1}{\sqrt {1-x^2} \left (1-x^2+x^4\right )} \, dx\\ &=\frac {1}{4} (1-x)^2-\frac {x^2}{2}+\frac {1}{4} (1+x)^2+\sin ^{-1}(x)+\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{1-x+x^2} \, dx,x,x^2\right )+\frac {(2 i) \int \frac {1}{\sqrt {1-x^2} \left (-1-i \sqrt {3}+2 x^2\right )} \, dx}{\sqrt {3}}-\frac {(2 i) \int \frac {1}{\sqrt {1-x^2} \left (-1+i \sqrt {3}+2 x^2\right )} \, dx}{\sqrt {3}}\\ &=\frac {1}{4} (1-x)^2-\frac {x^2}{2}+\frac {1}{4} (1+x)^2+\sin ^{-1}(x)-\frac {(2 i) \operatorname {Subst}\left (\int \frac {1}{-1+i \sqrt {3}-\left (-1-i \sqrt {3}\right ) x^2} \, dx,x,\frac {x}{\sqrt {1-x^2}}\right )}{\sqrt {3}}+\frac {(2 i) \operatorname {Subst}\left (\int \frac {1}{-1-i \sqrt {3}-\left (-1+i \sqrt {3}\right ) x^2} \, dx,x,\frac {x}{\sqrt {1-x^2}}\right )}{\sqrt {3}}-\operatorname {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,-1+2 x^2\right )\\ &=\frac {1}{4} (1-x)^2-\frac {x^2}{2}+\frac {1}{4} (1+x)^2+\sin ^{-1}(x)-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {-\frac {i-\sqrt {3}}{i+\sqrt {3}}} \sqrt {1-x^2}}\right )}{\sqrt {3}}-\frac {\tan ^{-1}\left (\frac {\sqrt {-\frac {i-\sqrt {3}}{i+\sqrt {3}}} x}{\sqrt {1-x^2}}\right )}{\sqrt {3}}+\frac {\tan ^{-1}\left (\frac {-1+2 x^2}{\sqrt {3}}\right )}{\sqrt {3}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 1.37, size = 1910, normalized size = 15.66 \[ \text {result too large to display} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.61, size = 73, normalized size = 0.60 \[ \frac {1}{3} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x^{2} - 1\right )}\right ) + \frac {1}{3} \, \sqrt {3} \arctan \left (\frac {\sqrt {3} {\left (2 \, x^{2} - 1\right )} \sqrt {-x^{2} + 1}}{3 \, {\left (x^{3} - x\right )}}\right ) - 2 \, \arctan \left (\frac {\sqrt {-x^{2} + 1} - 1}{x}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.58, size = 193, normalized size = 1.58 \[ \frac {1}{2} \, \pi \mathrm {sgn}\relax (x) - \frac {1}{6} \, \sqrt {3} {\left (\pi \mathrm {sgn}\relax (x) + 2 \, \arctan \left (-\frac {\sqrt {3} x {\left (\frac {\sqrt {-x^{2} + 1} - 1}{x} + \frac {{\left (\sqrt {-x^{2} + 1} - 1\right )}^{2}}{x^{2}} - 1\right )}}{3 \, {\left (\sqrt {-x^{2} + 1} - 1\right )}}\right )\right )} - \frac {1}{6} \, \sqrt {3} {\left (\pi \mathrm {sgn}\relax (x) + 2 \, \arctan \left (\frac {\sqrt {3} x {\left (\frac {\sqrt {-x^{2} + 1} - 1}{x} - \frac {{\left (\sqrt {-x^{2} + 1} - 1\right )}^{2}}{x^{2}} + 1\right )}}{3 \, {\left (\sqrt {-x^{2} + 1} - 1\right )}}\right )\right )} + \frac {1}{3} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x^{2} - 1\right )}\right ) + \arctan \left (-\frac {x {\left (\frac {{\left (\sqrt {-x^{2} + 1} - 1\right )}^{2}}{x^{2}} - 1\right )}}{2 \, {\left (\sqrt {-x^{2} + 1} - 1\right )}}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.06, size = 234, normalized size = 1.92 \[ -2 \arctan \left (\frac {-1+\sqrt {-x^{2}+1}}{x}\right )+\frac {\sqrt {3}\, \arctan \left (\frac {\left (2 x^{2}-1\right ) \sqrt {3}}{3}\right )}{3}-\frac {i \sqrt {3}\, \ln \left (\frac {\left (-1-i \sqrt {3}\right ) \left (-1+\sqrt {-x^{2}+1}\right )}{x}+\frac {\left (-1+\sqrt {-x^{2}+1}\right )^{2}}{x^{2}}-1\right )}{6}-\frac {i \sqrt {3}\, \ln \left (\frac {\left (1-i \sqrt {3}\right ) \left (-1+\sqrt {-x^{2}+1}\right )}{x}+\frac {\left (-1+\sqrt {-x^{2}+1}\right )^{2}}{x^{2}}-1\right )}{6}+\frac {i \sqrt {3}\, \ln \left (\frac {\left (1+i \sqrt {3}\right ) \left (-1+\sqrt {-x^{2}+1}\right )}{x}+\frac {\left (-1+\sqrt {-x^{2}+1}\right )^{2}}{x^{2}}-1\right )}{6}+\frac {i \sqrt {3}\, \ln \left (\frac {\left (i \sqrt {3}-1\right ) \left (-1+\sqrt {-x^{2}+1}\right )}{x}+\frac {\left (-1+\sqrt {-x^{2}+1}\right )^{2}}{x^{2}}-1\right )}{6} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {1}{2} \, x^{2} + \int -\frac {x^{4} - x^{2}}{x^{3} - x - \sqrt {x + 1} \sqrt {-x + 1}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.89, size = 549, normalized size = 4.50 \[ \mathrm {asin}\relax (x)-\frac {\ln \left (\frac {\frac {\left (x\,\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )-1\right )\,1{}\mathrm {i}}{\sqrt {1-{\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )}^2}}-\sqrt {1-x^2}\,1{}\mathrm {i}}{\frac {\sqrt {3}}{2}-x+\frac {1}{2}{}\mathrm {i}}\right )}{\sqrt {1-{\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )}^2}\,\left (\sqrt {3}-4\,{\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )}^3+1{}\mathrm {i}\right )}+\frac {\ln \left (\frac {\frac {\left (x\,\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )-1\right )\,1{}\mathrm {i}}{\sqrt {1-{\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )}^2}}-\sqrt {1-x^2}\,1{}\mathrm {i}}{x-\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}}\right )}{\sqrt {1-{\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )}^2}\,\left (-\sqrt {3}+4\,{\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )}^3+1{}\mathrm {i}\right )}-\frac {\ln \left (\frac {\frac {\left (x\,\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )+1\right )\,1{}\mathrm {i}}{\sqrt {1-{\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )}^2}}+\sqrt {1-x^2}\,1{}\mathrm {i}}{x+\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}}\right )}{\sqrt {1-{\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )}^2}\,\left (-\sqrt {3}+4\,{\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )}^3+1{}\mathrm {i}\right )}-\frac {\ln \left (x-\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )\,\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )}{\sqrt {3}-4\,{\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )}^3+1{}\mathrm {i}}-\frac {\ln \left (x+\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )\,\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )}{\sqrt {3}-4\,{\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )}^3+1{}\mathrm {i}}+\frac {\ln \left (\frac {\frac {\left (x\,\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )+1\right )\,1{}\mathrm {i}}{\sqrt {1-{\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )}^2}}+\sqrt {1-x^2}\,1{}\mathrm {i}}{x+\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}}\right )}{\sqrt {1-{\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )}^2}\,\left (\sqrt {3}-4\,{\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )}^3+1{}\mathrm {i}\right )}+\frac {\ln \left (x-\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )\,\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )}{-\sqrt {3}+4\,{\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )}^3+1{}\mathrm {i}}+\frac {\ln \left (x+\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )\,\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )}{-\sqrt {3}+4\,{\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )}^3+1{}\mathrm {i}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ - \int \frac {x \sqrt {1 - x^{2}}}{x^{3} - x - \sqrt {1 - x^{2}}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________