Optimal. Leaf size=56 \[ -\frac {1}{2} \sinh ^{-1}\left (\tan ^2(x)\right )-\frac {\tanh ^{-1}\left (\frac {1-\tan ^2(x)}{\sqrt {2} \sqrt {1+\tan ^4(x)}}\right )}{\sqrt {2}}+\frac {1}{2} \sqrt {1+\tan ^4(x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {3751, 1262,
749, 858, 221, 739, 212} \begin {gather*} \frac {1}{2} \sqrt {\tan ^4(x)+1}-\frac {\tanh ^{-1}\left (\frac {1-\tan ^2(x)}{\sqrt {2} \sqrt {\tan ^4(x)+1}}\right )}{\sqrt {2}}-\frac {1}{2} \sinh ^{-1}\left (\tan ^2(x)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 221
Rule 739
Rule 749
Rule 858
Rule 1262
Rule 3751
Rubi steps
\begin {align*} \int \tan (x) \sqrt {1+\tan ^4(x)} \, dx &=\text {Subst}\left (\int \frac {x \sqrt {1+x^4}}{1+x^2} \, dx,x,\tan (x)\right )\\ &=\frac {1}{2} \text {Subst}\left (\int \frac {\sqrt {1+x^2}}{1+x} \, dx,x,\tan ^2(x)\right )\\ &=\frac {1}{2} \sqrt {1+\tan ^4(x)}+\frac {1}{2} \text {Subst}\left (\int \frac {1-x}{(1+x) \sqrt {1+x^2}} \, dx,x,\tan ^2(x)\right )\\ &=\frac {1}{2} \sqrt {1+\tan ^4(x)}-\frac {1}{2} \text {Subst}\left (\int \frac {1}{\sqrt {1+x^2}} \, dx,x,\tan ^2(x)\right )+\text {Subst}\left (\int \frac {1}{(1+x) \sqrt {1+x^2}} \, dx,x,\tan ^2(x)\right )\\ &=-\frac {1}{2} \sinh ^{-1}\left (\tan ^2(x)\right )+\frac {1}{2} \sqrt {1+\tan ^4(x)}-\text {Subst}\left (\int \frac {1}{2-x^2} \, dx,x,\frac {1-\tan ^2(x)}{\sqrt {1+\tan ^4(x)}}\right )\\ &=-\frac {1}{2} \sinh ^{-1}\left (\tan ^2(x)\right )-\frac {\tanh ^{-1}\left (\frac {1-\tan ^2(x)}{\sqrt {2} \sqrt {1+\tan ^4(x)}}\right )}{\sqrt {2}}+\frac {1}{2} \sqrt {1+\tan ^4(x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.09, size = 74, normalized size = 1.32 \begin {gather*} \frac {\left (-2 \sqrt {2} \sinh ^{-1}(\cos (2 x)) \cos ^2(x)-2 \tanh ^{-1}\left (\frac {2 \sin ^2(x)}{\sqrt {3+\cos (4 x)}}\right ) \cos ^2(x)+\sqrt {3+\cos (4 x)}\right ) \sqrt {1+\tan ^4(x)}}{2 \sqrt {3+\cos (4 x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 64, normalized size = 1.14
method | result | size |
derivativedivides | \(\frac {\sqrt {\left (1+\tan ^{2}\left (x \right )\right )^{2}-2 \left (\tan ^{2}\left (x \right )\right )}}{2}-\frac {\arcsinh \left (\tan ^{2}\left (x \right )\right )}{2}-\frac {\sqrt {2}\, \arctanh \left (\frac {\left (-2 \left (\tan ^{2}\left (x \right )\right )+2\right ) \sqrt {2}}{4 \sqrt {\left (1+\tan ^{2}\left (x \right )\right )^{2}-2 \left (\tan ^{2}\left (x \right )\right )}}\right )}{2}\) | \(64\) |
default | \(\frac {\sqrt {\left (1+\tan ^{2}\left (x \right )\right )^{2}-2 \left (\tan ^{2}\left (x \right )\right )}}{2}-\frac {\arcsinh \left (\tan ^{2}\left (x \right )\right )}{2}-\frac {\sqrt {2}\, \arctanh \left (\frac {\left (-2 \left (\tan ^{2}\left (x \right )\right )+2\right ) \sqrt {2}}{4 \sqrt {\left (1+\tan ^{2}\left (x \right )\right )^{2}-2 \left (\tan ^{2}\left (x \right )\right )}}\right )}{2}\) | \(64\) |
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. 88 vs.
\(2 (43) = 86\).
time = 0.75, size = 88, normalized size = 1.57 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (\frac {3 \, \tan \left (x\right )^{4} - 2 \, \tan \left (x\right )^{2} + 2 \, \sqrt {\tan \left (x\right )^{4} + 1} {\left (\sqrt {2} \tan \left (x\right )^{2} - \sqrt {2}\right )} + 3}{\tan \left (x\right )^{4} + 2 \, \tan \left (x\right )^{2} + 1}\right ) + \frac {1}{2} \, \sqrt {\tan \left (x\right )^{4} + 1} + \frac {1}{2} \, \log \left (-\tan \left (x\right )^{2} + \sqrt {\tan \left (x\right )^{4} + 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 \sqrt {\tan ^{4}{\left (x \right )} + 1} \tan {\left (x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 79, normalized size = 1.41 \begin {gather*} \frac {1}{2} \, \sqrt {2} \log \left (-\frac {\tan \left (x\right )^{2} + \sqrt {2} - \sqrt {\tan \left (x\right )^{4} + 1} + 1}{\tan \left (x\right )^{2} - \sqrt {2} - \sqrt {\tan \left (x\right )^{4} + 1} + 1}\right ) + \frac {1}{2} \, \sqrt {\tan \left (x\right )^{4} + 1} + \frac {1}{2} \, \log \left (-\tan \left (x\right )^{2} + \sqrt {\tan \left (x\right )^{4} + 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \mathrm {tan}\left (x\right )\,\sqrt {{\mathrm {tan}\left (x\right )}^4+1} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________