Optimal. Leaf size=21 \[ -\frac {\tanh ^{-1}\left (\frac {\cos (x)-\sin (x)}{\sqrt {2}}\right )}{\sqrt {2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 21, 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 = {3153, 212}
\begin {gather*} -\frac {\tanh ^{-1}\left (\frac {\cos (x)-\sin (x)}{\sqrt {2}}\right )}{\sqrt {2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 3153
Rubi steps
\begin {align*} \int \frac {1}{\cos (x)+\sin (x)} \, dx &=-\text {Subst}\left (\int \frac {1}{2-x^2} \, dx,x,\cos (x)-\sin (x)\right )\\ &=-\frac {\tanh ^{-1}\left (\frac {\cos (x)-\sin (x)}{\sqrt {2}}\right )}{\sqrt {2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.02, size = 24, normalized size = 1.14 \begin {gather*} (-1-i) (-1)^{3/4} \tanh ^{-1}\left (\frac {-1+\tan \left (\frac {x}{2}\right )}{\sqrt {2}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 19, normalized size = 0.90
method | result | size |
default | \(\sqrt {2}\, \arctanh \left (\frac {\left (2 \tan \left (\frac {x}{2}\right )-2\right ) \sqrt {2}}{4}\right )\) | \(19\) |
risch | \(\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{i x}-\frac {\sqrt {2}}{2}+\frac {i \sqrt {2}}{2}\right )}{2}-\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{i x}+\frac {\sqrt {2}}{2}-\frac {i \sqrt {2}}{2}\right )}{2}\) | \(48\) |
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. 39 vs.
\(2 (18) = 36\).
time = 11.00, size = 39, normalized size = 1.86 \begin {gather*} -\frac {1}{2} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - \frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1}{\sqrt {2} + \frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - 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. 38 vs.
\(2 (18) = 36\).
time = 0.97, size = 38, normalized size = 1.81 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (\frac {2 \, {\left (\sqrt {2} - \cos \left (x\right )\right )} \sin \left (x\right ) - 2 \, \sqrt {2} \cos \left (x\right ) + 3}{2 \, \cos \left (x\right ) \sin \left (x\right ) + 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.21, size = 39, normalized size = 1.86 \begin {gather*} \frac {\sqrt {2} \log {\left (\tan {\left (\frac {x}{2} \right )} - 1 + \sqrt {2} \right )}}{2} - \frac {\sqrt {2} \log {\left (\tan {\left (\frac {x}{2} \right )} - \sqrt {2} - 1 \right )}}{2} \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. 37 vs.
\(2 (18) = 36\).
time = 0.48, size = 37, normalized size = 1.76 \begin {gather*} -\frac {1}{2} \, \sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 2 \, \tan \left (\frac {1}{2} \, x\right ) - 2 \right |}}{{\left | 2 \, \sqrt {2} + 2 \, \tan \left (\frac {1}{2} \, x\right ) - 2 \right |}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.33, size = 21, normalized size = 1.00 \begin {gather*} -\sqrt {2}\,\mathrm {atanh}\left (\frac {\sqrt {2}}{2}-\frac {\sqrt {2}\,\mathrm {tan}\left (\frac {x}{2}\right )}{2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________