Optimal. Leaf size=15 \[ \frac {\tanh ^{-1}\left (\sqrt {2} \cos (x)\right )}{\sqrt {2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {4442, 213}
\begin {gather*} \frac {\tanh ^{-1}\left (\sqrt {2} \cos (x)\right )}{\sqrt {2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 213
Rule 4442
Rubi steps
\begin {align*} \int \sec (2 x) \sin (x) \, dx &=-\text {Subst}\left (\int \frac {1}{-1+2 x^2} \, dx,x,\cos (x)\right )\\ &=\frac {\tanh ^{-1}\left (\sqrt {2} \cos (x)\right )}{\sqrt {2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.26, size = 174, normalized size = 11.60 \begin {gather*} \frac {2 i \tan ^{-1}\left (\frac {\cos \left (\frac {x}{2}\right )-\left (-1+\sqrt {2}\right ) \sin \left (\frac {x}{2}\right )}{\left (1+\sqrt {2}\right ) \cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )}\right )-2 i \tan ^{-1}\left (\frac {\cos \left (\frac {x}{2}\right )-\left (1+\sqrt {2}\right ) \sin \left (\frac {x}{2}\right )}{\left (-1+\sqrt {2}\right ) \cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )}\right )+4 \tanh ^{-1}\left (\sqrt {2}+\tan \left (\frac {x}{2}\right )\right )-\log \left (2-\sqrt {2} \cos (x)-\sqrt {2} \sin (x)\right )+\log \left (2+\sqrt {2} \cos (x)-\sqrt {2} \sin (x)\right )}{4 \sqrt {2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 13, normalized size = 0.87
method | result | size |
default | \(\frac {\arctanh \left (\cos \left (x \right ) \sqrt {2}\right ) \sqrt {2}}{2}\) | \(13\) |
risch | \(\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}+\sqrt {2}\, {\mathrm e}^{i x}+1\right )}{4}-\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}-\sqrt {2}\, {\mathrm e}^{i x}+1\right )}{4}\) | \(47\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 129 vs.
\(2 (12) = 24\).
time = 1.53, size = 129, normalized size = 8.60 \begin {gather*} \frac {1}{8} \, \sqrt {2} \log \left (2 \, \sqrt {2} \sin \left (2 \, x\right ) \sin \left (x\right ) + 2 \, {\left (\sqrt {2} \cos \left (x\right ) + 1\right )} \cos \left (2 \, x\right ) + \cos \left (2 \, x\right )^{2} + 2 \, \cos \left (x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \sin \left (x\right )^{2} + 2 \, \sqrt {2} \cos \left (x\right ) + 1\right ) - \frac {1}{8} \, \sqrt {2} \log \left (-2 \, \sqrt {2} \sin \left (2 \, x\right ) \sin \left (x\right ) - 2 \, {\left (\sqrt {2} \cos \left (x\right ) - 1\right )} \cos \left (2 \, x\right ) + \cos \left (2 \, x\right )^{2} + 2 \, \cos \left (x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \sin \left (x\right )^{2} - 2 \, \sqrt {2} \cos \left (x\right ) + 1\right ) \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. 33 vs.
\(2 (12) = 24\).
time = 1.06, size = 33, normalized size = 2.20 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (-\frac {2 \, \cos \left (x\right )^{2} + 2 \, \sqrt {2} \cos \left (x\right ) + 1}{2 \, \cos \left (x\right )^{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 \frac {\sin {\left (x \right )}}{\cos {\left (2 x \right )}}\, dx \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. 49 vs.
\(2 (12) = 24\).
time = 0.78, size = 49, normalized size = 3.27 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (\frac {{\left | -4 \, \sqrt {2} - \frac {2 \, {\left (\cos \left (x\right ) - 1\right )}}{\cos \left (x\right ) + 1} - 6 \right |}}{{\left | 4 \, \sqrt {2} - \frac {2 \, {\left (\cos \left (x\right ) - 1\right )}}{\cos \left (x\right ) + 1} - 6 \right |}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.13, size = 12, normalized size = 0.80 \begin {gather*} \frac {\sqrt {2}\,\mathrm {atanh}\left (\sqrt {2}\,\cos \left (x\right )\right )}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________