Optimal. Leaf size=120 \[ x \tan ^{-1}\left (x \sqrt {1+x^2}\right )+\frac {1}{2} \tan ^{-1}\left (\sqrt {3}-2 \sqrt {1+x^2}\right )-\frac {1}{2} \tan ^{-1}\left (\sqrt {3}+2 \sqrt {1+x^2}\right )-\frac {1}{4} \sqrt {3} \log \left (2+x^2-\sqrt {3} \sqrt {1+x^2}\right )+\frac {1}{4} \sqrt {3} \log \left (2+x^2+\sqrt {3} \sqrt {1+x^2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 8, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {5311, 1699,
840, 1183, 648, 632, 210, 642} \begin {gather*} x \text {ArcTan}\left (x \sqrt {x^2+1}\right )+\frac {1}{2} \text {ArcTan}\left (\sqrt {3}-2 \sqrt {x^2+1}\right )-\frac {1}{2} \text {ArcTan}\left (2 \sqrt {x^2+1}+\sqrt {3}\right )-\frac {1}{4} \sqrt {3} \log \left (x^2-\sqrt {3} \sqrt {x^2+1}+2\right )+\frac {1}{4} \sqrt {3} \log \left (x^2+\sqrt {3} \sqrt {x^2+1}+2\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 642
Rule 648
Rule 840
Rule 1183
Rule 1699
Rule 5311
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+2 x^2\right )}{\sqrt {1+x^2} \left (1+x^2+x^4\right )} \, dx\\ &=x \tan ^{-1}\left (x \sqrt {1+x^2}\right )-\frac {1}{2} \text {Subst}\left (\int \frac {1+2 x}{\sqrt {1+x} \left (1+x+x^2\right )} \, dx,x,x^2\right )\\ &=x \tan ^{-1}\left (x \sqrt {1+x^2}\right )-\text {Subst}\left (\int \frac {-1+2 x^2}{1-x^2+x^4} \, dx,x,\sqrt {1+x^2}\right )\\ &=x \tan ^{-1}\left (x \sqrt {1+x^2}\right )-\frac {\text {Subst}\left (\int \frac {-\sqrt {3}+3 x}{1-\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )}{2 \sqrt {3}}-\frac {\text {Subst}\left (\int \frac {-\sqrt {3}-3 x}{1+\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )}{2 \sqrt {3}}\\ &=x \tan ^{-1}\left (x \sqrt {1+x^2}\right )-\frac {1}{4} \text {Subst}\left (\int \frac {1}{1-\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )-\frac {1}{4} \text {Subst}\left (\int \frac {1}{1+\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )-\frac {1}{4} \sqrt {3} \text {Subst}\left (\int \frac {-\sqrt {3}+2 x}{1-\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )+\frac {1}{4} \sqrt {3} \text {Subst}\left (\int \frac {\sqrt {3}+2 x}{1+\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )\\ &=x \tan ^{-1}\left (x \sqrt {1+x^2}\right )-\frac {1}{4} \sqrt {3} \log \left (2+x^2-\sqrt {3} \sqrt {1+x^2}\right )+\frac {1}{4} \sqrt {3} \log \left (2+x^2+\sqrt {3} \sqrt {1+x^2}\right )+\frac {1}{2} \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,-\sqrt {3}+2 \sqrt {1+x^2}\right )+\frac {1}{2} \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,\sqrt {3}+2 \sqrt {1+x^2}\right )\\ &=x \tan ^{-1}\left (x \sqrt {1+x^2}\right )+\frac {1}{2} \tan ^{-1}\left (\sqrt {3}-2 \sqrt {1+x^2}\right )-\frac {1}{2} \tan ^{-1}\left (\sqrt {3}+2 \sqrt {1+x^2}\right )-\frac {1}{4} \sqrt {3} \log \left (2+x^2-\sqrt {3} \sqrt {1+x^2}\right )+\frac {1}{4} \sqrt {3} \log \left (2+x^2+\sqrt {3} \sqrt {1+x^2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.11, size = 95, normalized size = 0.79 \begin {gather*} -\frac {1}{2} \left (1-i \sqrt {3}\right ) \tan ^{-1}\left (\frac {1}{2} \left (1-i \sqrt {3}\right ) \sqrt {1+x^2}\right )-\frac {1}{2} \left (1+i \sqrt {3}\right ) \tan ^{-1}\left (\frac {1}{2} \left (1+i \sqrt {3}\right ) \sqrt {1+x^2}\right )+x \tan ^{-1}\left (x \sqrt {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. \(507\) vs.
\(2(92)=184\).
time = 0.06, size = 508, normalized size = 4.23
method | result | size |
default | \(x \arctan \left (x \sqrt {x^{2}+1}\right )+\frac {\sqrt {2}\, \sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \sqrt {3}\, \arctanh \left (\frac {\sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \sqrt {3}}{2}\right )}{3 \sqrt {\frac {\frac {\left (1+x \right )^{2}}{\left (1-x \right )^{2}}+1}{\left (\frac {1+x}{1-x}+1\right )^{2}}}\, \left (\frac {1+x}{1-x}+1\right )}+\frac {\sqrt {2}\, \sqrt {\frac {2 \left (-1+x \right )^{2}}{\left (-1-x \right )^{2}}+2}\, \sqrt {3}\, \arctanh \left (\frac {\sqrt {\frac {2 \left (-1+x \right )^{2}}{\left (-1-x \right )^{2}}+2}\, \sqrt {3}}{2}\right )}{3 \sqrt {\frac {\frac {\left (-1+x \right )^{2}}{\left (-1-x \right )^{2}}+1}{\left (\frac {-1+x}{-1-x}+1\right )^{2}}}\, \left (\frac {-1+x}{-1-x}+1\right )}-\frac {\sqrt {2}\, \sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \left (\sqrt {3}\, \arctanh \left (\frac {\sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \sqrt {3}}{2}\right )-3 \arctan \left (\frac {\sqrt {\frac {2 \left (1+x \right )^{2}}{\left (1-x \right )^{2}}+2}\, \left (1+x \right )}{\left (\frac {\left (1+x \right )^{2}}{\left (1-x \right )^{2}}+1\right ) \left (1-x \right )}\right )\right )}{12 \sqrt {\frac {\frac {\left (1+x \right )^{2}}{\left (1-x \right )^{2}}+1}{\left (\frac {1+x}{1-x}+1\right )^{2}}}\, \left (\frac {1+x}{1-x}+1\right )}-\frac {\sqrt {2}\, \sqrt {\frac {2 \left (-1+x \right )^{2}}{\left (-1-x \right )^{2}}+2}\, \left (\sqrt {3}\, \arctanh \left (\frac {\sqrt {\frac {2 \left (-1+x \right )^{2}}{\left (-1-x \right )^{2}}+2}\, \sqrt {3}}{2}\right )-3 \arctan \left (\frac {\sqrt {\frac {2 \left (-1+x \right )^{2}}{\left (-1-x \right )^{2}}+2}\, \left (-1+x \right )}{\left (\frac {\left (-1+x \right )^{2}}{\left (-1-x \right )^{2}}+1\right ) \left (-1-x \right )}\right )\right )}{12 \sqrt {\frac {\frac {\left (-1+x \right )^{2}}{\left (-1-x \right )^{2}}+1}{\left (\frac {-1+x}{-1-x}+1\right )^{2}}}\, \left (\frac {-1+x}{-1-x}+1\right )}\) | \(508\) |
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 [B] Leaf count of result is larger than twice the leaf count of optimal. 287 vs.
\(2 (92) = 184\).
time = 0.93, size = 287, normalized size = 2.39 \begin {gather*} x \arctan \left (\sqrt {x^{2} + 1} x\right ) - \frac {1}{4} \, \sqrt {3} \log \left (32 \, x^{4} + 80 \, x^{2} + 32 \, \sqrt {3} {\left (x^{3} + x\right )} - 16 \, {\left (2 \, x^{3} + \sqrt {3} {\left (2 \, x^{2} + 1\right )} + 4 \, x\right )} \sqrt {x^{2} + 1} + 32\right ) + \frac {1}{4} \, \sqrt {3} \log \left (32 \, x^{4} + 80 \, x^{2} - 32 \, \sqrt {3} {\left (x^{3} + x\right )} - 16 \, {\left (2 \, x^{3} - \sqrt {3} {\left (2 \, x^{2} + 1\right )} + 4 \, x\right )} \sqrt {x^{2} + 1} + 32\right ) + \arctan \left (2 \, \sqrt {2 \, x^{4} + 5 \, x^{2} + 2 \, \sqrt {3} {\left (x^{3} + x\right )} - {\left (2 \, x^{3} + \sqrt {3} {\left (2 \, x^{2} + 1\right )} + 4 \, x\right )} \sqrt {x^{2} + 1} + 2} {\left (x + \sqrt {x^{2} + 1}\right )} + \sqrt {3} - 2 \, \sqrt {x^{2} + 1}\right ) + \arctan \left (2 \, \sqrt {2 \, x^{4} + 5 \, x^{2} - 2 \, \sqrt {3} {\left (x^{3} + x\right )} - {\left (2 \, x^{3} - \sqrt {3} {\left (2 \, x^{2} + 1\right )} + 4 \, x\right )} \sqrt {x^{2} + 1} + 2} {\left (x + \sqrt {x^{2} + 1}\right )} - \sqrt {3} - 2 \, \sqrt {x^{2} + 1}\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*} \int \operatorname {atan}{\left (x \sqrt {x^{2} + 1} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.68, size = 92, normalized size = 0.77 \begin {gather*} x \arctan \left (\sqrt {x^{2} + 1} x\right ) + \frac {1}{4} \, \sqrt {3} \log \left (x^{2} + \sqrt {3} \sqrt {x^{2} + 1} + 2\right ) - \frac {1}{4} \, \sqrt {3} \log \left (x^{2} - \sqrt {3} \sqrt {x^{2} + 1} + 2\right ) - \frac {1}{2} \, \arctan \left (\sqrt {3} + 2 \, \sqrt {x^{2} + 1}\right ) - \frac {1}{2} \, \arctan \left (-\sqrt {3} + 2 \, \sqrt {x^{2} + 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.09, size = 413, normalized size = 3.44 \begin {gather*} x\,\mathrm {atan}\left (x\,\sqrt {x^2+1}\right )-\frac {\left (\ln \left (x-\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-\ln \left (\frac {x}{2}+\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )\,\sqrt {x^2+1}+1+\frac {\sqrt {3}\,x\,1{}\mathrm {i}}{2}\right )\right )\,\left (2\,{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}{\sqrt {{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^2+1}\,\left (4\,{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3+1+\sqrt {3}\,1{}\mathrm {i}\right )}-\frac {\left (\ln \left (x+\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-\ln \left (1+\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )\,\sqrt {x^2+1}-\frac {x}{2}+\frac {\sqrt {3}\,x\,1{}\mathrm {i}}{2}\right )\right )\,\left (2\,{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}{\sqrt {{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^2+1}\,\left (4\,{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3-1+\sqrt {3}\,1{}\mathrm {i}\right )}-\frac {\left (\ln \left (x-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-\ln \left (\frac {x}{2}+\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )\,\sqrt {x^2+1}+1-\frac {\sqrt {3}\,x\,1{}\mathrm {i}}{2}\right )\right )\,\left (2\,{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}{\sqrt {{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^2+1}\,\left (4\,{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3-1+\sqrt {3}\,1{}\mathrm {i}\right )}-\frac {\left (\ln \left (x+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-\ln \left (1+\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )\,\sqrt {x^2+1}-\frac {x}{2}-\frac {\sqrt {3}\,x\,1{}\mathrm {i}}{2}\right )\right )\,\left (2\,{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}{\sqrt {{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^2+1}\,\left (4\,{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3+1+\sqrt {3}\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________