Optimal. Leaf size=32 \[ -\frac {\sin ^{-1}(\tan (x))}{\sqrt {2}}+\tan ^{-1}\left (\frac {\sqrt {2} \tan (x)}{\sqrt {1-\tan ^2(x)}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.454, Rules used = {12, 399, 222,
385, 209} \begin {gather*} \tan ^{-1}\left (\frac {\sqrt {2} \tan (x)}{\sqrt {1-\tan ^2(x)}}\right )-\frac {\sin ^{-1}(\tan (x))}{\sqrt {2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 209
Rule 222
Rule 385
Rule 399
Rubi steps
\begin {align*} \int \sqrt {\cot (2 x) \tan (x)} \, dx &=\text {Subst}\left (\int \frac {\sqrt {1-x^2}}{\sqrt {2} \left (1+x^2\right )} \, dx,x,\tan (x)\right )\\ &=\frac {\text {Subst}\left (\int \frac {\sqrt {1-x^2}}{1+x^2} \, dx,x,\tan (x)\right )}{\sqrt {2}}\\ &=-\frac {\text {Subst}\left (\int \frac {1}{\sqrt {1-x^2}} \, dx,x,\tan (x)\right )}{\sqrt {2}}+\sqrt {2} \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \left (1+x^2\right )} \, dx,x,\tan (x)\right )\\ &=-\frac {\sin ^{-1}(\tan (x))}{\sqrt {2}}+\sqrt {2} \text {Subst}\left (\int \frac {1}{1+2 x^2} \, dx,x,\frac {\tan (x)}{\sqrt {1-\tan ^2(x)}}\right )\\ &=-\frac {\sin ^{-1}(\tan (x))}{\sqrt {2}}+\tan ^{-1}\left (\frac {\sqrt {2} \tan (x)}{\sqrt {1-\tan ^2(x)}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 52, normalized size = 1.62 \begin {gather*} \frac {\left (\sqrt {2} \sin ^{-1}\left (\sqrt {2} \sin (x)\right )-\tan ^{-1}\left (\frac {\sin (x)}{\sqrt {\cos (2 x)}}\right )\right ) \cos (x) \sqrt {\cot (2 x) \tan (x)}}{\sqrt {\cos (2 x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Mathics [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {cought exception: maximum recursion depth exceeded} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 0.48, size = 242, normalized size = 7.56
method | result | size |
default | \(\frac {\sqrt {2}\, \left (4 \EllipticPi \left (\frac {\sqrt {3+2 \sqrt {2}}\, \left (\cos \left (x \right )-1\right )}{\sin \left (x \right )}, -\frac {1}{3+2 \sqrt {2}}, \frac {\sqrt {3-2 \sqrt {2}}}{\sqrt {3+2 \sqrt {2}}}\right )-\EllipticF \left (\frac {\left (\cos \left (x \right )-1\right ) \left (1+\sqrt {2}\right )}{\sin \left (x \right )}, 3-2 \sqrt {2}\right )-2 \EllipticPi \left (\frac {\sqrt {3+2 \sqrt {2}}\, \left (\cos \left (x \right )-1\right )}{\sin \left (x \right )}, \frac {1}{3+2 \sqrt {2}}, \frac {\sqrt {3-2 \sqrt {2}}}{\sqrt {3+2 \sqrt {2}}}\right )\right ) \left (2+\sqrt {2}\right ) \cos \left (x \right ) \left (\sin ^{2}\left (x \right )\right ) \sqrt {\frac {2 \left (\cos ^{2}\left (x \right )\right )-1}{\cos \left (x \right )^{2}}}\, \sqrt {-\frac {2 \left (\cos \left (x \right ) \sqrt {2}-\sqrt {2}-2 \cos \left (x \right )+1\right )}{1+\cos \left (x \right )}}\, \sqrt {\frac {\cos \left (x \right ) \sqrt {2}+2 \cos \left (x \right )-\sqrt {2}-1}{1+\cos \left (x \right )}}}{2 \sqrt {3+2 \sqrt {2}}\, \left (1+\sqrt {2}\right ) \left (\cos \left (x \right )-1\right ) \left (2 \left (\cos ^{2}\left (x \right )\right )-1\right )}\) | \(242\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \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. 115 vs.
\(2 (26) = 52\).
time = 0.34, size = 115, normalized size = 3.59 \begin {gather*} \frac {1}{4} \, \sqrt {2} \arctan \left (\frac {\sqrt {2} {\left (3 \, \cos \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) - 1\right )} \sqrt {\frac {\cos \left (2 \, x\right )}{\cos \left (2 \, x\right ) + 1}}}{4 \, \cos \left (2 \, x\right ) \sin \left (2 \, x\right )}\right ) - \frac {1}{2} \, \arctan \left (\frac {\sqrt {2} {\left (2 \, \sqrt {2} \cos \left (2 \, x\right )^{2} + \sqrt {2} \cos \left (2 \, x\right ) - \sqrt {2}\right )} \sqrt {\frac {\cos \left (2 \, x\right )}{\cos \left (2 \, x\right ) + 1}}}{4 \, \cos \left (2 \, x\right ) \sin \left (2 \, x\right )}\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 {\frac {\cot {\left (2 x \right )}}{\cot {\left (x \right )}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains complex when optimal does not.
time = 0.05, size = 171, normalized size = 5.34 \begin {gather*} \frac {1}{2} \left (\pi -\sqrt {2} \arctan \left (-\mathrm {i}\right )-\sqrt {2} \arctan \left (\sqrt {2}\right )-\mathrm {i} \ln \left (2 \sqrt {2}+3\right )\right ) \mathrm {sign}\left (\sin \left (2 x\right )\right )+\frac {\left (-\frac {\arctan \left (\frac {-1+\frac {3 \left (-2 \sqrt {2} \sqrt {-2 \cos ^{4}x+3 \cos ^{2}x-1}+1\right )}{-4 \cos ^{2}x+3}}{2 \sqrt {2}}\right )}{\sqrt {2}}-\frac {\arcsin \left (4 \cos ^{2}x-3\right )}{2}\right ) \mathrm {sign}\left (\cos x\right )+\frac {\left (\mathrm {i} \sqrt {2} \ln \left (2 \mathrm {i} \sqrt {2}+3 \mathrm {i}\right )+2 \arctan \left (-\mathrm {i}\right )\right ) \mathrm {sign}\left (\cos x\right )}{2 \sqrt {2}}}{\mathrm {sign}\left (\sin \left (2 x\right )\right ) \mathrm {sign}\left (\cos x\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.03 \begin {gather*} \int \sqrt {\frac {\mathrm {cot}\left (2\,x\right )}{\mathrm {cot}\left (x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________