Optimal. Leaf size=141 \[ -\frac {1}{2} \sin ^{-1}(x)+\frac {1}{4} \sqrt {3} \tan ^{-1}\left (\frac {-1+\sqrt {3} x}{\sqrt {1-x^2}}\right )+\frac {1}{4} \sqrt {3} \tan ^{-1}\left (\frac {1+\sqrt {3} x}{\sqrt {1-x^2}}\right )-\frac {1}{4} \sqrt {3} \tan ^{-1}\left (\frac {-1+2 x^2}{\sqrt {3}}\right )+x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )-\frac {1}{4} \tanh ^{-1}\left (x \sqrt {1-x^2}\right )-\frac {1}{8} \log \left (1-x^2+x^4\right ) \]
[Out]
________________________________________________________________________________________
Rubi [C] Result contains complex when optimal does not.
time = 0.49, antiderivative size = 269, normalized size of antiderivative = 1.91, number of
steps used = 40, number of rules used = 15, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.071, Rules used
= {5311, 12, 6874, 222, 1128, 648, 632, 210, 642, 1188, 399, 385, 211, 1307, 1121}
\begin {gather*} \frac {1}{4} \sqrt {3} \tan ^{-1}\left (\frac {1-2 x^2}{\sqrt {3}}\right )+\frac {1}{12} \left (-\sqrt {3}+3 i\right ) \tan ^{-1}\left (\frac {x}{\sqrt {-\frac {-\sqrt {3}+i}{\sqrt {3}+i}} \sqrt {1-x^2}}\right )+\frac {\tan ^{-1}\left (\frac {x}{\sqrt {-\frac {-\sqrt {3}+i}{\sqrt {3}+i}} \sqrt {1-x^2}}\right )}{\sqrt {3}}-\frac {1}{12} \left (\sqrt {3}+3 i\right ) \tan ^{-1}\left (\frac {\sqrt {-\frac {-\sqrt {3}+i}{\sqrt {3}+i}} x}{\sqrt {1-x^2}}\right )+\frac {\tan ^{-1}\left (\frac {\sqrt {-\frac {-\sqrt {3}+i}{\sqrt {3}+i}} x}{\sqrt {1-x^2}}\right )}{\sqrt {3}}+x \tan ^{-1}\left (\sqrt {1-x^2}+x\right )-\frac {1}{8} \log \left (x^4-x^2+1\right )-\frac {1}{2} \sin ^{-1}(x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 210
Rule 211
Rule 222
Rule 385
Rule 399
Rule 632
Rule 642
Rule 648
Rule 1121
Rule 1128
Rule 1188
Rule 1307
Rule 5311
Rule 6874
Rubi steps
\begin {align*} \int \tan ^{-1}\left (x+\sqrt {1-x^2}\right ) \, dx &=x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )-\int \frac {x \left (1-\frac {x}{\sqrt {1-x^2}}\right )}{2 \left (1+x \sqrt {1-x^2}\right )} \, dx\\ &=x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )-\frac {1}{2} \int \frac {x \left (1-\frac {x}{\sqrt {1-x^2}}\right )}{1+x \sqrt {1-x^2}} \, dx\\ &=x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )-\frac {1}{2} \int \left (\frac {x^2}{-x+x^3-\sqrt {1-x^2}}+\frac {x}{1+x \sqrt {1-x^2}}\right ) \, dx\\ &=x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )-\frac {1}{2} \int \frac {x^2}{-x+x^3-\sqrt {1-x^2}} \, dx-\frac {1}{2} \int \frac {x}{1+x \sqrt {1-x^2}} \, dx\\ &=x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )-\frac {1}{2} \int \left (\frac {x}{1-x^2+x^4}-\frac {x^2 \sqrt {1-x^2}}{1-x^2+x^4}\right ) \, dx-\frac {1}{2} \int \left (-\frac {1}{\sqrt {1-x^2}}+\frac {x^3}{1-x^2+x^4}+\frac {\sqrt {1-x^2}}{1-x^2+x^4}-\frac {x^2 \sqrt {1-x^2}}{1-x^2+x^4}\right ) \, dx\\ &=x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )+\frac {1}{2} \int \frac {1}{\sqrt {1-x^2}} \, dx-\frac {1}{2} \int \frac {x}{1-x^2+x^4} \, dx-\frac {1}{2} \int \frac {x^3}{1-x^2+x^4} \, dx-\frac {1}{2} \int \frac {\sqrt {1-x^2}}{1-x^2+x^4} \, dx+2 \left (\frac {1}{2} \int \frac {x^2 \sqrt {1-x^2}}{1-x^2+x^4} \, dx\right )\\ &=\frac {1}{2} \sin ^{-1}(x)+x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )-\frac {1}{4} \text {Subst}\left (\int \frac {1}{1-x+x^2} \, dx,x,x^2\right )-\frac {1}{4} \text {Subst}\left (\int \frac {x}{1-x+x^2} \, dx,x,x^2\right )+2 \left (-\left (\frac {1}{2} \int \frac {1}{\sqrt {1-x^2}} \, dx\right )+\frac {1}{2} \int \frac {1}{\sqrt {1-x^2} \left (1-x^2+x^4\right )} \, dx\right )+\frac {i \int \frac {\sqrt {1-x^2}}{-1-i \sqrt {3}+2 x^2} \, dx}{\sqrt {3}}-\frac {i \int \frac {\sqrt {1-x^2}}{-1+i \sqrt {3}+2 x^2} \, dx}{\sqrt {3}}\\ &=\frac {1}{2} \sin ^{-1}(x)+x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )-\frac {1}{8} \text {Subst}\left (\int \frac {1}{1-x+x^2} \, dx,x,x^2\right )-\frac {1}{8} \text {Subst}\left (\int \frac {-1+2 x}{1-x+x^2} \, dx,x,x^2\right )+\frac {1}{2} \text {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,-1+2 x^2\right )+2 \left (-\frac {1}{2} \sin ^{-1}(x)-\frac {i \int \frac {1}{\sqrt {1-x^2} \left (-1-i \sqrt {3}+2 x^2\right )} \, dx}{\sqrt {3}}+\frac {i \int \frac {1}{\sqrt {1-x^2} \left (-1+i \sqrt {3}+2 x^2\right )} \, dx}{\sqrt {3}}\right )+\frac {1}{6} \left (3-i \sqrt {3}\right ) \int \frac {1}{\sqrt {1-x^2} \left (-1+i \sqrt {3}+2 x^2\right )} \, dx+\frac {1}{6} \left (3+i \sqrt {3}\right ) \int \frac {1}{\sqrt {1-x^2} \left (-1-i \sqrt {3}+2 x^2\right )} \, dx\\ &=\frac {1}{2} \sin ^{-1}(x)+\frac {\tan ^{-1}\left (\frac {1-2 x^2}{\sqrt {3}}\right )}{2 \sqrt {3}}+x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )-\frac {1}{8} \log \left (1-x^2+x^4\right )+\frac {1}{4} \text {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,-1+2 x^2\right )+2 \left (-\frac {1}{2} \sin ^{-1}(x)+\frac {i \text {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 {i \text {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}}\right )+\frac {1}{6} \left (3-i \sqrt {3}\right ) \text {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 )+\frac {1}{6} \left (3+i \sqrt {3}\right ) \text {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 )\\ &=\frac {1}{2} \sin ^{-1}(x)+\frac {1}{4} \sqrt {3} \tan ^{-1}\left (\frac {1-2 x^2}{\sqrt {3}}\right )+\frac {1}{12} \left (3 i-\sqrt {3}\right ) \tan ^{-1}\left (\frac {x}{\sqrt {-\frac {i-\sqrt {3}}{i+\sqrt {3}}} \sqrt {1-x^2}}\right )-\frac {1}{12} \left (3 i+\sqrt {3}\right ) \tan ^{-1}\left (\frac {\sqrt {-\frac {i-\sqrt {3}}{i+\sqrt {3}}} x}{\sqrt {1-x^2}}\right )+2 \left (-\frac {1}{2} \sin ^{-1}(x)+\frac {\tan ^{-1}\left (\frac {x}{\sqrt {-\frac {i-\sqrt {3}}{i+\sqrt {3}}} \sqrt {1-x^2}}\right )}{2 \sqrt {3}}+\frac {\tan ^{-1}\left (\frac {\sqrt {-\frac {i-\sqrt {3}}{i+\sqrt {3}}} x}{\sqrt {1-x^2}}\right )}{2 \sqrt {3}}\right )+x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )-\frac {1}{8} \log \left (1-x^2+x^4\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.30, size = 307, normalized size = 2.18 \begin {gather*} x \tan ^{-1}\left (x+\sqrt {1-x^2}\right )+\frac {1}{8} \left ((-4-4 i) \tan ^{-1}\left (\frac {x}{\sqrt {1-x^2}}\right )-2 i \tan ^{-1}\left (\frac {x+i \left (-1+\sqrt {1-x^2}\right )}{i+x-2 i x^2+(i+2 x) \sqrt {1-x^2}}\right )-4 i \sqrt {3} \tanh ^{-1}\left (\frac {1-(1+i) x+(1-i) \sqrt {1-x^2}}{\sqrt {3}}\right )-2 \log \left (1+\sqrt {3}+(1+i) x-(1-i) \sqrt {1-x^2}\right )-2 i \sqrt {3} \log \left (1+\sqrt {3}+(1+i) x-(1-i) \sqrt {1-x^2}\right )-2 \log \left (-1+\sqrt {3}-(1+i) x+(1-i) \sqrt {1-x^2}\right )+2 i \sqrt {3} \log \left (-1+\sqrt {3}-(1+i) x+(1-i) \sqrt {1-x^2}\right )-\log \left (\left (-1+i x+x^2\right ) \left (-1+2 x^2+2 i x \sqrt {1-x^2}\right )\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Mathics [F(-1)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains complex when optimal does not.
time = 0.06, size = 439, normalized size = 3.11
method | result | size |
default | \(x \arctan \left (x +\sqrt {-x^{2}+1}\right )-\frac {\ln \left (x^{4}-x^{2}+1\right )}{8}-\frac {\arctan \left (\frac {\left (2 x^{2}-1\right ) \sqrt {3}}{3}\right ) \sqrt {3}}{4}-\frac {i \sqrt {3}\, \ln \left (\frac {\left (\sqrt {-x^{2}+1}-1\right )^{2}}{x^{2}}+\frac {\left (1+i \sqrt {3}\right ) \left (\sqrt {-x^{2}+1}-1\right )}{x}-1\right )}{8}-\frac {\ln \left (\frac {\left (\sqrt {-x^{2}+1}-1\right )^{2}}{x^{2}}+\frac {\left (1+i \sqrt {3}\right ) \left (\sqrt {-x^{2}+1}-1\right )}{x}-1\right )}{8}-\frac {\ln \left (\frac {\left (\sqrt {-x^{2}+1}-1\right )^{2}}{x^{2}}+\frac {\left (1-i \sqrt {3}\right ) \left (\sqrt {-x^{2}+1}-1\right )}{x}-1\right )}{8}+\frac {i \sqrt {3}\, \ln \left (\frac {\left (\sqrt {-x^{2}+1}-1\right )^{2}}{x^{2}}+\frac {\left (1-i \sqrt {3}\right ) \left (\sqrt {-x^{2}+1}-1\right )}{x}-1\right )}{8}-\frac {i \sqrt {3}\, \ln \left (\frac {\left (\sqrt {-x^{2}+1}-1\right )^{2}}{x^{2}}+\frac {\left (-1+i \sqrt {3}\right ) \left (\sqrt {-x^{2}+1}-1\right )}{x}-1\right )}{8}+\frac {\ln \left (\frac {\left (\sqrt {-x^{2}+1}-1\right )^{2}}{x^{2}}+\frac {\left (-1-i \sqrt {3}\right ) \left (\sqrt {-x^{2}+1}-1\right )}{x}-1\right )}{8}+\frac {\ln \left (\frac {\left (\sqrt {-x^{2}+1}-1\right )^{2}}{x^{2}}+\frac {\left (-1+i \sqrt {3}\right ) \left (\sqrt {-x^{2}+1}-1\right )}{x}-1\right )}{8}+\frac {i \sqrt {3}\, \ln \left (\frac {\left (\sqrt {-x^{2}+1}-1\right )^{2}}{x^{2}}+\frac {\left (-1-i \sqrt {3}\right ) \left (\sqrt {-x^{2}+1}-1\right )}{x}-1\right )}{8}+\arctan \left (\frac {\sqrt {-x^{2}+1}-1}{x}\right )\) | \(439\) |
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*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 191, normalized size = 1.35 \begin {gather*} x \arctan \left (x + \sqrt {-x^{2} + 1}\right ) - \frac {1}{4} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x^{2} - 1\right )}\right ) - \frac {1}{8} \, \sqrt {3} \arctan \left (\frac {4 \, \sqrt {3} \sqrt {-x^{2} + 1} x + \sqrt {3}}{3 \, {\left (2 \, x^{2} - 1\right )}}\right ) - \frac {1}{8} \, \sqrt {3} \arctan \left (\frac {4 \, \sqrt {3} \sqrt {-x^{2} + 1} x - \sqrt {3}}{3 \, {\left (2 \, x^{2} - 1\right )}}\right ) + \frac {1}{2} \, \arctan \left (\frac {\sqrt {-x^{2} + 1} x}{x^{2} - 1}\right ) - \frac {1}{8} \, \log \left (x^{4} - x^{2} + 1\right ) - \frac {1}{16} \, \log \left (-x^{4} + x^{2} + 2 \, \sqrt {-x^{2} + 1} x + 1\right ) + \frac {1}{16} \, \log \left (-x^{4} + x^{2} - 2 \, \sqrt {-x^{2} + 1} x + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \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. 364 vs.
\(2 (110) = 220\).
time = 0.02, size = 481, normalized size = 3.41 \begin {gather*} -\frac {\ln \left (x^{4}-x^{2}+1\right )}{8}-\frac {3 \arctan \left (\frac {2 x^{2}-1}{\sqrt {3}}\right )}{4 \sqrt {3}}-\frac {3 \left (-\frac {1}{2} \pi \mathrm {sign}\left (x\right )-\arctan \left (\frac {2 x \left (\left (-\frac {-2 \sqrt {-x^{2}+1}+2}{2 x}\right )^{2}-1+\frac {-2 \sqrt {-x^{2}+1}+2}{2 x}\right )}{\sqrt {3} \left (-2 \sqrt {-x^{2}+1}+2\right )}\right )\right )}{4 \sqrt {3}}-\frac {3 \left (-\frac {1}{2} \pi \mathrm {sign}\left (x\right )-\arctan \left (\frac {2 x \left (\left (-\frac {-2 \sqrt {-x^{2}+1}+2}{2 x}\right )^{2}-1-\frac {-2 \sqrt {-x^{2}+1}+2}{2 x}\right )}{\sqrt {3} \left (-2 \sqrt {-x^{2}+1}+2\right )}\right )\right )}{4 \sqrt {3}}+\frac {-\frac {1}{2} \pi \mathrm {sign}\left (x\right )-\arctan \left (\frac {x \left (\left (-\frac {-2 \sqrt {-x^{2}+1}+2}{2 x}\right )^{2}-1\right )}{-2 \sqrt {-x^{2}+1}+2}\right )}{2}-\frac {\ln \left (\left (\frac {2 x}{-2 \sqrt {-x^{2}+1}+2}-\frac {-2 \sqrt {-x^{2}+1}+2}{2 x}\right )^{2}+2 \left (\frac {2 x}{-2 \sqrt {-x^{2}+1}+2}-\frac {-2 \sqrt {-x^{2}+1}+2}{2 x}\right )+4\right )}{8}+\frac {\ln \left (\left (\frac {2 x}{-2 \sqrt {-x^{2}+1}+2}-\frac {-2 \sqrt {-x^{2}+1}+2}{2 x}\right )^{2}-2 \left (\frac {2 x}{-2 \sqrt {-x^{2}+1}+2}-\frac {-2 \sqrt {-x^{2}+1}+2}{2 x}\right )+4\right )}{8}+x \arctan \left (x+\sqrt {-x^{2}+1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.37, size = 661, normalized size = 4.69
result too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________